63203 references to Debug
aspire (40)
Backchannel\ExtensionBackchannel.cs (2)
100Debug.Assert(endpoint is not null); 725Debug.Assert(!string.IsNullOrEmpty(serverCertificate));
Certificates\CertificateGeneration\CertificateManager.cs (1)
762Debug.Assert(pemEnvelope != null);
Certificates\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Certificates\CertificateGeneration\UnixCertificateManager.cs (1)
353Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Commands\ConfigCommand.cs (1)
61Debug.Assert(cmd.Description is not null);
Commands\PipelineCommandBase.cs (1)
594Debug.Assert(stepId != null, "Activity data should have a StepId for task activities.");
Commands\RunCommand.cs (1)
141Debug.Assert(_startDebugSessionOption is not null);
Interaction\ExtensionInteractionService.cs (21)
70Debug.Assert(result); 80Debug.Assert(result); 87Debug.Assert(result); 97Debug.Assert(result); 301Debug.Assert(result); 309Debug.Assert(result); 316Debug.Assert(result); 323Debug.Assert(result); 330Debug.Assert(result); 342Debug.Assert(result); 350Debug.Assert(result); 357Debug.Assert(result); 364Debug.Assert(result); 371Debug.Assert(result); 377Debug.Assert(result); 390Debug.Assert(result); 399Debug.Assert(result); 407Debug.Assert(result); 429Debug.Assert(result); 445Debug.Assert(result); 461Debug.Assert(result);
Mcp\McpResourceToolRefreshService.cs (1)
96Debug.Assert(resource.McpServer is not null);
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
src\Shared\ConsoleLogs\LogEntries.cs (4)
85Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 188Debug.Assert(BaseLineNumber != null, "Should be set before this method is run."); 193Debug.Assert(pause.EndTime is not null, "Pause should have ended before trying to insert another log."); 211Debug.Assert(BaseLineNumber is not null);
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
700Debug.Assert(totalValues >= values.Count, "Total values should be large or equal to the values passed into the method.");
src\Shared\Otlp\OtlpHelpers.cs (1)
108Debug.Assert(result, "Guid.TryFormat not successful.");
src\Shared\PathLookupHelper.cs (1)
37Debug.Assert(!string.IsNullOrWhiteSpace(command));
Telemetry\AspireCliTelemetry.cs (1)
168Debug.WriteLine("No reported activity found to record the error event.");
Aspire.Azure.AI.Inference (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.AI.OpenAI (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Data.Tables (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.EventHubs (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.ServiceBus (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Messaging.WebPubSub (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Npgsql (2)
AspireAzureNpgsqlExtensions.cs (2)
38Debug.Assert(azureSettings != null); 67Debug.Assert(azureSettings != null);
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (2)
AspireAzureEFPostgreSqlExtensions.cs (2)
59Debug.Assert(azureSettings != null); 84Debug.Assert(azureSettings != null);
Aspire.Azure.Search.Documents (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Security.KeyVault (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Blobs (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Files.DataLake (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Azure.Storage.Queues (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Confluent.Kafka (2)
KafkaConsumerSettings.cs (1)
50Debug.Assert(Config is not null);
KafkaProducerSettings.cs (1)
50Debug.Assert(Config is not null);
Aspire.Dashboard (60)
Components\Controls\Chart\ChartBase.cs (2)
490Debug.Assert(InstrumentViewModel.MatchedDimensions != null); 491Debug.Assert(InstrumentViewModel.Instrument != null);
Components\Controls\Chart\MetricTable.razor.cs (2)
47Debug.Assert(_jsModule != null, "The module should be initialized before chart data is sent to control."); 217Debug.Assert(exemplars.Count == newMetrics.Sum(m => m.Value.Exemplars.Count), $"Expected {exemplars.Count} exemplars but got {newMetrics.Sum(m => m.Value.Exemplars.Count)} exemplars.");
Components\Controls\Chart\PlotlyChart.razor.cs (1)
60Debug.Assert(_jsModule != null, "The module should be initialized before chart data is sent to control.");
Components\Controls\PropertyValues\ResourceNameButtonValue.razor.cs (1)
52Debug.Assert(_resource != null, "Should only get here if there is a matched resource.");
Components\Controls\ResourceDetails.razor.cs (1)
349Debug.Assert(_isMaskAllChecked != null);
Components\Dialogs\McpServerDialog.razor.cs (1)
104Debug.Assert(_mcpUrl != null);
Components\Interactions\InteractionsProvider.cs (2)
283Debug.Assert(currentDialogReference != null, "Dialog should have been created in UI thread."); 473Debug.Assert(message != null, "Message should have been created in UI thread.");
Components\Pages\ConsoleLogs.razor.cs (3)
248Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 346Debug.Assert(_resources is not null); 859Debug.Assert(removed, "Cannot remove unknown resource.");
Components\Pages\Resources.razor.cs (2)
301Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 336Debug.Assert(removed, "Cannot remove unknown resource.");
Components\Pages\TraceDetail.razor.cs (2)
188Debug.Assert(_spanWaterfallViewModels != null); 418Debug.Assert(_layout is not null);
Configuration\DashboardOptions.cs (6)
105Debug.Assert(_primaryApiKeyBytes is not null, "Should have been parsed during validation."); 174Debug.Assert(_primaryApiKeyBytes is not null, "Should have been parsed during validation."); 234Debug.Assert(_primaryApiKeyBytes is not null, "Should have been parsed during validation."); 301Debug.Assert(_parsedEndpointAddresses is not null, "Should have been parsed during validation."); 401Debug.Assert(_nameClaimTypes is not null, "Should have been parsed during validation."); 407Debug.Assert(_usernameClaimTypes is not null, "Should have been parsed during validation.");
DashboardWebApplication.cs (2)
950Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures)); 956Debug.Assert(_validationFailures.Count == 0, "Validation failures: " + Environment.NewLine + string.Join(Environment.NewLine, _validationFailures));
Model\Assistant\AssistantChatViewModel.cs (7)
587Debug.Assert(_currentAssistantResponse != null); 688Debug.Assert(_currentAssistantResponse != null); 781Debug.Assert(Monitor.IsEntered(_lock)); 805Debug.Assert(_currentAssistantResponse != null); 806Debug.Assert(Monitor.IsEntered(_lock)); 817Debug.Assert(_currentAssistantResponse != null); 818Debug.Assert(Monitor.IsEntered(_lock));
Model\Assistant\ChatClientFactory.cs (1)
91Debug.Assert(_endpoint is not null && _credential is not null && _httpClient is not null);
Model\ConsoleLogsManager.cs (1)
40Debug.Assert(_filters != null, "There should be filters if manager has been initialized.");
Model\PauseManager.cs (2)
62Debug.Assert(intervals.Length > 0, "There should be at least one interval."); 64Debug.Assert(lastInterval.End is null, "The last interval should not have an end time if unpausing.");
Model\ResourceOutgoingPeerResolver.cs (2)
43Debug.Assert(added, "Should not receive duplicate resources in initial snapshot data."); 70Debug.Assert(removed, "Cannot remove unknown resource.");
Model\ResourceViewModel.cs (2)
206Debug.Assert(x != null); 207Debug.Assert(y != null);
Model\ThemeManager.cs (1)
98Debug.Assert(_effectiveTheme != null, "There should be an effective theme if theme manager has been initialized.");
Otlp\Storage\TelemetryRepository.cs (4)
996Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetTraceUnsynchronized)}."); 1011Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetTraceAndCloneUnsynchronized)}."); 1020Debug.Assert(_tracesLock.IsReadLockHeld || _tracesLock.IsWriteLockHeld, $"Must get lock before calling {nameof(GetSpanAndCloneUnsynchronized)}."); 1255Debug.Assert(_traces.Contains(trace), "Trace not found in traces collection.");
ServiceClient\DashboardClient.cs (4)
179Debug.Assert( 191Debug.Assert( 349Debug.Assert(Monitor.IsEntered(_lock), "Caller must hold _lock."); 413Debug.Fail("Attempt to remove an unknown resource view model.");
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
src\Shared\ConsoleLogs\LogEntries.cs (4)
85Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 188Debug.Assert(BaseLineNumber != null, "Should be set before this method is run."); 193Debug.Assert(pause.EndTime is not null, "Pause should have ended before trying to insert another log."); 211Debug.Assert(BaseLineNumber is not null);
src\Shared\ConsoleLogs\SharedAIHelpers.cs (1)
700Debug.Assert(totalValues >= values.Count, "Total values should be large or equal to the values passed into the method.");
src\Shared\Otlp\OtlpHelpers.cs (1)
108Debug.Assert(result, "Guid.TryFormat not successful.");
Telemetry\DashboardTelemetrySender.cs (2)
43Debug.Assert(Client is not null, "HttpClient must be initialized."); 92Debug.Assert(State == TelemetrySessionState.Uninitialized, "Telemetry session has already been started.");
Aspire.Hosting (39)
ApplicationModel\ResourceLoggerService.cs (4)
449Debug.Assert(_backlog.EntriesCount == 0, "The backlog should be empty if there are no subscribers."); 488Debug.Assert(Monitor.IsEntered(_lock)); 499Debug.Assert(Monitor.IsEntered(_lock)); 514Debug.Assert(Monitor.IsEntered(_lock));
ApplicationModel\UserSecretsParameterDefault.cs (1)
31Debug.WriteLine($"Failed to set value for parameter '{parameterName}' in application '{applicationName}' to user secrets.");
Dashboard\DashboardEventHandlers.cs (3)
66Debug.Assert(executionContext.IsRunMode, "Dashboard resource should only be added in run mode"); 546Debug.Assert(options.DashboardUrl is not null, "DashboardUrl should not be null"); 547Debug.Assert(options.OtlpGrpcEndpointUrl is not null || options.OtlpHttpEndpointUrl is not null, "OtlpGrpcEndpointUrl and OtlpHttpEndpointUrl should not both be null");
Dcp\DcpExecutor.cs (3)
147Debug.Assert(_dcpInfo is not null, "DCP info should not be null at this point"); 411Debug.Assert(!entry.LogsAvailable.HasValue || entry.LogsAvailable.Value, "entry.LogsAvailable should never be 'false'"); 2481Debug.Assert(ea.IsProxied);
Dcp\OtlpEndpointReferenceGatherer.cs (3)
52Debug.Fail("Dashboard does not have any endpoints??"); 68Debug.Assert(endpointReference != null, "Dashboard should have at least one matching OTLP endpoint"); 74Debug.Assert(url is not null, $"We should be able to get a URL value from the reference dashboard endpoint '{endpointReference.EndpointName}'");
Exec\ExecResourceManager.cs (2)
237Debug.Assert(command[0] == '"' && command[^1] == '"'); 267Debug.Assert(command[0] == '"' && command[^1] == '"');
ExternalServiceBuilderExtensions.cs (2)
78Debug.Assert(uri is not null || urlParameter is not null, "Either uri or urlParameter must be provided."); 145Debug.Assert(uri is not null, "URI must be set at this point.");
IInteractionService.cs (1)
160Debug.Assert(Monitor.IsEntered(_lock));
InteractionService.cs (1)
273Debug.Assert(
Orchestrator\ApplicationOrchestrator.cs (2)
189Debug.Assert(context.DcpResourceName is not null, "Container that is starting should always include the DCP name."); 227Debug.Assert(endpoint.AllocatedEndpoint is not null, "Endpoint should be allocated at this point as we're calling this from ResourceEndpointsAllocatedEvent handler.");
Pipelines\Internal\DeploymentStateManagerBase.cs (2)
206Debug.Assert(_state is not null); 226Debug.Assert(_state is not null);
ProjectResourceBuilderExtensions.cs (1)
1010Debug.Assert(!e.EndpointAnnotation.FromLaunchProfile, "Endpoints from launch profile should never make it here");
src\Shared\CircularBuffer.cs (2)
129Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed."); 202Debug.Assert(!_buffer.Contains(removedItem), "Item was not correctly removed.");
src\Shared\CompareHelpers.cs (1)
30Debug.Assert(encodedByteCount == requestBytesSpan.Length, "Should match because span was previously trimmed to byte count value.");
src\Shared\ConsoleLogs\LogEntries.cs (4)
85Debug.Assert(logLine.Timestamp == null || logLine.Timestamp.Value.Kind == DateTimeKind.Utc, "Timestamp should always be UTC."); 188Debug.Assert(BaseLineNumber != null, "Should be set before this method is run."); 193Debug.Assert(pause.EndTime is not null, "Pause should have ended before trying to insert another log."); 211Debug.Assert(BaseLineNumber is not null);
src\Shared\PasswordGenerator.cs (1)
80Debug.Assert(destination.Length >= minValues);
src\Shared\PathLookupHelper.cs (1)
37Debug.Assert(!string.IsNullOrWhiteSpace(command));
UserSecrets\NoopUserSecretsManager.cs (3)
29Debug.WriteLine($"User secrets are not enabled. Cannot set secret '{name}'."); 35Debug.WriteLine($"User secrets are not enabled. Generating and adding secret '{name}' to configuration in-memory."); 42Debug.WriteLine("User secrets are not enabled. Cannot save state.");
UserSecrets\UserSecretsManagerFactory.cs (1)
132Debug.WriteLine($"Failed to save value to application user secrets.");
VersionChecking\VersionCheckService.cs (1)
85Debug.Assert(_appHostVersion != null);
Aspire.Hosting.Analyzers (1)
Infrastructure\WellKnownTypes.cs (1)
43Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Aspire.Hosting.Azure (2)
AzureProvisioningResource.cs (1)
92Debug.Assert(compilation.Count == 1);
src\Shared\PathLookupHelper.cs (1)
37Debug.Assert(!string.IsNullOrWhiteSpace(command));
Aspire.Hosting.Azure.AppContainers (3)
AzureContainerAppExtensions.cs (3)
263Debug.Assert(resourceToken is not null); 300Debug.Assert(resourceToken is not null); 323Debug.Assert(resourceToken is not null);
Aspire.Hosting.Azure.CosmosDB (2)
AzureCosmosDBResource.cs (1)
197Debug.Assert(!UseAccessKeyAuthentication, "AddRoleAssignments should not be called when using AccessKeyAuthentication");
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
Aspire.Hosting.Azure.PostgreSQL (1)
AzurePostgresFlexibleServerResource.cs (1)
274Debug.Assert(!UsePasswordAuthentication, "AddRoleAssignments should not be called when using UsePasswordAuthentication");
Aspire.Hosting.Azure.Redis (2)
AzureManagedRedisResource.cs (1)
203Debug.Assert(!UseAccessKeyAuthentication, "AddRoleAssignments should not be called when using AccessKeyAuthentication");
AzureRedisCacheResource.cs (1)
137Debug.Assert(!UseAccessKeyAuthentication, "AddRoleAssignments should not be called when using AccessKeyAuthentication");
Aspire.Hosting.Integration.Analyzers (1)
src\Aspire.Hosting.Analyzers\Infrastructure\WellKnownTypes.cs (1)
43Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Aspire.Hosting.RemoteHost (2)
Ats\AtsCallbackProxyFactory.cs (1)
374Debug.Assert(originalArgs.Length == argTypes.Length, "originalArgs and argTypes must have the same length");
AtsCapabilityScanner.cs (1)
2700System.Diagnostics.Debug.WriteLine($"Failed to load XML documentation for {location}: {ex.Message}");
Aspire.Microsoft.Azure.Cosmos (1)
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
src\Shared\Cosmos\CosmosUtils.cs (1)
76Debug.Assert(accountEndpoint is not null ^ connectionString is not null, "only one should be set.");
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration (1)
src\Components\Common\AzureComponent.cs (1)
66Debug.Assert(settings is IConnectionStringSettings, $"The settings object should implement {nameof(IConnectionStringSettings)}.");
Aspire.Playground.Tests (2)
src\Shared\PasswordGenerator.cs (1)
80Debug.Assert(destination.Length >= minValues);
src\Shared\PathLookupHelper.cs (1)
37Debug.Assert(!string.IsNullOrWhiteSpace(command));
Aspire.RabbitMQ.Client (5)
src\Components\Aspire.RabbitMQ.Client\RabbitMQEventSourceLogForwarder.cs (5)
48Debug.Assert( 103Debug.Assert(EventData.PayloadNames?.Count == 2 && EventData.Payload?.Count == 2); 104Debug.Assert(EventData.PayloadNames[0] == "message"); 105Debug.Assert(EventData.PayloadNames[1] == "ex"); 111Debug.Assert(exData is not null && exData.Count == 4);
Aspire.TestUtilities (1)
src\Shared\PathLookupHelper.cs (1)
37Debug.Assert(!string.IsNullOrWhiteSpace(command));
CodeStyleConfigFileGenerator (5)
Program.cs (3)
49Debug.Assert(language is "CSharp" or "VisualBasic"); 122Debug.Assert(sortedRulesById.Count > 0); 160Debug.Assert(rule.CustomTags.Any(c => c == s_neverTag || c == s_whenExplicitlyEnabledTag || c == s_recommendedTag || c == s_highlyRecommendedTag),
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
ConfigurationSchemaGenerator (31)
ConfigurationBindingGenerator.ForSchemaGeneration.cs (2)
66Debug.Assert(_typesToParse.Count == 1, "there should only be one type to parse to start."); 86Debug.Assert(result is not null);
RuntimeSource\Configuration.Binder\ConfigurationBindingGenerator.Parser.cs (8)
83Debug.Assert(invocation is not null); 86Debug.Assert(targetMethod.IsExtensionMethod); 139Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 195Debug.Assert(spec is ArraySpec or UnsupportedTypeSpec); 370Debug.Assert(spec is DictionarySpec or UnsupportedTypeSpec); 375Debug.Assert(spec is EnumerableSpec or UnsupportedTypeSpec); 657Debug.Assert(initExceptionMessage is not null); 692Debug.Assert(ctor is not null);
RuntimeSource\Configuration.Binder\Parser\BinderInvocation.cs (1)
25Debug.Assert(IsCandidateSyntaxNode(context.Node));
RuntimeSource\Configuration.Binder\Parser\ConfigurationBinder.cs (2)
258Debug.Assert((MethodsToGen.ConfigBinder_Any & overload) is not 0); 270Debug.Assert((MethodsToGen.ConfigBinder_Get & overload) is not 0 ||
RuntimeSource\Configuration.Binder\Parser\OptionsBuilderConfigurationExtensions.cs (4)
30Debug.Assert(typeSymbol?.IsValueType is not true); 49Debug.Assert(paramCount >= 2); 76Debug.Assert(paramCount >= 2); 89Debug.Assert((MethodsToGen.OptionsBuilderExt_Any & overload) is not 0);
RuntimeSource\Configuration.Binder\Parser\OptionsConfigurationServiceCollectionExtensions.cs (3)
68Debug.Assert(paramCount is 4); 74Debug.Assert(typeSymbol?.IsValueType is not true); 92Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0);
RuntimeSource\Configuration.Binder\Specs\BindingHelperInfo.cs (1)
175Debug.Assert(registeredForBindCore);
RuntimeSource\Configuration.Binder\Specs\InterceptorInfo.cs (6)
31Debug.Assert((MethodsToGen.ConfigBinder_Bind & interceptor) is 0); 44Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & interceptor) is not 0); 65Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is not 0); 91Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is 0); 103Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 171Debug.Assert(BinderInvocation.IsBindingOperation(invocation));
RuntimeSource\Configuration.Binder\Specs\Members\MemberSpec.cs (1)
14Debug.Assert(member is IPropertySymbol or IParameterSymbol);
RuntimeSource\Configuration.Binder\Specs\TypeIndex.cs (3)
82Debug.Assert(castType is not CollectionPopulationCastType.NotApplicable); 110Debug.Assert(type.StringParsableTypeKind is not StringParsableTypeKind.AssignFromSectionValue); 125Debug.Assert(displayString.Length > 0);
crossgen2 (9)
Program.cs (1)
616System.Diagnostics.Debug.Assert(inputModules.Count == 1);
src\runtime\src\coreclr\tools\Common\InstructionSetHelpers.cs (8)
138Debug.Assert((cpuidInfo.Edx & (1 << 15)) != 0); // CMOV 265Debug.Assert(InstructionSet.X64_AVX == InstructionSet.X86_AVX); 266Debug.Assert(InstructionSet.X64_AVX2 == InstructionSet.X86_AVX2); 286Debug.Assert(InstructionSet.X64_AVX512 == InstructionSet.X86_AVX512); 322Debug.Assert(InstructionSet.X86_AVX512 == InstructionSet.X64_AVX512); 325Debug.Assert(InstructionSet.X86_Vector256 == InstructionSet.X64_Vector256); 326Debug.Assert(InstructionSet.X86_VectorT256 == InstructionSet.X64_VectorT256); 327Debug.Assert(InstructionSet.X86_VectorT512 == InstructionSet.X64_VectorT512);
csc (12)
src\roslyn\src\Compilers\Shared\BuildClient.cs (4)
155Debug.Assert(serverResult.Value.RanOnServer); 238Debug.Assert(buildResponse != null); 273Debug.Assert(false); 353Debug.Assert(PlatformInformation.IsWindows);
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
73Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 85Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server"); 506Debug.Assert(reason is object);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
79Debug.Assert(workingDirectory is object); 199Debug.Assert(pipeName is object); 833Debug.Assert(Stream is null); 871Debug.Assert(Stream is not null);
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
CSharpSyntaxGenerator (7)
SourceWriter.cs (1)
1640System.Diagnostics.Debug.Assert(!IsRequiredFactoryField(nd, field));
src\roslyn\src\Compilers\CSharp\Portable\Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1247Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
dotnet (84)
CommandInvocation.cs (1)
29Debug.Assert(parseResult.CanBeInvoked());
Commands\DotNetCommandFactory.cs (2)
29Debug.Assert(framework == null, "BuiltInCommand doesn't support the 'framework' argument."); 30Debug.Assert(configuration == Constants.DefaultConfiguration, "BuiltInCommand doesn't support the 'configuration' argument.");
Commands\Package\Add\PackageAddCommand.cs (2)
31Debug.Assert(isFileBasedApp || allowedAppKinds.HasFlag(AppKinds.ProjectBased)); 36Debug.Assert(!isFileBasedApp);
Commands\Package\List\PackageListCommand.cs (1)
28Debug.Assert(isFileBasedApp || allowedAppKinds.HasFlag(AppKinds.ProjectBased));
Commands\Package\Remove\PackageRemoveCommand.cs (2)
35Debug.Assert(isFileBasedApp || allowedAppKinds.HasFlag(AppKinds.ProjectBased)); 40Debug.Assert(!isFileBasedApp);
Commands\Package\VirtualProjectPackageReflector.cs (1)
31Debug.Assert(!string.IsNullOrEmpty(item.Include), "Expected only PackageReference Include items in virtual project.");
Commands\Project\Convert\ProjectConvertCommand.cs (1)
488Debug.Assert(project.ExpandedName != null && project.ProjectFilePath != null && project.ProjectFilePath == project.Name);
Commands\Run\CSharpCompilerCommand.cs (2)
334Debug.Assert(!optionName.StartsWith('/') && optionName.EndsWith(':')); 350Debug.Assert(!string.IsNullOrWhiteSpace(result));
Commands\Run\FileBasedAppRunPlan.cs (4)
227Debug.Assert(cache.PreviousEntry != null); 252Debug.Assert(cacheEntry.ImplicitBuildFiles.Count != 0); 392Debug.Assert(entryPointFileDirectory != null); 435Debug.Assert(!cache.TriedDeserializingPreviousEntry);
Commands\Run\FileBasedAppSourceEditor.cs (3)
38Debug.Assert(!field.IsDefault); 160Debug.Assert(!trivia.IsKind(SyntaxKind.SingleLineCommentTrivia), 262Debug.Assert(startBeforeWhiteSpace > 0);
Commands\Run\RunCommand.cs (12)
124Debug.Assert(projectFileFullPath is null ^ entryPointFileFullPath is null); 125Debug.Assert(!readCodeFromStdin || entryPointFileFullPath is not null); 193Debug.Assert(!ReadCodeFromStdin); 342Debug.Assert(EntryPointFileFullPath is not null); 436Debug.Assert(ProjectFileFullPath is not null); 480Debug.Assert(EntryPointFileFullPath != null); 535Debug.Assert(EntryPointFileFullPath is not null); 700Debug.Assert(projectFileOrDirectoryPath == null); 859Debug.Assert(projectFilePath is null && entryPointFilePath is "-"); 883Debug.Assert(nonLoggerArgs[0] == "-"); 1045Debug.Assert(EntryPointFileFullPath != null); 1084Debug.Assert(ProjectFileFullPath != null);
Commands\Run\RunFileBuildCacheEntry.cs (1)
85Debug.Assert(globalProperties.Comparer == GlobalPropertiesComparer);
Commands\Run\VirtualProjectBuildingCommand.cs (10)
73Debug.Assert(!field.IsDefault); 128Debug.Assert(!NoRestore); 160Debug.Assert(cache is not null); 191Debug.Assert(result != 0); 198Debug.Assert(buildLevel is BuildLevel.All or BuildLevel.Csc); 278Debug.Assert(buildRequest.ProjectInstance != null); 430Debug.Assert(cache.CurrentEntry.AdditionalSources.Count == 0); 486Debug.Assert(cache.CurrentEntry.AdditionalSources.Count == 0); 489Debug.Assert(entryPointFileDirectory != null); 586Debug.Assert(buildOrRestoreResult != null);
Commands\Solution\Add\SolutionAddCommand.cs (2)
96Debug.Assert(relativeSolutionFolderPath is not null); 132Debug.Assert(solution.SerializerExtension is not null);
Commands\Test\MTP\IPC\Serializers\AzureDevOpsLogMessageSerializer.cs (1)
68Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\CommandLineOptionMessagesSerializer.cs (1)
125Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\DiscoveredTestMessagesSerializer.cs (1)
251Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\DisplayMessageSerializer.cs (1)
86Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\FileArtifactMessagesSerializer.cs (1)
157Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\HandshakeMessageSerializer.cs (1)
29Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\TestInProgressMessagesSerializer.cs (1)
117Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\TestResultMessagesSerializer.cs (1)
348Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\IPC\Serializers\TestSessionEventSerializer.cs (1)
68Debug.Assert(stream.CanSeek, "We expect a seekable stream.");
Commands\Test\MTP\Models.cs (2)
44Debug.Assert(Module is not null); 89Debug.Assert(_group.Module is not null);
Commands\Test\MTP\SolutionAndProjectUtility.cs (1)
178Debug.Assert(projectFilePath is not null);
Commands\Test\MTP\Terminal\FileUtilities.cs (1)
33Debug.Fail("Casing test failed: " + exc);
Commands\Test\MTP\TestResultsDirectoryResolver.cs (1)
119Debug.Assert(IsUnderRoot(resolved, resultsRoot), $"'{resolved}' escaped the results directory '{resultsRoot}'.");
Commands\Test\VSTest\TestCommand.cs (1)
75Debug.Assert(settings[0] == "--", "Settings should start with --");
Commands\Tool\Install\ToolInstallGlobalOrToolPathCommand.cs (2)
146Debug.Assert(_store != null); 160Debug.Assert(_packageIdentityWithRange.HasValue);
Commands\Tool\Install\ToolInstallLocalCommand.cs (1)
93Debug.Assert(_packageIdentityWithRange != null);
ReleasePropertyProjectLocator.cs (1)
51Debug.Assert(propertyToCheck == MSBuildPropertyNames.PUBLISH_RELEASE || propertyToCheck == MSBuildPropertyNames.PACK_RELEASE, "Only PackRelease or PublishRelease are currently expected.");
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26415.116\contentFiles\cs\net11.0\BuildProtocol.cs (3)
73Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 85Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server"); 506Debug.Assert(reason is object);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26415.116\contentFiles\cs\net11.0\BuildServerConnection.cs (4)
79Debug.Assert(workingDirectory is object); 199Debug.Assert(pipeName is object); 833Debug.Assert(Stream is null); 871Debug.Assert(Stream is not null);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26415.116\contentFiles\cs\net11.0\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
src\sdk\artifacts\.packages\microsoft.codeanalysis.buildclient\5.11.0-1.26415.116\contentFiles\cs\net11.0\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
Telemetry\ExternalTelemetryProperties.cs (4)
36Debug.Assert(e is ArgumentException | e is SecurityException | e is InvalidCastException); 68Debug.Assert(false, $"Unexpected exception from GetProductInfo: ${e.GetType().Name}: ${e.Message}"); 99Debug.Assert(e is DllNotFoundException || e is EntryPointNotFoundException); 123Debug.Assert(e is DllNotFoundException || e is EntryPointNotFoundException);
Telemetry\TelemetryClient.cs (1)
364Debug.Fail(e.ToString());
dotnet-aot (18)
NativeEntryPoint.cs (4)
159Debug.WriteLine($"Failed to initialize telemetry in the native entry point: {ex}"); 204Debug.WriteLine($"First-run setup failed in the AOT entry point; deferring to the managed CLI: {ex}"); 329Debug.WriteLine($"AOT external command resolution failed; falling back to managed CLI: {ex}"); 421Debug.WriteLine($"Failed to emit AOT parser telemetry: {ex}");
SdkRootLocator.cs (1)
74Debug.Assert(
src\sdk\src\Cli\dotnet\CommandInvocation.cs (1)
29Debug.Assert(parseResult.CanBeInvoked());
src\sdk\src\Cli\dotnet\Commands\DotNetCommandFactory.cs (2)
29Debug.Assert(framework == null, "BuiltInCommand doesn't support the 'framework' argument."); 30Debug.Assert(configuration == Constants.DefaultConfiguration, "BuiltInCommand doesn't support the 'configuration' argument.");
src\sdk\src\Cli\dotnet\Commands\Run\FileBasedAppRunPlan.cs (4)
227Debug.Assert(cache.PreviousEntry != null); 252Debug.Assert(cacheEntry.ImplicitBuildFiles.Count != 0); 392Debug.Assert(entryPointFileDirectory != null); 435Debug.Assert(!cache.TriedDeserializingPreviousEntry);
src\sdk\src\Cli\dotnet\Commands\Run\RunFileBuildCacheEntry.cs (1)
85Debug.Assert(globalProperties.Comparer == GlobalPropertiesComparer);
src\sdk\src\Cli\dotnet\Telemetry\ExternalTelemetryProperties.cs (4)
36Debug.Assert(e is ArgumentException | e is SecurityException | e is InvalidCastException); 68Debug.Assert(false, $"Unexpected exception from GetProductInfo: ${e.GetType().Name}: ${e.Message}"); 99Debug.Assert(e is DllNotFoundException || e is EntryPointNotFoundException); 123Debug.Assert(e is DllNotFoundException || e is EntryPointNotFoundException);
src\sdk\src\Cli\dotnet\Telemetry\TelemetryClient.cs (1)
364Debug.Fail(e.ToString());
dotnet-dev-certs (3)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
765Debug.Assert(pemEnvelope != null);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
91Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
354Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
dotnet-format (4)
Analyzers\AnalyzerRunner.cs (1)
109Debug.Assert(referencedProject is not null);
CodeFormatter.cs (3)
174Debug.Assert((formatOptions.WorkspaceType is WorkspaceType.Project) == (projectId is not null)); 240Debug.WriteLine($"Including generated file '{document.FilePath}'."); 265Debug.WriteLine($"Including source generated file '{generatedDocument.FilePath}'.");
dotnet-sourcelink (1)
dotnet-svcutil-lib (1435)
Bootstrapper\SvcutilBootstrapper.cs (3)
67Debug.Fail($"The NoBootstrapping property is not set, this would cause infinite bootstrapping recursion!"); 73Debug.Fail("Bootstrapping is enabled for the bootstrapper! This would cause an infinite bootstrapping recursion!"); 111Debug.Assert(frameworkInfo.IsDnx, "The bootstrapper has been enabled for a non-DNX platform!");
CmdCredentialsProvider.cs (2)
188System.Diagnostics.Debug.Assert(_serviceUri == null, "provider already started for the specified service URI"); 199System.Diagnostics.Debug.Assert(_serviceUri == serviceUri, "provider not statrted for the specified service URI");
CodeDomFixup\CodeDomVisitors\AttributeFixer.cs (1)
43System.Diagnostics.Debug.Assert(generator != null);
CodeDomFixup\CodeDomVisitors\CreateCallbackImpl.cs (2)
234System.Diagnostics.Debug.Assert(!methodNames.ContainsKey(method.Name), $"Key '{method.Name}' already added to dictionary!"); 452System.Diagnostics.Debug.Assert((IsSyncOperationContract(method)), "Only support sync callback on immersive project");
CodeDomFixup\CodeDomVisitors\SpecialIXmlSerializableRemapper.cs (1)
101System.Diagnostics.Debug.Assert(!_specialIXmlSerializableTypes.ContainsKey(typeName), $"Key '{typeName}' already added to dictionary!");
CodeDomFixup\CodeDomVisitors\TypeDeclCollection.cs (1)
45System.Diagnostics.Debug.Assert(!AllTypeDecls.ContainsKey(fullName), $"Key '{fullName}' already added to dictionary!");
CodeDomFixup\EndpointSelector.cs (1)
274System.Diagnostics.Debug.Assert(singleSignedEncryptedParam, "Unexpected number of SignedEncrypted token parameters in transport security binding!");
CodeDomFixup\MethodCreationHelper.cs (1)
2172System.Diagnostics.Debug.Assert(endpointNames.Count == 1, "have and only have on endpoint has to exist for a given client type");
CommandLineParser.cs (1)
59System.Diagnostics.Debug.Assert(!s_allSwitches.Any(s => s.Equals(this)), $"A switch with name or abbreviation '{name}+{abbreviation}' has already been crated!");
CommandProcessorOptions.cs (3)
323Debug.Assert(this.ToolContext.HasValue, $"{nameof(ToolContext)} is not initialized!"); 324Debug.Assert(this.Verbosity.HasValue, $"{nameof(Verbosity)} is not initialized!"); 700Debug.Assert(this.BootstrapPath != null, $"{nameof(this.BootstrapPath)} is not initialized!");
FrameworkFork\Microsoft.CodeDom\Compiler\CompilerInfo.cs (1)
75Debug.Assert(_providerOptions != null, "Created CompilerInfo w/ null _providerOptions");
FrameworkFork\Microsoft.CodeDom\Compiler\IndentTextWriter.cs (1)
95Debug.Assert(value >= 0, "Bogus Indent... probably caused by mismatched Indent++ and Indent--");
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (1)
3269Debug.Assert(names.Length > 0);
FrameworkFork\Microsoft.CodeDom\Microsoft\VBCodeProvider.cs (7)
370Debug.Assert(IsKeyword("for")); 371Debug.Assert(IsKeyword("foR")); 372Debug.Assert(IsKeyword("cdec")); 373Debug.Assert(!IsKeyword("cdab")); 374Debug.Assert(!IsKeyword("cdum")); 2858Debug.Assert(names.Length > 0); 3175Debug.Assert(_statementDepth >= 0, "statementDepth >= 0");
FrameworkFork\Microsoft.CodeDom\System\CodeTypeReference.cs (1)
265Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
FrameworkFork\Microsoft.CodeDom\System\FixedStringLookup.cs (2)
48Debug.Assert(value.Length == i + 1, "Lookup table contains an item in the wrong subtable. Item name: " + value); 51Debug.Assert(string.Compare(lastValue, value, ((ignoreCase) ? StringComparison.OrdinalIgnoreCase : StringComparison.Ordinal)) < 0,
FrameworkFork\Microsoft.Xml\Xml\Base64Decoder.cs (7)
128Debug.Assert(buffer != null); 129Debug.Assert(count >= 0); 130Debug.Assert(index >= 0); 131Debug.Assert(buffer.Length - index >= count); 132Debug.Assert((buffer as byte[]) != null); 162Debug.Assert(pCharsEndPos - pChars >= 0); 163Debug.Assert(pBytesEndPos - pBytes >= 0);
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (24)
143Debug.Assert(rguiData.Length == 4); 168Debug.Assert(rgulU.Length == s_cNumeMax); 175Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!"); 176Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero"); 177Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array"); 313Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_lInt32Base", ""); 338Debug.Assert(dwlAccum < s_ulInt32Base); 357Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_dwlBaseUI4", "Integer overflow"); 407Debug.Assert(dwlAccum < dwlDivisor); 409Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 433Debug.Assert(dwlAccum < s_ulInt32Base); 452Debug.Assert(bPrec <= s_maxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision"); 458Debug.Assert(uiDigit < 10); 572Debug.Assert(m_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid"); 573Debug.Assert(m_bScale <= m_bPrec, "m_bScale <= m_bPrec", "In AssertValid"); 574Debug.Assert(m_bScale >= 0, "m_bScale >= 0", "In AssertValid"); 575Debug.Assert(m_bPrec > 0, "m_bPrec > 0", "In AssertValid"); 576Debug.Assert(CLenFromPrec(m_bPrec) >= m_bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid"); 577Debug.Assert(m_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid"); 584Debug.Assert(m_bLen == 1, "m_bLen == 1", "In AssertValid"); 589Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid"); 644Debug.Assert(val >= 0 && val < 100); 650Debug.Assert(val > -10000 && val < 10000); 662Debug.Assert(val >= 0 && val < 1000);
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\XmlBinaryReader.cs (29)
388Debug.Assert(len >= 2 && (data[0] == 0xdf && data[1] == 0xff)); 830Debug.Fail("Unexpected parent NodeType"); 925Debug.Assert(decl != null); 1135Debug.Fail("should never happen"); 1225Debug.Fail("should never happen"); 1320Debug.Fail("should never happen"); 1415Debug.Fail("should never happen"); 1510Debug.Fail("should never happen"); 1605Debug.Fail("should never happen"); 1700Debug.Fail("should never happen"); 2015Debug.Assert(_mark <= _end, "Mark should never be past End"); 2016Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2036Debug.Assert((_attributes[i].contentPos >= 0) && (_attributes[i].contentPos <= (end))); 2044Debug.Assert(_attrCount == 0); 2062Debug.Assert((_pos + require) >= _end); 2102Debug.Assert(0 != (b & 0x80)); 2335Debug.Assert(pos >= 0 && cch >= 0); 2352Debug.Assert((offset & 1) == 0); 2772Debug.Assert(_stringValue == null, "this.stringValue == null"); 2773Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 2971Debug.Assert(_mark < 0); 3096Debug.Assert(_pos >= 3); 3101Debug.Assert(_pos >= 1); 3107Debug.Assert(_pos >= 2); 3505Debug.Assert(_checkCharacters, "this.checkCharacters"); 3507Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd"); 3567Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3570Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd"); 4481System.Diagnostics.Debug.WriteLine("Unhandled token: " + token.ToString());
FrameworkFork\Microsoft.Xml\Xml\BinHexDecoder.cs (7)
123Debug.Assert(buffer != null); 124Debug.Assert(count >= 0); 125Debug.Assert(index >= 0); 126Debug.Assert(buffer.Length - index >= count); 127Debug.Assert((buffer as byte[]) != null); 189Debug.Assert(pCharsEndPos - pChars >= 0); 190Debug.Assert(pBytesEndPos - pBytes >= 0);
FrameworkFork\Microsoft.Xml\Xml\BitStack.cs (2)
51Debug.Assert(_curr != 0x1, "Stack empty"); 72Debug.Assert(_curr != 0x1, "Stack empty");
FrameworkFork\Microsoft.Xml\Xml\BufferBuilder.cs (3)
433Debug.Assert(_lastBuffer == null); 481Debug.Assert(_buffers != null); 532Debug.Assert(newLength <= _length);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (22)
148Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); 209Debug.Assert(_pageParent[_idxParent].NodeType == XPathNodeType.Element); 283Debug.Assert(!prefix.Equals("xmlns")); 284Debug.Assert(_idxParent == 0 || _pageParent[_idxParent].NodeType == XPathNodeType.Element); 285Debug.Assert(_idxSibling == 0 || _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 302Debug.Assert(_pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 313Debug.Assert(_idxParent != 0, "ID attribute must have an element parent"); 475Debug.Assert(_pageParent[_idxParent].NodeType == XPathNodeType.Element); 486Debug.Assert(_idxSibling == 0 || _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 487Debug.Assert(!prefix.Equals("xmlns") && !namespaceName.Equals(XmlReservedNs.NsXmlNs)); 488Debug.Assert(_idxParent == 0 || _idxNmsp != 0); 489Debug.Assert(_idxParent == 0 || _pageParent[_idxParent].NodeType == XPathNodeType.Element); 543Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 622Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 652Debug.Assert(xptyp != XPathNodeType.Namespace); 695Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 723Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 739Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 759Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 760Debug.Assert(_idxSibling == 0 || !_pageSibling[_idxSibling].IsText, "Cannot create adjacent text nodes."); 889Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 890Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentNavigator.cs (10)
40Debug.Assert(pageCurrent != null && idxCurrent != 0); 41Debug.Assert((pageParent == null) == (idxParent == 0)); 87Debug.Assert(false, "ReadStringValue() should have taken care of these node types."); 91Debug.Assert(_idxParent != 0 && _pageParent[_idxParent].HasCollapsedText, 100Debug.Assert(_pageCurrent[_idxCurrent].NodeType == XPathNodeType.Text); 119Debug.Assert(page[idx].NodeType == XPathNodeType.Element || page[idx].IsText); 453Debug.Assert(_pageParent != null); 494Debug.Assert(page[idx].NodeType == XPathNodeType.Element); 690Debug.Assert(page[idx].HasCollapsedText); 698Debug.Assert(page[idx].IsText);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNode.cs (13)
158Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 213Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 225Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 363Debug.Assert(info != null && idxParent <= UInt16.MaxValue); 374Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, "Line number offset too large or small: " + lineNumOffset); 375Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, "Line position offset too large or small: " + linePosOffset); 385Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, "Collapsed text line position offset too large or small: " + posOffset); 402Debug.Assert(NodeType == XPathNodeType.Element); 413Debug.Assert(NodeType == XPathNodeType.Element); 441Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= UInt16.MaxValue, "Bad argument"); 442Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 460Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= UInt16.MaxValue, "Bad argument"); 461Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (32)
30Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 74Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 79Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 93Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 113Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 123Debug.Assert(idx != 0); 141Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 164Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 182Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 183Debug.Assert(idxNode <= UInt16.MaxValue); 184Debug.Assert(pageNode[0].PageInfo.PageNumber <= Int16.MaxValue); 197Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 203Debug.Assert(idx != 0); 231Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 264Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 302Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 315Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 334Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 335Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 371Debug.Assert(idxAnc != 0 && pageAnc != null); 397Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 427Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 454Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 516Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 613Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 614Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 615Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 652Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 671Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 672Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 749Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 750Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeInfoAtom.cs (4)
125Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 286Debug.Assert(that != null); 287Debug.Assert((object)_doc == (object)that._doc); 288Debug.Assert(_pageInfo == null);
FrameworkFork\Microsoft.Xml\Xml\Core\CharEntityEncoderFallback.cs (2)
165Debug.Assert(_charEntityIndex < _charEntity.Length); 180Debug.Assert(_charEntityIndex <= _charEntity.Length);
FrameworkFork\Microsoft.Xml\Xml\Core\HtmlEncodedRawTextWriter.cs (20)
79Debug.Assert(name != null && name.Length > 0); 126Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 132Debug.Assert(prefix.Length == 0); 171Debug.Assert(prefix.Length == 0); 196Debug.Assert(prefix.Length == 0); 316Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 320Debug.Assert(prefix.Length == 0); 383Debug.Assert(target != null && target.Length != 0 && text != null); 405Debug.Assert(text != null); 440Debug.Assert(buffer != null); 441Debug.Assert(index >= 0); 442Debug.Assert(count >= 0 && index + count <= buffer.Length); 465Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 466Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 467Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 602Debug.Assert(pSrc <= pSrcEnd); 690Debug.Assert(pSrc <= pSrcEnd); 858Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 866Debug.Assert(prefix.Length == 0); 922Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null);
FrameworkFork\Microsoft.Xml\Xml\Core\HtmlUtf8RawTextWriter.cs (20)
78Debug.Assert(name != null && name.Length > 0); 125Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 131Debug.Assert(prefix.Length == 0); 170Debug.Assert(prefix.Length == 0); 195Debug.Assert(prefix.Length == 0); 315Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 319Debug.Assert(prefix.Length == 0); 382Debug.Assert(target != null && target.Length != 0 && text != null); 404Debug.Assert(text != null); 439Debug.Assert(buffer != null); 440Debug.Assert(index >= 0); 441Debug.Assert(count >= 0 && index + count <= buffer.Length); 464Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 465Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 466Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 599Debug.Assert(pSrc <= pSrcEnd); 687Debug.Assert(pSrc <= pSrcEnd); 854Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null); 862Debug.Assert(prefix.Length == 0); 918Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null);
FrameworkFork\Microsoft.Xml\Xml\Core\IncrementalReadDecoders.cs (15)
70Debug.Assert(chars != null); 71Debug.Assert(len >= 0); 72Debug.Assert(startPos >= 0); 73Debug.Assert(chars.Length - startPos >= len); 75Debug.Assert(len > 0); 90Debug.Assert(str != null); 91Debug.Assert(len >= 0); 92Debug.Assert(startPos >= 0); 93Debug.Assert(str.Length - startPos >= len); 95Debug.Assert(len > 0); 114Debug.Assert(buffer != null); 115Debug.Assert(count >= 0); 116Debug.Assert(index >= 0); 117Debug.Assert(buffer.Length - index >= count); 119Debug.Assert((buffer as char[]) != null);
FrameworkFork\Microsoft.Xml\Xml\Core\QueryOutputWriter.cs (2)
137Debug.Assert(!_outputDocType); 350Debug.Assert(!_inCDataSection);
FrameworkFork\Microsoft.Xml\Xml\Core\QueryOutputWriterV1.cs (2)
134Debug.Assert(!_outputDocType); 313Debug.Assert(!_inCDataSection);
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelper.cs (11)
110Debug.Assert(false); 114Debug.Assert(_state == State.InReadContent); 166Debug.Assert(false); 170Debug.Assert(_state == State.InReadContent); 222Debug.Assert(false); 226Debug.Assert(_state == State.InReadElementContent); 278Debug.Assert(false); 282Debug.Assert(_state == State.InReadElementContent); 333Debug.Assert(_reader.NodeType == XmlNodeType.Element); 387Debug.Assert(_decoder != null); 412Debug.Assert(_valueOffset == _valueChunkLength);
FrameworkFork\Microsoft.Xml\Xml\Core\ReadContentAsBinaryHelperAsync.cs (11)
60Debug.Assert(false); 64Debug.Assert(_state == State.InReadContent); 116Debug.Assert(false); 120Debug.Assert(_state == State.InReadContent); 172Debug.Assert(false); 176Debug.Assert(_state == State.InReadElementContent); 228Debug.Assert(false); 232Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 304Debug.Assert(_decoder != null); 329Debug.Assert(_valueOffset == _valueChunkLength);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlAsyncCheckReader.cs (3)
43Debug.Assert(!(reader is IXmlSchemaInfo)); 50Debug.Assert(!(reader is IXmlSchemaInfo)); 55Debug.Assert(!(reader is IXmlSchemaInfo));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlAutoDetectWriter.cs (6)
35Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect); 107Debug.Assert(_wrapped != null); 310Debug.Assert(_wrapped != null); 316Debug.Assert(_wrapped != null); 322Debug.Assert(_wrapped != null); 414Debug.Assert(_wrapped == null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingReader.cs (3)
58Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 200Debug.Assert(false); 685Debug.Assert(readerAsNSResolver != null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingReaderAsync.cs (1)
51Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlCharCheckingWriter.cs (1)
65Debug.Assert(checkValues || replaceNewLines);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEncodedRawTextWriter.cs (45)
136Debug.Assert(writer != null && settings != null); 154Debug.Assert(stream != null && settings != null); 263Debug.Assert(name != null && name.Length > 0); 304Debug.Assert(localName != null && localName.Length > 0); 305Debug.Assert(prefix != null); 336Debug.Assert(localName != null && localName.Length > 0); 337Debug.Assert(prefix != null); 368Debug.Assert(localName != null && localName.Length > 0); 369Debug.Assert(prefix != null); 388Debug.Assert(localName != null && localName.Length > 0); 389Debug.Assert(prefix != null); 421Debug.Assert(prefix != null && namespaceName != null); 438Debug.Assert(prefix != null); 474Debug.Assert(text != null); 481Debug.Assert(bufPos >= 4); 511Debug.Assert(text != null); 530Debug.Assert(name != null && name.Length > 0); 531Debug.Assert(text != null); 552Debug.Assert(name != null && name.Length > 0); 599Debug.Assert(ws != null); 620Debug.Assert(text != null); 656Debug.Assert(buffer != null); 657Debug.Assert(index >= 0); 658Debug.Assert(count >= 0 && index + count <= buffer.Length); 680Debug.Assert(buffer != null); 681Debug.Assert(index >= 0); 682Debug.Assert(count >= 0 && index + count <= buffer.Length); 698Debug.Assert(data != null); 796Debug.Assert(stream != null || writer != null); 816Debug.Assert(_textContentMarks[0] == 1); 878Debug.Assert(bufPos == 1); 917Debug.Assert(pSrc <= pSrcEnd); 1023Debug.Assert(pSrc <= pSrcEnd); 1106Debug.Assert(s != null); 1136Debug.Assert(pSrc <= pSrcEnd); 1183Debug.Assert(pSrc <= pSrcEnd); 1285Debug.Assert(pSrc <= pSrcEnd); 1418Debug.Assert(pSrc <= pSrcEnd); 1508Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1534Debug.Assert(!xmlCharType.IsWhiteSpace((char)ch)); 1535Debug.Assert(!xmlCharType.IsAttributeValueChar((char)ch)); 1566Debug.Assert(inTextContent != value); 1567Debug.Assert(inTextContent || ((_lastMarkPos & 1) == 0)); 1578Debug.Assert(_lastMarkPos + 1 == _textContentMarks.Length); 1845Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlEventCache.cs (5)
128Debug.Assert(idxPage + 1 == _pages.Count); 248Debug.Assert(false, "Unknown event: " + page[idxEvent].EventType); 254Debug.Assert(false, "Unknown event should be added to end of event sequence."); 286Debug.Assert(idxPage + 1 == _pages.Count); 311Debug.Assert(false, "Unknown event should be added to end of event sequence.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReader.cs (59)
1066Debug.Assert(parentDepth == 0); 1090Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error); 1112Debug.Assert(parentDepth == 0); 1137Debug.Assert(NodeType == XmlNodeType.EndElement); 1260Debug.Assert(xtw is XmlTextWriter); 1442Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.None))); 1443Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Element))); 1444Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute))); 1445Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Text))); 1446Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA))); 1447Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference))); 1448Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Entity))); 1449Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1450Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Comment))); 1451Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Document))); 1452Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType))); 1453Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1454Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Notation))); 1455Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace))); 1456Debug.Assert(0 != (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1457Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement))); 1458Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity))); 1459Debug.Assert(0 == (s_isTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1469Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.None))); 1470Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Element))); 1471Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute))); 1472Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Text))); 1473Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA))); 1474Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference))); 1475Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Entity))); 1476Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1477Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Comment))); 1478Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Document))); 1479Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType))); 1480Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1481Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Notation))); 1482Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace))); 1483Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1484Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement))); 1485Debug.Assert(0 != (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity))); 1486Debug.Assert(0 == (s_canReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1496Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.None))); 1497Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Element))); 1498Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Attribute))); 1499Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Text))); 1500Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.CDATA))); 1501Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EntityReference))); 1502Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Entity))); 1503Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1504Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Comment))); 1505Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Document))); 1506Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentType))); 1507Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1508Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.Notation))); 1509Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.Whitespace))); 1510Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1511Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndElement))); 1512Debug.Assert(0 == (s_hasValueBitmap & (1 << (int)XmlNodeType.EndEntity))); 1513Debug.Assert(0 != (s_hasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlReaderAsync.cs (1)
233Debug.Assert(xtw is XmlTextWriter);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReader.cs (49)
426Debug.Assert(reader.NodeType == XmlNodeType.Element); 451Debug.Assert(_curNode.type == XmlNodeType.Attribute); 473Debug.Assert(reader.Depth >= _initialDepth); 483Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 527Debug.Assert(false); 544Debug.Assert(reader.Depth >= _initialDepth); 581Debug.Assert(reader.Depth >= _initialDepth); 595Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 610Debug.Assert(reader.Depth >= _initialDepth); 646Debug.Assert(false); 867Debug.Assert(AttributeCount > 0); 870Debug.Assert(false); 893Debug.Assert(false); 950Debug.Assert(false); 1003Debug.Assert(AttributeCount > 0); 1006Debug.Assert(false); 1029Debug.Assert(false); 1085Debug.Assert(false); 1144Debug.Assert(false); 1319Debug.Assert(_state == State.ClearNsAttributes || _state == State.Interactive || _state == State.PopNamespaceScope); 1347Debug.Assert(index >= 0 && index <= _nsAttrCount); 1380Debug.Assert(_state == State.Interactive); 1387Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 1421Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex); 1451Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Initial))); 1452Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.Interactive))); 1453Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Error))); 1454Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.EndOfFile))); 1455Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Closed))); 1456Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.PopNamespaceScope))); 1457Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.ClearNsAttributes))); 1458Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1459Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1460Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBase64))); 1461Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1472Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Initial))); 1473Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.Interactive))); 1474Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Error))); 1475Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.EndOfFile))); 1476Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Closed))); 1477Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.PopNamespaceScope))); 1478Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ClearNsAttributes))); 1479Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1480Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1481Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBase64))); 1482Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1490Debug.Assert(_tmpNode.localName == string.Empty && _tmpNode.prefix == string.Empty && _tmpNode.name == string.Empty && _tmpNode.namespaceUri == string.Empty); 1533Debug.Assert(false); 1541Debug.Assert(_state == State.Interactive ||
FrameworkFork\Microsoft.Xml\Xml\Core\XmlSubtreeReaderAsync.cs (19)
47Debug.Assert(reader.Depth >= _initialDepth); 57Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 101Debug.Assert(false); 118Debug.Assert(reader.Depth >= _initialDepth); 132Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 147Debug.Assert(reader.Depth >= _initialDepth); 183Debug.Assert(false); 284Debug.Assert(AttributeCount > 0); 287Debug.Assert(false); 310Debug.Assert(false); 367Debug.Assert(false); 420Debug.Assert(AttributeCount > 0); 423Debug.Assert(false); 446Debug.Assert(false); 502Debug.Assert(false); 553Debug.Assert(false); 584Debug.Assert(_state == State.Interactive); 591Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 625Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextEncoder.cs (2)
233Debug.Assert((ch < 0x20 && !_xmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 392Debug.Assert((ch < 0x20 && !_xmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (200)
323Debug.Assert(nt != null); 343Debug.Assert(_index == 0); 387Debug.Assert(_nameTableFromSettings == false); 408Debug.Assert(_index == 0); 457Debug.Assert(false); 621Debug.Assert(baseUri == null); 714Debug.Assert(baseUri == null); 774Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 822Debug.Assert(xmlFragment != null); 848default: Debug.Assert(false); goto case XmlNodeType.None; 1218Debug.Assert(false, "Invalid InitInputType"); 1242Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1245Debug.Assert(!_ps.appendMode); 1273Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1278Debug.Assert(_curNode.type == XmlNodeType.Element); 1342Debug.Assert(false); 1370Debug.Assert(false); 1402Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1403Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1505Debug.Assert(_parsingMode == ParsingMode.Full); 1524Debug.Assert(false); 1550Debug.Assert(false); 1566Debug.Assert(value is XmlTextReader); 1585Debug.Assert(_outerReader is XmlTextReaderImpl); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2076Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2104Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2109Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2128Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2133Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2185Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2226Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2228Debug.Assert(_stringBuilder.Length == 0); 2268Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2269Debug.Assert(_outerReader is XmlTextReader); 2310Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2311Debug.Assert(_outerReader is XmlTextReader); 2347Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 2348Debug.Assert(_outerReader is XmlTextReader); 2479Debug.Assert(value >= 0 && value <= _ps.charsUsed); 2566Debug.Assert(_parsingMode == ParsingMode.Full); 2655Debug.Assert(_parsingStatesStackTop == -1); 2656Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 2671Debug.Assert(_ps.appendMode); 2687Debug.Assert(_parsingStatesStackTop == -1); 2688Debug.Assert(internalDtd != null); 2845Debug.Assert(InAttributeValueIterator); 2881Debug.Assert(baseUriStr != null); 2887Debug.Assert(baseUri != null); 2898Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 2899Debug.Assert(baseUriStr != null); 2900Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 2991Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 2992Debug.Assert(baseUriStr != null); 3022Debug.Assert(_ps.stream == null && _ps.textReader == null); 3023Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0); 3024Debug.Assert(baseUriStr != null); 3025Debug.Assert(str != null); 3080Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3084Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3085Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 3109Debug.Assert(context != null && context.HasDtdInfo); 3123Debug.Assert(false, "Unhandled DtdProcessing enumeration value."); 3133Debug.Assert(_url != null && _url.Length > 0); 3140Debug.Assert(_xmlResolver != null || !Microsoft.Xml.XmlReaderSettings.EnableLegacyXmlSettings()); 3166Debug.Assert(_ps.bytes != null); 3167Debug.Assert(_ps.bytePos == 0); 3251Debug.Assert(_ps.charPos == 0); 3279Debug.Assert(_ps.stream != null); 3337Debug.Assert(newEncoding.EncodingName != "UTF-8"); 3351Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3352Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3354Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3362Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3370Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 3533Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3543Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3544Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3568Debug.Assert(maxCharsCount >= charsCount); 3587Debug.Assert(false, "We should get an exception again."); 3660Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3881Debug.Assert(!isTextDecl); 3891Debug.Assert(false); 4147Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 4171Debug.Assert(_index == 0); 4545Debug.Assert(_curNode.type == XmlNodeType.Element); 4724Debug.Assert(false, "We should never get to this point."); 4733Debug.Assert(_index > 0); 4738Debug.Assert(_curNode == startTagNode); 4765Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4777Debug.Assert(_attrCount == 0); 4837Debug.Assert(_curNode.type == XmlNodeType.Element); 4845Debug.Assert(_curNode.type == XmlNodeType.Element); 4966Debug.Assert(attrNameLineNo == _ps.LineNo); 5015Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 5090Debug.Assert(_curNode.type == XmlNodeType.Element); 5227Debug.Assert(_stringBuilder.Length == 0); 5438Debug.Assert(false, "We should never get to this point."); 5441Debug.Assert(_ps.isEof); 5459Debug.Assert(false); 5499Debug.Assert(attr.nextAttrValueChunk == null); 5528Debug.Assert(_stringBuilder.Length == 0); 5542Debug.Assert(endPos - startPos > 0); 5565Debug.Assert(_stringBuilder.Length > 0); 5586Debug.Assert(endPos - startPos > 0); 5853Debug.Assert(_ps.isEof); 5895Debug.Assert(_stringBuilder.Length == 0); 5896Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 5910Debug.Assert(_stringBuilder.Length > 0); 5964Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 5976Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 5981Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5993Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 5998Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 6026Debug.Assert(_stringBuilder.Length == 0); 6067Debug.Assert(_ps.chars[_ps.charPos] == '&'); 6076Debug.Assert(_ps.chars[_ps.charPos] == '&'); 6091Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 6243Debug.Assert(false); 6284Debug.Assert(_lastEntity != null); 6290Debug.Assert(_curNode.depth == _index); 6303Debug.Assert(_curNode.type == XmlNodeType.EntityReference); 6304Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName)); 6323Debug.Assert(_stringBuilder.Length == 0); 6349Debug.Assert(_ps.charPos < _ps.charsUsed); 6393Debug.Assert(_stringBuilder.Length == 0); 6451Debug.Assert(!_ps.eolNormalized); 6598Debug.Assert(_stringBuilder.Length == 0); 6659Debug.Assert(!_ps.eolNormalized); 6838Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 7166Debug.Assert(false, "We should never get to this point."); 7169Debug.Assert(_ps.isEof); 7272Debug.Assert(false, "We should never get to this point."); 7275Debug.Assert(_ps.isEof); 7284Debug.Assert(_ps.chars[startPos] == '&'); 7316Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7336Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7449Debug.Assert(pos > 0); 7485Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7505Debug.Assert(startPos < _ps.charsUsed); 7506Debug.Assert(_ps.chars[startPos] == '&'); 7507Debug.Assert(_ps.chars[startPos + 1] != '#'); 7615Debug.Assert(pos > 0); 7771Debug.Assert(nodeIndex < _nodes.Length); 7772Debug.Assert(_nodes[_nodes.Length - 1] == null); 7785Debug.Assert(nodeIndex < _nodes.Length); 7792Debug.Assert(nodeIndex < _nodes.Length); 7865Debug.Assert(attr.type == XmlNodeType.Attribute); 7899Debug.Assert(_ps.isEof); 7960Debug.Assert(_xmlContext.defaultNamespace == uri); 7996Debug.Assert(_curNode.xmlContextPushed); 8093Debug.Assert(_xmlResolver != null); 8110Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 8131Debug.Assert(entity.IsExternal); 8144Debug.Assert(_ps.appendMode); 8173Debug.Assert(!entity.IsExternal); 8243Debug.Assert(_parsingStatesStackTop == -1); 8259Debug.Assert(_parsingStatesStackTop >= 0); 8360Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 2, 2, "?>")); 8368Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 3, 3, "-->")); 8376Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 3, 3, "]]>")); 8400Debug.Assert(false); 8403Debug.Assert(_incReadState == IncrementalReadState.Text || 8515Debug.Assert(_ps.charPos - pos == 0); 8516Debug.Assert(_ps.charPos - startPos == 0); 8555Debug.Assert(_ps.charPos - pos == 0); 8556Debug.Assert(_ps.charPos - startPos == 0); 8653Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8670Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8676Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8693Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8720Debug.Assert(_stringBuilder.Length == 0); 8734Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 8788Debug.Assert(false, "We should never get to this point."); 8843Debug.Assert(false, "We should never get to this point."); 8931Debug.Assert(_ps.charPos < _ps.charsUsed); 9000Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 9016Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 9042Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9043Debug.Assert(_curNode.type == XmlNodeType.Element); 9121Debug.Assert(context != null); 9142Debug.Assert(nt != null); 9143Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9159Debug.Assert(_nameTableFromSettings == false); 9187Debug.Assert(_dtdInfo == null); 9246Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!"); 9348Debug.Assert(attr != null); 9373Debug.Assert(prefix != null); 9394Debug.Assert(attr != null); 9426Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9444Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9478Debug.Assert(_incReadDecoder != null); 9587Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9646Debug.Assert(characters >= 0); 9688Debug.Assert(startPos >= 0); 9689Debug.Assert(endPos < chars.Length); 9690Debug.Assert(startPos <= endPos); 9700Debug.Assert(startPos >= 0); 9701Debug.Assert(endPos < str.Length); 9702Debug.Assert(startPos <= endPos);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImplHelpers.cs (19)
293Debug.Assert(internalDtd != null); 435Debug.Assert(type == XmlNodeType.Element); 448Debug.Assert(type == XmlNodeType.Attribute); 465Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready."); 518Debug.Assert(value != null); 544Debug.Assert(localName != null); 545Debug.Assert(localName.Length > 0); 574Debug.Assert(_valueStartPos != -1); 575Debug.Assert(_chars != null); 585Debug.Assert(_valueStartPos != -1); 586Debug.Assert(_chars != null); 606Debug.Assert(_valueStartPos != -1); 607Debug.Assert(_chars != null); 632Debug.Assert(_valueStartPos != -1); 633Debug.Assert(_chars != null); 673Debug.Assert(nameWPrefix == null); 708Debug.Assert(false, "We should never get to this point."); 730Debug.Assert(x == null || x is NodeData || x is IDtdDefaultAttributeInfo); 731Debug.Assert(y == null || y is NodeData || y is IDtdDefaultAttributeInfo);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextWriter.cs (5)
973Debug.Assert(false); 1423Debug.Assert(declared == true, "Unexpected situation!!"); 1433Debug.Assert(false, "Should have never come here"); 1509Debug.Assert(_useNsHashtable); 1512Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix));
FrameworkFork\Microsoft.Xml\Xml\Core\XmlUtf8RawTextWriter.cs (40)
120Debug.Assert(stream != null && settings != null); 215Debug.Assert(name != null && name.Length > 0); 254Debug.Assert(localName != null && localName.Length > 0); 255Debug.Assert(prefix != null); 284Debug.Assert(localName != null && localName.Length > 0); 285Debug.Assert(prefix != null); 314Debug.Assert(localName != null && localName.Length > 0); 315Debug.Assert(prefix != null); 332Debug.Assert(localName != null && localName.Length > 0); 333Debug.Assert(prefix != null); 362Debug.Assert(prefix != null && namespaceName != null); 379Debug.Assert(prefix != null); 411Debug.Assert(text != null); 416Debug.Assert(bufPos >= 4); 446Debug.Assert(text != null); 463Debug.Assert(name != null && name.Length > 0); 464Debug.Assert(text != null); 483Debug.Assert(name != null && name.Length > 0); 526Debug.Assert(ws != null); 546Debug.Assert(text != null); 580Debug.Assert(buffer != null); 581Debug.Assert(index >= 0); 582Debug.Assert(count >= 0 && index + count <= buffer.Length); 602Debug.Assert(buffer != null); 603Debug.Assert(index >= 0); 604Debug.Assert(count >= 0 && index + count <= buffer.Length); 618Debug.Assert(data != null); 688Debug.Assert(stream != null); 752Debug.Assert(pSrc <= pSrcEnd); 858Debug.Assert(pSrc <= pSrcEnd); 941Debug.Assert(s != null); 971Debug.Assert(pSrc <= pSrcEnd); 1018Debug.Assert(pSrc <= pSrcEnd); 1120Debug.Assert(pSrc <= pSrcEnd); 1253Debug.Assert(pSrc <= pSrcEnd); 1350Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1382Debug.Assert(!xmlCharType.IsWhiteSpace((char)ch)); 1383Debug.Assert(!xmlCharType.IsAttributeValueChar((char)ch)); 1421Debug.Assert(ch >= 0x80 && !XmlCharType.IsSurrogate(ch)); 1720Debug.Assert(localName != null && localName.Length != 0 && prefix != null && ns != null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlValidatingReaderImpl.cs (5)
581Debug.Assert(false); 747Debug.Assert(value is XmlValidatingReader); 1010Debug.Assert(_parserContext != null); 1011Debug.Assert(_coreReaderImpl.DtdInfo == null); 1049Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriter.cs (18)
254Debug.Assert(writer != null); 255Debug.Assert(settings != null); 256Debug.Assert(MaxNamespacesWalkCount <= 3); 314Debug.Assert(false, "Expected currentState <= State.Error "); 484Debug.Assert(prefix.Length == 0); 1346Debug.Assert(i >= 0); 1357Debug.Assert(i >= 0); 1634Debug.Assert(false, "State.Attribute == currentState || State.RootLevelAttr == currentState"); 1681Debug.Assert(_stateTable == s_stateTableAuto); 1725Debug.Assert(prefix == "xmlns"); 1913Debug.Assert(_useNsHashtable); 1914Debug.Assert(indexFrom <= indexTo); 1917Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 2061Debug.Assert(false, "We should not get to this point."); 2091Debug.Assert(false, "We should never get to this point. State = " + state); 2144Debug.Assert(ncname != null && ncname.Length > 0); 2249Debug.Assert(_attrHashTable.Count == 0); 2291Debug.Assert(prev >= 0 && _attrStack[prev].localName == localName);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWellformedWriterHelpers.cs (4)
100Debug.Assert(kind == NamespaceKind.NeedToWrite); 386Debug.Assert(false, "Unexpected ItemType value."); 499Debug.Assert(_singleStringValue != null); 500Debug.Assert(_lastItem == -1);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWrappingReader.cs (1)
30Debug.Assert(baseReader != null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWrappingWriter.cs (1)
61Debug.Assert(baseWriter != null);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriter.cs (1)
539Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\Core\XmlWriterSettings.cs (5)
330Debug.Assert(_cdataSections != null); 502Debug.Assert(Encoding.UTF8.WebName == "utf-8"); 535Debug.Assert(false, "Invalid XmlOutputMethod setting."); 571Debug.Assert(false, "Invalid XmlOutputMethod setting."); 632Debug.Assert(false, "Invalid XmlOutputMethod setting.");
FrameworkFork\Microsoft.Xml\Xml\Core\XsdCachingReader.cs (8)
495Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 500Debug.Assert(endElementNode.NodeType == XmlNodeType.EndElement); 508Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 573Debug.Assert(_cacheState == CachingReaderState.Replay); 603Debug.Assert(_cacheState == CachingReaderState.Replay); 664Debug.Assert(attIndex <= _attributeEvents.Length); 688Debug.Assert(_contentIndex <= _contentEvents.Length); 714Debug.Assert(_coreReader.NodeType == XmlNodeType.Element);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdCachingReaderAsync.cs (1)
133Debug.Assert(_cacheState == CachingReaderState.Replay);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReader.cs (17)
1148Debug.Assert(attNode != null); 1199Debug.Assert(_attributePSVI != null); 1304Debug.Assert(moveTo); 1896Debug.Assert(_attributePSVI != null); 2035Debug.Assert(_atomicValue != null); 2123Debug.Assert(_coreReaderNameTable.Get(localName) != null); 2124Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2165Debug.Assert(_coreReaderNameTable.Get(attrLocalName) != null); 2166Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2186Debug.Assert(attIndex <= _attributePSVINodes.Length); 2215Debug.Assert(_inlineSchemaParser != null); 2323Debug.Assert(this.NodeType == XmlNodeType.Element); 2450Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement); 2461Debug.Assert(false); //Should not happen as the caching reader does not cache elements in simple content 2514Debug.Assert(false); //Should not happen as the caching reader does not cache elements in simple content 2572Debug.Assert(xmlType != null && xmlType.Datatype != null); 2586Debug.Assert(NodeType != XmlNodeType.Attribute);
FrameworkFork\Microsoft.Xml\Xml\Core\XsdValidatingReaderAsync.cs (3)
611Debug.Assert(_atomicValue != null); 627Debug.Assert(_inlineSchemaParser != null); 750Debug.Assert(this.NodeType == XmlNodeType.Element);
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentSchemaValidator.cs (16)
73Debug.Assert(schemas != null && schemas.Count > 0); 95Debug.Assert(nodeToValidate.SchemaInfo != null); 121Debug.Assert(schemaElement.ElementSchemaType == schemaInfo.SchemaType); 346Debug.Assert(elementNode != null); 360Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 361Debug.Assert(_nameTable.Get(attr.LocalName) != null); 444Debug.Assert(schemaAttribute != null); 461Debug.Assert(_attributeSchemaInfo != null); 473Debug.Assert(simpleValue != null); 510Debug.Assert(elementToValidate.ParentNode.NodeType != XmlNodeType.Document); //Handle if it is the documentElement seperately 635Debug.Assert(_nodeSequenceToValidate[0] == elementToValidate.ParentNode); 702Debug.Assert(elementNode != null); 716Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 717Debug.Assert(_nameTable.Get(attr.LocalName) != null); 783Debug.Assert(child == childToStopAt); 816Debug.Assert(ex != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentXmlWriter.cs (3)
427Debug.Assert(elem != null); 432Debug.Assert(attr != null); 443Debug.Assert(attr != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\DocumentXPathNavigator.cs (33)
530Debug.Assert(false); 538Debug.Assert(attributes != null); 558Debug.Assert(attributes != null && attributes.parent != null); 590Debug.Assert(_namespaceParent != null); 644Debug.Assert(false); 652Debug.Assert(attributes != null); 653Debug.Assert(0 <= index && index < attributes.Count); 673Debug.Assert(attributes != null && attributes.parent != null); 735Debug.Assert(parent != null); 771Debug.Assert(parent != null); 799Debug.Assert(sibling != null); 1324Debug.Assert(node1 != null); 1325Debug.Assert(node2 != null); 1326Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1328Debug.Assert(OwnerNode(node1) == OwnerNode(node2)); 1410Debug.Assert(node1 != node2); 1451Debug.Assert(node1 != node2); 1471Debug.Assert(this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All); 1861Debug.Assert(node != null, "Undefined navigator position"); 1862Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents"); 2281Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2294Debug.Assert(node != null); 2335Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2336Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2350Debug.Assert(node != null); 2351Debug.Assert(node.NodeType == XmlNodeType.Element); 2393Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2394Debug.Assert(Ref.Equal(nav.NameTable.Get(localNameAtom), localNameAtom)); 2395Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2396Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_NoLocalName class for special magic value of localNameAtom 2415Debug.Assert(node != null); 2416Debug.Assert(node.NodeType == XmlNodeType.Element); 2426Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName if localName == String.Empty
FrameworkFork\Microsoft.Xml\Xml\Dom\DomNameTable.cs (1)
30Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlAttribute.cs (3)
21Debug.Assert(name != null); 22Debug.Assert(doc != null); 54Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlAttributeCollection.cs (10)
191Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 220Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 297Debug.Assert(retNode is XmlAttribute); 313Debug.Assert(retNode is XmlAttribute); 377Debug.Assert(parentElem != null); 379Debug.Assert(doc != null); 393Debug.Assert(parentElem != null); 395Debug.Assert(doc != null); 408Debug.Assert(-1 == FindNodeOffset(node)); 411Debug.Assert(retNode is XmlAttribute);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlCDATASection.cs (1)
74Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlCharacterData.cs (1)
202Debug.Assert(XmlDocument.IsTextNode(node.NodeType) || (node.ParentNode != null && node.ParentNode.NodeType == XmlNodeType.EntityReference));
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlComment.cs (1)
40Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlDeclaration.cs (1)
152Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlDocument.cs (12)
141Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 142Debug.Assert(n.LocalName == localName); 143Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 150Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 151Debug.Assert(n == null || n.LocalName == localName); 152Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 159Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 160Debug.Assert(xmlName.LocalName == localName); 161Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 912Debug.Assert(((XmlAttribute)node).Specified); 977Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1723Debug.Assert(doc == this);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlDocumentFragment.cs (3)
113Debug.Assert(OwnerDocument != null); 159Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call 175Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlDocumentType.cs (2)
34Debug.Assert(doc != null); 65Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlElement.cs (5)
25Debug.Assert(name != null); 55Debug.Assert(OwnerDocument != null); 478Debug.Assert(n != null); 491Debug.Assert(n != null); 497Debug.Assert(n != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlElementList.cs (11)
31Debug.Assert(parent != null); 32Debug.Assert(parent.NodeType == XmlNodeType.Element || parent.NodeType == XmlNodeType.Document); 34Debug.Assert(parent.Document != null); 72Debug.Assert(parent.Document != null); 74Debug.Assert(nt != null); 83Debug.Assert(parent.Document != null); 85Debug.Assert(nt != null); 107Debug.Assert(curNode != null); 134Debug.Assert(curNode != null); 179Debug.Assert(n != null); 193Debug.Assert(n != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlEntityReference.cs (1)
87Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlLoader.cs (18)
61Debug.Assert(_reader != null); 62Debug.Assert(parentDoc != null); 154Debug.Assert(parent.NodeType == XmlNodeType.Element); 176Debug.Assert(parent == null); 231Debug.Assert(node != null); 256Debug.Assert(_reader.NodeType == XmlNodeType.Attribute); 295Debug.Assert(node != null); 304Debug.Assert(_reader.IsDefault); 354Debug.Assert(node != null); 362Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference); 385Debug.Assert(_reader.NodeType == XmlNodeType.XmlDeclaration); 408Debug.Assert(false); 423Debug.Assert(_reader.NodeType == XmlNodeType.DocumentType); 498Debug.Assert(parent.NodeType == XmlNodeType.Element); 552Debug.Assert(node != null); 756Debug.Assert(parentNode.NodeType != XmlNodeType.Document); 758Debug.Assert(_doc != null); 948Debug.Assert(tr.EntityHandling == EntityHandling.ExpandCharEntities);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlName.cs (2)
92Debug.Assert(_prefix != null); 115Debug.Assert(Ref.Equal(_name, ownerDoc.NameTable.Get(_name)));
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlNode.cs (9)
42Debug.Assert(doc != null); 115Debug.Assert(parentNode != null); 172Debug.Assert(parentNode != null); 777Debug.Assert(firstNode.NodeType == XmlNodeType.Text 795Debug.Assert(true, "shouldn't have fall through here."); 1407Debug.Assert(prevNode.IsText); 1408Debug.Assert(nextNode.IsText); 1415Debug.Assert(prevNode.IsText); 1416Debug.Assert(nextNode.IsText);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlNodeReader.cs (11)
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 136Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 232Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 233Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 252Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 253Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 618Debug.Assert(IsOnDeclOrDocType); 1061Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 1091Debug.Assert(_curNode != null); 1639Debug.Assert(_curDepth == 0);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlProcessingInstruction.cs (1)
90Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlSignificantWhitespace.cs (1)
75Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlText.cs (1)
77Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Dom\XmlWhitespace.cs (1)
91Debug.Assert(OwnerDocument != null);
FrameworkFork\Microsoft.Xml\Xml\Ref.cs (1)
21Debug.Assert(false, "Ref.Equal: Object comparison used for non-atomized string '" + strA + "'");
FrameworkFork\Microsoft.Xml\Xml\Resolvers\XmlPreloadedResolver.cs (2)
214Debug.Assert(s_rss091_Dtd.Length == 1); 361Debug.Assert(uri != null);
FrameworkFork\Microsoft.Xml\Xml\schema\BaseProcessor.cs (2)
29Debug.Assert(nameTable != null); 160Debug.Assert(item is XmlSchemaElement);
FrameworkFork\Microsoft.Xml\Xml\schema\basevalidator.cs (2)
49Debug.Assert(schemaCollection == null || schemaCollection.NameTable == reader.NameTable); 185Debug.Assert(names.Count > 0);
FrameworkFork\Microsoft.Xml\Xml\schema\BitSet.cs (1)
82Debug.Assert(startFrom >= -1 && startFrom <= _count);
FrameworkFork\Microsoft.Xml\Xml\schema\ChameleonKey.cs (1)
70Debug.Assert((chameleonLocation.OriginalString.Length == 0 && originalSchema != null)
FrameworkFork\Microsoft.Xml\Xml\schema\CompiledIdentityConstraint.cs (1)
66Debug.Assert(fields.Count > 0);
FrameworkFork\Microsoft.Xml\Xml\schema\ConstraintStruct.cs (3)
214Debug.Assert(_dstruct != null); 222Debug.Assert(_dstruct != null); 399Debug.Assert(dim > 0);
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (15)
97Debug.Assert(_particles.Count == _last + 1); 137Debug.Assert(_particles.Count == _last + 1); 990Debug.Assert(parent is SequenceNode); 991Debug.Assert(this == parent.RightChild); 1318Debug.Assert(ContentType == XmlSchemaContentType.ElementOnly || ContentType == XmlSchemaContentType.Mixed); 1330Debug.Assert(!IsOpen); 1432Debug.Assert(lrNode != null); 1450Debug.Assert(lrNode1 != null); 1566Debug.Assert(state == (int)stateTable[statePosSet]); // just make sure that statePosSet is for correct state 1957Debug.Assert(_minMaxNodesCount != 0); 2067Debug.Assert(_minMaxNodesCount > 0); 2092Debug.Assert(lrNode != null); 2184Debug.Assert(runningPositions[i].curpos != null); 2229Debug.Assert(runningPositions[i].curpos != null); 2288Debug.Assert(_elements.Count > 0);
FrameworkFork\Microsoft.Xml\Xml\schema\DatatypeImplementation.cs (7)
178Debug.Assert(qname != null && dataType != null); 194Debug.Assert(derivedType != null && baseType != null); 367Debug.Assert(currentType != null); 987Debug.Assert(arr1 != null && arr2 != null); 997Debug.Assert(atomicValues2 != null); 1065Debug.Assert(valuesToCheck != null); 1162Debug.Assert(array.GetType() == ListValueType);
FrameworkFork\Microsoft.Xml\Xml\schema\DtdParser.cs (37)
217Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0); 218Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1); 219Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2); 220Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3); 221Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4); 222Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5); 223Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6); 224Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7); 225Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8); 244Debug.Assert(readerAdapter != null); 504Debug.Assert(ParsingInternalSubset); 510Debug.Assert(_externalEntitiesDepth == 0); 531Debug.Assert(_readerAdapter.EntityStackLength == 0 || 601Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 613Debug.Assert(_readerAdapter.EntityStackLength == 0 || 633Debug.Assert(false); 637Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1518Debug.Assert(idTokenType == Token.PUBLIC); 1680Debug.Assert(false); 2418Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2637Debug.Assert(_curPos - _tokenStartPos == 0); 3183Debug.Assert(_chars[_curPos] == 'P'); 3203Debug.Assert(_chars[_curPos] == 'S'); 3226Debug.Assert(_curPos - _tokenStartPos > 0); 3248Debug.Assert(_curPos - _tokenStartPos > 0); 3271Debug.Assert(_curPos == 0 || _chars[_curPos - 1] == '"' || _chars[_curPos - 1] == '\''); 3304Debug.Assert(_internalSubsetValueSb != null); 3320Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 3328Debug.Assert(_chars[_curPos - 1] == ';'); 3393Debug.Assert(!ParsingInternalSubset || _freeFloatingDtd); 3394Debug.Assert(_currentEntityId == 0); 3418Debug.Assert(_chars[_curPos - 1] == ';'); 3474Debug.Assert(_validate); 3480Debug.Assert(_validate); 3486Debug.Assert(_validate); 3526Debug.Assert(false, "This is an unexpected error that should have been handled in the ScanXXX methods."); 3613Debug.Assert(startPos < _charsUsed);
FrameworkFork\Microsoft.Xml\Xml\schema\dtdvalidator.cs (2)
43Debug.Assert(reader != null); 146Debug.Assert(reader.NodeType == XmlNodeType.Element);
FrameworkFork\Microsoft.Xml\Xml\schema\FacetChecker.cs (2)
463Debug.Assert(false); 1648Debug.Assert(values != null);
FrameworkFork\Microsoft.Xml\Xml\schema\Inference\infer.cs (10)
276Debug.Assert(_rootSchema != null, "rootSchema is null"); 301Debug.Assert(compiledAttributes != null); //AttributeUses is never null 502Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty"); 1022Debug.Assert(elem.ElementDecl == null); 1225Debug.Assert(_xtr.NodeType == XmlNodeType.Attribute); 1265Debug.Assert(ct != null); 1276Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type 1280Debug.Assert(sce != null); 1753Debug.Assert(false, "Expected type not matched"); 2399Debug.Assert(false, "Expected date, time or dateTime");
FrameworkFork\Microsoft.Xml\Xml\schema\NamespaceList.cs (7)
34Debug.Assert(targetNamespace != null); 74Debug.Assert(_set != null); 117Debug.Assert(false); 162Debug.Assert(false); 184Debug.Assert(super._type == ListType.Set); 202Debug.Assert(o1 != o2); 320Debug.Assert(o1 != o2); //clause 1
FrameworkFork\Microsoft.Xml\Xml\schema\Parser.cs (8)
94Debug.Assert(_schemaType == SchemaType.XDR); 142Debug.Assert(false); 246Debug.Assert(_parentNode != null); 327Debug.Assert(currentNode != null); 328Debug.Assert(_parentNode != null); 336Debug.Assert(_reader.NodeType == XmlNodeType.Element); 421Debug.Assert(_reader.NodeType == XmlNodeType.Attribute); 447Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference);
FrameworkFork\Microsoft.Xml\Xml\schema\ParserAsync.cs (1)
59Debug.Assert(_schemaType == SchemaType.XDR);
FrameworkFork\Microsoft.Xml\Xml\schema\Preprocessor.cs (4)
324Debug.Assert(import != null); 730Debug.Assert(false); 856Debug.Assert(_currentSchema != null); 1013Debug.Assert((currentSchemaObject as XmlSchema) == null); //The current object should not be schema
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionCompiler.cs (9)
53Debug.Assert(!members.Contains(element)); 504Debug.Assert(group.CanonicalParticle != null); 1020Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1405Debug.Assert(false); 1860Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2333Debug.Assert(xe.ElementSchemaType != null); 2577Debug.Assert(particle == XmlSchemaParticle.Empty); 2624Debug.Assert(!p.IsEmpty); 2643Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaInfo.cs (1)
330Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaSetCompiler.cs (13)
118Debug.Assert(_schemaForSchema != null); 482Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 585Debug.Assert(group.CanonicalParticle != null); 1630Debug.Assert(false); 2207Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2764Debug.Assert(xe.ElementSchemaType != null); 2785Debug.Assert(decl != null); 3020Debug.Assert(particle == XmlSchemaParticle.Empty); 3068Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 3087Debug.Assert(false); 3244Debug.Assert(baseFixedValue != null); 3249Debug.Assert(derivedFixedValue != null); 3265Debug.Assert(simpleFixedValue != null);
FrameworkFork\Microsoft.Xml\Xml\schema\XdrBuilder.cs (1)
634Debug.Assert(_GroupDef != null);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlAtomicValue.cs (9)
159Debug.Assert(qname != null); //string representation is handled in a different overload 221default: Debug.Assert(false, "Should never get here"); break; 243default: Debug.Assert(false, "Should never get here"); break; 266default: Debug.Assert(false, "Should never get here"); break; 290default: Debug.Assert(false, "Should never get here"); break; 313default: Debug.Assert(false, "Should never get here"); break; 336default: Debug.Assert(false, "Should never get here"); break; 360default: Debug.Assert(false, "Should never get here"); break; 382default: Debug.Assert(false, "Should never get here"); break;
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchema.cs (2)
272Debug.Assert(_isPreprocessed); 702Debug.Assert(extList != null && schema != null);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaComplexType.cs (1)
408System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaComplexType. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaElement.cs (1)
358System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaElement. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaException.cs (1)
41Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaGroup.cs (1)
91System.Diagnostics.Debug.Assert(false, "Should never call Clone() on XmlSchemaGroup. Call Clone(XmlSchema) instead.");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObject.cs (4)
91get { Debug.Assert(false); return null; } 92set { Debug.Assert(false); } 101get { Debug.Assert(false); return null; } 102set { Debug.Assert(false); }
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaObjectTable.cs (11)
27Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 38Debug.Assert(oldValue != null); 40Debug.Assert(matchedIndex >= 0); 42Debug.Assert(_entries[matchedIndex].qname == name); 57Debug.Assert(oldValue != null); 59Debug.Assert(_entries[matchedIndex].qname == name); 77Debug.Assert(matchedIndex >= 0); 78Debug.Assert(_entries[matchedIndex].qname == name); 100Debug.Assert(_table.Count == _entries.Count); 223Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 278Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSet.cs (2)
1022Debug.Assert(ns != null); 1033Debug.Assert(schema.BaseUri.Equals(schemaUri));
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSimpleType.cs (1)
29Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaValidator.cs (35)
345Debug.Assert(_validatedNamespaces != null); 628Debug.Assert(_currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type 638Debug.Assert(currentElementDecl != null); 640Debug.Assert(ct != null); 657Debug.Assert(attributeDef != null); 677Debug.Assert(simpleValue != null); 828Debug.Assert(names.Count > 0); 960Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 1090Debug.Assert(attSchemaInfo != null); 1454Debug.Assert(currentElementDecl.Datatype != null); 1515Debug.Assert(simpleValue != null); 1527Debug.Assert(decl != null && decl.SchemaType != null); 1567Debug.Assert(_validationStack.Length > 1); 1646Debug.Assert(_partialValidationType is XmlSchemaAttribute); 1683Debug.Assert(elementDecl.DefaultValueTyped != null); 1837Debug.Assert(elementDecl.ContentValidator.ContentType == XmlSchemaContentType.Mixed && elementDecl.DefaultValueTyped != null); 1850Debug.Assert(decl != null); 1863Debug.Assert(_xmlResolver != null); 1959Debug.Assert(dtype != null); 1996Debug.Assert(dtype != null); 2130Debug.Assert(currentElementDecl != null); 2268Debug.WriteLine("Selector Match!"); 2269Debug.WriteLine("Name: " + localName + "\t|\tURI: " + namespaceUri + "\n"); 2283Debug.WriteLine("Element Field Match!"); 2327Debug.WriteLine("Attribute Field Match!"); 2330Debug.WriteLine("Attribute Field Filling Value!"); 2331Debug.WriteLine("Name: " + name + "\t|\tURI: " + ns + "\t|\tValue: " + obj + "\n"); 2340Debug.Assert(datatype != null); 2375Debug.WriteLine("Element Field Filling Value!"); 2376Debug.WriteLine("Name: " + localName + "\t|\tURI: " + namespaceUri + "\t|\tValue: " + typedValue + "\n"); 2534Debug.Assert(contentValidator is DfaContentValidator || contentValidator is NfaContentValidator || contentValidator is RangeContentValidator || contentValidator is AllElementsContentValidator); 2558Debug.Assert(names.Count > 0); 2608Debug.Assert(names.Count > 0); 2647Debug.Assert(builder.Length != 0); 2756Debug.Assert(nsList.Length > 0);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (8)
287Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 297Debug.Assert(schemaType.Datatype.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 321Debug.Assert(false, "Type code " + typeCode + " is not supported."); 529Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 3451Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3583Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3611Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3678Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdBuilder.cs (7)
712Debug.Assert(_currentEntry.InitFunc != null); 715Debug.Assert(_xso != null); 975Debug.Assert(false, "State is " + state); 1100Debug.Assert(false, "State is " + state); 1340Debug.Assert(false); 2381Debug.Assert(false); 2430Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDateTime.cs (3)
163Debug.Assert(Bits.ExactlyOne((uint)kinds), "Only one DateTime type code can be set."); 178Debug.Assert(dateTime.Kind == DateTimeKind.Local, "Unknown DateTimeKind: " + dateTime.Kind); 207Debug.Assert(Bits.ExactlyOne((uint)kinds), "Only one DateTime type code can be set.");
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (1)
115Debug.Assert(durationType == DurationType.Duration || durationType == DurationType.DayTimeDuration);
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (9)
502Debug.Assert(attnDef.SchemaType != null); 944Debug.WriteLine("Selector Match!"); 945Debug.WriteLine("Name: " + reader.LocalName + "\t|\tURI: " + reader.NamespaceURI + "\n"); 958Debug.WriteLine("Element Field Match!"); 1003Debug.WriteLine("Attribute Field Match!"); 1006Debug.WriteLine("Attribute Field Filling Value!"); 1007Debug.WriteLine("Name: " + name + "\t|\tURI: " + ns + "\t|\tValue: " + obj + "\n"); 1057Debug.WriteLine("Element Field Filling Value!"); 1058Debug.WriteLine("Name: " + reader.LocalName + "\t|\tURI: " + reader.NamespaceURI + "\t|\tValue: " + reader.TypedValueObject + "\n");
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (1)
176Debug.Assert(comments != null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (32)
47System.Diagnostics.Debug.Assert(typeBuilder != null); 123System.Diagnostics.Debug.Assert(false, msg); 129System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 135System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 182System.Diagnostics.Debug.Assert(false); 226Debug.Assert(_currentScope.parent != null); 235Debug.Assert(_freeLocals != null); 257Debug.Assert(!_currentScope.ContainsKey(name)); 273Debug.Assert(local.LocalType == type); 314Debug.Assert(forState != null); 636Debug.Assert(methodInfo != null); 645Debug.Assert(ctor != null); 651Debug.Assert(constructorInfo != null); 802System.Diagnostics.Debug.Assert(getMethod != null); 839System.Diagnostics.Debug.Assert(getMethod != null); 877System.Diagnostics.Debug.Assert(setMethod != null); 1141Debug.Assert(false, "Char is not a valid schema primitive and should be treated as int in DataContract"); 1192Debug.Assert(false, "UnknownConstantType"); 1288Debug.Assert(_currentScope.ContainsKey(name)); 1300Debug.Assert(local.LocalType == type); 1311Debug.Assert(_currentScope.ContainsKey(name)); 1313Debug.Assert(local.LocalType == type); 1529Debug.Assert(!opCode.Equals(OpCodes.Nop)); 1849Debug.Assert(ifState != null); 2043Debug.Assert(_initElseIfStack == -1); 2053Debug.Assert(_initIfStack == -1); 2073Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 2094Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 2878Debug.Assert(this.MethodBuilder.ReturnType == returnType); 2879Debug.Assert(this.MethodBuilder.Attributes == attributes); 2880Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 2883Debug.Assert(this.ParameterTypes[i] == parameterTypes[i]);
FrameworkFork\Microsoft.Xml\Xml\Serialization\SourceInfo.cs (4)
115Debug.Assert(get_Item != null); 192Debug.Assert(match.Groups["arg"].Value == Arg); 193Debug.Assert(match.Groups["cast"].Value == CodeIdentifier.GetCSharpName(Type)); 218System.Diagnostics.Debug.Assert(targetType == nullableType || targetType.IsAssignableFrom(nullableType.GetGenericArguments()[0]));
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (2)
1136Debug.Assert(propertyInfo != null); 1137Debug.Assert(typeDesc != null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationILGen.cs (5)
47System.Diagnostics.Debug.Assert(access == "public"); 62get { System.Diagnostics.Debug.Assert(_moduleBuilder != null); return _moduleBuilder; } 63set { System.Diagnostics.Debug.Assert(_moduleBuilder == null && value != null); _moduleBuilder = value; } 107System.Diagnostics.Debug.Assert(_methodBuilders.ContainsKey(methodName)); 572System.Diagnostics.Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriterILGen.cs (11)
1093System.Diagnostics.Debug.Assert(xmlnsSource.StartsWith("o.@", StringComparison.Ordinal)); 1444System.Diagnostics.Debug.Assert(parent == "o" || parent == "p"); 2316Debug.Assert(!local.LocalType.GetTypeInfo().IsValueType); 2516Debug.Assert(type.GetTypeInfo().IsValueType); 2600Debug.Assert(initValue.MemberInfo != null); 2601Debug.Assert(initValue.MemberInfo.Name == initValue.Arg.Substring(3)); 2646Debug.Assert(typeName == arrayTypeDesc.CSharpName || typeName == arrayTypeDesc.CSharpName + "[]"); 2658Debug.Assert(type != null); 2659Debug.Assert(ilg != null); 2667Debug.Assert(arrayType != null); 2668Debug.Assert(ilg != null);
FrameworkFork\Microsoft.Xml\Xml\ValidateNames.cs (7)
42Debug.Assert(s != null && offset <= s.Length); 78Debug.Assert(s != null && offset <= s.Length); 121Debug.Assert(s != null && offset <= s.Length); 181Debug.Assert(s != null && offset <= s.Length); 400Debug.Assert(offsetBadChar < s.Length); 420Debug.Assert(offsetBadChar < s.Length); 491Debug.Assert(prefix != null && localName != null && ns != null);
FrameworkFork\Microsoft.Xml\Xml\XmlCharType.cs (8)
472Debug.Assert(s_CharProperties != null); 704Debug.Assert(str != null); 705Debug.Assert(startPos + len <= str.Length); 706Debug.Assert(startPos <= str.Length); 720Debug.Assert(chars != null); 721Debug.Assert(startPos + len <= chars.Length); 722Debug.Assert(startPos <= chars.Length); 752Debug.Assert(start <= end);
FrameworkFork\Microsoft.Xml\Xml\XmlEncoding.cs (2)
433Debug.Assert(i == 1); 484Debug.Assert(i == 1);
FrameworkFork\Microsoft.Xml\Xml\XmlException.cs (5)
41Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 200Debug.Assert(invCharIndex < data.Length); 201Debug.Assert(invCharIndex < length); 202Debug.Assert(length <= data.Length); 267Debug.Assert(e != null, "Unexpected null exception");
FrameworkFork\Microsoft.Xml\Xml\XmlNamespaceManager.cs (4)
124Debug.Assert(decl >= 2); 187Debug.Assert(_hashTable == null); 251Debug.Assert(i >= 2); 262Debug.Assert(prefix != null);
FrameworkFork\Microsoft.Xml\Xml\XmlQualifiedName.cs (3)
175Debug.Assert(name != null && ns != null); 183Debug.Assert(ns != null); 198Debug.Assert(_name != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\AttributeQuery.cs (1)
50Debug.Assert(!currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Axis.cs (2)
43Debug.Assert(prefix != null); 44Debug.Assert(name != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\baseaxisquery.cs (3)
38Debug.Assert(qyInput != null); 68Debug.Assert(context != null); 125Debug.Assert(this is AttributeQuery || this is ChildrenQuery);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanExpr.cs (2)
22Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); 23Debug.Assert(opnd1 != null && opnd2 != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\BooleanFunctions.cs (1)
68Debug.Assert(result is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheAxisQuery.cs (2)
43Debug.Assert(0 <= count && count <= outputBuffer.Count); 55Debug.Assert(0 <= count && count <= outputBuffer.Count);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheChildrenQuery.cs (1)
104Debug.Assert(order == XmlNodeOrder.Before, "Algorith error. Nodes expected to be DocOrderDistinct");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CacheOutputQuery.cs (2)
53Debug.Assert(0 <= count && count <= outputBuffer.Count); 65Debug.Assert(0 <= count && count <= outputBuffer.Count);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\CompiledXpathExpr.cs (2)
47Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression"); 123Debug.Assert(prefix != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\DescendantOverDescendantQuery.cs (1)
95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\FilterQuery.cs (1)
74Debug.Assert(value is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\ForwardPositionQuery.cs (1)
16Debug.Assert(input != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\LogicalExpr.cs (7)
22Debug.Assert( 93Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 126Debug.Assert( 250Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 324Debug.Fail("Unexpected Operator.op code in cmpNumberNumber()"); 336Debug.Fail("Unexpected Operator.op code in cmpNumberNumberO()"); 362Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NamespaceQuery.cs (2)
62Debug.Assert(e.NodeType == XPathNodeType.Namespace); 65Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NumericExpr.cs (3)
22Debug.Assert( 27Debug.Assert(opnd1 != null && opnd2 != null); 62Debug.Assert(op == Operator.Op.PLUS || op == Operator.Op.MINUS || op == Operator.Op.MOD || op == Operator.Op.DIV || op == Operator.Op.MUL);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Operator.cs (1)
52Debug.Assert(Op.EQ <= op && op <= Op.GE);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingquery.cs (2)
89Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already"); 100Debug.Fail("Algorithm error: we missed the centinel node");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\precedingsibling.cs (2)
70Debug.Assert(test, "We just moved to parent, how we can not have first child?"); 79Debug.Fail("We managed to miss sentinel node (input)");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\Query.cs (9)
156Debug.Assert(0 <= l && l < r); 189Debug.Assert(0 <= pos && pos <= buffer.Count, "Algorithm error: Insert()"); 194Debug.Assert(cmp == XmlNodeOrder.Before, "Algorithm error: Insert()"); 199Debug.Assert(cmp == XmlNodeOrder.Before, "Algorithm error: Insert()"); 206Debug.Assert(query != null, "AssertQuery(): query == null"); 217Debug.Assert(curr == query.Current, "AssertQuery(): query.Advance() != query.Current"); 229Debug.Assert(cmp == XmlNodeOrder.Before, "AssertQuery(): Wrong node order"); 235Debug.Assert(actualSize == querySize, "AssertQuery(): actualSize != querySize"); 254Debug.Assert(value is XPathNavigator, "Unknown value type");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\querybuilder.cs (2)
466Debug.Assert(root != null, "root != null"); 496Debug.Assert(false, "Unknown QueryType encountered!!");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (9)
23Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 55Debug.Assert(numSorts > 0, "Why was the sort query created?"); 83Debug.Assert(0 <= count && count <= _results.Count); 95Debug.Assert(0 <= count && count <= _results.Count); 168Debug.Assert(_expressions.Length == _comparers.Length); 169Debug.Assert(0 < _expressions.Length); 170Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 184Debug.Assert(_numSorts < _expressions.Length); 206Debug.Assert(x != null && y != null, "Oops!! what happened?");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (2)
23Debug.Assert(argList != null, "Use 'new Query[]{}' instead."); 94Debug.Assert(GetXPathType(argVal) == XPathResultType.Number);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathArrayIterator.cs (2)
54Debug.Assert(index <= list.Count); 69Debug.Assert(index <= list.Count);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathMultyIterator.cs (3)
101Debug.Assert(firstNotEmpty <= item && item < arr.Length); 157Debug.Assert(position != 0, "MoveNext() wasn't called"); 158Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathParser.cs (5)
424Debug.Assert(nodeType != XPathNodeType.Root); 477Debug.Assert(IsPrimaryExpr(_scanner)); 511Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex."); 668Debug.Assert(_scanner.CanBeFunction); 880Debug.Assert(scaner.Kind == XPathScanner.LexKind.Axe);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathScanner.cs (15)
45Debug.Assert(0 <= _xpathExprIndex && _xpathExprIndex <= _xpathExpr.Length); 77Debug.Assert(_kind == LexKind.Name || _kind == LexKind.Axe); 78Debug.Assert(_name != null); 87Debug.Assert(_kind == LexKind.Name); 88Debug.Assert(_prefix != null); 97Debug.Assert(_kind == LexKind.String); 98Debug.Assert(_stringValue != null); 107Debug.Assert(_kind == LexKind.Number); 108Debug.Assert(_numberValue != double.NaN); 119Debug.Assert(_kind == LexKind.Name); 288Debug.Assert(this.CurerntChar == '.' || XmlCharType.IsDigit(this.CurerntChar)); 308Debug.Assert(XmlCharType.IsDigit(this.CurerntChar)); 310Debug.Assert(0 <= start && _xpathExpr[start] == '.'); 333Debug.Assert(this.CurerntChar == endChar); 340Debug.Assert(_xmlCharType.IsStartNCNameSingleChar(this.CurerntChar)
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathSingletonIterator.cs (1)
20Debug.Assert(nav != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathDocument.cs (5)
189Debug.Assert((object)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty"); 221Debug.Assert(reader.LocalName == "xmlns"); 226Debug.Assert(reader.Prefix == "xmlns"); 396Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element && pageNmsp[idxNmsp].NodeType == XPathNodeType.Namespace); 410Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigator.cs (10)
1029Debug.Assert(CompareSiblings(n1.Clone(), n2.Clone()) != CompareSiblings(n2.Clone(), n1.Clone()), "IsSamePosition() on custom navigator returns incosistent results"); 1098Debug.Assert(schemaType != null || this.NodeType == XPathNodeType.Root, "schemaType != null || this.NodeType == XPathNodeType.Root"); 1126Debug.Assert(schemas != null, "schemas != null"); 1150Debug.Assert(args != null); 1917Debug.Assert(!n1.IsSamePosition(n2)); 1919Debug.Assert(p1.MoveToParent() && p2.MoveToParent() && p1.IsSamePosition(p2)); 2154Debug.Assert(reader.LocalName == "xmlns"); 2159Debug.Assert(reader.Prefix == "xmlns"); 2216Debug.Assert(reader.LocalName == "xmlns"); 2221Debug.Assert(reader.Prefix == "xmlns");
FrameworkFork\Microsoft.Xml\Xml\XPath\XPathNavigatorReader.cs (4)
520Debug.Assert(value == null); 646Debug.Assert(XPathNodeType.Namespace == _nav.NodeType); 669Debug.Fail("Couldn't find Namespace Node! Should not happen!"); 1033Debug.Assert(_nav.NodeType == XPathNodeType.Element, _nav.NodeType.ToString() + " == XPathNodeType.Element");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CodeGenerator.cs (5)
39Debug.Assert(s_getTypeFromHandle != null); 63Debug.Assert(s_objectEquals != null); 86Debug.Assert(s_arraySetValue != null); 103Debug.Assert(s_objectToString != null); 118Debug.Assert(s_stringFormat != null);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\CollectionDataContract.cs (1)
550Debug.Assert(AddMethod != null || Kind == CollectionKind.Array, "Add method cannot be null if the collection is being used as a get-only property");
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\DiagnosticUtility.cs (1)
21Debug.Assert(condition, message);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\Globals.cs (3)
1051Debug.Assert(s_typeOfScriptObject != null); 1069Debug.Assert(s_serializeFunc != null); 1075Debug.Assert(s_deserializeFunc != null);
FrameworkFork\System.Runtime.Serialization\System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (65)
34Debug.Assert(s_writeStartElementMethod2 != null); 50Debug.Assert(s_writeStartElementMethod3 != null); 66Debug.Assert(s_writeEndElementMethod != null); 82Debug.Assert(s_writeNamespaceDeclMethod != null); 112Debug.Assert(s_ienumeratorMoveNextMethod != null); 128Debug.Assert(s_ienumeratorGetCurrentMethod != null); 144Debug.Assert(s_getItemContractMethod != null); 160Debug.Assert(s_isStartElementMethod2 != null); 176Debug.Assert(s_isStartElementMethod0 != null); 192Debug.Assert(s_getUninitializedObjectMethod != null); 208Debug.Assert(s_nodeTypeProperty != null); 237Debug.Assert(s_getStreamingContextMethod != null); 253Debug.Assert(s_getCollectionMemberMethod != null); 269Debug.Assert(s_storeCollectionMemberInfoMethod != null); 285Debug.Assert(s_storeIsGetOnlyCollectionMethod != null); 301Debug.Assert(s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod != null); 316Debug.Assert(s_throwArrayExceededSizeExceptionMethod != null); 332Debug.Assert(s_incrementItemCountMethod != null); 349Debug.Assert(s_internalDeserializeMethod != null); 365Debug.Assert(s_moveToNextElementMethod != null); 381Debug.Assert(s_getMemberIndexMethod != null); 397Debug.Assert(s_getMemberIndexWithRequiredMembersMethod != null); 413Debug.Assert(s_throwRequiredMemberMissingExceptionMethod != null); 429Debug.Assert(s_skipUnknownElementMethod != null); 445Debug.Assert(s_readIfNullOrRefMethod != null); 461Debug.Assert(s_readAttributesMethod != null); 477Debug.Assert(s_resetAttributesMethod != null); 493Debug.Assert(s_getObjectIdMethod != null); 509Debug.Assert(s_getArraySizeMethod != null); 525Debug.Assert(s_addNewObjectMethod != null); 541Debug.Assert(s_addNewObjectWithIdMethod != null); 557Debug.Assert(s_getExistingObjectMethod != null); 573Debug.Assert(s_ensureArraySizeMethod != null); 589Debug.Assert(s_trimArraySizeMethod != null); 605Debug.Assert(s_checkEndOfArrayMethod != null); 622Debug.Assert(s_getArrayLengthMethod != null); 638Debug.Assert(s_createSerializationExceptionMethod != null); 654Debug.Assert(s_createUnexpectedStateExceptionMethod != null); 670Debug.Assert(s_internalSerializeReferenceMethod != null); 686Debug.Assert(s_internalSerializeMethod != null); 702Debug.Assert(s_writeNullMethod != null); 718Debug.Assert(s_incrementArrayCountMethod != null); 734Debug.Assert(s_incrementCollectionCountMethod != null); 750Debug.Assert(s_incrementCollectionCountGenericMethod != null); 766Debug.Assert(s_getDefaultValueMethod != null); 782Debug.Assert(s_getNullableValueMethod != null); 798Debug.Assert(s_throwRequiredMemberMustBeEmittedMethod != null); 814Debug.Assert(s_getHasValueMethod != null); 832Debug.Assert(s_isMemberTypeSameAsMemberValue != null); 848Debug.Assert(s_writeXmlValueMethod != null); 864Debug.Assert(s_readXmlValueMethod != null); 880Debug.Assert(s_namespaceProperty != null); 896Debug.Assert(s_contractNamespacesField != null); 912Debug.Assert(s_memberNamesField != null); 928Debug.Assert(s_childElementNamespacesProperty != null); 944Debug.Assert(s_collectionItemNameProperty != null); 960Debug.Assert(s_childElementNamespaceProperty != null); 976Debug.Assert(s_getDateTimeOffsetMethod != null); 992Debug.Assert(s_getDateTimeOffsetAdapterMethod != null); 1007Debug.Assert(s_getTypeHandleMethod != null); 1021Debug.Assert(s_getTypeMethod != null); 1037Debug.Assert(s_throwInvalidDataContractExceptionMethod != null); 1053Debug.Assert(s_serializeReadOnlyTypesProperty != null); 1069Debug.Assert(s_classSerializationExceptionMessageProperty != null); 1085Debug.Assert(s_collectionSerializationExceptionMessageProperty != null);
FrameworkFork\System.ServiceModel\Internals\System\Runtime\AssertHelper.cs (1)
22Debug.Assert(false, message);
FrameworkFork\System.Web.Services\Services\Description\ServiceDescription.cs (2)
1322Debug.Assert(isInput == true, "Oneway flow cannot have an output message"); 1330Debug.Assert(false, "Unknown message flow");
HelpGenerator.cs (1)
219Debug.Assert(!string.IsNullOrEmpty(name), "Help category name should have a valid value!");
ImportModule.cs (3)
278Debug.Assert(false, "Unrecognized serializer option!"); 299Debug.Assert(false, "Unrecognized serializer option!"); 325Debug.Assert(!dcOptions.Namespaces.ContainsKey(namespaceMapping.Key), $"Key '{namespaceMapping.Key}' already added to dictionary!");
Metadata\MetadataDocumentSaver.cs (1)
120Debug.Fail("Unknown metadata found: " + typeName);
Metadata\MetadataFileInfo.cs (1)
20Debug.Assert(metadata != null && filePath != null && write != null, "One or more parameters null!");
OutputPathHelper.cs (1)
19Debug.Assert(!string.IsNullOrWhiteSpace(filePath), "filePath must have a valid value!");
Shared\Utilities\AsyncHelper.cs (1)
60System.Diagnostics.Debug.Assert(finishedTask != taskCompletionSrc.Task, "Unexpected completion task!");
Tool.cs (1)
334Debug.Assert(ex != null, "exception should not be null!");
dotnet-watch (12)
Program.cs (2)
233Debug.Assert(options.ProjectPath != null); 349Debug.Assert(mainProjectOptions.Representation.PhysicalPath != null);
Watch\BuildEvaluator.cs (4)
34Debug.Assert(context.MainProjectOptions != null); 46Debug.Assert(MainProjectOptions.Representation.PhysicalPath != null); 125Debug.Assert(_evaluationResult != null); 152Debug.Assert(_msbuildFileTimestamps != null);
Watch\DotNetWatcher.cs (3)
73Debug.Assert(context.MainProjectOptions != null); 146Debug.Assert(finishedTask == fileSetTask); 148Debug.Assert(changedFile != null, "ChangedFile should only be null when cancelled");
Watch\MsBuildFileSetFactory.cs (3)
91Debug.Assert(result != null); 128Debug.Assert(fileItems.Values.All(f => Path.IsPathRooted(f.FilePath)), "All files should be rooted paths"); 186Debug.Assert(assemblyDir != null);
DotNetWatchTasks (1)
FileSetSerializer.cs (1)
59Debug.Assert(existingStaticWebAssetPath == staticWebAssetPath);
GenerateDocumentationAndConfigFiles (560)
JsonWriter.cs (1)
127Debug.Assert(_pending is Pending.NewLineAndIndent or Pending.CommaNewLineAndIndent);
Program.cs (14)
419Debug.Assert(!args.ContainsPortedFxCopRules); 420Debug.Assert(string.IsNullOrEmpty(args.PropsFileToDisableNetAnalyzersInNuGetPackageName)); 440Debug.Assert(Version.TryParse(args.AnalyzerVersion, out _)); 466Debug.Assert(args.AnalyzerPackageName is NetAnalyzersPackageName or TextAnalyzersPackageName); 487Debug.Assert(!args.ContainsPortedFxCopRules); 539Debug.Assert(!args.ContainsPortedFxCopRules); 625Debug.Assert(!args.ContainsPortedFxCopRules); 761Debug.Assert(false); 771Debug.Assert(!args.ContainsPortedFxCopRules); 1230Debug.Assert(category == null || customTag == null); 1231Debug.Assert(category != null == (rulesetKind == RulesetKind.CategoryDefault || rulesetKind == RulesetKind.CategoryEnabled)); 1232Debug.Assert(customTag != null == (rulesetKind == RulesetKind.CustomTagDefault || rulesetKind == RulesetKind.CustomTagEnabled)); 1388Debug.Assert(fileName.EndsWith(".globalconfig", StringComparison.Ordinal)); 1442Debug.Assert(sortedRulesById.Count > 0);
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
714Debug.Assert(data.All(d => d.Count() == count));
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\RoslynAnalyzers\Microsoft.CodeAnalysis.Analyzers\Core\MetaAnalyzers\ReleaseTrackingHelper.cs (1)
482Debug.Assert(kind is ReleaseTrackingRuleEntryKind.New or ReleaseTrackingRuleEntryKind.Removed);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
495Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 507Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
210Debug.Assert(isInsideAnonymousObjectInitializer == 288Debug.Assert(success); 289Debug.Assert(cfg != null); 320Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 333Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 495Debug.Assert(parameterIndex >= 0); 496Debug.Assert(parameterIndex < arguments.Length);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
46Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
38Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
32Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
60Debug.Fail("FixAllScope.ContainingMember and FixAllScope.ContainingType are not supported in CodeStyle layer");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
342Debug.Assert(desiredGroupIndex >= 0); 343Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
206Debug.Assert(false, message + ". " + diagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
34Debug.Assert(diagnostic != null); 88Debug.Assert(analyzerConfigPath != null); 89Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
102Debug.Fail("Previous container didn't map back to a normal accessor container."); 111Debug.Fail("Accessor count shouldn't have changed as there were no top level edits."); 132Debug.Fail("Member count shouldn't have changed as there were no top level edits."); 139Debug.Fail("Child at indicated index should be a node as there were no top level edits.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (3)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel); 227Debug.Assert(replacedParent.GetAnnotatedNodesAndTokens(annotation).Count() == 1); 246Debug.Assert(newRoot.GetAnnotatedNodesAndTokens(marker).Count() == 1);
GetDocument.Insider (1)
src\86f290b12362e070\HostFactoryResolver.cs (1)
304Debug.Assert(_hostTcs.Task.IsCompleted);
ILAssembler (13)
GrammarVisitor.cs (13)
556Debug.Assert(_currentAssemblyOrRef is not null); 1313Debug.Assert(resolutionContext is null); 3006Debug.Assert(opcode == ILOpCode.Ldc_i8); 3097Debug.Assert(opcode == ILOpCode.Ldstr); 3115Debug.Assert(userString is not null); 3211Debug.Assert(context.id() is not null); 3612Debug.Assert(_currentMethod is not null); 3991Debug.Assert(child is CILParser.DottedNameContext); 4207Debug.Assert(strings.Length == 2); 4798Debug.Assert(context.className() is not null); 4816Debug.Assert(context.OBJECT() is not null); 5336Debug.Assert(context.type() != null); 5360Debug.Assert(childToken.Symbol.Type == CILParser.REF);
ilc (11)
Program.cs (1)
26using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\InstructionSetHelpers.cs (8)
138Debug.Assert((cpuidInfo.Edx & (1 << 15)) != 0); // CMOV 265Debug.Assert(InstructionSet.X64_AVX == InstructionSet.X86_AVX); 266Debug.Assert(InstructionSet.X64_AVX2 == InstructionSet.X86_AVX2); 286Debug.Assert(InstructionSet.X64_AVX512 == InstructionSet.X86_AVX512); 322Debug.Assert(InstructionSet.X86_AVX512 == InstructionSet.X64_AVX512); 325Debug.Assert(InstructionSet.X86_Vector256 == InstructionSet.X64_Vector256); 326Debug.Assert(InstructionSet.X86_VectorT256 == InstructionSet.X64_VectorT256); 327Debug.Assert(InstructionSet.X86_VectorT512 == InstructionSet.X64_VectorT512);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\HelperExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.Signature.Length == 0 && method.Signature.IsStatic);
ILCompiler.Compiler (1369)
Compiler\AnalysisBasedMetadataManager.cs (10)
12using Debug = System.Diagnostics.Debug; 76Debug.Assert((refMethod.Category & MetadataCategory.Description) == 0 78Debug.Assert((refMethod.Category & MetadataCategory.RuntimeMapping) == 0 87Debug.Assert((refField.Category & MetadataCategory.Description) == 0 89Debug.Assert((refField.Category & MetadataCategory.RuntimeMapping) == 0 110Debug.Assert((GetMetadataCategory(refType.Entity.GetTypeDefinition()) & MetadataCategory.Description) 113Debug.Assert((refType.Category & MetadataCategory.Description) == 0 || 121Debug.Assert((GetMetadataCategory(refMethod.Entity.GetTypicalMethodDefinition()) & MetadataCategory.Description) 125Debug.Assert(GetMetadataCategory(refMethod.Entity) == GetMetadataCategory(refMethod.Entity.GetCanonMethodTarget(CanonicalFormKind.Specific))); 132Debug.Assert((GetMetadataCategory(refField.Entity.GetTypicalFieldDefinition()) & MetadataCategory.Description)
Compiler\BodySubstitution.cs (3)
24Debug.Assert(_value != Throw); 43Debug.Assert(method.Signature.ReturnType.IsVoid); 48Debug.Assert(_value is int);
Compiler\BodySubstitutionParser.cs (1)
51Debug.Assert(ShouldProcessElement(nav));
Compiler\Compilation.cs (10)
19using Debug = System.Diagnostics.Debug; 176Debug.Assert(intrinsicMethod.IsIntrinsic); 192Debug.Assert(callsiteModule is IAssemblyDesc, "Multi-module assemblies"); 204Debug.Assert(callsiteModule is IAssemblyDesc, "Multi-module assemblies"); 285Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any) || type.IsCanonicalDefinitionType(CanonicalFormKind.Any)); 398Debug.Assert(contextMethod.AcquiresInstMethodTableFromThis()); 483Debug.Assert(calledMethod.HasInstantiation && calledMethod.IsVirtual); 486Debug.Assert(!calledMethod.IsCanonicalMethod(CanonicalFormKind.Specific)); 524Debug.Assert(!runtimeDeterminedOwningType.IsInterface); 540Debug.Assert(runtimeDeterminedOwningType.HasInstantiation);
Compiler\CompilerMetadataFieldLayoutAlgorithm.cs (2)
6using Debug = System.Diagnostics.Debug; 39Debug.Assert(layout.ThreadNonGcStatics.Size == LayoutInt.Zero);
Compiler\CompilerTypeSystemContext.Aot.cs (2)
131Debug.Assert(field.IsStatic); 271Debug.Assert(type is DefType);
Compiler\CompilerTypeSystemContext.BoxedTypes.cs (14)
13using Debug = System.Diagnostics.Debug; 56Debug.Assert(targetMethod.IsSharedByGenericInstantiations); 57Debug.Assert(!targetMethod.Signature.IsStatic); 58Debug.Assert(!targetMethod.HasInstantiation); 61Debug.Assert(owningType.IsValueType); 76Debug.Assert(owningType != owningTypeDefinition); 80Debug.Assert(!thunk.HasInstantiation); 88Debug.Assert(owningType.IsValueType); 259Debug.Assert(valuetype.IsTypeDefinition); 261Debug.Assert(valuetype.IsValueType); 358Debug.Assert(targetMethod.OwningType.IsValueType); 359Debug.Assert(!targetMethod.Signature.IsStatic); 447Debug.Assert(targetMethod.OwningType.IsValueType); 448Debug.Assert(!targetMethod.Signature.IsStatic);
Compiler\CompilerTypeSystemContext.GeneratedAssembly.cs (3)
14using Debug = System.Diagnostics.Debug; 66Debug.Fail("Resolving a TypeRef in the compiler generated assembly?"); 138Debug.Assert(!HasInstantiation, "Why is this generic?");
Compiler\CompilerTypeSystemContext.GetFieldMethodOverrides.cs (3)
10using Debug = System.Diagnostics.Debug; 114Debug.Assert(type.IsValueType); 159Debug.Assert(Type.IsValueType);
Compiler\CompilerTypeSystemContext.InterfaceThunks.cs (10)
11using Debug = System.Diagnostics.Debug; 72Debug.Assert(targetMethod.IsSharedByGenericInstantiations); 73Debug.Assert(!targetMethod.Signature.IsStatic); 74Debug.Assert(!targetMethod.HasInstantiation); 75Debug.Assert(interfaceOnDefinition.GetTypeDefinition() == targetMethod.OwningType.GetTypeDefinition()); 76Debug.Assert(targetMethod.OwningType.IsInterface); 81Debug.Assert(((MetadataType)implementingClass).IsDynamicInterfaceCastableImplementation()); 92Debug.Assert(interfaceIndex >= 0); 176Debug.Assert(targetMethod.OwningType.IsInterface); 177Debug.Assert(!targetMethod.Signature.IsStatic);
Compiler\Dataflow\ArrayValue.cs (1)
98System.Diagnostics.Debug.Assert(v is not ArrayValue);
Compiler\Dataflow\AsyncMaskingILProvider.cs (4)
9using Debug = System.Diagnostics.Debug; 24Debug.Assert(wrappedProvider is not AsyncMaskingILProvider); 30Debug.Assert(!method.IsAsyncVariant()); 76Debug.Assert(_wrappedIL.GetMethodILDefinition() == _wrappedIL);
Compiler\Dataflow\AttributeDataFlow.cs (1)
82Debug.Assert(namedArgument.Kind == CustomAttributeNamedArgumentKind.Property);
Compiler\Dataflow\CompilerGeneratedCallGraph.cs (10)
31Debug.Assert(fromMethod.IsTypicalMethodDefinition); 32Debug.Assert(toMethod.IsTypicalMethodDefinition); 33Debug.Assert(CompilerGeneratedNames.IsLambdaOrLocalFunction(toMethod.Name.AsSpan())); 39Debug.Assert(fromMethod.IsTypicalMethodDefinition); 40Debug.Assert(toType.IsTypeDefinition); 41Debug.Assert(CompilerGeneratedNames.IsStateMachineType(toType.Name.AsSpan())); 47Debug.Assert(fromType.IsTypeDefinition); 48Debug.Assert(toMethod.IsTypicalMethodDefinition); 49Debug.Assert(CompilerGeneratedNames.IsStateMachineType(fromType.Name.AsSpan())); 50Debug.Assert(CompilerGeneratedNames.IsLambdaOrLocalFunction(toMethod.Name.AsSpan()));
Compiler\Dataflow\CompilerGeneratedState.cs (20)
119Debug.Assert(type == type.GetTypeDefinition()); 120Debug.Assert(!CompilerGeneratedNames.IsStateMachineOrDisplayClass(type.Name.AsSpan())); 139Debug.Assert(method == method.GetTypicalMethodDefinition()); 148Debug.Assert(added); 155Debug.Assert(!isStateMachineMember); 188Debug.Assert(generatedType.IsTypeDefinition); 229Debug.Assert(generatedType.IsTypeDefinition); 251Debug.Assert(stateMachineType.ContainingType == type || 254Debug.Assert(stateMachineType == stateMachineType.GetTypeDefinition()); 328Debug.Assert(CompilerGeneratedNames.IsLambdaOrLocalFunction(nestedFunction.Name.AsSpan())); 343Debug.Assert(CompilerGeneratedNames.IsStateMachineType(stateMachineType.Name.AsSpan())); 355Debug.Assert(generatedType == generatedType.GetTypeDefinition()); 395Debug.Assert(CompilerGeneratedNames.IsStateMachineOrDisplayClass(generatedType.Name.AsSpan())); 396Debug.Assert(generatedType == generatedType.GetTypeDefinition()); 449Debug.Fail("This should be impossible in valid code"); 632Debug.Assert(type.IsTypeDefinition); 685Debug.Assert(CompilerGeneratedNames.IsStateMachineOrDisplayClass(generatedType.Name.AsSpan())); 746Debug.Assert(sourceMember is not MethodDesc sourceMethod || sourceMethod.IsTypicalMethodDefinition); 756Debug.Assert(userMethodCandidate != member); 763Debug.Assert(!IsNestedFunctionOrStateMachineMember(userMethod));
Compiler\Dataflow\FlowAnnotations.cs (5)
19using Debug = System.Diagnostics.Debug; 189Debug.Assert(ecmaGenericParameter.Kind == GenericParameterKind.Method); 315Debug.Assert(blobReader.Length == 8); 341Debug.Assert(key.IsTypeDefinition); 657Debug.Assert(attrs is null || attrs.Count == typeDef.Instantiation.Length);
Compiler\Dataflow\GenericArgumentDataFlow.cs (1)
101Debug.Assert(genericParameterValue.DynamicallyAccessedMemberTypes != DynamicallyAccessedMemberTypes.None);
Compiler\Dataflow\HandleCallAction.cs (2)
469Debug.Assert(staticType is MetadataType || staticType.IsArray); 570Debug.Assert(contextMethod.GetTypicalMethodDefinition() == contextMethod);
Compiler\Dataflow\HoistedLocalKey.cs (1)
22Debug.Assert(CompilerGeneratedState.IsHoistedLocal(field));
Compiler\Dataflow\InterproceduralState.cs (3)
66Debug.Assert(methodBody.GetMethodILDefinition() == methodBody); 70Debug.Assert(!MethodBodies.IsUnknown()); 81Debug.Assert(!CompilerGeneratedNames.IsLambdaOrLocalFunction(stateMachineMethod.Name.AsSpan()));
Compiler\Dataflow\MethodBodyScanner.cs (6)
289Debug.Assert(startingMethod.IsTypicalMethodDefinition); 293Debug.Assert(!CompilerGeneratedState.IsNestedFunctionOrStateMachineMember(startingMethod)); 309Debug.Assert(!oldInterproceduralState.MethodBodies.IsUnknown()); 328Debug.Assert(!interproceduralState.MethodBodies.IsUnknown()); 329Debug.Assert(interproceduralState.MethodBodies.GetKnownValues().Count() == 1); 988Debug.Assert(operand is FieldDesc);
Compiler\Dataflow\MethodReturnValue.cs (1)
23Debug.Assert(!isNewObj || method.IsConstructor, "isNewObj can only be true for constructors");
Compiler\Dataflow\ReflectionMarker.cs (3)
295Debug.Assert(entity is MethodDesc or FieldDesc); 344Debug.Assert(entity is MethodDesc or FieldDesc); 351Debug.Assert(_typeHierarchyDataFlowOrigin != null);
Compiler\Dataflow\ReflectionMethodBodyScanner.cs (5)
144Debug.Assert(annotation != DynamicallyAccessedMemberTypes.None); 212Debug.Fail("Invalid IL or a bug in the scanner"); 291Debug.Assert(callingMethodIL.OwningMethod == _origin.MemberDefinition); 341Debug.Assert(callingMethodDefinition == diagnosticContext.Origin.MemberDefinition); 345Debug.Assert(
Compiler\Dataflow\TrimAnalysisAssignmentPattern.cs (2)
40Debug.Assert(Origin == other.Origin); 41Debug.Assert(ParameterIndex == other.ParameterIndex);
Compiler\Dataflow\TrimAnalysisMethodCallPattern.cs (7)
36Debug.Assert(origin.MemberDefinition is MethodDesc); 58Debug.Assert(MethodBody.OwningMethod == other.MethodBody.OwningMethod); 59Debug.Assert(Operation == other.Operation); 60Debug.Assert(Offset == other.Offset); 61Debug.Assert(Origin == other.Origin); 62Debug.Assert(CalledMethod == other.CalledMethod); 63Debug.Assert(Arguments.Length == other.Arguments.Length);
Compiler\Dataflow\TrimAnalysisTokenAccessPattern.cs (1)
39Debug.Fail($"Unsupported entity for reflection access pattern: {Entity}");
Compiler\DelegateCreationInfo.cs (12)
11using Debug = System.Diagnostics.Debug; 47Debug.Assert(_constrainedType == null); 95Debug.Assert(_targetMethod.IsRuntimeDeterminedExactMethod || _constrainedType.IsRuntimeDeterminedSubtype); 99Debug.Assert(false); 111Debug.Assert(NeedsRuntimeLookup); 124Debug.Assert(false); 135Debug.Assert(!NeedsRuntimeLookup); 148Debug.Fail("Need to do runtime lookup"); 152Debug.Assert(false); 172Debug.Assert(targetKind != TargetKind.VTableLookup 206Debug.Assert(paramCountDelegateClosed == paramCountTargetMethod + 1); 289Debug.Assert(constrainedType == null);
Compiler\DependencyAnalysis\AddressTakenMethodNode.cs (1)
76Debug.Assert(!_methodNode.RepresentsIndirectionCell);
Compiler\DependencyAnalysis\ArrayOfFrozenObjectsNode.cs (1)
37Debug.Assert(node is not FrozenObjectNode frozenObj || !frozenObj.ObjectType.RequiresAlign8());
Compiler\DependencyAnalysis\AsyncContinuationEETypeNode.cs (5)
8using Debug = System.Diagnostics.Debug; 39Debug.Assert(continuationBaseType.InstanceByteCountUnaligned.AsInt == baseSize * pointerSize); 45Debug.Assert(dataOffsetField.IsLiteral); 49Debug.Assert(constant.TypeCode == System.Reflection.Metadata.ConstantTypeCode.Int32); 52Debug.Assert(baseSize * pointerSize == expectedDataOffset);
Compiler\DependencyAnalysis\CanonicalDefinitionEETypeNode.cs (1)
15Debug.Assert(type.IsCanonicalDefinitionType(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\ClassConstructorContextMap.cs (2)
10using Debug = System.Diagnostics.Debug; 52Debug.Assert(factory.PreinitializationManager.HasLazyStaticConstructor(type));
Compiler\DependencyAnalysis\ConstructedEETypeNode.cs (2)
15Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any)); 75Debug.Assert(!_type.IsCanonicalSubtype(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\CustomAttributeBasedDependencyAlgorithm.cs (2)
179Debug.Assert(decodedArgument.Kind == CustomAttributeNamedArgumentKind.Property); 289Debug.Assert(value is TypeDesc);
Compiler\DependencyAnalysis\DataflowAnalyzedMethodNode.cs (2)
26Debug.Assert(methodIL.OwningMethod.IsTypicalMethodDefinition); 27Debug.Assert(!CompilerGeneratedState.IsNestedFunctionOrStateMachineMember(methodIL.OwningMethod));
Compiler\DependencyAnalysis\DataflowAnalyzedTypeDefinitionNode.cs (1)
24Debug.Assert(typeDefinition.IsTypeDefinition);
Compiler\DependencyAnalysis\DataOnlyEETypeNode.cs (2)
10using Debug = System.Diagnostics.Debug; 84Debug.Assert(dataBuilder.CountBytes == ((ISymbolDefinitionNode)this).Offset);
Compiler\DependencyAnalysis\DehydratedDataNode.cs (4)
12using Debug = System.Diagnostics.Debug; 141Debug.Assert(reloc.Offset >= sourcePosition); 207Debug.Assert(sourcePosition == reloc.Offset); 307Debug.Assert(sourcePosition == o.Data.Length);
Compiler\DependencyAnalysis\DelegateMarshallingDataNode.cs (2)
10using Debug = System.Diagnostics.Debug; 25Debug.Assert(type.IsDelegate);
Compiler\DependencyAnalysis\DelegateTargetVirtualMethodNode.cs (3)
23Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 49Debug.Assert(declaration.GetCanonMethodTarget(CanonicalFormKind.Specific) == declaration); 50Debug.Assert(implementation.GetCanonMethodTarget(CanonicalFormKind.Specific) == implementation);
Compiler\DependencyAnalysis\DictionaryLayoutNode.cs (7)
40Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any)); 41Debug.Assert(type.IsDefType); 46Debug.Assert(method != null && method.IsSharedByGenericInstantiations); 61Debug.Assert(_owningMethodOrType is MethodDesc); 135Debug.Assert(builder.CountBytes - offsetBefore == factory.Target.PointerSize); 156Debug.Assert(HasFixedSlots); 284Debug.Assert(_layout == null, "Trying to add entry but layout already computed");
Compiler\DependencyAnalysis\DispatchCellNode.cs (4)
30Debug.Assert(targetMethod.HasInstantiation || targetMethod.OwningType.IsInterface); 31Debug.Assert(!targetMethod.IsSharedByGenericInstantiations); 54Debug.Assert(_offset != InvalidOffset); 73Debug.Assert(_offset == InvalidOffset);
Compiler\DependencyAnalysis\DynamicDependencyAttributesOnEntityNode.cs (5)
33Debug.Assert(entity is EcmaMethod || entity is EcmaField); 147Debug.Fail("Did we introduce a new overload?"); 196Debug.Fail("Did we introduce a new overload?"); 214Debug.Fail("Did we introduce a new overload?"); 218Debug.Assert(members.Any());
Compiler\DependencyAnalysis\EETypeNode.cs (19)
13using Debug = System.Diagnostics.Debug; 87Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any) || type == type.ConvertToCanonForm(CanonicalFormKind.Specific)); 88Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any) || !type.IsMdArray); // MDArray doesn't have type loader templates 89Debug.Assert(!type.IsGenericParameter); 90Debug.Assert(!type.IsRuntimeDeterminedSubtype); 422Debug.Assert( 439Debug.Assert(defTypeDefinitionRuntimeInterfaces.Length == defTypeRuntimeInterfaces.Length); 445Debug.Assert(interfaceType.IsInterface); 478Debug.Assert(!implMethod.IsVirtual); 700Debug.Assert(objData.CountBytes - ((ISymbolDefinitionNode)this).Offset == GetVTableOffset(objData.TargetPointerSize)); 751Debug.Assert(GCDescSize == 0); 828Debug.Assert(!_type.IsCanonicalSubtype(CanonicalFormKind.Any)); 888Debug.Assert(EmitVirtualSlots); 896Debug.Assert(templateType.BaseType != null); 975Debug.Assert(!declType.IsObject || declMethod.Name != "Finalize"u8); 978Debug.Assert(!declMethod.HasInstantiation); 1229Debug.Assert(_type.IsTypeDefinition || !_type.HasSameTypeDefinition(context.ArrayOfTClass), "Asking for Array<T> MethodTable"); 1254Debug.Assert(bytesEmitted % builder.TargetPointerSize == 0); 1298Debug.Assert(builder.CountBytes == WritableData.GetSize(factory.Target.PointerSize));
Compiler\DependencyAnalysis\EmbeddedObjectNode.cs (5)
8using Debug = System.Diagnostics.Debug; 29Debug.Assert(_offset != InvalidOffset); 38Debug.Assert(_index != InvalidOffset); 45Debug.Assert(_offset == InvalidOffset || _offset == offset); 51Debug.Assert(_index == InvalidOffset || _index == index);
Compiler\DependencyAnalysis\ExactMethodInstantiationsEntryNode.cs (5)
10using Debug = System.Diagnostics.Debug; 20Debug.Assert(!method.IsAbstract); 21Debug.Assert(method.HasInstantiation); 22Debug.Assert(!method.GetCanonMethodTarget(CanonicalFormKind.Specific).IsCanonicalMethod(CanonicalFormKind.Any)); 32Debug.Assert(dependencies != null);
Compiler\DependencyAnalysis\ExternalReferencesTableNode.cs (2)
9using Debug = System.Diagnostics.Debug; 48Debug.Assert(node.Marked);
Compiler\DependencyAnalysis\ExternalTypeMapNode.cs (1)
92Debug.Assert(targetNode.Marked);
Compiler\DependencyAnalysis\ExternalTypeMapRequestNode.cs (1)
8using Debug = System.Diagnostics.Debug;
Compiler\DependencyAnalysis\FatFunctionPointerNode.cs (4)
7using Debug = System.Diagnostics.Debug; 26Debug.Assert(methodRepresented.GetCanonMethodTarget(CanonicalFormKind.Specific) != methodRepresented); 64Debug.Assert(factory.Target.MinimumFunctionAlignment <= factory.Target.PointerSize); 85Debug.Assert(canonMethod.RequiresInstMethodTableArg());
Compiler\DependencyAnalysis\FieldMetadataNode.cs (4)
12using Debug = System.Diagnostics.Debug; 32Debug.Assert(field.IsTypicalFieldDefinition); 78Debug.Assert(!factory.MetadataManager.IsReflectionBlocked(_field)); 79Debug.Assert(factory.MetadataManager.CanGenerateMetadata(_field));
Compiler\DependencyAnalysis\FieldRvaDataNode.cs (2)
10using Debug = System.Diagnostics.Debug; 22Debug.Assert(field.HasRva);
Compiler\DependencyAnalysis\FrozenObjectNode.cs (2)
9using Debug = System.Diagnostics.Debug; 43Debug.Assert(dataBuilder.CountBytes == sizeBefore + ContentSize);
Compiler\DependencyAnalysis\FrozenRuntimeTypeNode.cs (2)
8using Debug = System.Diagnostics.Debug; 19Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\GCStaticsNode.cs (3)
9using Debug = System.Diagnostics.Debug; 21Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); 22Debug.Assert(!type.IsGenericDefinition);
Compiler\DependencyAnalysis\GCStaticsPreInitDataNode.cs (5)
7using Debug = System.Diagnostics.Debug; 23Debug.Assert(!preinitializationInfo.Type.IsCanonicalSubtype(CanonicalFormKind.Specific)); 70Debug.Assert(padding >= 0); 79Debug.Assert(builder.CountBytes - currentOffset == field.FieldType.GetElementSize().AsInt); 83Debug.Assert(pad >= 0);
Compiler\DependencyAnalysis\GenericDefinitionEETypeNode.cs (2)
9using Debug = System.Diagnostics.Debug; 17Debug.Assert(type.IsGenericDefinition);
Compiler\DependencyAnalysis\GenericDictionaryNode.cs (8)
169Debug.Assert(!owningType.IsCanonicalSubtype(CanonicalFormKind.Any)); 170Debug.Assert(!owningType.IsRuntimeDeterminedSubtype); 171Debug.Assert(owningType.HasInstantiation); 172Debug.Assert(owningType.ConvertToCanonForm(CanonicalFormKind.Specific) != owningType); 263Debug.Assert(builder.CountBytes == ((ISymbolDefinitionNode)this).Offset); 276Debug.Assert(!owningMethod.IsSharedByGenericInstantiations); 277Debug.Assert(owningMethod.HasInstantiation); 278Debug.Assert(owningMethod.GetCanonMethodTarget(CanonicalFormKind.Specific) != owningMethod);
Compiler\DependencyAnalysis\GenericLookupResult.cs (49)
30Debug.Assert(owningTypeDefinition.Instantiation.Length == TypeInstantiation.Length); 31Debug.Assert(MethodInstantiation.IsNull || MethodInstantiation.Length == 0); 36Debug.Assert(_canonicalOwner is MethodDesc); 38Debug.Assert(owningMethodDefinition.Instantiation.Length == MethodInstantiation.Length); 44Debug.Assert(owningType.Instantiation.Length == TypeInstantiation.Length); 49Debug.Assert(owningMethodDefinition.OwningType.Instantiation.IsNull 120Debug.Assert(InstantiationIsConcrete(dictionary.TypeInstantiation)); 121Debug.Assert(InstantiationIsConcrete(dictionary.MethodInstantiation)); 167Debug.Assert(x.GetType() == y.GetType()); 172Debug.Assert(result != 0); 178Debug.Assert(x.GetType() != y.GetType()); 196Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 208Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 255Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 266Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 313Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 324Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 371Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 387Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 434Debug.Assert(method.IsRuntimeDeterminedExactMethod, "Concrete method in a generic dictionary?"); 447Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 499Debug.Assert(field.OwningType.IsRuntimeDeterminedSubtype, "Concrete field in a generic dictionary?"); 510Debug.Assert(!instantiatedField.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)); 555Debug.Assert(method.IsRuntimeDeterminedExactMethod, "Concrete method in a generic dictionary?"); 569Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 620Debug.Assert(method.IsRuntimeDeterminedExactMethod); 638Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 703Debug.Assert(method.IsRuntimeDeterminedExactMethod); 704Debug.Assert(method.IsVirtual); 705Debug.Assert(method.HasInstantiation || method.OwningType.IsInterface); 733Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 783Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?"); 784Debug.Assert(type is MetadataType); 795Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 840Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?"); 841Debug.Assert(type is MetadataType); 852Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 896Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?"); 897Debug.Assert(type is MetadataType); 908Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 953Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 964Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 1005Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?"); 1016Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any)); 1064Debug.Assert(_constraintType.IsRuntimeDeterminedSubtype || _constrainedMethod.IsRuntimeDeterminedExactMethod, "Concrete type in a generic dictionary?"); 1065Debug.Assert(!_constrainedMethod.HasInstantiation || !_directCall, "Direct call to constrained generic method isn't supported"); 1094Debug.Assert(!instantiatedConstrainedMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 1095Debug.Assert(!instantiatedConstraintType.IsCanonicalSubtype(CanonicalFormKind.Any)); 1134Debug.Assert(instantiatedConstraintType.IsValueType || (instantiatedConstrainedMethod.OwningType.IsInterface && instantiatedConstrainedMethod.Signature.IsStatic));
Compiler\DependencyAnalysis\GenericMethodsHashtableEntryNode.cs (2)
10using Debug = System.Diagnostics.Debug; 29Debug.Assert(dependencies != null);
Compiler\DependencyAnalysis\GenericMethodsHashtableNode.cs (2)
53Debug.Assert(method.HasInstantiation && !method.IsCanonicalMethod(CanonicalFormKind.Any)); 100Debug.Assert(method.HasInstantiation && !method.IsCanonicalMethod(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\GenericMethodsTemplateMap.cs (2)
57Debug.Assert(layoutNode.Marked); 96Debug.Assert(method == method.GetCanonMethodTarget(CanonicalFormKind.Specific));
Compiler\DependencyAnalysis\GenericStaticBaseInfoNode.cs (2)
22Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any)); 23Debug.Assert(type.HasInstantiation);
Compiler\DependencyAnalysis\GenericTypesTemplateMap.cs (2)
91Debug.Assert(type.Instantiation.Length == 1); 118Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific));
Compiler\DependencyAnalysis\GenericVarianceNode.cs (6)
9using Debug = System.Diagnostics.Debug; 79Debug.Assert(typeDefinition.IsTypeDefinition); 80Debug.Assert(typeDefinition.HasInstantiation); 82Debug.Assert((byte)Internal.TypeSystem.GenericVariance.Contravariant == (byte)GenericVariance.Contravariant); 83Debug.Assert((byte)Internal.TypeSystem.GenericVariance.Covariant == (byte)GenericVariance.Covariant); 125Debug.Assert(Equals(other));
Compiler\DependencyAnalysis\GenericVirtualMethodImplNode.cs (3)
22Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 23Debug.Assert(method.HasInstantiation); 27Debug.Assert(method.IsVirtual || (method.Signature.IsStatic && !method.IsAbstract));
Compiler\DependencyAnalysis\GenericVirtualMethodTableNode.cs (3)
48Debug.Assert(!callingMethod.OwningType.IsInterface); 62Debug.Assert(!callingMethod.OwningType.IsInterface); 102Debug.Assert(!gvmEntry.Key.OwningType.IsInterface);
Compiler\DependencyAnalysis\ILScanNodeFactory.cs (2)
6using Debug = System.Diagnostics.Debug; 47Debug.Assert(!method.Signature.IsStatic);
Compiler\DependencyAnalysis\InterfaceDispatchMapNode.cs (8)
23Debug.Assert(!type.IsArrayTypeWithoutGenericInterfaces()); 24Debug.Assert(MightHaveInterfaceDispatchMap(type, factory)); 25Debug.Assert(type.ConvertToCanonForm(CanonicalFormKind.Specific) == type); 104Debug.Assert(declMethod.IsVirtual); 148Debug.Assert(declTypeRuntimeInterfaces.Length == declTypeDefinitionRuntimeInterfaces.Length); 165Debug.Assert(interfaceType.IsInterface); 267Debug.Assert(providingInterfaceDefinitionType != null); 276Debug.Assert(indexOfInterface >= 0);
Compiler\DependencyAnalysis\InterfaceGenericVirtualMethodTableNode.cs (7)
50Debug.Assert(callingMethod.OwningType.IsInterface); 83Debug.Assert(callingMethod.OwningType.IsInterface); 116Debug.Assert(numIfacesAdded > 0); 147Debug.Assert(gvmEntry.Key.OwningType.IsInterface); 173Debug.Assert(impl is DefaultInterfaceMethodResolution); 187Debug.Assert(_interfaceImpls.ContainsKey(impl)); 207Debug.Assert(((uint)ifaceId) < implementationType.RuntimeInterfaces.Length);
Compiler\DependencyAnalysis\InterfaceUseNode.cs (3)
10using Debug = System.Diagnostics.Debug; 25Debug.Assert(type.IsTypeDefinition); 26Debug.Assert(type.IsInterface);
Compiler\DependencyAnalysis\ManagedDataDescriptorNode.cs (1)
83Debug.Assert(builder.CountBytes == headerSize);
Compiler\DependencyAnalysis\MetadataEETypeNode.cs (1)
15Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\MethodAssociatedDataNode.cs (3)
30Debug.Assert(!methodNode.Method.IsAbstract); 31Debug.Assert(methodNode.Method.GetCanonMethodTarget(CanonicalFormKind.Specific) == methodNode.Method); 66Debug.Assert(MethodHasAssociatedData(_methodNode));
Compiler\DependencyAnalysis\MethodExceptionHandlingInfoNode.cs (1)
21Debug.Assert(data.DefinedSymbols == null || data.DefinedSymbols.Length == 0);
Compiler\DependencyAnalysis\MethodMetadataNode.cs (4)
14using Debug = System.Diagnostics.Debug; 36Debug.Assert(method.IsTypicalMethodDefinition); 142Debug.Assert(!factory.MetadataManager.IsReflectionBlocked(_method)); 143Debug.Assert(factory.MetadataManager.CanGenerateMetadata(_method));
Compiler\DependencyAnalysis\ModuleMetadataNode.cs (2)
10using Debug = System.Diagnostics.Debug; 27Debug.Assert(module is IAssemblyDesc, "Multi-module assemblies?");
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (46)
39Debug.Assert(Marked); 87Debug.Assert(SavedVertex == null || ReferenceEquals(SavedVertex, value)); 163Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 171Debug.Assert(_instantiationArgsSig == null || (_instantiationArgsSig != null && _method.Instantiation.Length == _instantiationArgsSig.Length)); 284Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 295Debug.Assert(_signature.Length == _parametersSig.Length); 337Debug.Assert(type.IsDefType); 361Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 386Debug.Fail("UNREACHABLE"); 405Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 422Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 433Debug.Fail("UNREACHABLE"); 445Debug.Assert(type.HasInstantiation && !type.IsGenericDefinition); 465Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 480Debug.Assert(!type.IsRuntimeDeterminedSubtype); 481Debug.Assert(!type.HasInstantiation || type.IsGenericDefinition); 497Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 527Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 644Debug.Assert(method.HasInstantiation); 666Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 674Debug.Assert(NeedsEntrypoint(_method)); 709Debug.Assert(nodeFactory.LazyGenericsPolicy.UsesLazyGenerics(owningMethod)); 710Debug.Assert(owningMethod.IsCanonicalMethod(CanonicalFormKind.Any)); 711Debug.Assert(owningMethod.HasInstantiation); 716Debug.Assert(nodeFactory.LazyGenericsPolicy.UsesLazyGenerics(owningType)); 717Debug.Assert(owningType.IsCanonicalSubtype(CanonicalFormKind.Any)); 727Debug.Assert(owningMethod.HasInstantiation); 765Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 770Debug.Assert(associatedLayout.Marked); 809Debug.Assert(method.HasInstantiation); 810Debug.Assert(!method.IsGenericMethodDefinition); 811Debug.Assert(method.IsCanonicalMethod(CanonicalFormKind.Any)); 812Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method, "Assert that the canonical method passed in is in standard canonical form"); 849Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 886Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any)); 887Debug.Assert(type.ConvertToCanonForm(CanonicalFormKind.Specific) == type, "Assert that the canonical type passed in is in standard canonical form"); 897Debug.Assert(GenericTypesTemplateMap.IsArrayTypeEligibleForTemplate(type)); 899Debug.Assert(defType.Instantiation.Length == 1); 1007Debug.Assert(Marked, "WriteVertex should only happen for marked vertices"); 1288Debug.Assert(method.HasInstantiation); 1331Debug.Assert(method.HasInstantiation); 1371Debug.Assert(field.OwningType.IsRuntimeDeterminedSubtype); 1465Debug.Assert(_constrainedMethod.OwningType.IsInterface); 1466Debug.Assert(!_constrainedMethod.HasInstantiation || !directCall); 1531Debug.Assert(SignatureKind is FixupSignatureKind.GenericConstrainedMethod); 1537Debug.Assert(SignatureKind is FixupSignatureKind.NonGenericStaticConstrainedMethod or FixupSignatureKind.NonGenericInstanceConstrainedMethod);
Compiler\DependencyAnalysis\NodeFactory.cs (34)
197Debug.Assert(_compilationModuleGroup.ShouldReferenceThroughImportTable(type)); 228Debug.Assert(gcStaticsNode is GCStaticsNode); 423Debug.Assert(method.OwningType.IsGenericDefinition || !VTable(method.OwningType).HasKnownVirtualMethodUse); 520Debug.Assert(method.IsStaticConstructor); 521Debug.Assert(PreinitializationManager.HasEagerStaticConstructor((MetadataType)method.OwningType)); 551Debug.Assert(CompilationModuleGroup.ContainsTypeDictionary(type)); 552Debug.Assert(!this.LazyGenericsPolicy.UsesLazyGenerics(type)); 648Debug.Assert(!_compilationModuleGroup.ShouldReferenceThroughImportTable(type)); 673Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any)); 674Debug.Assert(!_compilationModuleGroup.ShouldReferenceThroughImportTable(type)); 696Debug.Assert(!type.IsCanonicalDefinitionType(CanonicalFormKind.Any)); 697Debug.Assert(!_compilationModuleGroup.ShouldReferenceThroughImportTable(type)); 698Debug.Assert(!type.IsGenericDefinition); 757Debug.Assert(!TypeCannotHaveEEType(type)); 783Debug.Assert(type is not AsyncContinuationType); 785Debug.Assert(!TypeCannotHaveEEType(type)); 810Debug.Assert(!TypeCannotHaveEEType(type)); 829Debug.Assert(_compilationModuleGroup.ShouldReferenceThroughImportTable(type)); 837Debug.Assert(!TypeCannotHaveEEType(type)); 845Debug.Assert(!TypeCannotHaveEEType(type)); 864Debug.Assert(_compilationModuleGroup.ContainsType(type)); 1118Debug.Assert(!unboxingStub); 1128Debug.Assert(!unboxingStub); 1390Debug.Assert(!_factory.VTable(key.OwningType).HasKnownVirtualMethodUse); 1445Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1455Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1465Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1475Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1485Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1495Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1505Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1521Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1531Debug.Assert(MetadataManager is UsageBasedMetadataManager); 1823Debug.Assert(ownerType.HasStaticConstructor);
Compiler\DependencyAnalysis\NonGCStaticsNode.cs (7)
10using Debug = System.Diagnostics.Debug; 27Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); 28Debug.Assert(!type.IsGenericDefinition); 200Debug.Assert(classConstructorContextStorageSize >= GetClassConstructorContextSize(_type.Context.Target)); 236Debug.Assert(padding >= 0); 242Debug.Assert(builder.CountBytes - currentOffset == field.FieldType.GetElementSize().AsInt); 246Debug.Assert(pad >= 0);
Compiler\DependencyAnalysis\NotReadOnlyFieldNode.cs (2)
10using Debug = System.Diagnostics.Debug; 23Debug.Assert(!field.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)
Compiler\DependencyAnalysis\PInvokeMethodFixupNode.cs (2)
83Debug.Assert((charsetFlags & MethodFixupCellFlagsConstants.CharSetMask) == charsetFlags); 93Debug.Assert((objcFunctionFlags & MethodFixupCellFlagsConstants.ObjectiveCMessageSendFunctionMask) == objcFunctionFlags);
Compiler\DependencyAnalysis\PInvokeModuleFixupNode.cs (2)
10using Debug = System.Diagnostics.Debug; 63Debug.Assert((dllImportSearchPath & InteropDataConstants.HasDllImportSearchPath) == 0);
Compiler\DependencyAnalysis\ProxyTypeMapNode.cs (1)
75Debug.Assert(valueNode.Marked);
Compiler\DependencyAnalysis\ProxyTypeMapRequestNode.cs (1)
8using Debug = System.Diagnostics.Debug;
Compiler\DependencyAnalysis\ReadyToRunGenericHelperNode.cs (4)
36Debug.Assert(factory.MarkingComplete); 42Debug.Assert( 64Debug.Assert(factory.GenericLookup.Type((TypeDesc)target) != factory.GenericLookup.UnwrapNullableType((TypeDesc)target)); 263Debug.Assert(templateLayout != null);
Compiler\DependencyAnalysis\ReadyToRunHeaderNode.cs (1)
9using Debug = System.Diagnostics.Debug;
Compiler\DependencyAnalysis\ReadyToRunHelperNode.cs (2)
10using Debug = System.Diagnostics.Debug; 79Debug.Assert(!method.IsCanonicalMethod(CanonicalFormKind.Any) ||
Compiler\DependencyAnalysis\ReflectedDelegateNode.cs (3)
10using Debug = System.Diagnostics.Debug; 23Debug.Assert(delegateType is null || delegateType.IsDelegate); 29Debug.Assert(delegateType is null
Compiler\DependencyAnalysis\ReflectedFieldNode.cs (3)
10using Debug = System.Diagnostics.Debug; 26Debug.Assert(!field.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any) 35Debug.Assert(!factory.MetadataManager.IsReflectionBlocked(_field.GetTypicalFieldDefinition()));
Compiler\DependencyAnalysis\ReflectedMethodNode.cs (3)
10using Debug = System.Diagnostics.Debug; 27Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 35Debug.Assert(!factory.MetadataManager.IsReflectionBlocked(_method.GetTypicalMethodDefinition()));
Compiler\DependencyAnalysis\ReflectedTypeNode.cs (2)
10using Debug = System.Diagnostics.Debug; 28Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any)
Compiler\DependencyAnalysis\ReflectionInvokeMapNode.cs (4)
10using Debug = System.Diagnostics.Debug; 42Debug.Assert(factory.MetadataManager.IsReflectionInvokable(method)); 43Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 141Debug.Assert(method == method.GetCanonMethodTarget(CanonicalFormKind.Specific));
Compiler\DependencyAnalysis\ReflectionVirtualInvokeMapNode.cs (3)
74Debug.Assert(declaringMethodForSlot != null); 127Debug.Assert(!mappingEntry.Entity.IsAsyncVariant()); 190Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\ResourceDataNode.cs (1)
128Debug.Assert(currentPos == indexData.NativeOffset);
Compiler\DependencyAnalysis\RuntimeFieldHandleNode.cs (2)
17Debug.Assert(!targetField.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any)); 18Debug.Assert(!targetField.OwningType.IsRuntimeDeterminedSubtype);
Compiler\DependencyAnalysis\RuntimeMethodHandleNode.cs (3)
20Debug.Assert(!targetMethod.IsSharedByGenericInstantiations); 21Debug.Assert(!targetMethod.IsAsyncVariant()); 24Debug.Assert((targetMethod.HasInstantiation && targetMethod.IsMethodDefinition)
Compiler\DependencyAnalysis\ScannedMethodNode.cs (4)
13using Debug = System.Diagnostics.Debug; 33Debug.Assert(!method.IsAbstract); 34Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 81Debug.Assert(_dependencies != null);
Compiler\DependencyAnalysis\SealedVTableNode.cs (7)
25Debug.Assert(!type.IsArrayTypeWithoutGenericInterfaces()); 26Debug.Assert(!type.IsRuntimeDeterminedSubtype); 153Debug.Assert(declTypeRuntimeInterfaces.Length == declTypeDefinitionRuntimeInterfaces.Length); 305Debug.Assert(interfaceDefinition == null || method.GetTypicalMethodDefinition().OwningType == interfaceDefinition.GetTypeDefinition()); 330Debug.Assert(_interfaceDefinition == null || !method.IsCanonicalMethod(CanonicalFormKind.Any)); 339Debug.Assert(method.GetTypicalMethodDefinition().OwningType == interfaceDefinition.GetTypeDefinition()); 340Debug.Assert(interfaceDefinition.IsInterface);
Compiler\DependencyAnalysis\StackTraceLineNumbersNode.cs (3)
12using Debug = System.Diagnostics.Debug; 74Debug.Assert((factory.MetadataManager.StackTracePolicy.GetMethodVisibility(mapping.Method) & MethodStackTraceVisibilityFlags.HasLineNumbers) != 0); 106Debug.Assert(currentDocument == null || currentNativeOffset != sequencePoint.NativeOffset);
Compiler\DependencyAnalysis\StackTraceMethodMappingNode.cs (2)
11using Debug = System.Diagnostics.Debug; 74Debug.Assert(x.MethodInstantiationArgumentCollectionHandle == y.MethodInstantiationArgumentCollectionHandle);
Compiler\DependencyAnalysis\StaticsInfoHashtableNode.cs (1)
45Debug.Assert(metadataType.HasInstantiation && !metadataType.IsCanonicalSubtype(CanonicalFormKind.Any));
Compiler\DependencyAnalysis\StringAllocatorMethodNode.cs (2)
12using Debug = System.Diagnostics.Debug; 38Debug.Assert(constructorMethod.IsConstructor && constructorMethod.OwningType.IsString);
Compiler\DependencyAnalysis\Target_ARM\ARMReadyToRunGenericHelperNode.cs (7)
10using Debug = System.Diagnostics.Debug; 67Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 93Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 126Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 169Debug.Assert(contextRegister == encoder.TargetRegister.Arg2); 177Debug.Assert(target.Constructor.Method.Signature.Length == 3); 182Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_ARM\ARMReadyToRunHelperNode.cs (6)
97Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 105Debug.Assert(slot != -1); 116Debug.Assert(target.Constructor.Method.Signature.Length == 3); 121Debug.Assert(target.Constructor.Method.Signature.Length == 2); 143Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 146Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\Target_ARM64\ARM64ReadyToRunGenericHelperNode.cs (7)
10using Debug = System.Diagnostics.Debug; 66Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 92Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 124Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 167Debug.Assert(contextRegister == encoder.TargetRegister.Arg2); 175Debug.Assert(target.Constructor.Method.Signature.Length == 3); 180Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_ARM64\ARM64ReadyToRunHelperNode.cs (6)
112Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 120Debug.Assert(slot != -1); 131Debug.Assert(target.Constructor.Method.Signature.Length == 3); 136Debug.Assert(target.Constructor.Method.Signature.Length == 2); 158Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 161Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\Target_LoongArch64\LoongArch64ReadyToRunGenericHelperNode.cs (7)
10using Debug = System.Diagnostics.Debug; 66Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 93Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 126Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 169Debug.Assert(contextRegister == encoder.TargetRegister.Arg2); 177Debug.Assert(target.Constructor.Method.Signature.Length == 3); 182Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_LoongArch64\LoongArch64ReadyToRunHelperNode.cs (6)
104Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 112Debug.Assert(slot != -1); 123Debug.Assert(target.Constructor.Method.Signature.Length == 3); 128Debug.Assert(target.Constructor.Method.Signature.Length == 2); 150Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 153Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\Target_RiscV64\RiscV64ReadyToRunGenericHelperNode.cs (7)
10using Debug = System.Diagnostics.Debug; 65Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 91Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 123Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 166Debug.Assert(contextRegister == encoder.TargetRegister.Arg2); 174Debug.Assert(target.Constructor.Method.Signature.Length == 3); 179Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_RiscV64\RiscV64ReadyToRunHelperNode.cs (6)
102Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 110Debug.Assert(slot != -1); 121Debug.Assert(target.Constructor.Method.Signature.Length == 3); 126Debug.Assert(target.Constructor.Method.Signature.Length == 2); 148Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 151Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\Target_X64\X64ReadyToRunGenericHelperNode.cs (7)
10using Debug = System.Diagnostics.Debug; 68Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 96Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 131Debug.Assert(contextRegister == encoder.TargetRegister.Arg0); 177Debug.Assert(contextRegister == encoder.TargetRegister.Arg2); 185Debug.Assert(target.Constructor.Method.Signature.Length == 3); 190Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_X64\X64ReadyToRunHelperNode.cs (6)
116Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 125Debug.Assert(slot != -1); 136Debug.Assert(target.Constructor.Method.Signature.Length == 3); 141Debug.Assert(target.Constructor.Method.Signature.Length == 2); 164Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 167Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\Target_X86\X86ReadyToRunGenericHelperNode.cs (3)
10using Debug = System.Diagnostics.Debug; 174Debug.Assert(target.Constructor.Method.Signature.Length == 3); 183Debug.Assert(target.Constructor.Method.Signature.Length == 2);
Compiler\DependencyAnalysis\Target_X86\X86ReadyToRunHelperNode.cs (6)
120Debug.Assert(!target.TargetMethod.CanMethodBeInSealedVTable(factory)); 129Debug.Assert(slot != -1); 141Debug.Assert(target.Constructor.Method.Signature.Length == 3); 149Debug.Assert(target.Constructor.Method.Signature.Length == 2); 173Debug.Assert(!targetMethod.CanMethodBeInSealedVTable(factory)); 176Debug.Assert(slot != -1);
Compiler\DependencyAnalysis\TentativeInstanceMethodNode.cs (3)
7using Debug = System.Diagnostics.Debug; 27Debug.Assert(!methodNode.Method.Signature.IsStatic); 28Debug.Assert(!methodNode.Method.OwningType.IsValueType);
Compiler\DependencyAnalysis\TentativeMethodNode.cs (2)
12using Debug = System.Diagnostics.Debug; 82Debug.Assert(!_methodNode.RepresentsIndirectionCell);
Compiler\DependencyAnalysis\ThreadStaticsNode.cs (4)
23Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Specific)); 24Debug.Assert(!type.IsGenericDefinition); 110Debug.Assert(_type != null); 143Debug.Assert(other != null);
Compiler\DependencyAnalysis\TypeGVMEntriesNode.cs (2)
48Debug.Assert(associatedType.IsTypeDefinition); 49Debug.Assert(!associatedType.IsInterface);
Compiler\DependencyAnalysis\TypeMetadataNode.cs (5)
10using Debug = System.Diagnostics.Debug; 30Debug.Assert(type.IsTypeDefinition); 138Debug.Assert(type.IsDefType); 185Debug.Assert(!factory.MetadataManager.IsReflectionBlocked(_type)); 186Debug.Assert(factory.MetadataManager.CanGenerateMetadata(_type));
Compiler\DependencyAnalysis\TypeThreadStaticIndexNode.cs (1)
75Debug.Assert(_inlinedThreadStatics.IndexFromBeginningOfArray == 0);
Compiler\DependencyAnalysis\UnboxingStubNode.cs (3)
7using Debug = System.Diagnostics.Debug; 28Debug.Assert(target.GetCanonMethodTarget(CanonicalFormKind.Specific) == target); 29Debug.Assert(target.OwningType.IsValueType);
Compiler\DependencyAnalysis\VariantInterfaceMethodUseNode.cs (10)
10using Debug = System.Diagnostics.Debug; 28Debug.Assert(!decl.IsRuntimeDeterminedExactMethod); 29Debug.Assert(decl.IsVirtual); 30Debug.Assert(decl.OwningType.IsInterface); 35Debug.Assert(MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(decl) == decl); 38Debug.Assert(!decl.HasInstantiation); 41Debug.Assert(decl.IsTypicalMethodDefinition); 48Debug.Assert(implementedInterface.IsInterface); 49Debug.Assert(!implementedInterface.IsGenericDefinition); 97Debug.Assert(calledMethod.IsVirtual);
Compiler\DependencyAnalysis\VTableSliceNode.cs (10)
10using Debug = System.Diagnostics.Debug; 24Debug.Assert(!type.IsArray, "Wanted to call GetClosestDefType?"); 25Debug.Assert(!type.IsGenericDefinition); 125Debug.Assert(Array.IndexOf(_slots, slot) >= 0); 178Debug.Assert(Array.IndexOf(_slots, slot) >= 0); 197Debug.Assert(!virtualMethod.HasInstantiation); 198Debug.Assert(virtualMethod.IsVirtual); 199Debug.Assert(virtualMethod.OwningType == _type); 200Debug.Assert(Array.IndexOf(_slots, virtualMethod) >= 0); 202Debug.Assert(!_isLocked);
Compiler\DescriptorMarker.cs (2)
142Debug.Fail(member.GetType().ToString()); 178Debug.Assert(ShouldProcessElement(nav));
Compiler\GenericDictionaryLookup.cs (7)
9using Debug = System.Diagnostics.Debug; 41Debug.Assert(_offset1 == UseHelperOffset); 53Debug.Assert(_offset1 == UseHelperOffset); 84Debug.Assert(!UseHelper && !UseNull); 93Debug.Assert(!UseHelper && !UseNull); 94Debug.Assert(index < NumberOfIndirections); 118Debug.Assert(offset1 != UseHelperOffset);
Compiler\HardwareIntrinsicHelpers.Aot.cs (5)
11using Debug = System.Diagnostics.Debug; 28Debug.Assert(IsIsSupportedMethod(method)); 29Debug.Assert(isSupportedField.IsStatic && isSupportedField.FieldType.IsWellKnownType(WellKnownType.Int32)); 45Debug.Fail("Unsupported Architecture"); 97Debug.Fail("Unsupported Architecture");
Compiler\ILScanner.cs (13)
19using Debug = System.Diagnostics.Debug; 199Debug.Assert(mangledName != null || methodDesc != null); 446Debug.Assert(methodOrType is MethodDesc); 678Debug.Assert(!implType.IsInterface); 753Debug.Assert(type.NormalizeInstantiation() == type); 754Debug.Assert(ConstructedEETypeNode.CreationAllowed(type)); 760Debug.Assert(type.NormalizeInstantiation() == type); 761Debug.Assert(ConstructedEETypeNode.CreationAllowed(type)); 767Debug.Assert(type.NormalizeInstantiation() == type); 768Debug.Assert(ConstructedEETypeNode.CreationAllowed(type)); 774Debug.Assert(type.IsGenericDefinition); 920Debug.Assert(t.ThreadGcStaticFieldAlignment.AsInt <= factory.Target.PointerSize); 985Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any));
Compiler\LibraryInitializers.cs (2)
9using Debug = System.Diagnostics.Debug; 46Debug.Assert(_libraryInitializerMethods == null);
Compiler\Logger.cs (1)
272Debug.Assert(owningMethod != originMember);
Compiler\Logging\DocumentationSignatureGenerator.PartVisitor.cs (1)
133Debug.Assert(genericParameter.Kind == GenericParameterKind.Type);
Compiler\Logging\DocumentationSignatureParser.cs (14)
60Debug.Assert(results.Count <= 1); 98Debug.Assert(results.Count == 0); 168Debug.Assert(results.Count <= 1); 173Debug.Assert(result is TypeDesc); 284Debug.Assert(results.Count == 0); 294Debug.Assert(results.Count == 0); 317Debug.Assert(bounds > 0); 352Debug.Assert(PeekNextChar(id, index) == '`'); 355Debug.Assert( 396Debug.Assert(results.Count == 0); 424Debug.Assert(typeArguments != null && typeArguments.Count != 0); 529Debug.Assert(module != null); 560Debug.Assert(nestedType.Namespace.IsEmpty); 735Debug.Assert(typeParameterContext != null);
Compiler\Logging\MessageContainer.cs (2)
11using Debug = System.Diagnostics.Debug; 185Debug.Assert(declaringAssembly != null);
Compiler\Logging\MessageOrigin.cs (1)
99Debug.Assert(methodBody.OwningMethod == MemberDefinition);
Compiler\Logging\NativeAotFatalErrorException.cs (4)
23Debug.Assert(message.Category == MessageCategory.Error, $"'{nameof(NativeAotFatalErrorException)}' ought to be used for errors only"); 24Debug.Assert(message.Code != null && message.Code.Value != 0, $"'{nameof(NativeAotFatalErrorException)}' must have a code that indicates a failure"); 33Debug.Assert(message.Category == MessageCategory.Error, $"'{nameof(NativeAotFatalErrorException)}' ought to be used for errors only"); 34Debug.Assert(message.Code != null && message.Code.Value != 0, $"'{nameof(NativeAotFatalErrorException)}' must have a code that indicates failure");
Compiler\Logging\UnconditionalSuppressMessageAttributeState.cs (5)
83Debug.Assert(owningMethod != provider); 127Debug.Assert(property.OwningType == method.OwningType); 133Debug.Assert(@event.OwningType == method.OwningType); 232Debug.Assert(provider is not ModuleDesc); 327Debug.Fail("Trying to operate with unsupported TypeSystemEntity " + entity.GetType().ToString());
Compiler\MetadataBlockingPolicy.cs (4)
6using Debug = System.Diagnostics.Debug; 36Debug.Assert(type.IsTypeDefinition); 42Debug.Assert(method.IsTypicalMethodDefinition); 48Debug.Assert(field.IsTypicalFieldDefinition);
Compiler\MetadataManager.cs (15)
15using Debug = System.Diagnostics.Debug; 131Debug.Assert(comparer.Compare(_dehydratableData[i - 1].Node, _dehydratableData[i].Node) < 0); 146Debug.Assert(result <= ReadyToRunSectionType.ReadonlyBlobRegionEnd); 426Debug.Assert(!method.IsAsyncVariant()); 680Debug.Assert(IsReflectionInvokable(method)); 863Debug.Assert(!factory.CompilationModuleGroup.IsSingleFileCompilation); 868Debug.Assert(record != null); 869Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 874Debug.Assert(!method.IsGenericMethodDefinition && !method.OwningType.IsGenericDefinition); 875Debug.Assert(!IsReflectionBlocked(method)); 932Debug.Assert((stackTraceRecord.Flags & StackTraceRecordFlags.IsHidden) != 0); 1140Debug.Assert(type.IsTypeDefinition); 1194Debug.Assert(type.IsDefType); 1270Debug.Assert(method.IsTypicalMethodDefinition); 1276Debug.Assert(field.IsTypicalFieldDefinition);
Compiler\MstatObjectDumper.cs (3)
20using Debug = System.Diagnostics.Debug; 123Debug.Assert(_frozenObjects.Offset == 0); 146Debug.Assert(_manifestResources.Offset == 0);
Compiler\MultiFileCompilationModuleGroup.cs (1)
55Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) != method);
Compiler\ObjectWriter\CodeView\CodeViewSymbolsBuilder.cs (1)
216Debug.Fail("Unknown variable location type");
Compiler\ObjectWriter\CodeView\CodeViewTypesBuilder.cs (12)
85Debug.Assert(type.IsPrimitive, "it is not a primitive type"); 203Debug.Assert(classDescriptor.IsStruct == 0); 206Debug.Assert(memberCount <= ushort.MaxValue); 207Debug.Assert(arrayDescriptor.Size <= ushort.MaxValue); 243Debug.Assert(typeRecords.Length <= ushort.MaxValue); 328Debug.Assert(memberCount <= ushort.MaxValue); 359Debug.Assert(memberDescriptor.NumberOfArguments <= ushort.MaxValue); 415Debug.Assert(length <= ushort.MaxValue); 500Debug.Assert(_leafRecordType == LF_FIELDLIST || _leafRecordType == LF_METHODLIST); 508Debug.Assert(_leafRecordType == LF_FIELDLIST || _leafRecordType == LF_METHODLIST); 509Debug.Assert(_lastListMemberStart > 0); 519Debug.Assert(_lastListMemberStart > sizeof(ushort));
Compiler\ObjectWriter\Dwarf\DwarfBuilder.cs (1)
267Debug.Assert(type.IsPrimitive, "it is not a primitive type");
Compiler\ObjectWriter\Dwarf\DwarfFde.cs (1)
72Debug.Assert(diff <= 0xFF);
Compiler\ObjectWriter\Dwarf\DwarfInfo.cs (1)
546Debug.Assert(loc.LocationType != VarLocType.VLT_FIXED_VA);
Compiler\ObjectWriter\Dwarf\DwarfInfoWriter.cs (7)
104Debug.Assert(stringsOffset < uint.MaxValue); 113Debug.Assert(stringsOffset < uint.MaxValue); 119Debug.Assert(offset < uint.MaxValue); 142Debug.Assert(offset >= 0); 148Debug.Assert(offset < uint.MaxValue); 168Debug.Assert(offset < uint.MaxValue); 189Debug.Assert(offset < uint.MaxValue);
Compiler\ObjectWriter\Dwarf\DwarfLineSequenceWriter.cs (1)
31Debug.Assert(DwarfLineProgramTableWriter.MaximumOperationsPerInstruction == 1);
Compiler\ObjectWriter\Eabi\EabiUnwindConverter.cs (7)
35Debug.Assert(blobData.Length % 8 == 0); 81Debug.Assert(popOffset == 0); 89Debug.Assert(dwarfReg != 13); // SP 90Debug.Assert(dwarfReg < 15); 98Debug.Assert(cfiOffset == popOffset); 112Debug.Fail("Unknown register"); 162Debug.Assert((pendingSpAdjustment & 3) == 0);
Compiler\ObjectWriter\ElfObjectWriter.Aot.cs (1)
125Debug.Assert(armUnwindInfo.Length <= 1024);
Compiler\ObjectWriter\MachObjectWriter.Aot.cs (2)
125Debug.Assert(blobData.Length % 8 == 0); 183Debug.Assert(cfaRegister == spReg);
Compiler\ObjectWriter\UnixObjectWriter.Aot.cs (6)
14using Debug = System.Diagnostics.Debug; 125Debug.Assert(IsCacheable(x)); 126Debug.Assert(IsCacheable(y)); 139Debug.Assert(IsCacheable(obj)); 155Debug.Assert(IsCacheable(nodeWithCodeInfo)); 161Debug.Assert(IsCacheable(nodeWithCodeInfo));
Compiler\PreinitializationManager.cs (3)
47Debug.Assert(type is MetadataType); 68Debug.Assert(type is MetadataType); 168Debug.Assert(info.IsPreinitialized ||
Compiler\ReachabilityInstrumentationProvider.cs (1)
265Debug.Assert(this == other);
Compiler\RootingServiceProvider.cs (5)
10using Debug = System.Diagnostics.Debug; 82Debug.Assert(o is IDependencyNode<NodeFactory>); 88Debug.Assert(!type.IsGenericDefinition); 103Debug.Assert(!type.IsGenericDefinition); 118Debug.Assert(!type.IsGenericDefinition);
Compiler\SingleFileCompilationModuleGroup.cs (1)
29Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) != method);
Compiler\SingleMethodCompilationModuleGroup.cs (1)
38Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) != method);
Compiler\SubstitutedILProvider.cs (6)
17using Debug = System.Diagnostics.Debug; 514Debug.Assert((flags[srcPos] & OpcodeFlags.InstructionStart) != 0); 515Debug.Assert((flags[srcPos] & OpcodeFlags.VisibleBasicBlockStart) != 0); 649Debug.Assert(newBody[offset] == (byte)ILOpcode.call); 767Debug.Assert(stack.Count == 1); 958Debug.Assert(argIndex != 0);
Compiler\SubstitutionProvider.cs (2)
17using Debug = System.Diagnostics.Debug; 137Debug.Assert(method.Name.StartsWith("get_"u8));
Compiler\TypePreinit.cs (45)
70Debug.Assert(type.HasStaticConstructor); 71Debug.Assert(!type.IsGenericDefinition); 72Debug.Assert(!type.IsRuntimeDeterminedSubtype); 467Debug.Assert(opcode == ILOpcode.ldsflda); 824Debug.Assert(popped.Value is ByRefValueBase); 1281Debug.Assert(normalizedOpcode == ILOpcode.br_s); 1323Debug.Assert(ehRegion.Kind != ILExceptionRegionKind.Finally); 1902Debug.Assert(locationType.IsValueType || locationType.IsPointer || locationType.IsFunctionPointer); 2346Debug.Assert(type.IsValueType || type.IsPointer || type.IsFunctionPointer); 2449Debug.Assert(IsCompatible(type, out _)); 2450Debug.Assert(IsComInterfaceEntryType(entryType)); 2451Debug.Assert(((MetadataType)type).InstanceFieldSize.AsInt % ((MetadataType)entryType).InstanceFieldSize.AsInt == 0); 2507Debug.Assert(_entryType.GetField("IID"u8).Offset.AsInt == 0); 2510Debug.Assert(_entryType.GetField("Vtable"u8).Offset.AsInt == _guidBytes[i].Length); 2517Debug.Assert(targetField.IsStatic && !targetField.HasGCStaticBase && !targetField.IsThreadStatic && !targetField.HasRva); 2631Debug.Assert(IsCompatible(type)); 2632Debug.Assert(type.InstanceFieldSize.AsInt % type.Context.Target.PointerSize == 0); 2779Debug.Assert(field.Offset.AsInt % _parent._type.Context.Target.PointerSize == 0 && field.FieldType.IsFunctionPointer); 2938Debug.Assert(index <= bytes.Length); 2939Debug.Assert(length <= bytes.Length - index); 3020Debug.Assert(field.Name == "_reference"u8); 3042Debug.Assert(field.Name == "_reference"u8); 3212Debug.Assert(type.HasStaticConstructor); 3299Debug.Assert(_methodPointed.Signature.IsStatic == (_target == null)); 3303Debug.Assert(!creationInfo.TargetNeedsVTableLookup); 3307Debug.Assert(!node.RepresentsIndirectionCell); // Shouldn't have allowed this 3312Debug.Assert(creationInfo.Constructor.Method.Name == "InitializeOpenStaticThunk"u8); 3321Debug.Assert(creationInfo.Thunk != null); 3329Debug.Assert(creationInfo.Constructor.Method.Name == "InitializeClosedInstance"u8); 3394Debug.Assert(valueToStore.InstanceBytes.Length == _elementSize); 3422Debug.Assert(!node.RepresentsIndirectionCell); // Arrays are always local 3429Debug.Assert(pointerSize == 8 || pointerSize == 4); 3509Debug.Assert(lengthField.FieldType.IsWellKnownType(WellKnownType.Int32) 3512Debug.Assert(success); 3515Debug.Assert(firstCharField.FieldType.IsWellKnownType(WellKnownType.Char) 3606Debug.Assert(!node.RepresentsIndirectionCell); // Shouldn't have allowed preinitializing this 3652Debug.Assert(!field.IsStatic); 3653Debug.Assert(!field.FieldType.IsGCPointer); 3666Debug.Assert(!field.IsStatic); 3672Debug.Assert(value == null); 3704Debug.Assert(!field.IsStatic); 3705Debug.Assert(!field.FieldType.IsGCPointer); 3806Debug.Assert(IsPreinitialized); 3807Debug.Assert(field.OwningType == Type); 3808Debug.Assert(field.IsStatic && !field.HasRva && !field.IsThreadStatic && !field.IsLiteral);
Compiler\UnixNodeMangler.cs (1)
17Debug.Assert(type.IsValueType);
Compiler\UsageBasedInteropStubManager.cs (2)
11using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.HasInstantiation);
Compiler\UsageBasedMetadataManager.cs (5)
25using Debug = System.Diagnostics.Debug; 165Debug.Assert((GetMetadataCategory(field) & MetadataCategory.RuntimeMapping) != 0); 634Debug.Assert(decl.IsVirtual 655Debug.Assert(methodIL != null || method.IsAbstract || method.IsPInvoke || method.IsInternalCall); 946Debug.Assert(userMethod != methodILDefinition.OwningMethod);
Compiler\UserDefinedTypeDescriptor.cs (9)
50Debug.Assert(type.IsValueType); 59Debug.Assert(type.IsDefType); 351Debug.Fail("Unhandled UserDefinedTypeDescriptor type: {type}"); 401Debug.Assert(type.IsEnum, "GetEnumTypeIndex was called with wrong type"); 403Debug.Assert(defType != null, "GetEnumTypeIndex was called with non def type"); 433Debug.Assert(type.IsArray, "GetArrayTypeIndex was called with wrong type"); 502Debug.Assert(false); 556Debug.Assert(defType != null, "GetClassTypeIndex was called with non def type"); 846Debug.Assert(type.IsPrimitive, "it is not a primitive type");
Compiler\VectorOfTFieldLayoutAlgorithm.cs (2)
8using Debug = System.Diagnostics.Debug; 48Debug.Assert(targetDetails.MaximumSimdVectorLength == SimdVectorLength.None);
Compiler\VirtualMethodCallHelper.cs (3)
15Debug.Assert(method.GetTypicalMethodDefinition().OwningType == interfaceOnDefinition.GetTypeDefinition()); 44Debug.Assert(!implType.IsArrayTypeWithoutGenericInterfaces()); 183Debug.Assert(type.HasGenericDictionarySlot());
Compiler\WindowsNodeMangler.cs (2)
31Debug.Assert(type.IsValueType); 107Debug.Assert(method is Internal.TypeSystem.Ecma.EcmaMethod ecmaMethod && (ecmaMethod.GetRuntimeImportName() != null || ecmaMethod.GetRuntimeExportName() != null));
IL\ILImporter.Scanner.cs (17)
13using Debug = System.Diagnostics.Debug; 228Debug.Assert(lookup.UseHelper); 236Debug.Assert(_canonMethod.RequiresInstArg() || _canonMethod.AcquiresInstMethodTableFromThis()); 598Debug.Assert(false); break; 755Debug.Assert(!methodAfterConstraintResolution.OwningType.IsInterface 765Debug.Assert(method.OwningType.IsInterface); 798Debug.Assert(targetMethod.IsVirtual && targetMethod.OwningType.IsInterface); 843Debug.Assert(targetMethod.OwningType.IsValueType || targetMethod.Signature.IsStatic); 856Debug.Assert(targetOfLookup.GetCanonMethodTarget(CanonicalFormKind.Specific) == targetMethod.GetCanonMethodTarget(CanonicalFormKind.Specific)); 919Debug.Assert(targetMethod.AcquiresInstMethodTableFromThis()); 932Debug.Assert(!forceUseRuntimeLookup); 974Debug.Assert(targetMethod.OwningType.IsInterface && targetMethod.IsVirtual && _constrained != null); 983Debug.Assert(targetMethod.OwningType.IsInterface && targetMethod.IsVirtual && _constrained != null); 1064Debug.Assert(!_asyncDependenciesReported); 1265Debug.Assert(opCode == ILOpcode.unbox_any); 1336Debug.Assert(_methodIL.OwningMethod.Name == "GetCanonType"u8); 1551Debug.Assert(!type.IsCanonicalSubtype(CanonicalFormKind.Any));
IL\Stubs\PInvokeILProvider.cs (3)
7using Debug = System.Diagnostics.Debug; 43Debug.Assert(directCall); 44Debug.Assert(externName != null);
IL\Stubs\StartupCode\NativeLibraryStartupMethod.Sorting.cs (2)
6using Debug = System.Diagnostics.Debug; 17Debug.Assert(this == other);
IL\Stubs\StartupCode\StartupCodeMainMethod.cs (2)
9using Debug = System.Diagnostics.Debug; 147Debug.Assert((setLatchedExitCode != null) == (shutdown != null));
src\runtime\src\coreclr\tools\Common\Compiler\AsyncContinuationType.cs (1)
59Debug.Assert(_continuationBaseType == ((AsyncContinuationType)other)._continuationBaseType);
src\runtime\src\coreclr\tools\Common\Compiler\AsyncMethodVariant.cs (6)
21Debug.Assert(wrappedMethod.Signature.ReturnsTaskOrValueTask()); 37Debug.Assert(signature.ReturnsTaskOrValueTask()); 89Debug.Assert(!asyncVariant.Signature.ReturnType.IsVoid); 181Debug.Assert(!method.IsAsyncVariant()); 187Debug.Assert(method.IsAsyncVariant()); 193Debug.Assert(method.IsReturnDroppingAsyncThunk());
src\runtime\src\coreclr\tools\Common\Compiler\AsyncMethodVariant.Mangling.cs (1)
7using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\CachingVirtualMethodAlgorithm.cs (1)
26Debug.Assert(type.IsTypeDefinition);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Async.cs (7)
10using Debug = System.Diagnostics.Debug; 39Debug.Assert(originalMethod.Signature.ReturnsTaskOrValueTask()); 40Debug.Assert(resolvedMethod.Signature.ReturnsTaskOrValueTask()); 193Debug.Assert(taskReturningMethod.Signature.ReturnsTaskOrValueTask()); 212Debug.Assert(returnDroppingThunk.IsReturnDroppingAsyncThunk()); 243Debug.Assert(asyncVariantMethod.IsAsyncVariant()); 244Debug.Assert(!asyncVariantMethod.Signature.ReturnType.IsVoid);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (6)
53Debug.Fail("CreateValueFromKey not supported"); 81Debug.Fail("CreateValueFromKey not supported"); 286Debug.Assert(!type.IsArray, "Wanted to call GetClosestMetadataType?"); 296Debug.Assert(_genericsMode == SharedGenericsMode.Disabled); 306Debug.Assert(_genericsMode == SharedGenericsMode.Disabled); 315Debug.Assert(_genericsMode == SharedGenericsMode.Disabled);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Validation.cs (6)
9using Debug = System.Diagnostics.Debug; 104Debug.Assert(!OtherTypesToMarkAsSuccessfullyLoaded.Contains(type)); 146Debug.Assert(typeLoadCheckInProgressStackOffset != -1); 184Debug.Assert(EmptyList.Count == 0); 192Debug.Assert(typeLoadabilityCheck.OtherTypesToMarkAsSuccessfullyLoaded.Count == 0); 306Debug.Assert(type.IsDefType);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Wasm.cs (3)
9using Debug = System.Diagnostics.Debug; 68Debug.Assert(((DefType)type).InstanceFieldSize.AsInt == slotSize * elevation); 69Debug.Assert(((DefType)type).InstanceFieldAlignment.AsInt == slotSize * elevation);
src\runtime\src\coreclr\tools\Common\Compiler\Dataflow\EcmaExtensions.cs (2)
14using Debug = System.Diagnostics.Debug; 52Debug.Assert(signature == null);
src\runtime\src\coreclr\tools\Common\Compiler\DecimalFieldLayoutAlgorithm.cs (6)
6using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsDecimalFloatingPointType(defType)); 61Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 67Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 73Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type)); 79Debug.Assert(_fallbackAlgorithm.ComputeValueTypeShapeCharacteristics(type) == ValueTypeShapeCharacteristics.None);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\CompilerComparer.cs (3)
25Debug.Assert(x.GetType() == y.GetType()); 30Debug.Assert(result != 0); 36Debug.Assert(x.GetType() != y.GetType());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (4)
32Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 33Debug.Assert(method.HasInstantiation); 34Debug.Assert(method.IsVirtual); 35Debug.Assert(MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(method.GetMethodDefinition()) == method.GetMethodDefinition());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\MethodReadOnlyDataNode.cs (1)
43Debug.Assert(_data == null);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\MethodReadWriteDataNode.cs (1)
43Debug.Assert(_data == null);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ObjectDataBuilder.cs (8)
9using Debug = System.Diagnostics.Debug; 120Debug.Assert(_target.PointerSize == 4); 133Debug.Assert(_target.PointerSize == 4); 209Debug.Assert(_numReservations > 0); 261Debug.Assert(node.Marked); 308Debug.Assert(delta == 0); 335Debug.Assert(_numReservations == 0); 355Debug.Assert((align == 2) || (align == 4) || (align == 8) || (align == 16));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Relocation.cs (48)
160Debug.Assert(((uint)Opcode0 & 0xFBF0) == 0xF240); 161Debug.Assert(((uint)Opcode1 & 0xFBF0) == 0xF2C0); 174Debug.Assert(((uint)Opcode0 & 0xFBF0) == 0xF240); 175Debug.Assert(((uint)Opcode1 & 0xFBF0) == 0xF2C0); 182Debug.Assert((uint)GetThumb2Mov32(p) == imm32); 222Debug.Assert(FitsInThumb2BlRel24(imm24)); 226Debug.Assert((imm24 & 1/*THUMB_CODE*/) == 0); 243Debug.Assert(GetThumb2BlRel24(p) == imm24); 278Debug.Assert(FitsInRel21(imm21)); 282Debug.Assert((adrpInstr & 0x9F000000) == 0x90000000); 291Debug.Assert(GetArm64Rel21(pCode) == imm21); 321Debug.Assert(FitsInRel12(imm12)); 325Debug.Assert((addInstr & 0xFFC00000) == 0x91000000); 332Debug.Assert(GetArm64Rel12(pCode) == imm12); 343Debug.Assert(FitsInRel12(imm12)); 347Debug.Assert((addInstr & 0xFFC00000) == 0x91400000); 354Debug.Assert(GetArm64Rel12(pCode) == imm12); 380Debug.Assert(FitsInRel12(imm12)); 381Debug.Assert((imm12 & 7) == 0, "LDR offset must be 8-byte aligned"); 385Debug.Assert((ldrInstr & 0xFFC00000) == 0xF9400000); 397Debug.Assert(GetArm64Rel12Ldr(pCode) == imm12); 419Debug.Assert(FitsInArm64Rel28(imm28)); 421Debug.Assert((imm28 & 0x3) == 0); // the low two bits must be zero 427Debug.Assert((branchInstr & 0x7FFFFFFF) == 0x14000000); // Must be B or BL 434Debug.Assert(GetArm64Rel28(pCode) == imm28); 460Debug.Assert((int)imm == imm); 464Debug.Assert((pcInstr & 0xFE000000) == 0x1a000000); // Must be pcalau12i 480Debug.Assert(GetLoongArch64PC12(pCode) == imm); 500Debug.Assert((imm38 >= -0x2000000000L) && (imm38 < 0x2000000000L)); 502Debug.Assert((imm38 & 0x3) == 0); // the low two bits must be zero 506Debug.Assert(pcInstr == 0x1e000010); // Must be pcaddu18i t4, 0 526Debug.Assert(GetLoongArch64JIR(pCode) == imm38); 544Debug.Assert((auipc & OpcodeMask) == OpcodeAuipc); 546Debug.Assert(auipcRegDest != 0); 553Debug.Assert(opcode == OpcodeLoad || opcode == OpcodeStore || opcode == OpcodeLoadFp || opcode == OpcodeStoreFp || 555Debug.Assert(isStype == (opcode == OpcodeStore || opcode == OpcodeStoreFp)); 557Debug.Assert(auipcRegDest == addrReg); 581Debug.Assert((long)lo12 + (long)hi20 == offset); 600Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == offset); 605Debug.Assert(target != null); 694Debug.Fail("Invalid RelocType: " + relocType); 701Debug.Assert(IsVariableLength(relocType)); 719Debug.Fail("Invalid variable-length RelocType: " + relocType); 789Debug.Assert(IsVariableLength(relocType)); 804Debug.Fail("Invalid reloc type"); 847Debug.Assert((GetArm64Rel12((uint*)location) & 0xFF) == 0); 851Debug.Assert((GetArm64Rel21((uint*)location) & 0xFF) == 0); 883Debug.Fail("Invalid RelocType: " + relocType);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ShadowConcreteMethodNode.cs (2)
11using Debug = System.Diagnostics.Debug; 24Debug.Assert(!method.IsSharedByGenericInstantiations);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ShadowMethodNode.cs (5)
11using Debug = System.Diagnostics.Debug; 47Debug.Assert(!method.IsRuntimeDeterminedExactMethod); 48Debug.Assert(canonicalMethod.Method == method.GetCanonMethodTarget(CanonicalFormKind.Specific)); 49Debug.Assert(canonicalMethod.Method.IsSharedByGenericInstantiations); 99Debug.Assert(canonDep.OtherReasonNode is not INodeWithRuntimeDeterminedDependencies);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ShadowNonConcreteMethodNode.cs (2)
11using Debug = System.Diagnostics.Debug; 24Debug.Assert(method.IsSharedByGenericInstantiations);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\SortableDependencyNode.cs (3)
185Debug.Assert(x.GetType() == y.GetType() || 192Debug.Assert(result != 0 || x == y); 198Debug.Assert(x.GetType() != y.GetType());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_ARM\ARMEmitter.cs (18)
40Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 49Debug.Assert(IsValidReg(reg)); 60Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 69Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 78Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 100Debug.Assert(reg >= Register.R0 && (reg <= Register.R12 || reg == TargetRegister.LR)); 110Debug.Assert(IsValidReg(reg) && reg != TargetRegister.SP); 120Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 136Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 150Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 170Debug.Assert(encode >= 8); 171Debug.Assert((imm8 & 0x80) > 0); 179Debug.Assert(offset >= -255 && offset <= 4095); 198Debug.Assert(destination >= Register.R0 && (destination <= Register.R12 || destination == TargetRegister.LR)); 217Debug.Assert(!symbol.RepresentsIndirectionCell); 229Debug.Assert(IsValidReg(destination)); 243Debug.Assert(immediate >= -256 && immediate <= 254); 255Debug.Assert(immediate >= -256 && immediate <= 254);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_ARM64\ARM64Emitter.cs (14)
29Debug.Assert((uint)regDst <= 0x1f); 36Debug.Assert((uint)regDst <= 0x1f); 55Debug.Assert((uint)regDst <= 0x1f); 63Debug.Assert((uint)regDst <= 0x1f); 64Debug.Assert((offset & 3) == 0); 73Debug.Assert((uint)regDst <= 0x1f); 74Debug.Assert((uint)regAddr <= 0x1f); 83Debug.Assert(offset % 8 == 0); 104Debug.Assert((uint)regDst <= 0x1f); 105Debug.Assert((uint)regAddr <= 0x1f); 113Debug.Assert((uint)regDst <= 0x1f); 114Debug.Assert((uint)regAddr <= 0x1f); 141Debug.Assert(immediate % 4 == 0); 155Debug.Assert(immediate % 4 == 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_LoongArch64\LoongArch64Emitter.cs (8)
29Debug.Assert((uint)regDst <= 0x1f); 30Debug.Assert(imm16 <= 0xfff); 53Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 60Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 67Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 74Debug.Assert((imm >= -2048) && (imm <= 2047)); 82Debug.Assert((imm >= 0) && (imm <= 0xfff)); 90Debug.Assert((offset >= -2048) && (offset <= 2047));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_RiscV64\RiscV64Emitter.cs (8)
35Debug.Assert((offset >= -2048) && (offset <= 2047)); 56Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 63Debug.Assert((uint)regDst <= 0x1f); 64Debug.Assert((uint)regSrc <= 0x1f); 65Debug.Assert((offset >= -2048) && (offset <= 2047)); 72Debug.Assert((offset >= -2048) && (offset <= 2047)); 79Debug.Assert((offset >= -2048) && (offset <= 2047)); 86Debug.Assert((offset >= -2048) && (offset <= 2047));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (3)
162Debug.Assert(!result || FuncType.Equals(other.FuncType), 175Debug.Assert(result != 0 || FuncType.Equals(other.FuncType), 248Debug.Assert(totalSize == 1 + paramSize + returnSize);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_X64\X64Emitter.cs (3)
69Debug.Assert(addrMode.Size != AddrModeSize.Int8 && 236Debug.Assert(addrMode.BaseReg >= Register.RegDirect); 396Debug.Assert(addrMode.Size != 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_X86\X86Emitter.cs (4)
22Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 28Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 47Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 224Debug.Assert(addrMode.BaseReg >= Register.RegDirect);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\VirtualMethodUseNode.cs (5)
10using Debug = System.Diagnostics.Debug; 30Debug.Assert(!decl.IsRuntimeDeterminedExactMethod); 31Debug.Assert(decl.IsVirtual); 36Debug.Assert(MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(decl) == decl); 39Debug.Assert(!decl.HasInstantiation);
src\runtime\src\coreclr\tools\Common\Compiler\DevirtualizationManager.cs (3)
6using Debug = System.Diagnostics.Debug; 33Debug.Assert(type.IsDefType); 58Debug.Assert(declMethod.IsVirtual);
src\runtime\src\coreclr\tools\Common\Compiler\DisplayNameHelpers.cs (1)
65Debug.Assert(typicalMethod == @event.RaiseMethod);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Cycles.cs (1)
353Debug.Assert(alreadySeen[idx].Destination == vertex);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.cs (2)
12using Debug = System.Diagnostics.Debug; 226Debug.Assert(!typeContext.IsNull);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.ForEach.cs (1)
53Debug.Assert(type.IsDefType);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.MethodCall.cs (1)
37Debug.Assert(genericTypeParameters.Length == genericTypeArguments.Length);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\ModuleCycleInfo.cs (2)
15using Debug = System.Diagnostics.Debug; 37Debug.Assert(owner is EcmaMethod || owner is EcmaType);
src\runtime\src\coreclr\tools\Common\Compiler\HardwareIntrinsicHelpers.cs (3)
56Debug.Fail("Probably unimplemented"); 143Debug.Assert(InstructionSet.X64_AES == InstructionSet.X86_AES); 144Debug.Assert(InstructionSet.X64_AVX2 == InstructionSet.X86_AVX2);
src\runtime\src\coreclr\tools\Common\Compiler\InstructionSetSupport.cs (18)
115Debug.Assert(InstructionSet.X64_VectorT128 == InstructionSet.X86_VectorT128); 116Debug.Assert(InstructionSet.X64_VectorT256 == InstructionSet.X86_VectorT256); 117Debug.Assert(InstructionSet.X64_VectorT512 == InstructionSet.X86_VectorT512); 121Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT128)); 122Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT256)); 127Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT128)); 168Debug.Assert(false); // Unknown architecture 210Debug.Assert(support[instructionSet.Name] == instructionSet.InstructionSet); 397Debug.Assert(InstructionSet.X86_X86Base == InstructionSet.X64_X86Base); 398Debug.Assert(InstructionSet.X86_AVX2 == InstructionSet.X64_AVX2); 399Debug.Assert(InstructionSet.X86_AVX512 == InstructionSet.X64_AVX512); 401Debug.Assert(InstructionSet.X86_VectorT128 == InstructionSet.X64_VectorT128); 402Debug.Assert(InstructionSet.X86_VectorT256 == InstructionSet.X64_VectorT256); 403Debug.Assert(InstructionSet.X86_VectorT512 == InstructionSet.X64_VectorT512); 408Debug.Assert(supportedInstructionSets.HasInstructionSet(InstructionSet.X86_X86Base)); 409Debug.Assert((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 128)); 427Debug.Assert(supportedInstructionSets.HasInstructionSet(InstructionSet.ARM64_AdvSimd)); 428Debug.Assert((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 128));
src\runtime\src\coreclr\tools\Common\Compiler\Int128FieldLayoutAlgorithm.cs (7)
8using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsIntegerType(defType)); 29Debug.Assert((name == "Int128") || (name == "UInt128")); 62Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 68Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 74Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type)); 80Debug.Assert(_fallbackAlgorithm.ComputeValueTypeShapeCharacteristics(type) == ValueTypeShapeCharacteristics.None);
src\runtime\src\coreclr\tools\Common\Compiler\MethodExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 110Debug.Assert(!method.OwningType.ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable: true));
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (2)
31Debug.Assert(!_compilationUnitPrefix.IsNull); 158Debug.Assert(b);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (2)
8using Debug = System.Diagnostics.Debug; 38Debug.Assert(factory.MarkingComplete);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (7)
164Debug.Assert(alignment > 0 && BitOperations.IsPow2((uint)alignment)); 429Debug.Assert(section.Header.VirtualAddress == 0); 450Debug.Assert(outputFileStream.Position == section.Header.PointerToRawData); 474Debug.Assert(outputFileStream.Position == coffHeader.PointerToSymbolTable); 566Debug.Assert(SizeOfOptionalHeader == 0); 567Debug.Assert(Characteristics == 0); 792Debug.Assert(SectionIndex == uint.MaxValue || SectionIndex < ushort.MaxValue);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
129Debug.Assert(source.CanSeek); 130Debug.Assert(source.Length >= 0);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Eabi\EabiAttributesBuilder.cs (6)
39Debug.Assert(_sectionSize is null); 40Debug.Assert(_subsectionSize is null); 57Debug.Assert(_sectionSize is not null); 58Debug.Assert(_subsectionSize is not null); 69Debug.Assert(_subsectionSize is not null); 77Debug.Assert(_subsectionSize is not null);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (2)
227Debug.Assert(addend >= short.MinValue && addend <= short.MaxValue); 394Debug.Fail("Unsupported architecture");
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (11)
391Debug.Assert(BitOperations.IsPow2(alignment)); 456Debug.Assert(IsSectionSymbolName(symbolName)); 457Debug.Assert(relocType == IMAGE_REL_BASED_DIR64); 485Debug.Assert(!section.IsExecutable, "Executable sections cannot contain RELPTR32 relocations on Mach-O."); 489Debug.Assert(!section.IsZeroFill, "Uninitialized sections cannot contain RELPTR32 relocations on Mach-O."); 677Debug.Assert(FitsInSigned20Bits(inlineAddend), "The RELPTR32 addend cannot fit in ld-prime's signed 20-bit inline encoding."); 818Debug.Assert(_symbolNameToIndex.ContainsKey(_baseSymbolName.Value)); 971Debug.Assert(_symbolNameToIndex.ContainsKey(_baseSymbolName.Value)); 1058Debug.Assert(encoded); 1142Debug.Assert(encoded); 1144Debug.Assert(encoded);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (7)
421Debug.Assert(codeNode.Signature != null, $"Wasm code node {codeNode.GetType()} has null signature"); 432Debug.Assert(((ulong)thumbBit & (ulong)(uint)n.Offset) == 0); 486Debug.Assert(reloc.Offset % _nodeFactory.Target.PointerSize == 0); 489Debug.Assert(!hasPointerRelocs || (nodeContents.Alignment % _nodeFactory.Target.PointerSize) == 0); 622Debug.Assert(LayoutMode == CodeDataLayout.Separate); 627Debug.Assert(LayoutMode == CodeDataLayout.Separate); 729Debug.Assert(b);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (3)
684Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit."); 725Debug.Assert(DosHeader.Length == DosHeaderSize); 828Debug.Assert(outputFileStream.Position <= section.Header.PointerToRawData);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\UnixObjectWriter.cs (1)
13using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (5)
165Debug.Assert(_owningModule != null); 173Debug.Assert(!processAllAssemblies); 174Debug.Assert(_owningModule != null); 185Debug.Assert(!processAllAssemblies); 787Debug.Assert(!string.IsNullOrEmpty(fullName));
src\runtime\src\coreclr\tools\Common\Compiler\PseudoDescExtensions.cs (1)
7using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\TypeExtensions.cs (14)
9using Debug = System.Diagnostics.Debug; 23Debug.Assert(type.IsArray, "IsSealed on a type with no virtual methods?"); 213Debug.Assert(inst1.Length == inst2.Length); 262Debug.Assert(ta.IsDefType); 263Debug.Assert(tb.IsDefType); 337Debug.Assert(ta != null); 344Debug.Assert(ta.IsArray && tb.IsArray && ta != tb); 354Debug.Assert(taElem != tbElem); 544Debug.Assert(!method.OwningType.IsInterface); 550Debug.Assert(potentialMatchingInterfaces != 0); 555Debug.Assert(interfaceType.HasInstantiation); 641Debug.Assert(method.Signature.IsStatic); 645Debug.Assert(method != null); 795Debug.Assert(interfaceType.IsInterface);
src\runtime\src\coreclr\tools\Common\Compiler\TypeMapMetadata.cs (2)
292Debug.Assert(assemblyTargetsMode == TypeMapAssemblyTargetsMode.Traverse, "We should only have pending maps with target modules when we're traversing for type map groups, as opposed to just recording targets."); 387Debug.Fail($"Unexpected TypeMapAttributeKind: {attrKind}");
src\runtime\src\coreclr\tools\Common\Compiler\VectorFieldLayoutAlgorithm.cs (6)
8using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsVectorType(defType)); 79Debug.Assert(defType.Name == "Vector512`1"u8); 131Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 137Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 143Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type));
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
195Debug.Assert(dataBuilder.CountBytes == 0);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.UpdateResourceDataModel.cs (4)
30Debug.Assert(type is string); 50Debug.Assert(name is string); 71Debug.Assert(type is string); 86Debug.Assert(name is string);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
168Debug.Assert(offset < _size); 181Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\DehydratedData.cs (4)
7using Debug = System.Diagnostics.Debug; 38Debug.Assert((command & DehydratedDataCommandMask) == command); 39Debug.Assert(commandData <= MaxShortPayload); 45Debug.Assert((command & DehydratedDataCommandMask) == command);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\EETypeBuilderHelpers.cs (15)
27Debug.Assert((int)TypeFlags.Void == (int)EETypeElementType.Void); 28Debug.Assert((int)TypeFlags.IntPtr == (int)EETypeElementType.IntPtr); 29Debug.Assert((int)TypeFlags.Single == (int)EETypeElementType.Single); 30Debug.Assert((int)TypeFlags.UInt32 == (int)EETypeElementType.UInt32); 31Debug.Assert((int)TypeFlags.Pointer == (int)EETypeElementType.Pointer); 32Debug.Assert((int)TypeFlags.Array == (int)EETypeElementType.Array); 37Debug.Assert(elementType != EETypeElementType.SystemArray); 38Debug.Assert(elementType <= EETypeElementType.FunctionPointer); 226Debug.Assert(numInstanceFieldBytes >= 1); 240Debug.Assert(int.TrailingZeroCount((int)EETypeFlagsEx.ValueTypeFieldPaddingMask) == ValueTypeFieldPaddingConsts.Shift); 241Debug.Assert((valueTypeFieldPadding & ((int)EETypeFlagsEx.ValueTypeFieldPaddingMask >> ValueTypeFieldPaddingConsts.Shift)) == valueTypeFieldPadding); 252Debug.Assert(nullableValueOffset > 0); 255Debug.Assert((nullableValueOffset & (nullableValueOffset - 1)) == 0); 259Debug.Assert(int.TrailingZeroCount((int)EETypeFlagsEx.NullableValueOffsetMask) == NullableValueOffsetConsts.Shift); 260Debug.Assert((log2nullableOffset & ((int)EETypeFlagsEx.NullableValueOffsetMask >> NullableValueOffsetConsts.Shift)) == log2nullableOffset);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\GCDescEncoder.cs (9)
6using Debug = System.Diagnostics.Debug; 43Debug.Assert(numSeries > 0); 55Debug.Assert(numSeries > 0); 117Debug.Assert(initialBuilderPosition + GetGCDescSize(type) == builder.CountBytes); 123Debug.Assert(size >= map.Size); 148Debug.Assert(numSeries > 0); 200Debug.Assert(pointerCount < 64 * 1024); 203Debug.Assert(nonPointerCount * pointerSize < 64 * 1024); 214Debug.Assert(numSeries > 0);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (3)
36Debug.Assert(newLength <= _length); 61Debug.Assert(Ascii.IsValid(value)); 71Debug.Assert(Ascii.IsValid(value), "Non-ASCII character detected");
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (1)
274Debug.Assert(sizeof(CORINFO_RUNTIME_LOOKUP) >= sizeof(CORINFO_CONST_LOOKUP));
src\runtime\src\coreclr\tools\Common\Microsoft\SourceLink\Tools\SourceLinkMap.cs (1)
188Debug.Assert(mappedUri.Suffix.Length == 0);
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (3)
425Debug.Assert(modifyMask != InstrumentationDataProcessingState.Done); 665Debug.Assert(PgoSchemaMergeComparer.Singleton.Compare(schema, mergedElem) == 0); 666Debug.Assert(PgoSchemaMergeComparer.Singleton.Equals(schema, mergedElem));
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\DelegateInfo.cs (4)
10using Debug = System.Diagnostics.Debug; 108Debug.Assert(delegateType.IsDelegate); 109Debug.Assert(delegateType.IsTypeDefinition); 179Debug.Assert(firstParam.IsDefType);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\HelperExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.Signature.Length == 0 && method.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILReader.cs (2)
9using Debug = System.Diagnostics.Debug; 156Debug.Assert((currentOpcode >= ILOpcode.br && currentOpcode <= ILOpcode.blt_un)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\NativeAotILProvider.cs (7)
13using Debug = System.Diagnostics.Debug; 24Debug.Assert(method.IsRuntimeImplemented); 48Debug.Assert(method.IsIntrinsic); 94Debug.Assert(method.IsIntrinsic); 200Debug.Assert(((DefType)elementType).InstanceFieldSize.AsInt == 8); 235Debug.Assert(elementType.IsValueType); 376Debug.Assert(!(method is PInvokeTargetNativeMethod), "Who is asking for IL of PInvokeTargetNativeMethod?");
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ArrayMethodILEmitter.cs (3)
8using Debug = System.Diagnostics.Debug; 23Debug.Assert(method.Kind != ArrayMethodKind.Address, "Should be " + nameof(ArrayMethodKind.AddressWithHiddenArg)); 72Debug.Assert(_method.OwningType.IsMdArray);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\AsyncResumptionStub.cs (2)
11using Debug = System.Diagnostics.Debug; 24Debug.Assert(targetMethod.IsAsyncCall());
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\CalliMarshallingMethodThunk.Mangling.cs (1)
28Debug.Assert((_targetSignature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask) == MethodSignatureFlags.UnmanagedCallingConvention);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ComparerIntrinsics.cs (9)
10using Debug = System.Diagnostics.Debug; 54Debug.Assert(!methodBeingGenerated.IsTypicalMethodDefinition); 65Debug.Assert(comparerType != null); 135Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any)); 179Debug.Assert(context.IsCanonicalDefinitionType(nullableType, CanonicalFormKind.Universal)); 232Debug.Assert(type.CanCastTo(interfaceType.MakeInstantiatedType(type))); 252Debug.Assert(type.IsValueType); 296Debug.Assert(fieldType.IsValueType); 342Debug.Assert(fieldType.IsValueType);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DelegateMarshallingMethodThunk.cs (4)
12using Debug = System.Diagnostics.Debug; 185Debug.Assert(parameterIndex == parameterMetadataArray.Length || sequence <= parameterMetadataArray[parameterIndex].Index); 193Debug.Assert(sequence == parameterMetadataArray[parameterIndex].Index); 247Debug.Fail("Unexpected DelegateMarshallingMethodThunkKind.");
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DelegateMethodILEmitter.cs (4)
8using Debug = System.Diagnostics.Debug; 16Debug.Assert(method.OwningType.IsDelegate); 17Debug.Assert(method.OwningType.IsTypeDefinition); 18Debug.Assert(method.IsRuntimeImplemented);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DelegateThunks.cs (4)
9using Debug = System.Diagnostics.Debug; 158Debug.Assert(specializedMethod.GetTypicalMethodDefinition() == this); 172Debug.Assert(Signature.Length > 0); 493Debug.Assert(specializedMethod.GetTypicalMethodDefinition() == this);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\DynamicInvokeMethodThunk.cs (2)
9using Debug = System.Diagnostics.Debug; 58Debug.Assert(!type.ContainsSignatureVariables(treatGenericParameterLikeSignatureVariable: true));
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\GetCanonTypeIntrinsic.cs (3)
7using Debug = System.Diagnostics.Debug; 18Debug.Assert(target.Signature.Length == 0); 25Debug.Assert(target.Signature.ReturnType == runtimeTypeHandleType);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\GetFieldHelperMethodOverride.cs (2)
12using Debug = System.Diagnostics.Debug; 71Debug.Assert(specializedMethod.GetTypicalMethodDefinition() == this);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\InterlockedIntrinsics.cs (4)
8using Debug = System.Diagnostics.Debug; 23Debug.Assert(((MetadataType)method.OwningType).Name == "Interlocked"u8); 24Debug.Assert(!method.IsGenericMethodDefinition); 47Debug.Assert(size is 1 or 2 or 4 or 8);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\MethodBaseGetCurrentMethodThunk.cs (2)
9using Debug = System.Diagnostics.Debug; 22Debug.Assert(method.IsTypicalMethodDefinition);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\PInvokeILEmitter.cs (9)
8using Debug = System.Diagnostics.Debug; 27Debug.Assert(targetMethod.IsPInvoke || targetMethod is DelegateMarshallingMethodThunk || targetMethod is CalliMarshallingMethodThunk); 84Debug.Assert(parameterIndex == parameterMetadataArray.Length || i <= parameterMetadataArray[parameterIndex].Index); 92Debug.Assert(i == parameterMetadataArray[parameterIndex].Index); 105Debug.Assert(direction == MarshalDirection.Forward); 157Debug.Assert(delegateMethod != null); 257Debug.Fail("Unexpected DelegateMarshallingMethodThunkKind"); 453Debug.Assert(!string.IsNullOrEmpty(ex.Message)); 460Debug.Assert(_targetMethod.IsPInvoke || _targetMethod is DelegateMarshallingMethodThunk || _targetMethod is CalliMarshallingMethodThunk);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\PInvokeLazyFixupField.cs (2)
9using Debug = System.Diagnostics.Debug; 26Debug.Assert(targetMethod.IsPInvoke);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\RuntimeHelpersIntrinsics.cs (2)
9using Debug = System.Diagnostics.Debug; 20Debug.Assert(((MetadataType)method.OwningType).Name == "RuntimeHelpers"u8);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\StreamIntrinsics.cs (2)
8using Debug = System.Diagnostics.Debug; 19Debug.Assert(((MetadataType)method.OwningType).Name == "Stream"u8);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\StructMarshallingThunk.cs (11)
14using Debug = System.Diagnostics.Debug; 100Debug.Fail("Unexpected Struct marshalling thunk type"); 122Debug.Fail("Unexpected Struct marshalling thunk type"); 146Debug.Assert(_interopStateManager != null); 213Debug.Assert(notEmpty); 216Debug.Assert(nativeField != null); 231Debug.Assert(byValMarshaller != null); 259Debug.Assert(!nativeEnumerator.MoveNext()); 280Debug.Assert(notEmpty); 283Debug.Assert(nativeField != null); 320Debug.Assert(!string.IsNullOrEmpty(ex.Message));
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\TypeGetTypeMethodThunk.cs (5)
9using Debug = System.Diagnostics.Debug; 75Debug.Assert(Signature[0] == _helperMethod.Signature[0]); 78Debug.Assert(_helperMethod.Signature[1].IsString); 92Debug.Assert(_helperMethod.Signature[i] == Signature[i - 1]); 98Debug.Assert(_helperMethod.Signature[i].IsWellKnownType(WellKnownType.Boolean));
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\TypeSystemThrowingILEmitter.cs (2)
8using Debug = System.Diagnostics.Debug; 78Debug.Assert(helper.Signature.Length == exception.Arguments.Count + 1);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\UnsafeIntrinsics.cs (7)
8using Debug = System.Diagnostics.Debug; 19Debug.Assert(((MetadataType)method.OwningType).Name == "Unsafe"u8); 101Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 119Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 139Debug.Assert(method.Signature.IsStatic && method.Signature.Length == (write ? 2 : 1)); 157Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 212Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 1);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\InlineArrayType.cs (4)
12using Debug = System.Diagnostics.Debug; 175Debug.Assert(elementType.IsTypeDefinition); 176Debug.Assert(elementType.IsValueType); 177Debug.Assert(!elementType.IsGenericDefinition);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\MarshalHelpers.Aot.cs (3)
7using Debug = System.Diagnostics.Debug; 98Debug.Assert(nativeType.IsPointer || nativeType.IsFunctionPointer); 103Debug.Assert(marshalAs != null && marshalAs.SizeConst.HasValue);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\MarshalHelpers.cs (4)
5using Debug = System.Diagnostics.Debug; 78Debug.Assert(interopStateManager is not null, "An InteropStateManager is required to look up the native representation of a non-blittable struct or class with layout."); 120Debug.Assert(arrayType != null, "Expecting array"); 156Debug.Assert(arrayType != null, "Expecting array");
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.Aot.cs (8)
9using Debug = System.Diagnostics.Debug; 360Debug.Assert(MarshalAsDescriptor.SizeConst.HasValue); 378Debug.Assert(MarshalAsDescriptor.SizeConst.HasValue); 406Debug.Assert(nativeArrayType != null); 407Debug.Assert(ManagedType is ArrayType); 484Debug.Assert(ManagedType is ArrayType); 487Debug.Assert(nativeArrayType != null); 570Debug.Assert(nativeArrayType != null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.cs (17)
9using Debug = System.Diagnostics.Debug; 60Debug.Assert(_nativeType != null); 160Debug.Assert(false); 182Debug.Assert(false); 192Debug.Fail("Unexpectting setting value on non-byref arg"); 201Debug.Assert(false); 397Debug.Assert(parameterIndex == parameterMetadataArray.Length || i <= parameterMetadataArray[parameterIndex].Index); 407Debug.Assert(i == parameterMetadataArray[parameterIndex].Index); 448Debug.Assert(targetMethod.IsPInvoke); 467Debug.Assert(targetMethod.IsPInvoke); 631Debug.Assert(Return || IsHRSwappedRetVal); 937Debug.Assert(codeStream != null); 952Debug.Assert(codeStream != null); 1024Debug.Assert(Return); 1102Debug.Assert(ManagedType is ArrayType); 1112Debug.Assert(NativeType is PointerType); 1807Debug.Assert(_marshallerInstance is null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\NativeStructType.cs (3)
11using Debug = System.Diagnostics.Debug; 182Debug.Assert(!managedStructType.IsGenericDefinition); 202Debug.Assert(popped == managedStructType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\PInvokeDelegateWrapper.cs (3)
11using Debug = System.Diagnostics.Debug; 164Debug.Assert(delegateType.IsDelegate); 266Debug.Assert((int)kind < _methods.Length);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\InteropStateManager.cs (9)
6using Debug = System.Diagnostics.Debug; 51Debug.Assert(delegateType is MetadataType); 69Debug.Assert(delegateType is MetadataType); 87Debug.Assert(delegateType is MetadataType); 100Debug.Assert(delegateType is MetadataType); 125Debug.Assert(managedType is MetadataType); 140Debug.Assert(managedType is MetadataType); 156Debug.Assert(managedType is MetadataType); 172Debug.Assert(managedType is MetadataType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\UnmanagedCallingConventions.cs (8)
57Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 60Debug.Assert(unmanagedCallconv != 0); 97Debug.Assert(method.IsUnmanagedCallersOnly); 104Debug.Assert(method.IsPInvoke); 114Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 140Debug.Assert(delegateType.IsDelegate); 147Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 257Debug.Assert(index == count);
src\runtime\src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
140Debug.Assert(hashCode == NameHashCode("System.Array`1"u8));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
54Debug.Assert(memberTypes != DynamicallyAccessedMemberTypes.None);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\CompilerGeneratedNames.cs (1)
180Debug.Assert(ch < 0x80);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ForwardDataFlowAnalysis.cs (9)
70Debug.Assert(entryOut != null); 202Debug.Assert(successor.ConditionKind is ConditionKind.WhenTrue or ConditionKind.WhenFalse); 325Debug.Assert(isPredecessorInFinally); 393Debug.Assert(result); 405Debug.Assert(exceptionState != null); 406Debug.Assert(oldExceptionState != null); 413Debug.Assert(enclosingTryOrCatch.Kind != RegionKind.Filter); 445Debug.Assert(finallyExit != null); 448Debug.Assert(finallyExit.Value.ConditionKind == ConditionKind.Unconditional);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (4)
190Debug.Assert(other._values == UnknownSentinel); 206Debug.Assert(other._values == UnknownSentinel); 212Debug.Assert(_values == UnknownSentinel); 242Debug.Assert(_values == UnknownSentinel);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ArrayOfAnnotatedSystemTypeValue.cs (1)
34Debug.Assert(!IsModified);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (4)
95Debug.Assert(requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None); 100Debug.Assert(instanceValue.IsEmpty()); 101Debug.Assert(argumentValues.Count == 1); 525Debug.Fail("Unreachable.");
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableSystemTypeValue.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableValueWithDynamicallyAccessedMembers.cs (1)
23Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableSystemTypeValue.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
ILCompiler.DependencyAnalysisFramework (16)
ComputedStaticDependencyNode.cs (3)
18Debug.Assert(_dependencies == null); 19Debug.Assert(_conditionalDependencies == null); 20Debug.Assert(dependencies != null);
DependencyAnalyzer.cs (3)
94Debug.Assert(dependency.OtherReasonNode is null || dependency.OtherReasonNode.Marked); 246Debug.Assert(currentNode.Marked); 320Debug.Assert(node.StaticDependenciesAreComputed);
DependencyNode.cs (2)
18Debug.Assert(mark != null); 19Debug.Assert(_mark == null);
DgmlWriter.cs (1)
114Debug.Assert(!_nodeMappings.ContainsKey(node));
FirstMarkLogStrategy.cs (3)
50Debug.Assert(reason != null); 101Debug.Assert(markData.Reason1 != null); 110Debug.Assert(markData.Reason != null);
FullGraphLogStrategy.cs (3)
121Debug.Assert(reason != null); 175Debug.Assert(markData.Reason1 != null); 184Debug.Assert(markData.Reason != null);
src\runtime\src\coreclr\tools\Common\Sorting\ICompareAsEqualAction.cs (1)
17Debug.Assert(false);
ILCompiler.MetadataTransform (181)
ILCompiler\Metadata\MetadataTransformResult.cs (5)
8using Debug = System.Diagnostics.Debug; 55Debug.Assert(type.IsTypeDefinition); 72Debug.Assert(type.IsTypeDefinition); 89Debug.Assert(method.IsTypicalMethodDefinition); 113Debug.Assert(field.OwningType.IsTypeDefinition);
ILCompiler\Metadata\Transform.cs (2)
5using Debug = System.Diagnostics.Debug; 50Debug.Assert(type.IsDefType);
ILCompiler\Metadata\Transform.CustomAttribute.cs (3)
12using Debug = System.Diagnostics.Debug; 51Debug.Assert(prolog == 1); 87Debug.Assert((int)Cts.TypeFlags.Boolean == (int)Ecma.SerializationTypeCode.Boolean);
ILCompiler\Metadata\Transform.Field.cs (4)
12using Debug = System.Diagnostics.Debug; 42Debug.Assert(field.GetTypicalFieldDefinition() == field); 43Debug.Assert(_policy.GeneratesMetadata(field)); 91Debug.Assert(header.Kind == Ecma.SignatureKind.Field);
ILCompiler\Metadata\Transform.Method.cs (11)
12using Debug = System.Diagnostics.Debug; 49Debug.Assert(rec is QualifiedMethod || rec is MemberReference || rec is MethodInstantiation); 56Debug.Assert(method.IsTypicalMethodDefinition); 57Debug.Assert(_policy.GeneratesMetadata(method)); 132Debug.Assert(method.IsMethodDefinition); 239Debug.Assert((int)Cts.MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)SignatureCallingConvention.Cdecl); 240Debug.Assert((int)Cts.MethodSignatureFlags.UnmanagedCallingConventionThisCall == (int)SignatureCallingConvention.ThisCall); 241Debug.Assert((int)Cts.MethodSignatureFlags.UnmanagedCallingConventionMask == (int)SignatureCallingConvention.UnmanagedCallingConventionMask); 256Debug.Assert((int)Ecma.SignatureCallingConvention.CDecl == (int)SignatureCallingConvention.Cdecl); 257Debug.Assert((int)Ecma.SignatureCallingConvention.ThisCall == (int)SignatureCallingConvention.ThisCall); 258Debug.Assert((int)Ecma.SignatureCallingConvention.Unmanaged == (int)SignatureCallingConvention.Unmanaged);
ILCompiler\Metadata\Transform.Namespace.cs (2)
10using Debug = System.Diagnostics.Debug; 20Debug.Assert(namespaceString != null);
ILCompiler\Metadata\Transform.Scope.cs (1)
15using Debug = System.Diagnostics.Debug;
ILCompiler\Metadata\Transform.Type.cs (7)
11using Debug = System.Diagnostics.Debug; 67Debug.Assert(type.IsDefType); 80Debug.Assert(!_policy.IsBlocked(metadataType)); 92Debug.Assert(rec is TypeDefinition || rec is TypeReference || rec is TypeSpecification); 194Debug.Assert(parentRecord is TypeDefinition); 215Debug.Assert(entity.IsTypeDefinition); 231Debug.Assert(entity.IsTypeDefinition);
ILCompiler\Metadata\Transform.TypeForwarders.cs (2)
12using Debug = System.Diagnostics.Debug; 42Debug.Fail("Multi-module assemblies");
Internal\Metadata\NativeFormat\Writer\MdBinaryWriter.cs (2)
5using Debug = System.Diagnostics.Debug; 58Debug.Assert(value != null);
Internal\Metadata\NativeFormat\Writer\MdBinaryWriterGen.cs (1)
14using Debug = System.Diagnostics.Debug;
Internal\Metadata\NativeFormat\Writer\NativeFormatWriterGen.cs (36)
17using Debug = System.Diagnostics.Debug; 71Debug.Assert(ElementType == null || 146Debug.Assert(Type == null || 1635Debug.Assert(Value.TrueForAll(handle => handle == null || 2159Debug.Assert(Object.ReferenceEquals(other, popped)); 2187Debug.Assert(Constructor == null || 2191Debug.Assert(FixedArguments.TrueForAll(handle => handle == null || 2311Debug.Assert(Type == null || 2404Debug.Assert(DefaultValue == null || 2509Debug.Assert(Type == null || 2660Debug.Assert(Constraints.TrueForAll(handle => handle == null || 2741Debug.Assert(Parent == null || 2747Debug.Assert(Signature == null || 2915Debug.Assert(Method == null || 2919Debug.Assert(GenericTypeArguments.TrueForAll(handle => handle == null || 3075Debug.Assert(ReturnType == null || 3081Debug.Assert(Parameters.TrueForAll(handle => handle == null || 3087Debug.Assert(VarArgParameters.TrueForAll(handle => handle == null || 3229Debug.Assert(ModifierType == null || 3234Debug.Assert(Type == null || 3315Debug.Assert(Type == null || 3320Debug.Assert(Value == null || 3427Debug.Assert(ParentScopeOrNamespace == null || 3505Debug.Assert(ParentScopeOrNamespace == null || 3586Debug.Assert(DefaultValue == null || 3689Debug.Assert(Type == null || 3782Debug.Assert(DefaultValue == null || 3895Debug.Assert(Type == null || 3901Debug.Assert(Parameters.TrueForAll(handle => handle == null || 4110Debug.Assert(ElementType == null || 4418Debug.Assert(BaseType == null || 4434Debug.Assert(Interfaces.TrueForAll(handle => handle == null || 4592Debug.Assert(GenericType == null || 4597Debug.Assert(GenericTypeArguments.TrueForAll(handle => handle == null || 4670Debug.Assert(ParentNamespaceOrType == null || 4739Debug.Assert(Signature == null ||
Internal\Metadata\NativeFormat\Writer\NativeMetadataWriter.cs (5)
8using Debug = System.Diagnostics.Debug; 177Debug.Assert(rec.GetType() == pooledRecord.GetType()); 330Debug.Assert(realRec.Handle.Offset != 0); 506Debug.Assert(!_gettingHashCode); 513Debug.Assert(_gettingHashCode);
src\runtime\src\coreclr\tools\Common\Internal\LowLevelLinq\LowLevelEnumerable.cs (4)
14Debug.Assert(values != null); 22Debug.Assert(values != null); 31Debug.Assert(source != null); 32Debug.Assert(filter != null);
src\runtime\src\coreclr\tools\Common\Internal\Metadata\NativeFormat\MdBinaryReaderGen.cs (1)
13using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Internal\Metadata\NativeFormat\NativeFormatReaderGen.cs (63)
74Debug.Assert(hType == HandleType.ArraySignature || hType == HandleType.Null); 155Debug.Assert(hType == HandleType.ByReferenceSignature || hType == HandleType.Null); 235Debug.Assert(hType == HandleType.ConstantBooleanArray || hType == HandleType.Null); 315Debug.Assert(hType == HandleType.ConstantBooleanValue || hType == HandleType.Null); 395Debug.Assert(hType == HandleType.ConstantByteArray || hType == HandleType.Null); 475Debug.Assert(hType == HandleType.ConstantByteValue || hType == HandleType.Null); 555Debug.Assert(hType == HandleType.ConstantCharArray || hType == HandleType.Null); 635Debug.Assert(hType == HandleType.ConstantCharValue || hType == HandleType.Null); 715Debug.Assert(hType == HandleType.ConstantDoubleArray || hType == HandleType.Null); 795Debug.Assert(hType == HandleType.ConstantDoubleValue || hType == HandleType.Null); 879Debug.Assert(hType == HandleType.ConstantEnumArray || hType == HandleType.Null); 963Debug.Assert(hType == HandleType.ConstantEnumValue || hType == HandleType.Null); 1043Debug.Assert(hType == HandleType.ConstantHandleArray || hType == HandleType.Null); 1123Debug.Assert(hType == HandleType.ConstantInt16Array || hType == HandleType.Null); 1203Debug.Assert(hType == HandleType.ConstantInt16Value || hType == HandleType.Null); 1283Debug.Assert(hType == HandleType.ConstantInt32Array || hType == HandleType.Null); 1363Debug.Assert(hType == HandleType.ConstantInt32Value || hType == HandleType.Null); 1443Debug.Assert(hType == HandleType.ConstantInt64Array || hType == HandleType.Null); 1523Debug.Assert(hType == HandleType.ConstantInt64Value || hType == HandleType.Null); 1599Debug.Assert(hType == HandleType.ConstantReferenceValue || hType == HandleType.Null); 1679Debug.Assert(hType == HandleType.ConstantSByteArray || hType == HandleType.Null); 1759Debug.Assert(hType == HandleType.ConstantSByteValue || hType == HandleType.Null); 1839Debug.Assert(hType == HandleType.ConstantSingleArray || hType == HandleType.Null); 1919Debug.Assert(hType == HandleType.ConstantSingleValue || hType == HandleType.Null); 2000Debug.Assert(hType == HandleType.ConstantStringArray || hType == HandleType.Null); 2082Debug.Assert(hType == HandleType.ConstantStringValue || hType == HandleType.Null); 2162Debug.Assert(hType == HandleType.ConstantUInt16Array || hType == HandleType.Null); 2242Debug.Assert(hType == HandleType.ConstantUInt16Value || hType == HandleType.Null); 2322Debug.Assert(hType == HandleType.ConstantUInt32Array || hType == HandleType.Null); 2402Debug.Assert(hType == HandleType.ConstantUInt32Value || hType == HandleType.Null); 2482Debug.Assert(hType == HandleType.ConstantUInt64Array || hType == HandleType.Null); 2562Debug.Assert(hType == HandleType.ConstantUInt64Value || hType == HandleType.Null); 2652Debug.Assert(hType == HandleType.CustomAttribute || hType == HandleType.Null); 2749Debug.Assert(hType == HandleType.Event || hType == HandleType.Null); 2850Debug.Assert(hType == HandleType.Field || hType == HandleType.Null); 2931Debug.Assert(hType == HandleType.FieldSignature || hType == HandleType.Null); 3011Debug.Assert(hType == HandleType.FunctionPointerSignature || hType == HandleType.Null); 3112Debug.Assert(hType == HandleType.GenericParameter || hType == HandleType.Null); 3202Debug.Assert(hType == HandleType.MemberReference || hType == HandleType.Null); 3306Debug.Assert(hType == HandleType.Method || hType == HandleType.Null); 3392Debug.Assert(hType == HandleType.MethodInstantiation || hType == HandleType.Null); 3476Debug.Assert(hType == HandleType.MethodSemantics || hType == HandleType.Null); 3575Debug.Assert(hType == HandleType.MethodSignature || hType == HandleType.Null); 3655Debug.Assert(hType == HandleType.MethodTypeVariableSignature || hType == HandleType.Null); 3745Debug.Assert(hType == HandleType.ModifiedType || hType == HandleType.Null); 3839Debug.Assert(hType == HandleType.NamedArgument || hType == HandleType.Null); 3936Debug.Assert(hType == HandleType.NamespaceDefinition || hType == HandleType.Null); 4021Debug.Assert(hType == HandleType.NamespaceReference || hType == HandleType.Null); 4118Debug.Assert(hType == HandleType.Parameter || hType == HandleType.Null); 4199Debug.Assert(hType == HandleType.PointerSignature || hType == HandleType.Null); 4300Debug.Assert(hType == HandleType.Property || hType == HandleType.Null); 4390Debug.Assert(hType == HandleType.PropertySignature || hType == HandleType.Null); 4474Debug.Assert(hType == HandleType.QualifiedField || hType == HandleType.Null); 4558Debug.Assert(hType == HandleType.QualifiedMethod || hType == HandleType.Null); 4639Debug.Assert(hType == HandleType.SZArraySignature || hType == HandleType.Null); 4779Debug.Assert(hType == HandleType.ScopeDefinition || hType == HandleType.Null); 4887Debug.Assert(hType == HandleType.ScopeReference || hType == HandleType.Null); 5025Debug.Assert(hType == HandleType.TypeDefinition || hType == HandleType.Null); 5113Debug.Assert(hType == HandleType.TypeForwarder || hType == HandleType.Null); 5199Debug.Assert(hType == HandleType.TypeInstantiationSignature || hType == HandleType.Null); 5284Debug.Assert(hType == HandleType.TypeReference || hType == HandleType.Null); 5365Debug.Assert(hType == HandleType.TypeSpecification || hType == HandleType.Null); 5445Debug.Assert(hType == HandleType.TypeVariableSignature || hType == HandleType.Null);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (7)
19Debug.Assert(false); 228Debug.Assert(base_ <= base_ + size); 244Debug.Assert((byte*)address >= _base); 245Debug.Assert((byte*)address <= _base + _size); 251Debug.Assert(offset < _size); 258Debug.Assert(false); 392Debug.Assert(value < _reader.Size);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.Primitives.cs (4)
105Debug.Assert(false); 150Debug.Assert(false); 173Debug.Assert(false); 196Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (19)
39Debug.Assert(_offset >= 0); 72Debug.Assert(vertex._offset == Vertex.NotPlaced); 83Debug.Assert(vertex._offset == Vertex.Placed); 241Debug.Assert(val._offset != Vertex.NotPlaced); 330Debug.Assert(vertex._offset == GetCurrentOffset()); 379Debug.Assert(vertex._offset == GetCurrentOffset()); 406Debug.Assert(vertex._offset == Vertex.NotPlaced); 922Debug.Assert(args != null && args.Length > 0); 924Debug.Assert(fptrReferenceId == 0); 1316Debug.Assert(bounds != null && lowerBounds != null); 1575Debug.Assert(writer.GetCurrentOffset() > existingOffset); 1658Debug.Assert(delta >= 0); 1731Debug.Assert(pop == tree); 1740Debug.Assert(pop == second); 1744Debug.Assert(pop == tree); 1757Debug.Assert(pop == tree); 1814Debug.Assert(offset >= 0); 1915Debug.Assert(_nBuckets == 0); 2013Debug.Assert(iEntry == nEntries);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
168Debug.Assert(offset < _size); 181Debug.Assert(false);
ILCompiler.ReadyToRun (905)
Compiler\AssemblyExtensions.cs (1)
11using Debug = System.Diagnostics.Debug;
Compiler\CompilationModuleGroup.ReadyToRun.cs (1)
96Debug.Assert(VersionsWithModule((ModuleDesc)module) || module is MutableModule);
Compiler\DependencyAnalysis\ArrayInterfaceMethodsNode.cs (1)
29Debug.Assert(arrayType.IsSzArray);
Compiler\DependencyAnalysis\EmbeddedObjectNode.cs (5)
8using Debug = System.Diagnostics.Debug; 29Debug.Assert(_offset != InvalidOffset); 38Debug.Assert(_index != InvalidOffset); 45Debug.Assert(_offset == InvalidOffset || _offset == offset); 51Debug.Assert(_index == InvalidOffset || _index == index);
Compiler\DependencyAnalysis\ImportReferenceProvider.cs (1)
26Debug.Assert(module is IEcmaModule);
Compiler\DependencyAnalysis\InheritedVirtualMethodsNode.cs (4)
29Debug.Assert(type.IsDefType && !type.IsInterface); 30Debug.Assert(!type.IsGenericDefinition); 31Debug.Assert(type == type.ConvertToCanonForm(CanonicalFormKind.Specific)); 70Debug.Assert(!canonImpl.OwningType.IsGenericDefinition);
Compiler\DependencyAnalysis\ReadyToRun\AttributePresenceFilterNode.cs (5)
248Debug.Assert(customAttributeConstructorReferenceParentHandle.Kind == HandleKind.TypeSpecification); 261Debug.Assert(firstTypeHandle.Kind == HandleKind.TypeReference); 269Debug.Assert(false); 357Debug.Assert(bucketAIndex == (bucketBIndex ^ (fingerprintHash % bucketCount))); 396Debug.Fail("Not possible to reach here");
Compiler\DependencyAnalysis\ReadyToRun\CopiedCorHeaderNode.cs (4)
10using Debug = System.Diagnostics.Debug; 137Debug.Assert(reader.Offset - headerSize == _module.PEReader.PEHeaders.CorHeaderStartOffset); 138Debug.Assert(builder.CountBytes == headerSize); 139Debug.Assert(headerSize == Size);
Compiler\DependencyAnalysis\ReadyToRun\CopiedFieldRvaNode.cs (3)
13using Debug = System.Diagnostics.Debug; 105Debug.Assert(field.HasRva); 111Debug.Assert(size > 0);
Compiler\DependencyAnalysis\ReadyToRun\CopiedMetadataBlobNode.cs (7)
11using Debug = System.Diagnostics.Debug; 51Debug.Assert(builder.CountBytes == reader.Offset); 82Debug.Assert(builder.CountBytes == reader.Offset); 98Debug.Assert(fieldDesc.HasRva); 142Debug.Assert(builder.CountBytes == metadataBlob.Length); 143Debug.Assert(builder.CountBytes == metadataBlob.Offset); 144Debug.Assert(builder.CountBytes == Size);
Compiler\DependencyAnalysis\ReadyToRun\CopiedMethodILNode.cs (2)
11using Debug = System.Diagnostics.Debug; 25Debug.Assert(!method.IsAbstract);
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryEntryNode.cs (7)
125Debug.Assert(builder.CountBytes <= PerfMapEntrySize); 195Debug.Assert(builder.CountBytes <= RSDSSize); 208Debug.Assert(hash.Length >= 16); 219Debug.Assert(rsdsEntry.Length <= RSDSSize); 249Debug.Assert(checksumLocation.Length == ChecksumSize); 293Debug.Assert(debugEntryIndex >= 0); 311Debug.Assert(entries != null && _debugEntryIndex < entries.Length);
Compiler\DependencyAnalysis\ReadyToRun\DebugDirectoryNode.cs (1)
150Debug.Assert(builder.CountBytes == Size);
Compiler\DependencyAnalysis\ReadyToRun\DebugInfoTableNode.cs (2)
239Debug.Assert(bitsInProgressCount < 8); 317Debug.Assert(offset % 4 == 0);
Compiler\DependencyAnalysis\ReadyToRun\DeferredTillPhaseNode.cs (1)
19Debug.Assert(phase > 0);
Compiler\DependencyAnalysis\ReadyToRun\DelayLoadHelperImport.cs (1)
96Debug.Assert(Table.EntrySize == factory.Target.PointerSize);
Compiler\DependencyAnalysis\ReadyToRun\EnclosingTypeMapNode.cs (1)
52Debug.Assert(_metadata.TypeDefinitions.Count <= (int)ReadyToRunEnclosingTypeMap.MaxTypeCount);
Compiler\DependencyAnalysis\ReadyToRun\ExceptionInfoLookupTableNode.cs (1)
11using Debug = System.Diagnostics.Debug;
Compiler\DependencyAnalysis\ReadyToRun\GCRefMapBuilder.cs (3)
106Debug.Assert(hasAsyncContinuation ? !isUnboxingStub : true); 306Debug.Assert(type is MetadataType); 325Debug.Assert(field.Offset.AsInt == 0);
Compiler\DependencyAnalysis\ReadyToRun\GCRefMapNode.cs (1)
108Debug.Assert(nextOffsetIndex == offsets.Length);
Compiler\DependencyAnalysis\ReadyToRun\GenericLookupSignature.cs (2)
37Debug.Assert(typeArgument != null || methodArgument != null || fieldArgument != null); 108Debug.Assert(_methodArgument.Unboxing == false);
Compiler\DependencyAnalysis\ReadyToRun\HotColdMapNode.cs (1)
20Debug.Assert(_mapping == null);
Compiler\DependencyAnalysis\ReadyToRun\ILBodyFixupSignature.cs (3)
47Debug.Assert(signatureMethod.IsTypicalMethodDefinition); 48Debug.Assert(!signatureMethod.IsCompilerGeneratedILBodyForAsync()); 49Debug.Assert(signatureMethod.GetPrimaryMethodDesc() is EcmaMethod);
Compiler\DependencyAnalysis\ReadyToRun\ImportThunk.cs (1)
99Debug.Assert(base.ComputeNonRelocationBasedDependencies(factory) == null);
Compiler\DependencyAnalysis\ReadyToRun\InliningInfoNode.cs (13)
39Debug.Assert(module == null); // Cross module inlining always covers all modules 43Debug.Assert(module != null); // InliningInfo2 is restricted to a single module at a time 84Debug.Assert(AllowCrossModuleInlines || (inlinerDefinition.Module == _module)); 118Debug.Assert(factory.CompilationModuleGroup.CrossModuleInlineable(inlineeDefinition)); 171Debug.Assert(_module != null); 198Debug.Assert(result != 0); 208Debug.Assert(ridDelta >= 0); 241Debug.Assert(_module == null); 243Debug.Assert(!isCrossModuleInlinee || factory.CompilationModuleGroup.CrossModuleInlineable(inlinee)); 268Debug.Assert(indexA != indexB); 282Debug.Assert(result != 0); 292Debug.Assert(factory.CompilationModuleGroup.CrossModuleInlineable(method)); 344Debug.Assert(!isForeignInliner || crossModuleMultiModuleFormat);
Compiler\DependencyAnalysis\ReadyToRun\InstanceEntryPointTableNode.cs (2)
70Debug.Assert(handle.HasValue); 113Debug.Assert(method.Method.HasInstantiation || method.Method.OwningType.HasInstantiation || method.Method.IsAsyncVariant());
Compiler\DependencyAnalysis\ReadyToRun\InstrumentationDataTableNode.cs (1)
195Debug.Assert(schema != null);
Compiler\DependencyAnalysis\ReadyToRun\ManifestAssemblyMvidHeaderNode.cs (1)
11using Debug = System.Diagnostics.Debug;
Compiler\DependencyAnalysis\ReadyToRun\ManifestMetadataTableNode.cs (6)
16using Debug = System.Diagnostics.Debug; 177Debug.Assert(oldModuleToIndexCount == _assemblyRefToModuleIdMap.Count); 220Debug.Assert(module != null); 224Debug.Assert(module == _mutableModule); 306Debug.Assert(handle.HasValue); 307Debug.Assert(((handle.Value & 0xFFFFFF) + (_assemblyRefCount)) == (idAndAssemblyName.Key - 1));
Compiler\DependencyAnalysis\ReadyToRun\MethodColdCodeNode.cs (1)
57Debug.Assert(_methodColdCode == null);
Compiler\DependencyAnalysis\ReadyToRun\MethodEntryPointTableNode.cs (3)
53Debug.Assert(method.Method is EcmaMethod); 55Debug.Assert(ecmaMethod.Module == _module); 59Debug.Assert(rid != 0);
Compiler\DependencyAnalysis\ReadyToRun\MethodGCInfoNode.cs (2)
124Debug.Assert(bytes != null); 132Debug.Assert(symbol != null);
Compiler\DependencyAnalysis\ReadyToRun\MethodWithGCInfo.cs (15)
38Debug.Assert(!methodDesc.IsUnboxingThunk()); 78Debug.Assert(inlinee.IsNonVersionable()); 90Debug.Assert(_methodCode == null); 224Debug.Assert(cell.ImportOffset % factory.Target.PointerSize == 0); 230Debug.Assert(cell.TableIndex > curTableIndex); 251Debug.Assert(delta > 0); 325Debug.Assert(_frameInfos == null); 342Debug.Assert(_coldFrameInfos == null); 349Debug.Assert(_gcInfo == null); 355Debug.Assert(_ehInfo == null); 365Debug.Assert(_debugLocInfos == null); 373Debug.Assert(_debugVarInfos == null); 381Debug.Assert(_debugEHClauseInfos == null); 449Debug.Assert(resumptionStub.TargetMethod is not AsyncResumptionStub); 461Debug.Assert(_inlinedMethods == null);
Compiler\DependencyAnalysis\ReadyToRun\NibbleWriter.cs (2)
61Debug.Assert((nibble & ~0xF) == 0); 169Debug.Assert(startOffset == totalBytes);
Compiler\DependencyAnalysis\ReadyToRun\ReadyToRunHeaderNode.cs (1)
53Debug.Assert(otherModuleSpecificHeaderTableNode._module != null);
Compiler\DependencyAnalysis\ReadyToRun\ReadyToRunHelperSignature.cs (1)
18Debug.Assert(helper < ReadyToRunHelper.FirstFakeHelper);
Compiler\DependencyAnalysis\ReadyToRun\RuntimeFunctionsTableNode.cs (7)
11using Debug = System.Diagnostics.Debug; 42Debug.Assert(_nodeFactory.MarkingComplete); 43Debug.Assert(method.Marked); 156Debug.Assert((method.FrameInfos.Length + method.ColdFrameInfos.Length) == funcletOffsets.Length); 194Debug.Assert(frameInfo.StartOffset != frameInfo.EndOffset); 211Debug.Assert((mapping.Count == 0), "HotColdMap is null, but mapping is not empty"); 245Debug.Assert(_tableSize >= 0);
Compiler\DependencyAnalysis\ReadyToRun\SignatureBuilder.cs (9)
15using Debug = System.Diagnostics.Debug; 145Debug.Assert(udata <= 0x7f); 153Debug.Assert(udata <= 0x3fff); 162Debug.Assert(udata <= 0x1FFFFFFF); 402Debug.Assert(type.IsSzArray); 409Debug.Assert(type.IsArray && !type.IsSzArray); 459Debug.Assert(methodDefToken.TokenType == CorTokenType.mdtMethodDef); 465Debug.Assert(memberRefToken.TokenType == CorTokenType.mdtMemberRef); 487Debug.Assert(!methodToken.IsNull);
Compiler\DependencyAnalysis\ReadyToRun\StringDiscoverableAssemblyStubNode.cs (2)
35Debug.Assert(!string.IsNullOrEmpty(LookupString), "LookupString must be non-empty"); 36Debug.Assert(!LookupString.Contains('\0'), "LookupString must not contain embedded null characters");
Compiler\DependencyAnalysis\ReadyToRun\TypeFixupSignature.cs (3)
54Debug.Assert(_typeDesc.IsValueType); 75Debug.Assert(type.IsValueType); 146Debug.Assert(alignment == pointerSize);
Compiler\DependencyAnalysis\ReadyToRun\TypeHandle.cs (2)
85Debug.Assert(IsHomogeneousAggregate()); 144Debug.Assert(IsValueType());
Compiler\DependencyAnalysis\ReadyToRun\TypeValidationChecker.cs (1)
666Debug.Assert(type.IsGenericParameter);
Compiler\DependencyAnalysis\ReadyToRun\WasmImportThunk.cs (2)
148Debug.Assert(_thunkKind == ImportThunkKind.DelayLoadHelper); 149Debug.Assert(!instructionEncoder.Is64Bit); // We currently only support 32-bit, and the thunk logic is currently tied to that assumption
Compiler\DependencyAnalysis\ReadyToRun\WasmImportThunkPortableEntrypoint.cs (3)
23Debug.Assert(!import.UseVirtualCall); // We don't currently support these for WASM, so detect them early so we can diagnose issues faster. 24Debug.Assert(import.HelperId != ReadyToRunHelper.GetString); 26Debug.Assert(import.Signature is MethodFixupSignature || import.Signature is GenericLookupSignature);
Compiler\DependencyAnalysis\ReadyToRun\WasmInterpreterToR2RThunkNode.cs (2)
113Debug.Assert(!instructionEncoder.Is64Bit); 290Debug.Assert(targetFuncType.Returns.Types.Length == 1, "Expected exactly one wasm return type");
Compiler\DependencyAnalysis\ReadyToRun\WasmR2RToInterpreterThunkNode.cs (2)
122Debug.Assert(!instructionEncoder.Is64Bit); 387Debug.Assert(_typeNode.Type.Returns.Types.Length == 1, "Expected exactly one wasm return type");
Compiler\DependencyAnalysis\ReadyToRunCodegenNodeFactory.cs (11)
134Debug.Assert(CompilationModuleGroup.ContainsMethodBody(method, false)); 135Debug.Assert(method == method.GetCanonMethodTarget(CanonicalFormKind.Specific)); 191Debug.Assert(method.IsVirtual); 201Debug.Assert(method.IsVirtual); 202Debug.Assert(!method.HasInstantiation); 589Debug.Assert(!key.IsJumpableImportRequired); 611Debug.Assert(!isJumpableImportRequired || !isPrecodeImportRequired); 643Debug.Assert(methodCodeNodeDebug == methodCodeNode); 656Debug.Assert(MarkingComplete); 792Debug.Assert(method.IsTypicalMethodDefinition); 1306Debug.Assert(field.HasRva);
Compiler\DependencyAnalysis\ReadyToRunSymbolNodeFactory.cs (1)
514Debug.Assert(method.IsTypicalMethodDefinition);
Compiler\ExternalReferenceTokenManager.cs (5)
35Debug.Assert(_mutableModule.ModuleThatIsCurrentlyTheSourceOfNewReferences == null); 36Debug.Assert(!_mutableModule.CreatingTokensForAsyncMethod); 60Debug.Assert(_mutableModule.ModuleThatIsCurrentlyTheSourceOfNewReferences == null); 61Debug.Assert(!_mutableModule.CreatingTokensForAsyncMethod); 77Debug.Assert(_mutableModule.ModuleThatIsCurrentlyTheSourceOfNewReferences != null);
Compiler\FileLayoutOptimizer.cs (2)
318Debug.Assert(outputMethods.Count == methodsToPlace.Count); 365Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, methodsToPlace.Count)));
Compiler\PettisHansenSort\PettisHansen.cs (9)
55Debug.Assert(phEdges[kvp.Key][i] == phEdges[i][kvp.Key]); 80Debug.Assert(phEdges[from][to] == phEdges[to][from]); 114Debug.Assert(wfl >= wff && wfl >= wlf && wfl >= wll); 123Debug.Assert(phEdges[loser].Count(e => unionFind.FindSet(e.Key) == winner) == 1); 134Debug.Assert(removed); 152Debug.Assert(unionFind.FindSet(i) == i && unionFind.FindSet(edge.Key) == edge.Key); 153Debug.Assert(phEdges[edge.Key][i] == phEdges[i][edge.Key]); 171Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, graph.Count))); 177Debug.Assert(component[0] > prev);
Compiler\ProfileDataManager.cs (3)
263Debug.Assert(_gdvEntityFinder != null); 271Debug.Assert(_gdvEntityFinder != null); 284Debug.Assert(value is MethodDesc or TypeDesc);
Compiler\R2RTypeExtensions.cs (1)
9using Debug = System.Diagnostics.Debug;
Compiler\ReadyToRunCodegenCompilation.cs (4)
653Debug.Assert(!type.IsValueType); 679Debug.Assert(type != null); 702Debug.Assert(method.IsMethodDefinition); 938Debug.Assert((_nodeFactory.CompilationCurrentPhase == 0) || ((_nodeFactory.CompilationCurrentPhase == 2) && !_finishedFirstCompilationRunInPhase2));
Compiler\ReadyToRunCompilationModuleGroupBase.cs (6)
16using Debug = System.Diagnostics.Debug; 81Debug.Assert(_isCompositeBuildMode || _compilationModuleSet.Count == 1); 107Debug.Assert(_tokenResolver == null); 720Debug.Assert(!VersionsWithType(type)); 868Debug.Fail("Unhandled form of type in VersionsWithTypeReference"); 903Debug.Assert(instType.IsString || instType.IsObject);
Compiler\ReadyToRunCompilerContext.cs (4)
8using Debug = System.Diagnostics.Debug; 29Debug.Assert(type is DefType); 138Debug.Assert(_r2rFieldLayoutAlgorithm != null); 167Debug.Assert(field.IsStatic);
Compiler\ReadyToRunMetadataFieldLayoutAlgorithm.cs (1)
543Debug.Assert(TargetDetails.MaximumLog2PrimitiveSize == 3);
Compiler\ReadyToRunSingleAssemblyCompilationModuleGroup.cs (2)
10using Debug = System.Diagnostics.Debug; 60Debug.Assert(_profileGuidedCompileRestrictionSet);
Compiler\ReadyToRunStandaloneMethodMetadata.cs (1)
114Debug.Assert(expectedFinalSize == _nonCodeAlternateBlob.Count);
Compiler\ReadyToRunTableManager.cs (4)
14using Debug = System.Diagnostics.Debug; 80Debug.Assert(!_sortedMethods); 116Debug.Assert((nodeComparerResult == methodOnlyResult) || 172Debug.Assert(methodCategory == CompiledMethodCategory.NonInstantiated);
Compiler\SystemObjectFieldLayoutAlgorithm.cs (2)
6using Debug = System.Diagnostics.Debug; 30Debug.Assert(0 == layoutFromMetadata.Offsets.Length, "Incompatible system library. The CoreCLR System.Private.CoreLib must be used when compiling in ready-to-run mode.");
Compiler\VersionResilientHashCode.ReadyToRun.cs (1)
21Debug.Assert(assembly == module);
IBC\IBCProfileParser.cs (1)
748Debug.Assert(instantiationArgumentCount > 0);
IBC\MIbcProfileParser.cs (1)
203Debug.Assert(mibcGroupName == "");
IL\ReadyToRunILProvider.cs (7)
149Debug.Assert(method.IsTypicalMethodDefinition); 150Debug.Assert(_manifestMutableModule != null); 153Debug.Assert(!_compilationModuleGroup.VersionsWithMethodBody(method) && 182Debug.Assert(method.IsTypicalMethodDefinition); 200Debug.Assert(method.IsAsync && method is EcmaMethod); 297Debug.Assert(mutableModule.ModuleThatIsCurrentlyTheSourceOfNewReferences == null); 326Debug.Assert(ReadyToRunStandaloneMethodMetadata.Compute((EcmaMethod)_owningMethod.GetPrimaryMethodDesc().GetTypicalMethodDefinition()) != null);
IL\Stubs\PInvokeILEmitter.cs (2)
15using Debug = System.Diagnostics.Debug; 31Debug.Assert(targetMethod.IsPInvoke);
JitInterface\CorInfoImpl.ReadyToRun.cs (40)
153Debug.Assert(!method.IsUnboxingThunk()); 154Debug.Assert(genericContextObject is null or MethodDesc or TypeDesc); 190Debug.Assert(moduleToken.TokenType == CorTokenType.mdtMemberRef); 198Debug.Assert(devirtualizedMethodOwner == null); // Devirtualization is expected to always use a methoddef token 251Debug.Assert(false); // This is expected to fire if and only if we implement devirtualization to default interface methods 317Debug.Assert(false); 908Debug.Assert(type.IsDefType); 918Debug.Assert(type.IsSzArray); 980Debug.Assert(!targetMethodDesc.IsUnboxingThunk()); 1462Debug.Assert(resultMethod is EcmaMethod); 1479Debug.Assert(resultField is EcmaField); 1503Debug.Assert(sigMethod.Index == 0); 1529Debug.Assert(methodIL.GetMethodILScopeDefinition() is IEcmaMethodIL 1594Debug.Assert(_debugVarInfos == null); 1614Debug.Assert(_debugLocInfos == null); 1754Debug.Assert(((int)flags & ((int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET | 2013Debug.Assert(methodOnUnderlyingType != null); 2036Debug.Assert(!moduleToken.IsNull); 2061Debug.Assert(!methodAfterConstraintResolution.OwningType.IsInterface || (isStaticVirtual && methodAfterConstraintResolution.Signature.IsStatic)); 2566Debug.Assert(pResult->codePointerOrStubLookup.lookupKind.needsRuntimeLookup); 2647Debug.Assert(!pResult->sig.hasTypeArg() || _compilation.NodeFactory.Target.IsWasm); 2691Debug.Assert(callerHandle != null); 2731Debug.Assert(templateMethod != null); 2778Debug.Assert(MethodBeingCompiled is not AsyncResumptionStub); 2785Debug.Assert(!strippedInstantiation); 2821Debug.Assert(md.OwningType == td); 2866Debug.Assert(pResult.compileTimeHandle != null); 2917Debug.Assert(typeHandleImport.RepresentsIndirectionCell); 2926Debug.Assert(pResult.compileTimeHandle != null); 3109Debug.Assert(pResult->offset >= (uint)fieldBaseOffset); 3196Debug.Assert(dataBlobNode != null, "Data location without a data blob"); 3269Debug.Assert(_compilation.CompilationModuleGroup.VersionsWithMethodBody(methodDesc)); 3314Debug.Assert(!_compilation.NodeFactory.CompilationModuleGroup.GeneratesPInvoke(method)); 3379Debug.Assert(clauseType.IsObject); 3448Debug.Assert(typicalMethod.IsMethodDefinition); 3454Debug.Assert(_compilation.CompilationModuleGroup.CrossModuleInlineable(ecmaMethod) || 3481Debug.Assert(typicalMethod.IsMethodDefinition); 3505Debug.Assert(imp.GetType() == typeof(DelayLoadMethodImport)); 3524Debug.Assert(fieldHandle != null); 3602Debug.Assert(method != null);
ObjectWriter\MapFileBuilder.cs (1)
53Debug.Assert(Name.AsSpan().SequenceEqual(node.Name.AsSpan()));
src\runtime\src\coreclr\tools\Common\CallingConvention\ArgIterator.cs (34)
134Debug.Assert(IsStructPassedInRegs()); 141Debug.Assert(IsStructPassedInRegs()); 152Debug.Assert(IsStructPassedInRegs()); 169Debug.Assert(eightByteSize == 8); 170Debug.Assert((genRegDest & 7) == 0); 318Debug.Assert(argNum >= 0); 391Debug.Assert(_SIZE_OF_ARG_STACK_COMPUTED); 392Debug.Assert((_nSizeOfArgStack % _transitionBlock.PointerSize) == 0); 412Debug.Assert((size % _transitionBlock.PointerSize) == 0); 474Debug.Assert(!_argTypeHandle.IsNull()); 481Debug.Assert(!_argTypeHandle.IsNull()); 488Debug.Assert(!_argTypeHandle.IsNull()); 528Debug.Assert(IsVarArg); 557Debug.Assert(HasParamType); 600Debug.Assert(HasAsyncContinuation); 677Debug.Assert(!IsVarArg || !HasParamType); 785Debug.Assert(argOfs >= _transitionBlock.OffsetOfArgs); 832Debug.Assert(false); 1004Debug.Assert((cbArg % _transitionBlock.PointerSize) == 0); 1188Debug.Assert(_transitionBlock.IsAppleArm64ABI || (cbArg % _transitionBlock.PointerSize) == 0); 1227Debug.Assert((cbArg & (cbArg - 1)) == 0); 1296Debug.Assert(cFPRegs == 1); 1297Debug.Assert((info.flags & (FpStruct.OnlyOne | FpStruct.BothFloat)) == 0); 1326Debug.Assert((info.flags & (FpStruct.OnlyOne | FpStruct.BothFloat)) != 0); 1340Debug.Assert((cbArg % _transitionBlock.PointerSize) == 0); 1353Debug.Assert(regSlots == 2); 1355Debug.Assert(_rvLa64IdxGenReg == lastReg, "pass head in last register"); 1356Debug.Assert(_rvLa64OfsStack == 0, "pass tail in first stack slot"); 1414Debug.Assert(!_ITERATION_STARTED); 1595Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1634Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1685Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1732Debug.Assert(false); 1741Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0);
src\runtime\src\coreclr\tools\Common\CallingConvention\TransitionBlock.cs (18)
147Debug.Assert(!IsX64UnixABI || offset != StructInRegsOffset); 155Debug.Assert(!IsX86); 157Debug.Assert((offset % PointerSize) == 0); 163Debug.Assert(!IsX86); 169Debug.Assert(!IsX86); 188Debug.Assert(IsX86); 240Debug.Assert(IsX64); 306Debug.Assert(!thRetType.IsNull() && thRetType.IsValueType()); 469Debug.Assert(!th.IsNull()); 470Debug.Assert(th.IsValueType()); 588Debug.Assert(!th.IsNull()); 589Debug.Assert(th.IsValueType()); 616Debug.Assert((parmSize & (parmSize - 1)) == 0); 622Debug.Assert((parmSize % 4) == 0); 653Debug.Assert(!th.IsNull()); 654Debug.Assert(th.IsValueType()); 697Debug.Assert(!th.IsNull()); 698Debug.Assert(th.IsValueType());
src\runtime\src\coreclr\tools\Common\Compiler\AsyncContinuationType.cs (1)
59Debug.Assert(_continuationBaseType == ((AsyncContinuationType)other)._continuationBaseType);
src\runtime\src\coreclr\tools\Common\Compiler\AsyncMethodVariant.cs (6)
21Debug.Assert(wrappedMethod.Signature.ReturnsTaskOrValueTask()); 37Debug.Assert(signature.ReturnsTaskOrValueTask()); 89Debug.Assert(!asyncVariant.Signature.ReturnType.IsVoid); 181Debug.Assert(!method.IsAsyncVariant()); 187Debug.Assert(method.IsAsyncVariant()); 193Debug.Assert(method.IsReturnDroppingAsyncThunk());
src\runtime\src\coreclr\tools\Common\Compiler\AsyncMethodVariant.Mangling.cs (1)
7using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\CachingVirtualMethodAlgorithm.cs (1)
26Debug.Assert(type.IsTypeDefinition);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Async.cs (7)
10using Debug = System.Diagnostics.Debug; 39Debug.Assert(originalMethod.Signature.ReturnsTaskOrValueTask()); 40Debug.Assert(resolvedMethod.Signature.ReturnsTaskOrValueTask()); 193Debug.Assert(taskReturningMethod.Signature.ReturnsTaskOrValueTask()); 212Debug.Assert(returnDroppingThunk.IsReturnDroppingAsyncThunk()); 243Debug.Assert(asyncVariantMethod.IsAsyncVariant()); 244Debug.Assert(!asyncVariantMethod.Signature.ReturnType.IsVoid);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.cs (6)
53Debug.Fail("CreateValueFromKey not supported"); 81Debug.Fail("CreateValueFromKey not supported"); 286Debug.Assert(!type.IsArray, "Wanted to call GetClosestMetadataType?"); 296Debug.Assert(_genericsMode == SharedGenericsMode.Disabled); 306Debug.Assert(_genericsMode == SharedGenericsMode.Disabled); 315Debug.Assert(_genericsMode == SharedGenericsMode.Disabled);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Validation.cs (6)
9using Debug = System.Diagnostics.Debug; 104Debug.Assert(!OtherTypesToMarkAsSuccessfullyLoaded.Contains(type)); 146Debug.Assert(typeLoadCheckInProgressStackOffset != -1); 184Debug.Assert(EmptyList.Count == 0); 192Debug.Assert(typeLoadabilityCheck.OtherTypesToMarkAsSuccessfullyLoaded.Count == 0); 306Debug.Assert(type.IsDefType);
src\runtime\src\coreclr\tools\Common\Compiler\CompilerTypeSystemContext.Wasm.cs (3)
9using Debug = System.Diagnostics.Debug; 68Debug.Assert(((DefType)type).InstanceFieldSize.AsInt == slotSize * elevation); 69Debug.Assert(((DefType)type).InstanceFieldAlignment.AsInt == slotSize * elevation);
src\runtime\src\coreclr\tools\Common\Compiler\Dataflow\EcmaExtensions.cs (2)
14using Debug = System.Diagnostics.Debug; 52Debug.Assert(signature == null);
src\runtime\src\coreclr\tools\Common\Compiler\DecimalFieldLayoutAlgorithm.cs (6)
6using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsDecimalFloatingPointType(defType)); 61Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 67Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 73Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type)); 79Debug.Assert(_fallbackAlgorithm.ComputeValueTypeShapeCharacteristics(type) == ValueTypeShapeCharacteristics.None);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\CompilerComparer.cs (3)
25Debug.Assert(x.GetType() == y.GetType()); 30Debug.Assert(result != 0); 36Debug.Assert(x.GetType() != y.GetType());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\GVMDependenciesNode.cs (4)
32Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 33Debug.Assert(method.HasInstantiation); 34Debug.Assert(method.IsVirtual); 35Debug.Assert(MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(method.GetMethodDefinition()) == method.GetMethodDefinition());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\MethodReadOnlyDataNode.cs (1)
43Debug.Assert(_data == null);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\MethodReadWriteDataNode.cs (1)
43Debug.Assert(_data == null);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ObjectDataBuilder.cs (8)
9using Debug = System.Diagnostics.Debug; 120Debug.Assert(_target.PointerSize == 4); 133Debug.Assert(_target.PointerSize == 4); 209Debug.Assert(_numReservations > 0); 261Debug.Assert(node.Marked); 308Debug.Assert(delta == 0); 335Debug.Assert(_numReservations == 0); 355Debug.Assert((align == 2) || (align == 4) || (align == 8) || (align == 16));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Relocation.cs (48)
160Debug.Assert(((uint)Opcode0 & 0xFBF0) == 0xF240); 161Debug.Assert(((uint)Opcode1 & 0xFBF0) == 0xF2C0); 174Debug.Assert(((uint)Opcode0 & 0xFBF0) == 0xF240); 175Debug.Assert(((uint)Opcode1 & 0xFBF0) == 0xF2C0); 182Debug.Assert((uint)GetThumb2Mov32(p) == imm32); 222Debug.Assert(FitsInThumb2BlRel24(imm24)); 226Debug.Assert((imm24 & 1/*THUMB_CODE*/) == 0); 243Debug.Assert(GetThumb2BlRel24(p) == imm24); 278Debug.Assert(FitsInRel21(imm21)); 282Debug.Assert((adrpInstr & 0x9F000000) == 0x90000000); 291Debug.Assert(GetArm64Rel21(pCode) == imm21); 321Debug.Assert(FitsInRel12(imm12)); 325Debug.Assert((addInstr & 0xFFC00000) == 0x91000000); 332Debug.Assert(GetArm64Rel12(pCode) == imm12); 343Debug.Assert(FitsInRel12(imm12)); 347Debug.Assert((addInstr & 0xFFC00000) == 0x91400000); 354Debug.Assert(GetArm64Rel12(pCode) == imm12); 380Debug.Assert(FitsInRel12(imm12)); 381Debug.Assert((imm12 & 7) == 0, "LDR offset must be 8-byte aligned"); 385Debug.Assert((ldrInstr & 0xFFC00000) == 0xF9400000); 397Debug.Assert(GetArm64Rel12Ldr(pCode) == imm12); 419Debug.Assert(FitsInArm64Rel28(imm28)); 421Debug.Assert((imm28 & 0x3) == 0); // the low two bits must be zero 427Debug.Assert((branchInstr & 0x7FFFFFFF) == 0x14000000); // Must be B or BL 434Debug.Assert(GetArm64Rel28(pCode) == imm28); 460Debug.Assert((int)imm == imm); 464Debug.Assert((pcInstr & 0xFE000000) == 0x1a000000); // Must be pcalau12i 480Debug.Assert(GetLoongArch64PC12(pCode) == imm); 500Debug.Assert((imm38 >= -0x2000000000L) && (imm38 < 0x2000000000L)); 502Debug.Assert((imm38 & 0x3) == 0); // the low two bits must be zero 506Debug.Assert(pcInstr == 0x1e000010); // Must be pcaddu18i t4, 0 526Debug.Assert(GetLoongArch64JIR(pCode) == imm38); 544Debug.Assert((auipc & OpcodeMask) == OpcodeAuipc); 546Debug.Assert(auipcRegDest != 0); 553Debug.Assert(opcode == OpcodeLoad || opcode == OpcodeStore || opcode == OpcodeLoadFp || opcode == OpcodeStoreFp || 555Debug.Assert(isStype == (opcode == OpcodeStore || opcode == OpcodeStoreFp)); 557Debug.Assert(auipcRegDest == addrReg); 581Debug.Assert((long)lo12 + (long)hi20 == offset); 600Debug.Assert(GetRiscV64AuipcCombo(pCode, isStype) == offset); 605Debug.Assert(target != null); 694Debug.Fail("Invalid RelocType: " + relocType); 701Debug.Assert(IsVariableLength(relocType)); 719Debug.Fail("Invalid variable-length RelocType: " + relocType); 789Debug.Assert(IsVariableLength(relocType)); 804Debug.Fail("Invalid reloc type"); 847Debug.Assert((GetArm64Rel12((uint*)location) & 0xFF) == 0); 851Debug.Assert((GetArm64Rel21((uint*)location) & 0xFF) == 0); 883Debug.Fail("Invalid RelocType: " + relocType);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ShadowConcreteMethodNode.cs (2)
11using Debug = System.Diagnostics.Debug; 24Debug.Assert(!method.IsSharedByGenericInstantiations);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\ShadowMethodNode.cs (5)
11using Debug = System.Diagnostics.Debug; 47Debug.Assert(!method.IsRuntimeDeterminedExactMethod); 48Debug.Assert(canonicalMethod.Method == method.GetCanonMethodTarget(CanonicalFormKind.Specific)); 49Debug.Assert(canonicalMethod.Method.IsSharedByGenericInstantiations); 99Debug.Assert(canonDep.OtherReasonNode is not INodeWithRuntimeDeterminedDependencies);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\SortableDependencyNode.cs (3)
185Debug.Assert(x.GetType() == y.GetType() || 192Debug.Assert(result != 0 || x == y); 198Debug.Assert(x.GetType() != y.GetType());
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_ARM\ARMEmitter.cs (18)
40Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 49Debug.Assert(IsValidReg(reg)); 60Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 69Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 78Debug.Assert(IsLowReg(reg) && !IsBitNumOverflow(immediate, 8)); 100Debug.Assert(reg >= Register.R0 && (reg <= Register.R12 || reg == TargetRegister.LR)); 110Debug.Assert(IsValidReg(reg) && reg != TargetRegister.SP); 120Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 136Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 150Debug.Assert(IsValidReg(destination) && IsValidReg(source)); 170Debug.Assert(encode >= 8); 171Debug.Assert((imm8 & 0x80) > 0); 179Debug.Assert(offset >= -255 && offset <= 4095); 198Debug.Assert(destination >= Register.R0 && (destination <= Register.R12 || destination == TargetRegister.LR)); 217Debug.Assert(!symbol.RepresentsIndirectionCell); 229Debug.Assert(IsValidReg(destination)); 243Debug.Assert(immediate >= -256 && immediate <= 254); 255Debug.Assert(immediate >= -256 && immediate <= 254);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_ARM64\ARM64Emitter.cs (14)
29Debug.Assert((uint)regDst <= 0x1f); 36Debug.Assert((uint)regDst <= 0x1f); 55Debug.Assert((uint)regDst <= 0x1f); 63Debug.Assert((uint)regDst <= 0x1f); 64Debug.Assert((offset & 3) == 0); 73Debug.Assert((uint)regDst <= 0x1f); 74Debug.Assert((uint)regAddr <= 0x1f); 83Debug.Assert(offset % 8 == 0); 104Debug.Assert((uint)regDst <= 0x1f); 105Debug.Assert((uint)regAddr <= 0x1f); 113Debug.Assert((uint)regDst <= 0x1f); 114Debug.Assert((uint)regAddr <= 0x1f); 141Debug.Assert(immediate % 4 == 0); 155Debug.Assert(immediate % 4 == 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_LoongArch64\LoongArch64Emitter.cs (8)
29Debug.Assert((uint)regDst <= 0x1f); 30Debug.Assert(imm16 <= 0xfff); 53Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 60Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 67Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 74Debug.Assert((imm >= -2048) && (imm <= 2047)); 82Debug.Assert((imm >= 0) && (imm <= 0xfff)); 90Debug.Assert((offset >= -2048) && (offset <= 2047));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_RiscV64\RiscV64Emitter.cs (8)
35Debug.Assert((offset >= -2048) && (offset <= 2047)); 56Debug.Assert((uint)regDst > 0 && (uint)regDst < 32); 63Debug.Assert((uint)regDst <= 0x1f); 64Debug.Assert((uint)regSrc <= 0x1f); 65Debug.Assert((offset >= -2048) && (offset <= 2047)); 72Debug.Assert((offset >= -2048) && (offset <= 2047)); 79Debug.Assert((offset >= -2048) && (offset <= 2047)); 86Debug.Assert((offset >= -2048) && (offset <= 2047));
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_Wasm\WasmTypes.cs (3)
162Debug.Assert(!result || FuncType.Equals(other.FuncType), 175Debug.Assert(result != 0 || FuncType.Equals(other.FuncType), 248Debug.Assert(totalSize == 1 + paramSize + returnSize);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_X64\X64Emitter.cs (3)
69Debug.Assert(addrMode.Size != AddrModeSize.Int8 && 236Debug.Assert(addrMode.BaseReg >= Register.RegDirect); 396Debug.Assert(addrMode.Size != 0);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\Target_X86\X86Emitter.cs (4)
22Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 28Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 47Debug.Assert(addrMode.Size != AddrModeSize.Int8 && addrMode.Size != AddrModeSize.Int16); 224Debug.Assert(addrMode.BaseReg >= Register.RegDirect);
src\runtime\src\coreclr\tools\Common\Compiler\DependencyAnalysis\VirtualMethodUseNode.cs (5)
10using Debug = System.Diagnostics.Debug; 30Debug.Assert(!decl.IsRuntimeDeterminedExactMethod); 31Debug.Assert(decl.IsVirtual); 36Debug.Assert(MetadataVirtualMethodAlgorithm.FindSlotDefiningMethodForVirtualMethod(decl) == decl); 39Debug.Assert(!decl.HasInstantiation);
src\runtime\src\coreclr\tools\Common\Compiler\DevirtualizationManager.cs (3)
6using Debug = System.Diagnostics.Debug; 33Debug.Assert(type.IsDefType); 58Debug.Assert(declMethod.IsVirtual);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\Graph.Cycles.cs (1)
353Debug.Assert(alreadySeen[idx].Destination == vertex);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.cs (2)
12using Debug = System.Diagnostics.Debug; 226Debug.Assert(!typeContext.IsNull);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.ForEach.cs (1)
53Debug.Assert(type.IsDefType);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\GraphBuilder.MethodCall.cs (1)
37Debug.Assert(genericTypeParameters.Length == genericTypeArguments.Length);
src\runtime\src\coreclr\tools\Common\Compiler\GenericCycleDetection\ModuleCycleInfo.cs (2)
15using Debug = System.Diagnostics.Debug; 37Debug.Assert(owner is EcmaMethod || owner is EcmaType);
src\runtime\src\coreclr\tools\Common\Compiler\HardwareIntrinsicHelpers.cs (3)
56Debug.Fail("Probably unimplemented"); 143Debug.Assert(InstructionSet.X64_AES == InstructionSet.X86_AES); 144Debug.Assert(InstructionSet.X64_AVX2 == InstructionSet.X86_AVX2);
src\runtime\src\coreclr\tools\Common\Compiler\InstructionSetSupport.cs (18)
115Debug.Assert(InstructionSet.X64_VectorT128 == InstructionSet.X86_VectorT128); 116Debug.Assert(InstructionSet.X64_VectorT256 == InstructionSet.X86_VectorT256); 117Debug.Assert(InstructionSet.X64_VectorT512 == InstructionSet.X86_VectorT512); 121Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT128)); 122Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT256)); 127Debug.Assert(!IsInstructionSetOptimisticallySupported(InstructionSet.X64_VectorT128)); 168Debug.Assert(false); // Unknown architecture 210Debug.Assert(support[instructionSet.Name] == instructionSet.InstructionSet); 397Debug.Assert(InstructionSet.X86_X86Base == InstructionSet.X64_X86Base); 398Debug.Assert(InstructionSet.X86_AVX2 == InstructionSet.X64_AVX2); 399Debug.Assert(InstructionSet.X86_AVX512 == InstructionSet.X64_AVX512); 401Debug.Assert(InstructionSet.X86_VectorT128 == InstructionSet.X64_VectorT128); 402Debug.Assert(InstructionSet.X86_VectorT256 == InstructionSet.X64_VectorT256); 403Debug.Assert(InstructionSet.X86_VectorT512 == InstructionSet.X64_VectorT512); 408Debug.Assert(supportedInstructionSets.HasInstructionSet(InstructionSet.X86_X86Base)); 409Debug.Assert((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 128)); 427Debug.Assert(supportedInstructionSets.HasInstructionSet(InstructionSet.ARM64_AdvSimd)); 428Debug.Assert((maxVectorTBitWidth == 0) || (maxVectorTBitWidth >= 128));
src\runtime\src\coreclr\tools\Common\Compiler\Int128FieldLayoutAlgorithm.cs (7)
8using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsIntegerType(defType)); 29Debug.Assert((name == "Int128") || (name == "UInt128")); 62Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 68Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 74Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type)); 80Debug.Assert(_fallbackAlgorithm.ComputeValueTypeShapeCharacteristics(type) == ValueTypeShapeCharacteristics.None);
src\runtime\src\coreclr\tools\Common\Compiler\MethodExtensions.cs (1)
10using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\NativeAotNameMangler.cs (2)
31Debug.Assert(!_compilationUnitPrefix.IsNull); 158Debug.Assert(b);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectDataInterner.cs (2)
8using Debug = System.Diagnostics.Debug; 38Debug.Assert(factory.MarkingComplete);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\CoffObjectWriter.cs (7)
164Debug.Assert(alignment > 0 && BitOperations.IsPow2((uint)alignment)); 429Debug.Assert(section.Header.VirtualAddress == 0); 450Debug.Assert(outputFileStream.Position == section.Header.PointerToRawData); 474Debug.Assert(outputFileStream.Position == coffHeader.PointerToSymbolTable); 566Debug.Assert(SizeOfOptionalHeader == 0); 567Debug.Assert(Characteristics == 0); 792Debug.Assert(SectionIndex == uint.MaxValue || SectionIndex < ushort.MaxValue);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
129Debug.Assert(source.CanSeek); 130Debug.Assert(source.Length >= 0);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Eabi\EabiAttributesBuilder.cs (6)
39Debug.Assert(_sectionSize is null); 40Debug.Assert(_subsectionSize is null); 57Debug.Assert(_sectionSize is not null); 58Debug.Assert(_subsectionSize is not null); 69Debug.Assert(_subsectionSize is not null); 77Debug.Assert(_subsectionSize is not null);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ElfObjectWriter.cs (2)
227Debug.Assert(addend >= short.MinValue && addend <= short.MaxValue); 394Debug.Fail("Unsupported architecture");
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\MachObjectWriter.cs (11)
391Debug.Assert(BitOperations.IsPow2(alignment)); 456Debug.Assert(IsSectionSymbolName(symbolName)); 457Debug.Assert(relocType == IMAGE_REL_BASED_DIR64); 485Debug.Assert(!section.IsExecutable, "Executable sections cannot contain RELPTR32 relocations on Mach-O."); 489Debug.Assert(!section.IsZeroFill, "Uninitialized sections cannot contain RELPTR32 relocations on Mach-O."); 677Debug.Assert(FitsInSigned20Bits(inlineAddend), "The RELPTR32 addend cannot fit in ld-prime's signed 20-bit inline encoding."); 818Debug.Assert(_symbolNameToIndex.ContainsKey(_baseSymbolName.Value)); 971Debug.Assert(_symbolNameToIndex.ContainsKey(_baseSymbolName.Value)); 1058Debug.Assert(encoded); 1142Debug.Assert(encoded); 1144Debug.Assert(encoded);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\ObjectWriter.cs (7)
421Debug.Assert(codeNode.Signature != null, $"Wasm code node {codeNode.GetType()} has null signature"); 432Debug.Assert(((ulong)thumbBit & (ulong)(uint)n.Offset) == 0); 486Debug.Assert(reloc.Offset % _nodeFactory.Target.PointerSize == 0); 489Debug.Assert(!hasPointerRelocs || (nodeContents.Alignment % _nodeFactory.Target.PointerSize) == 0); 622Debug.Assert(LayoutMode == CodeDataLayout.Separate); 627Debug.Assert(LayoutMode == CodeDataLayout.Separate); 729Debug.Assert(b);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\PEObjectWriter.cs (3)
684Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit."); 725Debug.Assert(DosHeader.Length == DosHeaderSize); 828Debug.Assert(outputFileStream.Position <= section.Header.PointerToRawData);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\UnixObjectWriter.cs (1)
13using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSection.cs (3)
47Debug.Assert(headerBuffer.Slice(1).Length == Relocation.WASM_PADDED_RELOC_SIZE_32); 49Debug.Assert((int)readCheck == ContentSize); 93Debug.Assert(wroteHeaderSize == HeaderSize);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmDataSegment.cs (4)
71Debug.Assert(_paddingSet); 88Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32); 97Debug.Assert(headerBuffer.Slice(len).Length == Relocation.WASM_PADDED_RELOC_SIZE_32, $"{headerBuffer.Slice(len).Length} != {Relocation.WASM_PADDED_RELOC_SIZE_32}"); 111Debug.Assert(headerSize == HeaderSize);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmSection.cs (2)
33Debug.Assert(_dataStream != null, $"{this.Name} has null data stream"); 39Debug.Assert(value != null);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Wasm\WasmSections.cs (1)
24Debug.Assert(_sections.Count == sectionIndex);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (16)
220Debug.Assert(adjustSize == encodeSizeExpected); 257Debug.Assert(relocsEncoded == expr.EncodeRelocationCount()); 292Debug.Assert(buffer.Length >= EncodeRelocationCount()); 345Debug.Assert(buffer.Length >= relocSize); 519Debug.Assert(localIndex >= 0); 520Debug.Assert(kind.IsLocalVarExpr()); 544Debug.Assert(globalIndex >= 0); 545Debug.Assert(kind.IsGlobalVarExpr()); 567Debug.Assert(kind.IsBinaryExpr()); 591Debug.Assert(dstMemoryIndex >= 0); 592Debug.Assert(srcMemoryIndex >= 0); 623Debug.Assert(memoryIndex >= 0); 650Debug.Assert(dataSegmentIndex >= 0); 651Debug.Assert(memoryIndex >= 0); 682Debug.Assert(tableIndex >= 0); 683Debug.Assert(elemIndex >= 0);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (37)
92Debug.Assert(added, 189Debug.Assert(bytesWritten == encodeSize); 280Debug.Assert(section != null || alignment == 1, $"Section: {sectionIndex} is not a WebcilSection but alignment {alignment} requested"); 422Debug.Assert(BitOperations.IsPow2(webcilSection.MinAlignment) && BitOperations.IsPow2(WebcilSectionAlignment) && 456Debug.Assert(peCliHeaderRva != 0); 462Debug.Assert(peDebugRva != 0); 469Debug.Assert(webcilSections.Length > 0); 470Debug.Assert(webcilSections[webcilSections.Length - 1].Name.ToString() == "reloc"); 520Debug.Assert(_sections.Sections.Count == sectionIndex); 537Debug.Assert(MethodCount == totalMethodCount); 560Debug.Assert(added, $"Duplicate global name: {name}"); 565Debug.Assert(written == size); 618Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit."); 648Debug.Assert(outputFileStream.CanSeek, $"EmitObjectFile requires seekable output stream"); 735Debug.Assert(section.Header.SizeOfRawData - bytesWritten == section.Padding, $"Unexpected padding: {section.Header.SizeOfRawData - bytesWritten} != {section.Padding}"); 745Debug.Assert(webcilStream.Position == _webcilSegment.GetFlatMappedSize(), $"Total Size Mismatch: {webcilStream.Position} != {_webcilSegment.GetFlatMappedSize()}"); 794Debug.Assert(_sections[sectionIndex] is WebcilSection); 828Debug.Assert(_sections[pending.SectionIndex] is WebcilSection); 830Debug.Assert(pending.Offset >= 0, "Pending base relocation has a negative offset."); 836Debug.Assert(targetRva != 0); // this section should have been assigned a non-zero VirtualAddress at this point. 872Debug.Assert(sectionStream.Position + (long)decoded <= sectionStream.Length); 911Debug.Assert(writeCursor <= blobs[b].Start, $"Write cursor {writeCursor} is beyond the start of blob {blobs[b].Start}"); 929Debug.Assert(sectionStream.Position == firstReloc.Offset, $"Section stream position sectionStream.Position does not match first reloc offset {firstReloc.Offset}"); 948Debug.Assert(nextStart == sectionStream.Position); 955Debug.Assert(tempStream.Position <= blob.Size && blob.Size <= tempStream.Length, $"Temp stream position {tempStream.Position} exceeds blob size {blob.Size}"); 989Debug.Assert(newBlobs.Count == blobs.Count); 992Debug.Assert(newBlobs[i].Size + blobShrink[i] == blobs[i].Size); 1020Debug.Assert(IsWithinSection(virtualRelocOffset, curSectionAsWebcil)); 1031Debug.Assert(IsWithinSection(virtualSymbolImageOffset, symbolWebcilSection)); 1078Debug.Assert(symbolWebcilSection != null); 1082Debug.Assert(symbolWebcilSection != null); 1087Debug.Assert(symbolWebcilSection != null); 1091Debug.Assert(symbolWebcilSection != null); 1148Debug.Assert(symbol.IndexSpace == WasmIndexSpace.Tag); 1186Debug.Assert(sectionStream.CanSeek); 1187Debug.Assert(sectionStream.Length >= 0); 1287Debug.Assert(_definedGlobals.ContainsKey("webcilVersion"));
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmSymbolManager.cs (3)
65Debug.Assert(!_importsFrozen[indexSpace]); 67Debug.Assert(!expectedIndex.HasValue || expectedIndex.Value == ordinal); 137Debug.Assert((uint)indexSpace < (uint)WasmIndexSpace.Count);
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WebcilEncoder.cs (1)
33Debug.Assert(size == 28);
src\runtime\src\coreclr\tools\Common\Compiler\ProcessLinkerXmlBase.cs (5)
165Debug.Assert(_owningModule != null); 173Debug.Assert(!processAllAssemblies); 174Debug.Assert(_owningModule != null); 185Debug.Assert(!processAllAssemblies); 787Debug.Assert(!string.IsNullOrEmpty(fullName));
src\runtime\src\coreclr\tools\Common\Compiler\PseudoDescExtensions.cs (1)
7using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Compiler\TypeExtensions.cs (14)
9using Debug = System.Diagnostics.Debug; 23Debug.Assert(type.IsArray, "IsSealed on a type with no virtual methods?"); 213Debug.Assert(inst1.Length == inst2.Length); 262Debug.Assert(ta.IsDefType); 263Debug.Assert(tb.IsDefType); 337Debug.Assert(ta != null); 344Debug.Assert(ta.IsArray && tb.IsArray && ta != tb); 354Debug.Assert(taElem != tbElem); 544Debug.Assert(!method.OwningType.IsInterface); 550Debug.Assert(potentialMatchingInterfaces != 0); 555Debug.Assert(interfaceType.HasInstantiation); 641Debug.Assert(method.Signature.IsStatic); 645Debug.Assert(method != null); 795Debug.Assert(interfaceType.IsInterface);
src\runtime\src\coreclr\tools\Common\Compiler\TypeMapMetadata.cs (2)
292Debug.Assert(assemblyTargetsMode == TypeMapAssemblyTargetsMode.Traverse, "We should only have pending maps with target modules when we're traversing for type map groups, as opposed to just recording targets."); 387Debug.Fail($"Unexpected TypeMapAttributeKind: {attrKind}");
src\runtime\src\coreclr\tools\Common\Compiler\VectorFieldLayoutAlgorithm.cs (6)
8using Debug = System.Diagnostics.Debug; 26Debug.Assert(IsVectorType(defType)); 79Debug.Assert(defType.Name == "Vector512`1"u8); 131Debug.Assert(!_fallbackAlgorithm.ComputeContainsGCPointers(type)); 137Debug.Assert(!_fallbackAlgorithm.ComputeContainsByRefs(type)); 143Debug.Assert(!_fallbackAlgorithm.ComputeIsUnsafeValueType(type));
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
195Debug.Assert(dataBuilder.CountBytes == 0);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.UpdateResourceDataModel.cs (4)
30Debug.Assert(type is string); 50Debug.Assert(name is string); 71Debug.Assert(type is string); 86Debug.Assert(name is string);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.cs (19)
39Debug.Assert(_offset >= 0); 72Debug.Assert(vertex._offset == Vertex.NotPlaced); 83Debug.Assert(vertex._offset == Vertex.Placed); 241Debug.Assert(val._offset != Vertex.NotPlaced); 330Debug.Assert(vertex._offset == GetCurrentOffset()); 379Debug.Assert(vertex._offset == GetCurrentOffset()); 406Debug.Assert(vertex._offset == Vertex.NotPlaced); 922Debug.Assert(args != null && args.Length > 0); 924Debug.Assert(fptrReferenceId == 0); 1316Debug.Assert(bounds != null && lowerBounds != null); 1575Debug.Assert(writer.GetCurrentOffset() > existingOffset); 1658Debug.Assert(delta >= 0); 1731Debug.Assert(pop == tree); 1740Debug.Assert(pop == second); 1744Debug.Assert(pop == tree); 1757Debug.Assert(pop == tree); 1814Debug.Assert(offset >= 0); 1915Debug.Assert(_nBuckets == 0); 2013Debug.Assert(iEntry == nEntries);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
168Debug.Assert(offset < _size); 181Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\RiscVLoongArch64FpStruct.cs (30)
61Debug.Assert(index < 2); 63Debug.Assert(size == sizeof(float) || size == sizeof(double)); 65Debug.Assert(size >= 1 && size <= 8); 66Debug.Assert((size & (size - 1)) == 0, "size needs to be a power of 2"); 72Debug.Assert((int)PosIntFloat == (int)PosFloatInt + 1, "FloatInt and IntFloat need to be adjacent"); 73Debug.Assert((int)PosSizeShift2nd == (int)PosSizeShift1st + 2, "SizeShift1st and 2nd need to be adjacent"); 87Debug.Assert(nElements == 1, "HasImpliedRepeatedFields must have returned a false, it can't be an array"); 91Debug.Assert(nFlattenedFieldsPerElement == 1 || nFlattenedFieldsPerElement == 2); 101Debug.Assert(elementTypeIndex == 0); 102Debug.Assert(typeIndex == 1); 105Debug.Assert((int)FpStruct.IntFloat == ((int)FpStruct.FloatInt << 1), 107Debug.Assert((int)FpStruct.SizeShift2ndMask == ((int)FpStruct.SizeShift1stMask << 2), 115Debug.Assert(info.Size1st() == info.Size2nd()); 176Debug.Assert(nFields == 1); 182Debug.Assert(nElements > 0, "InlineArray length must be > 0"); 196Debug.Assert(arch is TargetArchitecture.RiscV64 or TargetArchitecture.LoongArch64); 209Debug.Assert(nFields == 1 || nFields == 2); 221Debug.Assert((info.flags & (OnlyOne | BothFloat)) == 0); 222Debug.Assert((info.flags & FloatInt) == 0 || info.Size1st() == sizeof(float) || info.Size1st() == sizeof(double)); 223Debug.Assert((info.flags & IntFloat) == 0 || info.Size2nd() == sizeof(float) || info.Size2nd() == sizeof(double)); 227Debug.Assert(nFields == 2); 232Debug.Assert((info.flags & FloatInt) != 0); 233Debug.Assert((info.flags & (IntFloat | SizeShift2ndMask)) == 0); 234Debug.Assert(info.offset2nd == 0); 237Debug.Assert(nFields == ((info.flags & OnlyOne) != 0 ? 1 : 2)); 239Debug.Assert(floatFlags != 0); 240Debug.Assert(((uint)floatFlags & ((uint)floatFlags - 1)) == 0, 246Debug.Assert(end1st <= info.offset2nd || end2nd <= info.offset1st, "fields must not overlap"); 248Debug.Assert(info.offset1st + info.Size1st() <= td.GetElementSize().AsInt); 249Debug.Assert(info.offset2nd + info.Size2nd() <= td.GetElementSize().AsInt);
src\runtime\src\coreclr\tools\Common\Internal\Text\Utf8StringBuilder.cs (3)
36Debug.Assert(newLength <= _length); 61Debug.Assert(Ascii.IsValid(value)); 71Debug.Assert(Ascii.IsValid(value), "Non-ASCII character detected");
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (75)
137Debug.Assert(_this is CorInfoImpl); 427Debug.Assert(codeSize != 0); 473Debug.Assert(clause.TryLength >= clause.TryOffset); 474Debug.Assert(clause.HandlerLength >= clause.HandlerOffset); 550Debug.Assert(_stashedPrecodeFixups.Count == 0); 576Debug.Assert(_compilation.NodeFactory.InstrumentationDataTable != null, "Expected InstrumentationDataTable to be non-null with synthesized PGO data to embed"); 745Debug.Assert(obj is not MethodILScope); 765Debug.Assert(handle != null); 976Debug.Assert((CorInfoType)TypeFlags.Void == CorInfoType.CORINFO_TYPE_VOID); 977Debug.Assert((CorInfoType)TypeFlags.Double == CorInfoType.CORINFO_TYPE_DOUBLE); 1090Debug.Assert(!method.Signature.IsStatic); 1288Debug.Assert(type.HasSameTypeDefinition(method.OwningType)); 1311Debug.Assert(method.GetTypicalMethodDefinition() == methodFromCtx.GetTypicalMethodDefinition()); 1439Debug.Assert(ownerTypeDesc is InstantiatedType); 1458Debug.Assert(info->detail != CORINFO_DEVIRTUALIZATION_DETAIL.CORINFO_DEVIRTUALIZATION_UNKNOWN); 1661Debug.Assert(false); // This should never happen, but we protect against total failure with the throw below. 1739Debug.Assert(sig != null); 1757Debug.Assert(methodDesc.IsUnmanagedCallersOnly); 1869Debug.Assert(typeContext.HasSameTypeDefinition(owningMethod.OwningType) || typeContext.IsArray); 1881Debug.Assert((methodContext.HasInstantiation && !owningMethod.HasInstantiation) || 1885Debug.Assert(methodContext.OwningType.HasSameTypeDefinition(owningMethod.OwningType)); 1932Debug.Assert(((MethodDesc)result).IsRuntimeDeterminedExactMethod); 1941Debug.Assert(((FieldDesc)result).OwningType.IsRuntimeDeterminedSubtype); 1951Debug.Assert(((TypeDesc)result).IsRuntimeDeterminedSubtype || 1999Debug.Assert(!strippedInstantiation); 2059Debug.Assert(!strippedInstantiation); 2158Debug.Assert(size >= 0); 2159Debug.Assert(startIndex >= 0); 2175Debug.Assert(handle != null); 2406Debug.Assert(!type.IsValueType); 2407Debug.Assert(type.IsDefType); 2408Debug.Assert(!type.IsString); 2410Debug.Assert(_compilation.IsInheritanceChainLayoutFixedInCurrentVersionBubble(type)); 2420Debug.Assert(!type.IsValueType); 2421Debug.Assert(type.IsDefType); 2539Debug.Assert(*gcPtrs == (byte)gcType); 2582Debug.Assert(field.Offset.AsInt % PointerSize == 0); 2598Debug.Assert(field.Offset.AsInt == 0); 2782Debug.Assert(fd.Offset != FieldAndOffset.InvalidOffset); 2788Debug.Assert(fieldType is MetadataType); 2916Debug.Assert(fd == null || fd.IsStatic); 2985Debug.Assert(!typeToInit.IsBeforeFieldInit); 3259Debug.Assert(!type.IsGenericParameter); 3266Debug.Assert(cls != null); 3274Debug.Assert(!type.IsGenericParameter); 3416Debug.Assert(fieldDesc.Offset != FieldAndOffset.InvalidOffset); 3423Debug.Assert(field.IsIntrinsic); 3577Debug.Fail("CorInfoImpl.runWithErrorTrap should not be called"); 3587Debug.Fail("CorInfoImpl.runWithSPMIErrorTrap should not be called"); 3672Debug.Assert(caller.SupportsAsyncVersionCodegen()); 3751Debug.Assert(awaitAwaiterMethod.Instantiation.Length == 1); 3819Debug.Assert(objRefsSize == (dataSize + (nuint)(PointerSize - 1)) / (nuint)PointerSize); 3999Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 0 * 2 == (int)CorInfoType.CORINFO_TYPE_BYTE); 4000Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 1 * 2 == (int)CorInfoType.CORINFO_TYPE_SHORT); 4001Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 2 * 2 == (int)CorInfoType.CORINFO_TYPE_INT); 4002Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 3 * 2 == (int)CorInfoType.CORINFO_TYPE_LONG); 4139Debug.Assert(method.AcquiresInstMethodTableFromThis()); 4284Debug.Assert(chunk.alignment == 1); 4329Debug.Assert(offset <= roDataSize); 4354Debug.Assert(offset <= rwDataSize); 4386Debug.Assert(FrameInfoFlags.Filter == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_FILTER); 4387Debug.Assert(FrameInfoFlags.Handler == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_HANDLER); 4615Debug.Assert(locationBlock != BlockType.Unknown, "BlockType.Unknown not expected"); 4643Debug.Assert(_methodColdCodeNode != null); 4748Debug.Assert(!field.IsStatic); 4812Debug.Assert(InstructionSet.X86_X86Base == InstructionSet.X64_X86Base); 4813Debug.Assert(_compilation.InstructionSetSupport.IsInstructionSetSupported(InstructionSet.X86_X86Base)); 4817Debug.Assert(_compilation.InstructionSetSupport.IsInstructionSetSupported(InstructionSet.ARM64_AdvSimd)); 4911Debug.Assert((bwInstrumentationData.BaseStream.Position % 8) == 0); 5027Debug.Assert(!_compilation.InstructionSetSupport.NonSpecifiableFlags.HasInstructionSet(instructionSet)); 5101Debug.Assert(buffer != null); 5102Debug.Assert(bufferSize > 0); 5103Debug.Assert(valueOffset >= 0); 5104Debug.Assert(field.IsStatic); 5105Debug.Assert(field.HasRva);
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoTypes.cs (1)
274Debug.Assert(sizeof(CORINFO_RUNTIME_LOOKUP) >= sizeof(CORINFO_CONST_LOOKUP));
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (1)
24Debug.Assert(s_instance != null);
src\runtime\src\coreclr\tools\Common\JitInterface\JitTypeNameFormatter.cs (2)
35Debug.Fail("Unexpected signature type variable in JitTypeNameFormatter"); 40Debug.Fail("Unexpected signature method variable in JitTypeNameFormatter");
src\runtime\src\coreclr\tools\Common\JitInterface\SwiftPhysicalLowering.cs (3)
89Debug.Assert(PointerSize == 8, "Swift interop is only supported on 64-bit platforms."); 96Debug.Assert(fieldType.IsPrimitiveNumeric); 217Debug.Fail("Non-unmanaged types should not be passed directly to a Swift function.");
src\runtime\src\coreclr\tools\Common\JitInterface\SystemVStructClassificator.cs (25)
87Debug.Assert(structPassInRegDescPtr.eightByteCount <= CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 136Debug.Fail($"Type {typeDesc} with unexpected category {typeDesc.Category}"); 147Debug.Assert((newFieldClassification == SystemVClassificationTypeInteger) || 156Debug.Assert((originalClassification == SystemVClassificationTypeInteger) || 163Debug.Assert((originalClassification == SystemVClassificationTypeInteger) || 177Debug.Assert(originalClassification == SystemVClassificationTypeIntegerReference); 182Debug.Assert(originalClassification == SystemVClassificationTypeIntegerByRef); 186Debug.Assert(false); // Unexpected type. 233Debug.Assert(mdType != null); 253Debug.Assert(fieldIndex < numIntroducedFields); 263Debug.Fail("Invalid struct size. The size of fields and overall size don't agree"); 328Debug.Assert(helper.FieldClassifications[helper.CurrentUniqueOffsetField] == SystemVClassificationTypeNoClass); 331Debug.Assert((fieldClassificationType == SystemVClassificationTypeInteger) || 340Debug.Assert(helper.CurrentUniqueOffsetField < SYSTEMV_MAX_NUM_FIELDS_IN_REGISTER_PASSED_STRUCT); 355Debug.Assert(CLR_SYSTEMV_MAX_BYTES_TO_PASS_IN_REGISTERS == SYSTEMV_MAX_NUM_FIELDS_IN_REGISTER_PASSED_STRUCT); 360Debug.Assert(largestFieldOffset != -1); 374Debug.Assert(helper.FieldOffsets[i] < CLR_SYSTEMV_MAX_BYTES_TO_PASS_IN_REGISTERS); 375Debug.Assert(sortedFieldOrder[helper.FieldOffsets[i]] == -1); // we haven't seen this field offset yet. 384Debug.Assert(offsetAfterLastFieldByte <= helper.StructSize); 421Debug.Assert(fieldSize > 0); 424Debug.Assert(fieldClassificationType != SystemVClassificationTypeMemory && fieldClassificationType != SystemVClassificationTypeUnknown); 430Debug.Assert(fieldEndEightByte < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 447Debug.Assert((fieldClassificationType != SystemVClassificationTypeIntegerReference) && 503Debug.Assert(helper.EightByteCount <= CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 508Debug.Assert(helper.EightByteClassifications[i] != SystemVClassificationTypeNoClass);
src\runtime\src\coreclr\tools\Common\JitInterface\UnboxingMethodDesc.cs (2)
25Debug.Assert(wrappedMethod.OwningType.IsValueType); 26Debug.Assert(!wrappedMethod.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\JitInterface\WasmLowering.cs (13)
19Debug.Assert(signature.Context.GetWellKnownType(WellKnownType.String).GetMethod(".ctor"u8, signature) != null); 20Debug.Assert(signature.GenericParameterCount == 0); 21Debug.Assert(signature.Flags == 0); 157Debug.Assert((size % slotSize) == 0); 221Debug.Assert(type is DefType defType && IsKnownMultiSegmentType(defType)); 285Debug.Assert(slotType is WasmValueType.I64 or WasmValueType.V128); 319Debug.Assert(!isV128 || ((DefType)type).InstanceFieldAlignment.AsInt == 16, 414Debug.Assert(sig[pos] == 'S'); 440Debug.Assert(returnType is not null, $"No cached struct of size {structSize} for return type in signature '{sig}'"); 489Debug.Assert(emptyStruct is not null, "Encountered 'e' in signature but no empty struct was cached during lowering"); 503Debug.Assert(cachedStruct is not null, $"No cached struct of size {structSize} for parameter in signature '{sig}'"); 530Debug.Assert(roundtrippedStr.Equals(wasmSignature.SignatureString, StringComparison.Ordinal), 711Debug.Assert(slotCount is >= 2 and <= 9,
src\runtime\src\coreclr\tools\Common\Pgo\PgoFormat.cs (3)
425Debug.Assert(modifyMask != InstrumentationDataProcessingState.Done); 665Debug.Assert(PgoSchemaMergeComparer.Singleton.Compare(schema, mergedElem) == 0); 666Debug.Assert(PgoSchemaMergeComparer.Singleton.Equals(schema, mergedElem));
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\HelperExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.Signature.Length == 0 && method.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILReader.cs (2)
9using Debug = System.Diagnostics.Debug; 156Debug.Assert((currentOpcode >= ILOpcode.br && currentOpcode <= ILOpcode.blt_un)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\AsyncResumptionStub.cs (2)
11using Debug = System.Diagnostics.Debug; 24Debug.Assert(targetMethod.IsAsyncCall());
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ComparerIntrinsics.cs (9)
10using Debug = System.Diagnostics.Debug; 54Debug.Assert(!methodBeingGenerated.IsTypicalMethodDefinition); 65Debug.Assert(comparerType != null); 135Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any)); 179Debug.Assert(context.IsCanonicalDefinitionType(nullableType, CanonicalFormKind.Universal)); 232Debug.Assert(type.CanCastTo(interfaceType.MakeInstantiatedType(type))); 252Debug.Assert(type.IsValueType); 296Debug.Assert(fieldType.IsValueType); 342Debug.Assert(fieldType.IsValueType);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\InterlockedIntrinsics.cs (4)
8using Debug = System.Diagnostics.Debug; 23Debug.Assert(((MetadataType)method.OwningType).Name == "Interlocked"u8); 24Debug.Assert(!method.IsGenericMethodDefinition); 47Debug.Assert(size is 1 or 2 or 4 or 8);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\RuntimeHelpersIntrinsics.cs (2)
9using Debug = System.Diagnostics.Debug; 20Debug.Assert(((MetadataType)method.OwningType).Name == "RuntimeHelpers"u8);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\UnsafeIntrinsics.cs (7)
8using Debug = System.Diagnostics.Debug; 19Debug.Assert(((MetadataType)method.OwningType).Name == "Unsafe"u8); 101Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 119Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 139Debug.Assert(method.Signature.IsStatic && method.Signature.Length == (write ? 2 : 1)); 157Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 2); 212Debug.Assert(method.Signature.IsStatic && method.Signature.Length == 1);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\MarshalHelpers.cs (2)
5using Debug = System.Diagnostics.Debug; 120Debug.Assert(arrayType != null, "Expecting array");
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\IL\Marshaller.cs (17)
9using Debug = System.Diagnostics.Debug; 60Debug.Assert(_nativeType != null); 160Debug.Assert(false); 182Debug.Assert(false); 192Debug.Fail("Unexpectting setting value on non-byref arg"); 201Debug.Assert(false); 397Debug.Assert(parameterIndex == parameterMetadataArray.Length || i <= parameterMetadataArray[parameterIndex].Index); 407Debug.Assert(i == parameterMetadataArray[parameterIndex].Index); 448Debug.Assert(targetMethod.IsPInvoke); 467Debug.Assert(targetMethod.IsPInvoke); 631Debug.Assert(Return || IsHRSwappedRetVal); 937Debug.Assert(codeStream != null); 952Debug.Assert(codeStream != null); 1024Debug.Assert(Return); 1102Debug.Assert(ManagedType is ArrayType); 1112Debug.Assert(NativeType is PointerType); 1807Debug.Assert(_marshallerInstance is null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\UnmanagedCallingConventions.cs (8)
57Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 60Debug.Assert(unmanagedCallconv != 0); 97Debug.Assert(method.IsUnmanagedCallersOnly); 104Debug.Assert(method.IsPInvoke); 114Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 140Debug.Assert(delegateType.IsDelegate); 147Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)UnmanagedCallingConventions.Cdecl 257Debug.Assert(index == count);
src\runtime\src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
140Debug.Assert(hashCode == NameHashCode("System.Array`1"u8));
TypeSystem\Mutable\MutableModule.cs (4)
42Debug.Assert(_mutableModule.ModuleThatIsCurrentlyTheSourceOfNewReferences != null && 56Debug.Assert(index != -1); 64Debug.Assert(index != -1); 178Debug.Assert(handle == ExistingEntities[entry.Item2]);
TypeSystem\Mutable\MutableModule.Sorting.cs (2)
4using Debug = System.Diagnostics.Debug; 13Debug.Assert(this == other);
ILCompiler.RyuJit (253)
Compiler\DependencyAnalysis\MethodCodeNode.cs (13)
34Debug.Assert(!method.IsAbstract); 35Debug.Assert(!method.IsGenericMethodDefinition && !method.OwningType.IsGenericDefinition); 36Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method); 42Debug.Assert(_methodCode == null); 111Debug.Assert(IsSpecialUnboxingThunk); 134Debug.Assert(_frameInfos == null); 140Debug.Assert(_gcInfo == null); 146Debug.Assert(_ehInfo == null); 159Debug.Assert(_debugLocInfos == null); 165Debug.Assert(_debugVarInfos == null); 171Debug.Assert(_debugInfo == null); 177Debug.Assert(_localTypes == null); 183Debug.Assert(_debugEHClauseInfos == null);
Compiler\DependencyAnalysis\RyuJitNodeFactory.cs (3)
6using Debug = System.Diagnostics.Debug; 41Debug.Assert(!Internal.JitInterface.UnboxingMethodDescExtensions.IsUnboxingThunk(method)); 55Debug.Assert(!method.Signature.IsStatic);
JitInterface\CorInfoImpl.RyuJit.cs (56)
90Debug.Assert(expectedeetype == eetype); 119Debug.Assert(blobData.Length % 8 == 0); 168Debug.Assert(cfaRegister == spReg); 192Debug.Assert(cfaRegister == spReg); 193Debug.Assert(cfaOffset == 0); 196Debug.Assert(spOffset == 0); 268Debug.Assert(contextSource == GenericContextSource.ThisObject); 280Debug.Assert(callerHandle != null); 367Debug.Assert(pResolvedToken.token == 0 && pResolvedToken.tokenScope == null); 368Debug.Assert(MethodBeingCompiled.IsSharedByGenericInstantiations); 371Debug.Assert(typeToInitialize.IsCanonicalSubtype(CanonicalFormKind.Any)); 403Debug.Assert(targetMethod.IsVirtual && targetMethod.Signature.IsStatic 426Debug.Assert(directMethod.OwningType.IsValueType || directMethod.Signature.IsStatic); 427Debug.Assert(!forceRuntimeLookup); 454Debug.Assert(expectedTargetMethod.GetCanonMethodTarget(CanonicalFormKind.Specific) == targetMethod.GetCanonMethodTarget(CanonicalFormKind.Specific)); 831Debug.Assert(mangledName != null || methodDesc != null); 1018Debug.Assert(_debugLocInfos == null); 1075Debug.Assert(runtimeLookupKind == CORINFO_RUNTIME_LOOKUP_KIND.CORINFO_LOOKUP_METHODPARAM); 1124Debug.Assert(CorInfoHelpFunc.CORINFO_HELP_ISINSTANCEOFINTERFACE + delta 1126Debug.Assert(CorInfoHelpFunc.CORINFO_HELP_ISINSTANCEOFARRAY + delta 1128Debug.Assert(CorInfoHelpFunc.CORINFO_HELP_ISINSTANCEOFCLASS + delta 1141Debug.Assert(!type.IsString && !type.IsArray && !type.IsCanonicalDefinitionType(CanonicalFormKind.Any)); 1166Debug.Assert(type.IsArray); 1273Debug.Assert(!methodAfterConstraintResolution.OwningType.IsInterface 1284Debug.Assert(method.OwningType.IsInterface); 1344Debug.Assert(targetMethod.IsVirtual && targetMethod.OwningType.IsInterface); 1411Debug.Assert(targetMethod.OwningType.GetTypeDefinition() == constrainedType.GetTypeDefinition()); 1425Debug.Assert(lookupMethod.GetCanonMethodTarget(CanonicalFormKind.Specific) == targetMethod.GetCanonMethodTarget(CanonicalFormKind.Specific)); 1447Debug.Assert((flags & CORINFO_CALLINFO_FLAGS.CORINFO_CALLINFO_LDFTN) != 0); 1527Debug.Assert(!forceUseRuntimeLookup); 1563Debug.Assert(targetMethod.OwningType.IsInterface && targetMethod.IsVirtual && constrainedType != null); 1571Debug.Assert(targetMethod.OwningType.IsInterface && targetMethod.IsVirtual && constrainedType != null); 1617Debug.Assert(pResult->codePointerOrStubLookup.lookupKind.needsRuntimeLookup); 1650Debug.Assert(pResult->codePointerOrStubLookup.lookupKind.needsRuntimeLookup); 1764Debug.Assert(md.OwningType == td); 1772Debug.Assert((pResolvedToken.tokenType & CorInfoTokenKind.CORINFO_TOKENKIND_Method) != 0); 1786Debug.Assert(pResolvedToken.tokenType == CorInfoTokenKind.CORINFO_TOKENKIND_Ldtoken); 1801Debug.Assert(fEmbedParent); 1809Debug.Assert(obj is FieldDesc); 1855Debug.Assert(pResult.compileTimeHandle != null); 1887Debug.Assert(!methodDesc.CanMethodBeInSealedVTable(_compilation.NodeFactory)); 1928Debug.Fail("Unexpected raw handle intrinsic"); 1984Debug.Assert(!IsPInvokeStubRequired(stub)); 2111Debug.Assert(((int)flags & ((int)CORINFO_ACCESS_FLAGS.CORINFO_ACCESS_GET | 2183Debug.Assert(contextMethod.RequiresInstMethodDescArg()); 2338Debug.Assert(!implClass.IsCanonicalSubtype(CanonicalFormKind.Any)); 2342Debug.Assert(index <= maxExactClasses); 2348Debug.Assert(fieldHandle != null); 2349Debug.Assert(buffer != null); 2350Debug.Assert(bufferSize > 0); 2351Debug.Assert(valueOffset >= 0); 2354Debug.Assert(field.IsStatic); 2426Debug.Assert(objPtr != null); 2427Debug.Assert(buffer != null); 2428Debug.Assert(bufferSize >= 0); 2429Debug.Assert(valueOffset >= 0);
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\FileLayoutOptimizer.cs (1)
365Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, methodsToPlace.Count)));
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\Compiler\PettisHansenSort\PettisHansen.cs (9)
55Debug.Assert(phEdges[kvp.Key][i] == phEdges[i][kvp.Key]); 80Debug.Assert(phEdges[from][to] == phEdges[to][from]); 114Debug.Assert(wfl >= wff && wfl >= wlf && wfl >= wll); 123Debug.Assert(phEdges[loser].Count(e => unionFind.FindSet(e.Key) == winner) == 1); 134Debug.Assert(removed); 152Debug.Assert(unionFind.FindSet(i) == i && unionFind.FindSet(edge.Key) == edge.Key); 153Debug.Assert(phEdges[edge.Key][i] == phEdges[i][edge.Key]); 171Debug.Assert(components.SelectMany(l => l).OrderBy(i => i).SequenceEqual(Enumerable.Range(0, graph.Count))); 177Debug.Assert(component[0] > prev);
src\runtime\src\coreclr\tools\aot\ILCompiler.ReadyToRun\IBC\MIbcProfileParser.cs (1)
203Debug.Assert(mibcGroupName == "");
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmInstructions.cs (16)
220Debug.Assert(adjustSize == encodeSizeExpected); 257Debug.Assert(relocsEncoded == expr.EncodeRelocationCount()); 292Debug.Assert(buffer.Length >= EncodeRelocationCount()); 345Debug.Assert(buffer.Length >= relocSize); 519Debug.Assert(localIndex >= 0); 520Debug.Assert(kind.IsLocalVarExpr()); 544Debug.Assert(globalIndex >= 0); 545Debug.Assert(kind.IsGlobalVarExpr()); 567Debug.Assert(kind.IsBinaryExpr()); 591Debug.Assert(dstMemoryIndex >= 0); 592Debug.Assert(srcMemoryIndex >= 0); 623Debug.Assert(memoryIndex >= 0); 650Debug.Assert(dataSegmentIndex >= 0); 651Debug.Assert(memoryIndex >= 0); 682Debug.Assert(tableIndex >= 0); 683Debug.Assert(elemIndex >= 0);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\RiscVLoongArch64FpStruct.cs (30)
61Debug.Assert(index < 2); 63Debug.Assert(size == sizeof(float) || size == sizeof(double)); 65Debug.Assert(size >= 1 && size <= 8); 66Debug.Assert((size & (size - 1)) == 0, "size needs to be a power of 2"); 72Debug.Assert((int)PosIntFloat == (int)PosFloatInt + 1, "FloatInt and IntFloat need to be adjacent"); 73Debug.Assert((int)PosSizeShift2nd == (int)PosSizeShift1st + 2, "SizeShift1st and 2nd need to be adjacent"); 87Debug.Assert(nElements == 1, "HasImpliedRepeatedFields must have returned a false, it can't be an array"); 91Debug.Assert(nFlattenedFieldsPerElement == 1 || nFlattenedFieldsPerElement == 2); 101Debug.Assert(elementTypeIndex == 0); 102Debug.Assert(typeIndex == 1); 105Debug.Assert((int)FpStruct.IntFloat == ((int)FpStruct.FloatInt << 1), 107Debug.Assert((int)FpStruct.SizeShift2ndMask == ((int)FpStruct.SizeShift1stMask << 2), 115Debug.Assert(info.Size1st() == info.Size2nd()); 176Debug.Assert(nFields == 1); 182Debug.Assert(nElements > 0, "InlineArray length must be > 0"); 196Debug.Assert(arch is TargetArchitecture.RiscV64 or TargetArchitecture.LoongArch64); 209Debug.Assert(nFields == 1 || nFields == 2); 221Debug.Assert((info.flags & (OnlyOne | BothFloat)) == 0); 222Debug.Assert((info.flags & FloatInt) == 0 || info.Size1st() == sizeof(float) || info.Size1st() == sizeof(double)); 223Debug.Assert((info.flags & IntFloat) == 0 || info.Size2nd() == sizeof(float) || info.Size2nd() == sizeof(double)); 227Debug.Assert(nFields == 2); 232Debug.Assert((info.flags & FloatInt) != 0); 233Debug.Assert((info.flags & (IntFloat | SizeShift2ndMask)) == 0); 234Debug.Assert(info.offset2nd == 0); 237Debug.Assert(nFields == ((info.flags & OnlyOne) != 0 ? 1 : 2)); 239Debug.Assert(floatFlags != 0); 240Debug.Assert(((uint)floatFlags & ((uint)floatFlags - 1)) == 0, 246Debug.Assert(end1st <= info.offset2nd || end2nd <= info.offset1st, "fields must not overlap"); 248Debug.Assert(info.offset1st + info.Size1st() <= td.GetElementSize().AsInt); 249Debug.Assert(info.offset2nd + info.Size2nd() <= td.GetElementSize().AsInt);
src\runtime\src\coreclr\tools\Common\JitInterface\CorInfoImpl.cs (68)
137Debug.Assert(_this is CorInfoImpl); 427Debug.Assert(codeSize != 0); 473Debug.Assert(clause.TryLength >= clause.TryOffset); 474Debug.Assert(clause.HandlerLength >= clause.HandlerOffset); 745Debug.Assert(obj is not MethodILScope); 765Debug.Assert(handle != null); 976Debug.Assert((CorInfoType)TypeFlags.Void == CorInfoType.CORINFO_TYPE_VOID); 977Debug.Assert((CorInfoType)TypeFlags.Double == CorInfoType.CORINFO_TYPE_DOUBLE); 1090Debug.Assert(!method.Signature.IsStatic); 1288Debug.Assert(type.HasSameTypeDefinition(method.OwningType)); 1311Debug.Assert(method.GetTypicalMethodDefinition() == methodFromCtx.GetTypicalMethodDefinition()); 1439Debug.Assert(ownerTypeDesc is InstantiatedType); 1458Debug.Assert(info->detail != CORINFO_DEVIRTUALIZATION_DETAIL.CORINFO_DEVIRTUALIZATION_UNKNOWN); 1739Debug.Assert(sig != null); 1757Debug.Assert(methodDesc.IsUnmanagedCallersOnly); 1869Debug.Assert(typeContext.HasSameTypeDefinition(owningMethod.OwningType) || typeContext.IsArray); 1881Debug.Assert((methodContext.HasInstantiation && !owningMethod.HasInstantiation) || 1885Debug.Assert(methodContext.OwningType.HasSameTypeDefinition(owningMethod.OwningType)); 1932Debug.Assert(((MethodDesc)result).IsRuntimeDeterminedExactMethod); 1941Debug.Assert(((FieldDesc)result).OwningType.IsRuntimeDeterminedSubtype); 1951Debug.Assert(((TypeDesc)result).IsRuntimeDeterminedSubtype || 2158Debug.Assert(size >= 0); 2159Debug.Assert(startIndex >= 0); 2175Debug.Assert(handle != null); 2406Debug.Assert(!type.IsValueType); 2407Debug.Assert(type.IsDefType); 2408Debug.Assert(!type.IsString); 2420Debug.Assert(!type.IsValueType); 2421Debug.Assert(type.IsDefType); 2539Debug.Assert(*gcPtrs == (byte)gcType); 2582Debug.Assert(field.Offset.AsInt % PointerSize == 0); 2598Debug.Assert(field.Offset.AsInt == 0); 2782Debug.Assert(fd.Offset != FieldAndOffset.InvalidOffset); 2788Debug.Assert(fieldType is MetadataType); 2916Debug.Assert(fd == null || fd.IsStatic); 2985Debug.Assert(!typeToInit.IsBeforeFieldInit); 3259Debug.Assert(!type.IsGenericParameter); 3266Debug.Assert(cls != null); 3274Debug.Assert(!type.IsGenericParameter); 3416Debug.Assert(fieldDesc.Offset != FieldAndOffset.InvalidOffset); 3423Debug.Assert(field.IsIntrinsic); 3577Debug.Fail("CorInfoImpl.runWithErrorTrap should not be called"); 3587Debug.Fail("CorInfoImpl.runWithSPMIErrorTrap should not be called"); 3672Debug.Assert(caller.SupportsAsyncVersionCodegen()); 3751Debug.Assert(awaitAwaiterMethod.Instantiation.Length == 1); 3819Debug.Assert(objRefsSize == (dataSize + (nuint)(PointerSize - 1)) / (nuint)PointerSize); 3999Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 0 * 2 == (int)CorInfoType.CORINFO_TYPE_BYTE); 4000Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 1 * 2 == (int)CorInfoType.CORINFO_TYPE_SHORT); 4001Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 2 * 2 == (int)CorInfoType.CORINFO_TYPE_INT); 4002Debug.Assert((int)CorInfoType.CORINFO_TYPE_BYTE + 3 * 2 == (int)CorInfoType.CORINFO_TYPE_LONG); 4139Debug.Assert(method.AcquiresInstMethodTableFromThis()); 4284Debug.Assert(chunk.alignment == 1); 4329Debug.Assert(offset <= roDataSize); 4354Debug.Assert(offset <= rwDataSize); 4386Debug.Assert(FrameInfoFlags.Filter == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_FILTER); 4387Debug.Assert(FrameInfoFlags.Handler == (FrameInfoFlags)CorJitFuncKind.CORJIT_FUNC_HANDLER); 4615Debug.Assert(locationBlock != BlockType.Unknown, "BlockType.Unknown not expected"); 4748Debug.Assert(!field.IsStatic); 4812Debug.Assert(InstructionSet.X86_X86Base == InstructionSet.X64_X86Base); 4813Debug.Assert(_compilation.InstructionSetSupport.IsInstructionSetSupported(InstructionSet.X86_X86Base)); 4817Debug.Assert(_compilation.InstructionSetSupport.IsInstructionSetSupported(InstructionSet.ARM64_AdvSimd)); 4911Debug.Assert((bwInstrumentationData.BaseStream.Position % 8) == 0); 5093Debug.Assert(!_compilation.InstructionSetSupport.NonSpecifiableFlags.HasInstructionSet(instructionSet)); 5101Debug.Assert(buffer != null); 5102Debug.Assert(bufferSize > 0); 5103Debug.Assert(valueOffset >= 0); 5104Debug.Assert(field.IsStatic); 5105Debug.Assert(field.HasRva);
src\runtime\src\coreclr\tools\Common\JitInterface\JitConfigProvider.cs (1)
24Debug.Assert(s_instance != null);
src\runtime\src\coreclr\tools\Common\JitInterface\JitTypeNameFormatter.cs (2)
35Debug.Fail("Unexpected signature type variable in JitTypeNameFormatter"); 40Debug.Fail("Unexpected signature method variable in JitTypeNameFormatter");
src\runtime\src\coreclr\tools\Common\JitInterface\SwiftPhysicalLowering.cs (3)
89Debug.Assert(PointerSize == 8, "Swift interop is only supported on 64-bit platforms."); 96Debug.Assert(fieldType.IsPrimitiveNumeric); 217Debug.Fail("Non-unmanaged types should not be passed directly to a Swift function.");
src\runtime\src\coreclr\tools\Common\JitInterface\SystemVStructClassificator.cs (25)
87Debug.Assert(structPassInRegDescPtr.eightByteCount <= CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 136Debug.Fail($"Type {typeDesc} with unexpected category {typeDesc.Category}"); 147Debug.Assert((newFieldClassification == SystemVClassificationTypeInteger) || 156Debug.Assert((originalClassification == SystemVClassificationTypeInteger) || 163Debug.Assert((originalClassification == SystemVClassificationTypeInteger) || 177Debug.Assert(originalClassification == SystemVClassificationTypeIntegerReference); 182Debug.Assert(originalClassification == SystemVClassificationTypeIntegerByRef); 186Debug.Assert(false); // Unexpected type. 233Debug.Assert(mdType != null); 253Debug.Assert(fieldIndex < numIntroducedFields); 263Debug.Fail("Invalid struct size. The size of fields and overall size don't agree"); 328Debug.Assert(helper.FieldClassifications[helper.CurrentUniqueOffsetField] == SystemVClassificationTypeNoClass); 331Debug.Assert((fieldClassificationType == SystemVClassificationTypeInteger) || 340Debug.Assert(helper.CurrentUniqueOffsetField < SYSTEMV_MAX_NUM_FIELDS_IN_REGISTER_PASSED_STRUCT); 355Debug.Assert(CLR_SYSTEMV_MAX_BYTES_TO_PASS_IN_REGISTERS == SYSTEMV_MAX_NUM_FIELDS_IN_REGISTER_PASSED_STRUCT); 360Debug.Assert(largestFieldOffset != -1); 374Debug.Assert(helper.FieldOffsets[i] < CLR_SYSTEMV_MAX_BYTES_TO_PASS_IN_REGISTERS); 375Debug.Assert(sortedFieldOrder[helper.FieldOffsets[i]] == -1); // we haven't seen this field offset yet. 384Debug.Assert(offsetAfterLastFieldByte <= helper.StructSize); 421Debug.Assert(fieldSize > 0); 424Debug.Assert(fieldClassificationType != SystemVClassificationTypeMemory && fieldClassificationType != SystemVClassificationTypeUnknown); 430Debug.Assert(fieldEndEightByte < CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 447Debug.Assert((fieldClassificationType != SystemVClassificationTypeIntegerReference) && 503Debug.Assert(helper.EightByteCount <= CLR_SYSTEMV_MAX_EIGHTBYTES_COUNT_TO_PASS_IN_REGISTERS); 508Debug.Assert(helper.EightByteClassifications[i] != SystemVClassificationTypeNoClass);
src\runtime\src\coreclr\tools\Common\JitInterface\UnboxingMethodDesc.cs (2)
25Debug.Assert(wrappedMethod.OwningType.IsValueType); 26Debug.Assert(!wrappedMethod.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\JitInterface\WasmLowering.cs (13)
19Debug.Assert(signature.Context.GetWellKnownType(WellKnownType.String).GetMethod(".ctor"u8, signature) != null); 20Debug.Assert(signature.GenericParameterCount == 0); 21Debug.Assert(signature.Flags == 0); 157Debug.Assert((size % slotSize) == 0); 221Debug.Assert(type is DefType defType && IsKnownMultiSegmentType(defType)); 285Debug.Assert(slotType is WasmValueType.I64 or WasmValueType.V128); 319Debug.Assert(!isV128 || ((DefType)type).InstanceFieldAlignment.AsInt == 16, 414Debug.Assert(sig[pos] == 'S'); 440Debug.Assert(returnType is not null, $"No cached struct of size {structSize} for return type in signature '{sig}'"); 489Debug.Assert(emptyStruct is not null, "Encountered 'e' in signature but no empty struct was cached during lowering"); 503Debug.Assert(cachedStruct is not null, $"No cached struct of size {structSize} for parameter in signature '{sig}'"); 530Debug.Assert(roundtrippedStr.Equals(wasmSignature.SignatureString, StringComparison.Ordinal), 711Debug.Assert(slotCount is >= 2 and <= 9,
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\HelperExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.Signature.Length == 0 && method.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILReader.cs (2)
9using Debug = System.Diagnostics.Debug; 156Debug.Assert((currentOpcode >= ILOpcode.br && currentOpcode <= ILOpcode.blt_un)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\TypeSystemThrowingILEmitter.cs (2)
8using Debug = System.Diagnostics.Debug; 78Debug.Assert(helper.Signature.Length == exception.Arguments.Count + 1);
ILCompiler.TypeSystem (310)
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\CanonTypes.cs (2)
10using Debug = System.Diagnostics.Debug; 111Debug.Assert(kind == CanonicalFormKind.Specific);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\CanonTypes.Metadata.cs (1)
10using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\CanonTypes.Sorting.cs (2)
4using Debug = System.Diagnostics.Debug; 14Debug.Assert(this == other);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\GenericParameterDesc.Canon.cs (3)
4using Debug = System.Diagnostics.Debug; 13Debug.Fail("IsCanonicalSubtype of an indefinite type"); 19Debug.Fail("ConvertToCanonFormImpl for an indefinite type");
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\InstantiatedMethod.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 66Debug.Fail("Invalid CanonicalFormKind: " + kind); 76Debug.Assert(_specificCanonCache == null || _specificCanonCache == value); 81Debug.Assert(_universalCanonCache == null || _universalCanonCache == value); 86Debug.Fail("Invalid CanonicalFormKind: " + kind);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\SignatureVariable.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 13Debug.Fail("IsCanonicalSubtype of an indefinite type"); 19Debug.Fail("ConvertToCanonFormImpl for an indefinite type"); 29Debug.Fail("IsCanonicalSubtype of an indefinite type"); 35Debug.Fail("ConvertToCanonFormImpl for an indefinite type");
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\StandardCanonicalizationAlgorithm.cs (2)
4using Debug = System.Diagnostics.Debug; 134Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\TypeDesc.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 29Debug.Fail("Invalid CanonicalFormKind: " + kind); 39Debug.Assert(_specificCanonCache == null || _specificCanonCache == value); 44Debug.Assert(_universalCanonCache == null || _universalCanonCache == value); 49Debug.Fail("Invalid CanonicalFormKind: " + kind);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\TypeSystemContext.Canon.cs (2)
5using Debug = System.Diagnostics.Debug; 61Debug.Assert(kind == CanonicalFormKind.Universal);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\AlignmentHelper.cs (4)
4using Debug = System.Diagnostics.Debug; 12Debug.Assert(val >= 0 && alignment >= 0); 15Debug.Assert(0 == (alignment & (alignment - 1))); 17Debug.Assert(result >= val); // check for overflow
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ArrayOfTRuntimeInterfacesAlgorithm.cs (3)
4using Debug = System.Diagnostics.Debug; 25Debug.Assert(!(arrayOfTType is InstantiatedType)); 31Debug.Assert(arrayType.IsSzArray);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\CastingHelper.cs (6)
4using Debug = System.Diagnostics.Debug; 122Debug.Assert(fn1Ttype.IsFunctionPointer && fn2Type.IsFunctionPointer); 252Debug.Assert(thisType.IsDefType); 393Debug.Assert(!type.IsEnum); 496Debug.Assert(instantiationThis.Length == instantiationTarget.Length && 526Debug.Assert(variance == GenericVariance.None);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\CastingHelper.TypeEquivalence.cs (4)
9using Debug = System.Diagnostics.Debug; 52Debug.Assert(thisType.IsDefType); 102Debug.Assert(type1.GetTypeDefinition() == type1); 103Debug.Assert(type2.GetTypeDefinition() == type2);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ConstructedTypeRewritingHelpers.cs (2)
123Debug.Fail("Unknown form of type"); 175Debug.Assert(method is InstantiatedMethod);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\DefType.FieldLayout.cs (2)
534Debug.Assert(fieldAndOffset.Field.OwningType == this); 569Debug.Assert(fieldAndOffset.Field.OwningType == this);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ExplicitLayoutValidator.cs (1)
68Debug.Fail("We should recurse on value types with GC pointers or byrefs");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldDesc.cs (2)
7using Debug = System.Diagnostics.Debug; 30Debug.Assert(o is not FieldDesc || ReferenceEquals(((FieldDesc)o).Context, this.Context));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldDesc.FieldLayout.cs (3)
27Debug.Assert(_offset != FieldAndOffset.InvalidOffset); 40Debug.Assert(IsStatic); 47Debug.Assert(_offset == FieldAndOffset.InvalidOffset || _offset == offset);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldForInstantiatedType.cs (2)
8using Debug = System.Diagnostics.Debug; 22Debug.Assert(fieldDef.GetTypicalFieldDefinition() == fieldDef);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldForInstantiatedType.FieldLayout.cs (1)
4using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldLayoutIntervalCalculator.cs (4)
33Debug.Assert(Size >= 0); 76Debug.Fail(fieldType.ToString()); 238Debug.Assert(nextInterval.Start <= expandedInterval.EndSentinel); 268Debug.Assert(previousInterval.EndSentinel <= expandedInterval.Start);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedMethod.cs (2)
21Debug.Assert(!(methodDef is InstantiatedMethod)); 24Debug.Assert(instantiation.Length > 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedType.cs (3)
22Debug.Assert(!(typeDef is InstantiatedType)); 25Debug.Assert(instantiation.Length > 0); 220Debug.Assert(typeInHierarchy is InstantiatedType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\LayoutInt.cs (3)
41Debug.Assert(output.IsIndeterminate); 153Debug.Assert(alignment._value <= target.MaximumAlignment); // Assert that the alignment handling for indeterminate types is safe 154Debug.Assert(alignment._value >= 1 || ((value._value == 0) && (alignment._value == 0))); // Alignment to less than one doesn't make sense, except for 0 to 0 alignment
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataFieldLayoutAlgorithm.cs (10)
5using Debug = System.Diagnostics.Debug; 126Debug.Assert(instanceField == null, "Unexpected extra instance field"); 131Debug.Assert(instanceField != null, "Null instance field"); 784Debug.Assert(fieldType.IsPrimitive || fieldType.IsPointer || fieldType.IsFunctionPointer || fieldType.IsEnum || fieldType.IsByRef); 854Debug.Assert(fieldType.IsPrimitive || fieldType.IsPointer || fieldType.IsFunctionPointer || fieldType.IsEnum || fieldType.IsByRef); 947Debug.Assert(instanceNonGCPointerFieldsCount[i] < instanceNonGCPointerFieldsArr[i].Length 1086Debug.Assert(size > 0); 1089Debug.Assert(0 == (size & (size - 1))); 1176Debug.Assert(fieldType.IsPointer || fieldType.IsFunctionPointer || fieldType.IsByRef); 1280Debug.Assert(type.IsValueType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataTypeSystemContext.cs (3)
6using Debug = System.Diagnostics.Debug; 66Debug.Assert(s_wellKnownTypeNames[(int)WellKnownType.MulticastDelegate - 1] == "MulticastDelegate"); 86Debug.Assert(_wellKnownTypes != null, "Forgot to call SetSystemModule?");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MetadataVirtualMethodAlgorithm.cs (13)
28Debug.Assert(key.Context == value.Context); 34Debug.Assert(value1.Context == value2.Context); 311Debug.Assert(decl.OwningType.IsInterface); 340Debug.Assert(foundMethodImplsOnDefinition.Length == foundMethodImpls.Length); 347Debug.Assert(index >= 0); 445Debug.Assert(method.GetMethodDefinition() == method); 541Debug.Assert(unificationGroup.IsInGroupOrIsDefiningSlot(originalDefiningMethod)); 607Debug.Assert( 700Debug.Assert(!interfaceMethod.Signature.IsStatic); 773Debug.Assert(!interfaceMethod.Signature.IsStatic); 791Debug.Assert(implMethod != null); 1030Debug.Assert(candidatesCount < candidateInterfaces.Length); 1195Debug.Assert(interfaceMethod.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodDesc.cs (3)
77Debug.Assert(parameters != null, "Parameters must not be null"); 477Debug.Assert(hashcode == ComputeHashCode()); 506Debug.Assert(o is not MethodDesc || ReferenceEquals(((MethodDesc)o).Context, this.Context));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodForInstantiatedType.cs (2)
8using Debug = System.Diagnostics.Debug; 21Debug.Assert(typicalMethodDef.GetTypicalMethodDefinition() == typicalMethodDef);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\SimpleArrayOfTRuntimeInterfacesAlgorithm.cs (1)
47Debug.Assert(arrayType.IsSzArray);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TargetDetails.cs (2)
5using Debug = System.Diagnostics.Debug; 349Debug.Assert(Architecture == TargetArchitecture.ARM ||
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ThrowHelper.Common.cs (2)
6using Debug = System.Diagnostics.Debug; 72Debug.Fail("Multi-module assemblies");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeDesc.cs (6)
29Debug.Assert(o is not TypeDesc || ReferenceEquals(((TypeDesc)o).Context, this.Context)); 37Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context)); 44Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context)); 142Debug.Assert((flags & mask) != 0); 411Debug.Assert((flags >= TypeFlags.Array && flags <= TypeFlags.Pointer) == (this is ParameterizedType)); 424Debug.Assert(GetTypeFlags(TypeFlags.CategoryMask) <= TypeFlags.Interface == this is DefType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeDesc.TypeEquivalence.cs (3)
4using Debug = System.Diagnostics.Debug; 13Debug.Assert(scope != null); 14Debug.Assert(name != null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemConstraintsHelpers.cs (1)
125Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemContext.cs (5)
247Debug.Assert((signature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask) is 0 or MethodSignatureFlags.UnmanagedCallingConvention); 248Debug.Assert(!signature.HasEmbeddedSignatureData); 444Debug.Assert(!(methodDef is InstantiatedMethod)); 517Debug.Assert(!(typicalMethodDef is MethodForInstantiatedType)); 518Debug.Assert(!(typicalMethodDef is InstantiatedMethod));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemContext.Resolution.cs (1)
23Debug.Assert(SystemModule == null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemHelpers.cs (11)
105Debug.Assert(instantiatedType.GetTypeDefinition() == methodTypicalDefinition.OwningType); 110Debug.Assert(method.OwningType.IsArray); 115Debug.Assert(type == methodTypicalDefinition.OwningType); 158Debug.Fail("method has no related type in the type hierarchy of type"); 233Debug.Assert(!type.HasInstantiation); 254Debug.Assert(field.GetTypicalFieldDefinition() == field); 273Debug.Assert(method.IsMethodDefinition && !method.HasInstantiation); 292Debug.Assert(interfaceMethodToResolve.OwningType.IsInterface); 312Debug.Assert(interfaceMethodToResolve.OwningType.IsInterface); 358Debug.Assert(thisType is DefType); 392Debug.Assert(isMethodImpl);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeWithRepeatedFields.cs (1)
59Debug.Assert(firstField is not null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\CustomAttributeTypeNameFormatter.cs (2)
7using Debug = System.Diagnostics.Debug; 142Debug.Assert(mdType.Module is IAssemblyDesc, "Multi-module?");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\CustomAttributeTypeNameParser.cs (1)
134Debug.Fail("Expected to be unreachable");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\GCPointerMap.Algorithm.cs (5)
5using Debug = System.Diagnostics.Debug; 16Debug.Assert(type.ContainsGCPointers); 89Debug.Assert(fieldType.IsValueType); 100Debug.Assert(builder.ToGCMap().Size * type.Context.Target.PointerSize >= type.GCStaticFieldSize.AsInt); 138Debug.Assert(builder.ToGCMap().Size * type.Context.Target.PointerSize >= type.ThreadGcStaticFieldSize.AsInt);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\GCPointerMap.cs (11)
7using Debug = System.Diagnostics.Debug; 90Debug.Assert(numCells <= gcFlags.Length << 5); 144Debug.Assert(Equals(other)); 190Debug.Assert(offset >= 0); 194Debug.Assert(absoluteOffset % _pointerSize == 0); 195Debug.Assert(absoluteOffset <= (_limit - _pointerSize)); 204Debug.Assert(offset >= 0); 208Debug.Assert(absoluteOffset + size <= _limit); 221Debug.Assert(_delta == 0); 249Debug.Assert(startBit >= 0 && numBits >= 0); 250Debug.Assert(startBit + numBits <= buffer.Length << 5);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (4)
9using Debug = System.Diagnostics.Debug; 160Debug.Assert(!foundAOne); 185Debug.Assert(hashTableLocal.Length > 0); 607Debug.Assert(hashTableLocal.Length > 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\TypeNameFormatter.cs (2)
6using Debug = System.Diagnostics.Debug; 42Debug.Assert(type.IsDefType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\CachingMetadataStringDecoder.cs (3)
5using Debug = System.Diagnostics.Debug; 39Debug.Assert((size & (size - 1)) == 0, "The cache size must be power of 2"); 109Debug.Assert((ascii[i] & 0x80) == 0, "The byte* input to this method must be valid ASCII.");
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\CustomAttributeTypeProvider.cs (4)
7using Debug = System.Diagnostics.Debug; 38Debug.Assert(reader == _module.MetadataReader); 44Debug.Assert(reader == _module.MetadataReader); 50Debug.Assert(reader == _module.MetadataReader);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaField.cs (5)
141Debug.Assert(fieldType == FieldType); 198Debug.Assert((flags & mask) != 0); 202Debug.Assert((flags & mask) != 0); 322Debug.Assert(field.HasRva); 331Debug.Assert(field.HasRva);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaGenericParameter.cs (4)
8using Debug = System.Diagnostics.Debug; 76Debug.Assert(parameter.Parent.Kind == HandleKind.TypeDefinition); 105Debug.Assert((int)GenericVariance.Contravariant == (int)GenericParameterAttributes.Contravariant); 115Debug.Assert((int)GenericConstraints.DefaultConstructorConstraint == (int)GenericParameterAttributes.DefaultConstructorConstraint);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaMethod.cs (11)
214Debug.Assert((flags & mask) != 0); 509Debug.Assert((int)MethodImportAttributes.CallingConventionStdCall == (int)PInvokeAttributes.CallingConventionStdCall); 510Debug.Assert((int)MethodImportAttributes.CharSetAuto == (int)PInvokeAttributes.CharSetAuto); 511Debug.Assert((int)MethodImportAttributes.CharSetUnicode == (int)PInvokeAttributes.CharSetUnicode); 512Debug.Assert((int)MethodImportAttributes.SetLastError == (int)PInvokeAttributes.SetLastError); 568Debug.Assert((int)ParameterAttributes.In == (int)ParameterMetadataAttributes.In); 569Debug.Assert((int)ParameterAttributes.Out == (int)ParameterMetadataAttributes.Out); 570Debug.Assert((int)ParameterAttributes.Optional == (int)ParameterMetadataAttributes.Optional); 571Debug.Assert((int)ParameterAttributes.HasDefault == (int)ParameterMetadataAttributes.HasDefault); 572Debug.Assert((int)ParameterAttributes.HasFieldMarshal == (int)ParameterMetadataAttributes.HasFieldMarshal); 595Debug.Assert(marshalAs != null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaModule.cs (3)
14using Debug = System.Diagnostics.Debug; 498Debug.Assert(_metadataReader.GetFieldDefinition(handle).GetDeclaringType() == owningType.Handle); 508Debug.Assert(_metadataReader.GetMethodDefinition(handle).GetDeclaringType() == owningType.Handle);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaModule.Sorting.cs (3)
7using Debug = System.Diagnostics.Debug; 31Debug.Assert(compare != 0); 39Debug.Assert(!StringComparer.Ordinal.Equals(thisName, otherName));
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaSignatureParser.cs (7)
398Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionCdecl == (int)SignatureCallingConvention.CDecl); 399Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionStdCall == (int)SignatureCallingConvention.StdCall); 400Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConventionThisCall == (int)SignatureCallingConvention.ThisCall); 401Debug.Assert((int)MethodSignatureFlags.CallingConventionVarargs == (int)SignatureCallingConvention.VarArgs); 402Debug.Assert((int)MethodSignatureFlags.UnmanagedCallingConvention == (int)SignatureCallingConvention.Unmanaged); 577Debug.Assert(_reader.RemainingBytes != 0); 686Debug.Assert(_reader.RemainingBytes == 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Ecma\EcmaType.MethodImpls.cs (2)
10using Debug = System.Diagnostics.Debug; 97Debug.Fail("unexpected methodDeclHandleKind");
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\EcmaMethodIL.cs (1)
157Debug.Assert(method.IsTypicalMethodDefinition);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\HelperExtensions.cs (2)
10using Debug = System.Diagnostics.Debug; 57Debug.Assert(method.Signature.Length == 0 && method.Signature.IsStatic);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILDisassembler.cs (3)
10using Debug = System.Diagnostics.Debug; 181Debug.Assert(obj is string, "NYI: " + obj.GetType()); 610Debug.Assert(owningModule is IAssemblyDesc);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILOpcodeHelper.cs (4)
4using Debug = System.Diagnostics.Debug; 20Debug.Assert((uint)opcode < (uint)s_opcodeSizes.Length); 22Debug.Assert(result != VariableSize); 23Debug.Assert(result != Invalid);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILReader.cs (2)
9using Debug = System.Diagnostics.Debug; 156Debug.Assert((currentOpcode >= ILOpcode.br && currentOpcode <= ILOpcode.blt_un)
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILStackHelper.cs (12)
71Debug.Assert(stackHeights[currentOffset] == StackHeightNotSet 171Debug.Assert(stackHeight > 0); 176Debug.Assert(stackHeight > 0); 230Debug.Assert(stackHeight >= adjustment); 233Debug.Assert(stackHeights[target] == StackHeightNotSet 271Debug.Assert(stackHeight >= adjustment); 282Debug.Assert(stackHeight == 0); 299Debug.Assert(stackHeight > 1); 314Debug.Assert(stackHeight > 2); 329Debug.Assert(stackHeight > 0); 400Debug.Assert(stackHeight > 0); 404Debug.Fail("Unknown instruction");
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\ILTokenReplacer.cs (1)
25Debug.Assert((offsetAfter - offsetBefore) == 5 || (offsetAfter - offsetBefore) == 6);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\InstantiatedMethodIL.cs (3)
6using Debug = System.Diagnostics.Debug; 19Debug.Assert(methodIL.GetMethodILDefinition() == methodIL); 20Debug.Assert(owningMethod.HasInstantiation || owningMethod.OwningType.HasInstantiation);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\Stubs\ILEmitter.cs (20)
10using Debug = System.Diagnostics.Debug; 47Debug.Assert(_startOffsetForLinking != StartOffsetNotSet); 115Debug.Assert(index >= 0); 129Debug.Assert(index >= 0); 200Debug.Assert(opcode == ILOpcode.br || opcode == ILOpcode.brfalse || 286Debug.Fail("Unexpected TypeDesc category"); 335Debug.Fail("Unexpected TypeDesc category"); 385Debug.Fail("Unexpected TypeDesc category"); 435Debug.Fail("Unexpected TypeDesc category"); 447Debug.Assert(builder._beginTryStream == null); 454Debug.Assert(builder._endTryStream == null); 461Debug.Assert(builder._beginHandlerStream == null); 468Debug.Assert(builder._endHandlerStream == null); 479Debug.Assert(patch.Label.IsPlaced); 480Debug.Assert(_startOffsetForLinking != StartOffsetNotSet); 527Debug.Assert((exceptionRegionKind == ILExceptionRegionKind.Catch && catchExceptionType != null) 662Debug.Assert(IsPlaced); 673Debug.Assert(!IsPlaced); 705Debug.Assert(value != null); 818Debug.Assert(region.IsDefined);
src\runtime\src\coreclr\tools\Common\TypeSystem\IL\UnsafeAccessors.cs (16)
22Debug.Assert(method != null); 301Debug.Assert(dd.kind == EmbeddedSignatureDataKind.UnmanagedCallConv); 303Debug.Assert(tmp.Length == 2); 391Debug.Assert(declaration != null); 392Debug.Assert(targetType != null); 393Debug.Assert(targetMethod != null); 487Debug.Assert(targetMaybe is not null); 539Debug.Assert(!replacementType.IsValueType); 766Debug.Assert(context.TargetMethod != null); 770Debug.Assert(context.TargetMethod != null); 774Debug.Assert(context.TargetMethod != null); 778Debug.Assert(context.TargetField != null); 782Debug.Assert(context.TargetField != null); 786Debug.Fail("Unknown UnsafeAccessorKind"); 838Debug.Assert(result is SetTargetResult.Missing); 855Debug.Assert(thrower != null);
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\MarshalAsDescriptor.cs (2)
62Debug.Assert(Type == NativeTypeKind.CustomMarshaler, "Marshaller type can be set only when using for CustomMarshaller"); 71Debug.Assert(Type == NativeTypeKind.CustomMarshaler, "Cookie can be set only when using for CustomMarshaller");
src\runtime\src\coreclr\tools\Common\TypeSystem\Interop\MethodDesc.Interop.cs (1)
191System.Diagnostics.Debug.Fail("Unexpected Unmanaged Calling Convention.");
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\FunctionPointerType.RuntimeDetermined.cs (1)
4using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\GenericParameterDesc.RuntimeDetermined.cs (3)
4using Debug = System.Diagnostics.Debug; 14Debug.Fail("IsRuntimeDeterminedSubtype of an indefinite type"); 21Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\MethodForRuntimeDeterminedType.cs (1)
18Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\RuntimeDeterminedCanonicalizationAlgorithm.cs (3)
4using Debug = System.Diagnostics.Debug; 118Debug.Assert(((RuntimeDeterminedType)typeToConvert).CanonicalType == context.UniversalCanonType); 145Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\RuntimeDeterminedType.cs (3)
9using Debug = System.Diagnostics.Debug; 164Debug.Assert((flags & mask) != 0); 202Debug.Assert(_runtimeDeterminedDetailsType.Kind == GenericParameterKind.Method);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\RuntimeDeterminedTypeUtilities.cs (4)
4using Debug = System.Diagnostics.Debug; 12Debug.Assert(instantiation.Length == openInstantiation.Length); 30Debug.Assert(openInstantiation[instantiationIndex] is GenericParameterDesc); 34Debug.Assert(canonForm is DefType);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\SignatureVariable.RuntimeDetermined.cs (3)
4using Debug = System.Diagnostics.Debug; 14Debug.Fail("IsRuntimeDeterminedSubtype of an indefinite type"); 21Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\RuntimeDetermined\TypeSystemContext.RuntimeDetermined.cs (2)
135Debug.Assert(!(typicalMethodDef is MethodForRuntimeDeterminedType)); 136Debug.Assert(typicalMethodDef.IsTypicalMethodDefinition);
src\runtime\src\coreclr\tools\Common\TypeSystem\Sorting\TypeSystemComparer.cs (12)
6using Debug = System.Diagnostics.Debug; 42Debug.Assert(x.GetType() == y.GetType()); 47Debug.Assert(result != 0); 53Debug.Assert(x.GetType() != y.GetType()); 60Debug.Assert(x.GetType() == y.GetType()); 68Debug.Assert(result != 0); 84Debug.Assert(x.GetType() == y.GetType()); 89Debug.Assert(result != 0); 95Debug.Assert(x.GetType() != y.GetType()); 111Debug.Assert(x.GetType() == y.GetType()); 116Debug.Assert(result != 0); 122Debug.Assert(x.GetType() != y.GetType());
src\runtime\src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
140Debug.Assert(hashCode == NameHashCode("System.Array`1"u8));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
illink (215)
ILLink.RoslynAnalyzer (127)
DataFlow\ControlFlowGraphExtensions.cs (2)
18Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 25Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
DataFlow\ControlFlowGraphProxy.cs (2)
66Debug.Assert(region != null); 174Debug.Assert(enclosingRegion.Kind == ControlFlowRegionKind.TryAndCatch);
DataFlow\InterproceduralState.cs (1)
54Debug.Assert(!Methods.IsUnknown());
DataFlow\LocalDataFlowAnalysis.cs (2)
89Debug.Assert(Context.OwningSymbol is not IMethodSymbol methodSymbol || 98Debug.Assert(!oldInterproceduralState.Methods.IsUnknown());
DataFlow\LocalDataFlowVisitor.cs (30)
119Debug.Assert(OwningSymbol is IMethodSymbol or IFieldSymbol or IPropertySymbol, 127Debug.Assert(OwningSymbol is IMethodSymbol, 202Debug.Assert(assemblyType != null); 206Debug.Assert(method != null); 228Debug.Assert(local.ContainingSymbol is IMethodSymbol or IFieldSymbol, // backing field for property initializers 456Debug.Assert(targetOperation is not IFlowCaptureReferenceOperation); 488Debug.Assert(valueOperation is not null); 550Debug.Assert(IsLValueFlowCapture(flowCaptureReference.Id)); 551Debug.Assert(flowCaptureReference.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Write)); 553Debug.Assert(!capturedReferences.IsUnknown()); 594Debug.Assert(IsLValueFlowCapture(flowCaptureReference.Id)); 597Debug.Assert(!capturedReferences.IsUnknown()); 899Debug.Assert(source is not null); 977Debug.Assert(IsLValueFlowCapture(flowCaptureReference.Id)); 979Debug.Assert(!capturedReferences.IsUnknown()); 1051Debug.Assert(addMethod != null); 1059Debug.Assert(removeMethod != null); 1068Debug.Assert(!IsLValueFlowCapture(operation.Id), 1070Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Read), 1090Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Write), 1092Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Reference), 1130Debug.Assert(operation.Value is not IFlowCaptureReferenceOperation); 1171Debug.Assert(!capturedReferences.IsUnknown()); 1223Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 1282Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Read)); 1297Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Reference)); 1332Debug.Assert(operation.GetValueUsageInfo(OwningSymbol).HasFlag(ValueUsageInfo.Read)); 1376Debug.Assert(operation.Symbol.ContainingSymbol is IMethodSymbol or IFieldSymbol); 1378Debug.Assert(lambda.MethodKind == MethodKind.LambdaMethod); 1525Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
DataFlow\LValueFlowCaptureProvider.cs (1)
86Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
DataFlow\MethodBodyValue.cs (2)
23Debug.Assert(owningSymbol is (IMethodSymbol or IFieldSymbol or IPropertySymbol)); 33Debug.Assert(ControlFlowGraph == other.ControlFlowGraph);
DynamicallyAccessedMembersAnalyzer.cs (1)
81Debug.Assert((int)first < (int)last);
IOperationExtensions.cs (2)
104Debug.Fail("Unhandled declaration pattern context"); 125Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\runtime\src\libraries\Common\src\System\Buffers\SearchValuesPolyfills.cs (1)
65Debug.Assert(_nonAscii.Length < 10, "Expected few non-ASCII characters at most.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
23Debug.Assert(name.Length != 0);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
66Debug.Assert(input.Length > 0);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (3)
231Debug.Fail("Pre-allocated full name should have been provided in the ctor"); 345Debug.Assert(_fullName is not null); 391Debug.Assert(rootTypeName._fullName is not null);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (2)
64Debug.Assert(parsedName.GetNodeCount() == recursiveDepth, $"Node count mismatch for '{typeName.ToString()}'"); 275Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (7)
180Debug.Assert(rankOrModifier >= 2); 360Debug.Fail("Expected to be unreachable"); 371Debug.Fail("Expected to be unreachable"); 382Debug.Fail("Expected to be unreachable"); 393Debug.Fail("Expected to be unreachable"); 404Debug.Fail("Expected to be unreachable"); 415Debug.Fail("Expected to be unreachable");
src\runtime\src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
54Debug.Assert(memberTypes != DynamicallyAccessedMemberTypes.None);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\CompilerGeneratedNames.cs (1)
180Debug.Assert(ch < 0x80);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ForwardDataFlowAnalysis.cs (9)
70Debug.Assert(entryOut != null); 202Debug.Assert(successor.ConditionKind is ConditionKind.WhenTrue or ConditionKind.WhenFalse); 325Debug.Assert(isPredecessorInFinally); 393Debug.Assert(result); 405Debug.Assert(exceptionState != null); 406Debug.Assert(oldExceptionState != null); 413Debug.Assert(enclosingTryOrCatch.Kind != RegionKind.Filter); 445Debug.Assert(finallyExit != null); 448Debug.Assert(finallyExit.Value.ConditionKind == ConditionKind.Unconditional);
src\runtime\src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (4)
190Debug.Assert(other._values == UnknownSentinel); 206Debug.Assert(other._values == UnknownSentinel); 212Debug.Assert(_values == UnknownSentinel); 242Debug.Assert(_values == UnknownSentinel);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\ArrayOfAnnotatedSystemTypeValue.cs (1)
34Debug.Assert(!IsModified);
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (4)
95Debug.Assert(requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None); 100Debug.Assert(instanceValue.IsEmpty()); 101Debug.Assert(argumentValues.Count == 1); 525Debug.Fail("Unreachable.");
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableSystemTypeValue.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableValueWithDynamicallyAccessedMembers.cs (1)
23Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableSystemTypeValue.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
src\runtime\src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs (1)
21Debug.Assert(nullableType.IsTypeOf(WellKnownType.System_Nullable_T));
TrimAnalysis\ArrayValue.cs (1)
80System.Diagnostics.Debug.Assert(v is not ArrayValue);
TrimAnalysis\DiagnosticContext.cs (1)
50Debug.Assert(Location != null);
TrimAnalysis\FlowAnnotations.cs (2)
188Debug.Assert(property != null); 211Debug.Assert(property != null);
TrimAnalysis\HandleCallAction.cs (1)
353Debug.Assert(property != null);
TrimAnalysis\MethodReturnValue.cs (1)
23Debug.Assert(!isNewObj || methodSymbol.MethodKind == MethodKind.Constructor, "isNewObj can only be true for constructors");
TrimAnalysis\ParameterProxy.cs (1)
34Debug.Fail($"Unexpected RefKind {ParameterSymbol!.RefKind} found on parameter {GetDisplayName()}");
TrimAnalysis\ReflectionAccessAnalyzer.cs (2)
123Debug.Assert(member is IMethodSymbol or IFieldSymbol); 130Debug.Assert(_typeHierarchyType is not null);
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (2)
44Debug.Assert(Operation == other.Operation); 45Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisBackingFieldAccessPattern.cs (3)
37Debug.Assert(SymbolEqualityComparer.Default.Equals(Property, other.Property)); 38Debug.Assert(Operation == other.Operation); 39Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (3)
36Debug.Assert(SymbolEqualityComparer.Default.Equals(Field, other.Field)); 37Debug.Assert(Operation == other.Operation); 38Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (3)
37Debug.Assert(Operation == other.Operation); 38Debug.Assert(SymbolEqualityComparer.Default.Equals(GenericInstantiation, other.GenericInstantiation)); 39Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (4)
58Debug.Assert(Operation == other.Operation); 59Debug.Assert(SymbolEqualityComparer.Default.Equals(CalledMethod, other.CalledMethod)); 60Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol)); 61Debug.Assert(Arguments.Length == other.Arguments.Length);
TrimAnalysis\TrimAnalysisPatternStore.cs (1)
122Debug.Assert(existingPattern == pattern, "Return values should be identical");
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (3)
35Debug.Assert(SymbolEqualityComparer.Default.Equals(ReferencedMethod, other.ReferencedMethod)); 36Debug.Assert(Operation == other.Operation); 37Debug.Assert(SymbolEqualityComparer.Default.Equals(OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisVisitor.cs (2)
424Debug.Assert(OwningSymbol is IMethodSymbol); 440Debug.Assert(OwningSymbol is IMethodSymbol);
TrimAnalysis\TrimDataFlowAnalysis.cs (2)
149Debug.WriteLine(tracingInfo); 168Debug.Write(tracingInfo);
TrimAnalysis\TypeNameResolver.cs (1)
92Debug.Fail("Unreachable");
Microsoft.Analyzers.Local.Tests (1)
InternalReferencedInPublicDocAnalyzerTests.cs (1)
459Debug.Assert(lineNumbers.Length == detectedTexts.Length, "Line numbers and texts should be the same length");
Microsoft.AspNetCore (6)
BootstrapHostBuilder.cs (1)
111Debug.Assert(descriptor.ImplementationType?.Name == "GenericWebHostService");
WebApplicationBuilder.cs (5)
89Debug.Assert(slim, "should only be called with slim: true"); 159Debug.Assert(!slim, "should only be called with slim: false"); 160Debug.Assert(empty, "should only be called with empty: true"); 416Debug.Assert(_builtApplication is not null); 598Debug.Assert(_builtApplication is not null);
Microsoft.AspNetCore.Analyzers (3)
BuildServiceProviderAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
UseAuthorizationAnalyzer.cs (1)
22Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
UseMvcAnalyzer.cs (1)
21Debug.Assert(context.Symbol.Kind == SymbolKind.NamedType);
Microsoft.AspNetCore.Antiforgery (25)
Internal\BinaryBlob.cs (2)
62Debug.Assert(_data.Length == other._data.Length); 75Debug.Assert(_data != null && _data.Length >= (32 / 8));
Internal\DefaultAntiforgery.cs (7)
54Debug.Assert(antiforgeryFeature.NewCookieTokenString != null); 180Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.CookieToken)); 181Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.RequestToken)); 280Debug.Assert(antiforgeryFeature.HaveDeserializedCookieToken); 309Debug.Assert(_tokenGenerator.IsCookieTokenValid(newCookieToken)); 403Debug.Assert(antiforgeryFeature.HaveGeneratedNewCookieToken); 404Debug.Assert(antiforgeryFeature.NewRequestToken != null);
Internal\DefaultAntiforgeryTokenStore.cs (4)
24Debug.Assert(httpContext != null); 38Debug.Assert(httpContext != null); 81Debug.Assert(httpContext != null); 82Debug.Assert(token != null);
Internal\DefaultClaimUidExtractor.cs (2)
19Debug.Assert(claimsPrincipal != null); 116Debug.Assert(destination.Length >= SHA256.HashSizeInBytes);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.App.Analyzers (84)
Infrastructure\EmbeddedSyntax\EmbeddedSeparatedSyntaxNodeList.cs (4)
26Debug.Assert(!nodesAndTokens.IsDefault); 44Debug.Assert(NodesAndTokens[i].IsNode); 45Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 50Debug.Assert(!NodesAndTokens[i].IsNode);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNode.cs (1)
25Debug.Assert((int)(object)kind != 0);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxNodeOrToken.cs (2)
25Debug.Assert((int)(object)token.Kind != 0); 33Debug.Assert(Node == null);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxToken.cs (1)
30Debug.Assert(!diagnostics.IsDefault);
Infrastructure\EmbeddedSyntax\EmbeddedSyntaxTrivia.cs (1)
27Debug.Assert(virtualChars.Length > 0);
Infrastructure\RoutePattern\RoutePatternNodes.cs (20)
19Debug.Assert(parts != null); 20Debug.Assert(endOfFileToken.Kind == RoutePatternKind.EndOfFile); 72Debug.Assert(openBracketToken.Kind == RoutePatternKind.OpenBracketToken); 73Debug.Assert(textToken.Kind == RoutePatternKind.ReplacementToken); 74Debug.Assert(closeBracketToken.Kind == RoutePatternKind.CloseBracketToken); 108Debug.Assert(openBraceToken.Kind == RoutePatternKind.OpenBraceToken); 109Debug.Assert(closeBraceToken.Kind == RoutePatternKind.CloseBraceToken); 146Debug.Assert(literalToken.Kind == RoutePatternKind.Literal); 170Debug.Assert(separatorToken.Kind == RoutePatternKind.DotToken); 194Debug.Assert(separatorToken.Kind == RoutePatternKind.SlashToken); 218Debug.Assert(asteriskToken.Kind == RoutePatternKind.AsteriskToken); 242Debug.Assert(questionMarkToken.Kind == RoutePatternKind.QuestionMarkToken); 266Debug.Assert(equalsToken.Kind == RoutePatternKind.EqualsToken); 267Debug.Assert(defaultValueToken.Kind == RoutePatternKind.DefaultValueToken); 294Debug.Assert(parameterNameToken.Kind == RoutePatternKind.ParameterNameToken); 318Debug.Assert(colonToken.Kind == RoutePatternKind.ColonToken); 345Debug.Assert(openParenToken.Kind == RoutePatternKind.OpenParenToken); 346Debug.Assert(argumentToken.Kind == RoutePatternKind.PolicyFragmentToken); 347Debug.Assert(closeParenToken.Kind == RoutePatternKind.CloseParenToken); 377Debug.Assert(argumentToken.Kind == RoutePatternKind.PolicyFragmentToken);
Infrastructure\RoutePattern\RoutePatternParser.cs (3)
65Debug.Assert(_lexer.Position == _lexer.Text.Length); 66Debug.Assert(_currentToken.Kind == RoutePatternKind.EndOfFile); 439Debug.Assert(_routePatternOptions.SupportTokenReplacement);
Infrastructure\VirtualChars\AbstractVirtualCharService.cs (13)
76Debug.Assert(expectedValueText == actualValueText); 82Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 86Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 95Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 104Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 114Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 132Debug.Assert(!token.ContainsDiagnostics); 136Debug.Assert(startDelimiter == ""); 137Debug.Assert(endDelimiter == ""); 144Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 150Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 218Debug.Assert(char.IsSurrogate(ch));
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (18)
58Debug.Assert(!token.ContainsDiagnostics); 250Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 256Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 341Debug.Assert(char.IsSurrogate(ch)); 351Debug.Assert(tokenText[index] == '\\'); 364Debug.Assert(tokenText[index] == '\\'); 397Debug.Assert(tokenText[index] == '\\'); 407Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 416Debug.Assert(tokenText[index] == '\\'); 427Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 436Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 447Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 461Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 479Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 488Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 501Debug.Assert(character == 'x'); 507Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 533Debug.Assert(IsHexDigit(c));
Infrastructure\VirtualChars\VirtualCharSequence.Chunks.cs (2)
72Debug.Assert(index >= 0); 150Debug.Assert(index + 1 >= _underlyingData.Length ||
Infrastructure\VirtualChars\VirtualCharSequence.cs (3)
214Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 215Debug.Assert(_span.End == virtualChars._span.Start); 226Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
Mvc\DetectAmbiguousActionRoutes.cs (1)
110Debug.Assert(!httpMethods.IsDefault);
Mvc\DetectOverriddenAuthorizeAttribute.cs (3)
29Debug.Assert(authorizeAttributes.Count is 0); 59Debug.Assert(authorizeAttributes.Count is 0); 109Debug.Assert(currentMethod is null);
RouteEmbeddedLanguage\FrameworkParametersCompletionProvider.cs (1)
549Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
RouteEmbeddedLanguage\RoutePatternCompletionProvider.cs (1)
401Debug.Assert(token.IsKind(SyntaxKind.StringLiteralToken));
RouteHandlers\DetectAmbiguousRoutes.cs (1)
153Debug.Assert(!httpMethods.IsDefault);
RouteHandlers\DetectMisplacedLambdaAttribute.cs (1)
30Debug.Fail("Expected a single top-level BlockOperation for all lambdas.");
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (3)
34Debug.Assert(methodSymbol != null); 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (1)
47Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.App.CodeFixes (2)
Authorization\AddAuthorizationBuilderFixer.cs (2)
76Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic."); 110Debug.Assert(false, "AddAuthorizationBuilderAnalyzer should not have emitted a diagnostic.");
Microsoft.AspNetCore.Authentication (1)
RemoteAuthenticationHandler.cs (1)
145Debug.Assert(ticket != null);
Microsoft.AspNetCore.Authentication.Cookies (2)
CookieAuthenticationHandler.cs (1)
213Debug.Assert(result.Ticket != null);
src\aspnetcore\src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.Authentication.Negotiate (5)
Internal\LdapAdapter.cs (1)
72Debug.Assert(settings.LdapConnection != null);
NegotiateHandler.cs (3)
139Debug.Assert(exception != null); 208Debug.Assert(object.ReferenceEquals(persistence?.State, _negotiateState), 400Debug.Assert(!items.ContainsKey(AuthPersistenceKey), "This should only be registered once per connection");
PostConfigureNegotiateOptions.cs (1)
49Debug.Assert(_serverAuth.AuthenticationScheme != null);
Microsoft.AspNetCore.Components (59)
ComponentsMetrics.cs (1)
40Debug.Assert(meterFactory != null);
PersistentComponentState.cs (1)
86Debug.Assert(CurrentContext != null);
PersistentState\PersistentStateValueProviderKeyResolver.cs (3)
80Debug.Assert(written == 0); 100Debug.Assert(written == 0); 115Debug.Assert(hashSucceeded);
Rendering\ComponentState.cs (1)
365Debug.Assert(currentFrame.FrameType != RenderTreeFrameType.Component || currentFrame.Component != null, "GetComponentKey is being invoked too soon, ComponentState is not fully constructed.");
Rendering\RenderTreeBuilder.cs (2)
824Debug.Assert(_hasSeenAddMultipleAttributes); 846Debug.Assert(frame.FrameTypeField == RenderTreeFrameType.Attribute, $"Frame type is {frame.FrameTypeField} at {i}");
RenderTree\Renderer.cs (2)
343Debug.Assert(_pendingTasks == null); 400Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0);
RenderTree\RenderTreeDiffBuilder.cs (1)
174Debug.Assert(action switch
Routing\SupplyParameterFromQueryValueProvider.cs (2)
55Debug.Assert(_subscribers is not null); 113Debug.Assert(_subscribers is not null);
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
182Debug.Assert(newCapacity > _items.Length);
src\aspnetcore\src\Components\Shared\src\QueryParameterValueSupplier.cs (1)
65Debug.Assert(url is not null);
src\aspnetcore\src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
489Debug.Assert(_arrayStorage != null);
src\aspnetcore\src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
src\aspnetcore\src\Http\Routing\src\ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
src\aspnetcore\src\Http\Routing\src\PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 89Debug.Assert(_path[_path.Length - 1] != '/'); 90Debug.Assert(currentSegmentIndex == index);
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePattern.cs (5)
45Debug.Assert(defaults != null); 46Debug.Assert(parameterPolicies != null); 47Debug.Assert(parameters != null); 48Debug.Assert(requiredValues != null); 49Debug.Assert(pathSegments != null);
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
src\aspnetcore\src\Http\Routing\src\Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
src\aspnetcore\src\Http\Routing\src\Template\RoutePrecedence.cs (3)
69Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 191Debug.Assert(parameterPart != null);
src\aspnetcore\src\Http\Routing\src\Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
src\aspnetcore\src\Http\Routing\src\Tree\UrlMatchingTree.cs (2)
98Debug.Assert(segment.Parts.Count == 1); 231Debug.Fail("We shouldn't get here.");
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (6)
93Debug.Assert(_rentedBuffer != null); 172Debug.Assert(_rentedBuffer != null); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\QueryStringEnumerable.cs (1)
105Debug.Assert(success);
Microsoft.AspNetCore.Components.Endpoints (40)
Builder\RazorComponentEndpointDataSource.cs (4)
77Debug.Assert(_changeToken != null); 78Debug.Assert(_endpoints != null); 208Debug.Assert(_changeToken != null); 209Debug.Assert(_endpoints != null);
CacheView\CacheViewKeyResolver.cs (1)
89Debug.Assert(hashSucceeded);
FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
FormMapping\FormDataReader.cs (3)
195Debug.Assert(_currentDepth >= 0); 199Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 228Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
FormMapping\HttpContextFormValueMapper.cs (1)
88Debug.Assert(deserializer != null);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Components.Media (1)
MediaComponentBase.cs (1)
164Debug.Assert(_renderHandle.IsInitialized);
Microsoft.AspNetCore.Components.QuickGrid (2)
src\aspnetcore\src\Components\Shared\src\QueryParameterValueSupplier.cs (1)
65Debug.Assert(url is not null);
src\aspnetcore\src\Shared\QueryStringEnumerable.cs (1)
105Debug.Assert(success);
Microsoft.AspNetCore.Components.Server (30)
BlazorPack\SequenceOfT.cs (3)
168Debug.Assert(last != null, "Cannot advance before acquiring memory."); 407Debug.Assert(segment != null, "Null not allowed."); 433Debug.Assert(offset >= this.Start, "Trying to rewind.");
Circuits\CircuitMetrics.cs (1)
21Debug.Assert(meterFactory != null);
Circuits\CircuitRegistry.cs (3)
136Debug.Assert(result, "This operation operates inside of a lock. We expect the previously inspected value to be still here."); 279Debug.Fail($"Unexpected {nameof(EvictionReason)} {reason}"); 362Debug.Assert(removeResult, "This operation operates inside of a lock. We expect the previously inspected value to be still here.");
Circuits\DefaultInMemoryCircuitPersistenceProvider.cs (1)
94Debug.Fail($"Unexpected {nameof(EvictionReason)} {reason}");
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
182Debug.Assert(newCapacity > _items.Length);
src\aspnetcore\src\Shared\Components\ComponentsActivityLinkStore.cs (1)
36Debug.Assert(_store != null, "Activity links store should not be null.");
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (6)
93Debug.Assert(_rentedBuffer != null); 172Debug.Assert(_rentedBuffer != null); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackReader.cs (1)
268Debug.Fail("Missing handler for code: " + code);
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReader.cs (9)
263Debug.Assert(this.usingSequence, "usingSequence"); 270Debug.Assert(this.usingSequence, "usingSequence"); 305Debug.Assert(this.usingSequence, "usingSequence"); 365Debug.Assert(count >= 0, "count >= 0"); 382Debug.Assert(count >= 0, "count >= 0"); 387Debug.Assert(this.CurrentSpanIndex < this.CurrentSpan.Length, "this.CurrentSpanIndex < this.CurrentSpan.Length"); 408Debug.Assert(this.usingSequence, "usingSequence"); 430Debug.Assert(count >= 0, "count >= 0"); 474Debug.Assert(firstSpan.Length < destination.Length, "firstSpan.Length < destination.Length");
src\aspnetcore\src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\SequenceReaderExtensions.cs (1)
72Debug.Assert(reader.UnreadSpan.Length < sizeof(T), "reader.UnreadSpan.Length < sizeof(T)");
Microsoft.AspNetCore.Components.Web (9)
Forms\EditForm.cs (2)
133Debug.Assert(_editContext != null); 202Debug.Assert(_editContext != null);
Forms\InputDate.cs (1)
115Debug.Assert(result != null);
Forms\InputRadio.cs (1)
63Debug.Assert(Context != null);
Forms\InputRadioGroup.cs (1)
71Debug.Assert(_context != null);
Forms\Mapping\SupplyParameterFromFormValueProvider.cs (1)
74Debug.Assert(mappingContext != null);
HtmlRendering\StaticHtmlRenderer.HtmlWriting.cs (2)
162Debug.Assert(afterElement == position + frame.ElementSubtreeLength); 177Debug.Assert(afterAttributes == position + frame.ElementSubtreeLength);
Virtualization\Virtualize.cs (1)
432Debug.Assert(refreshTask.IsCompletedSuccessfully);
Microsoft.AspNetCore.Components.WebAssembly (2)
Services\WebAssemblyConsoleLogger.cs (1)
95Debug.Assert(logLevel != LogLevel.None, "This method is never called with LogLevel.None.");
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
182Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.Components.WebView (1)
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
182Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
98Debug.Assert(key != null);
Microsoft.AspNetCore.Cryptography.Internal (6)
CryptoUtil.cs (1)
61Debug.Fail(message);
SafeHandles\BCryptAlgorithmHandle.cs (1)
45Debug.Assert(pbKey != null);
UnsafeNativeMethods.cs (1)
479Debug.Assert(lastError != 0, "This method should only be called if there was an error.");
WeakReferenceHelpers.cs (3)
38Debug.Assert(newTarget != null); 41Debug.Assert(newWeakRef != null); 53Debug.Assert(currentWeakRef != null);
Microsoft.AspNetCore.Cryptography.KeyDerivation (17)
PBKDF2\ManagedPbkdf2Provider.cs (5)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0); 96Debug.Assert(src.Length == dest.Length);
PBKDF2\NetCorePbkdf2Provider.cs (4)
19Debug.Assert(password != null); 20Debug.Assert(salt != null); 21Debug.Assert(iterationCount > 0); 22Debug.Assert(numBytesRequested > 0);
PBKDF2\Win7Pbkdf2Provider.cs (4)
18Debug.Assert(password != null); 19Debug.Assert(salt != null); 20Debug.Assert(iterationCount > 0); 21Debug.Assert(numBytesRequested > 0);
PBKDF2\Win8Pbkdf2Provider.cs (4)
20Debug.Assert(password != null); 21Debug.Assert(salt != null); 22Debug.Assert(iterationCount > 0); 23Debug.Assert(numBytesRequested > 0);
Microsoft.AspNetCore.DataProtection (70)
AuthenticatedEncryption\AuthenticatedEncryptorFactory.cs (1)
82Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngCbcAuthenticatedEncryptorFactory.cs (1)
43Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
AuthenticatedEncryption\CngGcmAuthenticatedEncryptorFactory.cs (1)
44Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Cng\DpapiSecretSerializerHelper.cs (9)
45Debug.Assert(secret != null); 120Debug.Assert(secret != null); 121Debug.Assert(protectionDescriptorHandle != null); 146Debug.Assert(protectionDescriptorHandle != null); 147Debug.Assert(pbData != null); 198Debug.Assert(protectedSecret != null); 261Debug.Assert(protectedData != null); 274Debug.Assert(pbData != null); 322Debug.Assert(protectedData != null);
DataProtectionServiceCollectionExtensions.cs (1)
64Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
EphemeralDataProtectionProvider.cs (2)
50Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 103Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
KeyManagement\Key.cs (4)
135Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor 151Debug.Assert(_descriptorFactory is not null, "Key constructed without either descriptor or descriptor factory"); 171Debug.Fail("ResetDescriptor called with descriptor available"); 172Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor
KeyManagement\KeyRingBasedDataProtector.cs (5)
40Debug.Assert(keyRingProvider != null); 200Debug.Assert(protectedData != null); 308Debug.Assert(success, "Failed to write Guid."); 339Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */); 415Debug.Assert(index == targetArr.Length);
KeyManagement\KeyRingBasedSpanDataProtector.cs (1)
53Debug.Assert(writeKeyIdResult, "Failed to write Guid to destination.");
KeyManagement\KeyRingProvider.cs (12)
173Debug.Assert(defaultKey != null); 176Debug.Assert(defaultKey.CreateEncryptor() != null); 228Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 312Debug.Assert(existingCacheableKeyRing != null); 328Debug.Assert(utcNow.Kind == DateTimeKind.Utc); 372Debug.Assert(taskKeyRing is not null, "How did _cacheableKeyRingTask change while we were holding the lock?"); 425Debug.Assert(CacheableKeyRing.IsValid(newCacheableKeyRing, utcNow), "GetCacheableKeyRing produced a ring that is already invalid at utcNow."); 459Debug.Assert(!forceRefresh, "A forced refresh should have produced a fresh key ring inline."); 460Debug.Assert(existingCacheableKeyRing is not null, "Should have refreshed inline when there was no cached key ring."); 461Debug.Assert(!CacheableKeyRing.IsValid(existingCacheableKeyRing, utcNow), "Should have returned a valid cached key ring above"); 475Debug.Assert(task.IsCompleted); 476Debug.Assert(!task.IsCanceled, "How did a task with no cancellation token get canceled?");
KeyManagement\XmlKeyManager.cs (10)
283Debug.Assert(_cacheExpirationTokenSource != null, $"{nameof(TriggerAndResetCacheExpirationToken)} must have been called first."); 290Debug.Assert(keyElement.Name == KeyElementName); 336Debug.Assert(_knownKeyMap.TryGetValue(key.KeyId, out var existingKey)); 337Debug.Assert(existingKey.CreationDate == key.CreationDate); 338Debug.Assert(existingKey.ActivationDate == key.ActivationDate); 339Debug.Assert(existingKey.ExpirationDate == key.ExpirationDate); 346Debug.Assert(revocationElement.Name == RevocationElementName); 668Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 693Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer. 698Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); // Hint for the platform compatibility analyzer.
Managed\ManagedAuthenticatedEncryptor.cs (2)
430Debug.Assert(success); 432Debug.Assert(bytesWritten == hashSize);
Repositories\DefaultKeyStorageDirectories.cs (1)
74Debug.Assert(retVal != null);
Repositories\FileSystemXmlRepository.cs (1)
209Debug.Assert(fileSystemInfo.Exists, "Having previously been deleted should not have caused an exception");
SP800_108\ManagedSP800_108_CTR_HMACSHA512.cs (2)
139Debug.Assert(success); 140Debug.Assert(bytesWritten == prfOutputSizeInBytes);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (6)
93Debug.Assert(_rentedBuffer != null); 172Debug.Assert(_rentedBuffer != null); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
Microsoft.AspNetCore.DataProtection.Abstractions (3)
CryptoUtil.cs (1)
21Debug.Fail(message);
DataProtectionCommonExtensions.cs (1)
53Debug.Assert(retVal is IDataProtector); // CreateProtector is supposed to return an instance of this interface
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (15)
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (6)
93Debug.Assert(_rentedBuffer != null); 172Debug.Assert(_rentedBuffer != null); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
765Debug.Assert(pemEnvelope != null);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
91Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
354Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Microsoft.AspNetCore.Diagnostics (12)
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\aspnetcore\src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (10)
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\aspnetcore\src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
..\..\..\..\test\Libraries\Microsoft.AspNetCore.Diagnostics.Middleware.Tests\Logging\ApiRoutingController.cs (3)
26Debug.Assert(userId != null, "Test"); 27Debug.Assert(noDataClassification != null, "Test"); 28Debug.Assert(noRedaction != null, "Test");
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Internal\Json\MessageTypeInfoResolver.cs (1)
148Debug.Assert(!field.IsRepeated && !field.IsMap, "Collections shouldn't have a setter.");
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
src\aspnetcore\src\Grpc\JsonTranscoding\src\Shared\HttpRoutePatternParser.cs (3)
343Debug.Assert(CurrentVariable.FieldPath.Any()); 344Debug.Assert(CurrentVariable.StartSegment < CurrentVariable.EndSegment); 345Debug.Assert(CurrentVariable.EndSegment <= _segments.Count);
Microsoft.AspNetCore.Hosting (18)
Http\DefaultHttpContextFactory.cs (2)
56Debug.Assert(featureCollection != null); 57Debug.Assert(httpContext != null);
Internal\ConfigureContainerBuilder.cs (1)
24Debug.Assert(MethodInfo != null, "Shouldn't be called when there is no Configure method.");
Internal\HostingApplicationDiagnostics.cs (2)
175Debug.Assert(context.MetricsTagsFeature != null, "MetricsTagsFeature should be set if MetricsEnabled is true."); 408Debug.Assert(ActivityCreator.IsActivityCreated(_activitySource, diagnosticsOrLoggingEnabled),
Internal\HostingRequestFinishedLog.cs (2)
28Debug.Assert(_context.HttpContext != null); 62Debug.Assert(_context.HttpContext != null);
Internal\StartupMethods.cs (2)
14Debug.Assert(configure != null); 15Debug.Assert(configureServices != null);
Internal\WebHost.cs (4)
82Debug.Assert(_applicationServices != null, "Initialize must be called before accessing services."); 127Debug.Assert(_applicationServices != null, "Initialize must be called first."); 203Debug.Assert(_applicationServices != null, "Initialize must be called first."); 256Debug.Assert(_applicationServices != null, "Initialize must be called first.");
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\aspnetcore\src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Html.Abstractions (2)
HtmlFormattableString.cs (2)
89Debug.Assert(formatProvider != null); 90Debug.Assert(encoder != null);
Microsoft.AspNetCore.Http (12)
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\aspnetcore\src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
228Debug.Assert(_arrayStorage == null); 514Debug.Assert(_arrayStorage != null); 544Debug.Assert(_arrayStorage is not null); 545Debug.Assert(_count <= _arrayStorage.Length); 554Debug.Assert(_dictionaryStorage == null); 555Debug.Assert(_arrayStorage != null); 575Debug.Assert(_dictionaryStorage == null); 576Debug.Assert(_arrayStorage != null);
Microsoft.AspNetCore.Http.Abstractions (26)
Extensions\UseMiddlewareExtensions.cs (2)
202Debug.Assert(!RuntimeFeature.IsDynamicCodeSupported, "Use reflection fallback when dynamic code is not supported."); 267Debug.Assert(RuntimeFeature.IsDynamicCodeSupported, "Use compiled expression when dynamic code is supported.");
PathString.cs (2)
161Debug.Assert(count > 0); 162Debug.Assert(buffer is not null);
Routing\RouteValueDictionary.cs (3)
489Debug.Assert(_arrayStorage != null); 772Debug.Assert(_propertyStorage != null); 885Debug.Assert(value != null);
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
Microsoft.AspNetCore.Http.Connections (7)
Internal\HttpConnectionContext.cs (2)
649Debug.Assert(Status == HttpConnectionStatus.Disposed); 756Debug.Assert(TransportType != HttpTransportType.None, "Transport has not been initialized yet");
Internal\HttpConnectionsMetrics.cs (1)
58Debug.Assert(transportType != HttpTransportType.None);
Internal\Transports\WebSocketsServerTransport.cs (1)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request");
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Http.Connections.Client (10)
Internal\Constants.cs (1)
24Debug.Assert(assemblyVersion != null);
Internal\LongPollingTransport.cs (2)
73Debug.Assert(_application != null); 143Debug.Assert(_application != null);
Internal\ServerSentEventsTransport.cs (2)
90Debug.Assert(_application != null); 128Debug.Assert(_application != null);
Internal\WebSocketsTransport.cs (4)
339Debug.Assert(_application != null); 349Debug.Assert(_notifyOnReconnect is not null); 435Debug.Assert(_application != null); 532Debug.Assert(_application != null);
src\aspnetcore\src\Shared\QueryStringEnumerable.cs (1)
105Debug.Assert(success);
Microsoft.AspNetCore.Http.Connections.Common (3)
NegotiateProtocol.cs (2)
66Debug.Assert(writer.CurrentDepth == 0); 140Debug.Assert(writer.CurrentDepth == 0);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
132Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.Http.Extensions (34)
RequestDelegateFactory.cs (11)
246Debug.Assert(untargetableRequestDelegate is not null); 258Debug.Assert(targetableRequestDelegate is not null); 423Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 1306Debug.Assert(factoryContext.JsonRequestBodyParameter is not null, "factoryContext.JsonRequestBodyParameter is null for a JSON body."); 1313Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1463Debug.Assert(factoryContext.FirstFormRequestBodyParameter is not null, "factoryContext.FirstFormRequestBodyParameter is null for a form body."); 1470Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null."); 1619Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 1644Debug.Assert(parameterInfo.Name != null, "Parameter name must be set for parameters resolved from properties."); 2059Debug.Assert(bindAsyncMethod.Expression is not null); 2358Debug.Assert(parameterName is not null, "CreateArgument() should throw if parameter.Name is null.");
src\aspnetcore\src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
src\aspnetcore\src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
195Debug.Assert(_currentDepth >= 0); 199Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 228Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
525Debug.Fail("No suitable System.Enum.TryParse method found."); 725Debug.Assert(obj is ParameterLookupKey);
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
24Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (1)
47Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.AspNetCore.Http.Results (7)
ResultsOfTHelper.cs (1)
44Debug.Assert(populateMetadataMethod != null, $"Couldn't find PopulateMetadata method on {typeof(TTarget)}.");
src\aspnetcore\src\Http\Shared\StreamCopyOperationInternal.cs (4)
39Debug.Assert(source != null); 40Debug.Assert(destination != null); 41Debug.Assert(!bytesRemaining.HasValue || bytesRemaining.GetValueOrDefault() >= 0); 42Debug.Assert(buffer != null);
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\aspnetcore\src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.HttpLogging (21)
BufferingStream.cs (1)
147Debug.Assert(_tail != null);
src\aspnetcore\src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.Identity (66)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (60)
70Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 71Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 83Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 84Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 85Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 86Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 189Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 190Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 203Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 204Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 205Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 206Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 375Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 376Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 387Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 388Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 389Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 390Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 491Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 492Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 504Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 505Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 506Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 507Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 637Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 638Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 650Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 651Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 652Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 653Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 756Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 757Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 768Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 769Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 770Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 771Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 872Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 873Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 884Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 885Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 886Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 887Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 988Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 989Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1001Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 1002Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1003Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 1004Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 1107Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 1108Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1118Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 1119Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1120Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 1121Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found."); 1209Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 1210Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1223Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 1224Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 1225Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 1226Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
IdentityApiEndpointRouteBuilderExtensions.cs (1)
433Debug.Assert(!result.Succeeded);
PasskeyHandler.cs (1)
435Debug.Assert(originalUserId is not null);
Passkeys\AuthenticatorData.cs (1)
99Debug.Assert(MinLength == 37);
Passkeys\BufferSourceJsonConverter.cs (3)
63Debug.Assert(bytesConsumed == utf8Unescaped.Length); 85Debug.Assert(status == OperationStatus.Done); 86Debug.Assert(bytesConsumed == bytes.Length);
Microsoft.AspNetCore.Mvc.Abstractions (11)
ModelBinding\ModelMetadata.cs (7)
167Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 182Debug.Assert(BoundConstructor != null, "This API can be only called for types with bound constructors."); 661Debug.Assert(_parameterMapping != null); 662Debug.Assert(_boundConstructorPropertyMapping != null); 749Debug.Assert(ModelType != null); 776Debug.Assert(ModelType != null); 790Debug.Assert(
ModelBinding\ModelStateDictionary.cs (2)
552Debug.Assert(key != null); 930Debug.Assert(ChildNodes != null);
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
525Debug.Fail("No suitable System.Enum.TryParse method found."); 725Debug.Assert(obj is ParameterLookupKey);
Microsoft.AspNetCore.Mvc.Analyzers (3)
src\aspnetcore\src\Shared\Roslyn\CodeAnalysisExtensions.cs (3)
34Debug.Assert(methodSymbol != null); 159Debug.Assert(method.PartialImplementationPart == null && !SymbolEqualityComparer.Default.Equals(method.PartialDefinitionPart, method)); 165Debug.Assert(!SymbolEqualityComparer.Default.Equals(method.PartialImplementationPart, method));
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
ApiResponseTypeProvider.cs (1)
274Debug.Assert(attributeScope <= existingScope);
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
24Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
Microsoft.AspNetCore.Mvc.Core (245)
ActionConstraints\ActionConstraintCache.cs (1)
95Debug.Assert(entry.ActionConstraints != null || entry.Items != null);
ApplicationModels\ApplicationModelFactory.cs (1)
79Debug.Assert(result != null);
ApplicationModels\ControllerActionDescriptorBuilder.cs (1)
134Debug.Assert(IsAttributeRouted(actionDescriptor));
Authorization\AuthorizeFilter.cs (1)
204Debug.Assert(AuthorizeData != null);
Controllers\ControllerBinderDelegateProvider.cs (1)
60Debug.Assert(valueProvider is not null);
Filters\DefaultFilterProvider.cs (2)
68Debug.Assert(actualFilter != null, "actualFilter should not be null"); 69Debug.Assert(filterMetadata != null, "filterMetadata should not be null");
Formatters\AcceptHeaderParser.cs (3)
43Debug.Fail("ParseAcceptHeader should advance charIndex, this is a bug."); 124Debug.Assert(input != null); 125Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length.
Infrastructure\ActionSelectionTable.cs (2)
178Debug.Assert(matches != null); 179Debug.Assert(matches.Count >= 0);
Infrastructure\ControllerActionInvoker.cs (16)
118Debug.Assert(state != null); 119Debug.Assert(_actionExecutingContext != null); 142Debug.Assert(state != null); 143Debug.Assert(_actionExecutingContext != null); 173Debug.Assert(state != null); 174Debug.Assert(_actionExecutingContext != null); 222Debug.Assert(state != null); 223Debug.Assert(_actionExecutingContext != null); 224Debug.Assert(_actionExecutedContext != null); 316Debug.Assert(_actionExecutedContext != null); 338Debug.Assert(invoker._actionExecutedContext != null); 344Debug.Assert(_actionExecutingContext != null); 357Debug.Assert(_actionExecutedContext != null); 364Debug.Assert(invoker._actionExecutedContext != null); 525Debug.Assert(_cacheEntry.ControllerBinderDelegate != null); 540Debug.Assert(actionParameters != null, "Expect arguments to be initialized.");
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (4)
57Debug.Assert(_collection != null); 58Debug.Assert(_changeToken != null); 72Debug.Assert(_collection != null); 73Debug.Assert(_changeToken != null);
Infrastructure\ObjectResultExecutor.cs (1)
125Debug.Assert(result.ContentTypes != null);
Infrastructure\ResourceInvoker.cs (50)
339Debug.Assert(state != null); 340Debug.Assert(_authorizationContext != null); 363Debug.Assert(state != null); 364Debug.Assert(_authorizationContext != null); 385Debug.Assert(state != null); 386Debug.Assert(_authorizationContext != null); 415Debug.Assert(state != null); 416Debug.Assert(_authorizationContext != null); 417Debug.Assert(_authorizationContext.Result != null); 475Debug.Assert(state != null); 476Debug.Assert(_resourceExecutingContext != null); 499Debug.Assert(state != null); 500Debug.Assert(_resourceExecutingContext != null); 534Debug.Assert(state != null); 535Debug.Assert(_resourceExecutingContext != null); 577Debug.Assert(state != null); 578Debug.Assert(_resourceExecutingContext != null); 579Debug.Assert(_resourceExecutedContext != null); 603Debug.Assert(state != null); 604Debug.Assert(_resourceExecutingContext != null); 605Debug.Assert(_resourceExecutedContext != null); 651Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 670Debug.Assert(state != null); 700Debug.Assert(state != null); 701Debug.Assert(_exceptionContext != null); 737Debug.Assert(state != null); 786Debug.Assert(state != null); 787Debug.Assert(_exceptionContext != null); 826Debug.Fail("unreachable"); 860Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 893Debug.Assert(scope == Scope.Invoker); 912Debug.Assert(_resourceExecutingContext != null); 926Debug.Assert(_resourceExecutedContext != null); 933Debug.Assert(invoker._resourceExecutedContext != null); 975Debug.Assert(_resourceExecutedContext != null); 997Debug.Assert(invoker._resourceExecutedContext != null); 1172Debug.Assert(state != null); 1173Debug.Assert(_resultExecutingContext != null); 1196Debug.Assert(state != null); 1197Debug.Assert(_resultExecutingContext != null); 1229Debug.Assert(state != null); 1230Debug.Assert(_resultExecutingContext != null); 1278Debug.Assert(state != null); 1279Debug.Assert(_resultExecutingContext != null); 1280Debug.Assert(_resultExecutedContext != null); 1377Debug.Assert(_resultExecutedContext != null); 1400Debug.Assert(invoker._resultExecutedContext != null); 1408Debug.Assert(_resultExecutingContext != null); 1422Debug.Assert(_resultExecutedContext != null); 1429Debug.Assert(invoker._resultExecutedContext != null);
ModelBinding\Binders\ArrayModelBinder.cs (2)
94Debug.Assert(targetType == typeof(TElement[]), "GenericModelBinder only creates this binder for arrays."); 102Debug.Assert(targetType == typeof(TElement?[]), "GenericModelBinder only creates this binder for arrays.");
ModelBinding\Binders\CollectionModelBinder.cs (2)
168Debug.Assert(model != null); 472Debug.Assert(targetCollection != null, "This binder is instantiated only for ICollection<T> model types.");
ModelBinding\Binders\ComplexObjectModelBinder.cs (3)
68Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable); 440Debug.Assert(property.MetadataKind == ModelMetadataKind.Property); 485Debug.Assert(parameter.MetadataKind == ModelMetadataKind.Parameter);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
97Debug.Assert(propertyData == GreedyPropertiesMayHaveData || propertyData == ValueProviderDataAvailable);
ModelBinding\Binders\DictionaryModelBinder.cs (1)
119Debug.Assert(result.Model != null);
ModelBinding\Binders\FormFileModelBinder.cs (2)
105Debug.Assert(postedFiles is List<IFormFile>); 110Debug.Assert(postedFiles is List<IFormFile>);
ModelBinding\Binders\HeaderModelBinder.cs (1)
194Debug.Assert(values != null);
ModelBinding\Metadata\DefaultModelMetadataProvider.cs (2)
227Debug.Fail($"Unable to find property '{propertyKey.Name}' on type '{propertyKey.ContainerType}."); 358Debug.Assert(propertyKey.MetadataKind == ModelMetadataKind.Property);
ModelBinding\ModelBinderFactory.cs (4)
79Debug.Assert(!(binder is PlaceholderBinder)); 176Debug.Assert(metadata != null); 177Debug.Assert(binder != null); 189Debug.Assert(metadata != null);
ModelBinding\PlaceholderBinder.cs (1)
20Debug.Assert(Inner is not null, "Inner must be resolved before BindModelAsync can be called.");
ModelBinding\PrefixContainer.cs (2)
202Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); 259Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
ModelBinding\SuppressChildValidationMetadataProvider.cs (2)
80Debug.Fail("We shouldn't get here."); 85Debug.Assert(FullTypeName != null);
ModelBinding\Validation\ClientValidatorCache.cs (1)
83Debug.Assert(entry.Items != null);
ModelBinding\Validation\ValidationStack.cs (1)
56Debug.Assert(ReferenceEquals(List[List.Count - 1], model));
ModelBinding\Validation\ValidationVisitor.cs (3)
203Debug.Assert(Key != null); 204Debug.Assert(Metadata != null); 422Debug.Assert(Metadata is not null && Key is not null && Model is not null);
ModelBinding\Validation\ValidatorCache.cs (1)
73Debug.Assert(entry.Items != null);
MvcCoreDiagnosticListenerExtensions.cs (100)
26Debug.Assert(diagnosticListener != null); 27Debug.Assert(actionDescriptor != null); 28Debug.Assert(httpContext != null); 29Debug.Assert(routeData != null); 54Debug.Assert(diagnosticListener != null); 55Debug.Assert(actionDescriptor != null); 56Debug.Assert(httpContext != null); 57Debug.Assert(routeData != null); 81Debug.Assert(diagnosticListener != null); 82Debug.Assert(authorizationContext != null); 83Debug.Assert(filter != null); 111Debug.Assert(diagnosticListener != null); 112Debug.Assert(authorizationContext != null); 113Debug.Assert(filter != null); 141Debug.Assert(diagnosticListener != null); 142Debug.Assert(authorizationContext != null); 143Debug.Assert(filter != null); 171Debug.Assert(diagnosticListener != null); 172Debug.Assert(authorizationContext != null); 173Debug.Assert(filter != null); 201Debug.Assert(diagnosticListener != null); 202Debug.Assert(resourceExecutingContext != null); 203Debug.Assert(filter != null); 231Debug.Assert(diagnosticListener != null); 232Debug.Assert(resourceExecutedContext != null); 233Debug.Assert(filter != null); 261Debug.Assert(diagnosticListener != null); 262Debug.Assert(resourceExecutingContext != null); 263Debug.Assert(filter != null); 291Debug.Assert(diagnosticListener != null); 292Debug.Assert(resourceExecutingContext != null); 293Debug.Assert(filter != null); 321Debug.Assert(diagnosticListener != null); 322Debug.Assert(resourceExecutedContext != null); 323Debug.Assert(filter != null); 351Debug.Assert(diagnosticListener != null); 352Debug.Assert(resourceExecutedContext != null); 353Debug.Assert(filter != null); 381Debug.Assert(diagnosticListener != null); 382Debug.Assert(exceptionContext != null); 383Debug.Assert(filter != null); 411Debug.Assert(diagnosticListener != null); 412Debug.Assert(exceptionContext != null); 413Debug.Assert(filter != null); 441Debug.Assert(diagnosticListener != null); 442Debug.Assert(exceptionContext != null); 443Debug.Assert(filter != null); 471Debug.Assert(diagnosticListener != null); 472Debug.Assert(exceptionContext != null); 473Debug.Assert(filter != null); 501Debug.Assert(diagnosticListener != null); 502Debug.Assert(actionExecutingContext != null); 503Debug.Assert(filter != null); 531Debug.Assert(diagnosticListener != null); 532Debug.Assert(actionExecutedContext != null); 533Debug.Assert(filter != null); 561Debug.Assert(diagnosticListener != null); 562Debug.Assert(actionExecutingContext != null); 563Debug.Assert(filter != null); 591Debug.Assert(diagnosticListener != null); 592Debug.Assert(actionExecutingContext != null); 593Debug.Assert(filter != null); 621Debug.Assert(diagnosticListener != null); 622Debug.Assert(actionExecutedContext != null); 623Debug.Assert(filter != null); 651Debug.Assert(diagnosticListener != null); 652Debug.Assert(actionExecutedContext != null); 653Debug.Assert(filter != null); 682Debug.Assert(diagnosticListener != null); 683Debug.Assert(actionContext != null); 684Debug.Assert(actionArguments != null); 685Debug.Assert(controller != null); 728Debug.Assert(diagnosticListener != null); 729Debug.Assert(actionContext != null); 730Debug.Assert(actionArguments != null); 731Debug.Assert(controller != null); 774Debug.Assert(diagnosticListener != null); 775Debug.Assert(resultExecutingContext != null); 776Debug.Assert(filter != null); 804Debug.Assert(diagnosticListener != null); 805Debug.Assert(resultExecutedContext != null); 806Debug.Assert(filter != null); 834Debug.Assert(diagnosticListener != null); 835Debug.Assert(resultExecutingContext != null); 836Debug.Assert(filter != null); 864Debug.Assert(diagnosticListener != null); 865Debug.Assert(resultExecutingContext != null); 866Debug.Assert(filter != null); 894Debug.Assert(diagnosticListener != null); 895Debug.Assert(resultExecutedContext != null); 896Debug.Assert(filter != null); 924Debug.Assert(diagnosticListener != null); 925Debug.Assert(resultExecutedContext != null); 926Debug.Assert(filter != null); 954Debug.Assert(diagnosticListener != null); 955Debug.Assert(actionContext != null); 956Debug.Assert(result != null); 980Debug.Assert(diagnosticListener != null); 981Debug.Assert(actionContext != null); 982Debug.Assert(result != null);
Routing\ActionEndpointDataSourceBase.cs (4)
46Debug.Assert(_changeToken != null); 47Debug.Assert(_endpoints != null); 90Debug.Assert(_changeToken != null); 91Debug.Assert(_endpoints != null);
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
166Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Routing\UrlHelperBase.cs (2)
309Debug.Assert(path.HasValue); 321Debug.Assert(pageName.Length > 0);
Routing\ViewEnginePath.cs (3)
18Debug.Assert(!string.IsNullOrEmpty(first)); 31Debug.Assert(index >= 0); 48Debug.Assert(!string.IsNullOrEmpty(path));
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\aspnetcore\src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
XmlDataContractSerializerOutputFormatter.cs (2)
242Debug.Assert(valueType is not null); 251Debug.Assert(wrapperProvider is not null);
XmlSerializerOutputFormatter.cs (1)
228Debug.Assert(wrapperProvider is not null);
Microsoft.AspNetCore.Mvc.Localization (2)
Properties\Resources.Designer.cs (1)
49System.Diagnostics.Debug.Assert(value != null);
ViewLocalizer.cs (1)
90Debug.Assert(!string.IsNullOrEmpty(path), "Couldn't determine a path for the view");
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
BsonTempDataSerializer.cs (2)
182Debug.Assert(genericTypeArguments.Length == 1, "IList<T> has one generic argument"); 188Debug.Assert(
Microsoft.AspNetCore.Mvc.Razor (7)
Compilation\DefaultViewCompiler.cs (1)
120Debug.Assert(relativePath != null);
RazorPageBase.cs (2)
304Debug.Assert(_valueBuffer is not null); 607Debug.Assert(_tagHelperAttributeInfo.ExecutionContext != null);
RazorView.cs (2)
97Debug.Assert(_bufferScope != null); 280Debug.Assert(originalLocations is not null && layoutPageResult.SearchedLocations is not null);
RazorViewEngine.cs (2)
482Debug.Assert(!string.IsNullOrEmpty(name)); 488Debug.Assert(!string.IsNullOrEmpty(name));
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (17)
CSharpCompiler.cs (4)
117Debug.Assert(_parseOptions is not null); 118Debug.Assert(_compilationOptions is not null); 119Debug.Assert(_emitOptions is not null); 229Debug.Fail($"LanguageVersion {languageVersion} specified in the deps file could not be parsed.");
PageActionDescriptorChangeProvider.cs (1)
32Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
RuntimeViewCompiler.cs (5)
138Debug.Assert(item.ExpirationTokens != null); 152Debug.Assert(item.Descriptor != null); 162Debug.Assert(taskSource != null); 168Debug.Assert(item.Descriptor != null); 383Debug.Assert(relativePath != null);
src\aspnetcore\src\Mvc\Mvc.RazorPages\src\ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
Microsoft.AspNetCore.Mvc.RazorPages (80)
ApplicationModels\PageRouteModelFactory.cs (7)
89Debug.Assert(relativePath.StartsWith('/')); 129Debug.Assert(path.StartsWith(rootDirectory, StringComparison.OrdinalIgnoreCase)); 130Debug.Assert(path.EndsWith(RazorViewEngine.ViewExtension, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!string.IsNullOrEmpty(areaName)); 141Debug.Assert(!string.IsNullOrEmpty(viewEnginePath)); 142Debug.Assert(viewEnginePath.StartsWith('/')); 175Debug.Assert(directory.StartsWith('/'));
DependencyInjection\RazorPagesRazorViewEngineOptionsSetup.cs (1)
26Debug.Assert(!string.IsNullOrEmpty(rootDirectory));
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
183Debug.Assert(currentSelector == null || ReferenceEquals(currentSelector, selector));
Infrastructure\DynamicPageEndpointSelectorCache.cs (1)
35Debug.Assert(dataSourceId is not null);
Infrastructure\PageActionInvoker.cs (29)
194Debug.Assert(_instance is not null); 215Debug.Assert(handlerBinder is not null); 216Debug.Assert(_arguments is not null); 255Debug.Assert(_instance is not null); 256Debug.Assert(_arguments is not null); 269Debug.Assert(executor != null, "We should always find a executor for a handler"); 323Debug.Assert(_instance is not null); 359Debug.Assert(state != null); 360Debug.Assert(_handlerSelectedContext != null); 383Debug.Assert(state != null); 384Debug.Assert(_handlerSelectedContext != null); 399Debug.Assert(state != null); 400Debug.Assert(_handlerSelectedContext != null); 441Debug.Assert(_instance is not null); 442Debug.Assert(_arguments is not null); 473Debug.Assert(state != null); 474Debug.Assert(_handlerExecutingContext != null); 497Debug.Assert(state != null); 498Debug.Assert(_handlerExecutingContext != null); 500Debug.Assert(_instance is not null); 531Debug.Assert(state != null); 532Debug.Assert(_handlerExecutingContext != null); 533Debug.Assert(_instance is not null); 582Debug.Assert(state != null); 583Debug.Assert(_handlerExecutingContext != null); 584Debug.Assert(_handlerExecutedContext != null); 672Debug.Assert(_handlerExecutedContext != null); 677Debug.Assert(_handlerExecutingContext != null); 692Debug.Assert(_handlerExecutedContext != null);
Infrastructure\PageActionInvokerCache.cs (1)
47Debug.Assert(compiledPageActionDescriptor != null, "PageLoader didn't run!");
MvcRazorPagesDiagnosticListenerExtensions.cs (40)
20Debug.Assert(diagnosticListener != null); 21Debug.Assert(actionContext != null); 22Debug.Assert(handlerMethodDescriptor != null); 23Debug.Assert(arguments != null); 24Debug.Assert(instance != null); 56Debug.Assert(diagnosticListener != null); 57Debug.Assert(actionContext != null); 58Debug.Assert(handlerMethodDescriptor != null); 59Debug.Assert(arguments != null); 60Debug.Assert(instance != null); 90Debug.Assert(diagnosticListener != null); 91Debug.Assert(handlerExecutionContext != null); 92Debug.Assert(filter != null); 120Debug.Assert(diagnosticListener != null); 121Debug.Assert(handlerExecutedContext != null); 122Debug.Assert(filter != null); 150Debug.Assert(diagnosticListener != null); 151Debug.Assert(handlerExecutingContext != null); 152Debug.Assert(filter != null); 180Debug.Assert(diagnosticListener != null); 181Debug.Assert(handlerExecutingContext != null); 182Debug.Assert(filter != null); 210Debug.Assert(diagnosticListener != null); 211Debug.Assert(handlerExecutedContext != null); 212Debug.Assert(filter != null); 240Debug.Assert(diagnosticListener != null); 241Debug.Assert(handlerExecutedContext != null); 242Debug.Assert(filter != null); 270Debug.Assert(diagnosticListener != null); 271Debug.Assert(handlerSelectedContext != null); 272Debug.Assert(filter != null); 300Debug.Assert(diagnosticListener != null); 301Debug.Assert(handlerSelectedContext != null); 302Debug.Assert(filter != null); 330Debug.Assert(diagnosticListener != null); 331Debug.Assert(handlerSelectedContext != null); 332Debug.Assert(filter != null); 360Debug.Assert(diagnosticListener != null); 361Debug.Assert(handlerSelectedContext != null); 362Debug.Assert(filter != null);
Microsoft.AspNetCore.Mvc.TagHelpers (9)
CacheTagHelper.cs (2)
164Debug.Fail($"{nameof(content)} should be an {nameof(CharBufferHtmlContent)}."); 269Debug.Assert(length == 0);
CurrentValues.cs (1)
12Debug.Assert(values != null);
JavaScriptResources.cs (1)
39Debug.Assert(
LinkTagHelper.cs (2)
325Debug.Assert(url != null); 451Debug.Assert(fallbackHrefs[i] != null);
ScriptTagHelper.cs (2)
352Debug.Assert(url != null); 380Debug.Assert(src != null);
TagHelperOutputExtensions.cs (1)
99Debug.Assert(found);
Microsoft.AspNetCore.Mvc.Testing (2)
Handlers\RedirectHandler.cs (1)
137Debug.Assert(response.RequestMessage is not null);
src\86f290b12362e070\HostFactoryResolver.cs (1)
304Debug.Assert(_hostTcs.Task.IsCompleted);
Microsoft.AspNetCore.Mvc.ViewFeatures (47)
AttributeDictionary.cs (8)
76Debug.Assert(index >= 0 && index < Count && _items != null); 82Debug.Assert(index >= 0 && index <= Count); 83Debug.Assert(value.Key != null); 95Debug.Assert(index >= 0 && index <= Count); 96Debug.Assert(value.Key != null); 108Debug.Assert(index >= 0 && index < Count); 110Debug.Assert(_items != null); 119Debug.Assert(key != null);
Buffers\PagedBufferedTextWriter.cs (2)
50Debug.Assert(length > 0); 66Debug.Assert(length == 0);
Buffers\PagedCharBuffer.cs (2)
61Debug.Assert(copyLength > 0); 82Debug.Assert(copyLength > 0);
CachedExpressionCompiler.cs (2)
45Debug.Assert(expression != null); 223Debug.Assert(combinedNullTest.Type == typeof(bool));
DefaultDisplayTemplates.cs (1)
89Debug.Assert(elementMetadata != null);
DefaultEditorTemplates.cs (1)
72Debug.Assert(elementMetadata != null);
DefaultHtmlGenerator.cs (4)
199Debug.Assert(!isChecked.HasValue); 454Debug.Assert(!isChecked.HasValue); 457Debug.Assert(value != null); 966Debug.Assert(isTargetEnum ^ enumNames == null);
ExpressionHelper.cs (7)
131Debug.Assert(segmentCount >= 0); 134Debug.Assert(!doNotCache); 148Debug.Assert(doNotCache); 157Debug.Assert(doNotCache); 168Debug.Assert(!name.Contains("__")); 182Debug.Assert(false); 187Debug.Assert(segmentCount == 0);
ExpressionMetadataProvider.cs (1)
118Debug.Assert(metadata != null);
Filters\SaveTempDataPropertyFilterBase.cs (1)
70Debug.Assert(Subject != null, "Subject must be set before this method is invoked.");
ModelExplorer.cs (2)
127Debug.Assert(Container != null); 202Debug.Assert(propertyHelper != null);
ModelExplorerExtensions.cs (1)
53Debug.Assert(enumGroupedDisplayNamesAndValues != null);
src\aspnetcore\src\Shared\PooledArrayBufferWriter.cs (6)
93Debug.Assert(_rentedBuffer != null); 172Debug.Assert(_rentedBuffer != null); 196Debug.Assert(oldBuffer.Length >= _index); 197Debug.Assert(_rentedBuffer.Length >= _index); 205Debug.Assert(_rentedBuffer.Length - _index > 0); 206Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
TempDataDictionary.cs (1)
152Debug.Assert(_initialKeys is not null && _retainedKeys is not null && _data is not null);
TemplateBuilder.cs (1)
107Debug.Assert(enumGrouped != null);
ValidationHelpers.cs (4)
13Debug.Assert(modelError != null); 29Debug.Assert(modelError != null); 30Debug.Assert(containingEntry != null); 31Debug.Assert(modelExplorer != null);
ViewDataDictionaryFactory.cs (2)
18Debug.Assert(constructor != null); 39Debug.Assert(constructor != null);
ViewDataEvaluator.cs (1)
100Debug.Assert(expression != null);
Microsoft.AspNetCore.OpenApi (23)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (6)
69Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 70Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 79Debug.Assert(options != null, "RequestDelegateFactoryOptions not found."); 80Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found."); 81Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found."); 82Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
Extensions\ApiDescriptionExtensions.cs (1)
70Debug.Assert(apiDescription.RelativePath != null, "Relative path cannot be null.");
Schemas\OpenApiJsonSchema.Helpers.cs (1)
215Debug.Assert(type is not null);
Services\OpenApiDocumentService.cs (1)
261Debug.Assert(descriptions.Key != null, "Relative path mapped to OpenApiPath key cannot be null.");
Services\Schemas\OpenApiSchemaService.cs (1)
259Debug.Assert(deserializedSchema != null, "The schema should have been deserialized successfully and materialize a non-null value.");
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\aspnetcore\src\Shared\ParameterBindingMethodCache.cs (2)
525Debug.Fail("No suitable System.Enum.TryParse method found."); 725Debug.Assert(obj is ParameterLookupKey);
src\aspnetcore\src\Shared\PropertyAsParameterInfo.cs (1)
24Debug.Assert(propertyInfo != null, "PropertyInfo must be provided.");
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
132Debug.Assert(charsUsed == 1);
Transformers\OpenApiDocumentTransformerContext.cs (1)
92Debug.Assert(Document is not null, "Document should have been initialized by framework.");
Transformers\TypeBasedOpenApiDocumentTransformer.cs (1)
25Debug.Assert(transformer != null, $"The type {_transformerType} does not implement {nameof(IOpenApiDocumentTransformer)}.");
Transformers\TypeBasedOpenApiOperationTransformer.cs (1)
25Debug.Assert(transformer != null, $"The type {_transformerType} does not implement {nameof(IOpenApiOperationTransformer)}.");
Transformers\TypeBasedOpenApiSchemaTransformer.cs (1)
25Debug.Assert(transformer != null, $"The type {_transformerType} does not implement {nameof(IOpenApiSchemaTransformer)}.");
Microsoft.AspNetCore.OpenApi.SourceGenerators (4)
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
Microsoft.AspNetCore.OutputCaching (20)
FormatterBinaryWriter.cs (6)
46Debug.Assert(target is not null); 50Debug.Assert(length == 0 && offset == 0); 55Debug.Assert(offset >= 0 && offset <= length); 56Debug.Assert(length > 0); 94Debug.Assert(actual == bytes); 102Debug.Assert(actual == bytes);
Memory\MemoryOutputCacheStore.cs (7)
100Debug.Assert(keys != null); 118Debug.Assert(key != null); 137Debug.Assert(state != null); 141Debug.Assert(tags != null); 142Debug.Assert(tags.Length > 0); 143Debug.Assert(key is string); 144Debug.Assert(entryId != Guid.Empty);
OutputCacheEntryFormatter.cs (1)
373Debug.Assert(reader.IsEOF, "should have read entire payload");
RecyclableArrayBufferWriter.cs (4)
66Debug.Assert(_buffer.Length > _index); 73Debug.Assert(_buffer.Length > _index); 107Debug.Assert(needed > currentLength); 127Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
RecyclableSequenceBuilder.cs (2)
73Debug.Assert(_currentSegment is not null); 75Debug.Assert(_currentSegmentIndex >= 0 && _currentSegmentIndex <= current.Length);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (7)
RedisOutputCacheStore.cs (7)
99Debug.Assert(secondsWithJitter >= 270 && secondsWithJitter <= 330); 168Debug.Assert(cache is not null); 193Debug.Assert(cache is not null); 212Debug.Assert(cache is not null); 246Debug.Assert(cache is not null); 345Debug.Assert(_cache is not null); 497Debug.WriteLine(ex);
Microsoft.AspNetCore.Razor (1)
TagHelpers\DefaultTagHelperContent.cs (1)
34Debug.Assert(_buffer.Count == 0);
Microsoft.AspNetCore.Razor.Runtime (1)
Runtime\TagHelpers\TagHelperExecutionContext.cs (1)
221Debug.Assert(!Output.IsContentModified);
Microsoft.AspNetCore.Razor.Utilities.Shared (117)
PooledArrayBufferWriter`1.cs (6)
87Debug.Assert(_rentedBuffer != null); 161Debug.Assert(_rentedBuffer != null); 182Debug.Assert(oldBuffer.Length >= _index); 183Debug.Assert(_rentedBuffer.Length >= _index); 191Debug.Assert(_rentedBuffer.Length - _index > 0); 192Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumerableExtensions.cs (2)
60Debug.Assert(result.Length == count); 131Debug.Assert(result.Length == count);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\EnumExtensions.cs (4)
38Debug.Fail("Unexpected enum underlying type."); 67Debug.Fail("Unexpected enum underlying type."); 111Debug.Fail("Unexpected enum underlying type."); 141Debug.Fail("Unexpected enum underlying type.");
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\ImmutableArrayExtensions.cs (13)
310Debug.Assert(i > 0); 322Debug.Assert(i > 0); 335Debug.Assert(!(none && all)); 394Debug.Assert(i > 0); 406Debug.Assert(i > 0); 419Debug.Assert(!(none && all)); 476Debug.Assert(i > 0); 488Debug.Assert(i > 0); 501Debug.Assert(!(none && all)); 562Debug.Assert(i > 0); 574Debug.Assert(i > 0); 587Debug.Assert(!(none && all)); 964Debug.Assert(uniqueItems.Count == 0, $"{nameof(uniqueItems)} should be empty!");
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\MemoryBuilder`1.cs (6)
58Debug.Assert(value >= 0); 59Debug.Assert(value <= _memory.Length); 69Debug.Assert(index >= 0 && index < _length); 115Debug.Assert(_length == _memory.Length); 136Debug.Assert(additionalCapacityRequired > 0); 159Debug.Assert(nextCapacity > _memory.Length);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledArrayBuilder`1.cs (12)
147Debug.Assert(_inlineCount <= InlineCapacity); 206Debug.Assert(_inlineCount <= InlineCapacity); 221Debug.Assert(_inlineCount <= InlineCapacity); 359Debug.Assert(index >= 0 && index <= Count); 385Debug.Assert(index >= 0 && index <= Count); 419Debug.Assert(index >= 0 && index <= Count); 660Debug.Assert(_inlineCount <= InlineCapacity); 1600Debug.Assert(_builder is null); 1629Debug.Assert(_builder is null); 1630Debug.Assert(index >= 0 && index < _inlineCount); 1631Debug.Assert(offset > 0); 1632Debug.Assert(offset + _inlineCount <= InlineCapacity);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\PooledObjects\PooledHashSet`1.cs (1)
235Debug.Assert(_set is null);
src\roslyn\src\Razor\src\Shared\Microsoft.AspNetCore.Razor.SharedUtilities\Utilities\SortHelper`1.cs (2)
106Debug.Assert(typeof(TElement) == typeof(T)); 180Debug.Assert(typeof(TElement) == typeof(T));
Utilities\Checksum.Builder.cs (2)
47Debug.Assert(length <= 8, $"length should never be greater than 8."); 65Debug.Assert(s_buffer is not null);
Utilities\Hashing\NonCryptographicHashAlgorithm.cs (1)
328Debug.Assert(destination.Length == HashLengthInBytes);
Utilities\Hashing\XxHash128.cs (6)
257Debug.Assert(length >= 1 && length <= 3); 282Debug.Assert(length >= 4 && length <= 8); 308Debug.Assert(length >= 9 && length <= 16); 334Debug.Assert(length >= 17 && length <= 128); 360Debug.Assert(length >= 129 && length <= 240); 393Debug.Assert(length > 240);
Utilities\Hashing\XxHashShared.cs (45)
121Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 124Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 127Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 129Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 130Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 131Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 132Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 133Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 134Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 135Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 136Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 137Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 138Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 139Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 140Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 141Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 142Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 145Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 212Debug.Assert(length > 240); 228Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 229Debug.Assert(stripesSoFar < stripesPerBlock); 250Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 280Debug.Assert(sourceIndex < source.Length); 286Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 290Debug.Assert(stripesToEnd <= stripes); 309Debug.Assert(sourceIndex < source.Length); // at least some bytes left 331Debug.Assert(sourceIndex < source.Length); 332Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 333Debug.Assert(state.BufferedCount == 0); 370Debug.Assert(state.BufferedCount > 0); 786Debug.Assert(shift >= 0 && shift < 64);
Microsoft.AspNetCore.ResponseCompression (2)
ResponseCompressionMiddleware.cs (1)
59Debug.Assert(originalBodyFeature != null);
ResponseCompressionProvider.cs (1)
84Debug.Assert(false, "Duplicate check failed.");
Microsoft.AspNetCore.Rewrite (9)
ApacheModRewrite\ConditionEvaluator.cs (1)
52Debug.Assert(condResult != null, "ConditionEvaluator must be passed at least one condition to evaluate.");
ApacheModRewrite\CookieActionFactory.cs (1)
59Debug.Assert(action != null || tokenType == Fields.Name);
ApacheModRewrite\RuleBuilder.cs (4)
65Debug.Assert(input.Operand != null); 76Debug.Assert(input.Operand != null); 102Debug.Assert(input.Operand != null); 162Debug.Assert(input.Operand != null);
PatternSegments\RuleMatchSegment.cs (1)
19Debug.Assert(ruleBackReferences != null);
UrlMatches\IntegerMatch.cs (1)
59Debug.Fail("This is never reached.");
UrlMatches\StringMatch.cs (1)
41Debug.Fail("This is never reached.");
Microsoft.AspNetCore.Routing (91)
ArrayBuilder.cs (7)
32Debug.Assert(capacity >= 0); 61Debug.Assert(index >= 0 && index < _count); 85Debug.Assert(_count > 0); 94Debug.Assert(_count > 0); 111Debug.Assert(_array != null); // Nonzero _count should imply this 141Debug.Assert(_count < Capacity); 148Debug.Assert(minimum > Capacity);
Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
Matching\CandidateSet.cs (2)
289Debug.Assert(cmp <= 0); 335Debug.Assert(count > 0);
Matching\DfaMatcher.cs (2)
198Debug.Assert(candidateStateArray is not null); 205Debug.Assert(candidateStateArray is not null);
Matching\DfaMatcherBuilder.cs (1)
396Debug.Assert(i == segment.Parts.Count - 1 && partParameter.IsOptional);
Matching\EndpointComparer.cs (5)
43Debug.Assert(x != null); 44Debug.Assert(y != null); 79Debug.Assert(x != null); 80Debug.Assert(y != null); 88Debug.Fail("We don't expect this to be called.");
Matching\ILEmitTrieFactory.cs (4)
524Debug.Assert(entries.Length == 1, "We should have a single entry"); 534Debug.Assert(index + 4 <= text.Length); 544Debug.Assert(index + 4 <= text.Length); 552Debug.Assert(index + 1 <= text.Length);
Matching\SingleEntryAsciiJumpTable.cs (1)
47Debug.Assert(a.Length == b.Length && b.Length == length);
ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
ParameterPolicyFactory.cs (1)
40Debug.Assert(reference.ParameterPolicy != null || reference.Content != null);
PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 89Debug.Assert(_path[_path.Length - 1] != '/'); 90Debug.Assert(currentSegmentIndex == index);
Patterns\RoutePattern.cs (5)
45Debug.Assert(defaults != null); 46Debug.Assert(parameterPolicies != null); 47Debug.Assert(parameters != null); 48Debug.Assert(requiredValues != null); 49Debug.Assert(pathSegments != null);
Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
Patterns\RoutePatternMatcher.cs (9)
111Debug.Assert(pathSegment != null); 168Debug.Assert(pathSegment != null); 169Debug.Assert(pathSegment.IsSimple); 172Debug.Assert(part.IsParameter); 240Debug.Assert(!pathSegment.IsSimple); 338Debug.Assert(routeSegment != null); 339Debug.Assert(routeSegment.Parts.Count > 1); 361Debug.Assert(part.IsLiteral || part.IsSeparator); 434Debug.Assert(false, "indexOfLastSegementUsed should always be 0 from the check above");
Patterns\RoutePatternParser.cs (8)
51Debug.Assert(context.AtEnd() || context.Current == Separator); 73Debug.Assert(context != null); 74Debug.Assert(segments != null); 145Debug.Assert(context.Current == OpenBrace); 445Debug.Assert(context != null); 446Debug.Assert(literal != null); 485Debug.Assert(template != null); 526Debug.Assert(_index >= 0);
Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
RequestDelegateFilterPipelineBuilder.cs (1)
19Debug.Assert(options.EndpointBuilder != null);
RouteBase.cs (2)
313Debug.Assert(_constraintLogger != null); 324Debug.Assert(_constraintLogger != null);
RouteCollection.cs (1)
150Debug.Assert(_options != null);
RouteEndpointDataSource.cs (2)
219Debug.Assert(entry.InferMetadataFunc != null, "A func to infer metadata must be provided for route handlers."); 264Debug.Assert(factoryCreatedRequestDelegate is not null);
RouteOptions.cs (1)
34Debug.Assert(_endpointDataSources != null, "Endpoint data sources should have been set in DI.");
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Template\RoutePrecedence.cs (7)
48Debug.Assert(digit >= 0 && digit < 10); 69Debug.Assert(digit >= 0 && digit < 10); 102Debug.Assert(digit >= 0 && digit < 10); 125Debug.Assert(digit >= 0 && digit < 10); 163Debug.Assert(part.IsParameter); 191Debug.Assert(parameterPart != null); 231Debug.Assert(part.IsParameter);
Template\TemplateBinder.cs (2)
518Debug.Assert(context.BufferState == SegmentState.Beginning); 519Debug.Assert(context.UriState == SegmentState.Beginning);
Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
Tree\UrlMatchingTree.cs (2)
98Debug.Assert(segment.Parts.Count == 1); 231Debug.Fail("We shouldn't get here.");
UriBuildingContext.cs (2)
137Debug.Assert(_lastValueOffset != -1, "Cannot invoke Remove more than once."); 171Debug.Assert(result);
Microsoft.AspNetCore.Routing.Abstractions (19)
RouteData.cs (1)
146Debug.Assert(_routers != null);
src\aspnetcore\src\Shared\PropertyHelper\PropertyHelper.cs (18)
161Debug.Assert(propertyInfo != null); 181Debug.Assert(propertyInfo != null); 195Debug.Assert(propertyInfo != null); 198Debug.Assert(propertyGetterWrapperMethod != null); 199Debug.Assert(propertyGetterWrapperMethod.IsGenericMethodDefinition); 200Debug.Assert(propertyGetterWrapperMethod.GetParameters().Length == 2); 203Debug.Assert(propertyGetterByRefWrapperMethod != null); 204Debug.Assert(propertyGetterByRefWrapperMethod.IsGenericMethodDefinition); 205Debug.Assert(propertyGetterByRefWrapperMethod.GetParameters().Length == 2); 208Debug.Assert(getMethod != null); 209Debug.Assert(!getMethod.IsStatic); 210Debug.Assert(getMethod.GetParameters().Length == 0); 274Debug.Assert(propertyInfo != null); 275Debug.Assert(!propertyInfo.DeclaringType!.IsValueType); 278Debug.Assert(setMethod != null); 279Debug.Assert(!setMethod.IsStatic); 280Debug.Assert(setMethod.ReturnType == typeof(void)); 282Debug.Assert(parameters.Length == 1);
Microsoft.AspNetCore.Server.HttpSys (53)
_generated\84\Windows.Win32.SCOPE_ID.g.cs (2)
86 global::System.Diagnostics.Debug.Assert(value is <= (uint)268435455L); 99 global::System.Diagnostics.Debug.Assert(value is <= (byte)15L);
AsyncAcceptContext.cs (5)
72Debug.Assert(_requestContext != null); 138Debug.Assert(false, nameof(SetExpectCompletion)); // fail hard in debug 150Debug.Assert(false, nameof(CancelExpectCompletion)); // fail hard in debug 162Debug.Assert(false, nameof(ObserveCompletion)); // fail hard in debug 172Debug.Assert(_requestContext != null);
AuthenticationManager.cs (1)
87Debug.Assert(_urlGroup == null, "SetUrlGroupSecurity called more than once.");
HttpSysListener.cs (3)
253Debug.Assert(_serverSession != null, "ServerSessionHandle is null in CloseV2Config"); 254Debug.Assert(!_serverSession.Id.IsInvalid, "ServerSessionHandle is invalid in CloseV2Config"); 278Debug.Assert(_state != State.Stopped, "Listener has been stopped.");
MessagePump.cs (4)
112Debug.Assert(RequestContextFactory == null, "Start called twice!"); 114Debug.Assert(application != null); 180Debug.Assert(RequestContextFactory != null); 321Debug.Assert(_messagePump.Stopping);
NativeInterop\RequestQueue.cs (2)
145Debug.Assert(Created); 161Debug.Assert(Created);
NativeInterop\SafeNativeOverlapped.cs (1)
36Debug.Assert(_boundHandle != null, "ReleaseHandle can't be called on SafeNativeOverlapped.Zero.");
NativeInterop\ServerSession.cs (1)
22Debug.Assert(serverSessionId != 0, "Invalid id returned by HttpCreateServerSession");
NativeInterop\UrlGroup.cs (3)
44Debug.Assert(urlGroupId != 0, "Invalid id returned by HttpCreateUrlGroup"); 118Debug.Assert(info != IntPtr.Zero, "SetUrlGroupProperty called with invalid pointer"); 222Debug.Assert(Id != 0, "HttpCloseUrlGroup called with invalid url group id");
RequestProcessing\RequestContext.FeatureCollection.cs (1)
85Debug.Assert(_features != null);
RequestProcessing\Response.cs (4)
301Debug.Assert(!HasStarted, "HttpListenerResponse::SendHeaders()|SentHeaders is true."); 402Debug.Assert(!HasComputedHeaders, nameof(HasComputedHeaders) + " is true."); 625Debug.Assert(HasTrailers); 671Debug.Assert(unknownHeadersOffset == trailerCount);
RequestProcessing\ResponseBody.cs (4)
114Debug.Assert(!(endOfRequest && data.Count > 0), "Data is not supported at the end of the request."); 188Debug.Assert(!(addTrailers && chunked), "Trailers aren't currently supported for HTTP/1.1 chunking."); 216Debug.Assert(hasData); 265Debug.Assert(currentChunk == dataChunks.Length, "All chunks should be accounted for");
RequestProcessing\ResponseStreamAsyncResult.cs (2)
94Debug.Assert(currentChunk == _dataChunks.Length); 135Debug.Assert(currentChunk == _dataChunks.Length);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
122Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 131Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 171Debug.Assert(_backingBuffer != null); 185Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 224Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 235Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
UrlPrefixCollection.cs (2)
214Debug.Assert(_urlGroup != null); 224Debug.Assert(port >= 5000 || port < 8000);
Microsoft.AspNetCore.Server.IIS (46)
_generated\45\Windows.Win32.SCOPE_ID.g.cs (2)
86 global::System.Diagnostics.Debug.Assert(value is <= (uint)268435455L); 99 global::System.Diagnostics.Debug.Assert(value is <= (byte)15L);
Core\HttpRequestStream.cs (2)
62Debug.Assert(_body != null, "Stream must be accepting reads."); 75Debug.Assert(_body != null, "Stream must be accepting reads.");
Core\IISHttpContext.cs (2)
504Debug.Assert(_hasResponseStarted == false); 544Debug.Assert(!HasStartedConsumingRequestBody);
Core\IISHttpContext.FeatureCollection.cs (1)
368Debug.Assert(_readBodyTask == null || _readBodyTask.IsCompleted);
Core\IISHttpServer.cs (1)
167Debug.Assert(server._iisContextFactory != null, "StartAsync must be called first.");
Core\IISServerAuthenticationHandlerInternal.cs (4)
24Debug.Assert(_iisHttpContext != null, "Handler must be initialized."); 25Debug.Assert(Scheme != null, "Handler must be initialized."); 41Debug.Assert(_context != null, "Handler must be initialized."); 51Debug.Assert(_context != null, "Handler must be initialized.");
Core\IO\AsyncIOEngine.cs (1)
175Debug.Assert(_runningOperation != null);
Core\IO\AsyncIOEngine.Flush.cs (1)
30Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOEngine.Read.cs (1)
34Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\AsyncIOOperation.cs (1)
13private static readonly Action<object?> CallbackCompleted = _ => { Debug.Assert(false, "Should not be invoked"); };
Core\IO\AsyncWriteOperationBase.cs (1)
26Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.cs (2)
37Debug.Assert(!read.InUse()); 53Debug.Assert(!write.InUse());
Core\IO\WebSocketsAsyncIOEngine.Initialize.cs (1)
28Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\IO\WebSocketsAsyncIOEngine.Read.cs (1)
42Debug.Assert(_requestHandler != null, "Must initialize first.");
Core\OutputProducer.cs (1)
119Debug.Assert(false);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (6)
122Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 131Debug.Assert(_nativeRequest != null || _backingBuffer == null, "native request accessed after ReleasePins()."); 171Debug.Assert(_backingBuffer != null); 185Debug.Assert(_nativeRequest != null, "RequestContextBase::ReleasePins()|ReleasePins() called twice."); 224Debug.Assert(_nativeRequest == null, "RequestContextBase::Dispose()|Dispose() called before ReleasePins()."); 235Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\aspnetcore\src\Shared\HttpSys\RequestProcessing\RequestUriBuilder.cs (1)
23Debug.Assert(rawUrlBytes.Length != 0, "Length of the URL cannot be zero.");
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\aspnetcore\src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\aspnetcore\src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Server.IISIntegration (3)
AuthenticationHandler.cs (3)
19Debug.Assert(_scheme != null, "Handler must be initialized."); 33Debug.Assert(_context != null, "Handler must be initialized."); 42Debug.Assert(_context != null, "Handler must be initialized.");
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Common\TestUriHelper.cs (1)
38Debug.Assert(scheme == "http", "Https not supported");
Microsoft.AspNetCore.Server.Kestrel.Core (375)
AnyIPListenOptions.cs (1)
21Debug.Assert(IPEndPoint != null);
HttpsConfigurationService.cs (4)
135Debug.Assert(_useHttpsWithDefaults is not null); 136Debug.Assert(_tlsConfigurationLoader is not null); 137Debug.Assert(_populateMultiplexedTransportFeatures is not null); 138Debug.Assert(_httpsLogger is not null);
Internal\CertificatePathWatcher.cs (2)
113Debug.Assert(certificateConfig.IsFileCert, "AddWatch called on non-file cert"); 216Debug.Assert(certificateConfig.IsFileCert, "RemoveWatch called on non-file cert");
Internal\Http\Http1ChunkedEncodingMessageBody.cs (2)
94Debug.Assert(!RequestUpgrade, "Upgraded connections should never use this code path!"); 175Debug.Assert(_pumpTask != null, "OnReadStartedAsync must have been called.");
Internal\Http\Http1Connection.cs (9)
187Debug.Assert(MinRequestBodyDataRate != null); 421Debug.Assert(startLine.IndexOf((byte)0) == -1); 426Debug.Assert(target.Length != 0, "Request target must be non-zero length"); 460Debug.Assert(RawTarget != null, "RawTarget was not set"); 461Debug.Assert(((IHttpRequestFeature)this).Method != null, "Method was not set"); 462Debug.Assert(Path != null, "Path was not set"); 463Debug.Assert(QueryString != null, "QueryString was not set"); 464Debug.Assert(HttpVersion != null, "HttpVersion was not set"); 470Debug.Assert(target[0] == ByteForwardSlash, "Should only be called when path starts with /");
Internal\Http\Http1OutputProducer.cs (8)
175Debug.Assert(!producer._pipeWriterCompleted); 176Debug.Assert(producer._responseBodyMode == ResponseBodyMode.Chunked && producer._advancedBytesForChunk > 0); 363Debug.Assert(responseBodyMode != ResponseBodyMode.Uninitialized); 541Debug.Assert(_currentSegmentOwner == null); 542Debug.Assert(_completedSegments == null || _completedSegments.Count == 0); 648Debug.Assert(_advancedBytesForChunk <= _currentChunkMemory.Length); 649Debug.Assert(_advancedBytesForChunk > 0); 653Debug.Assert(bytesWritten <= _currentMemoryPrefixBytes);
Internal\Http\HttpHeaders.Generated.cs (131)
8403Debug.Assert((_currentBits & 0x1L) != 0); 8408Debug.Assert((_currentBits & 0x2L) != 0); 8413Debug.Assert((_currentBits & 0x4L) != 0); 8418Debug.Assert((_currentBits & 0x8L) != 0); 8423Debug.Assert((_currentBits & 0x10L) != 0); 8428Debug.Assert((_currentBits & 0x20L) != 0); 8433Debug.Assert((_currentBits & 0x40L) != 0); 8438Debug.Assert((_currentBits & 0x80L) != 0); 8443Debug.Assert((_currentBits & 0x100L) != 0); 8448Debug.Assert((_currentBits & 0x200L) != 0); 8453Debug.Assert((_currentBits & 0x400L) != 0); 8458Debug.Assert((_currentBits & 0x800L) != 0); 8463Debug.Assert((_currentBits & 0x1000L) != 0); 8468Debug.Assert((_currentBits & 0x2000L) != 0); 8473Debug.Assert((_currentBits & 0x4000L) != 0); 8478Debug.Assert((_currentBits & 0x8000L) != 0); 8483Debug.Assert((_currentBits & 0x10000L) != 0); 8488Debug.Assert((_currentBits & 0x20000L) != 0); 8493Debug.Assert((_currentBits & 0x40000L) != 0); 8498Debug.Assert((_currentBits & 0x80000L) != 0); 8503Debug.Assert((_currentBits & 0x100000L) != 0); 8508Debug.Assert((_currentBits & 0x200000L) != 0); 8513Debug.Assert((_currentBits & 0x400000L) != 0); 8518Debug.Assert((_currentBits & 0x800000L) != 0); 8523Debug.Assert((_currentBits & 0x1000000L) != 0); 8528Debug.Assert((_currentBits & 0x2000000L) != 0); 8533Debug.Assert((_currentBits & 0x4000000L) != 0); 8538Debug.Assert((_currentBits & 0x8000000L) != 0); 8543Debug.Assert((_currentBits & 0x10000000L) != 0); 8548Debug.Assert((_currentBits & 0x20000000L) != 0); 8553Debug.Assert((_currentBits & 0x40000000L) != 0); 8558Debug.Assert((_currentBits & 0x80000000L) != 0); 8563Debug.Assert((_currentBits & 0x100000000L) != 0); 8568Debug.Assert((_currentBits & 0x200000000L) != 0); 8573Debug.Assert((_currentBits & 0x400000000L) != 0); 8578Debug.Assert((_currentBits & 0x800000000L) != 0); 8583Debug.Assert((_currentBits & 0x1000000000L) != 0); 8588Debug.Assert((_currentBits & 0x2000000000L) != 0); 8593Debug.Assert((_currentBits & 0x4000000000L) != 0); 8598Debug.Assert((_currentBits & 0x8000000000L) != 0); 8603Debug.Assert((_currentBits & 0x10000000000L) != 0); 8608Debug.Assert((_currentBits & 0x20000000000L) != 0); 8613Debug.Assert((_currentBits & 0x40000000000L) != 0); 8618Debug.Assert((_currentBits & 0x80000000000L) != 0); 8623Debug.Assert((_currentBits & 0x100000000000L) != 0); 8628Debug.Assert((_currentBits & 0x200000000000L) != 0); 8633Debug.Assert((_currentBits & 0x400000000000L) != 0); 8638Debug.Assert((_currentBits & 0x800000000000L) != 0); 8643Debug.Assert((_currentBits & 0x1000000000000L) != 0); 8648Debug.Assert(_currentBits == 0); 14835Debug.Assert((tempBits & 0x1L) != 0); 14854Debug.Assert((tempBits & 0x2L) != 0); 14861Debug.Assert((tempBits & 0x4L) != 0); 14880Debug.Assert((tempBits & 0x8L) != 0); 14899Debug.Assert((tempBits & 0x10L) != 0); 14906Debug.Assert((tempBits & 0x20L) != 0); 14913Debug.Assert((tempBits & 0x40L) != 0); 14920Debug.Assert((tempBits & 0x80L) != 0); 14927Debug.Assert((tempBits & 0x100L) != 0); 14934Debug.Assert((tempBits & 0x200L) != 0); 14941Debug.Assert((tempBits & 0x400L) != 0); 14948Debug.Assert((tempBits & 0x800L) != 0); 14955Debug.Assert((tempBits & 0x1000L) != 0); 14962Debug.Assert((tempBits & 0x2000L) != 0); 14981Debug.Assert((tempBits & 0x4000L) != 0); 14988Debug.Assert((tempBits & 0x8000L) != 0); 14995Debug.Assert((tempBits & 0x10000L) != 0); 15002Debug.Assert((tempBits & 0x20000L) != 0); 15009Debug.Assert((tempBits & 0x40000L) != 0); 15016Debug.Assert((tempBits & 0x80000L) != 0); 15023Debug.Assert((tempBits & 0x100000L) != 0); 15030Debug.Assert((tempBits & 0x200000L) != 0); 15037Debug.Assert((tempBits & 0x400000L) != 0); 15044Debug.Assert((tempBits & 0x800000L) != 0); 15051Debug.Assert((tempBits & 0x1000000L) != 0); 15058Debug.Assert((tempBits & 0x2000000L) != 0); 15065Debug.Assert((tempBits & 0x4000000L) != 0); 15072Debug.Assert((tempBits & 0x8000000L) != 0); 15079Debug.Assert((tempBits & 0x10000000L) != 0); 15086Debug.Assert((tempBits & 0x20000000L) != 0); 15093Debug.Assert((tempBits & 0x40000000L) != 0); 15100Debug.Assert((tempBits & 0x80000000L) != 0); 15107Debug.Assert((tempBits & 0x100000000L) != 0); 15126Debug.Assert((tempBits & 0x200000000L) != 0); 15133Debug.Assert((tempBits & 0x400000000L) != 0); 15140Debug.Assert((tempBits & 0x800000000L) != 0); 15147Debug.Assert((tempBits & 0x1000000000L) != 0); 15154Debug.Assert((tempBits & 0x2000000000L) != 0); 15172Debug.Assert(valueCount > 0); 15253Debug.Assert((_currentBits & 0x1L) != 0); 15259Debug.Assert((_currentBits & 0x2L) != 0); 15265Debug.Assert((_currentBits & 0x4L) != 0); 15271Debug.Assert((_currentBits & 0x8L) != 0); 15277Debug.Assert((_currentBits & 0x10L) != 0); 15283Debug.Assert((_currentBits & 0x20L) != 0); 15289Debug.Assert((_currentBits & 0x40L) != 0); 15295Debug.Assert((_currentBits & 0x80L) != 0); 15301Debug.Assert((_currentBits & 0x100L) != 0); 15307Debug.Assert((_currentBits & 0x200L) != 0); 15313Debug.Assert((_currentBits & 0x400L) != 0); 15319Debug.Assert((_currentBits & 0x800L) != 0); 15325Debug.Assert((_currentBits & 0x1000L) != 0); 15331Debug.Assert((_currentBits & 0x2000L) != 0); 15337Debug.Assert((_currentBits & 0x4000L) != 0); 15343Debug.Assert((_currentBits & 0x8000L) != 0); 15349Debug.Assert((_currentBits & 0x10000L) != 0); 15355Debug.Assert((_currentBits & 0x20000L) != 0); 15361Debug.Assert((_currentBits & 0x40000L) != 0); 15367Debug.Assert((_currentBits & 0x80000L) != 0); 15373Debug.Assert((_currentBits & 0x100000L) != 0); 15379Debug.Assert((_currentBits & 0x200000L) != 0); 15385Debug.Assert((_currentBits & 0x400000L) != 0); 15391Debug.Assert((_currentBits & 0x800000L) != 0); 15397Debug.Assert((_currentBits & 0x1000000L) != 0); 15403Debug.Assert((_currentBits & 0x2000000L) != 0); 15409Debug.Assert((_currentBits & 0x4000000L) != 0); 15415Debug.Assert((_currentBits & 0x8000000L) != 0); 15421Debug.Assert((_currentBits & 0x10000000L) != 0); 15427Debug.Assert((_currentBits & 0x20000000L) != 0); 15433Debug.Assert((_currentBits & 0x40000000L) != 0); 15439Debug.Assert((_currentBits & 0x80000000L) != 0); 15445Debug.Assert((_currentBits & 0x100000000L) != 0); 15451Debug.Assert((_currentBits & 0x200000000L) != 0); 15457Debug.Assert((_currentBits & 0x400000000L) != 0); 15463Debug.Assert((_currentBits & 0x800000000L) != 0); 15469Debug.Assert((_currentBits & 0x1000000000L) != 0); 15475Debug.Assert((_currentBits & 0x2000000000L) != 0); 15481Debug.Assert(_currentBits == 0); 17589Debug.Assert((_currentBits & 0x1L) != 0); 17595Debug.Assert((_currentBits & 0x2L) != 0); 17601Debug.Assert((_currentBits & 0x4L) != 0);
Internal\Http\HttpParser.cs (3)
140Debug.Assert(result); 382Debug.Assert(result.HasError); 421Debug.Assert(foundDelimiter);
Internal\Http\HttpProtocol.cs (8)
438Debug.Assert(resetSuccess); 748Debug.Assert(_bodyControl != null); 1040Debug.Assert(_requestRejectedException != null); 1382Debug.Assert(!HasResponseStarted, $"{nameof(SetErrorResponseHeaders)} called after response had already started."); 1649Debug.Assert(false, "Should not reach here, all cases in above switch statement should return"); 1655Debug.Assert(!HasResponseStarted); 1699Debug.Assert(false, "Should not reach here, all cases in above switch statement should return"); 1746Debug.Assert(false, "Should not reach here, all cases in above switch statement should return");
Internal\Http\ReasonPhrases.cs (1)
84Debug.Assert(!string.IsNullOrEmpty(reasonPhrase));
Internal\Http2\FlowControl\FlowControl.cs (3)
19Debug.Assert(initialWindowSize <= Http2PeerSettings.MaxWindowSize, $"{nameof(initialWindowSize)} too large."); 30Debug.Assert(!IsAborted, $"({nameof(Advance)} called after abort."); 31Debug.Assert(bytes == 0 || (bytes > 0 && bytes <= Available), $"{nameof(Advance)}({bytes}) called with {Available} bytes available.");
Internal\Http2\FlowControl\InputFlowControl.cs (2)
32Debug.Assert(initialWindowSize >= minWindowSizeIncrement, "minWindowSizeIncrement is greater than the window size."); 86Debug.Assert(false, $"{nameof(TryUpdateWindow)} attempted to grow window past max size.");
Internal\Http2\FlowControl\StreamInputFlowControl.cs (2)
52Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted."); 101Debug.Assert(connectionSuccess, "Connection-level input flow control should never be aborted.");
Internal\Http2\Http2Connection.cs (17)
241Debug.Assert(_isClosed == 1, "Should only be set when connection is closed."); 273Debug.Assert(Limits.MinRequestBodyDataRate != null); 429Debug.Assert(_currentHeadersStream != null); 667Debug.Assert(buffer.Length >= ClientPreface.Length, "Not enough content to match preface."); 781Debug.Assert(_currentHeadersStream != null, "Only throw this error if parsing headers."); 847Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.KeepAlive, "Non keep-alive timeout set at start of trailer headers."); 873Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.KeepAlive, "Non keep-alive timeout set at start of stream."); 1223Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders, "Received continuation frame without request header timeout being set."); 1246Debug.Assert(_currentHeadersStream != null); 1273Debug.Assert(_currentHeadersStream != null); 1297Debug.Assert(_currentHeadersStream != null); 1564Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders || 1582Debug.Assert(index <= H2StaticTable.Count); 1590Debug.Assert(index <= H2StaticTable.Count); 1608Debug.Assert(_currentHeadersStream != null); 1676Debug.Fail($"Unexpected header type: {headerType}"); 1790Debug.Assert(staticTableIndex > 0, "Static table starts at 1.");
Internal\Http2\Http2FrameWriter.cs (9)
254Debug.Assert(actual <= int.MaxValue); 280Debug.Assert(flushHeaders, "The app completed successfully without flushing headers!"); 551Debug.Assert(writeResult != HeaderWriteResult.BufferTooSmall, "This always writes the status as the first header, and it should never be an over the buffer size."); 634Debug.Assert(payloadLength <= _maxFrameSize, "The initial payload lengths is written to _headerEncodingBuffer with size of _maxFrameSize"); 658Debug.Assert(payloadLength == 0, "Payload written even though buffer is too small"); 717Debug.Assert(dataLength == data.Length); 744Debug.Assert(dataLength == data.Length); 748Debug.Assert(dataLength > dataPayloadLength); 967Debug.Assert(payload.Length == _outgoingFrame.PayloadLength); // 8
Internal\Http2\Http2OutputProducer.cs (2)
186Debug.Assert(_completedResponse); 313Debug.Assert(_unconsumedBytes > 0);
Internal\Http2\Http2Stream.cs (2)
163Debug.Assert(_decrementCalled); 515Debug.Assert(flushTask.IsCompletedSuccessfully);
Internal\Http3\Http3Connection.cs (8)
386Debug.Assert(streamDirectionFeature != null); 387Debug.Assert(streamIdFeature != null); 613Debug.Assert(persistentStateFeature != null, $"Required {nameof(IPersistentStateFeature)} not on stream context."); 640Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 902Debug.Assert(!stream.IsReceivingHeader); 913Debug.Assert(Limits.MinRequestBodyDataRate != null); 929Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 934Debug.Assert(!_webtransportSessions.ContainsKey(http3Stream.StreamId));
Internal\Http3\Http3ControlStream.cs (3)
275Debug.Assert(incomingFrame.RemainingLength >= framePayload.Length); 288Debug.Assert(framePayload.Slice(0, consumed).Length == framePayload.Length); 298Debug.Assert(incomingFrame.RemainingLength > 0);
Internal\Http3\Http3FrameWriter.cs (3)
179Debug.Assert(dataLength == data.Length); 202Debug.Assert(dataLength == data.Length); 206Debug.Assert(dataLength > dataPayloadLength);
Internal\Http3\Http3OutputProducer.cs (1)
60Debug.Assert(_dataWriteProcessingTask.IsCompleted);
Internal\Http3\Http3Stream.cs (5)
225Debug.Assert(index <= H3StaticTable.Count); 233Debug.Assert(index <= H3StaticTable.Count); 369Debug.Fail($"Unexpected header type: {headerType}"); 478Debug.Assert(staticTableIndex >= 0, "Static table starts at 0."); 864Debug.Fail("Unexpected header parsing state.");
Internal\Http3\QPackHeaderWriter.cs (1)
15Debug.Assert(hasValue == true);
Internal\HttpConnection.cs (6)
105Debug.Assert(connectionHeartbeatFeature != null, nameof(IConnectionHeartbeatFeature) + " is missing!"); 106Debug.Assert(connectionLifetimeNotificationFeature != null, nameof(IConnectionLifetimeNotificationFeature) + " is missing!"); 159Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 178Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 198Debug.Assert(previousState != ProtocolSelectionState.Initializing, "The state should never be initializing"); 298Debug.Assert(false, "Invalid TimeoutReason");
Internal\Infrastructure\HttpUtilities.cs (9)
54Debug.Assert(str.Length == 8, "String must be exactly 8 (ASCII) characters long."); 59Debug.Assert(operationStatus == OperationStatus.Done); 66Debug.Assert(str.Length == 4, "String must be exactly 4 (ASCII) characters long."); 71Debug.Assert(operationStatus == OperationStatus.Done); 78Debug.Assert(bytes.Length == 8, "Mask must be exactly 8 bytes long."); 101Debug.Assert(written == destination.Length); 281Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1)); 330Debug.Assert(char.IsAscii(c), "Must already be validated"); 465Debug.Fail("Unexpected HttpVersion: " + httpVersion);
Internal\Infrastructure\KestrelMetrics.cs (3)
412Debug.Assert(reason != ConnectionEndReason.Unset); 425Debug.Assert(reason != ConnectionEndReason.Unset); 436Debug.Assert(TryGetErrorType(reason, out _), "Overwrite should only be set for an error reason.");
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (5)
62Debug.Assert(_currentFlushTcs == null, "There should not be a pending flush."); 163Debug.Assert(_currentFlushTcs != null); 249Debug.Assert(_tail != null); 305Debug.Assert(_currentFlushTcs != null); 338Debug.Assert(_tail != null);
Internal\Infrastructure\ResourceCounter.cs (1)
64Debug.Assert(_count >= 0, "Resource count is negative. More resources were released than were locked.");
Internal\Infrastructure\StatusCheckPipeWriter.cs (1)
33Debug.Assert(_context != null);
Internal\Infrastructure\StatusCheckWriteStream.cs (1)
27Debug.Assert(_context != null);
Internal\Infrastructure\StreamCloseAwaitable.cs (1)
22Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Internal\Infrastructure\TimeoutControl.cs (4)
116Debug.Assert(_minReadRate != null); 169Debug.Assert(_timeoutTimestamp == long.MaxValue, "Concurrent timeouts are not supported."); 205Debug.Assert(_concurrentIncompleteRequestBodies == 0 || minRate == _minReadRate, "Multiple simultaneous read data rates are not supported."); 260Debug.Assert(count >= 0, "BytesRead count must not be negative.");
Internal\KestrelServerImpl.cs (1)
345Debug.Assert(Options.ConfigurationLoader != null, "Rebind can only happen when there is a ConfigurationLoader.");
Internal\SniOptionsSelector.cs (1)
154Debug.Assert(_fallbackServerCertificateSelector != null,
Internal\ThrowHelper.cs (1)
24Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
Internal\WebTransport\WebTransportSession.cs (1)
136Debug.Assert(success);
KestrelConfigurationLoader.cs (5)
50Debug.Assert(reloadOnChange || (certificatePathWatcher is null), "If reloadOnChange is false, then certificatePathWatcher should be null"); 290Debug.Assert(!!_loaded || _reloadToken is null, "Shouldn't have a reload token before first load"); 291Debug.Assert(!!ReloadOnChange || _reloadToken is null, "Shouldn't have a reload token unless reload-on-change is set"); 320Debug.Assert(ReloadOnChange); 399Debug.Assert(o.EndpointConfig?.Certificate?.FileHasChanged != true, "Preserving an endpoint with file changes");
KestrelServerOptions.cs (3)
298Debug.Assert(ApplicationServices.GetRequiredService<IHttpsConfigurationService>().IsInitialized, "HTTPS configuration should have been enabled"); 319Debug.Assert(DevelopmentCertificate is null); 404Debug.Assert(status.FailureMessage != null, "Status with a failure result must have a message.");
Middleware\HttpsConnectionMiddleware.cs (4)
98Debug.Assert(_serverCertificate != null); 284Debug.Assert(!certificate.HasPrivateKey, "This should only be called with certificates that don't have a private key"); 349Debug.Assert(_options != null, "Middleware must be created with options."); 445Debug.Assert(_options != null, "Middleware must be created with options.");
Middleware\TlsListener.cs (1)
63Debug.Assert(parseState is ClientHelloParseState.ValidTlsClientHello or ClientHelloParseState.NotTlsClientHello);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\aspnetcore\src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\aspnetcore\src\Shared\Buffers\RefPooledArrayBufferWriter.cs (9)
56Debug.Assert(_index >= 0); 84Debug.Assert(_index >= 0); 99Debug.Assert(_index >= 0); 137Debug.Assert(_rentedBuffer.Length - _index > 0); 138Debug.Assert(_rentedBuffer.Length - _index >= sizeHint); 157Debug.Assert(oldBuffer.Length >= _index); 158Debug.Assert(_rentedBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length - _index > 0); 167Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
765Debug.Assert(pemEnvelope != null);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
91Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
354Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
src\aspnetcore\src\Shared\Hpack\DynamicHPackEncoder.cs (5)
71Debug.Assert(!_pendingTableSizeUpdate, "Dynamic table size update should be encoded before headers."); 153Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 158Debug.Assert(removed != null); 212Debug.Assert(headerSize <= _maxHeaderTableSize, "Header is bigger than dynamic table size."); 213Debug.Assert(headerSize <= _maxHeaderTableSize - _headerTableSize, "Not enough room in dynamic table.");
src\aspnetcore\src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\aspnetcore\src\Shared\PathNormalizer\PathNormalizer.cs (2)
17Debug.Assert(src[0] == '/', "Path segment must always start with a '/'"); 98Debug.Assert(src[0] == '/');
src\aspnetcore\src\Shared\runtime\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackDecoder.cs (5)
182Debug.Fail("HPACK decoder reach an invalid state"); 249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header."); 608Debug.Assert(_stringLength <= _maxHeadersLength, "String length should have been checked prior to decode.");
src\aspnetcore\src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (19)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\aspnetcore\src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\aspnetcore\src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\aspnetcore\src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\aspnetcore\src\Shared\runtime\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\aspnetcore\src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\aspnetcore\src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackDecoder.cs (4)
233Debug.Fail("QPACK decoder reach an invalid state"); 428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringLength <= _maxHeadersLength, "String length should have been checked prior to decode."); 652Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\aspnetcore\src\Shared\runtime\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\aspnetcore\src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Bitshifter.cs (2)
24Debug.Assert(value <= 0xFF_FF_FF, value.ToString(CultureInfo.InvariantCulture)); 45Debug.Assert(value <= 0x7F_FF_FF_FF, value.ToString(CultureInfo.InvariantCulture));
src\aspnetcore\src\Shared\ServerInfrastructure\Http2\Http2FrameReader.cs (1)
229Debug.Assert(data.Length % SettingSize == 0, "Invalid settings payload length");
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (10)
Internal\NamedPipeConnectionListener.cs (2)
63Debug.Assert(!stream.IsConnected, "Stream should have been successfully disconnected to reach this point."); 71Debug.Assert(_completeListeningTask == null, "Already started");
Internal\NamedPipeTransportFactory.cs (1)
28Debug.Assert(OperatingSystem.IsWindows(), "Named pipes transport requires a Windows operating system.");
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (22)
Internal\QuicConnectionContext.cs (2)
179Debug.Assert(cancellationToken.IsCancellationRequested, "Error requires cancellation is requested."); 190Debug.Fail($"Unexpected exception in {nameof(QuicConnectionContext)}.{nameof(AcceptAsync)}: {ex}");
Internal\QuicConnectionListener.cs (2)
169Debug.Assert(connectionContext != null); 170Debug.Assert(connectionContext.GetInnerConnection() == quicConnection);
Internal\QuicStreamContext.cs (8)
81Debug.Assert(_stream == null); 143Debug.Assert(_processingTask.IsCompletedSuccessfully); 150Debug.Assert(_stream != null); 185Debug.Assert(_stream != null); 206Debug.Assert(_stream != null); 354Debug.Assert(_streamClosedTokenSource != null); 370Debug.Assert(_stream != null); 525Debug.Assert(_stream != null);
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\aspnetcore\src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
205Debug.Assert(_memoryHandle.HasValue);
src\aspnetcore\src\Shared\Buffers.MemoryPool\MemoryPoolThrowHelper.cs (1)
111Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument), "The enum value is not defined, please check the ExceptionArgument Enum.");
src\aspnetcore\src\Shared\Buffers.MemoryPool\UnmanagedBufferAllocator.cs (4)
34Debug.Assert(_blockSize >= 0); 84Debug.Assert(myString is not null); 119Debug.Assert(sizeHint >= 0); 143Debug.Assert(count >= 0);
src\aspnetcore\src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (8)
Internal\SocketConnection.cs (3)
45Debug.Assert(socket != null); 46Debug.Assert(memoryPool != null); 47Debug.Assert(logger != null);
Internal\SocketSender.cs (2)
78Debug.Assert(!buffer.IsEmpty); 79Debug.Assert(!buffer.IsSingleSegment);
SocketConnectionListener.cs (2)
51Debug.Assert(listenSocket.LocalEndPoint != null); 65Debug.Assert(_listenSocket != null, "Bind must be called first.");
src\aspnetcore\src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
Microsoft.AspNetCore.SignalR.Client.Core (7)
HubConnection.cs (3)
1008Debug.Assert(genericTypes.Length == 1); 1054Debug.Assert(methodInfo == _sendIAsyncStreamItemsMethod); 2477Debug.Assert(_messageBuffer is not null);
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
334Debug.Assert(_currentIndex == -1); 340Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 382Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\aspnetcore\src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Common (5)
Protocol\HandshakeProtocol.cs (2)
69Debug.Assert(writer.CurrentDepth == 0); 100Debug.Assert(writer.CurrentDepth == 0);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
132Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Core (25)
HubConnectionContext.cs (1)
393Debug.Assert(_messageBuffer is not null);
Internal\ChannelBasedSemaphore.cs (1)
74Debug.Assert(false);
Internal\DefaultHubActivator.cs (2)
24Debug.Assert(!_created.HasValue, "hub activators must not be reused."); 41Debug.Assert(_created.HasValue, "hubs must be released with the hub activator they were created");
Internal\DefaultHubDispatcher.cs (2)
417Debug.Assert(hub.Clients is HubCallerClients); 860Debug.Assert(false, $"Failed to bind argument of type '{descriptor.OriginalParameterTypes[parameterPointer].Name}' for hub method '{descriptor.MethodExecutor.MethodInfo.Name}'.");
Internal\HubMethodDescriptor.cs (1)
270Debug.Assert(adapterMethodInfo == MakeAsyncEnumeratorFromChannelMethod);
SerializedHubMessage.cs (1)
45Debug.Assert(message.GetType().IsAssignableTo(typeof(HubInvocationMessage)));
src\aspnetcore\src\Shared\ObjectMethodExecutor\ObjectMethodExecutor.cs (3)
66Debug.Assert(isTrimAotCompatible, "isTrimAotCompatible should always be true."); 149Debug.Assert(_executor != null, "Sync execution is not supported."); 178Debug.Assert(_executorAsync != null, "Async execution is not supported.");
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\aspnetcore\src\SignalR\common\Shared\MessageBuffer.cs (3)
334Debug.Assert(_currentIndex == -1); 340Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 382Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\aspnetcore\src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
StreamTracker.cs (1)
35Debug.Assert(RuntimeFeature.IsDynamicCodeSupported || !itemType.IsValueType, "HubMethodDescriptor ensures itemType is not a ValueType when PublishAot=true.");
Microsoft.AspNetCore.SignalR.Protocols.Json (4)
Protocol\JsonHubProtocol.cs (3)
571Debug.Assert(writer.CurrentDepth == 0); 791Debug.Assert(arguments != null); 809Debug.Assert(arguments != null);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
132Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Protocol\NewtonsoftJsonHubProtocol.cs (2)
783Debug.Assert(arguments != null); 800Debug.Assert(arguments != null);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\aspnetcore\src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
132Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.StackExchangeRedis (16)
Internal\RedisProtocol.cs (1)
244Debug.Assert(isArray);
RedisHubLifetimeManager.cs (4)
821Debug.Assert(success); 825Debug.Assert(success); 826Debug.Assert(written == 24); 828Debug.Assert(base64.EndsWith("=="));
src\aspnetcore\src\SignalR\common\Shared\ClientResultsManager.cs (9)
34Debug.Assert(result); 44Debug.Assert(result); 169public static new void SetCanceled(CancellationToken cancellationToken) => Debug.Assert(false); 170public static new void SetException(IEnumerable<Exception> exceptions) => Debug.Assert(false); 173Debug.Assert(false); 178Debug.Assert(false); 183Debug.Assert(false); 188Debug.Assert(false); 193Debug.Assert(false);
src\aspnetcore\src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Npm\NodeScriptRunner.cs (1)
109Debug.Assert(chunk.Array != null);
Microsoft.AspNetCore.StaticAssets (10)
Development\StaticAssetDevelopmentRuntimeHandler.cs (4)
51Debug.Assert(originalETag != null, $"The static asset descriptor {asset.Route} - {asset.AssetPath} does not have an original-resource property."); 52Debug.Assert(originalAsset != null, $"The static asset descriptor {asset.Route} - {asset.AssetPath} has an original-resource property that does not match any known static asset descriptor."); 122Debug.Assert(etag != null, $"The static asset descriptor {descriptor.Route} - {descriptor.AssetPath} does not have an ETag response header."); 123Debug.Assert(_descriptorsMap.ContainsKey((descriptor.Route, etag)),
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
StaticAssetEndpointDataSource.cs (4)
77Debug.Assert(_changeToken != null); 78Debug.Assert(_endpoints != null); 125Debug.Assert(_changeToken != null); 126Debug.Assert(_endpoints != null);
StaticAssetsInvoker.cs (1)
184Debug.Fail(exception.ToString());
Microsoft.AspNetCore.StaticFiles (2)
src\aspnetcore\src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
StaticFileContext.cs (1)
345Debug.Fail(exception.ToString());
Microsoft.AspNetCore.TestHost (3)
ResponseBodyReaderStream.cs (1)
116Debug.Assert(innerException != null);
src\86f290b12362e070\HostFactoryResolver.cs (1)
304Debug.Assert(_hostTcs.Task.IsCompleted);
WebSocketClient.cs (1)
104Debug.Assert(webSocketFeature != null);
Microsoft.AspNetCore.Watch.BrowserRefresh (3)
src\sdk\src\Dotnet.Watch\Web.Middleware\ResponseStreamWrapper.cs (1)
194Debug.Assert(_isHtmlResponse != true);
src\sdk\src\Dotnet.Watch\Web.Middleware\ScriptInjectingStream.cs (2)
142Debug.Assert(_partialBodyTagLength <= s_bodyTagBytes.Length); 165Debug.Assert(_partialBodyTagLength == 0);
Microsoft.AspNetCore.WebSockets (11)
HandshakeHelpers.cs (4)
175Debug.Assert(ret); 176Debug.Assert(written == len); 270Debug.Assert(ret); 271Debug.Assert(written == len);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\aspnetcore\src\Shared\ValueStringBuilder\ValueStringBuilder.cs (6)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0); 290Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.AspNetCore.WebUtilities (22)
FileBufferingReadStream.cs (2)
238Debug.Assert(_tempFileDirectoryAccessor != null); 240Debug.Assert(_tempFileDirectory != null);
FileBufferingWriteStream.cs (2)
124Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold); 163Debug.Assert(PagedByteBuffer.Length <= _memoryThreshold);
FormPipeReader.cs (1)
269Debug.Assert(segmentConsumed == keyValuePair.FirstSpan.Length);
HttpRequestStreamReader.cs (3)
258Debug.Assert(charsRemaining == 0); 269Debug.Assert(charsRemaining == 0); 279Debug.Assert(charsRemaining > 0);
HttpResponseStreamWriter.cs (8)
215Debug.Assert(_charBufferCount == _charBufferSize); 251Debug.Assert(count > 0); 252Debug.Assert(_charBufferSize - _charBufferCount < count); 295Debug.Assert(count > 0); 296Debug.Assert(_charBufferSize - _charBufferCount < count); 344Debug.Assert(value.Length > 0); 345Debug.Assert(_charBufferSize - _charBufferCount < value.Length); 616Debug.Assert(_charBufferSize - _charBufferCount >= value.Length);
MultipartReaderStream.cs (4)
212Debug.Assert(matchCount == length); 229Debug.Assert(read == length); // It should have all been buffered 302Debug.Assert(matchCount == length); 319Debug.Assert(read == length); // It should have all been buffered
src\aspnetcore\src\Shared\QueryStringEnumerable.cs (1)
105Debug.Assert(success);
src\aspnetcore\src\Shared\WebEncoders\WebEncoders.cs (1)
155Debug.Assert(arraySizeRequired % 4 == 0, "Invariant: Array length must be a multiple of 4.");
Microsoft.Build (221)
BackEnd\BuildManager\BuildManager.cs (21)
811Debug.Assert(Monitor.IsEntered(_syncLock)); 1170Debug.Assert(allMismatchedProjectStartedEventsDueToLoggerErrors, "There was a mismatched project started event not caused by an exception result"); 1696Debug.Assert(!Monitor.IsEntered(_syncLock)); 1711Debug.Assert(Monitor.IsEntered(_syncLock)); 1816Debug.Assert(Monitor.IsEntered(_syncLock)); 2008Debug.Assert(!Monitor.IsEntered(_syncLock)); 2029Debug.Assert(!Monitor.IsEntered(_syncLock)); 2110Debug.Assert(!Monitor.IsEntered(_syncLock)); 2566Debug.Assert(Monitor.IsEntered(_syncLock)); 2599Debug.Assert(Monitor.IsEntered(_syncLock)); 2607Debug.Assert(Monitor.IsEntered(_syncLock)); 2726Debug.Assert(Monitor.IsEntered(_syncLock)); 2752Debug.Assert(Monitor.IsEntered(_syncLock)); 2836Debug.Assert(Monitor.IsEntered(_syncLock)); 2928Debug.Assert(Monitor.IsEntered(_syncLock)); 2977Debug.Assert(Monitor.IsEntered(_syncLock)); 3103Debug.Assert(Monitor.IsEntered(_syncLock)); 3130Debug.Assert(Monitor.IsEntered(_syncLock)); 3275Debug.Assert(Monitor.IsEntered(_syncLock)); 3581Debug.Assert(Monitor.IsEntered(_syncLock)); 3662Debug.Assert(Monitor.IsEntered(_syncLock));
BackEnd\Client\MSBuildClient.cs (1)
648Debug.Assert(KnownTelemetry.PartialBuildTelemetry == null || KnownTelemetry.PartialBuildTelemetry.StartAt.HasValue, "BuildTelemetry.StartAt was not initialized!");
BackEnd\Components\RequestBuilder\ItemBucket.cs (1)
154Debug.Assert(_expander != null, "ItemBucket.Initialize was not properly called");
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
844Debug.Assert(coresAcquired >= 1);
BackEnd\Shared\TargetResult.cs (1)
182Debug.Fail($"Unknown enum value: {ResultCode}");
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (2)
219Debug.Fail("Unexpected finalization. Dispose should already have been called."); 805Debug.Assert(TaskInstance is not IMultiThreadableTask multiThreadableTask || multiThreadableTask.TaskEnvironment != null, "task environment missing for multi-threadable task");
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (4)
92Debug.Assert(!string.IsNullOrEmpty(sectionName)); 105Debug.Assert(!string.IsNullOrEmpty(key)); 106Debug.Assert(key == key.Trim()); 107Debug.Assert(value == value?.Trim());
BuildCheck\Infrastructure\EditorConfig\EditorConfigGlobsMatcher.cs (2)
33Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length); 51Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
Collections\RetrievableEntryHashSet\HashHelpers.cs (1)
59Debug.Assert(min >= 0, "min less than zero; handle overflow checking before calling HashHelpers");
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (10)
235Debug.Assert(String.Equals(name, value.Key, StringComparison.Ordinal)); 263Debug.Assert(_buckets != null, "m_buckets was null but m_lastIndex > 0"); 284Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 398Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 604Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 703Debug.Assert(_count >= 0, "m_count is negative"); 714Debug.Assert(_buckets != null, "m_buckets was null but m_count > 0"); 740Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess"); 760Debug.Assert(_buckets == null, "Initialize was called but m_buckets was non-null"); 776Debug.Assert(_buckets != null, "IncreaseCapacity called on a set with no elements");
Construction\ProjectElementContainer.cs (1)
444Debug.Assert(child.ExpressedAsAttribute, nameof(SetElementAsAttributeValue) + " method requires that " +
Definition\BuiltInMetadata.cs (1)
69Debug.Fail($"Expected a valid item-spec modifier, got \"{name}\".");
Definition\ProjectCollection.cs (3)
1810Debug.Assert(_locker.IsWriteLockHeld); 1828Debug.Assert(_locker.IsWriteLockHeld); 1880Debug.Assert(!_locker.IsWriteLockHeld, "We should never raise events while holding a private lock.");
Evaluation\Conditionals\Scanner.cs (2)
84Debug.Assert(false, "What code path did not set an appropriate error resource? Expression: " + _expression); 111Debug.Assert(-1 != _errorPosition); // We should have set it
Evaluation\Expander.Function.cs (1)
158System.Diagnostics.Debug.Assert(
Evaluation\LazyItemEvaluator.cs (2)
205Debug.Assert(_applyCalls == cacheCount, "Apply should only be called once per globsToIgnore. Otherwise caching is not working"); 211Debug.Assert(_cache == null);
Evaluation\Profiler\ProfilerResultPrettyPrinter.cs (1)
70Debug.Assert(totalTime != null, "There should be at least one evaluation pass result");
Graph\ProjectGraph.cs (1)
973Debug.Assert(_evaluationContext is not null);
Instance\TaskFactories\TaskHostTask.cs (1)
541Debug.WriteLine("[TaskHostTask] Handling packet {0} at {1}", packet.Type, DateTime.Now);
Logging\BaseConsoleLogger.cs (2)
1209Debug.Assert(shared != null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was not returned."); 1265Debug.Assert(previous == null, "This is not supposed to be used in multiple threads or multiple time. One method is expected to return it before next acquire. Most probably it was double returned.");
Logging\LogFormatter.cs (1)
37Debug.Assert(timeStamp != DateTime.MinValue, "Timestamp missing");
Logging\ProfilerLogger.cs (3)
105Debug.Assert(_aggregatedLocations == null, 141Debug.Assert(result, 254Debug.Assert(pair.Key.ParentId.HasValue,
Logging\TerminalLogger\TerminalLogger.cs (1)
757System.Diagnostics.Debug.Assert(
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\5057ed6cf5d6323b\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\5057ed6cf5d6323b\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\9f0d3f3da306d8cf\IEnumerableExtensions.cs (1)
752Debug.Assert(data.All(d => d.Count() == count));
src\9f0d3f3da306d8cf\ImmutableArrayExtensions.cs (16)
87Debug.Assert(items != null); 488Debug.Assert(self.Length == other.Length); 519Debug.Assert(self.Length == other.Length); 551Debug.Assert(!array.IsDefault); 552Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 571Debug.Assert(i > 0); 587Debug.Assert(i > 0); 590Debug.Assert(builder == null); 603Debug.Assert(!all); 604Debug.Assert(!none); 613Debug.Assert(none); 817Debug.Assert(!array.IsDefault); 1191Debug.Assert(builder.Count > 1); 1235Debug.Assert(members.Length > 0); 1250Debug.Assert(count < members.Length); 1262Debug.Assert(builder.Count == count);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\TemporaryArray`1.cs (2)
172Debug.Assert(_count == InlineCapacity); 335Debug.Assert(_builder is null);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ArrayBuilder.cs (8)
493Debug.Assert(builder.Count == 0); 609Debug.Assert(start >= 0 && length >= 0); 610Debug.Assert(start + length <= items.Count); 629Debug.Assert(start >= 0 && length >= 0); 630Debug.Assert(start + length <= items.Length); 644Debug.Assert(start >= 0 && length >= 0); 645Debug.Assert(start + length <= items.Length); 669Debug.Assert(limit <= Count);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\ObjectPool`1.cs (5)
118Debug.Assert(size >= 1); 126Debug.Assert(size >= 1); 277Debug.Assert(obj != null, "freeing null?"); 279Debug.Assert(_firstItem != obj, "freeing twice?"); 290Debug.Assert(value != obj, "freeing twice?");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledDictionary.cs (1)
58Debug.Assert(instance.Count == 0);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledHashSet.cs (1)
47Debug.Assert(instance.Count == 0);
src\msbuild\artifacts\.packages\microsoft.codeanalysis.pooledobjects\5.0.0-1.25277.114\contentFiles\cs\netstandard2.0\PooledStringBuilder.cs (2)
30Debug.Assert(pool != null); 95Debug.Assert(builder.Builder.Length == 0);
src\msbuild\src\Shared\ResourceUtilities.cs (3)
302Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 309Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 316Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
src\msbuild\src\Shared\TaskEngineAssemblyResolver.cs (1)
84Debug.Assert(false, "There is no handler to remove.");
src\msbuild\src\Shared\TaskLoggingHelper.cs (2)
280Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 475Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
Utilities\EngineFileUtilities.cs (1)
597Debug.Assert(s_lazyWildCardExpansionRegexes is not null, $"If the user provided lazy wildcard regexes, {nameof(s_lazyWildCardExpansionRegexes)} should be populated");
Utilities\FileSpecMatchTester.cs (4)
24Debug.Assert(!string.IsNullOrEmpty(unescapedFileSpec)); 25Debug.Assert(currentDirectory != null); 59Debug.Assert(!string.IsNullOrEmpty(fileToMatch)); 79Debug.Assert(!string.IsNullOrEmpty(normalizedFileToMatch));
Utilities\SimpleVersion.cs (1)
181Debug.Assert(value >= 0);
Utilities\Utilities.cs (4)
726Debug.Fail($"In {nameof(EnumerateProperties)}(): Unexpected: property is null"); 730Debug.Fail($"In {nameof(EnumerateProperties)}(): Unexpected property {item} of type {item?.GetType().ToString()}"); 907Debug.Fail($"In {nameof(EnumerateItems)}(): Unexpected: {nameof(item)} is null"); 911Debug.Fail($"In {nameof(EnumerateItems)}(): Unexpected {nameof(item)} {item} of type {item?.GetType().ToString()}");
Xml\ProjectXmlUtilities.XmlElementChildIterator.cs (4)
33Debug.Assert(element != null); 43Debug.Assert(_state > -1); 60Debug.Assert(_state == -1); 70Debug.Assert(_state == 1 && _current != null);
Microsoft.Build.Framework (41)
BackEnd\InterningBinaryReader.cs (1)
157Debug.Assert(false, e.ToString());
BinaryTranslator.cs (1)
644Debug.Assert(count == 2);
BuildException\BuildExceptionBase.cs (1)
111Debug.Assert((exception.Data?.Count ?? 0) == 0,
ChangeWaves.cs (1)
180Debug.Assert(_runningTests || Array.IndexOf(AllWaves, wave) >= 0, $"Change wave version {wave} is invalid");
Collections\RefArrayBuilder.cs (13)
77Debug.Assert(value >= 0, "Count must be non-negative."); 78Debug.Assert(value <= _scope.Length, "Count must not exceed the span length."); 93Debug.Assert(index < _count, "Index must be less than Count."); 138Debug.Assert(_count == _scope.Length, "AddWithResize should only be called when the span is full."); 195Debug.Assert(index >= 0, "Insert index must be non-negative."); 196Debug.Assert(index <= _count, "Insert index must not exceed Count."); 220Debug.Assert(_count == _scope.Length, "InsertWithResize should only be called when the span is full."); 237Debug.Assert(index >= 0, "Insert index must be non-negative."); 238Debug.Assert(index <= _count, "Insert index must not exceed Count."); 279Debug.Assert(startIndex >= -1, "Start index must be -1 or non-negative."); 280Debug.Assert(startIndex <= _count, "Start index must not exceed Count."); 336Debug.Assert(index >= 0, "Remove index must be non-negative."); 337Debug.Assert(index < _count, "Remove index must be less than Count.");
EncodingUtilities.cs (2)
78Debug.Assert(false, "GetEncoding(default OEM encoding) threw an ArgumentException in EncodingUtilities.CurrentSystemOemEncoding! Please log a bug against MSBuild.", ex.Message); 82Debug.Assert(false, "GetEncoding(default OEM encoding) threw a NotSupportedException in EncodingUtilities.CurrentSystemOemEncoding! Please log a bug against MSBuild.", ex.Message);
FileUtilities.cs (3)
98Debug.Fail($"Casing test failed: {ex}"); 917Debug.Assert(allowedExtensions?.Length > 0); 925Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
InternalErrorException.cs (1)
134Debug.Fail(message, innerMessage);
ITaskItemExtensions.cs (1)
59Debug.Fail(e.ToString());
Loader\CoreCLRAssemblyLoader.cs (1)
56Debug.Assert(Path.IsPathRooted(fullPath));
LoggerException.cs (1)
125Debug.Assert(state is not null, "state cannot be null");
ReuseableStringBuilder.cs (1)
326Debug.Assert(returningBuilder.Capacity > returning._borrowedWithCapacity, "Capacity can only increase");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Utilities\BufferScope.cs (1)
96Debug.Assert(capacity > _span.Length);
Utilities\FileMatcher.cs (5)
871Debug.Assert(FileUtilities.PathsEqual(searchToExclude.BaseDirectory, recursionState.BaseDirectory), "Expected exclude search base directory to match include search base directory"); 1981Debug.Assert(projectDirectoryUnescaped != null); 1982Debug.Assert(filespecUnescaped != null); 1983Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped)); 2541Debug.Assert(excludeState.SearchData.RegexFileMatch != null || excludeState.SearchData.DirectoryPattern != null,
Utilities\QuotingUtilities.cs (1)
88Debug.Assert(false, "Null character in parameter");
Utilities\StringBuilderCache.cs (2)
49Debug.Assert( 93Debug.Assert(t_cachedInstance is null, "Unexpected replacing of other StringBuilder.");
Utilities\TypeExtensions.cs (1)
92Debug.Assert(
Utilities\ValueStringBuilder.cs (2)
408Debug.Assert(additionalCapacityBeyondPos > 0); 409Debug.Assert(_length > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Build.Tasks.CodeAnalysis (32)
src\roslyn\src\Compilers\Core\MSBuildTask\CommandLineBuilderExtension.cs (2)
124Debug.Assert(!_isQuotingRequired); 240Debug.Assert(treatAsFlags == null
src\roslyn\src\Compilers\Core\MSBuildTask\Csc.cs (2)
225Debug.Fail("The SDK framework-to-core bridge task only runs on .NET Framework MSBuild."); 826Debug.Assert(HostObject != null, "We should not be here if the host object has not been set.");
src\roslyn\src\Compilers\Core\MSBuildTask\ManagedToolTask.cs (1)
86Debug.Assert(IsBuiltinToolRunningOnCoreClr || useAppHost);
src\roslyn\src\Compilers\Core\MSBuildTask\MapSourceRoots.cs (1)
196Debug.Assert(mappedTopLevelPath.EndsWith("/", StringComparison.Ordinal));
src\roslyn\src\Compilers\Core\MSBuildTask\RCWForCurrentContext.cs (3)
52Debug.Assert(objInCurrentCtx != null, "Unable to marshal COM Object to the current context (apartment). This will hurt performance."); 72Debug.Fail("This object requires explicit call to Dispose"); 119Debug.Assert(OperatingSystem.IsWindows());
src\roslyn\src\Compilers\Core\MSBuildTask\Vbc.cs (3)
409Debug.Fail("The SDK framework-to-core bridge task only runs on .NET Framework MSBuild."); 1128Debug.Assert(this.HostObject != null, "We should not be here if the host object has not been set."); 1134Debug.Assert(vbcHostObject5 != null, "Wrong kind of host object passed in!");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
73Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 85Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server"); 506Debug.Assert(reason is object);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
79Debug.Assert(workingDirectory is object); 199Debug.Assert(pipeName is object); 833Debug.Assert(Stream is null); 871Debug.Assert(Stream is not null);
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.Build.Tasks.Core (82)
AssemblyDependency\CandidateAssemblyFilesResolver.cs (1)
90Debug.Assert(considered.Reason != NoMatchReason.Unknown, "Expected a no match reason here.");
AssemblyDependency\Reference.cs (4)
210Debug.Assert(dependee.FullPath.Length > 0, "Cannot add dependee that doesn't have a full name. This should have already been resolved."); 424Debug.Assert(filenameExtension[0] == '.', "Expected extension to start with '.'"); 445Debug.Assert(!Path.IsPathRooted(filename), "Satellite path should be relative to the current reference."); 457Debug.Assert(!Path.IsPathRooted(filename), "Serialization assembly path should be relative to the current reference.");
AssemblyDependency\ResolveAssemblyReference.cs (6)
1850Debug.Assert(false, "Should have handled this case."); 1895Debug.Assert(false, "Unexpected exception type."); 2033Debug.Assert(false, "Should have handled this case."); 2151Debug.Assert(false, "Should have handled this case."); 2190Debug.Assert(!reference.IsPrimary, "A primary reference should never lose a conflict because of version. This is an insoluble conflict instead."); 2221Debug.Assert(false, "Should have handled this case.");
AssignCulture.cs (1)
212Debug.Assert(false, "Unexpected exception in AssignCulture.Execute. " +
BootstrapperUtil\BootstrapperBuilder.cs (21)
554Debug.Fail(ex.Message); 579Debug.Fail("Already found resources for culture " + stringNode.InnerText); 803Debug.Assert(filePath != null, "null filePath?"); 804Debug.Assert(schemaPath != null, "null schemaPath?"); 805Debug.Assert(schemaNamespace != null, "null schemaNamespace?"); 819Debug.Fail("Could not locate schema '" + schemaPath + "', so no validation of '" + filePath + "' is possible."); 828Debug.Fail("Could not locate data file '" + filePath + "'."); 850Debug.Assert(_document != null, "our document should have been created by now!"); 856Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message); 861Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message); 869Debug.Assert(xmlDocument.DocumentElement != null && 946Debug.Assert(langDoc != null, "we couldn't load package.xml in '" + strLangManifestFilename + "'...?"); 953Debug.Assert(langNode != null, $"Unable to find a package node in {strLangManifestFilename}"); 1045Debug.WriteLine($"Validation results already added for Product Code '{productCodeAttribute}'"); 1054Debug.Fail(ex.Message); 1058Debug.Fail(ex.Message); 1062Debug.Fail(ex.Message); 1260Debug.Assert(false, "Specified key does not exist for node " + nextNode.InnerXml); 1566Debug.Assert(sourceAttribute != null, "we should not be here if there is no ProductCode attribute"); 1901Debug.Fail(ex.Message); 1995Debug.Assert(s != null, $"EmbeddedResource '{name}' not found");
BootstrapperUtil\PackageCollection.cs (1)
39Debug.Fail("Package with culture " + package.Culture + " has already been added.");
BootstrapperUtil\Product.cs (2)
34Debug.Fail("Products are not to be created in this fashion. Please use IBootstrapperBuilder.Products instead."); 171Debug.WriteLine($"A package with culture '{package.Culture.ToLowerInvariant()}' has already been added to product '{ProductCode}'");
BootstrapperUtil\ProductCollection.cs (1)
37System.Diagnostics.Debug.WriteLine("Product '{0}' has already been added to the product list", product.ProductCode.ToUpperInvariant());
BootstrapperUtil\productvalidationresults.cs (1)
36System.Diagnostics.Debug.Fail("Validation results have already been added for culture '{0}'", culture);
GenerateApplicationManifest.cs (2)
402Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 420Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateDeploymentManifest.cs (2)
141Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 153Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateResource.cs (3)
3113Debug.Fail($"Unknown format {format}"); 3408Debug.Fail($"Unknown format {format}"); 3438Debug.Assert(_logger.HasLoggedErrors);
ManifestUtil\ConvertUtil.cs (2)
28Debug.Fail($"Invalid value '{value}' for {typeof(bool).Name}, returning {defaultValue}"); 32Debug.Fail($"Invalid value '{value}' for {typeof(bool).Name}, returning {defaultValue}");
ManifestUtil\Manifest.cs (4)
532Debug.Assert(false, "AssemblyName cannot be empty"); 778Debug.Fail("Comparing null objects"); 786Debug.Fail("Objects do not have a SortName"); 793Debug.Fail("Comparing objects that are not BaseReferences");
ManifestUtil\TrustInfo.cs (1)
317Debug.Assert(document != null, "GetPermissionSetElement was passed a null document");
ManifestUtil\Util.cs (4)
203Debug.Assert(s != null, $"EmbeddedResource '{name}' not found"); 596Debug.Fail("Comparing null objects"); 601Debug.Fail("Comparing objects that are not ITaskItem"); 608Debug.Fail("Objects do not have a ItemSpec");
ManifestUtil\XmlUtil.cs (1)
197Debug.Fail($"ResourceResolver could not find file '{filename}'");
RedistList.cs (3)
903Debug.Assert(isValidEntry, string.Format(CultureInfo.InvariantCulture, "Missing attribute in redist file: {0}, line #{1}", path, 936Debug.Assert(firstEntry != null && secondEntry != null); 1144Debug.Assert(name != null && frameworkDirectory != null);
ResGenDependencies.cs (3)
370Debug.Assert(outputFiles != null, "OutputFiles hasn't been set"); 395Debug.Assert(OutputFiles != null, "This has not been initialized"); 396Debug.Assert(otherLibrary.OutputFiles != null, "The other library has not been initialized");
ResolveManifestFiles.cs (13)
367Debug.Assert(!String.IsNullOrEmpty(itemCulture), $"Satellite item '{item.ItemSpec}' is missing expected attribute 'Culture'"); 888Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same key '{key}' detected"); 957Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same key '{key}' detected"); 991Debug.Assert(!String.IsNullOrEmpty(targetPath)); 998Debug.Assert(!_dictionary.ContainsKey(key), $"Two or more items with same '{(object)ItemMetadataNames.targetPath}' attribute detected"); 1033Debug.Fail($"Invalid value '{value}' for PublishState"); 1037Debug.Fail($"Invalid value '{value}' for PublishState"); 1072Debug.Fail("PublishState.DataFile is invalid for an assembly"); 1079Debug.Fail($"Unhandled value PublishFlags.{state}"); 1109Debug.Fail("PublishState.Prerequisite is invalid for a file"); 1112Debug.Fail($"Unhandled value PublishFlags.{state}"); 1139Debug.Fail("PublishState.DataFile is invalid for an assembly"); 1146Debug.Fail($"Unhandled value PublishFlags.{state}");
src\msbuild\src\Shared\LanguageParser\CSharptokenEnumerator.cs (2)
96Debug.Assert(false, "Code defect in tokenizer: Should have yielded a closing tick."); 160Debug.Assert(false, "Defect in tokenizer: Should have yielded a terminating quote.");
src\msbuild\src\Shared\ResourceUtilities.cs (3)
302Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 309Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 316Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
SystemState.cs (1)
688Debug.Assert(false, "Using slow-path in SystemState.GetDirectories, was this intentional?");
Microsoft.Build.Tasks.Git (22)
GitDataReader\GitConfig.Reader.cs (1)
363Debug.Assert(c == '[');
GitDataReader\GitEnvironment.cs (1)
129Debug.Assert(!PathUtils.IsUnixLikePlatform);
GitDataReader\GitIgnore.Matcher.cs (5)
44Debug.Assert(PathUtils.HasTrailingSlash(directory)); 114Debug.Assert(PathUtils.IsAbsolute(normalizedPosixPath)); 115Debug.Assert(PathUtils.IsPosixPath(normalizedPosixPath)); 116Debug.Assert(!PathUtils.HasTrailingSlash(normalizedPosixPath)); 166Debug.Assert(!PathUtils.HasTrailingSlash(fullPath));
GitDataReader\GitReferenceResolver.cs (2)
38Debug.Assert(PathUtils.IsNormalized(gitDirectory)); 39Debug.Assert(PathUtils.IsNormalized(commonDirectory));
GitDataReader\GitRefTableReader.cs (1)
270Debug.Assert(StringComparer.Ordinal.Compare(referenceName, record.LastRefName) < 0);
GitDataReader\Glob.cs (4)
59Debug.Assert(pattern[patternIndex] == '*' && pattern[patternIndex + 1] == '/'); 171Debug.Assert(patternIndex >= 0); 172Debug.Assert(pathIndex >= 0); 191Debug.Assert(pattern[patternIndex - 1] == '[');
GitDataReader\PathUtils.cs (2)
52Debug.Assert(!string.IsNullOrEmpty(root)); 103Debug.Assert(!IsUnixLikePlatform);
GitOperations.cs (2)
437Debug.Assert(segments.Length > 0); 439Debug.Assert(root.Matcher == null);
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.Build.Utilities.Core (7)
CommandLineBuilder.cs (1)
201Debug.Assert(!hasAllUnquotedCharacters || !hasSomeQuotedCharacters,
src\msbuild\src\Shared\ResourceUtilities.cs (3)
302Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 309Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 316Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
src\msbuild\src\Shared\TaskLoggingHelper.cs (2)
280Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?"); 475Debug.Assert(messageArgs == null || messageArgs.Length == 0 || messageArgs[0].GetType() != typeof(MessageImportance), "Did you call the wrong overload?");
ToolTask.cs (1)
440Debug.Assert(ExitCode != 0, "HandleTaskExecutionErrors should only be called if there were problems executing the task");
Microsoft.CodeAnalysis (2379)
AssemblyUtilities.cs (2)
26Debug.Assert(PathUtilities.IsAbsolute(filePath)); 100Debug.Assert(PathUtilities.IsAbsolute(assemblyPath));
Binding\AbstractLookupSymbolsInfo.cs (8)
132Debug.Assert((uniqueSymbol != null) || (arity == 0)); 139Debug.Assert(arity == _arityBitVectorOrUniqueArity); 148Debug.Assert(_uniqueSymbolOrArities is TSymbol); 163Debug.Assert(!this.HasUniqueSymbol); 205Debug.Assert(!this.HasUniqueSymbol); 213Debug.Assert(!this.HasUniqueSymbol); 265Debug.Assert(pair.UniqueSymbol == null || pair.UniqueSymbol == symbol); 286Debug.Assert(CanBeAdded(name));
Binding\BindingDiagnosticBag.cs (8)
43Debug.Assert(DiagnosticBag is object); 49Debug.Assert(DiagnosticBag is object); 67Debug.Assert(diagnosticBag?.GetType().IsValueType != true); 110Debug.Assert(allowMismatchInDependencyAccumulation || other.Dependencies.IsDefaultOrEmpty || this.AccumulatesDependencies || !this.AccumulatesDiagnostics); 119Debug.Assert(allowMismatchInDependencyAccumulation || !other.AccumulatesDependencies || this.AccumulatesDependencies); 186Debug.Assert(allowMismatchInDependencyAccumulation || !dependencies.AccumulatesDependencies || this.AccumulatesDependencies); 201Debug.Assert(!useSiteInfo.AccumulatesDependencies || this.AccumulatesDependencies); 261Debug.Assert(!useSiteInfo.AccumulatesDependencies || this.AccumulatesDependencies);
Binding\UseSiteInfo.cs (30)
60Debug.Assert(diagnosticInfo?.Severity != DiagnosticSeverity.Error || (primaryDependency is null && secondaryDependencies?.IsEmpty != false)); 61Debug.Assert(primaryDependency is null || primaryDependency != primaryDependency.CorLibrary); 62Debug.Assert(secondaryDependencies?.IsEmpty != false || !secondaryDependencies.Any(dependency => dependency == dependency.CorLibrary)); 81Debug.Assert(DiagnosticInfo?.Severity != DiagnosticSeverity.Error); 126Debug.Assert(assemblyBeingBuilt is object); 127Debug.Assert(assemblyBeingBuilt is ISourceAssemblySymbolInternal); 135Debug.Assert(assemblyBeingBuilt is object); 136Debug.Assert(assemblyBeingBuilt is ISourceAssemblySymbolInternal); 164Debug.Assert(discardLevel != DiscardLevel.None); 179Debug.Assert(_diagnostics is null); 180Debug.Assert(_dependencies is null); 181Debug.Assert(!_hasErrors); 185Debug.Assert(_dependencies is null); 201Debug.Assert(AccumulatesDiagnostics); 210Debug.Assert(_discardLevel switch { DiscardLevel.None => true, DiscardLevel.Dependencies => true, DiscardLevel.DiagnosticsAndDependencies => true, _ => false }); 211Debug.Assert(_hasErrors == (_diagnostics?.Any(d => d.Severity == DiagnosticSeverity.Error) ?? false)); 212Debug.Assert(!_hasErrors || (_dependencies is null)); 221Debug.Assert(AccumulatesDependencies); 231Debug.Assert(AccumulatesDiagnostics); 280Debug.Assert(_diagnostics is not null); 354Debug.Assert(!info.AccumulatesDependencies || this.AccumulatesDependencies); 390Debug.Assert(other.AccumulatesDiagnostics); 391Debug.Assert(other._discardLevel != DiscardLevel.None || _discardLevel == DiscardLevel.None); 395Debug.Assert(!AccumulatesDependencies); 438Debug.Assert(!AccumulatesDependencies); 474Debug.Assert(diagnosticInfo is null || diagnosticInfo.Severity == DiagnosticSeverity.Error); 486Debug.Assert(primaryDependency is object || (useSiteInfo.PrimaryDependency is null && secondaryDependencies.IsEmpty)); 487Debug.Assert(primaryDependency == useSiteInfo.PrimaryDependency || useSiteInfo.DiagnosticInfo?.Severity == DiagnosticSeverity.Error); 549Debug.Assert(info is object); 603Debug.Assert(!dependencies.IsEmpty);
CodeGen\BasicBlock.cs (18)
105Debug.Assert((this.FirstILMarker < 0) == (this.LastILMarker < 0)); 106Debug.Assert((this.LastILMarker < 0) || (this.LastILMarker + 1 == marker)); 119Debug.Assert(this.FirstILMarker >= 0); 120Debug.Assert(this.LastILMarker >= 0); 121Debug.Assert(this.LastILMarker == marker); 186Debug.Assert((ILOpCode)(byte)value == value, "rev opcodes must fit in a byte"); 210Debug.Assert(this.BranchCode.IsConditionalBranch() == newBranchCode.IsConditionalBranch()); 211Debug.Assert(newBranchCode.IsBranch() == (_branchLabel != null)); 232Debug.Assert(newLabel != null); 271Debug.Assert(delta <= 0); 284Debug.Assert(BranchBlock?.EnclosingHandler == null); 363Debug.Assert(BranchCode != ILOpCode.Nop, "Nop branches should not have labels"); 461Debug.Assert(toRemove == next || toRemove.TotalSize == 0); 462Debug.Assert(!builder._labelInfos.Values.Any(li => li.bb == toRemove), 633Debug.Assert(BranchCode.Size() == 1); 730Debug.Assert(BranchLabels != null); 741Debug.Assert(BranchesCount > 0); 742Debug.Assert(branchBlocksBuilder != null);
CodeGen\CompilationTestData.cs (1)
49Debug.Assert(MetadataWriter == null);
CodeGen\DebugId.cs (2)
35Debug.Assert(ordinal >= 0 || ordinal == UndefinedOrdinal); 36Debug.Assert(generation >= 0);
CodeGen\EmitState.cs (2)
47Debug.Assert(value >= 0 && value <= ushort.MaxValue); 63Debug.Assert(value >= 0 && value <= ushort.MaxValue);
CodeGen\ILBuilder.cs (37)
91Debug.Assert(!_pendingBlockCreate || (_currentBlock == null)); 104Debug.Assert(_currentBlock == null); 124Debug.Assert(_lastCompleteBlock != null); 125Debug.Assert(_lastCompleteBlock.NextBlock == null); 137Debug.Assert(_currentBlock == null); 140Debug.Assert(_currentBlock != null); 141Debug.Assert(!_pendingBlockCreate); 166Debug.Assert(_allocatedILMarkers != null); 176Debug.Assert((startMarker < 0) || (startMarker == (_lastCompleteBlock.LastILMarker + 1))); 269Debug.Assert(AllBlocks(block => (block.Reachability == Reachability.NotReachable))); 442Debug.Assert(handlerBlock != null); 448Debug.Assert(handlerBlock.NextExceptionHandler == null); 470Debug.Assert(handlerBlock.Type == BlockType.Catch || handlerBlock.Type == BlockType.Fault || handlerBlock.Type == BlockType.Filter); 481Debug.Assert(block.EnclosingHandler.LastFilterConditionBlock.BranchCode == ILOpCode.Endfilter); 531Debug.Assert(targetBlock != null && !IsSpecialEndHandlerBlock(targetBlock)); 591Debug.Assert(targetBlock != null && !IsSpecialEndHandlerBlock(targetBlock)); 703Debug.Assert(AllBlocks(block => (block.Reachability == Reachability.Reachable) || (block.Reachability == Reachability.BlockedByFinally))); 747Debug.Assert(current.Reachability != Reachability.BlockedByFinally || 768Debug.Assert(AllBlocks(block => !IsSpecialEndHandlerBlock(block))); 783Debug.Assert(block.BranchBlock == block); 910Debug.Assert(blockLastMarker >= blockFirstMarker); 913Debug.Assert(_allocatedILMarkers != null); 963Debug.Assert(btOffset == offset); 1001Debug.Assert(lastOffset < offset); 1004Debug.Assert((lastOffset >= 0) || (offset == 0)); 1042Debug.Assert(this.SeqPointsOpt.Count == 0); 1085Debug.Assert(_initialHiddenSequencePointMarker < 0); 1090Debug.Assert(_initialHiddenSequencePointMarker == 0); 1106Debug.Assert(_emitState.CurStack == 0); 1112Debug.Assert(_emitState.InstructionsEmitted >= _instructionCountAtLastLabel); 1142Debug.Assert(!_pendingBlockCreate); 1150Debug.Assert(!_pendingBlockCreate); 1246Debug.Assert(this.RealizedIL.IsDefault, "Too late to allocate a new IL marker"); 1253Debug.Assert(curBlock != null); 1271Debug.Assert(!RealizedIL.IsDefault, "Builder must be realized to perform this operation"); 1272Debug.Assert(_allocatedILMarkers != null, "There are not markers in this builder"); 1273Debug.Assert(ilMarker >= 0 && ilMarker < _allocatedILMarkers.Count, "Wrong builder?");
CodeGen\ILBuilderConversions.cs (2)
227Debug.Assert(fromPredefTypeKind.IsFloatingPoint()); 264Debug.Assert(fromPredefTypeKind.IsFloatingPoint());
CodeGen\ILBuilderEmit.cs (20)
32Debug.Assert(!code.IsControlTransfer(), 127Debug.Assert(labelInfo.bb == null, "duplicate use of a label"); 139Debug.Assert(curStack == labelStack, "forward branches and fall-through must agree on stack depth"); 169Debug.Assert(validOpCode); 170Debug.Assert(revOpCode == ILOpCode.Nop || revOpCode.IsBranch()); 171Debug.Assert(!code.HasVariableStackBehavior()); 184Debug.Assert(labelInfo.stack == _emitState.CurStack, "branches to same label with different stacks"); 191Debug.Assert((code != ILOpCode.Nop) || (block == _labelInfos[label].bb)); 231Debug.Assert(caseLabels.Length > 0); 263Debug.Assert(caseLabels.Length > 0); 264Debug.Assert(keyTypeCode != Cci.PrimitiveTypeCode.String); 289Debug.Assert(ld.stack == curStack, "branches to same label with different stacks"); 306Debug.Assert(!this.InExceptionHandler); 362Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 376Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 390Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 404Debug.Assert(!arrayType.IsSZArray, "should be used only with multidimensional arrays"); 489Debug.Assert(LocalSlotManager != null); 806Debug.Assert(alignment is 1 or 2 or 4); 852Debug.Assert(size == 2);
CodeGen\ILOpCodeExtensions.cs (3)
19Debug.Assert(code < 0xf0); 24Debug.Assert((code & 0xff00) == 0xfe00); 185Debug.Assert(!opcode.HasVariableStackBehavior());
CodeGen\LambdaDebugInfo.cs (1)
37Debug.Assert(closureOrdinal >= MinClosureOrdinal);
CodeGen\LocalDebugId.cs (2)
44Debug.Assert(isNone); 52Debug.Assert(ordinal >= 0);
CodeGen\LocalScopeManager.cs (24)
47Debug.Assert(_enclosingExceptionHandler == GetEnclosingExceptionHandler()); 71Debug.Assert(_enclosingExceptionHandler == GetEnclosingExceptionHandler()); 214Debug.Assert(scopeType == ScopeType.Variable || scopeType == ScopeType.StateMachineVariable); 261Debug.Assert(scopes.Count > 0); 285Debug.Assert(scopes.Count > 0); 346Debug.Assert(variable.Name != null); 358Debug.Assert(constant.Name != null); 370Debug.Assert(slotIndex >= 0); 561Debug.Assert((type == ScopeType.Try) || (type == ScopeType.Catch) || (type == ScopeType.Filter) || (type == ScopeType.Finally) || (type == ScopeType.Fault)); 562Debug.Assert((type == ScopeType.Catch) == (exceptionType != null)); 600Debug.Assert(_type == ScopeType.Filter); 601Debug.Assert(_lastFilterConditionBlock == null); 622Debug.Assert(endLabel != null); 631Debug.Assert(LeaderBlock != null); 636Debug.Assert(builder.EnclosingExceptionHandler == this); 699Debug.Assert(((_handlers.Count == 0) && (scopeType == ScopeType.Try)) || 702Debug.Assert(currentExceptionHandler == _containingHandler); 711Debug.Assert(_handlers.Count > 1); 732Debug.Assert(builder._currentBlock == builder._labelInfos[_endLabel].bb); 749Debug.Assert(_handlers.Count > 1); 768Debug.Assert(handlerScope.Type == ScopeType.Try); 774Debug.Assert((reachability == Reachability.Reachable) || (reachability == Reachability.NotReachable)); 777Debug.Assert(_handlers.All(h => (h.LeaderBlock.Reachability == reachability))); 867Debug.Assert(begin >= 0 && end >= 0);
CodeGen\LocalSlotManager.cs (5)
165Debug.Assert(removed, $"Attempted to free '{symbol}' more than once."); 255Debug.Assert(slot.Name == null); 265Debug.Assert((_addressedLocals == null) == (_addressedLocalScopes == 0)); 283Debug.Assert(_addressedLocals != null); 301Debug.Assert(_addressedLocalScopes == 0 && countBefore == 0);
CodeGen\MetadataConstant.cs (1)
34Debug.Assert(value == null || value is string || value is DateTime || value is decimal || value.GetType().GetTypeInfo().IsEnum || (value.GetType().GetTypeInfo().IsPrimitive && !(value is IntPtr) && !(value is UIntPtr)));
CodeGen\MethodBody.cs (4)
77Debug.Assert(!locals.IsDefault); 78Debug.Assert(!exceptionHandlers.IsDefault); 79Debug.Assert(!localScopes.IsDefault); 113Debug.Assert(debugDocumentProvider != null);
CodeGen\PermissionSetAttribute.cs (8)
71Debug.Assert(namedArgs.Length == 1); 75Debug.Assert(fileArg.ArgumentName == FilePropertyName); 76Debug.Assert(context.Module.IsPlatformType(fileArg.Type, Cci.PlatformType.SystemString)); 79Debug.Assert(fileArg.ArgumentValue is MetadataConstant); 81Debug.Assert(!String.IsNullOrEmpty(fileName)); 85Debug.Assert(((INamedTypeSymbol)iSymbol).GetMembers(HexPropertyName).Any( 135Debug.Assert(b < 0x10); 151Debug.Assert(_sourceAttribute.NamedArgumentCount == 1);
CodeGen\PrivateImplementationDetails.cs (23)
198Debug.Assert(!IsFrozen); 202Debug.Assert(typeCode is 222Debug.Assert(!IsFrozen); 224Debug.Assert(typeCode is not Cci.PrimitiveTypeCode.Reference); 242Debug.Assert(!IsFrozen); 243Debug.Assert(alignment is 1 or 2 or 4 or 8); 244Debug.Assert(length != 1 || alignment == 1); 385Debug.Assert(method is not null); 395Debug.Assert(symbol is not null, "The emit layer should check the helpers exist."); 404Debug.Assert(!IsFrozen); 408Debug.Assert(_mvidField.Type == mvidType); 416Debug.Assert(!IsFrozen); 420Debug.Assert(_moduleCancellationTokenField.Type == cancellationTokenType); 429Debug.Assert(!IsFrozen); 433Debug.Assert(payloadRootField.Type == payloadRootType); 440Debug.Assert(IsFrozen); 447Debug.Assert(!IsFrozen); 455Debug.Assert(IsFrozen); 461Debug.Assert(IsFrozen); 475Debug.Assert(IsFrozen); 508Debug.Assert(context.Module == ModuleBuilder); 529Debug.Assert(bytesWritten == hash.Length); 905Debug.Assert(!block.IsDefault);
CodeGen\SequencePointList.cs (1)
97Debug.Assert(ilOffset >= 0);
CodeGen\SwitchIntegralJumpTableEmitter.cs (13)
69Debug.Assert(caseLabels.Length > 0); 107Debug.Assert(!_sortedCaseLabels.IsEmpty); 152Debug.Assert(SwitchConstantValueHelper.IsValidSwitchCaseLabelConstant(firstConstant) 156Debug.Assert(SwitchConstantValueHelper.IsValidSwitchCaseLabelConstant(secondConstant) 187Debug.Assert(startLabelIndex >= 0 && startLabelIndex <= endLabelIndex); 188Debug.Assert(_sortedCaseLabels.Length > endLabelIndex); 227Debug.Assert(!switchBucketsStack.IsEmpty); 260Debug.Assert(startLabelIndex >= 0 && startLabelIndex <= endLabelIndex); 389Debug.Assert(i == bucketSize - 1); 397Debug.Assert(nextCaseLabelValue > startConstant.Int64Value); 403Debug.Assert(nextCaseLabelValue > startConstant.UInt64Value); 413Debug.Assert(nextCaseIndex >= switchBucket.LabelsCount); 423Debug.Assert(branchCode.IsBranch());
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (11)
64Debug.Assert((uint)startIndex < (uint)endIndex); 74Debug.Assert((uint)startIndex <= (uint)endIndex); 75Debug.Assert((uint)startIndex != (uint)endIndex || isDegenerate); 95Debug.Assert(i < LabelsCount, "index out of range"); 140Debug.Assert(_startLabelIndex != _endLabelIndex, "1-sized buckets should be already known as degenerate."); 183Debug.Assert(!BucketOverflowUInt64Limit(startConstant, endConstant)); 184Debug.Assert(endConstant.Discriminator == startConstant.Discriminator); 190Debug.Assert(endConstant.Int64Value >= startConstant.Int64Value); 195Debug.Assert(endConstant.UInt64Value >= startConstant.UInt64Value); 205Debug.Assert(IsValidSwitchBucketConstantPair(startConstant, endConstant)); 306Debug.Assert(prevBucket._endLabelIndex + 1 == _startLabelIndex);
CodeGen\SwitchStringJumpTableEmitter.cs (5)
81Debug.Assert(caseLabels.Length > 0); 96Debug.Assert(_keyHash == null || ShouldGenerateHashTableSwitch(_caseLabels.Length)); 111Debug.Assert(_keyHash != null); 201Debug.Assert(stringConstant.IsNull || stringConstant.IsString); 212Debug.Assert(!bucket.Contains(kvPair));
CodeGen\SynthesizedLocalOrdinalsDispenser.cs (1)
59Debug.Assert(ordinal == 0 || localKind != SynthesizedLocalKind.UserDefined);
CodeGen\TokenMap.cs (2)
65Debug.Assert(referenceAdded); 98Debug.Assert(token < (uint)_count && _count <= _items.Length);
Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
Collections\ByteSequenceComparer.cs (1)
103Debug.Assert(!x.IsDefault);
Collections\CachingDictionary.cs (3)
216Debug.Assert(IsNotFullyPopulatedMap(existingMap)); 220Debug.Assert(_comparer == allKeys.Comparer); 237Debug.Assert(elements != s_emptySentinel);
Collections\CachingFactory.cs (2)
117Debug.Assert(result != 0); 244Debug.Assert(size > 0);
Collections\ImmutableMemoryStream.cs (1)
19Debug.Assert(!array.IsDefault);
Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
Collections\SmallConcurrentSetOfInts.cs (3)
50Debug.Assert(i != unoccupied); 80Debug.Assert(i != unoccupied); 126Debug.Assert(!added);
Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
Collections\TopologicalSort.cs (1)
75Debug.Assert(count != 0);
Collections\UnionCollection.cs (3)
33Debug.Assert(coll1.IsReadOnly && coll2.IsReadOnly); 51Debug.Assert(collections.All(c => selector(c).IsReadOnly)); 68Debug.Assert(!collections.IsDefault);
CommandLine\AnalyzerConfig.cs (4)
227Debug.Assert(!string.IsNullOrEmpty(sectionName)); 241Debug.Assert(!string.IsNullOrEmpty(key)); 242Debug.Assert(key == key.Trim()); 243Debug.Assert(value == value?.Trim());
CommandLine\AnalyzerConfig.SectionNameMatching.cs (2)
32Debug.Assert(regex.GetGroupNumbers().Length - 1 == numberRangePairs.Length); 49Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
CommandLine\AnalyzerConfigOptionsResult.cs (2)
37Debug.Assert(treeOptions != null); 38Debug.Assert(analyzerOptions != null);
CommandLine\AnalyzerConfigSet.cs (6)
154Debug.Assert(builder.Count == config.NamedSections.Length); 159Debug.Assert(allMatchers.Count == _analyzerConfigs.Length); 556Debug.Assert(_values is object); 565Debug.Assert(_values is object); 566Debug.Assert(_duplicates is object); 623Debug.Assert(originalEntry.globalLevel == globalLevel);
CommandLine\CommandLineArguments.cs (1)
439Debug.Assert((diagnosticsOpt == null) == (messageProviderOpt == null));
CommandLine\CommandLineParser.cs (7)
65Debug.Assert(PathUtilities.IsAbsolute(directory)); 131Debug.Assert(false); 468Debug.Assert(outputDirectory is object); 597Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 982Debug.Assert(i < arg.Length); 1001Debug.Assert(slashCount >= 0); 1153Debug.Assert(IsScriptCommandLineParser || !arg.StartsWith('-') && !arg.StartsWith('@'));
CommandLine\CommandLineReference.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(reference));
CommandLine\CommandLineResource.cs (2)
40Debug.Assert(!resourceName.IsEmpty()); 41Debug.Assert(PathUtilities.IsAbsolute(fullPath));
CommandLine\CommandLineSourceFile.cs (1)
21Debug.Assert(!string.IsNullOrEmpty(path));
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (1)
51Debug.Assert(_streamToDispose == null);
CommandLine\CommonCompiler.cs (20)
130Debug.Assert(null == responseFile || PathUtilities.IsAbsolute(responseFile)); 313Debug.Assert(normalizedPath is object); 423Debug.Assert(compilation.Options.SourceReferenceResolver is object); 462Debug.Assert(text != null); 467Debug.Assert(text != null || diagnostics.HasAnyErrors()); 717Debug.Assert(Arguments.ErrorLogOptions?.Path != null); 729Debug.Assert(diagnostics.HasAnyErrors()); 819Debug.Assert(generatedFilesBaseDirectory is not null); 852Debug.Assert(!string.IsNullOrWhiteSpace(Arguments.OutputFileName)); 878Debug.Assert(!Arguments.IsScriptRunner); 928Debug.Assert(hadErrors); 1045Debug.Assert(existing.GetOptions(syntaxTree) == DictionaryAnalyzerConfigOptions.Empty); 1060Debug.Assert(existing.GetOptions(additionalFiles[i]) == DictionaryAnalyzerConfigOptions.Empty); 1079Debug.Assert(analyzerConfigSet is object); 1174Debug.Assert(!string.IsNullOrWhiteSpace(tree.FilePath)); 1190Debug.Assert(path.StartsWith(explicitGeneratedOutDir!)); 1199Debug.Assert(tree.Encoding is object); 1576Debug.Assert(touchedFilesLogger != null); 1611Debug.Assert(filePath != null); 1627Debug.Assert(PathUtilities.IsAbsolute(file.Path));
CommandLine\CommonCompiler.ExistingReferencesResolver.cs (2)
30Debug.Assert(resolver != null); 31Debug.Assert(availableReferences != null);
CommandLine\CommonCompiler.LoggingMetadataFileReferenceResolver.cs (2)
21Debug.Assert(pathResolver != null); 22Debug.Assert(provider != null);
CommandLine\CommonCompiler.SuppressionDiagnostic.cs (4)
37Debug.Assert(originalDiagnostic != null); 38Debug.Assert(originalDiagnostic.ProgrammaticSuppressionInfo != null); 39Debug.Assert(!string.IsNullOrEmpty(suppressionId)); 40Debug.Assert(suppressionJustification != null);
CommandLine\Feature.cs (1)
43Debug.Assert(flags.Contains(s), $"Unknown feature flag: {s}");
CommandLine\ReportAnalyzerUtil.cs (1)
68Debug.Assert(analyzerDriver.AnalyzerExecutionTimes != null);
CommandLine\SarifErrorLogger.cs (8)
29Debug.Assert(stream != null); 30Debug.Assert(stream!.Position == 0); 78Debug.Assert(false); 88Debug.Assert(diagnostic.CustomTags.SequenceEqual(diagnostic.Descriptor.ImmutableCustomTags)); 89Debug.Assert(diagnostic.Category == diagnostic.Descriptor.Category); 90Debug.Assert(diagnostic.DefaultSeverity == diagnostic.Descriptor.DefaultSeverity); 91Debug.Assert(diagnostic.IsEnabledByDefault == diagnostic.Descriptor.IsEnabledByDefault); 127Debug.Assert(!string.IsNullOrEmpty(path));
CommandLine\SarifV1ErrorLogger.cs (4)
138Debug.Assert(HasPath(location)); 286Debug.Assert(Count > 0); 292Debug.Assert(list.Capacity > list.Count); 296Debug.Assert(list.Capacity == list.Count);
CommandLine\SarifV2ErrorLogger.cs (7)
172Debug.Assert(HasPath(diagnosticLocation)); 276Debug.Assert(reportAnalyzerExecutionTime || descriptorInfo.ExecutionTime == 0); 277Debug.Assert(reportAnalyzerExecutionTime || descriptorInfo.ExecutionPercentage == 0); 387Debug.Assert(!severities.IsEmpty); 498Debug.Assert(Count > 0); 504Debug.Assert(list.Capacity > list.Count); 508Debug.Assert(list.Capacity == list.Count);
Compilation\ClosedDerivedTypeInfo.cs (1)
28Debug.Assert(!closedDerivedTypes.IsDefault);
Compilation\CommonModuleCompilationState.cs (5)
19Debug.Assert(!_frozen); 44Debug.Assert(!Frozen); 45Debug.Assert(method.PartialImplementationPart is null); 60Debug.Assert(Frozen); 61Debug.Assert(method.PartialImplementationPart is null);
Compilation\Compilation.cs (23)
704Debug.Assert(reference is UnresolvedMetadataReference || reference is CompilationReference); 1097Debug.Assert(tree.Options.Kind != SourceCodeKind.Script); 1236Debug.Assert(result 1267Debug.Assert(result 2536Debug.Assert(!string.IsNullOrEmpty(text.FilePath)); 2654Debug.Assert(IsSubmission); 2685Debug.Assert(this.CommonAnonymousTypeManager.AreTemplatesSealed); 2967Debug.Assert(!embedPdb || pdbStream == null); 2968Debug.Assert(metadataPEStream == null || !options.IncludePrivateMembers); // you may not use a secondary stream and include private members together 3273Debug.Assert(moduleBeingBuilt.DebugInformationFormat != DebugInformationFormat.Embedded || pdbStreamProvider == null); 3307Debug.Assert(!deterministic || moduleBeingBuilt.PdbChecksumAlgorithm.Name != null); 3342Debug.Assert(nativePdbStream != null || metadataDiagnostics.HasAnyErrors()); 3400Debug.Assert(auxStream != null || metadataDiagnostics.HasAnyErrors()); 3442Debug.Assert(!metadataOnly); 3443Debug.Assert(!includePrivateMembers); 3475Debug.Assert(previousGeneration != null); 3476Debug.Assert(previousGeneration.Compilation != this); 3486Debug.Assert(previousGeneration.Compilation != null); 3487Debug.Assert(previousGeneration.PEModuleBuilder != null); 3488Debug.Assert(moduleBeingBuilt.EncSymbolChanges != null); 3718Debug.Assert(this.ContainsSyntaxTree(tree1)); 3719Debug.Assert(this.ContainsSyntaxTree(tree2)); 3954Debug.Assert(!found); // only one required language version in a given diagnostic
Compilation\DeterministicKeyBuilder.cs (3)
136Debug.Assert(!syntaxTrees.IsDefault); 137Debug.Assert(!references.IsDefault); 138Debug.Assert(!publicKey.IsDefault);
Compilation\IImportScope.cs (5)
132Debug.Assert(!aliases.IsDefault); 133Debug.Assert(!externAliases.IsDefault); 134Debug.Assert(!imports.IsDefault); 135Debug.Assert(!xmlNamespaces.IsDefault); 136Debug.Assert(aliases.Length + externAliases.Length + imports.Length + xmlNamespaces.Length > 0);
Compilation\SymbolInfo.cs (2)
70Debug.Assert(symbol is null || symbol.Kind != SymbolKind.Namespace || ((INamespaceSymbol)symbol).NamespaceKind != NamespaceKindNamespaceGroup); 73Debug.Assert(item.Kind != SymbolKind.Namespace || ((INamespaceSymbol)item).NamespaceKind != NamespaceKindNamespaceGroup);
Compilation\TypeInfo.cs (2)
43Debug.Assert(type is null || type.NullableAnnotation == nullability.FlowState.ToAnnotation()); 44Debug.Assert(convertedType is null || convertedType.NullableAnnotation == convertedNullability.FlowState.ToAnnotation());
ConstantValue.cs (2)
358Debug.Assert(discriminator != ConstantValueTypeDiscriminator.Bad); 402Debug.Assert(discriminator != ConstantValueTypeDiscriminator.Bad);
ConstantValueSpecialized.cs (1)
187Debug.Assert(constantValue != null);
CryptographicHashProvider.cs (1)
276Debug.Assert(bits.Length == 4);
CvtRes.cs (13)
549System.Diagnostics.Debug.Assert(resStream.Position - startPos == dataSize + headerSize); 710Debug.Assert((startPos & 3) == 0); 718Debug.Assert((writer.BaseStream.Position & 3) == 0); 723System.Diagnostics.Debug.Assert(cbBlock == writer.BaseStream.Position - startPos); 812System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 819System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 825System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 828System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 835System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 841System.Diagnostics.Debug.Assert((writer.BaseStream.Position & 3) == 0); 843System.Diagnostics.Debug.Assert(writer.BaseStream.Position - debugPos == dataSize - GetStringsSize()); 853System.Diagnostics.Debug.Assert(entry.Value != null); 857System.Diagnostics.Debug.Assert(writer.BaseStream.Position - debugPos == GetStringsSize());
Desktop\DesktopAssemblyIdentityComparer.Fx.cs (1)
164Debug.Assert(value.VersionHigh == default(AssemblyVersion));
Diagnostic\DiagnosticBag.cs (2)
210Debug.Assert(diagnostic.Severity != InternalDiagnosticSeverity.Unknown); //Info access should have forced resolution. 257Debug.Assert(diagnostic.Severity != InternalDiagnosticSeverity.Unknown); //Info access should have forced resolution.
Diagnostic\DiagnosticDescriptor.cs (2)
73Debug.Assert(CustomTags is ImmutableArray<string>); 162Debug.Assert(!customTags.IsDefault);
Diagnostic\DiagnosticInfo.cs (5)
146Debug.Assert(expectedLength == actualLength, $"Expected {expectedLength} arguments for error code {errorCode}, but got {actualLength}. Message: {message}"); 147Debug.Assert(bits == BitVector.AllSet(actualLength)); 155Debug.Assert(!isWarningAsError || _defaultSeverity == DiagnosticSeverity.Warning); 170Debug.Assert(this.GetType() == result.GetType()); 171Debug.Assert(severity == result.Severity);
Diagnostic\DiagnosticWithInfo.cs (1)
145Debug.Assert(HasLazyInfo);
Diagnostic\SourceLocation.cs (4)
39Debug.Assert(nodeOrToken.SyntaxTree is object); 45Debug.Assert(trivia.SyntaxTree is object); 87Debug.Assert(!result.IsValid); 101Debug.Assert(!result.IsValid);
Diagnostic\SuppressionInfo.cs (1)
36Debug.Assert(programmaticSuppressions.All(suppression => id == suppression.SuppressedDiagnostic.Id));
Diagnostic\XmlLocation.cs (1)
39Debug.Assert(xmlLineInfo.LinePosition != 0);
DiagnosticAnalyzer\AnalysisContextInfo.cs (2)
64Debug.Assert(node == null || file?.SourceTree != null); 65Debug.Assert(operation == null || file?.SourceTree != null);
DiagnosticAnalyzer\AnalysisResultBuilder.cs (4)
97Debug.Assert(_analyzerExecutionTimeOpt != null); 257Debug.Assert(!analysisScope.FilterSpanOpt.HasValue); 412Debug.Assert(getLocalDiagnostics || getNonLocalDiagnostics); 488Debug.Assert(diagnostics != null);
DiagnosticAnalyzer\AnalysisScope.cs (5)
141Debug.Assert(!isSyntacticSingleFileAnalysis || filterFile.HasValue); 159Debug.Assert(!filterSpan.HasValue || filterFile.HasValue); 163Debug.Assert(filterFile.HasValue); 184Debug.Assert(_lazyAnalyzersSet.Value.Contains(analyzer)); 202Debug.Assert(compilationWithAnalyzers.Analyzers.Contains(analyzer));
DiagnosticAnalyzer\AnalysisValueProvider.cs (1)
55Debug.Assert(value is object);
DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
194Debug.Assert(GeneratedPathComparer.Equals(_originalPathInfoMap[originalPath].ResolvedPath, resolvedPath));
DiagnosticAnalyzer\AnalyzerDriver.cs (60)
78Debug.Assert(_lazyAnalyzerExecutor != null); 88Debug.Assert(_lazyCurrentCompilationData != null); 106Debug.Assert(_lazyUnsuppressedAnalyzers != null); 123Debug.Assert(_lazyPerSymbolAnalyzerActionsCache != null); 142Debug.Assert(_lazyCompilationEndAnalyzers != null); 164Debug.Assert(_lazyAnalyzerGateMap != null); 178Debug.Assert(!_lazyGeneratedCodeAnalysisFlagsMap.IsDefault); 198Debug.Assert(_lazyNonConfigurableAndCustomConfigurableAnalyzers != null); 212Debug.Assert(_lazySymbolStartAnalyzers != null); 226Debug.Assert(_lazyTreatAllCodeAsNonGeneratedCode.HasValue); 245Debug.Assert(_lazyGeneratedCodeFilesMap != null); 259Debug.Assert(_lazyGeneratedCodeSymbolsForTreeMap != null); 273Debug.Assert(_lazySuppressedAnalyzersForTreeMap != null); 289Debug.Assert(_lazySuppressedDiagnosticIdsForUnsuppressedAnalyzers != null); 303Debug.Assert(_lazyIsGeneratedCodeSymbolMap != null); 348Debug.Assert(_lazyCompilationEventQueue != null); 362Debug.Assert(_lazyDiagnosticQueue != null); 376Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Suppress)); 377Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Default)); 404Debug.Assert(_lazyInitializeTask == null); 473Debug.Assert(_lazyInitializeTask == null); 474Debug.Assert(compilation.SemanticModelProvider != null); 706Debug.Assert(analysisScope != null); 728Debug.Assert(faultedTask.IsFaulted); 993Debug.Assert(severity != ReportDiagnostic.Default); 1017Debug.Assert(compilation.ContainsSyntaxTree(tree)); 1024Debug.Assert(!reportedDiagnostics.IsEmptyWithoutResolution); 1048Debug.Assert(HasDiagnosticSuppressors); 1049Debug.Assert(!reportedDiagnostics.IsEmpty); 1050Debug.Assert(_programmaticSuppressions != null); 1051Debug.Assert(_diagnosticsProcessedForProgrammaticSuppressions != null); 1081Debug.Assert(suppressableDiagnostics.Contains(diagnostic)); 1082Debug.Assert(!diagnostic.IsSuppressed); 1084Debug.Assert(suppressedDiagnostic.IsSuppressed); 1262Debug.Assert(location.SourceTree != null); 1282Debug.Assert(declaredSymbols != null); 1299Debug.Assert(GeneratedCodeSymbolsForTreeMap != null); 1300Debug.Assert(_lazyGeneratedCodeAttribute != null); 1322Debug.Assert(existingGeneratedCodeSymbols.SetEquals(generatedCodeSymbols)); 1443Debug.Assert(_lazyInitializeTask != null); 1455Debug.Assert(_lazyPrimaryTask != null); 1618Debug.Assert(CompilationEventQueue.IsCompleted, "TryDequeueAsync should provide a value unless the AsyncQueue<T> is completed."); 1794Debug.Assert(!subsetProcessedAnalyzers.IsDefault); 1832Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0); 1883Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length); 1964Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent); 2171Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0); 2172Debug.Assert(SymbolStartAnalyzers.Contains(analyzer)); 2262Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)); 2287Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)); 2352Debug.Assert(_lazyDoNotAnalyzeGeneratedCode.HasValue); 2621Debug.Assert(shouldExecuteSyntaxNodeActions || shouldExecuteOperationActions || shouldExecuteCodeBlockActions || shouldExecuteOperationBlockActions); 2622Debug.Assert(!isInGeneratedCode || !DoNotAnalyzeGeneratedCode); 3032Debug.Assert(!operationBlock.Parent.IsImplicit); 3039Debug.Assert(operationBlock.Kind is OperationKind.Invocation or OperationKind.Invalid); 3040Debug.Assert(operationBlock.Parent.IsImplicit); 3041Debug.Assert(operationBlock.Parent.Parent is IConstructorBodyOperation ctorBody && 3043Debug.Assert(!operationBlock.Parent.Parent.IsImplicit); 3050Debug.Fail($"Expected operation with kind '{operationBlock.Kind}' to be the root operation with null 'Parent', but instead it has a non-null Parent with kind '{operationBlock.Parent.Kind}'"); 3061Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActions.cs (3)
48Debug.Assert(isEmpty || !GroupedActionsByAnalyzer.IsEmpty); 68Debug.Assert(!analyzers.IsDefaultOrEmpty); 85Debug.Assert(intersected.IsEmpty());
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActionsForAnalyzer.cs (2)
30Debug.Assert(!analyzerActions.IsEmpty); 45Debug.Assert(action.Analyzer == analyzer);
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (3)
108Debug.Assert(_addNonCategorizedDiagnostic != null); 113Debug.Assert(_addNonCategorizedDiagnostic == null); 114Debug.Assert(_addCategorizedNonLocalDiagnostic != null);
DiagnosticAnalyzer\AnalyzerExecutor.cs (40)
136Debug.Assert((addNonCategorizedDiagnostic != null) ^ (addCategorizedLocalDiagnostic != null)); 137Debug.Assert((addCategorizedLocalDiagnostic != null) == (addCategorizedNonLocalDiagnostic != null)); 233Debug.Assert(_analyzerExecutionTimeMap != null); 339Debug.Assert(startAction.Analyzer == symbolScope.Analyzer); 362Debug.Assert(_addSuppression != null); 403Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent); 450Debug.Assert(getTopMostNodeForAnalysis != null); 451Debug.Assert(!filterSpan.HasValue || filterTree != null); 573Debug.Assert(getTopMostNodeForAnalysis != null); 574Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer)); 575Debug.Assert(!IsAnalyzerSuppressedForSymbol(analyzer, symbolDeclaredEvent.Symbol, cancellationToken)); 576Debug.Assert(!filterSpan.HasValue || filterTree != null); 687Debug.Assert(file.SourceTree != null); 743Debug.Assert(file.AdditionalFile != null); 787Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(syntaxNodeAction.Analyzer)); 788Debug.Assert(!IsAnalyzerSuppressedForTree(syntaxNodeAction.Analyzer, node.SyntaxTree, cancellationToken)); 811Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(operationAction.Analyzer)); 812Debug.Assert(!IsAnalyzerSuppressedForTree(operationAction.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken)); 861Debug.Assert(!executableCodeBlocks.IsEmpty); 975Debug.Assert(!operationBlocks.IsEmpty); 1056Debug.Assert(declaredNode != null); 1057Debug.Assert(executionData.DeclaredSymbol != null); 1058Debug.Assert(CanHaveExecutableCodeBlock(executionData.DeclaredSymbol)); 1059Debug.Assert(startActions.Any() || endActions.Any() || actions.Any()); 1181Debug.Assert(nodeActionsByKind.Any()); 1182Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(executionData.Analyzer)); 1183Debug.Assert(!IsAnalyzerSuppressedForTree(executionData.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken)); 1284Debug.Assert(operationActionsByKind != null); 1285Debug.Assert(operationActionsByKind.Any()); 1286Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(executionData.Analyzer)); 1287Debug.Assert(!IsAnalyzerSuppressedForTree(executionData.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken)); 1327Debug.Assert(((IFieldSymbol)symbol).AssociatedSymbol == null); 1386Debug.Assert(false); 1538Debug.Assert(IsAnalyzerExceptionDiagnostic(exceptionDiagnostic)); 1576Debug.Assert(_addNonCategorizedDiagnostic != null); 1581Debug.Assert(_addNonCategorizedDiagnostic == null); 1582Debug.Assert(_addCategorizedNonLocalDiagnostic != null); 1618Debug.Assert(_addNonCategorizedDiagnostic != null); 1690Debug.Assert(_analyzerExecutionTimeMap != null); 1701Debug.Assert(operation.Parent == null);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
610Debug.Assert(type != null);
DiagnosticAnalyzer\AnalyzerManager.AnalyzerExecutionContext.cs (6)
120Debug.Assert(sessionScope.Analyzer == _analyzer); 416Debug.Assert(pendingMemberSymbols != null); 434Debug.Assert(!symbolEndActions.IsEmpty); 439Debug.Assert(_lazyPendingMemberSymbolsMap != null); 482Debug.Assert(_lazyPendingMemberSymbolsMap == null || _lazyPendingMemberSymbolsMap.Count == 0); 483Debug.Assert(_lazyPendingSymbolEndActionsMap == null || _lazyPendingSymbolEndActionsMap.Count == 0);
DiagnosticAnalyzer\AsyncQueue.cs (6)
98Debug.Assert(_data.Count == 0); 102Debug.Assert(waiter.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously)); 197Debug.Assert(this.Count == 0, "we should not be cancelling the waiters when we have items in the queue"); 200Debug.Assert(tcs.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously)); 205Debug.Assert(_whenCompleted.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously)); 316Debug.Assert(taskCompletionSource.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously));
DiagnosticAnalyzer\CompilationUnitCompletedEvent.cs (1)
16Debug.Assert(compilation.ContainsSyntaxTree(compilationUnit));
DiagnosticAnalyzer\CompilationWithAnalyzers.cs (12)
704Debug.Assert(analysisScope != null); 727Debug.Assert(driver.IsInitialized); 728Debug.Assert(!driver.WhenInitializedTask.IsCanceled); 775Debug.Assert(!analysisScope.IsSyntacticSingleFileAnalysis); 776Debug.Assert(hasAnyActionsRequiringCompilationEvents); 779Debug.Assert(!symbolStartAnalyzers.IsEmpty); 838Debug.Assert(driver.IsInitialized); 960Debug.Assert(compilationEvents.Count(e => e is CompilationUnitCompletedEvent c && !c.FilterSpan.HasValue) == 1); 963Debug.Assert(!compilationEvents.HasDuplicates()); 996Debug.Assert(analysisScope.IsSingleFileAnalysis); 1047Debug.Assert(analysisScope.IsSingleFileAnalysis); 1048Debug.Assert(!analysisScope.IsSyntacticSingleFileAnalysis);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (2)
838Debug.Assert(!filterSpan.HasValue || filterTree != null); 918Debug.Assert(!filterSpan.HasValue || filterTree != null);
DiagnosticAnalyzer\DiagnosticAnalysisContextHelpers.cs (1)
95Debug.Assert(location.SourceTree != null);
DiagnosticAnalyzer\DiagnosticQueue.cs (2)
111Debug.Assert(diagnostic.Location.Kind == LocationKind.SourceFile || diagnostic.Location.Kind == LocationKind.ExternalFile); 176Debug.Assert(diag != null);
DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (2)
43Debug.Assert(IsAnalyzerPathHandled(originalAnalyzerPath)); 49Debug.Assert(IsAnalyzerPathHandled(originalAnalyzerPath));
DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (2)
370Debug.Assert(AnalyzerAssemblyLoader.GeneratedPathComparer.Equals(shadowCopyPath, task.Result)); 452Debug.Assert(bytesWritten == hash.Length);
DiagnosticAnalyzer\Suppression.cs (1)
21Debug.Assert(suppressedDiagnostic.ProgrammaticSuppressionInfo == null);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (6)
58Debug.Assert(_lazyResolvedSuppressionsById.IsEmpty); 75Debug.Assert(symbol != null); 80Debug.Assert(symbol.IsDefinition); 116Debug.Assert(target.IsDefinition); 194Debug.Assert(declaredSymbols != null); 342Debug.Assert(symbol is IAssemblySymbol || symbol is IModuleSymbol);
DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
308Debug.Assert(PeekNextChar() is '(' or '['); 495Debug.Assert(PeekNextChar() == '!'); 542Debug.Assert(bindingContext != null); 657Debug.Assert(PeekNextChar() == '<'); 698Debug.Assert(PeekNextChar() == '['); 884Debug.Assert(type != null); 890Debug.Assert(startIndex >= 0);
DiaSymReader\Metadata\SymWriterMetadataAdapter.cs (7)
23Debug.Assert(metadataProvider != null); 43Debug.Assert(baseType == null); 96Debug.Assert(attributes == null); 97Debug.Assert(signature == null); 98Debug.Assert(signatureLength == null); 99Debug.Assert(relativeVirtualAddress == null); 100Debug.Assert(implAttributes == null);
DiaSymReader\SymUnmanagedFactory.cs (1)
158System.Diagnostics.Debug.Assert(OperatingSystem.IsWindows());
DiaSymReader\Utilities\InteropUtilities.cs (2)
36Debug.Assert(nameStr != null); 85Debug.Assert(dst <= dstEndPtr);
DiaSymReader\Writer\SymUnmanagedWriterFactory.cs (1)
50Debug.Assert(loadException != null);
DiaSymReader\Writer\SymUnmanagedWriterImpl.cs (5)
34Debug.Assert(pdbStream != null); 35Debug.Assert(symWriter != null); 36Debug.Assert(symWriterModuleName != null); 366Debug.Assert(OperatingSystem.IsWindows()); 377Debug.Assert(value != null);
DocumentationCommentId.cs (4)
686Debug.Assert(symbol.ContainingSymbol is null or INamedTypeSymbol or IMethodSymbol); 689Debug.Assert(!declarer.Failed); 1005System.Diagnostics.Debug.Assert(PeekNextChar(id, index) == '`'); 1520System.Diagnostics.Debug.Assert(typeParameterContext != null);
DocumentationComments\XmlDocumentationCommentTextReader.XmlStream.cs (2)
135Debug.Assert(charCount > 0); 140Debug.Assert(destCount >= 0);
EmbeddedText.cs (4)
54Debug.Assert(filePath.Length > 0); 55Debug.Assert(SourceHashAlgorithms.IsSupportedAlgorithm(checksumAlgorithm)); 56Debug.Assert(!blob.IsDefault && blob.Length >= sizeof(int)); 218Debug.Assert(longLength >= 0);
Emit\AnonymousTypeKey.cs (1)
35Debug.Assert(name != null);
Emit\AnonymousTypeValue.cs (2)
18Debug.Assert(!string.IsNullOrEmpty(name)); 19Debug.Assert(uniqueIndex >= 0);
Emit\AsyncMoveNextBodyDebugInfo.cs (3)
40Debug.Assert(!yieldOffsets.IsDefault); 41Debug.Assert(!resumeOffsets.IsDefault); 42Debug.Assert(yieldOffsets.Length == resumeOffsets.Length);
Emit\CommonPEModuleBuilder.cs (32)
64Debug.Assert(manifestResources != null); 65Debug.Assert(serializationProperties != null); 66Debug.Assert(compilation != null); 132Debug.Assert(_encDeletedMemberDefinitions == null); 143Debug.Assert(_encDeletedMemberDefinitions != null); 393Debug.Assert(ReferenceEquals(context.Module, this)); 415Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); 416Debug.Assert(methodSymbol.IsDefinition); 417Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. 432Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); 433Debug.Assert(methodSymbol.IsDefinition); 434Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. 435Debug.Assert(body == null || (object)methodSymbol == body.MethodDefinition.GetInternalSymbol()); 442Debug.Assert(method == null || IsSourceDefinition(method)); 443Debug.Assert(OutputKind.IsApplication()); 450Debug.Assert(method == null || IsSourceDefinition(method)); 623Debug.Assert(value != null); 630Debug.Assert(TestData == null); 693Debug.Assert(sourceModule != null); 694Debug.Assert(serializationProperties != null); 757Debug.Assert(names != null); 787Debug.Assert(_namesOfTopLevelTypes == null); 864Debug.Assert(((ISynthesizedGlobalMethodSymbol)cctor.GetInternalSymbol()).ContainingPrivateImplementationDetailsType == (object)details); 892Debug.Assert(NestedTypes is null || 984Debug.Assert(container.IsDefinition); 990Debug.Assert(method != null); 1003Debug.Assert(property != null); 1016Debug.Assert(field != null); 1029Debug.Assert(nestedType != null); 1037Debug.Assert(typeOrNamespace != null); 1177Debug.Assert(_lazyPrivateImplementationDetails?.IsFrozen != false); 1187Debug.Assert((object)this == context.Module);
Emit\Context.cs (5)
39Debug.Assert(rebuildData is null || !metadataOnly); 41Debug.Assert(module != null); 42Debug.Assert(diagnostics != null); 43Debug.Assert(includePrivateMembers || metadataOnly); 44Debug.Assert(syntaxNode is null || syntaxReference is null);
Emit\EditAndContinue\AddedOrChangedMethodInfo.cs (5)
41Debug.Assert(methodId.Generation >= 0); 44Debug.Assert(stateMachineAwaiterSlotsOpt.IsDefault == stateMachineTypeName is null); 47Debug.Assert(stateMachineHoistedLocalSlotsOpt.IsDefault || stateMachineTypeName is not null); 74Debug.Assert(!info.IsDefault); 77Debug.Assert(info.Signature != null);
Emit\EditAndContinue\DefinitionMap.cs (16)
54Debug.Assert(edits != null); 89Debug.Assert(edit.NewSymbol != null); 90Debug.Assert(edit.OldSymbol != null); 95Debug.Assert(oldMethod != null); 96Debug.Assert(newMethod != null); 187Debug.Assert(peMethod != null); 188Debug.Assert(peMethod.MetadataName == oldProperty.MetadataName); 213Debug.Assert(peProperty != null); 214Debug.Assert(peProperty.MetadataName == oldProperty.MetadataName); 239Debug.Assert(peEvent != null); 240Debug.Assert(peEvent.MetadataName == oldEvent.MetadataName); 648Debug.Assert(!containingDisplayClassId.HasValue); 662Debug.Assert(hasDebugIds); 672Debug.Assert(containingDisplayClassId.HasValue); 682Debug.Assert(hasDebugIds); 746Debug.Assert(peMethod != null);
Emit\EditAndContinue\DeletedPEMethodDefinition.cs (1)
24Debug.Assert(oldMethod.MetadataToken != 0);
Emit\EditAndContinue\DeltaMetadataWriter.cs (33)
87Debug.Assert(previousGeneration != null); 88Debug.Assert(encId != default); 89Debug.Assert(encId != previousGeneration.EncId); 90Debug.Assert(context.Module.DebugInformationFormat != DebugInformationFormat.Embedded); 91Debug.Assert(context.Module.EncSymbolChanges != null); 145Debug.Assert(changes != null); 212Debug.Assert(module.EncSymbolChanges is not null); 795Debug.Assert(!methodDef.IsEncDeleted); 856Debug.Assert(ok); 878Debug.Assert(def is INestedTypeDefinition or IPropertyDefinition or IEventDefinition); 1041Debug.Assert(xOrdinal == int.MaxValue && yOrdinal == int.MaxValue); 1054Debug.Assert(xOrdinal == int.MaxValue && yOrdinal == int.MaxValue); 1069Debug.Assert(CustomAttributeRowIds.IsSorted()); 1081Debug.Assert(CustomAttributeRowIds.IsSorted()); 1135Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0); 1136Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncMap] == 0); 1371Debug.Assert(tokens.IsSorted(HandleComparer.Default)); 1390Debug.Assert(debugTokens.Distinct().Count() == debugTokens.Count); 1446Debug.Assert(rowCounts[i] == 0); 1576Debug.Assert(prev < next); 1626Debug.Assert(!_map.TryGetValue(index, out var other) || ((object)other == (object)item) || other is DeletedSourceTypeDefinition || item is DeletedSourceTypeDefinition); 1641Debug.Assert(!this.IsFrozen); 1655Debug.Assert(!this.IsFrozen); 1707Debug.Assert(index > 0); 1800Debug.Assert(!this.IsFrozen); 1838Debug.Assert(!this.IsFrozen); 1874Debug.Assert(!this.IsFrozen); 1906Debug.Assert(this.ShouldVisit(eventDefinition)); 1912Debug.Assert(this.ShouldVisit(fieldDefinition)); 1926Debug.Assert(this.ShouldVisit(method)); 1945Debug.Assert(this.ShouldVisit(namespaceTypeDefinition)); 1951Debug.Assert(this.ShouldVisit(nestedTypeDefinition)); 1957Debug.Assert(this.ShouldVisit(propertyDefinition));
Emit\EditAndContinue\EmitBaseline.cs (30)
33Debug.Assert(implementingMethod > 0); 34Debug.Assert(index > 0); 323Debug.Assert(module != null); 324Debug.Assert(ordinal is 0 == (encId == default)); 325Debug.Assert(ordinal is 0 == initialBaseline is null); 326Debug.Assert(synthesizedTypes.IsEmpty || ordinal > 0); 327Debug.Assert(encId != module.GetModuleVersionId()); 328Debug.Assert(debugInformationProvider != null); 329Debug.Assert(localSignatureProvider != null); 330Debug.Assert(typeToEventMap != null); 331Debug.Assert(typeToPropertyMap != null); 332Debug.Assert(moduleVersionId != default); 333Debug.Assert(moduleVersionId == module.GetModuleVersionId()); 334Debug.Assert(synthesizedMembers != null); 335Debug.Assert(deletedMembers != null); 337Debug.Assert(tableEntriesAdded.Length == MetadataTokens.TableCount); 343Debug.Assert(tableEntriesAdded[(int)TableIndex.TypeDef] >= typesAdded.Count); 344Debug.Assert(tableEntriesAdded[(int)TableIndex.Event] >= eventsAdded.Count); 345Debug.Assert(tableEntriesAdded[(int)TableIndex.Field] >= fieldsAdded.Count); 346Debug.Assert(tableEntriesAdded[(int)TableIndex.MethodDef] >= methodsAdded.Count); 347Debug.Assert(tableEntriesAdded[(int)TableIndex.Property] >= propertiesAdded.Count); 348Debug.Assert(tableEntriesAdded[(int)TableIndex.EventMap] >= eventMapAdded.Count); 349Debug.Assert(tableEntriesAdded[(int)TableIndex.PropertyMap] >= propertyMapAdded.Count); 419Debug.Assert(synthesizedTypes.AnonymousTypes.Count >= _synthesizedTypes.AnonymousTypes.Count); 420Debug.Assert(synthesizedTypes.AnonymousDelegates.Count >= _synthesizedTypes.AnonymousDelegates.Count); 421Debug.Assert(synthesizedTypes.AnonymousDelegatesWithIndexedNames.Count >= _synthesizedTypes.AnonymousDelegatesWithIndexedNames.Count); 422Debug.Assert(customAttributesAdded.All(entry => !entry.Value.IsDefaultOrEmpty && entry.Value.IsSorted())); 469Debug.Assert(LazyMetadataSymbols is object); 508Debug.Assert(!parentType.IsNil); 523Debug.Assert(!parentType.IsNil);
Emit\EditAndContinue\EncHoistedLocalMetadata.cs (3)
17Debug.Assert(name != null); 18Debug.Assert(type != null); 19Debug.Assert(synthesizedKind.IsLongLived());
Emit\EditAndContinue\EncLocalInfo.cs (2)
23Debug.Assert(signature.Length > 0); 57Debug.Assert(Type != null);
Emit\EditAndContinue\EncVariableSlotAllocator.cs (3)
64Debug.Assert(!previousLocals.IsDefault); 87Debug.Assert(!localInfo.IsDefault); 333Debug.Assert(closureOrdinal >= LambdaDebugInfo.MinClosureOrdinal);
Emit\EditAndContinue\SymbolChanges.cs (8)
325Debug.Assert(symbol != null); 327Debug.Assert(result != null); 382Debug.Assert(edit.OldSymbol is IMethodSymbol or IPropertySymbol or IEventSymbol); 397Debug.Assert(!deletedMembersPerType.Contains(oldSymbol)); 423Debug.Assert(newMethod.PartialImplementationPart == null); 424Debug.Assert(edit.OldSymbol == null || ((IMethodSymbol)edit.OldSymbol).PartialImplementationPart == null); 446Debug.Assert(newProperty.PartialImplementationPart == null); 447Debug.Assert(edit.OldSymbol == null || ((IPropertySymbol)edit.OldSymbol).PartialImplementationPart == null);
Emit\EditAndContinue\SymbolMatcher.cs (2)
166Debug.Assert(template is not null); 259Debug.Assert(isDeletedMemberMapping || newSynthesizedMembers.Contains(mappedMember));
Emit\EditAndContinueMethodDebugInformation.cs (6)
34Debug.Assert(methodOrdinal >= -1); 165Debug.Assert(kind <= SynthesizedLocalKind.MaxValidValueForLocalVariableSerializedToDebugInformation); 174Debug.Assert((b & (1 << 7)) == 0); 263Debug.Assert(MethodOrdinal >= -1); 296Debug.Assert(info.ClosureOrdinal >= LambdaDebugInfo.MinClosureOrdinal); 297Debug.Assert(info.LambdaId.Generation == 0);
Emit\NoPia\CommonEmbeddedEvent.cs (3)
48Debug.Assert(adder != null || remover != null); 86Debug.Assert(!isUsedForComAwareEventBinding || _isUsedForComAwareEventBinding != 0); 91Debug.Assert(!isUsedForComAwareEventBinding || _isUsedForComAwareEventBinding != 0);
Emit\NoPia\CommonEmbeddedProperty.cs (1)
47Debug.Assert(getter != null || setter != null);
Emit\NoPia\CommonEmbeddedType.cs (5)
232Debug.Assert(_lazyAssemblyRefIndex >= 0); 255Debug.Assert(TypeManager.IsFrozen); 284Debug.Assert(TypeManager.IsFrozen); 453Debug.Assert(TypeManager.IsFrozen); 503Debug.Assert(TypeManager.IsFrozen);
Emit\NoPia\EmbeddedTypesManager.cs (1)
114Debug.Assert(_frozen[i - 1] == prev);
Emit\StateMachineMoveNextDebugInfo.cs (1)
23Debug.Assert(kickoffMethod != null);
EnumConstantHelper.cs (4)
22Debug.Assert(!constantValue.IsBad); 23Debug.Assert(offset > 0); 119Debug.Assert(maxOffset >= previous); 125Debug.Assert(maxOffset >= previous);
ExtendedSpecialType.cs (2)
21Debug.Assert(value >= sbyte.MinValue && value <= sbyte.MaxValue); 72Debug.Assert(InternalSpecialType.First == InternalSpecialType.System_ReadOnlySpan_T);
FileKey.cs (2)
30Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 31Debug.Assert(timestamp.Kind == DateTimeKind.Utc);
FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
InternalUtilities\BlobBuildingStream.cs (1)
100Debug.Assert(disposing);
InternalUtilities\ConcurrentLruCache.cs (1)
102Debug.Assert(_capacity > 0);
InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
InternalUtilities\FileLockCheck.cs (1)
199Debug.Assert(rgAffectedApps != null);
InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
InternalUtilities\JsonWriter.cs (2)
219Debug.Assert(_pending == Pending.NewLineAndIndent || _pending == Pending.CommaNewLineAndIndent); 302Debug.Assert(ShouldAppendAsUnicode(c));
InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
InternalUtilities\ThreeState.cs (1)
33Debug.Assert(value != ThreeState.Unknown);
InternalUtilities\WeakList.cs (6)
27Debug.Assert(_size == _items.Length); 28Debug.Assert(_items.Length == 0 || _items.Length >= MinimalNonEmptySize); 64Debug.Assert(_size == _items.Length); 76Debug.Assert(_items.Length > 0 && _size < 3 * _items.Length / 4, "length: " + _items.Length + " size: " + _size); 100Debug.Assert(_items[firstDead].IsNull()); 157Debug.Assert(_size < _items.Length);
InternalUtilities\XmlUtilities.cs (3)
34Debug.Assert(copy != node); 35Debug.Assert(copy.Parent == null); // Otherwise, when we give it one, it will be copied. 52Debug.Assert(sourceAttributes.Current.Name == targetAttributes.Current.Name);
MemberDescriptor.cs (2)
56Debug.Assert(_declaringTypeId < (int)InternalSpecialType.NextAvailable); 65Debug.Assert(_declaringTypeId >= (int)WellKnownType.First);
MetadataReader\MetadataDecoder.cs (21)
87Debug.Assert(type != null); 129Debug.Assert(module != null); 142Debug.Assert(!token.IsNil); 168Debug.Assert(type != null); 400Debug.Assert(!refersToNoPiaLocalType || generic.TypeKind == TypeKind.Error); 514Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(name)); 528Debug.Assert(result != null); 534Debug.Assert(result1.Equals(result, TypeCompareKind.ConsiderEverything)); 560Debug.Assert(fullName.NamespaceName.Length == 0); 637Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(name)); 702Debug.Assert((object)result != null); 719Debug.Assert(!isNoPiaLocalType); 862Debug.Assert(typeParameterCount == 0); 884Debug.Assert(signatureReader.Offset <= start); 1486Debug.Assert(type != null); 1993Debug.Assert(!typeDef.IsNil); 2012Debug.Assert(typeSymbol != null); 2149Debug.Assert(type.TypeKind == TypeKind.Array); 2258Debug.Assert( 2284Debug.Assert(type == HandleKind.MethodDefinition || type == HandleKind.MemberReference); 2294Debug.Assert(type == HandleKind.FieldDefinition ||
MetadataReader\MetadataHelpers.cs (31)
153Debug.Assert(!isTypeArgumentWithAssemblyName || isTypeArgument); 177Debug.Assert(decodedString != null); 305Debug.Assert(topLevelType == null); 325Debug.Assert(i == _input.Length || s_typeNameDelimiters.Contains(_input[i])); 434Debug.Assert(Current == '['); 494Debug.Assert(arity > 0); 511Debug.Assert(emittedTypeName != null, "NULL actual name unexpected!!!"); 557Debug.Assert(intArity > 0); 573Debug.Assert(!resultMemory.Equals(emittedTypeNameMemory) || ReferenceEquals(resultString, emittedTypeName), "If the name was not mangled, we should get the original string instance back."); 584Debug.Assert(suffixStartsAt == -1); 588Debug.Assert(suffixStartsAt > 0 && suffixStartsAt < emittedTypeName.Length - 1); 594Debug.Assert(arity > 0); 599Debug.Assert(suffixStartsAt > 0 && suffixStartsAt < emittedTypeName.Length - 1); 621Debug.Assert(!nameMemory.Equals(default(ReadOnlyMemory<char>))); 686Debug.Assert(pstrName != null); 714Debug.Assert(angleBracketDepth == 0); 738Debug.Assert(name != null); 792Debug.Assert(typesByNS != null); 793Debug.Assert(namespaceNameLength >= 0); 794Debug.Assert(!isGlobalNamespace || namespaceNameLength == 0); 855Debug.Assert((object?)typesInLastChildNamespace != null); 866Debug.Assert(lastChildNamespaceName != null); 873Debug.Assert(lastChildNamespaceName != null); 874Debug.Assert(typesInLastChildNamespace.Count != 0); 891Debug.Assert(lastChildNamespaceName != null); 892Debug.Assert(typesInLastChildNamespace.Count != 0); 924Debug.Assert(keyIndex < i); 932Debug.Assert(removed > 0); 938Debug.Assert(types != null); 939Debug.Assert(namespaces != null); 1106Debug.Assert(value <= 0x1fffffff);
MetadataReader\MetadataTypeName.cs (19)
94Debug.Assert(fullName != null); 95Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 96Debug.Assert(forcedArity == -1 || 124Debug.Assert(namespaceName != null); 125Debug.Assert(typeName != null); 126Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 127Debug.Assert(!typeName.Contains(MetadataHelpers.DotDelimiterString)); 128Debug.Assert(forcedArity == -1 || 153Debug.Assert(typeName != null); 154Debug.Assert(!typeName.Contains(MetadataHelpers.DotDelimiterString) || typeName.IndexOf(MetadataHelpers.MangledNameRegionStartChar) >= 0); 155Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 156Debug.Assert(forcedArity == -1 || 188Debug.Assert(_namespaceName != null); 189Debug.Assert(_typeName != null); 204Debug.Assert(_fullName != null); 224Debug.Assert(_fullName != null); 244Debug.Assert(_inferredArity == -1); 279Debug.Assert(_unmangledTypeNameMemory.Equals(default(ReadOnlyMemory<char>))); 280Debug.Assert(_unmangledTypeName == null);
MetadataReader\MetadataTypeName.Key.cs (2)
46Debug.Assert(mdTypeName._namespaceName != null); 47Debug.Assert(mdTypeName._typeName != null);
MetadataReader\PEAssembly.cs (2)
62Debug.Assert(!modules.IsDefault); 63Debug.Assert(modules.Length > 0);
MetadataReader\PEModule.cs (50)
150Debug.Assert((peReader == null) ^ (metadataOpt == IntPtr.Zero && metadataSizeOpt == 0)); 151Debug.Assert(metadataOpt == IntPtr.Zero || metadataSizeOpt > 0); 174Debug.Assert(peReader != null); 248Debug.Assert(_peReaderOpt != null); 345Debug.Assert(_hashesOpt != null); 531Debug.Assert(name.Length == 0 || MetadataHelpers.IsValidMetadataIdentifier(name)); // Obfuscated assemblies can have types with empty names. 739Debug.Assert(left.IsEmpty() && right.IsEmpty()); 744Debug.Assert(result != 0); 1124Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1144Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1176Debug.Assert(info.SignatureIndex == 0); 1192Debug.Assert(info.SignatureIndex == 0); 1209Debug.Assert(info.SignatureIndex == 0); 1224Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1323Debug.Assert(attributeInfo.HasValue); 1497Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 1498Debug.Assert(targetAttribute.SignatureIndex is 0 or 1); 1508Debug.Assert(!paramNames.IsDefault); 1518Debug.Assert(description.Namespace == "System.Diagnostics.CodeAnalysis"); 1519Debug.Assert(description.Name == "MaybeNullWhenAttribute" || description.Name == "NotNullWhenAttribute" || description.Name == "DoesNotReturnIfAttribute"); 1559Debug.Assert(info.SignatureIndex == 0); 1667Debug.Assert(info.SignatureIndex == 0); 1800Debug.Assert(attributeInfo.HasValue); 1840Debug.Assert(!handle.IsNil); 1867Debug.Assert(attributeInfo.HasValue); 1886Debug.Assert(attributeInfo.HasValue); 1900Debug.Assert(attributeInfo.HasValue); 1951Debug.Assert(info.HasValue); 2047Debug.Assert(!handle.IsNil); 2517Debug.Assert(signatureIndex >= 0 && signatureIndex <= byte.MaxValue); 2638Debug.Assert(rid > 0); 2704Debug.Assert(rid > 0); 2785Debug.Assert(namespaceName != null); 2786Debug.Assert(typeName != null); 2820Debug.Assert(assemblyName != null); 2859Debug.Assert(!resolutionScope.IsNil); 2860Debug.Assert(namespaceName != null); 2861Debug.Assert(typeName != null); 2906Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(name)); 2965Debug.Assert(targetSignature.Length >= 3); 3118Debug.Assert(!ctorType.IsNil); 3204Debug.Assert(_lazyContainsNoPiaLocalTypes != ThreeState.True); 3242Debug.Assert(!info.HasValue || info.SignatureIndex == 0); 3256Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 3277Debug.Assert(!info.HasValue || info.SignatureIndex == 0); 3410Debug.Assert(rva >= 0); 3614Debug.Assert(!param.IsNil); 3631Debug.Assert(!fieldDef.IsNil); 3909Debug.Assert(indices.FirstIndex >= 0, "Not allowed to store a negative (non-existent) index in typesToAssemblyIndexMap"); 3998Debug.Assert(_peReaderOpt != null);
MetadataReader\TypeNameDecoder.cs (3)
157Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(fullName.TopLevelType)); 173Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(fullName.NestedTypes[i])); 211Debug.Assert(rank >= 0);
MetadataReference\AssemblyIdentity.cs (11)
59Debug.Assert((object)other != null); 60Debug.Assert((object)version != null); 164Debug.Assert(name != null); 165Debug.Assert(IsValid(version)); 166Debug.Assert(IsValidCultureName(cultureName)); 167Debug.Assert((hasPublicKey && MetadataHelpers.IsValidPublicKey(publicKeyOrToken)) || (!hasPublicKey && (publicKeyOrToken.IsDefaultOrEmpty || publicKeyOrToken.Length == PublicKeyTokenSize))); 188Debug.Assert(name != null); 189Debug.Assert((hasPublicKey && MetadataHelpers.IsValidPublicKey(publicKeyOrToken)) || (!hasPublicKey && (publicKeyOrToken.IsDefaultOrEmpty || publicKeyOrToken.Length == PublicKeyTokenSize))); 190Debug.Assert(noThrow); 343Debug.Assert(HasPublicKey || !_lazyPublicKeyToken.IsDefault); 437Debug.Assert(hash.Length == CryptographicHashProvider.Sha1HashSize);
MetadataReference\AssemblyIdentity.DisplayName.cs (4)
450Debug.Assert(displayName.IndexOf('\0') == -1); 552Debug.Assert(i == displayName.Length || IsNameTokenTerminator(displayName[i])); 602Debug.Assert(str.Length > 0); 603Debug.Assert(str.IndexOf('\0') < 0);
MetadataReference\AssemblyIdentityComparer.cs (2)
89Debug.Assert((reference is not null) ^ (referenceDisplayName != null)); 113Debug.Assert(reference.ContentType == definition.ContentType);
MetadataReference\AssemblyMetadata.cs (6)
37Debug.Assert(!modules.IsDefaultOrEmpty && assembly != null); 94Debug.Assert(!modules.IsDefaultOrEmpty); 101Debug.Assert(manifestModule != null); 102Debug.Assert(moduleFactory != null); 327Debug.Assert(_initialModules.Length == 1); 395Debug.Assert(_initialModules.Length == 1 || _initialModules.Length == previousData.Modules.Length);
MetadataReference\CompilationReference.cs (1)
24Debug.Assert(properties.Kind != MetadataImageKind.Module);
MetadataReference\ModuleMetadata.cs (2)
115Debug.Assert(metadata != IntPtr.Zero); 116Debug.Assert(size > 0);
MetadataReference\ReferenceDirective.cs (2)
20Debug.Assert(file != null); 21Debug.Assert(location != null);
MethodImplExtensions.cs (2)
20Debug.Assert(MethodImplAttributes.Async == (MethodImplAttributes)0x2000); 37Debug.Assert(MethodImplOptions.Async == (MethodImplOptions)0x2000);
NativePdbWriter\PdbWriter.cs (24)
67Debug.Assert(_metadataWriter != null); 93Debug.Assert(emitAllDebugInfo || !emitExternNamespaces); 174Debug.Assert(import.AliasOpt != null); 175Debug.Assert(import.TargetAssemblyOpt == null); 249Debug.Assert(import.TargetAssemblyOpt == null); 250Debug.Assert(declaredExternAliasesOpt == null); 254Debug.Assert(import.TargetNamespaceOpt == null); 255Debug.Assert(import.TargetAssemblyOpt == null); 289Debug.Assert(import.AliasOpt != null); 290Debug.Assert(import.TargetXmlNamespaceOpt != null); 295Debug.Assert(import.TargetXmlNamespaceOpt == null); 299Debug.Assert(import.TargetNamespaceOpt == null); 300Debug.Assert(import.TargetAssemblyOpt == null); 327Debug.Assert(import.AliasOpt != null); 328Debug.Assert(import.TargetAssemblyOpt == null); 366Debug.Assert(!(typeReference is IArrayTypeReference)); 367Debug.Assert(!(typeReference is IPointerTypeReference)); 368Debug.Assert(!typeReference.IsTypeSpecification()); 391Debug.Assert(namespaceType != null); 519Debug.Assert(scopeLocal.SlotIndex >= 0); 574Debug.Assert(age == Age); 671Debug.Assert(sequencePoint.Document != null); 708Debug.Assert(!handle.IsNil); 730Debug.Assert(token != 0);
Operations\BasicBlock.cs (9)
79Debug.Assert(_successorsAreSealed); 96Debug.Assert(_successorsAreSealed); 112Debug.Assert(_predecessorsAreSealed); 137Debug.Assert(!_successorsAreSealed); 138Debug.Assert(_lazySuccessor == null); 139Debug.Assert(_lazyConditionalSuccessor == null); 153Debug.Assert(!_predecessorsAreSealed); 154Debug.Assert(_lazyPredecessors.IsDefault); 155Debug.Assert(!predecessors.IsDefault);
Operations\CaptureId.cs (1)
17Debug.Assert(value >= 0);
Operations\ControlFlowBranch.cs (3)
88Debug.Assert(source.Kind != ControlFlowRegionKind.Root); 89Debug.Assert(source.EnclosingRegion != null); 150Debug.Assert(builder.Last().Kind == ControlFlowRegionKind.Finally);
Operations\ControlFlowGraph.cs (23)
40Debug.Assert(parent != null == (originalOperation.Kind == OperationKind.LocalFunction || originalOperation.Kind == OperationKind.AnonymousFunction)); 41Debug.Assert(captureIdDispenser != null); 42Debug.Assert(!blocks.IsDefault); 43Debug.Assert(blocks.First().Kind == BasicBlockKind.Entry); 44Debug.Assert(blocks.Last().Kind == BasicBlockKind.Exit); 45Debug.Assert(root != null); 46Debug.Assert(root.Kind == ControlFlowRegionKind.Root); 47Debug.Assert(root.FirstBlockOrdinal == 0); 48Debug.Assert(root.LastBlockOrdinal == blocks.Length - 1); 49Debug.Assert(!localFunctions.IsDefault); 50Debug.Assert(localFunctionsMap != null); 51Debug.Assert(localFunctionsMap.Count == localFunctions.Length); 52Debug.Assert(localFunctions.Distinct().Length == localFunctions.Length); 53Debug.Assert(anonymousFunctionsMap != null); 57Debug.Assert(method.MethodKind == MethodKind.LocalFunction); 58Debug.Assert(localFunctionsMap.ContainsKey(method)); 191Debug.Assert(controlFlowGraph.OriginalOperation == operation); 252Debug.Assert(localFunction == LocalFunctions[info.ordinal]); 262Debug.Assert(localFunction == info.operation.Symbol); 264Debug.Assert(graph.OriginalOperation == info.operation); 269Debug.Assert(controlFlowGraph.Parent == this); 311Debug.Assert(graph.OriginalOperation == anonymous.Original); 316Debug.Assert(controlFlowGraph.Parent == this);
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (19)
51Debug.Assert(operation != null); 81Debug.Assert(Region != null); 99Debug.Assert(_predecessor1 == null); 100Debug.Assert(_predecessor2 == null); 116Debug.Assert(!result || BranchValue != null); 125Debug.Assert(_predecessor1 == null); 126Debug.Assert(_predecessor2 == null); 145Debug.Assert(predecessor != null); 149Debug.Assert(_predecessor1 == null); 150Debug.Assert(_predecessor2 == null); 175Debug.Assert(_predecessors.Count == 3); 183Debug.Assert(predecessor != null); 187Debug.Assert(_predecessor1 == null); 188Debug.Assert(_predecessor2 == null); 205Debug.Assert(_predecessor1 == null); 206Debug.Assert(_predecessor2 == null); 242Debug.Assert(_predecessor1 == null); 243Debug.Assert(_predecessor2 == null); 292Debug.Assert(predecessor.FallThroughSuccessor != null);
Operations\ControlFlowGraphBuilder.ConditionalAccessOperationTracker.cs (1)
30Debug.Assert(operations != null && whenNull != null);
Operations\ControlFlowGraphBuilder.Context.cs (2)
26Debug.Assert(!anonymousTypePropertyValues.IsDefault); 27Debug.Assert(implicitInstance == null || anonymousType == null);
Operations\ControlFlowGraphBuilder.cs (330)
65Debug.Assert(compilation != null); 77Debug.Assert(_currentRegion != null); 89Debug.Assert(body != null); 90Debug.Assert(((Operation)body).OwningSemanticModel != null); 95Debug.Assert(body.Parent == null); 96Debug.Assert(body.Kind == OperationKind.Block || 104Debug.Assert(parent == null); 108Debug.Assert(body.Kind == OperationKind.LocalFunction || body.Kind == OperationKind.AnonymousFunction); 109Debug.Assert(parent != null); 127Debug.Assert(captureIdDispenser != null); 131Debug.Assert(captureIdDispenser != null); 145Debug.Assert(builder._currentRegion == null); 162Debug.Assert(builder._evalStack.Count == 0); 268Debug.Assert(outOfRangeBlocksToVisit != null); 313Debug.Assert(current.Region != null); 331Debug.Assert(branch.Destination == null); 336Debug.Assert(branch.Destination != null); 337Debug.Assert(current.Region != null); 357Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 358Debug.Assert(region.EnclosingRegion != null); 362Debug.Assert(enclosing.NestedRegions[0] == region); 363Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 380Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 421Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 422Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 431Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 442Debug.Assert(enclosing!.Kind == ControlFlowRegionKind.FilterAndHandler); 443Debug.Assert(enclosing.EnclosingRegion != null); 445Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 469Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 470Debug.Assert(startAt > 0); 471Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 485Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 486Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal); 525Debug.Assert(!region.IsEmpty); 563Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 584Debug.Assert(subRegion.FirstBlock != null); 589Debug.Assert(!subRegion.HasCaptureIds); 592Debug.Assert(regionMap[block] == subRegion); 624Debug.Assert(subRegion.Kind != ControlFlowRegionKind.Root); 625Debug.Assert(subRegion.Enclosing != null); 634Debug.Assert(canHaveEmptyRegion); 635Debug.Assert(!subRegion.HasRegions); 648Debug.Assert(!r.IsEmpty); 651Debug.Assert(regionMap[blocks[i]] == subRegion); 667Debug.Assert(regionMap[blocks[i]] == subRegion); 712Debug.Assert(predecessor.BranchValue == null); 713Debug.Assert(predecessor.FallThrough.Kind == ControlFlowBranchSemantics.Regular); 726Debug.Assert((block.BranchValue != null && !block.HasCondition) == (next.Kind == ControlFlowBranchSemantics.Return || next.Kind == ControlFlowBranchSemantics.Throw)); 727Debug.Assert((next.Destination == null) == 738Debug.Assert(currentRegion.Kind == ControlFlowRegionKind.Filter || 740Debug.Assert(block == currentRegion.LastBlock); 756Debug.Assert(currentRegion.FirstBlock == block); 757Debug.Assert(!currentRegion.HasRegions); 765Debug.Assert(currentRegion.Enclosing != null); 767Debug.Assert(tryAndFinally.Kind == ControlFlowRegionKind.TryAndFinally); 768Debug.Assert(tryAndFinally.Regions!.Count == 2); 771Debug.Assert(@try.Kind == ControlFlowRegionKind.Try); 772Debug.Assert(tryAndFinally.Regions.Last() == currentRegion); 777Debug.Assert(@try.FirstBlock != null); 789Debug.Assert(tryAndFinally.Enclosing != null); 794Debug.Assert(regionMap[block] == tryAndFinallyEnclosing); 805Debug.Assert(block.HasCondition || block.BranchValue == null); 806Debug.Assert(next.Destination == null); 836Debug.Assert(next.Kind == ControlFlowBranchSemantics.Regular || 843Debug.Assert(!block.HasCondition); // This is ensured by an "if" above. 858Debug.Assert(implicitEntryRegion.LastBlock!.Ordinal >= next.Destination.Ordinal); 866Debug.Assert(next.Destination != null); 890Debug.Assert(predecessor.FallThrough.Destination == block); 929Debug.Assert(predecessor.BranchValue == null); 936Debug.Assert(value == null); 957Debug.Assert(next.Kind == ControlFlowBranchSemantics.Regular || 984Debug.Assert(predecessor != block); 985Debug.Assert(predecessor.BranchValue == null); 1048Debug.Assert(!region.IsEmpty); 1049Debug.Assert(region.FirstBlock.Ordinal >= 0); 1050Debug.Assert(region.FirstBlock.Ordinal <= region.LastBlock.Ordinal); 1051Debug.Assert(region.FirstBlock.Ordinal <= block.Ordinal); 1052Debug.Assert(block.Ordinal <= region.LastBlock.Ordinal); 1058Debug.Assert(region.Enclosing != null); 1063Debug.Assert(enclosing.Enclosing != null); 1071Debug.Assert(region.Enclosing != null); 1076Debug.Assert(enclosing.Enclosing != null); 1081Debug.Assert(region.FirstBlock.Ordinal <= region.LastBlock.Ordinal); 1084Debug.Assert(removed); 1085Debug.Assert(blocks[block.Ordinal] == block); 1105Debug.Assert(predecessorBranch.Kind == ControlFlowBranchSemantics.Regular); 1234Debug.Assert(branch.Kind == ControlFlowBranchSemantics.Regular); 1245Debug.Assert(stackDepth == 0 || _evalStack.Peek().frameOpt != null); 1259Debug.Assert(_evalStack.Count == stackDepth); 1260Debug.Assert(stackDepth == 0 || _evalStack.Peek().frameOpt != null); 1286Debug.Assert(spillingTheStack || _evalStack.All( 1306Debug.Assert(block != null); 1307Debug.Assert(_currentRegion != null); 1338Debug.Assert(_evalStack.Count == _startSpillingAt); 1351Debug.Assert(_currentRegion != null); 1363Debug.Assert((frameOpt == null) != (operationOpt == null)); 1367Debug.Assert(enclosed != frameOpt.RegionBuilderOpt); 1372Debug.Assert(enclosed.LastBlock != null); 1379Debug.Assert(prevBlock.HasCondition || prevBlock.BranchValue == null); 1380Debug.Assert(prevBlock.FallThrough.Destination == null); 1404Debug.Assert(_currentStatement == operation); 1405Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1412Debug.Assert(((Operation)originalOperation).OwningSemanticModel != null, "Not an original node."); 1413Debug.Assert(_currentStatement == originalOperation); 1414Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1509Debug.Assert(captureIdForResult is null); 1516Debug.Assert(_currentStatement == operation); 1577Debug.Assert(whenFalse is { }); 1616Debug.Assert(operation is { WhenTrue: not null, WhenFalse: not null }); 1631Debug.Assert(rewrittenThrow!.Kind == OperationKind.None); 1632Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 1649Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 1650Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 1695Debug.Assert(_startSpillingAt == _evalStack.Count); 1724Debug.Assert(_lazyRegionBuilder == null); 1725Debug.Assert(value != null); 1740Debug.Assert(frame != null); 1742Debug.Assert(_startSpillingAt <= stackDepth); 1750Debug.Assert(frame == frameOpt); 1751Debug.Assert(operationOpt == null); 1757Debug.Assert(_currentRegion != null); 1759Debug.Assert(toMerge.Enclosing != null); 1762Debug.Assert(toMerge.IsStackSpillRegion); 1763Debug.Assert(!toMerge.HasLocalFunctions); 1764Debug.Assert(toMerge.Locals.IsEmpty); 1792Debug.Assert(_currentRegion!.IsStackSpillRegion); 1816Debug.Assert(owner != null); 1824Debug.Assert(_startSpillingAt <= _evalStack.Count); 1836Debug.Assert(frameOpt.RegionBuilderOpt != null); 1844Debug.Assert((frameOpt == null) != (operationOpt == null)); 1849Debug.Assert(frameOpt.RegionBuilderOpt == null); 1855Debug.Assert(operationOpt != null); 1872Debug.Assert(currentFrame != null); 1874Debug.Assert(currentSpillRegion != null); 1905Debug.Assert(candidate.IsStackSpillRegion); 1912Debug.Assert(candidate.Enclosing != null); 1932Debug.Assert(CurrentRegionRequired.IsStackSpillRegion); 1949Debug.Assert(operationOpt == null); 1950Debug.Assert(frameOpt.RegionBuilderOpt != null); 1954Debug.Assert(operationOpt != null); 1962Debug.Assert(_evalStack.Count != 0); 1963Debug.Assert(_evalStack.First().frameOpt != null); 1964Debug.Assert(_evalStack.First().operationOpt == null); 1965Debug.Assert(_startSpillingAt <= _evalStack.Count); 1966Debug.Assert(operation != null); 1973Debug.Assert(_startSpillingAt <= stackDepth); 1981Debug.Assert(frameOpt == null); 1982Debug.Assert(operationOpt != null); 1989Debug.Assert(_startSpillingAt <= _evalStack.Count); 1992Debug.Assert(frameOpt == null); 1993Debug.Assert(operationOpt != null); 2000Debug.Assert(unwrapper != null || typeof(T) == typeof(IOperation)); 2009Debug.Assert(wrapper != null || typeof(T) == typeof(IOperation)); 2039Debug.Assert(stackSizeBefore == _evalStack.Count); 2072Debug.Assert(interpolatedStringBuilder != null); 2102Debug.Assert(index >= 0 && index < args.Length); 2461Debug.Assert(binOp.Type is not null); 2475Debug.Assert(binOp.Type is not null); 2500Debug.Assert(unaryOperatorMethod == null); 2574Debug.Assert(binOp.OperatorMethod is not null); 2603Debug.Assert(unaryOperatorMethod == null || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)); 2664Debug.Assert(IsBooleanConditionalOperator(condition)); 2714Debug.Assert(ITypeSymbolHelpers.IsBooleanType(condition.Type)); 2776Debug.Assert(current == _currentRegion); 2793Debug.Assert(_startSpillingAt == _evalStack.Count); 2880Debug.Assert(conditional.WhenFalse is not null); 2938Debug.Assert(rewrittenThrow != null); 2939Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 2940Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 2976Debug.Assert(previous.BranchValue == null); 2977Debug.Assert(!previous.HasCondition); 2978Debug.Assert(condition != null); 2979Debug.Assert(branch.Destination != null); 2993Debug.Assert(_evalStack.Last().frameOpt != null); 2994Debug.Assert(_startSpillingAt >= _evalStack.Count - 1); 3078Debug.Assert(conversion is not null); 3080Debug.Assert(rewrittenThrow != null); 3081Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 3082Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 3113Debug.Assert(operation.Parent != null); 3115Debug.Assert(captureIdForResult == null || !isStatement); 3129Debug.Assert(valueFrame.RegionBuilderOpt != null); 3191Debug.Assert(intermediateFrame.RegionBuilderOpt != null); 3206Debug.Assert(intermediateFrame != null); 3227Debug.Assert(whenNullFrame.RegionBuilderOpt != null); 3324Debug.Assert(ITypeSymbolHelpers.IsBooleanType(booleanType)); 3335Debug.Assert(nullableMember == SpecialMember.System_Nullable_T_GetValueOrDefault || 3342Debug.Assert(ITypeSymbolHelpers.IsNullableType(valueType)); 3365Debug.Assert(ITypeSymbolHelpers.IsNullableType(value.Type)); 3418Debug.Assert(captureIdForResult == null); 3425Debug.Assert(_currentStatement is not null); 3437Debug.Assert(expressionFrame != null); 3464Debug.Assert(operation.Type is not null); 3480Debug.Assert(!_currentConditionalAccessTracker.IsDefault); 3481Debug.Assert(_currentConditionalAccessTracker.Operations.Count == 0); 3531Debug.Assert(!_currentConditionalAccessTracker.IsDefault && _currentConditionalAccessTracker.Operations.Count > 0); 3539Debug.Assert(!_currentConditionalAccessTracker.IsDefault); 3572Debug.Assert(operation.Operation.Kind == OperationKind.ConditionalAccess || operation.Operation.Kind == OperationKind.CoalesceAssignment); 3609Debug.Assert(operation.Condition is not null); 3649Debug.Assert(_currentRegion == locals); 3688Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3721Debug.Assert(!filterRegion.IsEmpty); 3722Debug.Assert(filterRegion.LastBlock.FallThrough.Destination == null); 3723Debug.Assert(!filterRegion.FirstBlock.HasPredecessors); 3742Debug.Assert(!handlerRegion.IsEmpty); 3745Debug.Assert(CurrentRegionRequired == filterAndHandlerRegion); 3748Debug.Assert(filterAndHandlerRegion.Regions![0].LastBlock!.FallThrough.Destination == null); 3753Debug.Assert(predecessors.All(p => filterAndHandlerRegion.Regions[0].FirstBlock!.Ordinal <= p.Ordinal && 3761Debug.Assert(!handlerRegion.FirstBlock.HasPredecessors); 3765Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndCatch); 3771Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3782Debug.Assert(_currentRegion == tryAndFinallyRegion); 3784Debug.Assert(!finallyRegion.IsEmpty); 3785Debug.Assert(finallyRegion.LastBlock.FallThrough.Destination == null); 3786Debug.Assert(!finallyRegion.FirstBlock.HasPredecessors); 3790Debug.Assert(tryAndFinallyRegion?.Regions![1].LastBlock!.FallThrough.Destination == null); 3852Debug.Assert(current.BranchValue == null); 3853Debug.Assert(!current.HasCondition); 3949Debug.Assert(current.BranchValue == null); 3950Debug.Assert(!current.HasCondition); 3951Debug.Assert(current.FallThrough.Destination == null); 3952Debug.Assert(current.FallThrough.Kind == ControlFlowBranchSemantics.None); 3977Debug.Assert(visitResource is null); 3996Debug.Assert(resources.Kind != OperationKind.VariableDeclaration); 3997Debug.Assert(resources.Kind != OperationKind.VariableDeclarator); 4016Debug.Assert(_currentRegion == usingRegion); 4103Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4110Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4115Debug.Assert(_currentRegion == resourceRegion); 4125Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4126Debug.Assert(resource.Type is not null); 4137Debug.Assert(!isNotNullableValueType(resource.Type)); 4142Debug.Assert(resource.Type is not null); 4173Debug.Assert(_currentRegion == finallyRegion); 4179Debug.Assert((disposeMethod is object && !disposeArguments.IsDefault) || 4223Debug.Assert(iDisposable.SpecialType == SpecialType.System_IDisposable || 4343Debug.Assert(lockStatement.LockTakenSymbol == null); 4377Debug.Assert(lockStatement.LockTakenSymbol is not null); 4378Debug.Assert(enterMethod is not null); 4405Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4419Debug.Assert(lockStatement.LockTakenSymbol is not null); 4453Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4504Debug.Assert(regionForCollection == _currentRegion); 4532Debug.Assert(localsRegion == _currentRegion); 4542Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.Try); 4559Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.TryAndFinally); 4565Debug.Assert(_currentRegion == enumeratorCaptureRegion); 4691Debug.Assert(info?.ElementConversion?.ToCommonConversion().IsIdentity != false); 4713Debug.Assert(method.IsStatic == (instanceOpt == null)); 4791Debug.Assert(isObjectLoop && loopObject is not null); 4812Debug.Assert(builder.All(o => o != null)); 4842Debug.Assert(builder.All(op => op is not null)); 4905Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 4906Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5049Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 5050Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5061Debug.Assert(positiveFlag is not null); 5100Debug.Assert(value.Discriminator != ConstantValueTypeDiscriminator.Bad); 5297Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 5298Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5366Debug.Assert(controlVariableReferenceForAssignment.Kind == OperationKind.FlowCaptureReference); 5391Debug.Assert(ITypeSymbolHelpers.IsNullableType(controlVariableReferenceForIncrement.Type)); 5415Debug.Assert(controlVariableReferenceForAssignment.Type != null); 5446Debug.Assert(!_forceImplicit); 5492Debug.Assert(_currentRegion == switchRegion); 5523Debug.Assert(section.Clauses.All(c => c.Label == null)); 5524Debug.Assert(_currentSwitchOperationExpression == null); 5579Debug.Assert(compareWith.Type != null); 5585Debug.Assert(operation.Value.Type != null); 5675Debug.Assert(ITypeSymbolHelpers.IsNullableType(type)); 5676Debug.Assert(ITypeSymbolHelpers.GetNullableUnderlyingType(type).Equals(operand.Type)); 5716Debug.Assert(current.BranchValue == null); 5717Debug.Assert(!current.HasCondition); 5718Debug.Assert(current.FallThrough.Destination == null); 5719Debug.Assert(current.FallThrough.Kind == ControlFlowBranchSemantics.None); 5880Debug.Assert(initializer != null && assignmentSyntax != null); 5883Debug.Assert((afterInitialization, localSymbol.IsStatic) is (null, false) or (not null, true)); 6077Debug.Assert(validKinds.Contains(innerInitializer.Kind)); 6231Debug.Assert(instance.Kind == OperationKind.Invalid || instance.Kind == OperationKind.None); 6318Debug.Assert(array.Initializer is not null); 6370Debug.Fail("This code path should not be reachable."); 6376Debug.Fail("This code path should not be reachable."); 6389Debug.Assert(operation.Type is not null); 6391Debug.Assert(_currentImplicitInstance.AnonymousTypePropertyValues is not null); 6403Debug.Assert(propertyReference != null); 6404Debug.Assert(propertyReference.Arguments.IsEmpty); 6405Debug.Assert(propertyReference.Instance != null); 6406Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 6407Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver); 6455Debug.Assert(owner.Enclosing != null); 6465Debug.Assert(_currentStatement == null); 6619Debug.Assert(operation.IsImplicit); 6627Debug.Assert(operation.Parent is InvocationOperation { Parent: CollectionExpressionOperation ce } && ce.HasErrors(_compilation), 6758Debug.Assert(left != null); 6759Debug.Assert(right != null); 6792Debug.Assert(_currentStatement == operation); 6812Debug.Assert(_evalStack[maxStackDepth + 1].frameOpt != null); 6819Debug.Assert(_evalStack[i].frameOpt == null); 6820Debug.Assert(_evalStack[i].operationOpt != null); 6844Debug.Assert(operation.HandlerCreation is IObjectCreationOperation); 6858Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } }); 6870Debug.Assert(resultBlock != null); 6871Debug.Assert(outParameterPlaceholder != null); 6872Debug.Assert(outParameterFlowCapture != -1); 6893Debug.Assert(resultBlock != null); 7013Debug.Assert(receiverCapture is IFlowCaptureReferenceOperation); 7027Debug.Assert(argumentCapture is IFlowCaptureReferenceOperation or IDiscardOperation); 7049Debug.Assert(_evalStack.Count > _currentInterpolatedStringHandlerCreationContext.MaximumStackDepth); 7092Debug.Assert(interpolation.FormatString is ILiteralOperation or IConversionOperation { Operand: ILiteralOperation }); 7105Debug.Assert(interpolatedStringText.Text is ILiteralOperation or IConversionOperation { Operand: ILiteralOperation }); 7134Debug.Assert(operation.GetConstantValue() != null); 7182Debug.Assert(_currentImplicitInstance.AnonymousTypePropertyValues is not null); 7348Debug.Assert(operation.EventReference != null); 7454Debug.Fail("All placeholders should be handled above. Have we introduced a new scenario where placeholders are used?"); 7536Debug.Assert(_currentStatement == invalidOperation); 7899Debug.Assert(operation == null || ((Operation)operation).OwningSemanticModel!.Compilation == _compilation); 7907Debug.Assert(operation == null || ((Operation)operation).OwningSemanticModel!.Compilation == _compilation); 7909Debug.Assert((result == null) == (operation == null)); 7920Debug.Assert((result == null) == (operation == null)); 7986Debug.Assert(operation.Type!.IsAnonymousType); 8031Debug.Assert(simpleAssignment.Target is InvalidOperation); 8038Debug.Assert(propertyReference != null); 8039Debug.Assert(propertyReference.Arguments.IsEmpty); 8040Debug.Assert(propertyReference.Instance != null); 8041Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 8042Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver); 8072Debug.Assert(oldValueCaptureId >= 0); 8124Debug.Assert(simpleAssignment.Target is InvalidOperation); 8129Debug.Assert(properties.Contains(propertyReference.Property, SymbolEqualityComparer.IgnoreAll));
Operations\ControlFlowGraphBuilder.ImplicitInstanceInfo.cs (3)
37Debug.Assert(currentImplicitInstance != null); 45Debug.Assert(currentInitializedAnonymousType.IsAnonymousType); 54Debug.Assert(context.ImplicitInstance == null || context.AnonymousType == null);
Operations\ControlFlowGraphBuilder.InterpolatedStringContext.cs (6)
49Debug.Assert(_currentInterpolatedStringHandlerCreationContext != null); 50Debug.Assert(placeholderOperation is IInstanceReferenceOperation { ReferenceKind: InstanceReferenceKind.InterpolatedStringHandler } or IInterpolatedStringHandlerArgumentPlaceholderOperation); 58Debug.Assert(operation != null); 59Debug.Assert(_currentInterpolatedStringHandlerCreationContext.ApplicableCreationOperation == operation); 70Debug.Assert(_currentInterpolatedStringHandlerArgumentContext.ApplicableCreationOperations.Contains((IInterpolatedStringHandlerCreationOperation)operation)); 74Debug.Assert(placeholderOperation.Parent!.Parent is IObjectCreationOperation objectCreation && objectCreation.HasErrors(_compilation));
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (40)
33Debug.Assert(!isStackSpillRegion || (kind == ControlFlowRegionKind.LocalLifetime && locals.IsDefaultOrEmpty)); 45Debug.Assert((FirstBlock == null) == (LastBlock == null)); 66Debug.Assert(Kind != ControlFlowRegionKind.Root); 78Debug.Assert(Kind != ControlFlowRegionKind.Root); 96Debug.Assert(!IsStackSpillRegion); 97Debug.Assert(Kind != ControlFlowRegionKind.Root); 98Debug.Assert(symbol.MethodKind == MethodKind.LocalFunction); 110Debug.Assert(Kind != ControlFlowRegionKind.Root); 117Debug.Assert(others.All(((IMethodSymbol m, ILocalFunctionOperation _) tuple) => tuple.m.MethodKind == MethodKind.LocalFunction)); 136Debug.Assert(region.Enclosing == null || (region.Enclosing._aboutToFree && region.Enclosing.Enclosing == this)); 146Debug.Assert(Regions.Count <= 2); 147Debug.Assert(lastKind == (Regions.Count < 2 ? ControlFlowRegionKind.Filter : ControlFlowRegionKind.Catch)); 153Debug.Assert(lastKind == ControlFlowRegionKind.Try); 157Debug.Assert(lastKind == ControlFlowRegionKind.Catch || lastKind == ControlFlowRegionKind.FilterAndHandler); 162Debug.Assert(Regions.Count <= 2); 165Debug.Assert(lastKind == ControlFlowRegionKind.Try); 169Debug.Assert(lastKind == ControlFlowRegionKind.Finally); 174Debug.Assert(lastKind != ControlFlowRegionKind.Filter); 175Debug.Assert(lastKind != ControlFlowRegionKind.Catch); 176Debug.Assert(lastKind != ControlFlowRegionKind.Finally); 177Debug.Assert(lastKind != ControlFlowRegionKind.Try); 185Debug.Assert(region.Enclosing == this); 186Debug.Assert(Regions != null); 190Debug.Assert(Regions[0] == region); 203Debug.Assert(toReplace.Enclosing == this); 204Debug.Assert(toReplace.FirstBlock!.Ordinal <= replaceWith.First().FirstBlock!.Ordinal); 205Debug.Assert(toReplace.LastBlock!.Ordinal >= replaceWith.Last().LastBlock!.Ordinal); 206Debug.Assert(Regions != null); 212Debug.Assert(Regions[0] == toReplace); 250Debug.Assert(block != null); 251Debug.Assert((Kind != ControlFlowRegionKind.FilterAndHandler && 258Debug.Assert(LastBlock == null); 268Debug.Assert(FirstBlock != null); 269Debug.Assert(Regions.Count == 1 && Regions.First().LastBlock == block); 273Debug.Assert(LastBlock!.Ordinal < block.Ordinal); 274Debug.Assert(!HasRegions || Regions.Last().LastBlock!.Ordinal <= block.Ordinal); 283Debug.Assert(_aboutToFree); 303Debug.Assert(!_aboutToFree); 305Debug.Assert(!IsEmpty); 377Debug.Assert(block.Region == null);
Operations\ControlFlowRegion.cs (17)
71Debug.Assert(firstBlockOrdinal >= 0); 72Debug.Assert(lastBlockOrdinal >= firstBlockOrdinal); 86Debug.Assert(r.EnclosingRegion == null && r.Kind != ControlFlowRegionKind.Root); 96Debug.Assert(NestedRegions.Length == 2); 97Debug.Assert(NestedRegions[0].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Try : ControlFlowRegionKind.Filter)); 98Debug.Assert(NestedRegions[1].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Finally : ControlFlowRegionKind.Catch)); 99Debug.Assert(NestedRegions[0].FirstBlockOrdinal == firstBlockOrdinal); 100Debug.Assert(NestedRegions[1].LastBlockOrdinal == lastBlockOrdinal); 101Debug.Assert(NestedRegions[0].LastBlockOrdinal + 1 == NestedRegions[1].FirstBlockOrdinal); 105Debug.Assert(NestedRegions.Length >= 2); 106Debug.Assert(NestedRegions[0].Kind == ControlFlowRegionKind.Try); 107Debug.Assert(NestedRegions[0].FirstBlockOrdinal == firstBlockOrdinal); 113Debug.Assert(previousLast + 1 == r.FirstBlockOrdinal); 116Debug.Assert(r.Kind == ControlFlowRegionKind.FilterAndHandler || r.Kind == ControlFlowRegionKind.Catch); 119Debug.Assert(previousLast == lastBlockOrdinal); 134Debug.Assert(previousLast < r.FirstBlockOrdinal); 138Debug.Assert(previousLast <= lastBlockOrdinal);
Operations\IOperation.OperationList.cs (1)
126Debug.Assert(_operation != null && _currentSlot >= 0 && _currentIndex >= 0);
Operations\IOperation.OperationList.Reversed.cs (2)
106Debug.Assert(_operation != null && _currentSlot is >= 0 and not int.MaxValue && _currentIndex is >= 0 and not int.MaxValue); 113Debug.Assert((_currentSlot == int.MaxValue) == (_currentIndex == int.MaxValue));
Operations\Loops\ForEachLoopOperationInfo.cs (1)
61Debug.Assert(!collectionIsInlineArrayValue || inlineArrayConversion is { });
Operations\Operation.cs (9)
32Debug.Assert(semanticModel.ContainingPublicModelOrSelf != null); 33Debug.Assert(semanticModel.ContainingPublicModelOrSelf != semanticModel); 34Debug.Assert(semanticModel.ContainingPublicModelOrSelf.ContainingPublicModelOrSelf == semanticModel.ContainingPublicModelOrSelf); 52Debug.Assert(_parentDoNotAccessDirectly != s_unset, "Attempt to access parent node before construction is complete!"); 139Debug.Assert(_parentDoNotAccessDirectly == s_unset); 140Debug.Assert(parent != s_unset); 144Debug.Assert(parent == null || ((Operation)parent).OwningSemanticModel == OwningSemanticModel); 178Debug.Assert((object?)child.Parent == parent); 185Debug.Assert(!children.IsDefault);
Operations\OperationExtensions.cs (1)
339Debug.Assert(operation != null);
Operations\OperationMapBuilder.cs (1)
21Debug.Assert(dictionary.Count == 0);
Operations\OperationNodes.cs (4)
91Debug.Assert(children.All(o => o != null)); 652Debug.Assert(value != null); 661Debug.Assert(operand != null); 699Debug.Assert(statements.All(s => s.Parent != this && s.Parent!.Kind is OperationKind.Block or OperationKind.SwitchCase));
PEWriter\CustomDebugInfoWriter.cs (4)
33Debug.Assert(pdbWriter != null); 175Debug.Assert(local.SlotIndex >= 0); 188Debug.Assert(localConstant.SlotIndex < 0); 271Debug.Assert(!ReferenceEquals(_previousMethodBodyWithUsingInfo, methodBody));
PEWriter\ExceptionHandlerRegion.cs (8)
42Debug.Assert(tryStartOffset < tryEndOffset); 43Debug.Assert(tryEndOffset <= handlerStartOffset); 44Debug.Assert(handlerStartOffset < handlerEndOffset); 45Debug.Assert(tryStartOffset >= 0); 46Debug.Assert(tryEndOffset >= 0); 47Debug.Assert(handlerStartOffset >= 0); 48Debug.Assert(handlerEndOffset >= 0); 157Debug.Assert(filterDecisionStartOffset >= 0);
PEWriter\ExtendedPEBuilder.cs (2)
76Debug.Assert(_withMvidSection); 98Debug.Assert(mvidWriter.RemainingBytes == 0);
PEWriter\LocalScope.cs (4)
32Debug.Assert(!locals.Any(l => l.Name == null)); 33Debug.Assert(!constants.Any(c => c.Name == null)); 34Debug.Assert(offset >= 0); 35Debug.Assert(endOffset > offset);
PEWriter\Members.cs (1)
116Debug.Assert((compare & ~(CallingConvention)SignatureCallingConventionMask) == 0);
PEWriter\MetadataVisitor.cs (3)
105Debug.Assert((constant != null) == fieldDefinition.IsCompileTimeConstant); 106Debug.Assert((marshalling != null || !fieldDefinition.MarshallingDescriptor.IsDefaultOrEmpty) == fieldDefinition.IsMarshalledExplicitly); 437Debug.Assert((marshalling != null || !parameterDefinition.MarshallingDescriptor.IsDefaultOrEmpty) == parameterDefinition.IsMarshalledExplicitly);
PEWriter\MetadataWriter.cs (50)
104Debug.Assert(metadata != debugMetadataOpt); 661Debug.Assert(namespaceTypeReference.AsGenericTypeInstanceReference == null); 668Debug.Assert(!_tableIndicesAreComplete); 677Debug.Assert(!_tableIndicesAreComplete); 846Debug.Assert(!_tableIndicesAreComplete); 1130Debug.Assert((methodReference.CallingConvention & CallingConvention.Generic) != 0 == (methodReference.GenericParameterCount > 0)); 1190Debug.Assert(!(signature is IMethodReference)); 1427Debug.Assert(str != null); // No need to handle in an internal utility. 1696Debug.Assert(nativePdbWriterOpt == null ^ portablePdbStreamOpt == null); 1714Debug.Assert(module.SerializationProperties.PersistentIdentifier != default(Guid)); 1725Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0); 1726Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncMap] == 0); 1729Debug.Assert(managedResourceDataBuilder == null); 1730Debug.Assert(mvidFixup.IsDefault); 1731Debug.Assert(mvidStringFixup.IsDefault); 1995Debug.Assert(sourceAssembly != null); 2067Debug.Assert(this.IsFullMetadata); // parentToken is not relative 2105Debug.Assert(this.IsFullMetadata); 2264Debug.Assert(exportedType.ParentIndex != -1); 2369Debug.Assert(offset % ManagedPEBuilder.MappedFieldDataAlignment == 0, "Expected last write to end at alignment boundary"); 2370Debug.Assert(ManagedPEBuilder.MappedFieldDataAlignment == 8, "Expected alignment to be 8"); 2436Debug.Assert(propDef.DefaultValue != null); 2575Debug.Assert(resourceDataWriter == null || (resourceDataWriter.Count % ManagedPEBuilder.ManagedResourcesDataAlignment) == 0); 2958Debug.Assert(MetadataOnly); 2987Debug.Assert(!MetadataOnly); 3013Debug.Assert(body != null); 3095Debug.Assert(!_tableIndicesAreComplete); 3275Debug.Assert(pseudoToken <= 0xffffff); 3316Debug.Assert(ReadByte(generatedIL, offset - 1) == (byte)ILOpCode.Ldtoken); 3324Debug.Assert(handle.Kind is HandleKind.MethodDefinition); 3332Debug.Assert(handle.Kind is HandleKind.FieldDefinition); 3371Debug.Assert(guidStringLength == default(Guid).ToString().Length); 3466Debug.Assert(parameterTypeInformation.RefCustomModifiers.Length == 0 || parameterTypeInformation.IsByReference); 3477Debug.Assert(fieldReference.RefCustomModifiers.Length == 0 || fieldReference.IsByReference); 3514Debug.Assert(parameters.Length == arguments.Length); 3570Debug.Assert(this.module.IsPlatformType(targetType, PlatformType.SystemObject)); 3630Debug.Assert(!module.IsPlatformType(c.Type, PlatformType.SystemType) || c.Value == null); 3646Debug.Assert(marshallingInformation.NumberOfElements >= 0); 3685Debug.Assert(marshallingInformation.ElementType >= 0); 3783Debug.Assert(identity.ContentType == AssemblyContentType.Default); 3830Debug.Assert(!signature.ReturnValueIsByRef); 3831Debug.Assert(signature.RefCustomModifiers.IsEmpty); 3838Debug.Assert(signature.RefCustomModifiers.IsEmpty || signature.ReturnValueIsByRef); 4060Debug.Assert(arrayTypeReference.IsSZArray); 4063Debug.Assert(!(elementType is IModifiedTypeReference)); 4094Debug.Assert(typeReference.IsEnum); 4279Debug.Assert(!_writer._tableIndicesAreComplete); 4282Debug.Assert(!this.TryGetValue(item, out i)); 4305Debug.Assert(index.Count == 0); 4332Debug.Assert(index.Count == 0);
PEWriter\MetadataWriter.DynamicAnalysis.cs (3)
159Debug.Assert(previousStartColumn < 0); 182Debug.Assert(deltaLines != 0 || deltaColumns != 0); 230Debug.Assert(name != null);
PEWriter\MetadataWriter.PortablePdb.cs (16)
107Debug.Assert(local.SlotIndex >= 0); 120Debug.Assert(mdConstant != null); 247Debug.Assert(!value.GetType().GetTypeInfo().IsEnum); 336Debug.Assert(import.TargetNamespaceOpt == null); 337Debug.Assert(import.TargetAssemblyOpt == null); 338Debug.Assert(import.TargetTypeOpt == null); 347Debug.Assert(import.TargetNamespaceOpt == null); 348Debug.Assert(import.TargetAssemblyOpt == null); 404Debug.Assert(import.AliasOpt != null); 405Debug.Assert(import.TargetAssemblyOpt == null); 433Debug.Assert(rid == ModuleImportScopeHandle); 580Debug.Assert(asyncInfo.ResumeOffsets.Length == asyncInfo.YieldOffsets.Length); 581Debug.Assert(asyncInfo.CatchHandlerOffset >= -1); 688Debug.Assert(previousNonHiddenStartColumn < 0); 725Debug.Assert(deltaLines != 0 || deltaColumns != 0 || sequencePoint.IsHidden); 762Debug.Assert(result);
PEWriter\ModifiedTypeReference.cs (1)
24Debug.Assert(!customModifiers.IsDefault);
PEWriter\NativeResourceWriter.cs (2)
196Debug.Assert(typeDirectory.NumberOfIdEntries == 0, "Not all Win32 resources with types encoded as strings precede those encoded as ints"); 214Debug.Assert(nameDirectory.NumberOfIdEntries == 0, "Not all Win32 resources with names encoded as strings precede those encoded as ints");
PEWriter\PeWriter.cs (11)
60Debug.Assert(ManagedResourceBlobBuilder == null || ManagedResourceBlobBuilder.Count > 0); 61Debug.Assert(MappedFieldDataBlobBuilder == null || MappedFieldDataBlobBuilder.Count > 0); 94Debug.Assert(nativePdbWriterOpt == null || pdbPathOpt != null); 107Debug.Assert(properties.PersistentIdentifier == default(Guid)); 205Debug.Assert(!isDeterministic || context.Module.PdbChecksumAlgorithm.Name != null); 300Debug.Assert(strongNameProvider != null); 346Debug.Assert(writer.RemainingBytes == 0); 353Debug.Assert(writer.RemainingBytes == 0); 360Debug.Assert(writer.RemainingBytes == 0); 410Debug.Assert(resourceSection != null); 426Debug.Assert(resources.Any());
PEWriter\ReferenceIndexer.cs (3)
74Debug.Assert(!this.typeReferenceNeedsToken); 109Debug.Assert(body != null); 148Debug.Assert(!this.typeReferenceNeedsToken);
PEWriter\ReferenceIndexerBase.cs (5)
47Debug.Assert(!this.typeReferenceNeedsToken); 54Debug.Assert(!this.typeReferenceNeedsToken); 280Debug.Assert(!this.typeReferenceNeedsToken); 321Debug.Assert(!this.typeReferenceNeedsToken); 339Debug.Assert(!this.typeReferenceNeedsToken);
PEWriter\RootModuleType.cs (1)
32Debug.Assert(_methods is null);
PEWriter\TypeNameSerializer.cs (3)
92Debug.Assert(uninstantiatedTypeReference != typeReference); 215Debug.Assert(needsEscaping.All(c => !fileIdentifier.Contains(c))); 268Debug.Assert(@namespace != null);
PEWriter\Units.cs (4)
38Debug.Assert(startLine >= 0); 39Debug.Assert(startColumn >= 0); 40Debug.Assert(endLine >= 0); 41Debug.Assert(endColumn >= 0);
RealParser.cs (6)
229Debug.Assert((DenormalMantissaMask & (1UL << DenormalMantissaBits)) == 0); 231Debug.Assert((shiftedExponent & DenormalMantissaMask) == 0); 232Debug.Assert((mantissa & ~DenormalMantissaMask) == 0); 233Debug.Assert((shiftedExponent & ~(((1UL << this.ExponentBits) - 1) << DenormalMantissaBits)) == 0); // exponent fits in its place 466Debug.Assert(!fractionalNumerator.IsZero); 548Debug.Assert(integerBitsOfPrecision < 60); // we can use BigInteger's built-in conversion
ReferenceManager\AssemblyDataForAssemblyBeingBuilt.cs (3)
32Debug.Assert(identity != null); 33Debug.Assert(!referencedAssemblyData.IsDefault); 89Debug.Assert(assemblies[_referencedAssemblyData[i].Identity.Name].Contains((_referencedAssemblyData[i], i + 1)));
ReferenceManager\AssemblyReferenceBinding.cs (6)
27Debug.Assert(referenceIdentity != null); 39Debug.Assert(referenceIdentity != null); 40Debug.Assert(definitionIndex >= 0); 41Debug.Assert(versionDifference >= -1 && versionDifference <= +1); 78Debug.Assert(IsBound); 91Debug.Assert(IsBound);
ReferenceManager\CommonReferenceManager.Binding.cs (31)
110Debug.Assert(explicitAssemblies[0] is AssemblyDataForAssemblyBeingBuilt); 111Debug.Assert(explicitReferences.Length == explicitReferenceMap.Length); 159Debug.Assert(referenceBindings.Count == allAssemblies.Length); 225Debug.Assert(explicitAssemblies[0] is AssemblyDataForAssemblyBeingBuilt); 226Debug.Assert(referenceBindings.Count == explicitAssemblies.Length); 227Debug.Assert(explicitReferences.Length == explicitReferenceMap.Length); 265Debug.Assert(binding.ReferenceIdentity is object); 320Debug.Assert(lazyAliasMap == null); 360Debug.Assert(binding.ReferenceIdentity is object); 397Debug.Assert(result.Count == 0); 417Debug.Assert(bindingIndex == bindingsOfAssemblyBeingBuilt.Length); 435Debug.Assert(result.Count == explicitModules.Length + totalReferencedAssemblyCount); 559Debug.Assert(resolvedAssembly is object); 580Debug.Assert(assembly is object); 675Debug.Assert(GetCorLibrary(candidateInputAssemblySymbols[j]) == null); 683Debug.Assert(corLibraryIndex != 0); 689Debug.Assert(candidateInputAssemblySymbols[corLibraryIndex] == null); 702Debug.Assert(candidateInputAssemblySymbols[j] != null); 771Debug.Assert(candidate.DefinitionIndex >= 0); 772Debug.Assert(candidate.AssemblySymbol is object); 777Debug.Assert(boundInputs[candidateIndex].AssemblySymbol == null || 810Debug.Assert(candidateInputAssemblySymbols[candidateIndex] == null); 822Debug.Assert(candidateReferenceBinding is object); 823Debug.Assert(candidateReferenceBinding.Length == candidateReferencedSymbols.Count); 912Debug.Assert(corLibraryIndex != 0); 914Debug.Assert(ReferenceEquals(candidateCorLibrary, GetCorLibrary(candidateCorLibrary))); 931Debug.Assert(!assemblies[corLibraryIndex].ContainsNoPiaLocalTypes); 932Debug.Assert(!assemblies[corLibraryIndex].IsLinked); 933Debug.Assert(!IsLinked(candidateCorLibrary)); 948Debug.Assert(boundInputs[k].AssemblySymbol == null); 988Debug.Assert(value.Identity is object);
ReferenceManager\CommonReferenceManager.Resolution.cs (24)
69Debug.Assert(index >= 0); 82Debug.Assert(!aliasesOpt.IsDefault || !recursiveAliasesOpt.IsDefault); 83Debug.Assert(!mergedReferences.IsDefault); 101Debug.Assert(!IsUninitialized); 115Debug.Assert(!IsUninitialized); 124Debug.Assert(!IsUninitialized); 144Debug.Assert(!IsSkipped); 156Debug.Assert(!IsSkipped); 323Debug.Assert(metadata != null || diagnostics.HasAnyErrors()); 336Debug.Assert(assembly is object); 531Debug.Assert(existing is Metadata || existing is Diagnostic); 549Debug.Assert(metadata != null || diagnostics.HasAnyErrors()); 686Debug.Assert(other.Identity is object); 716Debug.Assert(other.Identity is object); 731Debug.Assert(other.Identity is object); 750Debug.Assert(equivalent.Identity.IsStrongName); 771Debug.Assert(!equivalent.Identity.IsStrongName); 785Debug.Assert(equivalent.Reference != null); 804Debug.Assert(referenceDirective.Location is object); 813Debug.Assert(referenceDirective.File is object); 814Debug.Assert(referenceDirective.Location.SourceTree is object); 875Debug.Assert(compilation.Options.MetadataReferenceResolver != null); 963Debug.Assert(reference.Version > definition.Version); 1054Debug.Assert(definitionData.Identity.PublicKeyToken.IsEmpty);
ReferenceManager\CommonReferenceManager.State.cs (47)
197Debug.Assert(simpleAssemblyName != null); 198Debug.Assert(identityComparer != null); 329Debug.Assert(_lazyMergedAssemblyReferencesMap != null); 351Debug.Assert(_isBound == 0); 352Debug.Assert(_lazyHasCircularReference == ThreeState.Unknown); 353Debug.Assert(_lazyReferencedAssembliesMap == null); 354Debug.Assert(_lazyReferencedModuleIndexMap == null); 355Debug.Assert(_lazyReferenceDirectiveMap == null); 356Debug.Assert(_lazyDirectiveReferences.IsDefault); 357Debug.Assert(_lazyImplicitReferenceResolutions == null); 358Debug.Assert(_lazyExplicitReferences.IsDefault); 359Debug.Assert(_lazyReferencedModules.IsDefault); 360Debug.Assert(_lazyReferencedModulesReferences.IsDefault); 361Debug.Assert(_lazyReferencedAssemblies.IsDefault); 362Debug.Assert(_lazyAliasesOfReferencedAssemblies.IsDefault); 363Debug.Assert(_lazyMergedAssemblyReferencesMap == null); 364Debug.Assert(_lazyUnifiedAssemblies.IsDefault); 365Debug.Assert(_lazyCorLibraryOpt == null); 372Debug.Assert(_isBound != 0); 373Debug.Assert(_lazyHasCircularReference != ThreeState.Unknown); 374Debug.Assert(_lazyReferencedAssembliesMap != null); 375Debug.Assert(_lazyReferencedModuleIndexMap != null); 376Debug.Assert(_lazyReferenceDirectiveMap != null); 377Debug.Assert(!_lazyDirectiveReferences.IsDefault); 378Debug.Assert(_lazyImplicitReferenceResolutions != null); 379Debug.Assert(!_lazyExplicitReferences.IsDefault); 380Debug.Assert(!_lazyReferencedModules.IsDefault); 381Debug.Assert(!_lazyReferencedModulesReferences.IsDefault); 382Debug.Assert(!_lazyReferencedAssemblies.IsDefault); 383Debug.Assert(!_lazyAliasesOfReferencedAssemblies.IsDefault); 384Debug.Assert(_lazyMergedAssemblyReferencesMap != null); 385Debug.Assert(!_lazyUnifiedAssemblies.IsDefault); 388Debug.Assert(_lazyReferencedAssemblies.Length == 0 || _lazyCorLibraryOpt != null); 394Debug.Assert(compilation.MakeSourceAssemblySimpleName() == this.SimpleAssemblyName); 427Debug.Assert(referencedModules.Length == referencedModulesReferences.Length); 428Debug.Assert(referencedModules.Length == referencedModulesMap.Count); 429Debug.Assert(referencedAssemblies.Length == aliasesOfReferencedAssemblies.Length); 496Debug.Assert(aliasesOfReferencedAssembliesBuilder.Count == assemblyIndex); 516Debug.Assert(!aliasesOfReferencedAssembliesBuilder.Any(a => a.IsDefault)); 544Debug.Assert(originalIdentities.Length == symbols.Length); 555Debug.Assert(versionPattern.Build == ushort.MaxValue || versionPattern.Revision == ushort.MaxValue); 572Debug.Assert(originalIdentity == symbolIdentity); 590Debug.Assert(versionPattern is null || versionPattern.Build == ushort.MaxValue || versionPattern.Revision == ushort.MaxValue); 622Debug.Assert(bindingResult.Length == aliasesOfReferencedAssembliesBuilder.Count + 1); 630Debug.Assert(reference.Kind == MetadataImageKind.Assembly); 633Debug.Assert(assemblyIndicesToProcess.Count == 0); 647Debug.Assert(referenceBinding is object);
ReferenceManager\ModuleReferences.cs (4)
46Debug.Assert(!identities.IsDefault); 47Debug.Assert(!symbols.IsDefault); 48Debug.Assert(identities.Length == symbols.Length); 49Debug.Assert(!unifiedAssemblies.IsDefault);
ReferenceManager\UnifiedAssembly.cs (2)
29Debug.Assert(originalReference != null); 30Debug.Assert(targetAssembly != null);
RuleSet\RuleSet.cs (2)
146Debug.Assert(effectiveRuleset is object); 301Debug.Assert(resolvedPath != null);
RuleSet\RuleSetProcessor.cs (3)
82Debug.Assert(nodeList.Count == 1, "Multiple top-level nodes!"); 83Debug.Assert(nodeList[0].Name == RuleSetNodeName); 166Debug.Assert(false, "Unknown child node in Rules node");
SignatureComparer.cs (3)
35Debug.Assert(!result || position == signature.Length); 79Debug.Assert(position == signature.Length); 124Debug.Assert(position == signature.Length);
SourceGeneration\AdditionalSourcesCollection.cs (2)
37Debug.Assert(fileExtension.Length > 0 && fileExtension[0] == '.'); 38Debug.Assert(reservedHintNames.IsEmpty || reservedHintNames.KeyComparer == s_hintNameComparer);
SourceGeneration\CompilationCache.cs (1)
66Debug.Assert(_compilation is not null, $"{nameof(Compilation)} read before any builder produced this cache.");
SourceGeneration\GeneratorAdaptor.cs (2)
39Debug.Assert(_sourceExtension != DummySourceExtension); 96Debug.Assert(ParseOptions is object && ConfigOptions is object);
SourceGeneration\GeneratorDriver.cs (3)
33Debug.Assert(state.Generators.GroupBy(s => s.GetGeneratorType()).Count() == state.Generators.Length); // ensure we don't have duplicate generator types 452Debug.Assert(false); 487Debug.Assert(outputKind != IncrementalGeneratorOutputKind.None);
SourceGeneration\GeneratorDriverState.cs (2)
40Debug.Assert(Generators.Length == GeneratorStates.Length); 41Debug.Assert(IncrementalGenerators.Length == GeneratorStates.Length);
SourceGeneration\GeneratorSyntaxWalker.cs (2)
25Debug.Assert(model is not null 30Debug.Assert(model.Value.SyntaxTree == child.SyntaxTree);
SourceGeneration\IncrementalGeneratorRunStep.cs (2)
18Debug.Assert(!inputs.IsDefault); 19Debug.Assert(!outputs.IsDefault);
SourceGeneration\Nodes\AbstractSourceOutputNode.cs (1)
103Debug.Assert(context.TableBuilder is not null);
SourceGeneration\Nodes\BatchNode.cs (3)
87Debug.Assert(indexInPrevious == previousItems.Length); 106Debug.Assert(builder.Count == entryCount); 127Debug.Assert(!tableBuilder.TrackIncrementalSteps || (sourceTable.HasTrackedSteps || sourceTable.IsEmpty));
SourceGeneration\Nodes\CombineNode.cs (3)
81Debug.Assert(tableBuilder.Count == totalEntryItemCount); 90Debug.Assert(input1Table.HasTrackedSteps && input2Table.IsCached); 98Debug.Assert(usedCachedEntry);
SourceGeneration\Nodes\DriverStateTable.cs (3)
45Debug.Assert(_compilation is not null, "Compilation should only be read after the pre-compilation phase has completed; if this fires a driver-internal caller is reading it too early."); 68Debug.Assert(_syntaxStore is not null, "SyntaxStore should only be read after the pre-compilation phase has completed; if this fires a driver-internal caller is reading it too early."); 84Debug.Assert(_compilation is null, "SetCompilation should only be called once.");
SourceGeneration\Nodes\GeneratorRunStateTable.cs (4)
41Debug.Assert(RecordingExecutedSteps); 42Debug.Assert(table.HasTrackedSteps); 76Debug.Assert(RecordingExecutedSteps); 95Debug.Assert(step.Name is not null);
SourceGeneration\Nodes\HostOutputNode.cs (1)
70Debug.Assert(context.TableBuilder is not null);
SourceGeneration\Nodes\InputNode.cs (6)
69Debug.Assert(added); 93Debug.Assert(usedCache); 103Debug.Assert(removed); 106Debug.Assert(modified); 111Debug.Assert(removed); 119Debug.Assert(previousTable is null || inputItems.Length != previousTable.Count || itemsSet.Count == 0);
SourceGeneration\Nodes\NodeStateTable.cs (18)
70Debug.Assert(!hasTrackedSteps || steps.Length == states.Length); 172Debug.Assert(compacted.Count == nonRemovedCount); 180Debug.Assert((_states.Length == 1 || _states.Length == 2 && _states[0].IsRemovedDueToInputRemoval) && _states[^1].Count == 1); 189Debug.Assert(inputTable.HasTrackedSteps && inputTable.IsCached); 195Debug.Assert(usedCachedEntry); 305Debug.Assert(previousEntries.IsCached); 338Debug.Assert(previousEntry.Count == 1); 478Debug.Assert(stepInputs.IsDefault == !TrackIncrementalSteps); 482Debug.Assert(_steps.Count + 1 == _states.Count); 521Debug.Assert(!TrackIncrementalSteps || _states.Count == _steps.Count); 533Debug.Assert(_requestedTableCapacity == null || _states.Count <= _requestedTableCapacity); 604Debug.Assert(!states.IsDefault); 605Debug.Assert(states.Length == 1 || states.Distinct().Length > 1); 657Debug.Assert(itemBuilder.Count < this.Count); 768Debug.Assert(_currentState.HasValue, "Created a builder with no values?"); 769Debug.Assert(_items.Count >= 1, "Created a builder with no values?"); 771Debug.Assert(_items.Count == _requestedCapacity); 772Debug.Assert(_states == null || _states.Count == _requestedCapacity);
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
86Debug.Assert(model is object);
SourceGeneration\Nodes\SourceOutputNode.cs (1)
19Debug.Assert(outputKind is IncrementalGeneratorOutputKind.Source or IncrementalGeneratorOutputKind.Implementation);
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
80Debug.Assert(model is not null);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
102Debug.Assert(syntaxNodes.All(n => n.SyntaxTree == syntaxTree));
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithSimpleName.cs (2)
116Debug.Assert(compilationUnit is ICompilationUnitSyntax); 160Debug.Assert(compilationUnit is ICompilationUnitSyntax);
SourceGeneration\RunResults.cs (1)
91Debug.Assert(exception is null || diagnostics.Length == 1);
SourceGeneration\SyntaxStore.cs (2)
51Debug.Assert(_syntaxInputNodes.Contains(syntaxInputNode)); 136Debug.Assert(_tableBuilder.Contains(node));
SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
SpecialTypes.cs (1)
103Debug.Assert(name.IndexOf('+') < 0); // Compilers aren't prepared to lookup for a nested special type.
src\roslyn\src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
81Debug.Assert(assemblyScopedNamespaceSymbol.ConstituentNamespaces.Length == 1);
src\roslyn\src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
17Debug.Assert(declaredNode != null); 18Debug.Assert(!executableCodeBlocks.IsDefault);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (8)
25Debug.Assert(builder.Count == 0); 50Debug.Assert(_recordCount <= byte.MaxValue); 85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 102Debug.Assert(usingCount <= ushort.MaxValue); 152Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 153Debug.Assert(info.LocalName.Length <= IdentifierSize); 172Debug.Assert(infos.Count > 0); 179Debug.Assert((info.SlotIndex == -1) ^ (info.ScopeStart == 0 && info.ScopeEnd == 0));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (7)
257Debug.Assert(flagsBuilder.Count == 0); 258Debug.Assert(nameBuilder.Length == 0); 398Debug.Assert(!allModuleInfoImportStrings.IsDefault); 422Debug.Assert(!importStrings.IsDefault); 452Debug.Assert(groupBuilder.Count == 0); 493Debug.Assert(!importStrings.IsDefault); 512Debug.Assert(!importStrings.IsDefault);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\StateMachineHoistedLocalScope.cs (2)
26Debug.Assert(startOffset >= 0); 27Debug.Assert(endOffset > startOffset || startOffset == 0 && endOffset == 0);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\TupleElementNamesInfo.cs (1)
22Debug.Assert(!elementNames.IsDefault);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
714Debug.Assert(data.All(d => d.Count() == count));
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
StrongName\DesktopStrongNameProvider.cs (3)
81Debug.Assert(PathUtilities.IsAbsolute(resolvedKeyFile)); 134Debug.Assert(combinedPath == null || PathUtilities.IsAbsolute(combinedPath)); 164Debug.Assert(string.IsNullOrEmpty(keys.KeyFilePath) != string.IsNullOrEmpty(keys.KeyContainer));
StrongName\StrongNameFileSystem.cs (2)
33Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 39Debug.Assert(fullPath == null || PathUtilities.IsAbsolute(fullPath));
StrongName\StrongNameKeys.cs (5)
71Debug.Assert(diagnostic != null); 77Debug.Assert(keyContainerName == null || keyPair.IsDefault); 78Debug.Assert(keyPair.IsDefault || keyFilePath != null); 90Debug.Assert(!publicKey.IsDefaultOrEmpty); 212Debug.Assert(keyFilePath is object);
SwitchConstantValueHelper.cs (1)
89Debug.Assert(second.IsString);
SymbolDisplay\AbstractSymbolDisplayVisitor_Minimal.cs (1)
23Debug.Assert(IsMinimizing);
SymbolDisplay\AbstractSymbolDisplayVisitor.cs (9)
77Debug.Assert(format != null); 135Debug.Assert(constantValue != null); 154Debug.Assert(enumType.EnumUnderlyingType is not null); 183Debug.Assert(typeSymbol != null); 236Debug.Assert(enumType.EnumUnderlyingType is not null); 300Debug.Assert(zeroField.IdentityOpt is not null); 315Debug.Assert(enumType.EnumUnderlyingType is not null); 335Debug.Assert(enumType.EnumUnderlyingType is not null); 346Debug.Assert(match.IdentityOpt is not null);
SymbolDisplay\FormattedSymbol.cs (1)
27Debug.Assert(symbol != null && symbolDisplayFormat != null);
SymbolDisplay\FormattedSymbolList.cs (1)
23Debug.Assert(symbols != null);
Symbols\Attributes\AttributeDescription.cs (1)
48Debug.Assert(signature[0] == (byte)SignatureAttributes.Instance);
Symbols\Attributes\CommonAssemblyWellKnownAttributeData.cs (3)
460Debug.Assert(value != null); 461Debug.Assert(!value.IsUninitialized); 462Debug.Assert(value.Kind == ObsoleteAttributeKind.Experimental);
Symbols\Attributes\CommonAttributeData.cs (22)
67Debug.Assert(AttributeClass is not null); 202Debug.Assert(AttributeConstructor is object); 206Debug.Assert(parameters.Length == 5); 207Debug.Assert(parameters[0].Type.SpecialType == SpecialType.System_Byte); 208Debug.Assert(parameters[1].Type.SpecialType == SpecialType.System_Byte); 217Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_Int32); 218Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_Int32); 219Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_Int32); 227Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_UInt32); 228Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_UInt32); 229Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_UInt32); 274Debug.Assert(this.CommonConstructorArguments.Length == 1); 322Debug.Assert(args.Length <= 2); 327Debug.Assert(args[1].ValueInternal is object); 380Debug.Assert(args[1].ValueInternal is object); 394Debug.Assert(this.CommonConstructorArguments.Length == 0); 406Debug.Assert(arguments.AttributeSyntaxOpt is object); 412Debug.Assert(attribute.AttributeConstructor is object); 455Debug.Assert(attribute.AttributeClass is object); 479Debug.Assert(arguments.AttributeSyntaxOpt is object); 482Debug.Assert(attribute.AttributeClass is object); 590Debug.Assert(positionalArg.ValueInternal is object);
Symbols\Attributes\CommonAttributeDataComparer.cs (6)
33Debug.Assert(attr1 != null); 34Debug.Assert(attr2 != null); 46Debug.Assert(!equals || GetHashCode(attr1) == GetHashCode(attr2), "If attributes are equal for some options, their hashes must be equal for those same options."); 52Debug.Assert(attr != null); 115Debug.Assert(!result || GetHashCode(x) == GetHashCode(y), "If TypedConstants are equal, their hashes must be equal."); 146Debug.Assert(!equals || GetHashCode(pair1) == GetHashCode(pair2), "If named arguments are equal, their hashes must be equal.");
Symbols\Attributes\CommonEventEarlyWellKnownAttributeData.cs (2)
32Debug.Assert(value != null); 33Debug.Assert(!value.IsUninitialized);
Symbols\Attributes\CommonFieldEarlyWellKnownAttributeData.cs (2)
32Debug.Assert(value != null); 33Debug.Assert(!value.IsUninitialized);
Symbols\Attributes\CommonFieldWellKnownAttributeData.cs (2)
29Debug.Assert(offset >= 0); 56Debug.Assert(_constValue == ConstantValue.Unset);
Symbols\Attributes\CommonMethodEarlyWellKnownAttributeData.cs (2)
48Debug.Assert(value != null); 49Debug.Assert(!value.IsUninitialized);
Symbols\Attributes\CommonMethodWellKnownAttributeData.cs (3)
49Debug.Assert(attributeIndex >= 0); 58Debug.Assert(attributeIndex >= 0); 68Debug.Assert(attributeIndex >= 0);
Symbols\Attributes\CommonModuleWellKnownAttributeData.cs (5)
45Debug.Assert(HasDefaultCharSetAttribute); 51Debug.Assert(IsValidCharSet(value)); 80Debug.Assert(value != null); 81Debug.Assert(!value.IsUninitialized); 82Debug.Assert(value.Kind == ObsoleteAttributeKind.Experimental);
Symbols\Attributes\CommonParameterEarlyWellKnownAttributeData.cs (1)
28Debug.Assert(_defaultParameterValue == ConstantValue.Unset);
Symbols\Attributes\CommonPropertyEarlyWellKnownAttributeData.cs (2)
28Debug.Assert(value != null); 29Debug.Assert(!value.IsUninitialized);
Symbols\Attributes\CommonTypeEarlyWellKnownAttributeData.cs (4)
28Debug.Assert(_attributeUsageInfo.IsNull); 29Debug.Assert(!value.IsNull); 86Debug.Assert(value != null); 87Debug.Assert(!value.IsUninitialized);
Symbols\Attributes\CommonTypeWellKnownAttributeData.cs (4)
162Debug.Assert(value != null); 178Debug.Assert(charSet == CharSet.Ansi || charSet == CharSet.Unicode || charSet == Cci.Constants.CharSet_Auto); 199Debug.Assert(HasStructLayoutAttribute); 209Debug.Assert(HasStructLayoutAttribute);
Symbols\Attributes\CustomAttributesBag.cs (7)
72Debug.Assert(!IsPartComplete(CustomAttributeBagCompletionPart.DecodedWellKnownAttributeData) || IsPartComplete(CustomAttributeBagCompletionPart.EarlyDecodedWellKnownAttributeData)); 87Debug.Assert(IsPartComplete(CustomAttributeBagCompletionPart.EarlyDecodedWellKnownAttributeData)); 100Debug.Assert(!newCustomAttributes.IsDefault); 114Debug.Assert(IsPartComplete(CustomAttributeBagCompletionPart.Attributes)); 115Debug.Assert(!_customAttributes.IsDefault); 128Debug.Assert(IsPartComplete(CustomAttributeBagCompletionPart.DecodedWellKnownAttributeData)); 141Debug.Assert(IsPartComplete(CustomAttributeBagCompletionPart.EarlyDecodedWellKnownAttributeData));
Symbols\Attributes\DecodeWellKnownAttributeArguments.cs (1)
65Debug.Assert(this.HasDecodedData);
Symbols\Attributes\EarlyDecodeWellKnownAttributeArguments.cs (1)
69Debug.Assert(this.HasDecodedData);
Symbols\Attributes\MarshalAsAttributeDecoder.cs (6)
22Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 116Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 176Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 209Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 298Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 368Debug.Assert((object)arguments.AttributeSyntaxOpt != null);
Symbols\Attributes\MarshalPseudoCustomAttributeData.cs (17)
47Debug.Assert(parameterIndex == null || parameterIndex >= 0 && parameterIndex <= MaxMarshalInteger); 55Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 56Debug.Assert(parameterIndex == null || parameterIndex >= 0); 66Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 67Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 76Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 85Debug.Assert(elementCount >= 0 && elementCount <= MaxMarshalInteger); 93Debug.Assert(type >= 0 && (int)type <= MaxMarshalInteger); 108Debug.Assert( 119Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_CustomMarshaler); 127Debug.Assert(_marshalTypeNameOrSymbol == null || _marshalTypeNameOrSymbol is string); 136Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_CustomMarshaler); 145Debug.Assert(_marshalType == UnmanagedType.ByValTStr || _marshalType == UnmanagedType.LPArray || _marshalType == Cci.Constants.UnmanagedType_SafeArray || _marshalType == UnmanagedType.ByValArray); 154Debug.Assert(_marshalType == UnmanagedType.LPArray && _marshalParameterIndex <= short.MaxValue); 163Debug.Assert(_marshalType == UnmanagedType.LPArray || _marshalType == UnmanagedType.ByValArray); 172Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_SafeArray); 179Debug.Assert(_marshalType == Cci.Constants.UnmanagedType_SafeArray);
Symbols\Attributes\SecurityWellKnownAttributeData.cs (10)
32Debug.Assert(attributeIndex >= 0 && attributeIndex < totalSourceAttributes); 33Debug.Assert(action != 0); 40Debug.Assert(_lazySecurityActions.Length == totalSourceAttributes); 46Debug.Assert(attributeIndex >= 0 && attributeIndex < totalSourceAttributes); 47Debug.Assert(resolvedFilePath != null); 54Debug.Assert(_lazyPathsForPermissionSetFixup.Length == totalSourceAttributes); 64Debug.Assert(!customAttributes.IsDefault); 65Debug.Assert(_lazyPathsForPermissionSetFixup == null || _lazySecurityActions != null && _lazyPathsForPermissionSetFixup.Length == _lazySecurityActions.Length); 69Debug.Assert(_lazySecurityActions != null); 70Debug.Assert(_lazySecurityActions.Length == customAttributes.Length);
Symbols\Attributes\WellKnownAttributeData.cs (4)
44Debug.Assert(_isSealed == expected); 52Debug.Assert(_anyDataStored == expected); 70Debug.Assert(!data._isSealed); 71Debug.Assert(data._anyDataStored);
Symbols\INamedTypeSymbolInternal.cs (1)
38Debug.Assert(type.EnumUnderlyingType is not null);
Symbols\ISymbolExtensions.cs (2)
26Debug.Assert(reducedFrom is object); 40Debug.Assert(typeParameter.ReducedFrom is object);
Symbols\ITypeSymbol.cs (1)
251Debug.Assert(IsNullableType(type));
Symbols\SymbolKind.cs (1)
132Debug.Assert(!EnumUtilities.ContainsValue(FunctionType));
Symbols\TypedConstant.cs (3)
25Debug.Assert(kind == TypedConstantKind.Array || !(value is ImmutableArray<TypedConstant>)); 26Debug.Assert(!(value is ISymbol) || value is ISymbolInternal); 27Debug.Assert(type is object || kind == TypedConstantKind.Error);
Symbols\TypedConstantValue.cs (2)
25Debug.Assert(value == null || value is string || value.GetType().GetTypeInfo().IsEnum || (value.GetType().GetTypeInfo().IsPrimitive && !(value is System.IntPtr) && !(value is System.UIntPtr)) || value is ITypeSymbol); 57Debug.Assert(!(_value is ImmutableArray<TypedConstant>));
Symbols\TypeKind.cs (1)
107Debug.Assert(!EnumUtilities.ContainsValue(FunctionType));
Symbols\TypeLayout.cs (2)
23Debug.Assert(size >= 0 && (int)kind >= 0 && (int)kind <= 3); 26Debug.Assert(LayoutKind.Sequential == 0);
Syntax\AbstractWarningStateMap.cs (1)
56Debug.Assert(_warningStateMapEntries != null && _warningStateMapEntries.Length > 0);
Syntax\ChildSyntaxList.cs (5)
146Debug.Assert(offsetInSlot >= 0); 193Debug.Assert(result != null); 255Debug.Assert(node.FullSpan.Contains(targetPosition)); 261Debug.Assert(!green.IsList); 401Debug.Assert(_node is object);
Syntax\ChildSyntaxList.Enumerator.cs (3)
53Debug.Assert(_node != null); 66Debug.Assert(_node is object); 79Debug.Assert(_node != null);
Syntax\ChildSyntaxList.Reversed.cs (2)
30Debug.Assert(_node is object); 93Debug.Assert(_node is object);
Syntax\CommonSyntaxNodeRemover.cs (1)
36Debug.Assert(node is object);
Syntax\GreenNode.cs (7)
165Debug.Assert(value <= byte.MaxValue); 229Debug.Assert(0 <= offset && offset < FullWidth); 235Debug.Assert(i < SlotCount); 585Debug.Assert(found, "We must be able to find annotations since we had the bit set on ourselves"); 586Debug.Assert(annotations != null, "annotations should not be null"); 587Debug.Assert(annotations != s_noAnnotations, "annotations should not be s_noAnnotations"); 588Debug.Assert(annotations.Length != 0, "annotations should be non-empty");
Syntax\GreenNode.NodeEnumerable.cs (1)
43Debug.Assert(_started);
Syntax\GreenNode.NodeFlagsAndSlotCount.cs (2)
44Debug.Assert(shifted <= SlotCountTooLarge); 67Debug.Assert((ushort)value <= NodeFlagsMask);
Syntax\InternalSyntax\SeparatedSyntaxList.cs (2)
28Debug.Assert(!item.IsToken, "even elements of a separated list must be nodes"); 32Debug.Assert(item.IsToken, "odd elements of a separated list must be tokens");
Syntax\InternalSyntax\SyntaxList.cs (1)
77Debug.Assert(node is object);
Syntax\InternalSyntax\SyntaxList.WithLotsOfChildren.cs (1)
44Debug.Assert(offset >= 0 && offset < FullWidth);
Syntax\InternalSyntax\SyntaxList`1.cs (3)
41Debug.Assert(index >= 0); 42Debug.Assert(index <= _node.SlotCount); 73Debug.Assert(index == 0);
Syntax\InternalSyntax\SyntaxListBuilder.cs (2)
94Debug.Assert(_nodes[i].Value != null); 146Debug.Assert(newSize >= requiredSize);
Syntax\InternalSyntax\SyntaxListBuilder`1.cs (1)
50Debug.Assert(result != null);
Syntax\InternalSyntax\SyntaxListPool.cs (2)
40Debug.Assert(!_allocated.Contains(item)); 72Debug.Assert(_allocated.Contains(item));
Syntax\InternalSyntax\SyntaxNodeCache.cs (5)
144Debug.Assert(GetCacheHash(node) == hash); 345Debug.Assert(IsCacheable(node)); 366Debug.Assert(IsCacheable(parent)); 379Debug.Assert(IsCacheable(parent)); 393Debug.Assert(IsCacheable(parent));
Syntax\LineDirectiveMap.cs (5)
41Debug.Assert(directives != null); 160Debug.Assert(entries[i].CompareTo(entries[i + 1]) < 0); 174Debug.Assert(Entries.Length > 1); 179Debug.Assert( 190Debug.Assert(unmappedEndLine >= current.UnmappedLine - 1);
Syntax\LineDirectiveMap.LineMappingEntry.cs (1)
94Debug.Assert(state != PositionState.RemappedSpan);
Syntax\SeparatedSyntaxList.cs (6)
74Debug.Assert(item.IsNode, "Node missing in separated list."); 78Debug.Assert(item.IsToken, "Separator token missing in separated list."); 149Debug.Assert(node.IsList, "separated list cannot be a singleton separator"); 154Debug.Assert(green.IsToken); 443Debug.Assert(node is object); 456Debug.Assert(tr.UnderlyingNode is object);
Syntax\SeparatedSyntaxListBuilder.cs (1)
78Debug.Assert(separatorToken.Node is object);
Syntax\SyntaxDiffer.cs (13)
197System.Diagnostics.Debug.Assert(count >= 0); 445Debug.Assert(tr.UnderlyingNode is object); 451Debug.Assert(tr.UnderlyingNode is object); 457Debug.Assert(tr.UnderlyingNode is object); 466Debug.Assert(tr.UnderlyingNode is object); 477Debug.Assert(n1.UnderlyingNode is object); 488Debug.Assert(n2.UnderlyingNode is object); 588Debug.Assert(change.Range.Span.Start >= last.Range.Span.End); 611Debug.Assert(textChangeRange.Span.Start >= last.Range.Span.End); 644Debug.Assert(start >= 0); 645Debug.Assert(end >= 0); 669Debug.Assert(start >= 0); 670Debug.Assert(end >= 0);
Syntax\SyntaxList`1.cs (2)
151Debug.Assert(index == 0); 406Debug.Assert(_node == null || Count != 0);
Syntax\SyntaxListBuilder.cs (1)
144Debug.Assert(list.Node is object);
Syntax\SyntaxNavigator.cs (10)
123Debug.Assert(child.IsNode); 170Debug.Assert(child.IsNode); 190Debug.Assert(stepInto != null); 211Debug.Assert(stepInto != null); 454Debug.Assert(child.IsNode); 504Debug.Assert(child.IsNode); 532Debug.Assert(searchInsideCurrentTokenTrailingTrivia == false || stepInto != null); 562Debug.Assert(child.IsNode); 586Debug.Assert(searchInsideCurrentTokenLeadingTrivia == false || stepInto != null); 616Debug.Assert(child.IsNode);
Syntax\SyntaxNode.cs (9)
108Debug.Assert(width >= 0); 214Debug.Assert(this.IsList); 234Debug.Assert(this.IsList); 480Debug.Assert(!triviaContainsMatch(current.GetLeadingTriviaCore(), rawKind), "Should not have a match if the token doesn't even have leading trivia"); 483Debug.Assert(!triviaContainsMatch(current.GetTrailingTriviaCore(), rawKind), "Should never have a match in trailing trivia"); 765Debug.Assert(childNodeOrToken.FullSpan.Contains(position), "ChildThatContainsPosition's return value does not contain the requested position."); 1505Debug.Assert(Eof.EndPosition == position); 1522Debug.Assert(curNode.RawKind != 0); 1523Debug.Assert(curNode.FullSpan.Contains(position));
Syntax\SyntaxNode.Iterators.cs (19)
106Debug.Assert(_stack is object); 121Debug.Assert(_stack is object); 144Debug.Assert(_stack is object); 258Debug.Assert(_discriminatorStack is object); 269Debug.Assert(_discriminatorStack is object); 281Debug.Assert(_discriminatorStack is object); 290Debug.Assert(_discriminatorStack is object); 297Debug.Assert(_discriminatorStack is object); 304Debug.Assert(_discriminatorStack is object); 355Debug.Assert(_discriminatorStack is object); 366Debug.Assert(_discriminatorStack is object); 378Debug.Assert(_discriminatorStack is object); 385Debug.Assert(_discriminatorStack is object); 386Debug.Assert(_tokenStack is object); 395Debug.Assert(_discriminatorStack is object); 402Debug.Assert(_discriminatorStack is object); 409Debug.Assert(_discriminatorStack is object); 416Debug.Assert(_discriminatorStack is object); 417Debug.Assert(_tokenStack is object);
Syntax\SyntaxNodeExtensions_Tracking.cs (3)
161Debug.Assert(node is object); 186Debug.Assert(node is object); 206Debug.Assert(node is object);
Syntax\SyntaxNodeOrToken.cs (8)
47Debug.Assert(!node.Green.IsList, "node cannot be a list"); 55Debug.Assert(parent == null || !parent.Green.IsList, "parent cannot be a list"); 56Debug.Assert(token != null || (parent == null && position == 0 && index == 0), "parts must form a token"); 57Debug.Assert(token == null || token.IsToken, "token must be a token"); 58Debug.Assert(index >= 0, "index must not be negative"); 59Debug.Assert(parent == null || token != null, "null token cannot have parent"); 137Debug.Assert(UnderlyingNode is not null); 703Debug.Assert(
Syntax\SyntaxNodeOrTokenList.cs (1)
43Debug.Assert(node != null || index == 0);
Syntax\SyntaxToken.cs (4)
31Debug.Assert(parent == null || !parent.Green.IsList, "list cannot be a parent"); 32Debug.Assert(token == null || token.IsToken, "token must be a token"); 42Debug.Assert(token == null || token.IsToken, "token must be a token"); 84Debug.Assert(Node is object);
Syntax\SyntaxTokenList.cs (7)
31Debug.Assert(tokenOrList != null || (position == 0 && index == 0 && parent == null)); 32Debug.Assert(position >= 0); 33Debug.Assert(tokenOrList == null || (tokenOrList.IsToken) || (tokenOrList.IsList)); 103Debug.Assert(token.Node is object); 258Debug.Assert(this.Count >= offset + count); 271Debug.Assert(Node is object); 280Debug.Assert(node.IsList || (i == 0 && !node.IsList));
Syntax\SyntaxTokenList.Enumerator.cs (2)
95Debug.Assert(_singleNodeOrList is object); 97Debug.Assert(_current is object);
Syntax\SyntaxTokenList.Reversed.cs (2)
111Debug.Assert(_singleNodeOrList is object); 113Debug.Assert(_current is object);
Syntax\SyntaxTokenListBuilder.cs (6)
36Debug.Assert(item.Node is object); 98Debug.Assert(_nodes[0] is object); 99Debug.Assert(_nodes[1] is object); 102Debug.Assert(_nodes[0] is object); 103Debug.Assert(_nodes[1] is object); 104Debug.Assert(_nodes[2] is object);
Syntax\SyntaxTree.cs (2)
380Debug.Assert(!_lazyChecksum.IsDefault); 381Debug.Assert(_lazyHashAlgorithm != default(SourceHashAlgorithm));
Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
Syntax\SyntaxTrivia.cs (2)
35Debug.Assert(this.RawKind != 0 || this.Equals(default(SyntaxTrivia))); 65Debug.Assert(node is object);
Syntax\SyntaxTriviaList.cs (2)
453Debug.Assert(Node is object); 459Debug.Assert(node.IsList || (i == 0 && !node.IsList));
Syntax\SyntaxTriviaList.Enumerator.cs (5)
57Debug.Assert(token.Node is object); 59Debug.Assert(node is object); 68Debug.Assert(token.Node is object); 83Debug.Assert(trailingGreen is object); 104Debug.Assert(_singleNodeOrList is object);
Syntax\SyntaxTriviaList.Reversed.cs (2)
108Debug.Assert(_singleNodeOrList is object); 112Debug.Assert(_current is object);
Syntax\TranslationSyntaxReference.cs (1)
37Debug.Assert(node.SyntaxTree == _reference.SyntaxTree);
Text\ChangedText.cs (4)
23Debug.Assert(newText is CompositeText || newText is SubText || newText is StringText || newText is LargeText); 25Debug.Assert(oldText != newText); 26Debug.Assert(!changeRanges.IsDefault); 254Debug.Assert(changeSets.Count > 1);
Text\CompositeText.cs (10)
31Debug.Assert(!segments.IsDefaultOrEmpty); 32Debug.Assert(segments.Length > 0); 44Debug.Assert(_segments[i].Length > 0); 441Debug.Assert(compositeText.Segments.Length > 0); 452Debug.Assert(segment.Length > 0); 455Debug.Assert(i == compositeText.Segments.Length - 1 || segment[^1] != '\r' || compositeText.Segments[i + 1][0] != '\n'); 497Debug.Assert(firstSegmentIndexInclusive <= lastSegmentIndexInclusive); 514Debug.Assert((nextSegment.Lines.Count == 1) || 526Debug.Assert(lastSegment.Lines.Count >= 1); 540Debug.Assert(resultLine.ToString().All(static c => !TextUtilities.IsAnyLineBreakCharacter(c)));
Text\LargeText.cs (1)
66Debug.Assert(longLength > 0 && longLength <= int.MaxValue); // GetMaxCharCountOrThrowIfHuge should have thrown.
Text\SourceText.cs (10)
70Debug.Assert(embeddedTextBlob.IsDefault || !checksum.IsDefault); 490Debug.Assert(0 <= span.Start && span.Start <= span.End); 635Debug.Assert(charBuffer.Length == CharBufferSize); 1011Debug.Assert(priorLineBreakLength is 1 or 2); 1246Debug.Assert(buffer1.Length == buffer2.Length); 1247Debug.Assert(buffer1.Length == CharBufferSize); 1280Debug.Assert(length <= source.Length); 1350Debug.Assert(stream.CanSeek); 1378Debug.Assert(checksumAlgorithm != SourceHashAlgorithm.None); 1379Debug.Assert(checksumAlgorithm != underlying.ChecksumAlgorithm);
Text\SourceTextStream.cs (1)
39Debug.Assert(source.Encoding != null || useDefaultEncodingIfNull);
Text\SubText.cs (2)
122Debug.Assert(_subText.UnderlyingText[underlyingSpanEnd - 1] == '\r' && _subText.UnderlyingText[underlyingSpanEnd] == '\n'); 189Debug.Assert(resultLine.ToString().All(static c => !TextUtilities.IsAnyLineBreakCharacter(c)));
Text\TextChange.cs (1)
91Debug.Assert(change.NewText is object);
Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
Text\TextLine.cs (3)
100Debug.Assert(span.Start == 0 || TextUtilities.IsAnyLineBreakCharacter(text[span.Start - 1])); 101Debug.Assert(span.End == text.Length || TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1])); 102Debug.Assert(lineBreakLength is >= 0 and <= 2);
VersionHelper.cs (2)
55Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 200Debug.Assert(revision < ushort.MaxValue);
WellKnownMembers.cs (1)
5966Debug.Assert(!descriptor.IsSpecialTypeMember); // Members of types from core library should be in the SpecialMember set instead.
WellKnownTypes.cs (6)
819Debug.Assert(expectedName == (startingOffset + i).ToString()); 842Debug.Assert(typeId != WellKnownType.ExtSentinel); 848Debug.Assert(typeId != WellKnownType.ExtSentinel); 871Debug.Assert(WellKnownType.First != 0); 878Debug.Assert(invokeArgumentCount >= 0); 887Debug.Assert(invokeArgumentCount >= 0);
Xml\XmlCharType.cs (8)
1125Debug.Assert(str != null); 1126Debug.Assert(startPos + len <= str.Length); 1127Debug.Assert(startPos <= str.Length); 1141Debug.Assert(chars != null); 1142Debug.Assert(startPos + len <= chars.Length); 1143Debug.Assert(startPos <= chars.Length); 1173Debug.Assert(start <= end); 1182Debug.Assert(start <= end);
XmlFileResolver.cs (2)
59Debug.Assert(resolvedPath == null || PathUtilities.IsAbsolute(resolvedPath)); 69Debug.Assert(resolvedPath == null || PathUtilities.IsAbsolute(resolvedPath));
Microsoft.CodeAnalysis.Analyzers (584)
MetaAnalyzers\CompareSymbolsCorrectlyAnalyzer.cs (1)
241Debug.Assert(destinationTypeIndex < method.TypeArguments.Length);
MetaAnalyzers\CompilerExtensionStrictApiAnalyzer.cs (1)
173Debug.Assert(attribute.ApplicationSyntaxReference is not null,
MetaAnalyzers\CompilerExtensionTargetFrameworkAnalyzer.cs (1)
122Debug.Assert(attribute.ApplicationSyntaxReference is not null,
MetaAnalyzers\DiagnosticAnalyzerAPIUsageAnalyzer.cs (3)
106Debug.Assert(added); 135Debug.Assert(SymbolEqualityComparer.Default.Equals(typeToProcess.ContainingAssembly, declaredType.ContainingAssembly)); 136Debug.Assert(namedTypesToAccessedTypesMap.ContainsKey(typeToProcess));
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer_ResourceStringsFormat.cs (2)
42Debug.Assert(HasResxAdditionalFiles(options)); 43Debug.Assert(!resourceFileName.EndsWith(".resx", StringComparison.OrdinalIgnoreCase));
MetaAnalyzers\DiagnosticDescriptorCreationAnalyzer.cs (5)
693Debug.Assert(diagnostic.Id is DiagnosticIds.DefineDiagnosticTitleCorrectlyRuleId or 963Debug.Assert(IsMultiSentences(s)); 973Debug.Assert(EndsWithPeriod(s)); 982Debug.Assert(ContainsLineReturn(s)); 1023Debug.Assert(HasLeadingOrTrailingWhitespaces(s));
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.cs (4)
92Debug.Fail($"Unsupported diagnostic ID {diagnostic.Id}"); 337Debug.Fail($"Unexpected line {lineText}"); 363Debug.Fail($"Unexpected line {lineText}"); 413Debug.Assert(newRuleEntriesToAdd == null || newRuleEntriesToAdd.Count == 0);
MetaAnalyzers\Fixers\AnalyzerReleaseTrackingFix.FixAllProvider.cs (1)
61Debug.Fail($"Unknown FixAllScope '{fixAllContext.Scope}'");
MetaAnalyzers\Fixers\DefineDiagnosticDescriptorArgumentsCorrectlyFix.CustomFixAllProvider.cs (2)
39Debug.Assert(fixAllContext.CodeActionEquivalenceKey.EndsWith(AdditionalDocumentEquivalenceKeySuffix, StringComparison.Ordinal)); 74Debug.Fail($"Unknown FixAllScope '{fixAllContext.Scope}'");
MetaAnalyzers\RegisterActionAnalyzer.cs (1)
540Debug.Assert(IsContextType(contextParameter.Type, _codeBlockStartAnalysisContext, _compilationStartAnalysisContext, _operationBlockStartAnalysisContext));
MetaAnalyzers\ReleaseTrackingHelper.cs (1)
482Debug.Assert(kind is ReleaseTrackingRuleEntryKind.New or ReleaseTrackingRuleEntryKind.Removed);
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (11)
111Debug.Assert(source != null); 112Debug.Assert(scheduler != null); 113Debug.Assert(body != null); 276Debug.Assert(source != null); 277Debug.Assert(scheduler != null); 278Debug.Assert(body != null); 488Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 495Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 528Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 540Debug.Assert(!Cancellation.IsCancellationRequested); 556Debug.Assert(taskSet, "Complete should only be called once.");
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (3)
60Debug.Assert(child.Symbol.Kind == SymbolKind.Namespace); 61Debug.Assert(!child.Children.IsEmpty); 62Debug.Assert(child.Children.All(grandChild => grandChild.Symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
35Debug.Assert( 43Debug.Assert(depthOfInheritance.HasValue == (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace || symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
26Debug.Assert(childrenCount != 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
495Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 507Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
210Debug.Assert(isInsideAnonymousObjectInitializer == 288Debug.Assert(success); 289Debug.Assert(cfg != null); 320Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 333Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 495Debug.Assert(parameterIndex >= 0); 496Debug.Assert(parameterIndex < arguments.Length);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
46Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
38Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
32Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
60Debug.Fail("FixAllScope.ContainingMember and FixAllScope.ContainingType are not supported in CodeStyle layer");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
342Debug.Assert(desiredGroupIndex >= 0); 343Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
206Debug.Assert(false, message + ". " + diagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
34Debug.Assert(diagnostic != null); 88Debug.Assert(analyzerConfigPath != null); 89Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
102Debug.Fail("Previous container didn't map back to a normal accessor container."); 111Debug.Fail("Accessor count shouldn't have changed as there were no top level edits."); 132Debug.Fail("Member count shouldn't have changed as there were no top level edits."); 139Debug.Fail("Child at indicated index should be a node as there were no top level edits.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (3)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel); 227Debug.Assert(replacedParent.GetAnnotatedNodesAndTokens(annotation).Count() == 1); 246Debug.Assert(newRoot.GetAnnotatedNodesAndTokens(marker).Count() == 1);
Microsoft.CodeAnalysis.AnalyzerUtilities (977)
src\1e7e9f16bf7f1945\ValueContentAnalysis.CoreAnalysisDataDomain.cs (2)
52Debug.Assert(Compare(forwardEdgeAnalysisData, resultMap) <= 0); 53Debug.Assert(Compare(backEdgeAnalysisData, resultMap) <= 0);
src\1e7e9f16bf7f1945\ValueContentAnalysis.ValueContentAnalysisDomain.cs (1)
35Debug.Assert(forwardEdgeAnalysisData.IsReachableBlockData == backEdgeAnalysisData.IsReachableBlockData);
src\2e2796bccd1466f6\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (5)
142Debug.Fail("Can we have a tainted data parameter with no syntax references?"); 328Debug.Fail("Are the tainted data sources misconfigured?"); 367Debug.Fail("Are the tainted data sources misconfigured?"); 406Debug.Fail("Are the tainted data sanitizers misconfigured?"); 466Debug.Assert(!this.TryGetInterproceduralAnalysisResult(invocationOperation, out _));
src\66dd3055a1c91c38\PointsToAnalysis.CorePointsToAnalysisDataDomain.cs (2)
122Debug.Assert(Compare(forwardEdgeAnalysisData.CoreAnalysisData, resultMap) <= 0); 123Debug.Assert(Compare(backEdgeAnalysisData.CoreAnalysisData, resultMap) <= 0);
src\66dd3055a1c91c38\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (16)
91Debug.Assert(!ShouldBeTracked(analysisEntity)); 92Debug.Assert(!CurrentAnalysisData.TryGetValue(analysisEntity, out var existingValue) || existingValue == PointsToAbstractValue.NoLocation); 177Debug.Assert(ShouldBeTracked(analysisEntity) || !HasAbstractValue(analysisEntity)); 183Debug.Assert(value == _defaultPointsToValueGenerator.GetOrCreateDefaultValue(analysisEntity)); 184Debug.Assert(!CurrentAnalysisData.TryGetValue(analysisEntity, out var currentValue) || 254Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData == null); 282Debug.Assert(operation.Type == null || !operation.Type.IsNonNullableValueType() || defaultValue == PointsToAbstractValue.NoLocation); 289Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 451Debug.Assert(!targetAnalysisData.HasAbstractValue(key)); 452Debug.Assert(!sourceAnalysisData.HasAbstractValue(key)); 514Debug.Assert(IsValidValueForPredicateAnalysis(nullState) || nullState == NullAbstractValue.Invalid); 563Debug.Assert(IsValidValueForPredicateAnalysis(value)); 791Debug.Assert(value.NullState == NullAbstractValue.NotNull || DataFlowAnalysisContext.InterproceduralAnalysisData != null); 893Debug.Assert(operation.Initializer == null || initializerValue == pointsToAbstractValue); 1193Debug.Assert(!inference.AlwaysSucceed || !inference.AlwaysFail); 1214Debug.Assert(!inference.IsUnboxing);
src\683181b2796de991\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (7)
34Debug.Assert(analysisContext.OwningSymbol.Kind == SymbolKind.Method); 35Debug.Assert(analysisContext.PointsToAnalysisResult != null); 176Debug.Assert(_hazardousParameterUsageBuilder != null); 193Debug.Assert(IsNotOrMaybeValidatedLocation(location)); 290Debug.Assert(!targetMethod.IsLambdaOrLocalFunctionOrDelegate()); 319Debug.Assert(!targetMethod.IsVirtual && !targetMethod.IsOverride); 358Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\683181b2796de991\ParameterValidationAnalysisContext.cs (3)
76Debug.Assert(pointsToAnalysisResult != null); 77Debug.Assert(copyAnalysisResult == null); 78Debug.Assert(valueContentAnalysisResult == null);
src\97c55a67c449f67c\GlobalFlowStateAnalysis.GlobalFlowStateAnalysisValueSetDomain.cs (5)
78Debug.Assert(value1.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 79Debug.Assert(value2.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 144Debug.Assert(value1.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 145Debug.Assert(value2.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 228Debug.Assert(value1.Height == value2.Height);
src\97c55a67c449f67c\GlobalFlowStateDataFlowOperationVisitor.cs (1)
86Debug.Assert(input.ContainsKey(GlobalEntity));
src\97c55a67c449f67c\GlobalFlowStateValueSetFlowOperationVisitor.cs (2)
45Debug.Assert(HasPredicatedGlobalState || !negate); 63Debug.Assert(HasPredicatedGlobalState || value.Parents.IsEmpty);
src\a03b2aad21e28a8a\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (12)
60Debug.Assert(analysisContext.PointsToAnalysisResult != null); 78Debug.Assert(this.TrackedTypeSymbols.Any()); 173Debug.Assert(this.DataFlowAnalysisContext.ValueContentAnalysisResult != null); 187Debug.Fail("Unhandled ConstructorMapper"); 271Debug.Fail($"Unhandled PointsToAbstractValue: Kind = {pointsToAbstractValue.Kind}, NullState = {pointsToAbstractValue.NullState}"); 300Debug.Assert(this.DataFlowAnalysisContext.ValueContentAnalysisResult != null); 306Debug.Fail("Unhandled PropertyMapper"); 381Debug.Fail("Expected to have tracked assignment operations for a given location"); 408Debug.Fail("Expected to have tracked assignment operations with locations"); 431Debug.Fail("Expected to have tracked assignment operations with unknown PointsTo"); 440Debug.Fail($"Unhandled PointsToAbstractValue: Kind = {pointsToAbstractValue.Kind}, NullState = {pointsToAbstractValue.NullState}"); 722Debug.Fail("Can LValues FlowCaptureReferences have more than one operation?");
src\a172c07bebba4cd8\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (8)
36Debug.Assert(IDisposableNamedType != null); 37Debug.Assert(CollectionNamedTypes.All(ct => ct.TypeKind == TypeKind.Interface)); 38Debug.Assert(analysisContext.DisposeOwnershipTransferLikelyTypes != null); 39Debug.Assert(analysisContext.PointsToAnalysisResult != null); 181Debug.Assert(!escapedLocations.IsEmpty); 182Debug.Assert(parameter.RefKind != RefKind.None); 190Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 427Debug.Assert(disposedState == DisposeAbstractValue.NotDisposed);
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (11)
111Debug.Assert(source != null); 112Debug.Assert(scheduler != null); 113Debug.Assert(body != null); 276Debug.Assert(source != null); 277Debug.Assert(scheduler != null); 278Debug.Assert(body != null); 488Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 495Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 528Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 540Debug.Assert(!Cancellation.IsCancellationRequested); 556Debug.Assert(taskSet, "Complete should only be called once.");
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (3)
60Debug.Assert(child.Symbol.Kind == SymbolKind.Namespace); 61Debug.Assert(!child.Children.IsEmpty); 62Debug.Assert(child.Children.All(grandChild => grandChild.Symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
35Debug.Assert( 43Debug.Assert(depthOfInheritance.HasValue == (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace || symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
26Debug.Assert(childrenCount != 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
495Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 507Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
210Debug.Assert(isInsideAnonymousObjectInitializer == 288Debug.Assert(success); 289Debug.Assert(cfg != null); 320Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 333Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 495Debug.Assert(parameterIndex >= 0); 496Debug.Assert(parameterIndex < arguments.Length);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
46Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
38Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
32Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\BasicBlockExtensions.cs (1)
199Debug.Assert(ordinal < basicBlock.Ordinal);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\ControlFlowConditionKindExtensions.cs (1)
22Debug.Fail($"Unsupported conditional kind: '{controlFlowConditionKind}'");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAbstractValue.cs (10)
24Debug.Assert(analysisEntities.IsEmpty != kind.IsKnown()); 25Debug.Assert(kind != CopyAbstractValueKind.KnownReferenceCopy || analysisEntities.All(a => !a.Type.IsValueType)); 41Debug.Assert(!kind.IsKnown()); 54Debug.Assert(!analysisEntities.IsEmpty); 59Debug.Assert(AnalysisEntities.Contains(entityToRemove)); 60Debug.Assert(AnalysisEntities.Count > 1); 61Debug.Assert(Kind.IsKnown()); 68Debug.Assert(entitiesToRemove.All(AnalysisEntities.Contains)); 69Debug.Assert(AnalysisEntities.Count > 1); 70Debug.Assert(Kind.IsKnown());
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyAbstractValueDomain.cs (4)
73Debug.Assert(value1.Kind.IsKnown()); 74Debug.Assert(value2.Kind.IsKnown()); 83Debug.Assert(_entitiesDomain.Equals(mergedEntities, value1.AnalysisEntities)); 88Debug.Assert(_entitiesDomain.Equals(mergedEntities, value2.AnalysisEntities));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.CopyDataFlowOperationVisitor.cs (7)
157Debug.Assert(ReferenceEquals(sourceCopyAnalysisData, targetCopyAnalysisData) || fromPredicateKind.HasValue); 181Debug.Assert(existingValue.AnalysisEntities.Contains(analysisEntity)); 319Debug.Assert(operation.Parameter?.RefKind is RefKind.Ref or RefKind.Out); 453Debug.Assert(SymbolEqualityComparer.Default.Equals(throwBranchWithExceptionType.ExceptionType, ExceptionNamedType)); 545Debug.Assert(copyValue.AnalysisEntities.Contains(key)); 546Debug.Assert(predicate == null || copyValue.AnalysisEntities.All(predicate)); 628Debug.Assert(!inference.AlwaysSucceed || !inference.AlwaysFail);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.cs (1)
41Debug.Fail("Expected non-null CFG");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (10)
52Debug.Assert(IsReachableBlockData || !data.IsReachableBlockData); 93Debug.Assert(HasPredicatedData); 169Debug.Assert(newCopyEntities.SetEquals(currentValue.AnalysisEntities)); 180Debug.Assert(predicatedData.All(kvp => kvp.Value.AnalysisEntities.IsSubsetOf(coreAnalysisData[kvp.Key].AnalysisEntities))); 206Debug.Assert(!coreCopyAnalysisData.IsDisposed); 212Debug.Assert(kvp.Value.AnalysisEntities.Contains(kvp.Key)); 216Debug.Assert(map[analysisEntity] == kvp.Value); 228Debug.Assert(kvp.Value.AnalysisEntities.Contains(defaultCopyValyeEntity)); 229Debug.Assert(map.ContainsKey(defaultCopyValyeEntity)); 239Debug.Assert(!analysisEntity.HasUnknownInstanceLocation, "Don't track entities if do not know about it's instance location");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAbstractValue.cs (6)
26Debug.Assert(kind != DisposeAbstractValueKind.Disposed); 38Debug.Assert(Kind != DisposeAbstractValueKind.NotDisposable); 45Debug.Assert(Kind != DisposeAbstractValueKind.NotDisposable); 46Debug.Assert(Kind != DisposeAbstractValueKind.Unknown); 60Debug.Assert(disposingOrEscapingOperations.IsEmpty); 66Debug.Assert(!disposingOrEscapingOperations.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.cs (2)
58Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, wellKnownTypeProvider.Compilation)); 98Debug.Assert(wellKnownTypeProvider.TryGetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemIDisposable, out _));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.DisposeAbstractValueDomain.cs (3)
83Debug.Assert(!mergedDisposingOperations.IsEmpty); 89Debug.Assert(!value1.DisposingOrEscapingOperations.IsEmpty || !value2.DisposingOrEscapingOperations.IsEmpty); 156Debug.Fail($"Unhandled dispose value kind merge: {value1.Kind} and {value2.Kind}");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisContext.cs (3)
99Debug.Assert(pointsToAnalysisResult != null); 100Debug.Assert(copyAnalysisResult == null); 101Debug.Assert(valueContentAnalysisResult == null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\GlobalFlowStateAnalysis\GlobalFlowStateAnalysisValueSet.cs (13)
33Debug.Assert((!analysisValues.IsEmpty || !parents.IsEmpty) == (kind == GlobalFlowStateAnalysisValueSetKind.Known)); 34Debug.Assert(analysisValues.All(value => value != null)); 35Debug.Assert(parents.All(parent => parent != null)); 36Debug.Assert(height >= 0); 37Debug.Assert(height == 0 || kind == GlobalFlowStateAnalysisValueSetKind.Known); 38Debug.Assert(height == 0 == parents.IsEmpty); 51Debug.Assert(!analysisValues.IsEmpty || !parents.IsEmpty); 65Debug.Assert(Kind == GlobalFlowStateAnalysisValueSetKind.Known); 89Debug.Assert(Kind != GlobalFlowStateAnalysisValueSetKind.Unknown); 107Debug.Assert(Kind == GlobalFlowStateAnalysisValueSetKind.Known); 135Debug.Assert(AnalysisValues.Count > 1); 136Debug.Assert(parentsBuilder.Count > 1); 145Debug.Assert(parents.Count > 0);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ParameterValidationAnalysis\ParameterValidationAnalysis.cs (1)
41Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, compilation));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAbstractValue.cs (18)
33Debug.Assert(!locations.IsEmpty); 34Debug.Assert(locations.All(location => !location.IsNull) || nullState != NullAbstractValue.NotNull); 35Debug.Assert(nullState != NullAbstractValue.Undefined); 36Debug.Assert(nullState != NullAbstractValue.Invalid); 37Debug.Assert(!locations.Any(l => l.IsAnalysisEntityDefaultLocation && l.AnalysisEntity!.HasUnknownInstanceLocation)); 38Debug.Assert(locations.Count <= LocationThreshold); 48Debug.Assert(!lValueCapturedOperations.IsEmpty); 58Debug.Assert(kind != PointsToAbstractValueKind.KnownLocations); 59Debug.Assert(kind != PointsToAbstractValueKind.KnownLValueCaptures); 69Debug.Assert(!location.IsNull, "Use 'PointsToAbstractValue.NullLocation' singleton"); 70Debug.Assert(!location.IsNoLocation, "Use 'PointsToAbstractValue.NoLocation' singleton"); 82Debug.Assert(!locations.IsEmpty); 114Debug.Assert(!lValueCapturedOperations.IsEmpty); 120Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 147Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 164Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 165Debug.Assert(NullState != NullAbstractValue.Null); 177Debug.Assert(Locations.All(location => !location.IsNull));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.cs (2)
73Debug.Fail("Expected non-null CFG"); 100Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToAbstractValueDomain.cs (5)
127Debug.Assert(value2.Kind == PointsToAbstractValueKind.KnownLValueCaptures); 133Debug.Assert(value1.Kind == PointsToAbstractValueKind.KnownLocations); 134Debug.Assert(value2.Kind == PointsToAbstractValueKind.KnownLocations); 141Debug.Assert(Compare(value1, result) <= 0); 142Debug.Assert(Compare(value2, result) <= 0);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.PointsToAnalysisDomain.cs (1)
39Debug.Assert(forwardEdgeAnalysisData.IsReachableBlockData == backEdgeAnalysisData.IsReachableBlockData);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisContext.cs (3)
42Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None); 76Debug.Assert(pointsToAnalysisResult == null); 77Debug.Assert(valueContentAnalysisResult == null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (6)
76Debug.Assert(IsReachableBlockData || !data.IsReachableBlockData); 108Debug.Assert(key.CaptureId == null); 126Debug.Assert(!corePointsToAnalysisData.IsDisposed); 141Debug.Assert(value.Kind != PointsToAbstractValueKind.Undefined); 142Debug.Assert(!key.IsLValueFlowCaptureEntity || value.Kind == PointsToAbstractValueKind.KnownLValueCaptures); 143Debug.Assert(PointsToAnalysis.ShouldBeTracked(key, PointsToAnalysisKind.Complete, isDisposable));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\TrackedEntitiesBuilder.cs (2)
33Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None); 50Debug.Assert(analysisEntity.ShouldBeTrackedForPointsToAnalysis(PointsToAnalysisKind));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.cs (1)
154Debug.Assert(index >= 0);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.ValuePool.cs (1)
33Debug.Assert(values[i] == i, $"{nameof(PropertySetAbstractValueKind)} isn't a contiguous enum starting at 0");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.cs (2)
203Debug.Assert(success); 206Debug.Fail("Expected non-null CFG");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysisContext.cs (2)
115Debug.Assert(pointsToAnalysisResult != null); 116Debug.Assert(copyAnalysisResult == null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAbstractValue.cs (3)
77Debug.Assert(value1.Kind == TaintedDataAbstractValueKind.Tainted); 78Debug.Assert(value2.Kind == TaintedDataAbstractValueKind.Tainted); 95Debug.Assert(value.Kind == TaintedDataAbstractValueKind.Tainted);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.cs (1)
56Debug.Fail("Expected non-null CFG");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysisContext.cs (2)
58Debug.Assert(pointsToAnalysisResult != null); 81Debug.Assert(pointsToAnalysisResult != null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataConfig.cs (4)
200Debug.Fail($"SinkKind {sinkKind} entry missing from {typeof(T).Name} map"); 251Debug.Fail($"Unhandled SinkKind {sinkKind}"); 307Debug.Fail($"Unhandled SinkKind {sinkKind}"); 362Debug.Fail($"Unhandled SinkKind {sinkKind}");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (1)
117Debug.Fail("Expected non-null 'namedTypeSymbol'");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAbstractValue.cs (4)
204Debug.Assert(value1 == ValueContainsNonLiteralState.No); 205Debug.Assert(value2 == ValueContainsNonLiteralState.No); 241Debug.Assert(IsLiteralState); 242Debug.Assert(value2.IsLiteralState);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysis.cs (1)
64Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, wellKnownTypeProvider.Compilation));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\ValueContentAnalysis\ValueContentAnalysisContext.cs (1)
82Debug.Assert(valueContentAnalysisResult == null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractDataFlowAnalysisContext.cs (5)
46Debug.Assert(owningSymbol.Kind is SymbolKind.Method or 50Debug.Assert(Equals(owningSymbol.OriginalDefinition, owningSymbol)); 51Debug.Assert(pointsToAnalysisResult == null || 53Debug.Assert(copyAnalysisResult == null || 55Debug.Assert(valueContentAnalysisResult == null ||
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractDomain.cs (1)
59Debug.Fail("Non-monotonic merge");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (4)
37Debug.Assert(isSpecialSingleton ^ (locationType != null)); 50Debug.Assert(creation != null ^ symbol != null ^ analysisEntity != null ^ captureId != null); 51Debug.Assert(locationType != null); 129Debug.Assert(Creation != null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocationDataFlowOperationVisitor.cs (5)
25Debug.Assert(analysisContext.PointsToAnalysisResult != null); 43Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData != null); 69Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 99Debug.Assert(Equals(analysisEntity.Symbol, parameter)); 109Debug.Assert(SymbolEqualityComparer.Default.Equals(analysisEntity.Symbol, parameter));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AddressSharedEntitiesProvider.cs (1)
85Debug.Assert(builder.All(e => !e.HasUnknownInstanceLocation));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntity.cs (16)
49Debug.Assert(!indices.IsDefault); 50Debug.Assert(symbol != null || !indices.IsEmpty || instanceReferenceOperationSyntax != null || captureId.HasValue); 51Debug.Assert(parent == null || parent.Type.HasValueCopySemantics() || !indices.IsEmpty); 52Debug.Assert(entityForInstanceLocation == null || parent == null); 53Debug.Assert(entityForInstanceLocation == null || location.Kind == PointsToAbstractValueKind.KnownLocations); 72Debug.Assert(symbol != null || !indices.IsEmpty); 79Debug.Assert(instanceReferenceOperation != null); 97Debug.Assert(symbol != null || !indices.IsEmpty); 98Debug.Assert(parent == null || parent.InstanceLocation == instanceLocation); 99Debug.Assert(entityForInstanceLocation == null || instanceLocation.Kind == PointsToAbstractValueKind.KnownLocations); 119Debug.Assert(instanceLocation.Locations.Count == 1); 120Debug.Assert(instanceLocation.Locations.Single().Creation == null); 121Debug.Assert(Equals(instanceLocation.Locations.Single().Symbol, typeSymbol)); 128Debug.Assert(EqualsIgnoringInstanceLocation(analysisEntityToMerge)); 129Debug.Assert(!InstanceLocation.Equals(analysisEntityToMerge.InstanceLocation)); 160Debug.Assert(Parent == null || result);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityBasedPredicateAnalysisData.cs (5)
44Debug.Assert(data1.IsReachableBlockData == data2.IsReachableBlockData); 75Debug.Assert(baseCompareResult < 0, "Non-monotonic Merge function"); 80Debug.Assert(coreAnalysisDataCompareResult <= 0, "Non-monotonic Merge function"); 95Debug.Assert(!CoreAnalysisData.IsDisposed); 96AssertValidPredicatedAnalysisData(map => Debug.Assert(!map.IsDisposed));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityDataFlowOperationVisitor.cs (21)
34Debug.Assert(!analysisContext.PredicateAnalysis || SupportsPredicateAnalysis); 66Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 82Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 103Debug.Assert(locals.Any() || flowCaptures.Any()); 119Debug.Fail("TryCreateForSymbolDeclaration failed"); 157Debug.Assert(analysisEntity.Symbol is IParameterSymbol parameter && parameter.IsParams); 258Debug.Assert(success || assignedValueEntity == null); 280Debug.Assert(addressSharedCopyValue.AnalysisEntities.Contains(targetAnalysisEntity)); 294Debug.Assert(SymbolEqualityComparer.Default.Equals(analysisEntity.Symbol, parameter)); 307Debug.Assert(Equals(analysisEntity.Symbol, parameter)); 328Debug.Assert(HasPointsToAnalysisResult); 329Debug.Assert(analysisEntity.Type.HasValueCopySemantics()); 337Debug.Assert(HasPointsToAnalysisResult); 362Debug.Assert(HasPointsToAnalysisResult); 363Debug.Assert(targetAnalysisEntity.Type.HasValueCopySemantics()); 411Debug.Assert(analysisEntity.Type.HasValueCopySemantics()); 571Debug.Assert(ShouldProcessPointsToValue(pointsToValue)); 688Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData != null); 742Debug.Assert(throwBranchWithExceptionType.ExceptionType.Equals(ExceptionNamedType)); 769Debug.Assert(tupleOperation.Elements.Length == tupleElementEntities.Length); 776Debug.Assert(tupleElementEntity.Symbol is IFieldSymbol field);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (8)
313Debug.Assert(symbol.Kind is SymbolKind.Local or SymbolKind.Parameter or SymbolKind.Field or SymbolKind.Property); 352Debug.Assert(parentTupleOperationOpt.Elements.Length == parentTupleElementEntities.Length); 372Debug.Assert(parentEntity.InstanceLocation == instanceLocation); 399Debug.Assert(!indices.IsEmpty); 421Debug.Assert(_interproceduralCallStack.Last().Descendants().Contains(flowCaptureOrReference)); 425Debug.Assert(_controlFlowGraph.DescendantOperations().Contains(flowCaptureOrReference)); 442Debug.Assert(symbol != null || !indices.IsEmpty); 519Debug.Assert(symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Parameter || symbol.IsStatic || symbol.IsLambdaOrLocalFunction());
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityMapAbstractDomain.cs (16)
99Debug.Assert(!map2.ContainsKey(key1)); 100Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 164Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 165Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 185Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 186Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 194Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 206Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 213Debug.Assert(!map1.ContainsKey(newKey)); 214Debug.Assert(!map2.ContainsKey(newKey)); 226Debug.Assert(Compare(map1, resultMap) <= 0); 227Debug.Assert(Compare(map2, resultMap) <= 0); 247Debug.Assert(values.Count > 0); 259Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 260Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 267Debug.Assert(isNewKey == (!map1.ContainsKey(key) && !map2.ContainsKey(key)));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysis.cs (19)
233Debug.Assert(tryRegion.Kind == ControlFlowRegionKind.Try); 260Debug.Assert(needsAtLeastOnePass); 267Debug.Assert(!currentInfeasibleData.IsDisposed); 278Debug.Assert(enclosingTryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 279Debug.Assert(block.EnclosingRegion.Kind is ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter); 280Debug.Assert(block.EnclosingRegion.FirstBlockOrdinal == block.Ordinal); 281Debug.Assert(!catchBlockInput.IsDisposed); 352Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 380Debug.Assert(!ReferenceEquals(dataToDispose, newSuccessorInput)); 428Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 439Debug.Assert(currentSuccessorInput == null || AnalysisDomain.Compare(currentSuccessorInput, newSuccessorInput) <= 0); 455Debug.Assert(dominatorBlockOrdinal >= block.Ordinal); 456Debug.Assert(dominatorBlockOrdinal >= successorBlock.Ordinal); 470Debug.Assert(IsValidWorklistState()); 492Debug.Assert(tryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 537Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 627Debug.Assert(basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Finally); 729Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 783Debug.Assert(builder[block] == null || AnalysisDomain.Compare(builder[block]!, newInput) <= 0, "Non-monotonic update");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (4)
108Debug.Assert(operation.GetRoot() != ControlFlowGraph.OriginalOperation, 118Debug.Assert(operation.GetAncestor<IBlockOperation>(OperationKind.Block, predicate: b => b.Parent == null) == null); 159Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 170Debug.Assert(lambdaOrLocalFunctionOperation.Kind is OperationKind.AnonymousFunction or OperationKind.LocalFunction);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (103)
177Debug.Assert(!_currentAnalysisData.IsDisposed); 182Debug.Assert(!value.IsDisposed); 191Debug.Assert(_currentBasicBlock != null); 234Debug.Assert(ExceptionNamedType != null); 430Debug.Assert(_pendingArgumentsToReset.Count == 0); 431Debug.Assert(_pendingArgumentsToPostProcess.Count == 0); 551Debug.Assert(entryBlock.Kind == BasicBlockKind.Entry); 564Debug.Assert(result); 584Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit); 634Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 635Debug.Assert(DataFlowAnalysisContext.ControlFlowGraph.LocalFunctions.Contains(localFunction)); 643Debug.Assert(_visitedLambdas.Contains(lambda)); 651Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit); 745Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None); 788Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None); 823Debug.Assert(implicitTaskPointsToValueOpt.Kind == PointsToAbstractValueKind.KnownLocations); 852Debug.Assert(ExecutingExceptionPathsAnalysisPostPass); 853Debug.Assert(!SkipExceptionPathsAnalysisPostPass); 932Debug.Assert(ExecutingExceptionPathsAnalysisPostPass); 933Debug.Assert(!SkipExceptionPathsAnalysisPostPass); 962Debug.Assert(locals.Any() || flowCaptures.Any()); 1004/// Checks if the method is an overload of the <see cref="Debug.Assert(bool)"/> method. 1007/// <returns>True if the method is an overlaod of the <see cref="Debug.Assert(bool)"/> method.</returns> 1141Debug.Assert(parameterEntity.Symbol?.Kind == SymbolKind.Parameter); 1154Debug.Assert(CurrentBasicBlock.Kind == BasicBlockKind.Entry); 1302Debug.Fail($"Unexpected 'null' target type for '{operation.Syntax}'"); 1358Debug.Assert(PredicateAnalysis); 1364Debug.Assert(PredicateAnalysis); 1388Debug.Assert(PredicateAnalysis); 1389Debug.Assert(operation.Kind is OperationKind.BinaryOperator or 1424Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 1436Debug.Assert(result); 1439Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity)); 1453Debug.Assert(!ReferenceEquals(truePredicatedData, CurrentAnalysisData)); 1458Debug.Assert(!ReferenceEquals(falsePredicatedData, CurrentAnalysisData)); 1462Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 1491Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation)); 1529Debug.Assert(targetEntity.CaptureId != null); 1546Debug.Assert(PredicateAnalysis); 1547Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None); 1641Debug.Fail($"Unknown pattern kind '{isPatternOperation.Pattern.Kind}'"); 1670Debug.Assert(IsContractCheckArgument(argument)); 1684Debug.Assert(result); 1827Debug.Assert(PredicateAnalysis); 1852Debug.Assert(PredicateAnalysis); 1853Debug.Assert(operation.IsComparisonOperator()); 1854Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None); 1896Debug.Assert(PredicateAnalysis); 1902Debug.Assert(PredicateAnalysis); 1908Debug.Assert(PredicateAnalysis); 1914Debug.Assert(PredicateAnalysis); 1923Debug.Assert(PredicateAnalysis); 1929Debug.Assert(PredicateAnalysis); 1935Debug.Assert(PredicateAnalysis); 1951Debug.Assert(IsLValueFlowCaptureReference(flowCaptureReference)); 2026Debug.Assert(HasPointsToAnalysisResult); 2027Debug.Assert(operation.Type!.HasValueCopySemantics()); 2045Debug.Assert(HasPointsToAnalysisResult); 2046Debug.Assert(!operation.Type!.HasValueCopySemantics()); 2268Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2269Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2270Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 2333Debug.Assert(arguments.All(arg => !_pendingArgumentsToReset.Contains(arg))); 2348Debug.Assert(popped == originalOperation); 2395Debug.Assert(arguments.All(_pendingArgumentsToReset.Contains)); 2485Debug.Assert(originalOperation.Kind == OperationKind.ObjectCreation); 2516Debug.Assert(arguments.Length == invokedMethod.Parameters.Length); 2558Debug.Assert(invokedMethod.Parameters.Length == method.GetParameters().Length || 2624Debug.Assert(success); 2635Debug.Assert(IsStandaloneAnalysisRequiredForLocalFunction(localFunction)); 2653Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2654Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2655Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 2685Debug.Assert(IsStandaloneAnalysisRequiredForLambda(lambda)); 2703Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2704Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2705Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 3000Debug.Assert(result); 3009Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity)); 3035Debug.Assert(flowCaptureEntity.CaptureId != null); 3079Debug.Assert(FlowBranchConditionKind == ControlFlowConditionKind.None); 3158Debug.Assert(operation.Initializer == null, "Object or collection initializer must have been lowered in the CFG"); 3241Debug.Assert(!arguments.IsEmpty); 3260Debug.Assert(arguments.Length >= 2); 3284Debug.Assert(IsPointsToAnalysis); 3328Debug.Assert(operation != null ^ invocationTarget != null); 3339Debug.Assert(invocation.Instance == null); 3347Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or 3381Debug.Assert(knownTargetInvocations); 3388Debug.Assert(knownTargetInvocations); 3395Debug.Assert(knownTargetInvocations); 3417Debug.Assert(knownTargetInvocations); 3462Debug.Assert(methodTargetsOptBuilder.Count > 0 || lambdaTargets.Count > 0); 3480Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData)); 3492Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData)); 3496Debug.Assert(mergedCurrentAnalysisData == null || ReferenceEquals(mergedCurrentAnalysisData, CurrentAnalysisData)); 3587Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation)); 3605Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation)); 3682Debug.Assert(elementEntities.Length == elementValueBuilder.Count); 3683Debug.Assert(elementEntities.Length == operation.Elements.Length); 3761Debug.Assert(caughtExceptionType != null || CurrentBasicBlock.IsFirstBlockOfFinally(out _)); 3794Debug.Assert(CurrentBasicBlock.IsFirstBlockOfFinally(out _)); 3828Debug.Assert(operation.Kind == OperationKind.YieldReturn, "IReturnOperation must have been lowered in the CFG");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (17)
35Debug.Assert(!IsDisposed); 43Debug.Assert(!IsDisposed); 48Debug.Assert(!IsDisposed); 57Debug.Assert(!IsDisposed); 71Debug.Assert(!IsDisposed); 80Debug.Assert(!IsDisposed); 87Debug.Assert(!IsDisposed); 93Debug.Assert(!IsDisposed); 99Debug.Assert(!IsDisposed); 105Debug.Assert(!IsDisposed); 111Debug.Assert(!IsDisposed); 117Debug.Assert(!IsDisposed); 123Debug.Assert(!IsDisposed); 129Debug.Assert(!IsDisposed); 135Debug.Assert(!IsDisposed); 143Debug.Assert(!IsDisposed); 149Debug.Assert(!IsDisposed);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\LValueFlowCapturesProvider.cs (1)
70Debug.Fail("Flow capture used as both an r-value and an l-value?");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\MapAbstractDomain.cs (1)
93Debug.Fail("Non-monotonic merge");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PerEntityPredicatedAnalysisData.cs (1)
22Debug.Assert(truePredicatedData != null || falsePredicatedData != null);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicateAnalysisEntityDataFlowOperationVisitor.cs (2)
30Debug.Assert(PredicateAnalysis); 33Debug.Assert(!isReachable || predicatedData.IsReachableBlockData);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicatedAnalysisData.cs (12)
65Debug.Assert(!_lazyPredicateDataMap.IsDisposed); 71Debug.Assert(!value.TruePredicatedData.IsDisposed); 72Debug.Assert(builder.Add(value.TruePredicatedData)); 77Debug.Assert(!value.FalsePredicatedData.IsDisposed); 78Debug.Assert(builder.Add(value.FalsePredicatedData)); 91Debug.Assert(predicatedEntity.IsCandidatePredicateEntity()); 92Debug.Assert(predicatedEntity.CaptureId != null, "Currently we only support predicated data tracking for flow captures"); 105Debug.Assert(HasPredicatedDataForEntity(predicatedEntity)); 128Debug.Assert(HasPredicatedDataForEntity(fromEntity)); 144Debug.Assert(HasPredicatedDataForEntity(predicatedEntity)); 175Debug.Assert(HasPredicatedData); 437Debug.Assert(_lazyPredicateDataMap.IsDisposed);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\ThrownExceptionInfo.cs (2)
50Debug.Assert(enclosingRegion.NestedRegions[0].Kind == ControlFlowRegionKind.Try); 71Debug.Assert(interproceduralCallStack != InterproceduralCallStack);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.CodeStyle (560)
src\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
275Debug.Assert(operation.Kind is OperationKind.DelegateCreation or OperationKind.AnonymousFunction); 324Debug.Assert(operation.Kind is OperationKind.LocalReference or OperationKind.ParameterReference); 525Debug.Assert(!SymbolUsageAnalysis.Run(context.GetControlFlowGraph(operationBlock), context.OwningSymbol, context.CancellationToken)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (4)
29Debug.Assert(!isUnnecessary || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer); 43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer); 161Debug.Assert(_minimumReportedSeverity != null); 245Debug.Assert(editorConfigSeverity != null);
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
75Debug.Assert(options.Count > 1); 87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\roslyn\src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
64Debug.Assert(customTags.Length == tags.Length); 68Debug.Assert(customTags[i] == tags[i]); 74Debug.Assert(isConfigurable || enforceOnBuild == EnforceOnBuild.Never);
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
337Debug.Assert(id.StartsWith("IDE", StringComparison.Ordinal));
src\roslyn\src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (3)
47Debug.Assert(perLanguageValuedOption.IsPerLanguage); 83Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions)); 84Debug.Assert(options.All(option => option.Definition.IsEditorConfigOption));
src\roslyn\src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (3)
109Debug.Assert(fieldStateMap.ContainsKey(field.OriginalDefinition)); 219Debug.Assert(IsCandidateField(field)); 293Debug.Assert(isInInstanceConstructor);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
108Debug.Assert(preference.Value == ParenthesesPreference.NeverIfUnnecessary ||
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
69Debug.Fail(ex.Message); 422Debug.Assert(!analyzer.IsCompilerAnalyzer()); 454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics); 554Debug.Assert(diagnostic.Location.IsInSource); 555Debug.Assert(diagnostic.Location.SourceTree == tree);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
406Debug.Assert(memberReference.Parent is ICompoundAssignmentOperation compoundAssignment && 633Debug.Assert(IsCandidateSymbol(member)); 634Debug.Assert(!member.IsImplicitlyDeclared);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
256Debug.Assert(unusedValueExpressionStatementSeverity.Severity != ReportDiagnostic.Suppress || 317Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _)); 323Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _));
src\roslyn\src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
36Debug.Assert(binaryToAssignmentMap.Count == assignmentToTokenMap.Count); 37Debug.Assert(binaryToAssignmentMap.Values.All(assignmentToTokenMap.ContainsKey));
src\roslyn\src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
70Debug.Assert(elementCount >= 2 || statements.Length >= 2);
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
202Debug.Assert(syntaxFacts.IsArgument(argsArgument));
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
308Debug.Assert(PeekNextChar() is '(' or '['); 495Debug.Assert(PeekNextChar() == '!'); 542Debug.Assert(bindingContext != null); 657Debug.Assert(PeekNextChar() == '<'); 698Debug.Assert(PeekNextChar() == '['); 884Debug.Assert(type != null); 890Debug.Assert(startIndex >= 0);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (11)
111Debug.Assert(source != null); 112Debug.Assert(scheduler != null); 113Debug.Assert(body != null); 276Debug.Assert(source != null); 277Debug.Assert(scheduler != null); 278Debug.Assert(body != null); 488Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 495Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 528Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 540Debug.Assert(!Cancellation.IsCancellationRequested); 556Debug.Assert(taskSet, "Complete should only be called once.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.CodeStyle.Fixes (37)
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
97Debug.Assert(false, "All conflict markers should start at the beginning of a line."); 396Debug.Assert(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
87Debug.Assert(constructor.Parameters.Length == expressions.Length);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
222Debug.Assert(syntaxFacts.IsInvocationExpression(invocationExpression));
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
36Debug.Fail("Declared symbol must never be null here");
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
43Debug.Assert(diagnostics.Select(diagnostic => diagnostic.Properties[MatchFolderAndNamespaceConstants.TargetNamespace]).Distinct().Count() == 1); 62Debug.Assert(newSolution != document.Project.Solution);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
57Debug.Assert(missingCases || missingDefaultCase);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
70Debug.Fail("We should always be able to find the node from the diagnostic."); 77Debug.Fail("We should always be able to find the method symbol for the diagnostic.");
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
98Debug.Assert(childDeclarators.All(c => !declarators.Contains(c)));
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
249Debug.Assert(success); 254Debug.Assert(diagnosticId == diagnostic.Id); 255Debug.Assert(AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.TryGetUnusedValuePreference(diagnostic, out var diagnosticPreference) && 257Debug.Assert(removeAssignments == AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.GetIsRemovableAssignmentDiagnostic(diagnostic)); 410Debug.Assert(semanticModel.Language != LanguageNames.VisualBasic); 517Debug.Assert(syntaxFacts.IsLeftSideOfAnyAssignment(node)); 726Debug.Assert(removeAssignments);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
130Debug.Assert(fieldDocument.Project == propertyDocument.Project); 171Debug.Assert(fieldDocument.Project == propertyDocument.Project);
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
285Debug.Assert(syntaxFacts.IsElementAccessExpression(elementAccess));
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
48Debug.Fail("Could not get analyzer");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
60Debug.Fail("FixAllScope.ContainingMember and FixAllScope.ContainingType are not supported in CodeStyle layer");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
342Debug.Assert(desiredGroupIndex >= 0); 343Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
206Debug.Assert(false, message + ". " + diagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
34Debug.Assert(diagnostic != null); 88Debug.Assert(analyzerConfigPath != null); 89Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
102Debug.Fail("Previous container didn't map back to a normal accessor container."); 111Debug.Fail("Accessor count shouldn't have changed as there were no top level edits."); 132Debug.Fail("Member count shouldn't have changed as there were no top level edits."); 139Debug.Fail("Child at indicated index should be a node as there were no top level edits.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (3)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel); 227Debug.Assert(replacedParent.GetAnnotatedNodesAndTokens(annotation).Count() == 1); 246Debug.Assert(newRoot.GetAnnotatedNodesAndTokens(marker).Count() == 1);
Microsoft.CodeAnalysis.CSharp (8577)
Binder\Binder_Attributes.cs (35)
35Debug.Assert(binders.Any()); 36Debug.Assert(attributesToBind.Any()); 37Debug.Assert((object)ownerSymbol != null); 38Debug.Assert(binders.Length == attributesToBind.Length); 81Debug.Assert(binders.Any()); 82Debug.Assert(attributesToBind.Any()); 83Debug.Assert(boundAttributeTypes.Any()); 84Debug.Assert(binders.Length == attributesToBind.Length); 85Debug.Assert(boundAttributeTypes.Length == attributesToBind.Length); 105Debug.Assert(boundAttributeArray is null || boundAttributeArray[i] is not null); 112Debug.Assert(!attribute.HasErrors); 113Debug.Assert(attribute.AttributeClass is object); 157Debug.Assert(binder.SkipSemanticModelBinder() == binder.GetRequiredBinder(node).SkipSemanticModelBinder()); 158Debug.Assert(binder.InAttributeArgument); 236Debug.Assert(!attributeConstructor.IsExtensionBlockMember()); 259Debug.Assert(boundConstructorArguments.All(a => !a.NeedsToBeConverted())); 267Debug.Assert(boundNamedArguments.All(arg => !arg.Right.NeedsToBeConverted())); 290Debug.Assert(boundAttribute.Syntax.Kind() == SyntaxKind.Attribute); 297Debug.Assert(hasErrors); 310Debug.Assert(!constructorArgsArray.IsDefault, "Property of VisitArguments"); 328Debug.Assert(rewrittenArguments.Length == attributeConstructor.ParameterCount); 354Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) == (boundAttribute.ConstructorExpanded ? 1 : 0)); 379Debug.Assert(argsToParamsOpt.IsDefault 386Debug.Assert(!arguments[argIndex].IsParamsArrayOrCollection || arguments[argIndex] is BoundArrayCreation); 403Debug.Assert(paramType.HasType); 422Debug.Assert((object)attributeType != null); 423Debug.Assert(!attributeType.IsErrorType()); 428Debug.Assert(conditionalSymbols != null); 518Debug.Assert(namedArgument.NameEquals is not null); 555Debug.Assert(resultKind == LookupResultKind.Viable || wasError); 713Debug.Assert(!constructorArgsArray.IsDefault); 714Debug.Assert(!hasErrors); 749Debug.Assert(hasErrors || reorderedArguments.All(arg => arg.Kind != TypedConstantKind.Error)); 908Debug.Assert(node.ConstantValueOpt == null); 925Debug.Assert(type.IsSZArray());
Binder\Binder_Await.cs (6)
96Debug.Assert(!call.IsErroneousNode); 289Debug.Assert(TypeSymbol.Equals(expression.Type, getAwaiterArgument.Type, TypeCompareKind.ConsiderEverything)); 519Debug.Assert(awaitMethod is { Arity: 1 }); 616Debug.Assert(!call.IsErroneousNode); 701Debug.Assert(conversion.IsValid); 733Debug.Assert(!call.IsErroneousNode);
Binder\Binder_Constraints.cs (11)
33Debug.Assert(this.Flags.Includes(BinderFlags.GenericConstraintsClause)); 35Debug.Assert((containingSymbol.Kind == SymbolKind.NamedType) || (containingSymbol.Kind == SymbolKind.Method)); 36Debug.Assert(typeParameters.Length > 0); 37Debug.Assert(clauses.Count > 0); 66Debug.Assert(ordinal >= 0); 67Debug.Assert(ordinal < n); 125Debug.Assert(!InExecutableBinder); // Cannot eagerly report diagnostics handled by LazyMissingNonNullTypesContextDiagnosticInfo 345Debug.Assert(!isForOverride || 392Debug.Assert(typeParameters.Length > 0); 393Debug.Assert(typeParameters.Length == constraintClauses.Count); 469Debug.Assert(possibleFileType?.IsDefinition != false);
Binder\Binder_Conversions.cs (146)
69Debug.Assert(result is BoundConversion || (conversion.IsIdentity && ((object)result == source) || source.NeedsToBeConverted()) || hasErrors); 74Debug.Assert(filterConversion(conversion, result)); 75Debug.Assert(BoundNode.GetConversion(result, placeholder1) == conversion); 81Debug.Assert(BoundNode.GetConversion(result2, placeholder2) == conversion); 234Debug.Assert(destination.SpecialType != SpecialType.System_String); 258Debug.Assert(!conversion.Exists); 277Debug.Assert(conversion.IsCollectionExpression 300Debug.Assert(source.Type is null); 301Debug.Assert(!conversion.Exists); 311Debug.Assert(inConversionGroupFlags == InConversionGroupFlags.Unspecified); 344Debug.Assert(source == (object)methodGroup || !conversion.IsValid); 363Debug.Assert(!conversion.IsMethodGroup); 379Debug.Assert(conversion.UnderlyingConversions.Length == 1); 442Debug.Assert(elementConversions.Length == sourceTypes.Length); 465Debug.Assert(conversion.UnderlyingConversions.IsDefault); 474Debug.Assert(syntax.SyntaxTree is object); 482Debug.Assert(conversion.ConstrainedToTypeOpt is TypeParameterSymbol); 523Debug.Assert(source.Type is { }); 526Debug.Assert(elementField is { }); 545Debug.Assert(destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions)); 562Debug.Assert(source.Type is not null); 563Debug.Assert(destination.IsSpan() || destination.IsReadOnlySpan()); 584Debug.Assert(destination.IsReadOnlySpan()); 596Debug.Assert(destination.IsReadOnlySpan()); 653Debug.Assert(type.IsSpan() || type.IsReadOnlySpan()); 654Debug.Assert(type.IsDefinition); 663Debug.Assert(spanType.IsSpan() && readonlySpanType.IsReadOnlySpan()); 664Debug.Assert(spanType.IsDefinition && readonlySpanType.IsDefinition); 686Debug.Assert(source.IsSpan() || source.IsReadOnlySpan()); 687Debug.Assert(destination.IsReadOnlySpan()); 688Debug.Assert(!source.IsDefinition && !destination.IsDefinition); 695Debug.Assert(!source.IsReadOnlySpan() || !sameElementTypes); 703Debug.Assert(source.IsReadOnlySpan() && destination.IsReadOnlySpan()); 704Debug.Assert(source.IsDefinition && destination.IsDefinition); 731Debug.Assert(readOnlySpanType.IsReadOnlySpan()); 732Debug.Assert(!readOnlySpanType.IsDefinition); 733Debug.Assert(((NamedTypeSymbol)readOnlySpanType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].SpecialType is SpecialType.System_Char); 786Debug.Assert(destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) || 826Debug.Assert(expr is BoundObjectCreationExpressionBase { WasTargetTyped: true } or 831Debug.Assert(expr is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node.Syntax, node)); 942Debug.Assert(_conversion.Kind is ConversionKind.NoConversion); 950Debug.Assert(elementType is { }); 961Debug.Assert(result.WasCompilerGenerated == _node.IsParamsArrayOrCollection); 962Debug.Assert(result.IsParamsArrayOrCollection == _node.IsParamsArrayOrCollection); 972Debug.Assert(elementType is { }); 1038Debug.Assert(_node.WithElement is null); 1039Debug.Assert(inProgressConstructor is not null); 1047Debug.Assert(collectionCreation is BoundObjectCreationExpressionBase or BoundBadExpression); 1159Debug.Assert(elements.Length == elementConversions.Length); 1160Debug.Assert(elementConversions.All(c => c.Exists)); 1191Debug.Assert(enumeratorInfo is { }); 1192Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable. 1268Debug.Assert(@this._targetType.IsArrayInterface(out _)); 1280Debug.Assert(isMutableArray); 1370Debug.Assert(projection.Arity == 0); 1371Debug.Assert(projection.ParameterCount == 0 || !projection.Parameters.Last().IsParams); 1387Debug.Assert(collectionBuilderMethods.All(t => t.Name == methodName)); 1420Debug.Assert(!projectionCall.Expanded); 1503Debug.Assert(result); 1507Debug.Assert(result); 1637Debug.Assert(parameterType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 1649Debug.Assert(!collectionBuilderMethod.IsExtensionBlockMember()); 1664Debug.Assert(!isParamsModifierValidation || syntax is ParameterSyntax); 1666Debug.Assert(!isParamsModifierValidation); 1669Debug.Assert(!hasWithElement); 1690Debug.Assert(!hasWithElement); 1835Debug.Assert(!targetType.IsDynamic()); 1914Debug.Assert(boundExpression.HasErrors); 1954Debug.Assert(methodGroup.ReceiverOpt is not null); 1955Debug.Assert(methodGroup.ReceiverOpt.Type is not null); 1971Debug.Assert(false); // Should not get here given the 'acceptOnlyMethods' argument value used in 'ResolveMethodGroup' call above 1995Debug.Assert(resolution.AnalyzedArguments.HasDynamicArgument); 2011Debug.Assert(finalApplicableCandidates.Length != 1 || finalApplicableCandidates[0].IsApplicable); 2032Debug.Assert(!IsDisallowedExtensionInOlderLangVer(addMethods[0])); 2038Debug.Assert(!resolution.OverloadResolutionResult.Succeeded); 2061Debug.Assert(methodGroup.ReceiverOpt is not null); 2091Debug.Assert(receiverType is not null); 2152Debug.Assert(constructed is not null); 2185Debug.Assert(node != null); 2186Debug.Assert(methodGroup != null); 2187Debug.Assert(methodGroup.Error == null); 2188Debug.Assert(methodGroup.Methods.Count > 0); 2249Debug.Assert(call.HasErrors); 2250Debug.Assert(call.Method.Name == "Add"); 2253Debug.Assert(false); // Add test if we hit this assert. 2266Debug.Assert(!collectionInitializer.DefaultArguments[argIndex]); 2281Debug.Assert(false); 2364Debug.Assert(elementTypeWithAnnotations.Type is null); // GetCollectionExpressionTypeKind() does not set elementType for these cases. 2376Debug.Assert(elementTypeWithAnnotations.HasType); 2386Debug.Assert(elementType is { }); 2434Debug.Assert(reportedErrors); 2456Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything)); 2495Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything)); 2528Debug.Assert(conversionGroup != null); 2529Debug.Assert(conversionGroup.Conversion == conversion); 2530Debug.Assert(conversion.IsUserDefined); 2579Debug.Assert(conversion.BestUserDefinedConversionAnalysis is object); // All valid user-defined conversions have this populated 2601Debug.Assert(toParameterTypeConversion.IsNullable); 2602Debug.Assert(toParameterTypeConversion.IsExplicit); 2603Debug.Assert(toParameterTypeConversion.UnderlyingConversions[0].IsIdentity); 2647Debug.Assert(toConversion.Exists); 2653Debug.Assert(fromReturnTypeConversion.IsNullable); 2654Debug.Assert(fromReturnTypeConversion.IsImplicit); 2655Debug.Assert(!fromReturnTypeConversion.UnderlyingConversions[0].IsIdentity); 2717Debug.Assert(conversionGroup != null); 2718Debug.Assert(conversionGroup.Conversion == conversion); 2719Debug.Assert(conversion.IsUnion); 2742Debug.Assert(conversion.BestUnionConversionAnalysis is object); // All valid union conversions have this populated 2746Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm); 2747Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 2748Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions)); 2749Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 2750Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions)); 2751Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true }); 2752Debug.Assert(source.Type?.IsDynamic() != true); 2841Debug.Assert(conversion.Kind == ConversionKind.FunctionType); 2842Debug.Assert(source.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda); 2843Debug.Assert(syntax.IsFeatureEnabled(MessageID.IDS_FeatureInferredDelegateType)); 2847Debug.Assert(delegateType is { }); 2863Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.FunctionTypeDelegate) == 0); 2893Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.FunctionTypeDelegateToTarget) == 0); 2947Debug.Assert(conversion.UnderlyingConversions.IsDefault); 3004Debug.Assert(delegateType is not null); 3008Debug.Assert(lambdaSymbol.ParameterCount == delegateParameters.Length); 3094Debug.Assert(conversion.IsStackAlloc); 3127Debug.Assert(conversion.IsTupleLiteralConversion || 3132Debug.Assert(conversion.IsNullable == destination.IsNullableType()); 3144Debug.Assert(conversionWithoutNullable.IsTupleLiteralConversion); 3182Debug.Assert(targetElementTypes.Length == arguments.Length, "converting a tuple literal to incompatible type?"); 3204Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.TupleLiteral) == 0); 3222Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.TupleLiteralExplicitIdentity) == 0); 3364Debug.Assert(memberSymbol is not MethodSymbol { MethodKind: not MethodKind.Constructor } || 3375Debug.Assert(!invokedAsExtensionMethod); 3379Debug.Assert(!invokedAsExtensionMethod || (receiverOpt != null)); 3518Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } } 3529Debug.Assert(!isExtensionMethod || (receiverOpt != null)); 3536Debug.Assert(methodParameters.Length == numParams + (isExtensionMethod ? 1 : 0)); 3542Debug.Assert(!(isExtensionMethod || (method.IsExtensionBlockMember() && !method.IsStatic)) || 3625Debug.Fail("This method should have been eliminated in overload resolution!"); 3685Debug.Assert(method.IsExtensionBlockMember()); 3709Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer); 3710Debug.Assert(conversion.Method is object); 3755Debug.Assert(!selectedMethod.HasUseSiteError, "Shouldn't have reached this point if there were use site errors."); 3792Debug.Assert(conversion.IsValid); // i.e. if it exists, then it is valid. 3907Debug.Assert(!sourceValue.IsBad); 3914Debug.Assert(underlyingType.SpecialType != SpecialType.None);
Binder\Binder_Crefs.cs (27)
22Debug.Assert(!symbols.IsDefault, "Prefer empty to null."); 23Debug.Assert((symbols.Length > 1) == ((object?)ambiguityWinner != null), "ambiguityWinner should be set iff more than one symbol is returned."); 85Debug.Assert(Flags.Includes(BinderFlags.Cref)); 97Debug.Assert((object)namespaceOrTypeSymbol != null); 165Debug.Assert((object?)containerOpt == null); 211Debug.Assert(sortedSymbols.All(SymbolExtensions.IsIndexer)); 268Debug.Assert(sortedSymbols.All(s => s.IsExtensionBlockMember())); 274Debug.Assert(name is not null); 276Debug.Assert(syntax.Parameters is not null); 350Debug.Assert(result.Symbol is not null); 575Debug.Assert(memberName == memberNameText); 665Debug.Assert(builder != null); 690Debug.Assert(!symbols.IsEmpty); 876Debug.Assert(!symbols.IsEmpty); 895Debug.Assert(!best.IsNone); 896Debug.Assert(!secondBest.IsNone); 1036Debug.Assert(candidate.GetMemberArity() != 0 || candidate.Name == WellKnownMemberNames.InstanceConstructorName || arity == 0, 1092Debug.Assert(typeArgumentListSyntax is object); 1099Debug.Assert(unusedDiagnostics.DiagnosticBag is object); 1111Debug.Assert(typeArgumentSyntax.ContainsDiagnostics || !typeArgumentSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics() || 1128Debug.Assert(symbol is NamedTypeSymbol); 1149Debug.Assert(parameterListSyntax.Parent is object); 1167Debug.Assert(InCrefButNotParameterOrReturnType); 1173Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 1179Debug.Assert(localDiagnostics.DiagnosticBag is object); 1187Debug.Assert(typeSyntax.Parent is object); 1201Debug.Assert(type.TypeKind != TypeKind.Error || typeSyntax.ContainsDiagnostics || !typeSyntax.SyntaxTree.ReportDocumentationCommentDiagnostics(), "Why wasn't there a diagnostic?");
Binder\Binder_Deconstruct.cs (17)
96Debug.Assert(locals.NestedVariables is object); 120Debug.Assert(diagnostics.DiagnosticBag is object); 158Debug.Assert(hasErrors || lhsTuple.Type is object); 185Debug.Assert(parent.Kind() == SyntaxKind.SimpleAssignmentExpression); 211Debug.Assert(diagnostics.DiagnosticBag is object); 251Debug.Assert((object)type != null); 309Debug.Assert(nestedConversion.Kind == ConversionKind.Deconstruction); 322Debug.Assert(single is object); 323Debug.Assert(single.Type is not null); 381Debug.Assert((object?)pending.Type == null); 405Debug.Assert(variable.Single is object); 423Debug.Assert((object?)variables[i].Single!.Type != null); 463Debug.Assert(NestedVariables is object); 503Debug.Assert(variable.Single is object); 566Debug.Assert(variable.Single is object); 755Debug.Assert(isVar == !declType.HasType); 953Debug.Assert(TypeSymbol.Equals(declTypeWithAnnotations.Type, fieldType.Type, TypeCompareKind.ConsiderEverything2));
Binder\Binder_Expressions.cs (303)
220Debug.Assert(expr != null); 221Debug.Assert(resultKind != LookupResultKind.Viable); 343Debug.Assert(op.NoCommonTypeError != 0); 448Debug.Assert(expr.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup); 478Debug.Assert((object)this.ContainingMemberOrLambda == field); 486Debug.Assert(initializerBinder != null); 536Debug.Assert(this.InParameterDefaultValue); 537Debug.Assert(this.ContainingMemberOrLambda.Kind == SymbolKind.Method 543Debug.Assert(defaultValueBinder != null); 561Debug.Assert(initializerBinder != null); 629Debug.Assert(node != null); 877Debug.Assert(false, "Unexpected SyntaxKind " + node.Kind()); 1185Debug.Assert(elementNames.Count == inferredElementNames.Count); 1482Debug.Assert(ContainingType is { }); 1506Debug.Assert((this.Flags & BinderFlags.InContextualAttributeBinder) != 0); 1533Debug.Assert(!result || lookupResult.Symbols.Count > 0); 1566Debug.Assert(symbol is null or LocalSymbol or LocalFunctionSymbol or RangeVariableSymbol or TypeParameterSymbol); 1649Debug.Assert(node != null); 1687Debug.Assert(node.Arity == typeArgumentList.Count); 1708Debug.Assert(members.Count > 0); 1711Debug.Assert(!IsTypeOrValueExpression(receiver)); 1740Debug.Assert(isError); // Should have been reported by GetSymbolOrMethodOrPropertyGroup. 1820Debug.Assert(SyntaxFacts.IsInvoked(id) == invoked); 1885Debug.Assert(!primaryConstructor.GetCapturedParameters().ContainsKey(shadowedParameter)); // How could we capture a shadowed parameter? 1912Debug.Assert((options & LookupOptions.NamespacesOrTypesOnly) == 0); 1941Debug.Assert(node.Identifier.IsUnderscoreToken()); 2006Debug.Assert(members.Count > 0); 2049Debug.Assert(!symbol.ContainingSymbol.Equals(containingMethod)); 2116Debug.Assert(primaryCtor is null || 2135Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType()); 2158Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType()); 2518Debug.Assert(node.ContainsDiagnostics); 2535Debug.Assert(result.IsSingleViable, "If this happens, we need to deal with multiple label definitions."); 2579Debug.Assert(node != null); 2607Debug.Assert(location is not null); 2617Debug.Assert(this.ContainingMemberOrLambda is not null); 2681Debug.Assert(node.OperatorToken.IsKind(SyntaxKind.CaretToken)); 2880Debug.Assert(conversion.IsUserDefined || conversion.IsUnion); 2889Debug.Assert(originalUserDefinedConversions.Length == 0, 2965Debug.Assert((object)operand.Type != null); 3006Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 3007Debug.Assert((object)operand.Type != null && !operand.Type.IsNullableType()); 3256Debug.Assert(isVar != declType.HasType); 3272Debug.Assert(declarationExpression.IsOutVarDeclaration()); 3296Debug.Assert(localSymbol.DeclarationKind == LocalDeclarationKind.OutVariable); 3414Debug.Assert(argumentSyntax is ArgumentSyntax || argumentSyntax is AttributeArgumentSyntax); 3526Debug.Assert(result.ConversionForArg(arg).IsIdentity); 3527Debug.Assert(!argument.NeedsToBeConverted()); 3528Debug.Assert(!expanded || result.ParameterFromArgument(arg) != parameters.Length - 1); 3537Debug.Assert(paramsArgsBuilder is null); 3554Debug.Assert(analyzedArguments.RefKinds.Count == 0 || analyzedArguments.RefKinds.Count == arguments.Count); 3555Debug.Assert(analyzedArguments.Names.Count == 0 || analyzedArguments.Names.Count == arguments.Count); 3556Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Count); 3577Debug.Assert(argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 3598Debug.Assert(parameterTypeWithAnnotations.HasType); 3603Debug.Assert(kind.IsIdentity); 3631Debug.Assert(arguments[arg].Kind is not 3660Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 3661Debug.Assert(methodResult.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel); 3683Debug.Assert(collectionArgs.Length != 0); 3688Debug.Assert(firstParamsArgument != -1); 3689Debug.Assert(collectionArgs.Length == 1 || firstParamsArgument + collectionArgs.Length == arguments.Count); 3702Debug.Assert(argsToParamsBuilder is not null || argsToParamsOpt.IsDefault); 3753Debug.Assert(unconvertedString is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 3755Debug.Assert(interpolatedStringConversion.IsInterpolatedStringHandler); 3756Debug.Assert(handlerType is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }); 3763Debug.Assert(handlerParameterIndexes.IsEmpty); 3777Debug.Assert(arguments is not null); 3810Debug.Assert(handlerParameterIndexes.All((index, paramLength) => index >= BoundInterpolatedStringArgumentPlaceholder.ExtensionReceiver && index < paramLength, 3829Debug.Assert(handlerArgumentIndexesBuilder[handlerParameterIndex] is BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter); 3862Debug.Assert(argumentIndex != interpolatedStringArgNum); 3869Debug.Assert(receiver!.Type is not null); 3874Debug.Assert(methodResult.Member.IsExtensionBlockMember()); 3876Debug.Assert(receiverParameter is not null); 3930Debug.Assert(receiver != null); 3995Debug.Assert(!available); 4008Debug.Assert(argNumber > 0); 4020Debug.Assert(argNumber >= 0); // can be 0 for receiver of extension method 4029Debug.Assert(argNumber > 0); 4289Debug.Assert(rank > 0); 4290Debug.Assert(dimension > 0 && dimension <= rank); 4291Debug.Assert(exprBuilder != null); 4362Debug.Assert(!boundInitExpr.IsDefault); 4372Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length); 4397Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length); 4400Debug.Assert(init.HasAnyErrors); 4401Debug.Assert(init.Type.IsErrorType()); 4510Debug.Assert(creationSyntax == null || 4513Debug.Assert(initSyntax != null); 4514Debug.Assert((object)type != null); 4515Debug.Assert(boundInitExprOpt.IsDefault || creationSyntax.Kind() == SyntaxKind.ImplicitArrayCreationExpression); 4667Debug.Assert(node is StackAllocArrayCreationExpressionSyntax || node is ImplicitStackAllocArrayCreationExpressionSyntax); 4692Debug.Assert(node is StackAllocArrayCreationExpressionSyntax or ImplicitStackAllocArrayCreationExpressionSyntax); 4730Debug.Assert(node != null); 4769Debug.Assert(node.IsKind(SyntaxKind.ImplicitStackAllocArrayCreationExpression) || node.IsKind(SyntaxKind.StackAllocArrayCreationExpression)); 4815Debug.Assert(expression != null); 4833Debug.Assert(expression != null); 4859Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64); 4894Debug.Assert(argumentListBinder.IsSemanticModelBinder); 4926Debug.Assert((object)constructor != null); 4927Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4929Debug.Assert(diagnostics != null); 4943Debug.Assert(constructorReturnType.IsVoidType()); //true of all constructors 4962Debug.Assert((object)initializerType != null || 4998Debug.Assert(initializerArgumentListOpt.Parent.Kind() == SyntaxKind.ThisConstructorInitializer); 5104Debug.Assert(initializerType.IsErrorType() || 5165Debug.Assert(!resultMember.IsExtensionBlockMember()); 5294Debug.Assert(result is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node, node)); 5422Debug.Assert(expression.Type is { }); 5429Debug.Assert(conversion.IsValid); 5437Debug.Assert(length > 0); 5584Debug.Assert(!type.IsGenericOrNonGenericExpressionType(out _)); 5671Debug.Assert(!conv.IsExtensionMethod); 5672Debug.Assert(conv.IsValid); // i.e. if it exists, then it is valid. 5739Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 5783Debug.Assert(typeSyntax is not null); 5802Debug.Assert(syntax != null); 5803Debug.Assert((object)type != null); 5833Debug.Assert(syntax != null); 5834Debug.Assert((object)type != null); 5840Debug.Assert(syntax.Parent.Parent.Kind() != SyntaxKind.WithInitializerExpression); 5841Debug.Assert(rhsValueKind == BindValueKind.RValue); 5860Debug.Assert(initializerSyntax.Kind() == SyntaxKind.ObjectInitializerExpression || 5862Debug.Assert((object)initializerType != null); 5906Debug.Assert((object)boundLeft.Type != null); 6235Debug.Assert(!boundMember.NeedsToBeConverted()); 6257Debug.Assert(boundMember.HasAnyErrors); 6271Debug.Assert(memberNameMap != null); 6281Debug.Assert(memberInitializerSyntax.Kind() == SyntaxKind.SimpleAssignmentExpression); 6415Debug.Assert(initializerSyntax.Kind() == SyntaxKind.CollectionInitializerExpression); 6416Debug.Assert(initializerSyntax.Expressions.Any()); 6417Debug.Assert((object)initializerType != null); 6569Debug.Assert(node.Kind() == SyntaxKind.ComplexElementInitializerExpression); 6600Debug.Assert(!boundElementInitializerExpressions.IsEmpty); 6619Debug.Assert(collectionInitializerAddMethodBinder.HasCollectionExpressionApplicableAddMethod(elementInitializer, implicitReceiver.Type, addMethods: out _, d)); 6633Debug.Assert(collectionInitializerAddMethodBinder != null); 6634Debug.Assert(collectionInitializerAddMethodBinder.Flags.Includes(BinderFlags.CollectionInitializerAddMethod)); 6635Debug.Assert(implicitReceiver != null); 6636Debug.Assert((object)implicitReceiver.Type != null); 6702Debug.Assert(addMethodInvocation.Kind == BoundKind.BadExpression); 6748Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable. 6795Debug.Assert((object)constructor != null); 6796Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor); 6823Debug.Assert((object)this.Compilation.Assembly != null); 6879Debug.Assert(finalApplicableCandidates[0].IsApplicable); 6967Debug.Assert(!method.IsExtensionBlockMember()); 7102Debug.Assert((object)type != null); 7128Debug.Assert((object)interfaceType != null); 7129Debug.Assert(interfaceType.IsInterfaceType()); 7130Debug.Assert((object)coClassType != null); 7131Debug.Assert(TypeSymbol.Equals(interfaceType.ComImportCoClass, coClassType, TypeCompareKind.ConsiderEverything2)); 7132Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 7571Debug.Assert(!value.GetType().GetTypeInfo().IsEnum); 7576Debug.Assert( 7597Debug.Assert(node.Kind() == SyntaxKind.Utf8StringLiteralExpression); 7598Debug.Assert(node.Token.Kind() is SyntaxKind.Utf8StringLiteralToken or SyntaxKind.Utf8SingleLineRawStringLiteralToken or SyntaxKind.Utf8MultiLineRawStringLiteralToken); 7642Debug.Assert(node != null); 7643Debug.Assert(invoked == SyntaxFacts.IsInvoked(node)); 7655Debug.Assert(node.Kind() == SyntaxKind.PointerMemberAccessExpression); 7709Debug.Assert((left.Parent is MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression } memberAccess && memberAccess.Expression == left) || 7721Debug.Assert(left.Arity == 0); 7780Debug.Assert(!leftType.IsDynamic()); 7781Debug.Assert(IsPotentialColorColorReceiver(left, leftType)); 7787Debug.Assert(!IsPotentialColorColorReceiver(left, leftType)); 7790Debug.Assert(leftType.Equals(boundValue.Type, TypeCompareKind.ConsiderEverything)); 7791Debug.Assert(leftSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol)); 7913Debug.Assert(node != null); 7914Debug.Assert(boundLeft != null); 7948Debug.Assert((object)leftType == null); 8090Debug.Assert(sym.Kind == SymbolKind.NamedType); 8106Debug.Assert(symbols.Count > 0); 8107Debug.Assert(symbols[0].Kind == SymbolKind.NamedType); 8116Debug.Assert(lookupResult.IsClear, "If there's a legitimate reason for having candidates without a reason, then we should produce something intelligent in such cases."); 8117Debug.Assert(lookupResult.Error == null); 8142Debug.Assert(boundLeft is BoundTypeExpression); 8143Debug.Assert((object)leftType != null); 8218Debug.Assert(!resolution.IsNonMethodExtensionMember(out _)); 8226Debug.Assert(!resolution.IsEmpty); 8271Debug.Assert(typeArgumentsOpt.IsDefault); 8294Debug.Assert(propertySymbol.ContainingType.ExtensionParameter is not null); 8326Debug.Assert(rightArity == (typeArgumentsWithAnnotations.IsDefault ? 0 : typeArgumentsWithAnnotations.Length)); 8606Debug.Assert(receiver != null); 8607Debug.Assert(extensionMethodArguments.Arguments.Count == 0); 8608Debug.Assert(extensionMethodArguments.Names.Count == 0); 8609Debug.Assert(extensionMethodArguments.RefKinds.Count == 0); 8651Debug.Assert(node != null); 8652Debug.Assert(left != null); 8653Debug.Assert(lookupResult.IsMultiViable); 8654Debug.Assert(lookupResult.Symbols.Any()); 8664Debug.Assert(members.Count > 0); 8690Debug.Assert(symbol.Kind != SymbolKind.Method); 8773Debug.Assert(left.Type is not null); 8774Debug.Assert(!left.Type.IsDynamic()); 8775Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 8868Debug.Assert(left.Type is not null); 8889Debug.Assert(arity == 0 || lookupResult.Symbols.All(s => s.Kind != SymbolKind.Property)); 8902Debug.Assert(actualReceiverArguments is not null); 8937Debug.Assert(actualReceiverArguments is not null); 8946Debug.Assert(propertyResult?.HasAnyApplicableMember == true); 8957Debug.Assert(actualReceiverArguments is not null); 9004Debug.Assert(propertyResult is not null); 9029Debug.Assert(lookupResult.Kind == LookupResultKind.Viable); 9060Debug.Assert(receiverType is not null); 9185Debug.Assert(left is not null); 9193Debug.Assert(left.Type is not null); 9194Debug.Assert(!left.Type.IsDynamic()); 9195Debug.Assert(!left.Type.IsArray()); 9196Debug.Assert(left.Type.SpecialType != SpecialType.System_String); 9246Debug.Assert(receiver.Type is not null); 9247Debug.Assert(lookupResult.IsClear); 9282Debug.Assert(left is not null); 9290Debug.Assert(left.Type is not null); 9291Debug.Assert(!left.Type.IsDynamic()); 9292Debug.Assert(!left.Type.IsArray()); 9293Debug.Assert(left.Type.SpecialType != SpecialType.System_String); 9330Debug.Assert(receiver.Type is not null); 9350Debug.Assert(actualExtensionIntIndexerOrSliceArguments is null); 9368Debug.Assert(!argumentPlaceholders.IsDefault); 9406Debug.Assert(lengthOrCountProperty.ContainingType.ExtensionParameter is not null); 9426Debug.Assert(receiver.Type is not null); 9547Debug.Assert(receiver.Type is not null); 9556Debug.Assert(argKind is IndexOrRangeArgKind.Range); 9575Debug.Assert(receiver.Type is not null); 9669Debug.Assert(receiver.Type is not null); 9730Debug.Assert(!candidate.IsStatic); 9783Debug.Assert(resolutionResult.Result.ConversionForArg(0).Exists); 9966Debug.Assert((object)underlyingType != null); 9991Debug.Assert(propertySymbol.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) == CallerUnsafeMode.None || 10013Debug.Assert(symbol is not TypeSymbol); 10079Debug.Assert(eventSymbol.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) == CallerUnsafeMode.None || 10175Debug.Assert(!methodOrPropertyGroup.Any()); 10180Debug.Assert(result.Kind != LookupResultKind.Empty); 10181Debug.Assert(!result.Symbols.Any(s => s.IsIndexer())); 10227Debug.Assert(methodOrPropertyGroup.Any() || ((object)other != null)); 10257Debug.Assert(members.Count > 0); 10262Debug.Assert(members.All(m => m.Kind == member.Kind)); 10270Debug.Assert(members.All(m => !m.IsIndexer())); 10299Debug.Assert(receiver.Type?.IsFunctionPointer() != true, "There should have been an error reported for indexing into a function pointer."); 10316Debug.Assert(propertyGroup.ReceiverOpt is not null); 10366Debug.Assert(expr.Type.TryGetInlineArrayElementField() is not null); 10382Debug.Assert(tryInlineArrayAccess); 10383Debug.Assert(diagnosticsForBindElementAccessCore.DiagnosticBag is { }); 10610Debug.Assert(node != null); 10611Debug.Assert(expr != null); 10612Debug.Assert((object)expr.Type != null); 10613Debug.Assert(arguments != null); 10641Debug.Assert(node != null); 10642Debug.Assert(expr != null); 10643Debug.Assert(arguments != null); 10702Debug.Assert(convertedArguments.Length == 1); 10724Debug.Assert(index != null); 10829Debug.Assert(expr != null); 10830Debug.Assert((object)targetType != null); 10846Debug.Assert(result != null); // If this ever fails (it shouldn't), then put a null-check around the diagnostics update. 10853Debug.Assert(node != null); 10854Debug.Assert(expr != null); 10855Debug.Assert(analyzedArguments != null); 10869Debug.Assert(expr.Type.IsPointerType()); 10915Debug.Assert(node != null); 10916Debug.Assert(expr != null); 10917Debug.Assert((object?)expr.Type != null); 10918Debug.Assert(analyzedArguments != null); 10934Debug.Assert(symbol.IsIndexer()); 11005Debug.Assert(property.ParameterCount > 0); 11023Debug.Assert(receiver is not null); 11051Debug.Assert(receiver is not null); 11117Debug.Assert(receiver is not null); 11134Debug.Assert(finalApplicableCandidates[0].IsApplicable); 11260Debug.Assert(receiver is not null); 11261Debug.Assert(receiver.Type is not null); 11299Debug.Assert(argKind != IndexOrRangeArgKind.None); 11300Debug.Assert(lengthOrCountAccess is BoundPropertyAccess); 11301Debug.Assert(indexerOrSliceAccess is BoundIndexerAccess or BoundCall); 11302Debug.Assert(indexerOrSliceAccess.Type is not null); 11365Debug.Assert(argKind != IndexOrRangeArgKind.None); 11376Debug.Assert(actualExtensionIntIndexerOrSliceArguments is null); 11496Debug.Assert(receiverPlaceholder.Type is not null); 11499Debug.Assert(receiverPlaceholder.Type is not null); 11524Debug.Assert(lookupResult.IsClear); 11604Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 11636Debug.Assert(node.LookupError == null); 11696Debug.Assert(!methodResolution.HasAnyApplicableMethod); 11697Debug.Assert(!extensionMethodResolution.HasAnyApplicableMethod); 11698Debug.Assert(!methodResolution.IsEmpty); 11699Debug.Assert(!extensionMethodResolution.IsEmpty); 11713Debug.Assert(!extensionMethodResolution.IsEmpty); 11731Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 11864Debug.Assert(node.ReceiverOpt!.Type is not null); // extensions are only considered on member access 11882Debug.Assert(extensionMember is not null); 11921Debug.Assert(methods.Count != 0); 12080Debug.Assert(node.ReceiverOpt!.Type is not null); // extensions are only considered on member access 12096Debug.Assert(extensionMember is not null); 12209Debug.Assert(ContainingMemberOrLambda is { }); 12210Debug.Assert(parameterRefKinds.IsDefault || parameterRefKinds.Length == parameterTypes.Length); 12211Debug.Assert(parameterDefaultValues.IsDefault || parameterDefaultValues.Length == parameterTypes.Length); 12212Debug.Assert(returnType.Type is { }); // Expecting System.Void rather than null return type. 12213Debug.Assert(!hasParams || parameterTypes.Length != 0); 12302Debug.Assert((location == null) ^ (node == null)); 12356Debug.Assert((object)receiverType != null); 12475Debug.Assert(node != null); 12476Debug.Assert(node.Expression != null); 12482Debug.Assert(receiver != null); 12491Debug.Assert(conditionalAccessNode != null);
Binder\Binder_Flags.cs (6)
23Debug.Assert(containingMemberOrLambda != null); 31Debug.Assert(containingMemberOrLambda != null); 53Debug.Assert(receiverExpression != null); 80Debug.Assert((object)containing != null); 90Debug.Assert((object)containing != null); 124Debug.Assert(!this.Flags.Includes(BinderFlags.UncheckedRegion | BinderFlags.CheckedRegion));
Binder\Binder_Initializers.cs (5)
89Debug.Assert((object)fieldSymbol != null); 147Debug.Assert((ContainingMemberOrLambda is TypeSymbol containing && TypeSymbol.Equals(containing, fieldSymbol.ContainingType, TypeCompareKind.ConsiderEverything2)) || //should be the binder for the type 195Debug.Assert(syntaxTree.Options.Kind != SourceCodeKind.Regular); 207Debug.Assert(scriptClassBinder.ContainingMemberOrLambda is NamedTypeSymbol { IsScriptClass: true }); 289Debug.Assert(!fieldSymbol.IsMetadataConstant);
Binder\Binder_InterpolatedString.cs (21)
188Debug.Assert(isResultConstant == (resultConstant != null)); 219Debug.Assert(unconvertedInterpolatedString.Type?.SpecialType == SpecialType.System_String); 245Debug.Assert(unconvertedInterpolatedString.Parts.All(static part => part.Type is null or { SpecialType: SpecialType.System_String })); 387Debug.Assert(fillin.Alignment.ConstantValueOpt is { }); 392Debug.Assert(fillin.Format.ConstantValueOpt is { }); 407Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue != null); 442Debug.Assert(binaryOperator.IsUnconvertedInterpolatedStringAddition); 484Debug.Assert(partsArrayBuilder.Count >= 2); 510Debug.Assert(count <= 4); 530Debug.Assert(arg.AppendCalls.Length > i); 590Debug.Assert(appendCalls.Length == 1); 608Debug.Assert(binaryOperator.IsUnconvertedInterpolatedStringAddition); 641Debug.Assert(additionalConstructorArguments.IsDefault 669Debug.Assert(appendCallsArray.Select(a => a.Length).SequenceEqual(partsArray.Select(a => a.Length))); 670Debug.Assert(appendCallsArray.All(appendCalls => appendCalls.All(a => a is { HasErrors: true } or BoundCall { Arguments: { Length: > 0 } } or BoundDynamicInvocation))); 799Debug.Assert(constructorCall.HasErrors || constructorCall is BoundObjectCreationExpression or BoundDynamicObjectCreationExpression); 887Debug.Assert(part is BoundLiteral { Type: { SpecialType: SpecialType.System_String }, ConstantValueOpt.IsString: true }); 920Debug.Assert(part is BoundLiteral or BoundStringInsert); 952Debug.Assert(boundLiteral.ConstantValueOpt != null && boundLiteral.ConstantValueOpt.IsString); 970Debug.Assert(parameterNamesAndLocationsBuilder.Count == 0 || parameterNamesAndLocationsBuilder[0] == null); 979Debug.Assert(call is BoundCall or BoundDynamicInvocation or { HasErrors: true });
Binder\Binder_Invocation.cs (55)
101Debug.Assert(receiver != null); 102Debug.Assert(names.IsDefault || names.Length == args.Length); 125Debug.Assert(allowFieldsAndProperties || boundExpression.Kind is (BoundKind.MethodGroup or BoundKind.BadExpression)); 130Debug.Assert(!args.Any(static e => e.Kind == BoundKind.OutVariablePendingInference || 149Debug.Assert(diagnostics.DiagnosticBag is null || diagnostics.HasAnyErrors()); 226Debug.Assert(node.Expression.Kind() is SyntaxKind.SimpleMemberAccessExpression); 434Debug.Assert(ContainingType is not null); 565Debug.Assert(receiver.Type is not null); 617Debug.Assert((object?)arg.Type != null); 759Debug.Assert(extensionMemberAccess.Kind != BoundKind.MethodGroup); 793Debug.Assert(methodGroup.LookupSymbolOpt is not MethodSymbol); 860Debug.Assert(finalApplicableCandidates[0].IsApplicable); 872Debug.Assert(finalApplicableCandidates.Length > 0); 881Debug.Assert(methodGroup.ReceiverOpt != null && (object)methodGroup.ReceiverOpt.Type != null); 1042Debug.Assert(overloadResolutionResult.HasAnyApplicableMember); 1100Debug.Assert(diagnostics != null); 1182Debug.Assert(node != null); 1183Debug.Assert(methodGroup != null); 1184Debug.Assert(methodGroup.Error == null); 1185Debug.Assert(methodGroup.Methods.Count > 0); 1186Debug.Assert(((object)delegateTypeOpt == null) || (methodGroup.Methods.Count == 1)); 1192Debug.Assert(!invokedAsExtensionMethod || ((object)delegateTypeOpt == null)); 1256Debug.Assert(methodResult.Result.ConversionForArg(0).Exists); 1272Debug.Assert(analyzedArguments.Arguments[0] == (object)methodGroup.Receiver); 1315Debug.Assert(analyzedArguments.RefKind(0) == RefKind.None); 1364Debug.Assert(!method.HasUseSiteError, "Shouldn't have reached this point if there were use site errors."); 1375Debug.Assert(args.IsDefaultOrEmpty || (object)receiver != (object)args[0]); 1456Debug.Assert(parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object); 1537Debug.Assert(argumentOrdinal < argsToParamsOpt.Length); 1580Debug.Assert(argumentsBuilder[i].IsParamsArrayOrCollection); 1581Debug.Assert(i + 1 == argumentsBuilder.Count || 1597Debug.Assert(argumentsBuilder.Count >= parameters.Length); // Accounting for arglist cases 1598Debug.Assert(argumentRefKindsBuilder is null || argumentRefKindsBuilder.Count == 0 || argumentRefKindsBuilder.Count == argumentsBuilder.Count); 1599Debug.Assert(namesBuilder is null || namesBuilder.Count == 0 || namesBuilder.Count == argumentsBuilder.Count); 1600Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == argumentsBuilder.Count); 1622Debug.Assert(InAttributeArgument || (attributedMember is null && containingMember is not null)); 1628Debug.Assert(!expanded || parameters[^1].IsParams); 1637Debug.Assert(parameter.IsOptional); 1678Debug.Assert(argumentsBuilder.Count == parameters.Length); 1679Debug.Assert(argumentRefKindsBuilder is null || argumentRefKindsBuilder.Count == 0 || argumentRefKindsBuilder.Count == parameters.Length); 1680Debug.Assert(namesBuilder is null || namesBuilder.Count == 0 || namesBuilder.Count == parameters.Length); 1681Debug.Assert(argsToParamsBuilder is null || argsToParamsBuilder.Count == parameters.Length); 1713Debug.Assert((object?)defaultConstantValue != ConstantValue.Unset); 1806Debug.Assert(parameterIndex >= 0); 1900Debug.Assert(false); // Add test if this code path is reachable 1906Debug.Assert(conversion.IsCollectionExpression); 1923Debug.Assert(collection.IsParamsArrayOrCollection); 1992Debug.Assert(typeOrValue.Binder == (object)this); 2008Debug.Assert(typeOrValue.Type.Equals(boundValue.Type, TypeCompareKind.ConsiderEverything)); 2009Debug.Assert(typeOrValue.ValueSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol)); 2168Debug.Assert(!p.IsExtensionBlockMember()); 2389Debug.Assert(binder.Flags == this.Flags); 2450Debug.Assert(!syntaxIsOk); 2451Debug.Assert(indexerAccess.AccessorKind == AccessorKind.Unknown); 2467Debug.Assert(!resolution.IsNonMethodExtensionMember(out _));
Binder\Binder_Lambda.cs (6)
43Debug.Assert(syntax != null); 44Debug.Assert(syntax.IsAnonymousFunction()); 296Debug.Assert(syntax is not ScopedTypeSyntax); 367Debug.Assert(syntax != null); 368Debug.Assert(syntax.IsAnonymousFunction()); 436Debug.Assert(s_lambdaBindings is null);
Binder\Binder_Lookup.cs (40)
69Debug.Assert(options.AreValid()); 73Debug.Assert((binder != null) || result.IsClear); 80Debug.Assert(binder == otherBinder); 83Debug.Assert(result.IsMultiViable || result.IsClear || result.Error != null); 90Debug.Assert(result.IsClear); 91Debug.Assert(options.AreValid()); 156Debug.Assert(options.AreValid()); 167Debug.Assert(result.IsMultiViable || result.IsClear || result.Error != null); 172Debug.Assert(options.AreValid()); 174Debug.Assert(arity >= 0); 202Debug.Assert(name == WellKnownMemberNames.Indexer); 208Debug.Assert(implementationsToShadow is null); 233Debug.Assert(resultOfThisMember.Symbol is not null); 262Debug.Assert(resultOfThisMember.Symbol is not null); 459Debug.Assert(result.Symbols.All(IsMethodOrIndexer)); 577Debug.Assert(result.IsClear); 578Debug.Assert(options.AreValid()); 579Debug.Assert(options.IsAttributeTypeLookup()); 631Debug.Assert(resultWithSuffix != null); 695Debug.Assert(symbols.Count >= 2); 707Debug.Assert(!best.IsNone); 708Debug.Assert(!secondBest.IsNone); 766Debug.Assert((object)symbol != null); 776Debug.Assert((object)symbol != null); 792Debug.Assert(!diagnose || useSiteInfo.AccumulatesDiagnostics); 907Debug.Assert((object)type != null); 908Debug.Assert(!type.IsInterfaceType() && type.TypeKind != TypeKind.TypeParameter); 1126Debug.Assert((object)type != null); 1127Debug.Assert(type.IsInterface); 1254Debug.Assert((object)type != null); 1255Debug.Assert(type.IsInterface); 1272Debug.Assert((object)typeParameter != null); 1280Debug.Assert(!originalBinder.InCref, "Can't dot into type parameters, so how can this happen?"); 1291Debug.Assert(!TypeSymbol.Equals(baseType, derivedType, TypeCompareKind.ConsiderEverything2)); 1489Debug.Assert((options & LookupOptions.MustBeAbstractOrVirtual) == 0 || (options & LookupOptions.MustNotBeInstance) != 0); 1648Debug.Assert(symbol.MustCallMethodsDirectly()); 1687Debug.Assert(symbol.Kind != SymbolKind.Alias, "It is the caller's responsibility to unwrap aliased symbols."); 1688Debug.Assert(aliasSymbol == null || aliasSymbol.GetAliasTarget(basesBeingResolved: null) == symbol); 1689Debug.Assert(options.AreValid()); 1880Debug.Assert(object.ReferenceEquals(namedType.ConstructedFrom, namedType));
Binder\Binder_Operators.cs (156)
72Debug.Assert(left.Type is { }); 136Debug.Assert(ordinaryInstanceOperatorName is not null); 162Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 163Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 164Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 168Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 169Debug.Assert(originalUserDefinedOperators.IsEmpty); 184Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 268Debug.Assert(leftType is { }); 283Debug.Assert(finalConversion.HasErrors || (object)finalConversion == finalPlaceholder); 312Debug.Assert(left.Kind != BoundKind.EventAccess || hasError); 341Debug.Assert(!left.HasDynamicType()); 384Debug.Assert(leftType is not null); 412Debug.Assert(analyzedArguments is not null); 430Debug.Assert(!methods.IsEmpty); 435Debug.Assert(leftType is not null); 448Debug.Assert(analyzedArguments.RefKinds.Count == 0); 487Debug.Assert(method.ContainingType.ExtensionParameter is not null); 502Debug.Assert(conversion.Kind is ConversionKind.ImplicitReference); 503Debug.Assert(leftType.IsReferenceType); 601Debug.Assert(ordinaryInstanceOperatorName is not null); 692Debug.Assert(opKind == BinaryOperatorKind.Addition || opKind == BinaryOperatorKind.Subtraction); 778Debug.Assert(operand != null); 808Debug.Assert((object)left.Type != null && left.Type.IsDynamic() || (object)right.Type != null && right.Type.IsDynamic()); 838Debug.Assert(left.Type is not TypeParameterSymbol); 890Debug.Assert(IsSimpleBinaryOperator(node.Kind())); 925Debug.Assert(IsSimpleBinaryOperator(syntaxNode.Kind())); 988Debug.Assert(right.Type.SpecialType == SpecialType.System_String); 1043Debug.Assert(!resultOperatorKind.IsUserDefined()); 1073Debug.Assert((object)signature.LeftType != null); 1074Debug.Assert((object)signature.RightType != null); 1087Debug.Assert(conversionDiagnostics != diagnostics); 1091Debug.Assert(sourceBag is not null); 1217Debug.Assert(isObjectEquality); 1255Debug.Assert(current.IsUnconvertedInterpolatedStringAddition); 1260Debug.Assert(stack.Count > 0 && stack.Peek().Left is BoundUnconvertedInterpolatedString); 1277Debug.Assert(left != null); 1278Debug.Assert(stack.Count == 0); 1314Debug.Assert(!conversion.IsImplicit); 1344Debug.Assert(!right.Type.IsReferenceType); 1348Debug.Assert(!left.Type.IsReferenceType); 1389Debug.Assert(node.Kind() == SyntaxKind.LogicalOrExpression || node.Kind() == SyntaxKind.LogicalAndExpression); 1435Debug.Assert(kind == BinaryOperatorKind.LogicalAnd || kind == BinaryOperatorKind.LogicalOr); 1526Debug.Assert(trueOperator is { HasValue: true }); 1527Debug.Assert(falseOperator is { HasValue: true }); 1535Debug.Assert(resultLeft.Type.Equals(signature.LeftType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 1565Debug.Assert(bothBool); 1566Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1615Debug.Assert(left.IsLiteralNull()); 1646Debug.Assert(result.Conversion.IsImplicit); 1677Debug.Assert(signature.Kind.OperandTypes() == BinaryOperatorKind.UserDefined); 1678Debug.Assert(signature.Method is not null); 1693Debug.Assert(trueOperator is { HasValue: true }); 1694Debug.Assert(falseOperator is { HasValue: true }); 1695Debug.Assert(!trueOperator.GetValueOrDefault().Signature.Kind.IsLifted()); 1696Debug.Assert(!falseOperator.GetValueOrDefault().Signature.Kind.IsLifted()); 1700Debug.Assert(trueOperator is null); 1701Debug.Assert(falseOperator is null); 1895Debug.Assert(result.Results.IsEmpty); 2059Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2060Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2061Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2065Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2066Debug.Assert(originalUserDefinedOperators.IsEmpty); 2169Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2170Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2171Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2267Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2268Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 2269Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2273Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2274Debug.Assert(originalUserDefinedOperators.IsEmpty); 2316Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 2317Debug.Assert(possiblyBest.HasValue == (resultKind is LookupResultKind.Viable)); 2318Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 2460Debug.Assert(valueLeft != null); 2461Debug.Assert(valueRight != null); 2491Debug.Assert(valueLeft != null); 2492Debug.Assert(valueRight != null); 2534Debug.Assert(valueLeft != null); 2535Debug.Assert(valueRight != null); 2590Debug.Assert(valueLeft != null); 2591Debug.Assert(valueRight != null); 2686Debug.Assert(left != null); 2687Debug.Assert(right != null); 2688Debug.Assert(kind.IsEnum()); 2689Debug.Assert(!kind.IsLifted()); 2732Debug.Assert(resultTypeSymbol.SpecialType == SpecialType.System_Boolean); 2761Debug.Assert(left != null); 2762Debug.Assert(right != null); 2945Debug.Assert(valueLeft != null); 2946Debug.Assert(valueRight != null); 3200Debug.Assert(valueLeft != null); 3201Debug.Assert(valueRight != null); 3298Debug.Assert(operandType is not null); 3325Debug.Assert(ordinaryInstanceOperatorName is not null); 3342Debug.Assert(resultKind is LookupResultKind.Viable or LookupResultKind.Ambiguous or LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 3343Debug.Assert(best.HasValue == (resultKind is LookupResultKind.Viable)); 3344Debug.Assert(resultKind is not (LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty) || originalUserDefinedOperators.IsEmpty); 3348Debug.Assert(resultKind is LookupResultKind.OverloadResolutionFailure or LookupResultKind.Empty); 3349Debug.Assert(originalUserDefinedOperators.IsEmpty); 3365Debug.Assert(instanceExtensionResult.ResultKind is LookupResultKind.Viable || !instanceExtensionResult.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3409Debug.Assert(hasErrors || (object)resultConversion == resultPlaceholder); 3419Debug.Assert(!signature.Kind.IsUserDefined()); 3452Debug.Assert(operandType is not null); 3453Debug.Assert(!operandType.IsDynamic()); 3454Debug.Assert(kind is (UnaryOperatorKind.PrefixIncrement or UnaryOperatorKind.PrefixDecrement or UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement)); 3498Debug.Assert(operand.Type is not null); 3499Debug.Assert(mode != InstanceUserDefinedIncrementUsageMode.None); 3520Debug.Assert(analyzedArguments is not null); 3539Debug.Assert(!methods.IsEmpty); 3542Debug.Assert(operandType is not null); 3558Debug.Assert(analyzedArguments.RefKinds.Count == 0); 3593Debug.Assert(method.ContainingType.ExtensionParameter is not null); 3608Debug.Assert(conversion.Kind is ConversionKind.ImplicitReference); 3609Debug.Assert(operandType.IsReferenceType); 3693Debug.Assert(operand.Type is not null); 3710Debug.Assert(ordinaryInstanceOperatorName is not null); 3775Debug.Assert(mode != InstanceUserDefinedIncrementUsageMode.None); 3795Debug.Assert(parameterCount is 0 or 1); 3801Debug.Assert(SyntaxFacts.IsCheckedOperator(checkedName)); 3859Debug.Assert(parameterCount is 0 or 1); 3870Debug.Assert(parameterCount is 0 or 1); 3875Debug.Assert(SyntaxFacts.IsCheckedOperator(checkedName)); 3924Debug.Assert(extensionParameter is not null); 3936Debug.Assert(!op.IsStatic); 3960Debug.Assert(!x.IsOverride); 3961Debug.Assert(!x.IsStatic); 3963Debug.Assert(!y.IsOverride); 3964Debug.Assert(!y.IsStatic); 3973Debug.Assert(!method.IsOverride); 3974Debug.Assert(!method.IsStatic); 4032Debug.Assert((methodOpt.Name == WellKnownMemberNames.UnsignedRightShiftOperatorName) == isUnsignedRightShift); 4069Debug.Assert(node.Operand.SkipParens().GetLastToken().Kind() == SyntaxKind.ExclamationToken); 4146Debug.Assert(hasErrors); 4155Debug.Assert((object)operandType != null, "BindValue should have caught a null operand type"); 4477Debug.Assert(operand != null); 4662Debug.Assert(false, "Should be handled separately."); 4731Debug.Assert(valueRight != null); 4862Debug.Assert(hasUnionMatching); 4930Debug.Assert((object)inputType != null); 5052Debug.Assert(constantValue == ConstantValue.True || constantValue == ConstantValue.False); 5075Debug.Assert((object)targetType != null); 5116Debug.Assert((object)operandType != null); 5216Debug.Assert(operandType is TypeParameterSymbol { AllowsRefLikeType: false }); 5224Debug.Assert(targetType is TypeParameterSymbol { AllowsRefLikeType: false }); 5312Debug.Assert(operandType.IsNullableType()); 5369Debug.Assert(targetType.IsNullableType()); 5485Debug.Assert(operand.Type is null); 5501Debug.Assert((object)operandType != null); 5504Debug.Assert(!targetType.IsPointerOrFunctionPointer(), "Should have been caught above"); 5635Debug.Assert(constantValue.IsNull); 5890Debug.Assert((object)leftType != null); 6066Debug.Assert(type is { }); 6067Debug.Assert(Conversions.HasIdentityConversion(trueType, type)); 6068Debug.Assert(Conversions.HasIdentityConversion(falseType, type));
Binder\Binder_Patterns.cs (44)
30Debug.Assert(unionType is null || inputType.IsObjectType()); 76Debug.Assert(expression.Type is { }); 109Debug.Assert(expression.Type is object); 127Debug.Assert(expression.Type is object); 300Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 308Debug.Assert(indexerAccess.Type is not null); 394Debug.Assert(indexerAccess!.Type is not null); 429Debug.Assert(!inputType.IsDynamic()); 458Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess or BoundPointerElementAccess); 528Debug.Assert(hasUnionMatching); 569Debug.Assert(unionMatchingInputType is null || unionMatchingInputType.IsSubjectForUnionMatching); 674Debug.Assert(hasErrors); 872Debug.Assert((object)inputType != null); 873Debug.Assert((object)patternType != null); 959Debug.Assert(unionType.IsUnionType); 1019Debug.Assert((!conversion.IsUserDefined && !conversion.IsUnion) || result == ConstantValue.False || result == ConstantValue.Bad); 1056Debug.Assert(declType.HasType); 1117Debug.Assert(designation.SyntaxTree.Options.Kind != SourceCodeKind.Regular); 1220Debug.Assert(typeSyntax is null); 1221Debug.Assert(unionMatchingMode == UnionMatchingMode.None); 1269Debug.Assert(unionType is null || inputType.IsObjectType()); 1471Debug.Assert(!declType.IsTupleType); 1472Debug.Assert(!IsZeroElementTupleType(declType)); 1598Debug.Assert(node.Parent is { }); 1676Debug.Assert(unionType is null || strippedInputType.IsObjectType()); 1772Debug.Assert(expr is not null); 1887Debug.Assert(boundMember.HasAnyErrors); 1918Debug.Assert(declType.HasType); 1937Debug.Assert(unionType is null || inputType.IsObjectType()); 1953Debug.Assert(unionValueMatchingInputType == (object)inputType); 1971Debug.Assert(unionValueTypeMatchHasErrors && instanceTypeMatchHasErrors); 2035Debug.Assert(!isExplicitNotNullTest || unionMatchingMode == UnionMatchingMode.None); 2037Debug.Assert(unionType is null || inputType.IsObjectType()); 2059Debug.Assert(type is { }); 2167Debug.Assert(currentUnionType is null || subPattern.NarrowedType.IsObjectType()); 2193Debug.Assert(binaryPatternStack.Count > 0); 2202Debug.Assert(permitDesignations); 2207Debug.Assert(currentPermitDesignations == binaryPatternAndPermitDesignations.permitDesignations); 2232Debug.Assert(binaryPatternAndPermitDesignations.pat.IsKind(SyntaxKind.AndPattern)); 2237Debug.Assert(currentPermitDesignations == (permitDesignations && binaryPatternAndPermitDesignations.permitDesignations)); 2261Debug.Assert(!permitDesignations); 2267Debug.Assert(!permitDesignations); 2298Debug.Assert(candidates.Count >= 2); 2318Debug.Assert(spoiler.Equals(bestSoFar, TypeCompareKind.ConsiderEverything));
Binder\Binder_Query.cs (11)
109Debug.Assert(state.clauses.IsEmpty()); 219Debug.Assert(state.clauses.IsEmpty()); 300Debug.Assert(state.fromExpression.Type is { }); 694Debug.Assert(LambdaUtilities.IsQueryPairLambda(node)); 746Debug.Assert(yExpression.Type is { }); 841Debug.Assert(lambdaSymbol != null); 872Debug.Assert(node is ExpressionSyntax || LambdaUtilities.IsQueryPairLambda(node)); 925Debug.Assert(expectedMethodName is null || expectedMethodName == methodName); 933Debug.Assert(receiver.Type is object || ultimateReceiver.Type is null); 936Debug.Assert(ultimateReceiver.Kind != BoundKind.MethodGroup || ultimateReceiver.HasAnyErrors); 1024Debug.Assert(receiver == originalUltimateReceiver);
Binder\Binder_QueryErrors.cs (1)
215Debug.Assert(methodName == "SelectMany");
Binder\Binder_Statements.cs (94)
59Debug.Assert(node != null); 151Debug.Assert(result.WasCompilerGenerated == false || 156Debug.Assert(result.Syntax is StatementSyntax, "BoundStatement should be associated with a statement syntax."); 158Debug.Assert(System.Linq.Enumerable.Contains(result.Syntax.AncestorsAndSelf(), node), @"Bound statement (or one of its parents) 189Debug.Assert(fixedBinder != null); 203Debug.Assert(!declarations.IsEmpty); 298Debug.Assert(lockBinder != null); 310Debug.Assert(usingBinder != null); 339Debug.Assert(binder != null); 348Debug.Assert(binder != null); 354Debug.Assert(binder != null); 593Debug.Assert(blockBody != null || expressionBody != null || (localSymbol.IsExtern && localSymbol.IsStatic) || hasErrors); 703Debug.Assert(usingDeclaration is BoundUsingLocalDeclarations); 763Debug.Assert(expr is object); 764Debug.Assert(expr.Type is object); 765Debug.Assert(expr.Type.IsRefLikeType || hasAwait); // pattern dispose lookup is only valid on ref structs or asynchronous usings 793Debug.Assert( 803Debug.Assert(typeSyntax is not ScopedTypeSyntax); 805Debug.Assert(declType.HasType || isVar); 965Debug.Assert(declarator != null); 991Debug.Assert(declarator != null); 992Debug.Assert(declTypeOpt.HasType || isVar); 993Debug.Assert(typeSyntax != null); 1076Debug.Assert(declTypeOpt.HasType); 1229Debug.Assert(!ReferenceEquals(declType, null)); 1230Debug.Assert(declType.IsPointerType()); 1366Debug.Assert(initializer != null); 1410Debug.Assert(node != null); 1411Debug.Assert(node.Left != null); 1412Debug.Assert(node.Right != null); 1486Debug.Assert(op1 != null); 1487Debug.Assert(op2 != null); 1493Debug.Assert(!op1.NeedsToBeConverted() 1555Debug.Assert(op1 != null); 1556Debug.Assert(op2 != null); 1560Debug.Assert(op1.Type is { }); 1593Debug.Assert(leftEscape.Equals(rightEscape) || op1.Type.IsRefLikeOrAllowsRefLikeType()); 1601Debug.Assert(op1.Kind != BoundKind.Parameter); // If the assert fails, add a corresponding test. 1649Debug.Assert(false); 1657Debug.Assert(methodInvocationInfo.MethodInfo.Method is not null); 1861Debug.Assert((object)receiver.Type != null); 1872Debug.Assert(node != null); 1917Debug.Assert(binder != null); 1968Debug.Assert((object)targetType != null); 1969Debug.Assert(expression != null); 2048Debug.Assert((object)targetType != null); 2049Debug.Assert(anonymousFunction != null); 2105Debug.Assert(targetType.IsExpressionTree()); 2112Debug.Assert(targetType.IsGenericOrNonGenericExpressionType(out _)); 2150Debug.Assert(delegateType is not null); 2208Debug.Assert(diagnostics.DiagnosticBag?.Count is not 0); 2231Debug.Assert(anonymousFunction.HasExplicitlyTypedParameterList); 2235Debug.Assert(anonymousFunction.ParameterCount == delegateParameters.Length); 2241Debug.Assert(!lambdaParameterType.IsErrorType()); 2263Debug.Assert(ErrorFacts.PreventsSuccessfulDelegateConversion(bindingResult.Diagnostics.Diagnostics)); 2270Debug.Assert(false, "Missing case in lambda conversion error reporting"); 2281Debug.Assert(!conversion.IsImplicit || !conversion.IsValid); 2315Debug.Assert(conversion.IsUserDefined || conversion.IsUnion); 2324Debug.Assert(originalUserDefinedConversions.Length == 0, 2353Debug.Assert(operand != null); 2354Debug.Assert((object)targetType != null); 2445Debug.Assert(reportedError); 2465Debug.Assert(reportedError); 2487Debug.Assert(operand.HasAnyErrors && operand.Kind != BoundKind.UnboundLambda, "Missing a case in implicit conversion error reporting"); 2605Debug.Assert(b != null); 2790Debug.Assert(node != null); 2807Debug.Assert(node != null); 2810Debug.Assert(loopBinder != null); 2822Debug.Assert(loopBinder != null); 2835Debug.Assert(loopBinder != null); 2853Debug.Assert(typeSyntax is not ScopedTypeSyntax || localKind is LocalDeclarationKind.RegularVariable or LocalDeclarationKind.UsingVariable); 2873Debug.Assert(declType.HasType || isVar); 2877Debug.Assert(count > 0); 2965Debug.Assert(name != null); 3215Debug.Assert(returnRefKind == RefKind.None); 3292Debug.Assert(node != null); 3340Debug.Assert((object)type != null); 3376Debug.Assert(((object)type == null) || !type.IsErrorType()); 3418Debug.Assert(binder != null); 3426Debug.Assert(local.Type.IsErrorType() || (TypeSymbol.Equals(local.Type, type, TypeCompareKind.ConsiderEverything2))); 3568Debug.Assert(expressionSyntax != null || !IsValidExpressionBody(expressionSyntax, expression)); 3658Debug.Assert(bodyBinder != null); 3679Debug.Assert(bodyBinder != null); 3691Debug.Assert(bodyBinder != null); 3693Debug.Assert(body.Kind() != SyntaxKind.RefExpression); 3771Debug.Assert(typeDecl.ParameterList is object); 3772Debug.Assert(typeDecl.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.StructDeclaration); 3779Debug.Assert(initializerBinder != null); 3800Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3813Debug.Assert(bodyBinder != null); 3878Debug.Assert(!this.ContainingMember().IsImplicitlyDeclared); 3880Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3897Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer."); 3921Debug.Assert(sourceConstructor?.SyntaxNode is TypeDeclarationSyntax
Binder\Binder_Symbols.cs (44)
42Debug.Assert(isVar == symbol.IsDefault); 62Debug.Assert((keyword != ConstraintContextualKeyword.None) == symbol.IsDefault); 83Debug.Assert(isVar == symbol.IsDefault); 277Debug.Assert(UnwrapAliasNoDiagnostics(symbol) is NamespaceSymbol); 325Debug.Assert(diagnostics != null); 400Debug.Assert(!result.IsDefault); 1136Debug.Assert(syntax != null); 1137Debug.Assert(diagnostics != null); 1319Debug.Assert(lookupResult.Error != null); 1362Debug.Assert(typeArguments.Count > 0); 1458Debug.Assert(members.Count > 0); 1563Debug.Assert(lookupResult?.IsClear != false); 1602Debug.Assert(symbol.IsExtensionBlockMember()); 1639Debug.Assert(!typeArguments.IsEmpty); 1721Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1729Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found"); 1794Debug.Assert(symbol.IsDefinition); 1859Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 1867Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 1889Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found"); 1905Debug.Assert((syntax != null) ^ (location != null)); 2027Debug.Assert(where != null); 2028Debug.Assert(diagnostics != null); 2050Debug.Assert(!best.IsNone); 2051Debug.Assert(!secondBest.IsNone); 2066Debug.Assert(best.IsFromAddedModule); 2109Debug.Assert(!(srcSymbol.Kind == SymbolKind.Namespace && mdSymbol.Kind == SymbolKind.Namespace)); 2117Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(), 2120Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything), 2161Debug.Assert(!best.IsFromCorLibrary); 2173Debug.Assert(best.IsFromCompilation); 2209Debug.Assert(secondBest.IsFromAddedModule); 2220Debug.Assert(best.IsFromAddedModule); 2244Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly); 2275Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name || 2404Debug.Assert(symbols.Count > 0); 2524Debug.Assert(location != BestSymbolLocation.None); 2551Debug.Assert(secondLocation != 0); 2598Debug.Assert(!first.IsNone); 2599Debug.Assert(!second.IsNone); 2661Debug.Assert(qualifierOpt.IsNamespace); 2667Debug.Assert(aliasOpt == null || aliasOpt == SyntaxFacts.GetText(SyntaxKind.GlobalKeyword)); 2733Debug.Assert((object)forwardedType.ContainingAssembly != null, "How did we find a cycle if there was no forwarding?"); 2764Debug.Assert(false);
Binder\Binder_TupleOperators.cs (8)
56Debug.Assert(length == multiple.Operators.Length); 111Debug.Assert(!binary.OperatorKind.IsDynamic()); 187Debug.Assert((object)left.Type != null && left.Type.IsDynamic() || (object)right.Type != null && right.Type.IsDynamic()); 224Debug.Assert((object)left.Type != null || left.Kind == BoundKind.TupleLiteral); 225Debug.Assert((object)right.Type != null || right.Kind == BoundKind.TupleLiteral); 241Debug.Assert(length == rightParts.Length); 291Debug.Assert(leftNoNames || rightNoNames || leftNames.Length == rightNames.Length); 338Debug.Assert(targetType.StrippedType().IsTupleType);
Binder\Binder_Unsafe.cs (10)
113Debug.Assert(this.Compilation.SourceModule.UseUpdatedMemorySafetyRules || callerUnsafeMode == CallerUnsafeMode.Implicit); 117Debug.Assert(callerUnsafeMode == CallerUnsafeMode.Explicit || !forConstructorConstraint); 149Debug.Fail($"Symbol {symbol} has {nameof(CallerUnsafeMode)}={callerUnsafeMode}."); 154Debug.Fail($"Symbol {symbol} has {nameof(symbol.Kind)}={symbol.Kind}."); 159Debug.Fail($"Symbol {symbol} is a generic type."); 199Debug.Assert((node.Kind() == SyntaxKind.SizeOfExpression) == ((object?)sizeOfTypeOpt != null), "Should have a type for (only) sizeof expressions."); 267Debug.Assert(sizeOfTypeOpt is null || disallowedUnder is MemorySafetyRules.Legacy); 279Debug.Assert(customErrorCode is null && customArgs is null); 299Debug.Assert(disallowedUnder is MemorySafetyRules.Updated); 328Debug.Assert(disallowedUnder is MemorySafetyRules.Updated);
Binder\Binder_XmlNameAttribute.cs (3)
41Debug.Assert(lookupResult.IsMultiViable); 45Debug.Assert(lookupSymbols[0].Kind == SymbolKind.TypeParameter || lookupSymbols[0].Kind == SymbolKind.Parameter); 46Debug.Assert(lookupSymbols.All(sym => sym.Kind == lookupSymbols[0].Kind));
Binder\Binder.CapturedParametersFinder.cs (2)
58Debug.Assert(syntaxNode is not null); 165Debug.Assert(lookupResult.SingleSymbolOrDefault == (object)parameter);
Binder\Binder.cs (2)
124Debug.Assert(Next is not null); 820Debug.Assert(syntax.GetLocation() != null);
Binder\Binder.IdentifierUsedAsValueFinder.cs (8)
123Debug.Assert(targetNode.Parent is not null); 204Debug.Assert(_lookupResult?.IsClear != false); 267Debug.Assert(!type.IsDynamic()); 268Debug.Assert(lookupResult.IsClear); 277Debug.Assert(lookupResult.Symbols.Any()); 285Debug.Assert(members.Count > 0); 297Debug.Assert(symbol.Kind != SymbolKind.Method); 373Debug.Assert(state.clauses.IsEmpty());
Binder\Binder.NamespaceOrTypeOrAliasSymbolWithAnnotations.cs (3)
22Debug.Assert(typeWithAnnotations.HasType); 30Debug.Assert(!(symbol is TypeSymbol)); 47Debug.Assert(_symbol?.Kind == SymbolKind.Alias); // Not meaningful to use this property otherwise
Binder\Binder.OperatorResolutionForReporting.cs (5)
28Debug.Assert(_nonExtensionResult is null or OverloadResolutionResult<MethodSymbol> or BinaryOperatorOverloadResolutionResult or UnaryOperatorOverloadResolutionResult); 29Debug.Assert(_extensionResult is null or OverloadResolutionResult<MethodSymbol> or BinaryOperatorOverloadResolutionResult or UnaryOperatorOverloadResolutionResult); 126Debug.Assert(results.All(r => r.resultKind == OperatorAnalysisResultKind.Inapplicable)); 247Debug.Assert(results.All(r => r.resultKind != kind)); 272Debug.Assert(first is not null);
Binder\Binder.QueryTranslationState.cs (2)
78Debug.Assert(identifier.Parent is { }); 126Debug.Assert(nextInvokedMethodName is null);
Binder\Binder.ValueChecks.cs (104)
93Debug.Assert(method is ErrorMethodSymbol or { HasUnsupportedMetadata: true }); 156Debug.Assert(indexerAccess.AccessorKind != AccessorKind.Set); 172Debug.Assert(objectCreation.Constructor is not null); 188Debug.Assert(unaryOperator.MethodOpt is not null); 205Debug.Assert(binaryOperatorMethod is not null); 260Debug.Assert(incrementOperator.MethodOpt is not null); 277Debug.Assert(method is not null); 306Debug.Assert(propertyAccess.AutoPropertyAccessorKind != AccessorKind.Set); 353Debug.Assert(parameter.RefKind.IsWritableReference() && parameter.Type.IsRefLikeOrAllowsRefLikeType()); 354Debug.Assert(GetParameterValEscapeLevel(parameter).HasValue); 395Debug.Assert(!isArgList || parameter is null); 662Debug.Assert(parameters.Length == indexer.Parameters.Length); 743Debug.Assert(expr.Syntax.Kind() != SyntaxKind.Argument || valueKind == BindValueKind.RefOrOut); 748Debug.Assert(valueKind == BindValueKind.RefOrOut); 752Debug.Assert(valueKind is (BindValueKind.Assignable or BindValueKind.RefOrOut or BindValueKind.RefAssignable) || diagnostics.DiagnosticBag is null || diagnostics.HasAnyResolvedErrors()); 854Debug.Assert(!resolution.IsNonMethodExtensionMember(out _)); 873Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable); 880Debug.Assert(methodGroup.LookupError != null); 938Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 1109Debug.Assert(!RequiresRefAssignableVariable(valueKind)); 1404Debug.Assert(!RequiresAssignableVariable(BindValueKind.AddressOf)); 1423Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind)); 1431Debug.Assert(backingField.RefKind == RefKind.None); 1432Debug.Assert(!RequiresRefAssignableVariable(valueKind)); 1436Debug.Assert(backingField.RefKind == RefKind.None); 1469Debug.Assert(valueKind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp 1573Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape.IsReturnOnly); 1655Debug.Assert(valueKind == BindValueKind.RefAssignable); 1666Debug.Assert(fieldAccess.ReceiverOpt is null or BoundTypeExpression); 1671Debug.Assert(fieldAccess.ReceiverOpt is not null); 1805Debug.Assert(fieldAccess.ReceiverOpt is { }); 1862Debug.Assert(!RequiresVariableReceiver(receiver, eventSymbol)); 1912Debug.Assert(receiver != null); 1997Debug.Assert((object)propertySymbol != null); 1998Debug.Assert(propertySyntax != null); 2010Debug.Assert(propertySymbol.TypeWithAnnotations.HasType); 2214Debug.Assert(member.Kind != SymbolKind.Property); 2215Debug.Assert(member.Kind != SymbolKind.Event); 2267Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(in methodInvocationInfo)); 2430Debug.Assert(extensionParameter is not null); 2440Debug.Assert(methodInvocationInfo.HasAnyErrors, "Got a null receiver for a non-static extension method without errors?"); 2481Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(in methodInvocationInfo)); 2668Debug.Assert(receiver.Type is { }); 2669Debug.Assert(methodInvocationInfo.ReceiverIsSubjectToCloning != ThreeState.Unknown); 2673Debug.Assert(receiver is not BoundValuePlaceholderBase && method is not null && receiver.Type?.IsReferenceType == false); 2701Debug.Assert(argIndex == argsOpt.Length - 1); 2884Debug.Assert(methodInfo.Method?.IsExtensionMethod != false); 2913Debug.Assert(parameter?.IsThis != true); 2918Debug.Assert(escapeLevel == EscapeLevel.ReturnOnly); 3144Debug.Assert(symbol is null or SourceLocalSymbol or GlobalExpressionVariable); 3359Debug.Assert(underlyingParameter.IsThis); 3360Debug.Assert(underlyingParameter.RefKind != RefKind.Out); // Shouldn't get here for a constructor 3361Debug.Assert(underlyingParameter.ContainingSymbol is MethodSymbol); 3436Debug.Assert((object)local != null); 3437Debug.Assert(kind != BindValueKind.RValue); 3598Debug.Assert((object)field != null); 3599Debug.Assert(field.RefKind == RefKind.None ? RequiresAssignableVariable(kind) : RequiresRefAssignableVariable(kind)); 3600Debug.Assert(field.Type != (object)null); 3604Debug.Assert(kind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp 3634Debug.Assert((object)symbol != null); 3635Debug.Assert(RequiresAssignableVariable(kind)); 3671Debug.Assert(expr.Type is not null); 3752Debug.Assert(false); 3757Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 3885Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 3893Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 3921Debug.Assert(expr is BoundConversion conversion && 3928Debug.Assert(expr is BoundUnaryOperator unaryOperator && 3935Debug.Assert(expr is BoundBinaryOperator binaryOperator && 3942Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && 3948Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && 3955Debug.Assert(expr is BoundIncrementOperator incrementOperator && 3977Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 3981Debug.Assert(GetRefEscape(expr).IsConvertibleTo(escapeTo)); 4051Debug.Assert(false); 4056Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 4186Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 4194Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 4264Debug.Assert((!conversion.Conversion.IsUserDefined && !conversion.Conversion.IsUnion) || 4270Debug.Assert(expr is BoundUnaryOperator unaryOperator && 4277Debug.Assert(expr is BoundBinaryOperator binaryOperator && 4284Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && 4290Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && 4297Debug.Assert(expr is BoundIncrementOperator incrementOperator && 4368Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 4416Debug.Assert(false); 4594Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 4620Debug.Assert(operatorMethod is not null); 4642Debug.Assert(increment.OperatorKind.IsUserDefined()); 4645Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement); 4790Debug.Assert(elementType.Type is { }); 4799Debug.Assert(elementType.Type is { }); 4803Debug.Assert(expr.CollectionCreation is not null); 4848Debug.Assert(spreadElement.HasErrors 4863Debug.Assert(element.HasErrors); 5037Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 5041Debug.Assert(GetValEscape(expr).IsConvertibleTo(escapeTo)); 5069Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 5174Debug.Assert(false); 5373Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected"); 5409Debug.Assert(operatorMethod is not null); 5436Debug.Assert(increment.OperatorKind.IsUserDefined()); 5439Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement); 5765Debug.Assert(conversion.Conversion.IsInlineArray);
Binder\Binder.WithQueryLambdaParametersBinder.cs (4)
39Debug.Assert(!qv.IsTransparent); 49Debug.Assert(value.Count == 1); 56Debug.Assert(base.lambdaSymbol.Parameters[0].Name.StartsWith(transparentIdentifierPrefix, StringComparison.Ordinal)); 107Debug.Assert(result.IsClear);
Binder\BinderFactory.BinderFactoryVisitor.cs (26)
29Debug.Assert((memberDeclarationOpt == null) == (memberOpt == null)); 221Debug.Assert(method.Arity == 0, "Generic Ctor, What to do?"); 293Debug.Assert(accessor is not null || parent.HasErrors); 423Debug.Assert(!accessor.IsIterator); 440Debug.Assert(containingSymbol is NamespaceSymbol); 526Debug.Assert(basePropertyDeclarationSyntax.Kind() == SyntaxKind.PropertyDeclaration || basePropertyDeclarationSyntax.Kind() == SyntaxKind.IndexerDeclaration); 562Debug.Assert(kind is SymbolKind.Method or SymbolKind.Property or SymbolKind.Event); 633Debug.Assert(syntaxTree != null); 642Debug.Assert(syntaxTree != null); 859Debug.Assert(!inUsing || inBody, "inUsing => inBody"); 905Debug.Assert(name is not QualifiedNameSyntax); 916Debug.Assert(outer is SimpleProgramUnitBinder); 929Debug.Assert(!inUsing); 962Debug.Assert((object)compilation.ScriptClass != null); 1040Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 1056Debug.Assert(BitArithmeticUtilities.CountBits((uint)usage) <= 1, "Not a flags enum."); 1077Debug.Assert(token == this.syntaxTree.GetRoot().GetLastToken()); 1147Debug.Assert(extraInfo == NodeUsage.Normal || extraInfo == NodeUsage.CrefParameterOrReturnType, 1269Debug.Assert(type.IsExtension); 1306Debug.Assert(property.SetMethod.ParameterCount > 0); 1321Debug.Assert((object)delegateType != null); 1323Debug.Assert((object)invokeMethod != null); 1405Debug.Assert(crefSyntax != null); 1406Debug.Assert(memberSyntax != null); 1448Debug.Assert(xmlSyntax is XmlAttributeSyntax || xmlSyntax.Kind() == SyntaxKind.XmlEmptyElement || xmlSyntax.Kind() == SyntaxKind.XmlElementStartTag); 1483Debug.Assert(curr != null);
Binder\BinderFactory.cs (3)
126Debug.Assert(node != null); 158Debug.Assert(typeDecl.ParameterList is not null); 166Debug.Assert(constructor.Arity == 0, "Generic Ctor, What to do?");
Binder\BlockBinder.cs (1)
29Debug.Assert(block != null);
Binder\CatchClauseBinder.cs (1)
23Debug.Assert(syntax != null);
Binder\ContextualAttributeBinder.cs (1)
28Debug.Assert(symbol is not null);
Binder\DecisionDagBuilder_CheckOrReachability.cs (18)
84Debug.Assert(noPreviousCases.Count == 0); 284Debug.Assert(ShouldWarn(node)); 483Debug.Assert(diagSyntax is not null); 634Debug.Assert(current.Left is not BoundBinaryPattern { Disjunction: true }); 727public bool? OnTheLeftOfDisjunction { get; set { Debug.Assert(field is null); field = value; } } 762Debug.Assert(_disjunction.HasValue); 764Debug.Assert(_operationSyntax is not null); 776Debug.Assert(_operand is not null); 799Debug.Assert(_evalSequence is [var first, ..] && first.IsOperand(out _)); 868Debug.Assert(node is not BoundPattern { UnionMatchingMode: not UnionMatchingMode.None }); 869Debug.Assert(node is BoundBinaryPattern 920Debug.Assert(!(current.Left is BoundBinaryPattern binary && binary.Disjunction == node.Disjunction)); 1102Debug.Assert(pattern is BoundITuplePattern or BoundListPattern); 1179Debug.Assert(_evalSequence.Count == startOfLeft + 1); 1279Debug.Assert(_expectingOperandOfDisjunction == _negated); 1307Debug.Assert(_evalSequence.Count == startOfLeft + 1); 1368Debug.Assert(_evalSequence.Count == startOfLeft + 1); 1406Debug.Assert(slice.Pattern is not null);
Binder\DecisionDagBuilder_ListPatterns.cs (10)
18Debug.Assert(inputType.IsErrorType() || list.HasErrors || list.InputType.IsErrorType() || 43Debug.Assert(list.LengthAccess is not null); 45Debug.Assert(lengthProperty is not null); 63Debug.Assert(slice.IndexerAccess is not null); 64Debug.Assert(index <= 0); 65Debug.Assert(slice.ReceiverPlaceholder is not null); 66Debug.Assert(slice.ArgumentPlaceholder is not null); 79Debug.Assert(list.IndexerAccess is not null); 80Debug.Assert(list.ReceiverPlaceholder is not null); 81Debug.Assert(list.ArgumentPlaceholder is not null);
Binder\DecisionDagBuilder.cs (104)
372Debug.Assert(pattern.UnionMatchingMode == UnionMatchingMode.None); 373Debug.Assert(input.UnionValue is null ? 387Debug.Assert(input.UnionValue is null); 435Debug.Assert(unionValue.Symbol is PropertySymbol); 440Debug.Assert(IsUnionValue(result, out _)); 569Debug.Assert(input.Index == 0); 602Debug.Assert(variableAccess.Type!.Equals(input.Type, TypeCompareKind.AllIgnoreOptions) || variableAccess.Type.IsErrorType()); 758Debug.Assert(IsUnionHasValue(temp, out _)); 761Debug.Assert(test is Tests.One { Test: BoundDagValueTest }); 803Debug.Assert(IsUnionTryGetValueReturn(boolResult, out _, out _, out _)); 806Debug.Assert(test is Tests.One { Test: var tryGetValueResultTest } && IsUnionTryGetValueTest(tryGetValueResultTest, out _, out _, out _)); 844Debug.Assert(!conversion.IsUserDefined); 845Debug.Assert(!conversion.IsUnion); 904Debug.Assert(constant.Value.Type is not null || constant.HasErrors); 923Debug.Assert(input.Source is BoundDagPropertyEvaluation { IsLengthOrCount: true }); 1009Debug.Assert(subpattern is { IsLengthOrCount: false }); 1067Debug.Assert(subpattern.HasAnyErrors); 1095Debug.Assert(subpattern.HasAnyErrors); 1170Debug.Assert(bin.HasErrors || 1185Debug.Assert(type is { }); 1233Debug.Assert(_suitableForLowering || !_forLowering); 1239Debug.Assert(kvp.Key == kvp.Value); 1385Debug.Assert(!first.IsImpossible); 1460Debug.Assert(state.SelectedTest is null); 1488Debug.Assert(state.FalseBranch is null); 1489Debug.Assert(trueBranch is not null); 1490Debug.Assert(state.TrueBranch is not null); 1500Debug.Assert(stateForCases.Index == state.TrueBranch.Cases[case2].Index); 1505Debug.Assert(case2 >= state.TrueBranch.Cases.Count || stateForCases.Index != state.TrueBranch.Cases[case2].Index); 1544Debug.Assert(trueBranch is not null); 1545Debug.Assert(falseBranch is not null); 1610Debug.Assert(_defaultLabel != null); 1611Debug.Assert(defaultDecision != null); 1621Debug.Assert(wasAcyclic, "wasAcyclic"); // force failure in debug builds 1893Debug.Assert(e.IsLengthOrCount); 1899Debug.Assert(input.Index == 0); 1914Debug.Assert(input.Index == 0); 2210Debug.Assert(testUnionInstance != null); 2211Debug.Assert(testKind != UnionTestKind.TypeTest || testTargetType is not null); 2222Debug.Assert(otherUnionInstance != null); 2223Debug.Assert(otherKind != UnionTestKind.TypeTest || otherTargetType is not null); 2265Debug.Assert(testTargetType is not null); 2266Debug.Assert(otherTargetType is not null); 2377Debug.Assert((hasValueTest.Value == ConstantValue.True || hasValueTest.Value == ConstantValue.False)); 2396Debug.Assert(isTrue); // The only form of the test that we construct 2522Debug.Assert(s1LengthTemp.IsEquivalentTo(s2LengthTemp)); 2589Debug.Assert(s1.Input.Source is BoundDagTypeEvaluation); 2590Debug.Assert(s2.Input.Source is BoundDagTypeEvaluation); 2676Debug.Assert(input.Index == 0); 2961Debug.Assert(arrayBuilder != null); 3067Debug.Assert(dagState.Cases.IsDefault); 3068Debug.Assert(dagState.RemainingValues is null); 3069Debug.Assert(dagState.SelectedTest is null); 3070Debug.Assert(dagState.TrueBranch is null); 3071Debug.Assert(dagState.FalseBranch is null); 3072Debug.Assert(dagState.Dag is null); 3278Debug.Assert((conditionToUseFinalResult is null) == (tempsUpdatedResult is null)); 3279Debug.Assert((conditionToUseFinalResult is null) || (tempsUpdatedResult is One(BoundDagIndexerEvaluation))); 3316Debug.Assert(rewriteResult.TempsUpdatedResult is not null); 3354Debug.Assert(!b.TempContainingValue.Equals(useValueFrom)); 3523Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 3524Debug.Assert(t.Relation == BinaryOperatorKind.GreaterThanOrEqual); 3525Debug.Assert(t.Value.Int32Value >= 0); 3538Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 3542Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 3566Debug.Assert(value >= 0); // Tests with negative values should never be created. 3567Debug.Assert(offset >= 0); // The number of elements in a list is always non-negative. 3581Debug.Assert(tempMap.IsEmpty); 3607Debug.Assert(savedTempMap == tempsUpdatedResultTempMap); 3618Debug.Assert(removeEvaluationLeavesInputUnchanged(tempsUpdatedResult, builder, state, tempMap, e)); 3623Debug.Assert(!finalResult.Equals(tempsUpdatedResult) || tempsUpdatedResultTempMap == tempMap); 3624Debug.Assert(condition is null || 3628Debug.Assert(Test is not BoundDagIndexerEvaluation || 3646Debug.Fail("Unexpected change in temp map during conditional removal of indexer evaluation."); 3713Debug.Assert(!eval.Input.Equals(e1.Input)); 3762Debug.Assert(oldTemp.Type.Equals(newTemp.Type, TypeCompareKind.AllIgnoreOptions)); 3794Debug.Assert(!typeEval.Equals(e1)); 3860Debug.Fail("Do not expect to get in a situation when a type evaluation removal initiates a temp rewrite."); 3882Debug.Assert(s1LengthTemp.IsEquivalentTo(s2LengthTemp)); 3892Debug.Assert(state.RemainingValues.ContainsKey(s1LengthTemp)); 3896Debug.Assert(!lengthValues.IsEmpty); 3935Debug.Assert(passThrough.Input.Source is BoundDagTypeEvaluation); 4018Debug.Assert(test is not BoundDagEvaluation); 4046Debug.Assert(!values.IsEmpty); 4105Debug.Assert(test is BoundDagTypeTest, "New type of non-evaluation test added, please update filter for this"); 4151Debug.Assert(sample is not null); 4174Debug.Assert(Input.Source is not BoundDagPropertyEvaluation { IsLengthOrCount: true } e || 4244Debug.Assert(remainingTests.Length > 1); 4376Debug.Assert(tempMapToRestore == tempMap); 4386Debug.Assert(testsToAssemble.Count != 0); // If we have a child to rewrite, we must have a parent to reassemble. 4432Debug.Assert(testsToAssemble.Peek().Kind == ReassembleKind.And); 4442Debug.Assert(rewriteResult.TempsUpdatedResult is not null); 4448Debug.Assert(leftToRewriteBuilder.Count < childCount); 4475Debug.Assert(rewriteResult.ConditionToUseFinalResult is not null); 4476Debug.Assert(rewriteResult.TempsUpdatedResult is not null); 4547Debug.Assert(!skip); 4548Debug.Assert(!skip); 4616Debug.Assert(obj is SequenceTests); 4644Debug.Assert(t2 is SequenceTests seq && seq.RemainingTests.Length == sequence.RemainingTests.Length); 4778Debug.Assert(!remainingTests.Any(t => t is AndSequence)); 4785Debug.Assert(t2 is not (True or False)); 4884Debug.Assert(!remainingTests.Any(t => t is OrSequence)); 4891Debug.Assert(t2 is not (True or False)); 4943Debug.Assert(builder.Count == count);
Binder\EarlyWellKnownAttributeBinder.cs (2)
48Debug.Assert(false, "Don't call this overload."); 59Debug.Assert(node != null);
Binder\EmbeddedStatementBinder.cs (1)
27Debug.Assert(statement != null);
Binder\ExecutableCodeBinder.cs (1)
41Debug.Assert((object)memberSymbol == null ||
Binder\ExpressionListVariableBinder.cs (1)
22Debug.Assert(expressions.Count > 0);
Binder\ExpressionVariableFinder.cs (9)
27Debug.Assert(node != null); 55Debug.Assert(node.Parent is ConstructorInitializerSyntax || node.Parent is PrimaryConstructorBaseTypeSyntax); 58Debug.Assert(node is ExpressionSyntax); 115Debug.Assert(nodes.Count > 0); 226Debug.Assert(node.Designation == null || node.Designation.Kind() == SyntaxKind.DiscardDesignation); 265Debug.Assert(node.Designation is null or SingleVariableDesignationSyntax or DiscardDesignationSyntax); 277Debug.Assert(node.Designation is null or SingleVariableDesignationSyntax or DiscardDesignationSyntax); 614Debug.Assert(_scopeBinder.ContainingMemberOrLambda != null); 636Debug.Assert(_scopeBinder.ContainingMemberOrLambda != null);
Binder\FixedStatementBinder.cs (1)
25Debug.Assert(syntax != null);
Binder\ForEachEnumeratorInfo.cs (10)
78Debug.Assert(patternDisposeInfo == null || needsDisposal); 79Debug.Assert(inlineArraySpanType is WellKnownType.Unknown or WellKnownType.System_Span_T or WellKnownType.System_ReadOnlySpan_T); 80Debug.Assert(inlineArraySpanType == WellKnownType.Unknown || 82Debug.Assert(!inlineArrayUsedAsValue || inlineArraySpanType != WellKnownType.Unknown); 83Debug.Assert(!isAsync || moveNextAwaitableInfo != null); 127Debug.Assert((object)CollectionType != null, $"'{nameof(CollectionType)}' cannot be null"); 128Debug.Assert((object)ElementType != null, $"'{nameof(ElementType)}' cannot be null"); 129Debug.Assert(GetEnumeratorInfo != null, $"'{nameof(GetEnumeratorInfo)}' cannot be null"); 131Debug.Assert(MoveNextInfo != null); 132Debug.Assert(CurrentPropertyGetter != null);
Binder\ForEachLoopBinder.cs (53)
43Debug.Assert(syntax != null); 315Debug.Assert(declType.HasType); 436Debug.Assert(hasErrors || 467Debug.Assert(!IsDisallowedExtensionInOlderLangVer(getEnumeratorMethod)); 475Debug.Assert(!IsDisallowedExtensionInOlderLangVer(builder.MoveNextInfo.Method)); 476Debug.Assert(!IsDisallowedExtensionInOlderLangVer(builder.CurrentPropertyGetter)); 556Debug.Assert(collectionConversionClassification.IsValid); 557Debug.Assert(currentConversionClassification.IsValid || 562Debug.Assert((object)collectionConversionClassification.Method == null, 564Debug.Assert((object)currentConversionClassification.Method == null, 585Debug.Assert( 648Debug.Assert(!collectionConversionClassification.IsUserDefined); 649Debug.Assert(!collectionConversionClassification.IsUnion); 663Debug.Assert(collectionConversionClassification.IsIdentity); 664Debug.Assert(convertedCollectionExpression == (object)collectionExpr); 665Debug.Assert(collectionType.Equals(collectionExpr.Type, TypeCompareKind.AllIgnoreOptions)); // Should not create an Identity conversion that changes type. 692Debug.Assert(!isAsync || !isSpread); 787Debug.Assert(!isAsync || !isSpread); 884Debug.Assert(span == originalSpan); 885Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionBlockMember()); 892Debug.Assert(builder.CollectionType == (object)spanType); 930Debug.Assert(collectionExpr == originalCollectionExpr || 932Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionBlockMember()); 964Debug.Assert(collectionExpr.HasAnyErrors); // should already have been reported 1032Debug.Assert((object)builder.GetEnumeratorInfo != null); 1034Debug.Assert(!(viaExtensionMethod && builder.GetEnumeratorInfo.Method.IsExtensionMethod && builder.GetEnumeratorInfo.Method.Parameters.IsDefaultOrEmpty)); 1035Debug.Assert(!(viaExtensionMethod && !builder.GetEnumeratorInfo.Method.IsExtensionMethod && !builder.GetEnumeratorInfo.Method.IsExtensionBlockMember())); 1088Debug.Assert((object)builder.CollectionType != null); 1105Debug.Assert(IsIAsyncEnumerable(collectionType.OriginalDefinition)); 1111Debug.Assert(getEnumeratorMethod is null or { ParameterCount: 1 }); 1122Debug.Assert(collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T); 1143Debug.Assert(enumeratorType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T))); 1181Debug.Assert(collectionType.SpecialType == SpecialType.System_Collections_IEnumerable); 1188Debug.Assert((object)builder.GetEnumeratorInfo == null || 1213Debug.Assert(!patternDisposeMethod.IsExtensionMethod && !patternDisposeMethod.IsExtensionBlockMember(), 1215Debug.Assert(patternDisposeMethod.ParameterRefKinds.IsDefaultOrEmpty || 1237Debug.Assert(argsToParams.IsDefault); 1262Debug.Assert(!enumeratorType.IsRefLikeType); // Ref like types are supposed to be structs, therefore, sealed. 1324Debug.Assert((object)builder.GetEnumeratorInfo == null || 1374Debug.Assert(lookupResult.IsClear); 1464Debug.Assert(!result.IsExtensionMethod && !result.IsExtensionBlockMember()); 1483Debug.Assert(analyzedArguments.Arguments.Count == 0); 1499Debug.Assert(argsToParams.IsDefault); 1545Debug.Assert(result.IsExtensionMethod || result.IsExtensionBlockMember()); 1566Debug.Assert(!collectionConversion.IsUserDefined); 1567Debug.Assert(!collectionConversion.IsUnion); 1589Debug.Assert(!result.IsStatic); 1643Debug.Assert((object)builder.GetEnumeratorInfo.Method != null); 1696Debug.Assert((object)lookupSymbol != null); 1949Debug.Assert(resolvedMember is null or { ParameterCount: 0 }); 1958Debug.Assert((extensionReceiverOpt != null) == (method.IsExtensionMethod || method.IsExtensionBlockMember())); 1959Debug.Assert(!method.IsExtensionBlockMember() || !method.IsStatic); 1987Debug.Assert(argsToParams.IsDefault);
Binder\ForLoopBinder.cs (3)
24Debug.Assert(syntax != null); 108Debug.Assert(increment.Kind != BoundKind.StatementList || ((BoundStatementList)increment).Statements.Length > 1); 128Debug.Assert(this.Locals == this.GetDeclaredLocalsForScope(node));
Binder\HostObjectModeBinder.cs (1)
27Debug.Assert((object)result != null);
Binder\ImportChain.cs (4)
24Debug.Assert(imports != null); 39Debug.Assert(result); 40Debug.Assert(!imports.IsDefault); 107Debug.Assert(!symbol.IsExtern);
Binder\Imports.cs (12)
41Debug.Assert(usingAliases != null); 42Debug.Assert(!usings.IsDefault); 43Debug.Assert(!externs.IsDefault); 67Debug.Assert(previousSubmissionImports != null); 68Debug.Assert(newSubmission.IsSubmission); 93Debug.Assert(newSubmission.IsSubmission); 123Debug.Assert(!originalNamespace.IsGlobalNamespace, "Global using to global namespace"); 126Debug.Assert(expandedGlobalNamespace.IsGlobalNamespace, "Global namespace required"); 156Debug.Assert(usingAliases != null); 157Debug.Assert(!usings.IsDefault); 158Debug.Assert(!externs.IsDefault); 173Debug.Assert(otherImports != null);
Binder\InContainerBinder.cs (2)
31Debug.Assert((object)container != null); 103Debug.Assert(result.IsClear);
Binder\InMethodBinder.cs (6)
44Debug.Assert(!enclosing.Flags.Includes(BinderFlags.InCatchFilter)); 45Debug.Assert((object)owner != null); 187Debug.Assert(result.IsClear); 237Debug.Assert(!locations.IsEmpty || parameter.IsImplicitlyDeclared); 239Debug.Assert(oldLocation != newLocation || oldLocation == Location.None || newLocation.SourceTree?.GetRoot().ContainsDiagnostics == true, 316Debug.Assert(false, "what else could be defined in a method?");
Binder\InSubmissionClassBinder.cs (2)
29Debug.Assert(submissionClass.IsSubmissionClass); 45Debug.Assert(result.IsClear);
Binder\LocalBinderFactory.cs (26)
136Debug.Assert((object)containingMemberOrLambda != null); 137Debug.Assert(containingMemberOrLambda.Kind != SymbolKind.Local && containingMemberOrLambda.Kind != SymbolKind.RangeVariable && containingMemberOrLambda.Kind != SymbolKind.Parameter); 175Debug.Assert(node.ParameterList is object); 176Debug.Assert(node.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration); 288Debug.Assert((current.Flags & BinderFlags.InContextualAttributeBinder) != 0); 291Debug.Assert(contextualAttributeBinder is not null); 333Debug.Assert(false); 347Debug.Assert(false); 354Debug.Assert(delegateType.IsDelegateType()); 360Debug.Assert(false); 367Debug.Assert(parameters[^1] is SynthesizedAccessorValueParameterSymbol); 542Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 555Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 562Debug.Assert((expressionSyntax == null) ^ (declarationSyntax == null)); // Can't have both or neither. 583Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 593Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 603Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 649Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 709Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 745Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 893Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 933Debug.Assert(_map.TryGetValue(node.Block, out finallyBinder) && finallyBinder.Flags.Includes(BinderFlags.InFinallyBlock)); 1026Debug.Assert(node.CanHaveAssociatedLocalBinder() || 1038Debug.Assert(!_map.TryGetValue(node, out existing) || existing == binder || existing == binder.Next || existing == binder.Next?.Next); 1066Debug.Assert((object)_containingMemberOrLambda == enclosing.ContainingMemberOrLambda); 1071Debug.Assert((object)_containingMemberOrLambda == enclosing.ContainingMemberOrLambda);
Binder\LocalInProgressBinder.cs (1)
35Debug.Assert(_localSymbol is not null);
Binder\LocalScopeBinder.cs (6)
134Debug.Assert(array.Length > 0); 276Debug.Assert(statementBinder != null); // Lock always has a binder. 424Debug.Assert(options.AreValid()); 425Debug.Assert(result.IsClear); 464Debug.Assert(options.AreValid()); 536Debug.Assert(false, "what else can be declared inside a local scope?");
Binder\LockBinder.cs (1)
74Debug.Assert(this.Locals.IsDefaultOrEmpty);
Binder\LockOrUsingBinder.cs (3)
44Debug.Assert(targetExpressionSyntax.Parent.Kind() == SyntaxKind.LockStatement || 73Debug.Assert(_lazyLockedOrDisposedVariables != null); 95Debug.Assert(_lazyExpressionAndDiagnostics != null);
Binder\LookupResult.cs (1)
336Debug.Assert(instance.IsClear);
Binder\LookupResultKind.cs (1)
94Debug.Assert(false, "Should not call this on LookupResultKind.Viable");
Binder\LookupSymbolsInfo.cs (1)
38Debug.Assert(info.Count == 0);
Binder\MethodArgumentInfo.cs (1)
36Debug.Assert(method.ParameterCount == 0);
Binder\MethodGroupResolution.cs (8)
46Debug.Assert((methodGroup != null) || ((object)otherSymbol != null) || analyzedArguments == null); // analyzedArguments is only set if we have some result 47Debug.Assert((methodGroup == null) || (methodGroup.Methods.Count > 0)); 48Debug.Assert((methodGroup == null) || ((object)otherSymbol == null)); 50Debug.Assert(((object)otherSymbol == null) || (otherSymbol.Kind != SymbolKind.Method)); 51Debug.Assert(resultKind != LookupResultKind.Ambiguous); // HasAnyApplicableMethod is expecting Viable methods. 52Debug.Assert(!diagnostics.Diagnostics.IsDefault); 53Debug.Assert(!diagnostics.Dependencies.IsDefault); 96Debug.Assert((extensionMember is not null) || !isExtensionMember);
Binder\PatternExplainer.cs (9)
38Debug.Assert(nullPaths == (reachabilityInfo is not null)); 50Debug.Assert(!nodes.Contains(x)); 106Debug.Assert(next != null); 107Debug.Assert(distance(next) == (d - 1)); 252Debug.Assert(nullPaths == (reachabilityInfo is not null)); 396Debug.Assert(sense); // we have dropped failing type tests 524Debug.Assert(e == slice); 750Debug.Assert(typeName != null || deconstruction != null || propertyString != null); 837Debug.Assert(underlyingType.IsNativeIntegerType);
Binder\RefSafetyAnalysis.cs (28)
227Debug.Assert(_localEscapeScopes?.ContainsKey(local) == true || _symbol != local.ContainingSymbol); 236Debug.Assert(_localEscapeScopes?.ContainsKey(local) == true); 246Debug.Fail($"Placeholder {placeholder} already has a scope: {existing.FilePath}:{existing.LineNumber}."); 260Debug.Assert(_placeholderScopes?.ContainsKey(placeholder) == true); 270Debug.Assert(_placeholderScopes?.ContainsKey(placeholder) == true); 344Debug.Assert(ContainsPlaceholderScope(placeholder)); 360Debug.Assert(ContainsPlaceholderScope(placeholder)); 496Debug.Assert(_localEscapeScopes?.ContainsKey(node.LocalSymbol) == true || 524Debug.Assert(_localEscapeScopes?.ContainsKey(local) != true); 538Debug.Assert(_localEscapeScopes is { }); 559Debug.Assert(localSymbol.RefKind == RefKind.None || 877Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 899Debug.Assert(interpolationData.ReceiverPlaceholder is not null); 912Debug.Assert(receiver != null); 923Debug.Assert(placeholder.Type.SpecialType == SpecialType.System_Boolean); 930Debug.Assert(isExtensionBlockMethod); 1016Debug.Assert(node.Constructor is not null); 1063Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 1073Debug.Assert(node.AccessorKind is not AccessorKind.Unknown); 1081Debug.Assert(node.AccessorKind is AccessorKind.Get or AccessorKind.Both); 1082Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 1144Debug.Assert(node.ArgumentPlaceholders.All(p => p is BoundImplicitIndexerValuePlaceholder { Type.SpecialType: SpecialType.System_Int32 })); 1165Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 1195Debug.Assert(parameters.Length - offset == n); 1216Debug.Assert(offset == 1); 1217Debug.Assert(methodInvocationInfo.Receiver is null); 1435Debug.Assert(spreadElement.HasErrors 1443Debug.Assert(element is BoundCollectionElementInitializer or BoundExpression, $"Unexpected collection expression element {element}");
Binder\SafeContext.cs (2)
66Debug.Assert(_value >= ReturnOnlyRaw); 76Debug.Assert(_value >= CurrentMethodRaw);
Binder\Semantics\AccessCheck.cs (22)
69Debug.Assert(symbol is object); 142Debug.Assert((object)symbol != null); 143Debug.Assert((object)within != null); 144Debug.Assert(within.IsDefinition); 145Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 225Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 226Debug.Assert((object)type != null); 261Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 262Debug.Assert((object)assembly != null); 307Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 308Debug.Assert((object)containingType != null); 464Debug.Assert(current.IsDefinition); 497Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 518Debug.Assert((object)withinType != null); 519Debug.Assert((object)originalContainingType != null); 520Debug.Assert(originalContainingType.IsDefinition); 527Debug.Assert(current.IsDefinition); 551Debug.Assert(type.IsDefinition); 552Debug.Assert(baseType.IsDefinition); 570Debug.Assert(current.IsDefinition); 602Debug.Assert(!result); 613Debug.Assert(currentBase.IsDefinition);
Binder\Semantics\BestTypeInferrer.cs (4)
26Debug.Assert(!type.HasType || type.Equals(example, TypeCompareKind.AllIgnoreOptions)); 72Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr)); 137Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr1)); 152Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr2));
Binder\Semantics\Conversions\Conversion.cs (13)
98Debug.Assert(!deconstructConversionInfo.IsDefaultOrEmpty); 115Debug.Assert(collectionExpressionTypeKind != CollectionExpressionTypeKind.None); 116Debug.Assert(elementType is { }); 163Debug.Assert(!(this is { IsNullable: true, UnderlyingConversions: var underlying } && (underlying[0].IsUserDefined || underlying[0].IsUnion))); 207Debug.Assert(kind == ConversionKind.Deconstruction); 222Debug.Assert(_kind is ConversionKind.MethodGroup or ConversionKind.IntPtr or ConversionKind.ImplicitUserDefined or ConversionKind.ExplicitUserDefined); 229Debug.Assert(_kind.IsDynamic()); 230Debug.Assert(_uncommonData == null); 377Debug.Assert(kind == ConversionKind.ImplicitNullable || kind == ConversionKind.ExplicitNullable); 439Debug.Assert((_uncommonData as NestedUncommonData)?._nestedConversionsChecked ?? true); 620Debug.Assert(!this.IsUserDefined); 621Debug.Assert(!this.IsUnion); 1320Debug.Assert(invocation is not BoundCall { Expanded: true });
Binder\Semantics\Conversions\Conversions.cs (12)
40Debug.Assert(IncludeNullability != includeNullability); 58Debug.Assert(methodSymbol == ((NamedTypeSymbol)destination).DelegateInvokeMethod); 105Debug.Assert(!resolution.IsNonMethodExtensionMember(out _)); 152Debug.Assert(source is BoundUnconvertedInterpolatedString); 185Debug.Assert(elementType is { }); 283Debug.Assert(!resolution.IsNonMethodExtensionMember(out _)); 343Debug.Assert((object)method != null); 346Debug.Assert(method.IsExtensionMethod || method.IsExtensionBlockMember()); 414Debug.Assert((object)delegateInvokeMethod != null && !delegateInvokeMethod.HasUseSiteError, 515Debug.Assert(method.ParameterCount == parameterCount + (isExtensionMethod ? 1 : 0)); 524Debug.Assert((object)sourceExpression.Type == null); 525Debug.Assert((object)sourceExpression.ElementType != null);
Binder\Semantics\Conversions\ConversionsBase.cs (155)
35Debug.Assert((object)corLibrary != null); 36Debug.Assert(otherNullabilityOpt == null || includeNullability != otherNullabilityOpt.IncludeNullability); 37Debug.Assert(otherNullabilityOpt == null || currentRecursionDepth == otherNullabilityOpt.currentRecursionDepth); 38Debug.Assert(corLibrary == corLibrary.CorLibrary); 60Debug.Assert(_lazyOtherNullability.IncludeNullability == includeNullability); 61Debug.Assert(_lazyOtherNullability._lazyOtherNullability == this); 100Debug.Assert(sourceExpression != null); 101Debug.Assert(Compilation != null); 102Debug.Assert((object)destination != null); 171Debug.Assert((object)source != null); 172Debug.Assert((object)destination != null); 221Debug.Assert(false); 236Debug.Assert((object)source != null); 237Debug.Assert((object)destination != null); 285Debug.Assert(sourceExpression != null); 286Debug.Assert(Compilation != null); 287Debug.Assert((object)destination != null); 319Debug.Assert((object)source != null); 320Debug.Assert((object)destination != null); 377Debug.Assert(source != null); 378Debug.Assert(Compilation != null); 379Debug.Assert((object)destination != null); 431Debug.Assert((object)source != null); 432Debug.Assert((object)destination != null); 501Debug.Assert((object)source != null); 502Debug.Assert((object)destination != null); 543Debug.Assert(sourceExpression is null || Compilation is not null); 544Debug.Assert(sourceExpression != null || (object)source != null); 545Debug.Assert((object)destination != null); 607Debug.Assert(sourceExpression is null || Compilation is not null); 608Debug.Assert(sourceExpression != null || (object)source != null); 609Debug.Assert(sourceExpression == null || (object)sourceExpression.Type == (object)source); 610Debug.Assert((object)destination != null); 647Debug.Assert(isStandardImplicitConversionFromExpression(conversion.Kind)); 698Debug.Assert(conversion.Kind == ConversionKind.NoConversion || IsStandardImplicitConversionFromType(conversion.Kind)); 703Debug.Assert((object)source != null); 704Debug.Assert((object)destination != null); 724Debug.Assert(false); 765Debug.Assert((object)source != null); 766Debug.Assert((object)destination != null); 809Debug.Assert((object)source != null); 810Debug.Assert((object)destination != null); 819Debug.Assert(!HasExplicitNumericConversion(source, destination)); 966Debug.Assert((object)baseType != null); 967Debug.Assert((object)derivedType != null); 1001Debug.Assert((object)derivedType != null); 1002Debug.Assert((object)baseType != null); 1046Debug.Assert(sourceExpression is null || Compilation is not null); 1047Debug.Assert(sourceExpression != null || (object)source != null); 1048Debug.Assert(sourceExpression == null || (object)sourceExpression.Type == (object)source); 1049Debug.Assert((object)destination != null); 1201Debug.Assert(Compilation is not null); 1230Debug.Assert(Compilation is not null); 1248Debug.Assert((object)source != null); 1249Debug.Assert((object)destination != null); 1310Debug.Assert(Compilation is not null); 1336Debug.Assert(Compilation is not null); 1418Debug.Assert(sourceExpression != null); 1419Debug.Assert(Compilation != null); 1420Debug.Assert((object)destination != null); 1458Debug.Assert((object)source != null); 1459Debug.Assert((object)destination != null); 1484Debug.Assert((object)anonymousFunction != null); 1485Debug.Assert((object)type != null); 1603Debug.Assert((object)anonymousFunction != null); 1604Debug.Assert((object)type != null); 1605Debug.Assert(type.IsExpressionTree()); 1641Debug.Assert((object)anonymousFunction != null); 1642Debug.Assert((object)type != null); 1658Debug.Assert(source != null); 1659Debug.Assert((object)destination != null); 1671Debug.Assert(compilation is { }); 1746Debug.Assert((object)sourceType != null); 1747Debug.Assert(!sourceType.IsValidV6SwitchGoverningType()); 1756Debug.Assert(switchGoverningType.IsValidV6SwitchGoverningType(isTargetTypeOfUserDefinedOp: true)); 1819Debug.Assert((object)type1 != null); 1820Debug.Assert((object)type2 != null); 1906Debug.Assert(IncludeNullability); 1928Debug.Assert((object)thisType != null); 1938Debug.Assert(sourceExpressionOpt is null || Compilation is not null); 1939Debug.Assert(sourceExpressionOpt == null || (object)sourceExpressionOpt.Type == sourceType); 1940Debug.Assert((object)destination != null); 1969Debug.Assert(!IncludeNullability); 2041Debug.Assert(conversion.Kind == ConversionKind.NoConversion); 2050Debug.Assert((object)source != null); 2051Debug.Assert((object)destination != null); 2066Debug.Assert(conversionKind is ConversionKind.ImplicitNumeric or ConversionKind.ExplicitNumeric); 2139Debug.Assert((object)source != null); 2140Debug.Assert((object)target != null); 2225Debug.Assert((object)source != null); 2226Debug.Assert((object)destination != null); 2254Debug.Assert((object)source != null); 2255Debug.Assert((object)destination != null); 2300Debug.Assert(Compilation is not null); 2304Debug.Assert(!IncludeNullability); 2318Debug.Assert(Compilation is not null); 2322Debug.Assert(!IncludeNullability); 2343Debug.Assert(Compilation is not null); 2354Debug.Assert(arguments.Length == targetElementTypes.Length); 2455Debug.Assert((object)source != null); 2456Debug.Assert((object)destination != null); 2510Debug.Assert((object)source != null); 2511Debug.Assert((object)destination != null); 2532Debug.Assert((object)source != null); 2533Debug.Assert((object)destination != null); 2548Debug.Assert((object)destination != null); 2557Debug.Assert((object)source != null); 2558Debug.Assert((object)destination != null); 2564Debug.Assert((object)source != null); 2565Debug.Assert((object)destination != null); 2645Debug.Assert((object)source != null); 2646Debug.Assert((object)destination != null); 2895Debug.Assert((object)source != null); 2896Debug.Assert((object)destination != null); 2992Debug.Assert((object)derivedType != null); 2993Debug.Assert((object)baseType != null); 3023Debug.Assert(targetInterfaceType.IsErrorType() || targetInterfaceType.IsInterface); 3057Debug.Assert(targetInterfaceType.IsErrorType() || targetInterfaceType.IsInterface); 3091Debug.Assert((object)source != null); 3092Debug.Assert((object)destination != null); 3110Debug.Assert((object)source != null); 3111Debug.Assert((object)destination != null); 3160Debug.Assert((object)source != null); 3161Debug.Assert((object)destination != null); 3179Debug.Assert((object)source != null); 3180Debug.Assert((object)destination != null); 3192Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, destination.OriginalDefinition, TypeCompareKind.AllIgnoreOptions)); 3193Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 3194Debug.Assert(typeParameters.Count == destinationTypeArguments.Count); 3272Debug.Assert((object)source != null); 3273Debug.Assert((object)destination != null); 3326Debug.Assert((object)source != null); 3327Debug.Assert((object)destination != null); 3387Debug.Assert((object)source != null); 3388Debug.Assert((object)destination != null); 3455Debug.Assert((object)source != null); 3456Debug.Assert((object)destination != null); 3478Debug.Assert((object)source != null); 3479Debug.Assert((object)destination != null); 3552Debug.Assert((object)source != null); 3553Debug.Assert((object)destination != null); 3604Debug.Assert((object)source != null); 3605Debug.Assert((object)destination != null); 3655Debug.Assert((object)source != null); 3656Debug.Assert((object)destination != null); 3744Debug.Assert((object)source != null); 3745Debug.Assert((object)destination != null); 3836Debug.Assert((object)source != null); 3837Debug.Assert((object)destination != null); 3904Debug.Assert((object)source != null); 3905Debug.Assert((object)destination != null); 3912Debug.Assert((object)source != null); 3913Debug.Assert((object)destination != null); 3930Debug.Assert((object)source != null); 3931Debug.Assert((object)destination != null);
Binder\Semantics\Conversions\TypeConversions.cs (1)
32Debug.Assert(IncludeNullability != includeNullability);
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (19)
27Debug.Assert(sourceExpression is null || Compilation is not null); 28Debug.Assert(sourceExpression != null || (object)source != null); 29Debug.Assert((object)target != null); 94Debug.Assert(sourceExpression is null || Compilation is not null); 95Debug.Assert(sourceExpression != null || (object)source != null); 96Debug.Assert((object)target != null); 97Debug.Assert(d != null); 98Debug.Assert(u != null); 106Debug.Assert(constrainedToTypeOpt is not null); 152Debug.Assert(sourceExpression is null || Compilation is not null); 153Debug.Assert(sourceExpression != null || (object)source != null); 154Debug.Assert((object)target != null); 155Debug.Assert(u != null); 156Debug.Assert((object)declaringType != null); 327Debug.Assert(liftedFromConversion.Exists); 328Debug.Assert(liftedToConversion.Exists); 481Debug.Assert(expr is null || Compilation is not null); 482Debug.Assert(expr != null || (object)a != null); 483Debug.Assert((object)b != null);
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (22)
31Debug.Assert(sourceExpression is null || Compilation is not null); 32Debug.Assert(sourceExpression != null || (object)source != null); 33Debug.Assert((object)target != null); 151Debug.Assert(sourceExpression is null || Compilation is not null); 152Debug.Assert(sourceExpression != null || (object)source != null); 153Debug.Assert(((object)target != null) == !allowAnyTarget); 154Debug.Assert(d != null); 155Debug.Assert(u != null); 259Debug.Assert(constrainedToTypeOpt is not null); 577Debug.Assert(aExpr is null || Compilation is not null); 578Debug.Assert((object)a != null); 579Debug.Assert((object)b != null); 596Debug.Assert(aExpr is null || Compilation is not null); 597Debug.Assert(aExpr != null || (object)a != null); 598Debug.Assert((object)b != null); 908Debug.Assert((object)source != null); 909Debug.Assert(!source.IsValidV6SwitchGoverningType()); 990Debug.Assert(sourceExpression is null || Compilation is not null); 991Debug.Assert(sourceExpression != null || (object)source != null); 992Debug.Assert((object)target != null); 1035Debug.Assert(targetConversion.Exists && targetConversion.IsImplicit); 1036Debug.Assert(targetConversion.IsIdentity || (targetConversion.IsNullable && targetConversion.UnderlyingConversions[0].IsIdentity));
Binder\Semantics\Operators\BinaryOperatorEasyOut.cs (6)
317Debug.Assert(leftConversion.Exists && leftConversion.IsImplicit); 318Debug.Assert(rightConversion.Exists && rightConversion.IsImplicit); 325Debug.Assert(left != null); 326Debug.Assert((object?)left.Type != null); 327Debug.Assert(right != null); 328Debug.Assert((object?)right.Type != null);
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (39)
43Debug.Assert(left != null); 44Debug.Assert(right != null); 45Debug.Assert(result.Results.Count == 0); 67Debug.Assert(left != null); 68Debug.Assert(right != null); 69Debug.Assert(result.Results.Count == 0); 131Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 204Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 227Debug.Assert(candidates.Count == 0); 247Debug.Assert(hadUserDefinedCandidateFromInterfaces == candidates.Any(r => r.IsValid)); 299Debug.Assert(hadUserDefinedCandidate == results.Any(r => r.IsValid)); 339Debug.Assert(left != null); 340Debug.Assert(right != null); 479Debug.Assert((object)enumType != null); 488Debug.Assert((object)underlying != null); 489Debug.Assert(underlying.SpecialType != SpecialType.None); 558Debug.Assert((object)pointerType != null); 603Debug.Assert(left != null); 604Debug.Assert(right != null); 692Debug.Assert(left != null); 693Debug.Assert(right != null); 732Debug.Assert(operators.Count == 1); 738Debug.Assert(op.LeftType.IsObjectType()); 739Debug.Assert(op.RightType.IsObjectType()); 744Debug.Assert(convLeft.IsImplicit); 745Debug.Assert(convRight.IsImplicit); 840Debug.Assert(op.Signature.Kind.Operator() == existingSignature.Kind.Operator()); 875Debug.Assert(results.Count == 0); 927Debug.Assert(hadApplicableCandidates == results.Any(r => r.IsValid)); 955Debug.Assert(operators.Count == 0); 1226Debug.Assert(op1.Priority.HasValue == op2.Priority.HasValue); 1426Debug.Assert((kind & ~BinaryOperatorKind.Checked) == kind, "Did not expect operator to be checked. Consider using .Operator() to mask."); 1442Debug.Assert(isChecked || name2Opt is null); 1505Debug.Assert(extensionCandidatesInSingleScope.All(static m => m.ContainingType.ExtensionParameter is not null)); 1557Debug.Assert(lifting is LiftingResult.LiftOperandsAndResult or LiftingResult.LiftOperandsButNotResult); 1588Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 1607Debug.Assert(extensionParameter is not null); 1614Debug.Assert(operand.Type is not null); 1615Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null);
Binder\Semantics\Operators\BinaryOperatorSignature.cs (4)
98Debug.Assert(Method.ParameterCount == 2); 102Debug.Assert(Method.ParameterRefKinds.Length == 2); 120Debug.Assert(Method.ParameterCount == rightIndex + 1); 124Debug.Assert(Method.ParameterRefKinds.Length == rightIndex + 1);
Binder\Semantics\Operators\OperatorKindExtensions.cs (6)
122Debug.Assert(kind == (kind & ~UnaryOperatorKind.TypeMask)); 123Debug.Assert(type == (type & UnaryOperatorKind.TypeMask)); 149Debug.Assert(kind == (kind & ~BinaryOperatorKind.TypeMask)); 167Debug.Assert(kind == (kind & ~UnaryOperatorKind.TypeMask)); 185Debug.Assert(kind == (kind & ~BinaryOperatorKind.TypeMask)); 186Debug.Assert(type == (type & BinaryOperatorKind.TypeMask));
Binder\Semantics\Operators\UnaryOperatorEasyOut.cs (1)
116Debug.Assert(conversion.HasValue && conversion.Value.IsImplicit);
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (16)
33Debug.Assert(operand != null); 34Debug.Assert(result.Results.Count == 0); 82Debug.Assert(isChecked || name2Opt is null); 83Debug.Assert(operand.Type is not null); 146Debug.Assert(extensionCandidatesInSingleScope.All(static m => m.ContainingType.ExtensionParameter is not null)); 220Debug.Assert(operand.Type is not null); 221Debug.Assert(candidate.Method.ContainingType.ExtensionParameter is not null); 225Debug.Assert(operand.Type.IsNullableType()); 250Debug.Assert(x is { }); 251Debug.Assert(y is { }); 260Debug.Assert(xGroupingKey is not null); 292Debug.Assert(groupingKey is not null); 551Debug.Assert(operand != null); 582Debug.Assert(operand != null); 613Debug.Assert(operand != null); 775Debug.Assert(operators.Count == 0);
Binder\Semantics\Operators\UnaryOperatorSignature.cs (2)
52Debug.Assert(Method.ParameterCount == 1); 56Debug.Assert(Method.ParameterRefKinds.Length == 1);
Binder\Semantics\OverloadResolution\ArgumentAnalysisResult.cs (2)
21Debug.Assert(arg >= 0); 26Debug.Assert(arg < ArgsToParamsOpt.Length);
Binder\Semantics\OverloadResolution\CallingConventionInfo.cs (1)
17Debug.Assert(unmanagedCallingConventionTypes.IsEmpty || callKind == Cci.CallingConvention.Unmanaged);
Binder\Semantics\OverloadResolution\MemberAnalysisResult.cs (10)
31Debug.Assert(!_argumentsCoerced); 53Debug.Assert(!_argumentsCoerced); 67Debug.Assert(!_argumentsCoerced); 81Debug.Assert(!_argumentsCoerced); 130Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.HasType); 131Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.HasType); 166Debug.Assert(arg >= 0); 171Debug.Assert(arg < ArgsToParamsOpt.Length); 325Debug.Assert(conversions.Length != 0); 326Debug.Assert(badArguments.TrueBits().Any());
Binder\Semantics\OverloadResolution\MethodGroup.cs (7)
55Debug.Assert(method.IsExtensionMethod || method.IsExtensionBlockMember()); 130Debug.Assert(this.Receiver == null); 131Debug.Assert(this.Methods.Count == 0); 132Debug.Assert(this.TypeArguments.Count == 0); 133Debug.Assert(!this.IsExtensionMethodGroup); 134Debug.Assert(this.Error == null); 135Debug.Assert(this.ResultKind == LookupResultKind.Empty);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (143)
65Debug.Assert(instance.Count == 0); 285Debug.Assert(!methodTypeParameters.IsDefault); 286Debug.Assert(methodTypeParameters.Length > 0); 287Debug.Assert(!formalParameterTypes.IsDefault); 288Debug.Assert(formalParameterRefKinds.IsDefault || formalParameterRefKinds.Length == formalParameterTypes.Length); 289Debug.Assert(!arguments.IsDefault); 345Debug.Assert(ordinals is null || ordinals.Values.Count() == ordinals.Values.Distinct().Count()); 346Debug.Assert(ordinals is null || methodTypeParameters.All(tp => ordinals.ContainsKey(tp))); 354Debug.Assert(_nullableAnnotationLowerBounds.All(annotation => annotation.IsNotAnnotated())); 443Debug.Assert(0 <= index && index < _formalParameterTypes.Length); 498Debug.Assert(ValidIndex(methodTypeParameterIndex)); 504Debug.Assert(type.HasType); 539Debug.Assert(IsUnfixedTypeParameter(methodTypeParameterWithAnnotations)); 554Debug.Assert(ValidIndex(methodTypeParameterIndex)); 562Debug.Assert((object)delegateOrFunctionPointerType != null); 563Debug.Assert(delegateOrFunctionPointerType.IsDelegateType() || delegateOrFunctionPointerType is FunctionPointerTypeSymbol); 603Debug.Assert(!_formalParameterTypes.IsDefault); 604Debug.Assert(!_arguments.IsDefault); 671Debug.Assert(targetType is { }); 705Debug.Assert(target.Type is { }); 744Debug.Assert(sourceArguments.Length == destTypes.Length); 802Debug.Assert(res != InferenceResult.NoProgress); 931Debug.Assert((object)argument.Type == null, "should not need to dig into elements if tuple has natural type"); 941Debug.Assert(sourceArguments.Length == destTypes.Length); 1128Debug.Assert(ValidIndex(iParam)); 1129Debug.Assert(ValidIndex(jParam)); 1141Debug.Assert(IsUnfixed(iParam)); 1142Debug.Assert(IsUnfixed(jParam)); 1194Debug.Assert(_dependencies == null); 1198Debug.Assert(0 == (int)Dependency.Unknown); 1215Debug.Assert(_dependencies != null); 1221Debug.Assert(0 <= iParam && iParam < _methodTypeParameters.Length); 1222Debug.Assert(0 <= jParam && jParam < _methodTypeParameters.Length); 1234Debug.Assert(_dependencies != null); 1235Debug.Assert(ValidIndex(iParam)); 1236Debug.Assert(ValidIndex(jParam)); 1270Debug.Assert(_dependencies != null); 1291Debug.Assert(_dependencies != null); 1306Debug.Assert(_dependencies != null); 1324Debug.Assert(ValidIndex(iParam)); 1339Debug.Assert(ValidIndex(iParam)); 1352Debug.Assert(ValidIndex(iParam)); 1371Debug.Assert(expression != null); 1372Debug.Assert(target.HasType); 1404Debug.Assert(source != null); 1405Debug.Assert(target.HasType); 1418Debug.Assert((object)delegateType.DelegateInvokeMethod != null && !delegateType.DelegateInvokeMethod.HasUseSiteError, 1432Debug.Assert(inferredReturnType.Type is not FunctionTypeSymbol); 1440Debug.Assert(source != null); 1441Debug.Assert((object)target != null); 1472Debug.Assert(method is { HasUseSiteError: false }, 1523Debug.Assert(!resolution.IsNonMethodExtensionMember(out _)); 1549Debug.Assert(source != null); 1550Debug.Assert(target.HasType); 1604Debug.Assert(source != null); 1605Debug.Assert(target.HasType); 1640Debug.Assert(source.HasType); 1641Debug.Assert(target.HasType); 1694Debug.Assert(source.HasType); 1695Debug.Assert(target.HasType); 1709Debug.Assert(source.HasType); 1710Debug.Assert(target.HasType); 1741Debug.Assert(source is not null); 1742Debug.Assert(target is not null); 1768Debug.Assert(type.IsSpan() || type.IsReadOnlySpan()); 1804Debug.Assert(source.HasType); 1805Debug.Assert(target.HasType); 1833Debug.Assert(source.HasType); 1834Debug.Assert(target.HasType); 1860Debug.Assert(source.HasType); 1861Debug.Assert(target.HasType); 1944Debug.Assert((object)source != null); 1945Debug.Assert((object)target != null); 1946Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 1954Debug.Assert(sourceTypeArguments.Count == targetTypeArguments.Count); 1971Debug.Assert(source.HasType); 1972Debug.Assert(target.HasType); 2065Debug.Assert(source.HasType); 2066Debug.Assert(target.HasType); 2080Debug.Assert((object)source != null); 2081Debug.Assert((object)target != null); 2115Debug.Assert((object)source != null); 2116Debug.Assert((object)target != null); 2153Debug.Assert(source is not null); 2154Debug.Assert(target is not null); 2196Debug.Assert((object)source != null); 2197Debug.Assert((object)target != null); 2260Debug.Assert((object)source != null); 2261Debug.Assert((object)target != null); 2305Debug.Assert((object)source != null); 2306Debug.Assert((object)target != null); 2386Debug.Assert((object)source != null); 2387Debug.Assert((object)target != null); 2388Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 2398Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2399Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2480Debug.Assert(source.HasType); 2481Debug.Assert(target.HasType); 2514Debug.Assert(source.Type.IsReferenceType || source.Type.IsFunctionPointer()); 2541Debug.Assert(source.HasType); 2542Debug.Assert(target.HasType); 2555Debug.Assert(source.HasType); 2556Debug.Assert(target.HasType); 2597Debug.Assert(sourceWithAnnotations.HasType); 2598Debug.Assert(targetWithAnnotations.HasType); 2657Debug.Assert((object)source != null); 2658Debug.Assert((object)target != null); 2686Debug.Assert((object)source != null); 2687Debug.Assert((object)target != null); 2736Debug.Assert((object)source != null); 2737Debug.Assert((object)target != null); 2738Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 2748Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 2749Debug.Assert(typeParameters.Count == targetTypeArguments.Count); 2829Debug.Assert(IsUnfixed(iParam)); 2851Debug.Assert(best.Type.Type.Equals(withoutNullability.Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 2883Debug.Assert(!containsFunctionTypes(exact)); 2884Debug.Assert(!containsFunctionTypes(upper)); 2974Debug.Assert(!best.Equals(candidate, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 2994Debug.Assert(compilation is not null); // Tracked by https://github.com/dotnet/roslyn/issues/80658 3062Debug.Assert((object)target != null); 3063Debug.Assert(target.IsDelegateType()); 3064Debug.Assert((object)target.DelegateInvokeMethod != null && !target.DelegateInvokeMethod.HasUseSiteError, 3066Debug.Assert(!target.DelegateInvokeMethod.ReturnsVoid); 3070Debug.Assert(!HasUnfixedParamInInputType(source, target)); 3156Debug.Assert(target.IsInterface); 3194Debug.Assert(extension is not null); 3195Debug.Assert(extension.Arity > 0); 3196Debug.Assert(extension.ExtensionParameter is not null); 3197Debug.Assert(!extension.ExtensionParameter.Type.IsDynamic()); 3198Debug.Assert(extension.IsDefinition); 3199Debug.Assert(receiver is not null); 3263Debug.Assert((object)method != null); 3264Debug.Assert(method.Arity > 0); 3265Debug.Assert(!arguments.IsDefault); 3274Debug.Assert(!method.GetParameterType(0).IsDynamic()); 3301Debug.Assert(!_formalParameterTypes.IsDefault); 3302Debug.Assert(_formalParameterTypes.Length >= 1); 3303Debug.Assert(!_arguments.IsDefault); 3304Debug.Assert(_arguments.Length >= 1); 3323Debug.Assert(IsUnfixed(iParam)); 3393Debug.Assert(conversions.IncludeNullability || 3424Debug.Assert(variance == VarianceKind.In || variance == VarianceKind.Out);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (11)
34Debug.Assert(parameters == null || parameters.Length == length); 47Debug.Assert(0 <= argument && argument < _length); 60Debug.Assert(symbol.IsExtensionBlockMember()); 71Debug.Assert((object)symbol != null); 72Debug.Assert(arguments != null); 286Debug.Assert(expanded); 321Debug.Assert(arguments.Names[argumentPosition].HasValue); 353Debug.Assert(!parameters.IsDefault); 354Debug.Assert(arguments != null); 355Debug.Assert(arguments.Names.Count == 0); 445Debug.Assert(!(expanded && isMethodGroupConversion));
Binder\Semantics\OverloadResolution\OverloadResolution.cs (90)
103Debug.Assert(!dynamicResolution || arguments.HasDynamicArgument); 149Debug.Assert((options & Options.DynamicResolution) == 0 || arguments.HasDynamicArgument); 150Debug.Assert((options & Options.InferWithDynamic) == 0 || (options & Options.DynamicResolution) == 0); 151Debug.Assert((options & Options.IsFunctionPointerResolution) == 0 || (options & Options.DynamicResolution) == 0); 152Debug.Assert((options & Options.IsMethodGroupConversion) == 0 || (options & Options.DynamicResolution) == 0); 153Debug.Assert((options & Options.InferWithDynamic) == 0 || (options & Options.IsMethodGroupConversion) != 0); 173Debug.Assert(!dynamicResolution || arguments.HasDynamicArgument); 515Debug.Assert(hidden == hidden.ConstructedFrom()); 562Debug.Assert(funcPtrBuilder.Count == 1); 563Debug.Assert(funcPtrBuilder[0].Arity == 0); 672Debug.Assert(!expectedConvention.CallKind.HasUnknownCallingConventionAttributeBits()); 673Debug.Assert(expectedConvention.UnmanagedCallingConventionTypes is not null); 674Debug.Assert(expectedConvention.UnmanagedCallingConventionTypes.IsEmpty || expectedConvention.CallKind == Cci.CallingConvention.Unmanaged); 676Debug.Assert(!_binder.IsEarlyAttributeBinder); 694Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyData, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound) 717Debug.Assert(unmanagedCallingConventionTypes.All(u => FunctionPointerTypeSymbol.IsCallingConventionModifier((NamedTypeSymbol)u))); 860Debug.Assert(typeof(TMember) == typeof(MethodSymbol)); 938Debug.Assert(!MemberAnalysisResult.UnsupportedMetadata().HasUseSiteDiagnosticToReportFor(constructor)); 1038Debug.Assert(!constructor.IsVararg); 1054Debug.Assert(!result.IsValid || result.Kind == MemberResolutionKind.ApplicableInExpandedForm); 1071Debug.Assert(checkOverriddenOrHidden || containingTypeMapOpt is null); 1072Debug.Assert((options & Options.IgnoreNormalFormIfHasValidParamsParameter) == 0 || (options & Options.IsMethodGroupConversion) == 0); 1157Debug.Assert(!MemberAnalysisResult.UnsupportedMetadata().HasUseSiteDiagnosticToReportFor(member)); 1173Debug.Assert(typeArguments.Count == 0 || typeArguments.Count == member.GetMemberArityIncludingExtension()); 1239Debug.Assert(!normalResult.IsValid); 1377Debug.Assert(elementType.Type is { }); 1892Debug.Assert(memberWithPriority is not null); 1923Debug.Assert(previousResults.All(r => r.MemberWithPriority.GetOverloadResolutionPriority() == previousPriority)); 2047Debug.Assert(!results[i].IsValid || worse[i] != unknown); 2058Debug.Assert(!results[i].IsValid || worse[i] != unknown); 2067Debug.Assert(worse[i] != notBetterThanEverything || i == notBestIdx); 2071Debug.Assert(worse[notBestIdx] == notBetterThanEverything); 2076Debug.Assert(countOfNotBestCandidates > 1); 2080Debug.Assert(!results[i].IsValid || worse[i] != unknown); 2104Debug.Assert(m1.Result.IsValid); 2105Debug.Assert(m2.Result.IsValid); 2106Debug.Assert(arguments != null); 2144Debug.Assert(m1.Result.IsValid); 2145Debug.Assert(m2.Result.IsValid); 2146Debug.Assert(arguments != null); 2181Debug.Assert(i == arguments.Count - 1); 2182Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2282Debug.Assert(result == r); 2283Debug.Assert(result == BetterResult.Left || result == BetterResult.Right); 2323Debug.Assert(i == arguments.Count - 1); 2324Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2376Debug.Assert(m1.Result.Kind != MemberResolutionKind.ApplicableInExpandedForm); 2483Debug.Assert(i == arguments.Count - 1); 2484Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2588Debug.Assert(paramsElementTypeOpt.HasType); 2589Debug.Assert(paramsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel); 2606Debug.Assert(extensionParameter is not null); 2640Debug.Assert(!isInterpolatedStringHandlerConversion || arguments[i] is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 2702Debug.Assert(m.Result.IsValid); 2754Debug.Assert(t1.Count == t2.Count); 2818Debug.Assert(arr1.HasSameShapeAs(arr2)); 2834Debug.Assert(t1.IsDynamic() && t2.IsDynamic() || 2849Debug.Assert(((object)n1 == null) == ((object)n2 == null)); 2918Debug.Assert(refKind1 == RefKind.None || refKind1 == RefKind.Ref); 2919Debug.Assert(refKind2 == RefKind.None || refKind2 == RefKind.Ref); 3130Debug.Assert(underlyingElementConversions1.Length == underlyingElementConversions2.Length && underlyingElementConversions1.Length == collectionExpressionElements.Length); 3196Debug.Assert(!Conversions.HasIdentityConversion(t1, t2)); 3214Debug.Assert(kind1 is not (CollectionExpressionTypeKind.ReadOnlySpan or CollectionExpressionTypeKind.Span)); 3401Debug.Assert(sourceArguments.Length == destTypes.Length); 3721Debug.Assert((r1.IsVoidType()) == (r2.IsVoidType())); 3725Debug.Assert(!r1.IsVoidType()); 3726Debug.Assert(!r2.IsVoidType()); 3727Debug.Assert(!Conversions.HasIdentityConversion(r1, r2)); 3738Debug.Assert(currentResult == BetterResult.Right); 3743Debug.Assert(currentResult == BetterResult.Left); 3765Debug.Assert( 3883Debug.Assert(firstParamsElementIndex == -1 || (firstParamsElementIndex >= 0 && firstParamsElementIndex < types.Length)); 3900Debug.Assert(argumentRefKinds != null); 3915Debug.Assert(member.ContainingType.ExtensionParameter is not null); 4017Debug.Assert(compilation is not null); 4061Debug.Assert(argumentRefKinds != null); 4084Debug.Assert(paramsIterationType.HasType); 4160Debug.Assert(!hasAnyRefOmittedArgument || (options & Options.AllowRefOmittedArguments) != 0); 4229Debug.Assert(!hasAnyRefOmittedArgument || (options & Options.AllowRefOmittedArguments) != 0); 4246Debug.Assert(!result.Result.IsValid || result.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm); 4268Debug.Assert(GetConstructedFrom(leastOverriddenMember) == (object)leastOverriddenMember); 4405Debug.Assert(isExtensionBlockMember); 4407Debug.Assert(!result.IsDefaultOrEmpty); 4594Debug.Assert(candidate is MethodSymbol { MethodKind: MethodKind.UserDefinedOperator }); 4626Debug.Assert( 4639Debug.Assert(badArguments.IsNull); 4640Debug.Assert(conversions == null); 4683Debug.Assert(paramsElementTypeOpt.HasType); 4738Debug.Assert(argRefKind != RefKind.None); 4751Debug.Assert((!conversion.Exists) || conversion.IsImplicit, "ClassifyImplicitConversion should only return implicit conversions");
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (41)
68Debug.Assert(_bestResultState == ThreeState.True && _bestResult.Result.IsValid); 93Debug.Assert(_bestResultState == ThreeState.True); 133Debug.Assert(HasAnyApplicableMember); 176Debug.Assert(false, "How did we manage to get two methods in the overload resolution results that were both better than every other method?"); 224Debug.Assert(!this.Succeeded, "Don't ask for diagnostic info on a successful overload resolution result."); 227Debug.Assert(arguments.Arguments.All(a => a.Display != null)); 432Debug.Assert(!supportedRequiredParameterMissingConflicts); 495Debug.Assert(arguments.Names[badArg].HasValue); 535Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor }); 544Debug.Assert(firstSupported.Member is MethodSymbol { Name: "Add" }); 606Debug.Assert(diagInfo != null); 607Debug.Assert(diagInfo.Severity == DiagnosticSeverity.Error); 620Debug.Assert(firstSupported.Result.Kind == MemberResolutionKind.WrongCallingConvention); 635Debug.Assert(bad.Member.GetUseSiteInfo().DiagnosticInfo.Severity == DiagnosticSeverity.Error, 792Debug.Assert(arguments.Arguments.Count > 0); 832Debug.Assert(arguments.Names.Count > badArg); 833Debug.Assert(arguments.Names[badArg].HasValue); 835Debug.Assert(badName != null); 852Debug.Assert(arguments.Names.Count > badArg); 853Debug.Assert(arguments.Names[badArg].HasValue); 855Debug.Assert(badName != null); 866Debug.Assert(result.Result.BadArgumentsOpt.TrueBits().Count() == 1); 867Debug.Assert(arguments.Names[result.Result.FirstBadArgument].HasValue); 869Debug.Assert(name != null); 892Debug.Assert(arguments.Names.Count > badArg); 893Debug.Assert(arguments.Names[badArg].HasValue); 895Debug.Assert(badName != null); 938Debug.Assert(badMember.Kind == SymbolKind.Method); 939Debug.Assert(((MethodSymbol)(object)badMember).IsVararg); 1235Debug.Assert(refArg == RefKind.None); 1340Debug.Assert(argument.Kind != BoundKind.OutDeconstructVarPendingInference); 1341Debug.Assert(argument.Kind != BoundKind.OutVariablePendingInference); 1342Debug.Assert(argument.Kind != BoundKind.DiscardExpression || argument.HasExpressionType()); 1343Debug.Assert(argument.Display != null); 1347Debug.Assert((arg == 0) && (parm == arg)); 1348Debug.Assert(!badArg.Result.ConversionForArg(parm).IsImplicit); 1359Debug.Assert((object)parameter == unwrapIfParamsCollection(badArg, parameter, isLastParameter), "If they ever differ, just call the method when constructing the diagnostic."); 1423Debug.Assert(badArg.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel); 1442Debug.Assert(nWorse == 0, "How is it that there is exactly one applicable but worse method, and exactly zero applicable best methods? What was better than this thing?"); 1503Debug.Assert(nValid == 0, "Why are we doing error reporting on an overload resolution problem that had one valid result?"); 1507Debug.Assert(false, "Add tests if this is triggered. https://github.com/dotnet/roslyn/issues/80507");
Binder\SingleLookupResult.cs (1)
31Debug.Assert(symbol is not null || kind == LookupResultKind.Empty);
Binder\SwitchBinder_Patterns.cs (3)
31Debug.Assert(SwitchSyntax.Equals(node)); 153Debug.Assert(this.SwitchSyntax == node.Parent.Parent); 199Debug.Assert(sectionBinder != null);
Binder\SwitchBinder.cs (18)
46Debug.Assert(_switchGoverningExpression != null); 98Debug.Assert(labels.Length > 0); 211Debug.Assert(caseLabel.Value != null); 287Debug.Assert((object)constantValue != null); 294Debug.Assert(constantValue.Value is int); 298Debug.Assert(constantValue.Value is uint); 335Debug.Assert(key != null); 343Debug.Assert((object)label != null); 397Debug.Assert(ScopeDesignator == SwitchSyntax); 400Debug.Assert(binder != null); 440Debug.Assert(conversion.Kind == ConversionKind.ImplicitUserDefined); 441Debug.Assert(conversion.Method.IsUserDefinedConversion()); 442Debug.Assert(conversion.UserDefinedToConversion.IsIdentity); 443Debug.Assert(resultantGoverningType.IsValidV6SwitchGoverningType(isTargetTypeOfUserDefinedOp: true)); 465Debug.Assert((object)switchGoverningExpression.Type == null || switchGoverningExpression.Type.IsVoidType()); 497Debug.Assert(node.Kind() == SyntaxKind.GotoCaseStatement || node.Kind() == SyntaxKind.GotoDefaultStatement); 517Debug.Assert(node.Kind() == SyntaxKind.GotoCaseStatement); 542Debug.Assert(node.Kind() == SyntaxKind.GotoDefaultStatement);
Binder\SwitchExpressionArmBinder.cs (2)
31Debug.Assert(node == _arm); 38Debug.Assert(node == _arm);
Binder\SwitchExpressionBinder.cs (4)
28Debug.Assert(node == SwitchExpressionSyntax); 100Debug.Assert(wasAcyclic); 193Debug.Assert(inputExpression.Type is not null); 204Debug.Assert(inputExpression.Type is not null);
Binder\UnionMatchingRewriter.cs (17)
44Debug.Assert(result != pattern); 62Debug.Assert(unionMatchingInputType.IsSubjectForUnionMatching); 63Debug.Assert(exclusiveValuePattern.InputType.IsObjectType()); 84Debug.Assert(node.InputType.IsSubjectForUnionMatching); 85Debug.Assert((node.UnionMatchingMode & UnionMatchingMode.UnionValue) != 0); 89Debug.Assert(Binder.IsClassOrNullableValueTypeUnionNullPatternMatching((NamedTypeSymbol)node.InputType, node.ConstantValue)); 90Debug.Assert(node.NarrowedType.Equals(node.InputType, TypeCompareKind.AllIgnoreOptions)); 145Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.None); 171Debug.Assert((node.UnionMatchingMode & UnionMatchingMode.UnionValue) != 0); 188Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.UnionValue); 199Debug.Assert(node.UnionMatchingMode == UnionMatchingMode.None); 240Debug.Assert(binaryPatternStack.Count > 0); 300Debug.Assert(node.NarrowedType.Equals(leastSpecific ?? node.InputType, TypeCompareKind.ConsiderEverything)); 352Debug.Assert(rightUnionPattern.LeftOfPendingConjunction is not BoundPatternWithUnionMatching); 424Debug.Assert(right is not null); 430Debug.Assert(left is not null); 530Debug.Assert(result.InputType.Equals(pattern.InputType, TypeCompareKind.AllIgnoreOptions));
Binder\UsingStatementBinder.cs (12)
32Debug.Assert((expressionSyntax == null) ^ (declarationSyntax == null)); // Can't have both or neither. 82Debug.Assert((expressionSyntax == null) ^ (declarationSyntax == null)); // Can't have both or neither. 85Debug.Assert(boundUsingStatement is BoundUsingStatement); 105Debug.Assert(isUsingDeclaration || usingBinderOpt != null); 119Debug.Assert(expressionOpt is not null); 130Debug.Assert(!declarationsOpt.IsEmpty && declarationsOpt[0].DeclaredTypeOpt != null); 188Debug.Assert(!fromExpression || expressionOpt != null); 203Debug.Assert(!disposeMethod.IsExtensionMethod && !disposeMethod.IsExtensionBlockMember(), 228Debug.Assert(argsToParams.IsDefault); 243Debug.Assert((object)disposableInterface != null); 290Debug.Assert(expressionOpt is { }); 295Debug.Assert(declarationTypeOpt is { });
Binder\WhileBinder.cs (3)
24Debug.Assert(syntax != null && (syntax.IsKind(SyntaxKind.WhileStatement) || syntax.IsKind(SyntaxKind.DoStatement))); 34Debug.Assert(this.Locals == this.GetDeclaredLocalsForScope(node)); 44Debug.Assert(this.Locals == this.GetDeclaredLocalsForScope(node));
Binder\WithClassTypeParametersBinder.cs (1)
26Debug.Assert((object)container != null);
Binder\WithCrefTypeParametersBinder.cs (2)
136Debug.Assert(typeParameterSyntax != null, "Syntactic requirement of crefs"); 157Debug.Assert(!result.CanBeAdded(typeParameter.Name) || originalBinder.CanAddLookupSymbolInfo(typeParameter, options, result, null));
Binder\WithExtensionParameterBinder.cs (1)
39Debug.Assert(result.IsClear);
Binder\WithExternAliasesBinder.cs (3)
35Debug.Assert(result.IsClear); 91Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 117Debug.Assert(!externAliases.IsDefault);
Binder\WithExternAndUsingAliasesBinder.cs (6)
28Debug.Assert(!next.WithImportChainEntry); 39Debug.Assert(result.IsClear); 72Debug.Assert(this.Next is WithUsingNamespacesAndTypesBinder); 76Debug.Assert(_lazyImportChain != null); 120Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 234Debug.Assert(!externAliases.IsDefault);
Binder\WithLambdaParametersBinder.cs (2)
89Debug.Assert(result.IsClear); 153Debug.Assert(false, "what else could be defined in a lambda?");
Binder\WithNullableContextBinder.cs (2)
19Debug.Assert(syntaxTree != null); 20Debug.Assert(position >= 0);
Binder\WithParametersBinder.cs (2)
27Debug.Assert(!parameters.IsDefaultOrEmpty); 53Debug.Assert(result.IsClear);
Binder\WithPrimaryConstructorParametersBinder.cs (1)
66Debug.Assert(result.IsClear);
Binder\WithTypeParametersBinder.cs (1)
40Debug.Assert(result.IsClear);
Binder\WithUsingNamespacesAndTypesBinder.cs (7)
76Debug.Assert(members.Count == 0); 120Debug.Assert(result.IsClear); 150Debug.Assert(!symbol.IsExtensionBlockMember()); 232Debug.Assert(_lazyImportChain != null || !_withImportChainEntry); 264Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 294Debug.Assert(declarationSyntax.IsKind(SyntaxKind.CompilationUnit) || declarationSyntax.IsKind(SyntaxKind.NamespaceDeclaration)); 329Debug.Assert(!namespacesOrTypes.IsDefault);
BoundTree\BoundAwaitableInfo.cs (10)
15Debug.Assert(RuntimeAsyncAwaitCall.Method.ContainingType.ExtendedSpecialType == InternalSpecialType.System_Runtime_CompilerServices_AsyncHelpers); 16Debug.Assert(RuntimeAsyncAwaitCallPlaceholder is not null); 21Debug.Assert(GetAwaiter is null); 22Debug.Assert(IsCompleted is null); 23Debug.Assert(GetResult is null); 28Debug.Assert(GetAwaiter is not null); 29Debug.Assert(IsCompleted is not null); 30Debug.Assert(GetResult is not null); 34Debug.Fail($"Unexpected RuntimeAsyncAwaitCall: {RuntimeAsyncAwaitCall.Method.Name}"); 39Debug.Assert(GetAwaiter is not null || RuntimeAsyncAwaitCall is not null || IsDynamic || HasErrors);
BoundTree\BoundBadExpression.cs (1)
14Debug.Assert(!this.ChildBoundNodes.Any(c => Binder.IsTypeOrValueExpression(c) || Binder.IsMethodGroupWithTypeOrValueReceiver(c)));
BoundTree\BoundBinaryOperator.UncommonData.cs (6)
19Debug.Assert(OperatorKind.IsLogical()); 20Debug.Assert(method.Name is WellKnownMemberNames.TrueOperatorName or WellKnownMemberNames.FalseOperatorName); 21Debug.Assert(method.ParameterCount == 1); 25Debug.Assert(method is ErrorMethodSymbol or { ParameterCount: 2 }); 73Debug.Assert(interpolatedStringHandlerData is null || !isUnconvertedInterpolatedStringAddition); 74Debug.Assert(method is null or ErrorMethodSymbol { ParameterCount: 0 } or { MethodKind: MethodKind.UserDefinedOperator } or { ParameterCount: 2 });
BoundTree\BoundBinaryPattern.cs (6)
13Debug.Assert(Left.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 14Debug.Assert(Left is not BoundPatternWithUnionMatching); 15Debug.Assert(Right is not BoundPatternWithUnionMatching); 19Debug.Assert(Right.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 25Debug.Assert(Right.InputType.Equals(Left.NarrowedType, TypeCompareKind.AllIgnoreOptions)); 26Debug.Assert(NarrowedType.Equals(Right.NarrowedType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundCall.cs (3)
15Debug.Assert(ResultKind is not LookupResultKind.MemberGroup); 16Debug.Assert(ResultKind is not LookupResultKind.StaticInstanceMismatch); 17Debug.Assert(ResultKind is LookupResultKind.Viable || HasErrors);
BoundTree\BoundCollectionExpression.cs (12)
19Debug.Assert(this.CollectionTypeKind == CollectionExpressionTypeKind.CollectionBuilder); 20Debug.Assert(this.CollectionCreation is not null); 21Debug.Assert(this.CollectionBuilderMethod is not null); 22Debug.Assert(collectionBuilderElementsPlaceholder is not null); 23Debug.Assert(collectionBuilderElementsPlaceholder.Type is not null); 25Debug.Assert(boundCall.Arguments is [.., BoundCollectionBuilderElementsPlaceholder placeholder] && 27Debug.Assert(collectionBuilderElementsPlaceholder.Type.IsReadOnlySpan()); 31Debug.Assert(this.CollectionTypeKind != CollectionExpressionTypeKind.CollectionBuilder); 32Debug.Assert(this.CollectionBuilderMethod is null); 33Debug.Assert(collectionBuilderElementsPlaceholder is null); 55Debug.Assert(collectionCreation 71Debug.Assert(element is not BoundUnconvertedWithElement);
BoundTree\BoundConstantPattern.cs (2)
16Debug.Assert(NarrowedType.IsObjectType() || 22Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
BoundTree\BoundConversion.cs (59)
13Debug.Assert(!Binder.IsTypeOrValueExpression(Operand)); 14Debug.Assert(!Binder.IsMethodGroupWithTypeOrValueReceiver(Operand)); 19Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.TupleLiteral) != 0); 24Debug.Assert(Conversion.IsTupleLiteralConversion || 26Debug.Assert(Operand is BoundConvertedTupleLiteral); 31Debug.Assert(Conversion.IsIdentity); 32Debug.Assert(Operand is BoundConvertedTupleLiteral || 43Debug.Assert(ConversionGroupOpt is null); 47Debug.Assert(ConversionGroupOpt?.Conversion.IsUserDefined == true); 55Debug.Assert(Conversion == ConversionGroupOpt.Conversion); 59Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UserDefinedErroneous); 60Debug.Assert(Operand is not BoundConversion operandAsConversion || operandAsConversion.ConversionGroupOpt != ConversionGroupOpt); 64Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UserDefinedOperator); 68Debug.Assert((operandAsConversion.InConversionGroupFlags & (InConversionGroupFlags.UserDefinedFromConversion | InConversionGroupFlags.UserDefinedFromConversionAdjustment)) != 0); 72Debug.Assert(Conversion.UserDefinedFromConversion.IsIdentity || 80Debug.Assert(!ExplicitCastInCode); 81Debug.Assert(ConversionGroupOpt.Conversion.IsValid); 85Debug.Assert(ConversionsBase.IsEncompassingImplicitConversionKind(Conversion.Kind) || 92Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.UserDefinedAllFlags) == InConversionGroupFlags.UserDefinedFromConversion); 93Debug.Assert(Operand is not BoundConversion operandAsConversion || 95Debug.Assert(Conversion == ConversionGroupOpt.Conversion.UserDefinedFromConversion); 99Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.UserDefinedAllFlags) == InConversionGroupFlags.UserDefinedFromConversionAdjustment); 100Debug.Assert(Conversion.IsNullable); 101Debug.Assert(Conversion.IsExplicit); 102Debug.Assert(Conversion.UnderlyingConversions[0].IsIdentity); 106Debug.Assert((operandAsConversion.InConversionGroupFlags & InConversionGroupFlags.UserDefinedFromConversion) != 0); 110Debug.Assert(ConversionGroupOpt.Conversion.UserDefinedFromConversion.IsIdentity || 117Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.UserDefinedAllFlags) == InConversionGroupFlags.UserDefinedReturnTypeAdjustment); 118Debug.Assert(Conversion.IsNullable); 119Debug.Assert(Conversion.IsImplicit); 120Debug.Assert(!Conversion.UnderlyingConversions[0].IsIdentity); 121Debug.Assert(Operand is BoundConversion operandAsConversion && 127Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UserDefinedFinal); 129Debug.Assert(Operand is BoundConversion operandAsConversion && 143Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.UserDefinedAllFlags) == 0 || (InConversionGroupFlags & InConversionGroupFlags.UnionAllFlags) == 0); 149Debug.Assert(ConversionGroupOpt is null); 153Debug.Assert(ConversionGroupOpt?.Conversion.IsUnion == true); 161Debug.Assert(Conversion == ConversionGroupOpt.Conversion); 165Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UnionErroneous); 166Debug.Assert(Operand is not BoundConversion operandAsConversion || operandAsConversion.ConversionGroupOpt != ConversionGroupOpt); 170Debug.Assert(ConversionGroupOpt.Conversion.BestUnionConversionAnalysis is { }); 171Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UnionConstructor); 175Debug.Assert((operandAsConversion.InConversionGroupFlags & InConversionGroupFlags.UnionSourceConversion) != 0); 180Debug.Assert(sourceConversion.IsIdentity || 188Debug.Assert(ConversionGroupOpt.Conversion.IsValid); 189Debug.Assert(ConversionGroupOpt.Conversion.BestUnionConversionAnalysis is { }); 190Debug.Assert(!ExplicitCastInCode); 191Debug.Assert(ConversionsBase.IsEncompassingImplicitConversionKind(Conversion.Kind)); 195Debug.Assert((InConversionGroupFlags & InConversionGroupFlags.UnionAllFlags) == InConversionGroupFlags.UnionSourceConversion); 196Debug.Assert(Operand is not BoundConversion operandAsConversion || 198Debug.Assert(Conversion == ConversionGroupOpt.Conversion.BestUnionConversionAnalysis.SourceConversion); 202Debug.Assert(InConversionGroupFlags == InConversionGroupFlags.UnionFinal); 203Debug.Assert(Conversion.IsNullable); 204Debug.Assert(Conversion.IsImplicit); 205Debug.Assert(Conversion.UnderlyingConversions[0].IsIdentity); 206Debug.Assert(Operand is BoundConversion operandAsConversion && 209Debug.Assert(Conversion == ConversionGroupOpt.Conversion.BestUnionConversionAnalysis.TargetConversion); 221Debug.Assert(ConversionGroupOpt?.Conversion.IsUnion == true); 241Debug.Assert(current.InConversionGroupFlags == InConversionGroupFlags.UnionConstructor);
BoundTree\BoundDagEvaluation.cs (11)
21Debug.Assert(other.GetHashCode() == this.GetHashCode()); 22Debug.Assert(DecisionDagBuilder.IsEqualEvaluation(other, this)); 23Debug.Assert(other is BoundDagIndexerEvaluation or BoundDagTypeEvaluation or BoundDagPassThroughEvaluation || 64Debug.Assert(result is not null || this is BoundDagAssignmentEvaluation or BoundDagPassThroughEvaluation); 198Debug.Assert(Property.Type.IsObjectType()); 225Debug.Assert(IndexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess); 262Debug.Assert(IndexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess); 327Debug.Assert(parameter.RefKind == RefKind.Out); 339Debug.Assert(parameter.RefKind == RefKind.Out); 345Debug.Assert(!DeconstructMethod.ReturnsVoid); 382Debug.Assert(Input.Source is BoundDagTypeEvaluation);
BoundTree\BoundDagTemp.cs (1)
30Debug.Assert(other.GetHashCode() == this.GetHashCode());
BoundTree\BoundDecisionDag.cs (2)
81Debug.Assert(wasAcyclic); 108Debug.Assert(!replacement.ContainsKey(node));
BoundTree\BoundDecisionDagNode.cs (2)
66Debug.Assert(value >= 0, "Id must be non-negative but was set to " + value); 67Debug.Assert(_id == -1, $"Id was set to {_id} and set again to {value}");
BoundTree\BoundDeclarationPattern.cs (2)
13Debug.Assert(DeclaredType is not null); 14Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundDiscardExpression.cs (3)
14Debug.Assert(Type is null && type.HasType); 15Debug.Assert(this.IsInferred); 32Debug.Assert(this.Type is { });
BoundTree\BoundDiscardPattern.cs (1)
13Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundExpression.cs (8)
22Debug.Assert(this.WasCompilerGenerated || 47Debug.Assert(suppress || !this.IsSuppressed); 236Debug.Fail("Getting here is unexpected."); 253Debug.Assert(Expression.ConstantValueOpt == null); 434Debug.Assert(LogicalOperator.ParameterCount == 2); 435Debug.Assert(TrueOperator.ParameterCount == 1); 436Debug.Assert(FalseOperator.ParameterCount == 1); 707Debug.Fail("Getting here is unexpected.");
BoundTree\BoundExpressionExtensions.cs (1)
137Debug.Assert(expr.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda);
BoundTree\BoundFunctionPointerInvocation.cs (1)
16Debug.Assert(InvokedExpression.Type is FunctionPointerTypeSymbol);
BoundTree\BoundImplicitIndexerAccess.cs (2)
20Debug.Assert(LengthOrCountAccess is BoundPropertyAccess or BoundArrayLength or BoundLocal or BoundBadExpression); 21Debug.Assert(IndexerOrSliceAccess is BoundIndexerAccess or BoundCall or BoundArrayAccess);
BoundTree\BoundInlineArrayAccess.cs (9)
16Debug.Assert(!IsValue || GetItemOrSliceHelper == WellKnownMember.System_ReadOnlySpan_T__get_Item); 18Debug.Assert(Argument.Type is 35Debug.Assert(GetItemOrSliceHelper is 41Debug.Assert(Type.Name == "ReadOnlySpan"); 45Debug.Assert(Type.Name == "Span"); 49Debug.Assert(Type is 62Debug.Assert(((NamedTypeSymbol)Type).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].Equals(Expression.Type?.TryGetInlineArrayElementField()?.TypeWithAnnotations ?? default, TypeCompareKind.ConsiderEverything)); 66Debug.Assert(GetItemOrSliceHelper is 70Debug.Assert(Type.Equals(Expression.Type?.TryGetInlineArrayElementField()?.Type, TypeCompareKind.ConsiderEverything));
BoundTree\BoundIsPatternExpression.cs (2)
17Debug.Assert(negated == this.IsNegated); 28Debug.Assert(decisionDag.SuitableForLowering);
BoundTree\BoundITuplePattern.cs (2)
14Debug.Assert(UnionMatchingMode == UnionMatchingMode.None); 15Debug.Assert(NarrowedType.IsCompilerServicesTopLevelType() && NarrowedType.Name == "ITuple");
BoundTree\BoundListPattern.cs (6)
21Debug.Assert(!Subpatterns.Any(p => p is BoundPatternWithUnionMatching)); 22Debug.Assert(LengthAccess is null or BoundPropertyAccess or BoundBadExpression); 23Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess or BoundPointerElementAccess); 24Debug.Assert(Binder.GetIndexerOrImplicitIndexerSymbol(IndexerAccess) is var _); 25Debug.Assert(UnionMatchingMode == UnionMatchingMode.None); 26Debug.Assert(NarrowedType.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundMethodDefIndex.cs (1)
13Debug.Assert(Method.IsDefinition);
BoundTree\BoundNameOfOperator.cs (2)
13Debug.Assert(!Binder.IsTypeOrValueExpression(Argument)); 14Debug.Assert(!Binder.IsMethodGroupWithTypeOrValueReceiver(Argument));
BoundTree\BoundNegatedPattern.cs (4)
14Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 15Debug.Assert(Negated.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 16Debug.Assert(Negated is not BoundPatternWithUnionMatching); 17Debug.Assert(UnionMatchingMode == UnionMatchingMode.None);
BoundTree\BoundNode.cs (21)
75Debug.Assert( 139Debug.Assert((_attributes & BoundNodeAttributes.HasErrors) == 0, 157Debug.Assert(original is BoundExpression || !original.IsSuppressed); 185Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0, 195Debug.Assert((_attributes & BoundNodeAttributes.CompilerGenerated) == 0, 207Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0, 240Debug.Assert((_attributes & BoundNodeAttributes.WasTopLevelNullabilityChecked) == 0, 304Debug.Assert((_attributes & BoundNodeAttributes.IsSuppressed) == 0, "flag should not be set twice or reset"); 326Debug.Assert((_attributes & BoundNodeAttributes.WasConverted) == 0, "WasConverted flag should not be set twice or reset"); 342Debug.Assert((_attributes & BoundNodeAttributes.WasPropertyBackingFieldAccessChecked) == 0, "should not be set twice or reset"); 360Debug.Assert(value || !IsParamsArrayOrCollection); 361Debug.Assert(!value || 366Debug.Assert(!value || 468Debug.Assert(possiblyUserDefined.Conversion.IsUserDefined); 495Debug.Assert(possiblyUnion.Conversion.IsUnion); 519Debug.Assert((boundConversion.InConversionGroupFlags & InConversionGroupFlags.LoweredFormOfUserDefinedConversionForExpressionTree) != 0); 562Debug.Assert(false, "duplicate local " + local.GetDebuggerDisplay()); 573Debug.Assert(false, "missing local " + local.GetDebuggerDisplay()); 582Debug.Assert(false, "undeclared local " + local.GetDebuggerDisplay()); 618Debug.Assert(added); 635Debug.Assert(removed);
BoundTree\BoundNodeExtensions.cs (7)
41Debug.Assert(statement != null); 59Debug.Assert(call != null); 152Debug.Assert(stack.Count == 0); 158Debug.Assert(typeof(TInterpolatedStringType) == typeof(BoundInterpolatedString) || binary.IsUnconvertedInterpolatedStringAddition); 211Debug.Assert(currentBinary.Left is TInterpolatedStringType || result != null); 233Debug.Assert(result != null); 244Debug.Assert(typeof(TInterpolatedStringType) == typeof(BoundInterpolatedString) || binary.IsUnconvertedInterpolatedStringAddition);
BoundTree\BoundPattern.cs (3)
24Debug.Assert(negatedPattern.UnionMatchingMode == UnionMatchingMode.None); 35Debug.Assert(UnionMatchingMode != UnionMatchingMode.UnionInstance); 36Debug.Assert(UnionMatchingMode == UnionMatchingMode.None || InputType is { IsSubjectForUnionMatching: true });
BoundTree\BoundPatternWithUnionMatching.cs (11)
14Debug.Assert(UnionMatchingInputType.IsSubjectForUnionMatching); 15Debug.Assert(InputType.Equals(LeftOfPendingConjunction?.InputType ?? UnionMatchingInputType, TypeCompareKind.AllIgnoreOptions)); 16Debug.Assert(UnionMatchingInputType == (object)(LeftOfPendingConjunction?.NarrowedType ?? InputType)); 17Debug.Assert(NarrowedType == (object)(SharedRightOfPendingConjunction ?? ExclusiveValuePattern).NarrowedType); 18Debug.Assert(ExclusiveValuePattern is not BoundPatternWithUnionMatching); 19Debug.Assert(SharedRightOfPendingConjunction is not BoundPatternWithUnionMatching); 26Debug.Assert(p1.DeclaredType == (object)((BoundTypePattern)ExclusiveValuePattern).DeclaredType); 29Debug.Assert(p1.DeclaredType == (object)((BoundDeclarationPattern)ExclusiveValuePattern).DeclaredType); 32Debug.Assert(p1.DeclaredType == (object?)((BoundRecursivePattern)ExclusiveValuePattern).DeclaredType); 38Debug.Assert(SharedRightOfPendingConjunction is not null || NarrowedType.Equals(ExclusiveInstancePattern.NarrowedType, TypeCompareKind.ConsiderEverything)); 39Debug.Assert(ExclusiveInstancePattern.InputType == (object)UnionMatchingInputType);
BoundTree\BoundRecursivePattern.cs (3)
17Debug.Assert(UnionMatchingMode == UnionMatchingMode.None); 18Debug.Assert(NarrowedType.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions)); 22Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundRelationalPattern.cs (3)
16Debug.Assert((UnionMatchingMode & UnionMatchingMode.UnionInstance) == 0); 17Debug.Assert(NarrowedType.IsObjectType() || 22Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
BoundTree\BoundReturnStatement.cs (1)
13Debug.Assert(RefKind is RefKind.None or RefKind.Ref); // We assume that 'ref readonly' cannot be result of a return inference for a lambda.
BoundTree\BoundSlicePattern.cs (4)
18Debug.Assert(Pattern is not BoundPatternWithUnionMatching); 19Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 20Debug.Assert(Binder.GetIndexerOrImplicitIndexerSymbol(IndexerAccess) is var _); 21Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundStatementExtensions.cs (3)
30Debug.Assert(node != null); 35Debug.Assert(((BoundLabelStatement)node).Label == label); 39Debug.Assert(((BoundLabeledStatement)node).Label == label);
BoundTree\BoundSubpattern.cs (1)
13Debug.Assert(Pattern is not BoundPatternWithUnionMatching);
BoundTree\BoundSwitchExpression.cs (1)
29Debug.Assert(decisionDag.SuitableForLowering);
BoundTree\BoundSwitchStatement.cs (1)
25Debug.Assert(decisionDag.SuitableForLowering);
BoundTree\BoundTreeRewriter.cs (14)
38System.Diagnostics.Debug.Assert(item != null); 69Debug.Assert(symbol is not null); 75Debug.Assert(symbol is not null); 84Debug.Assert(symbol is not null); 90Debug.Assert(symbol is not null); 102Debug.Assert(symbol is not null); 177Debug.Assert(newSymbol is not null); 274Debug.Assert(left is { }); 280Debug.Assert(right is { }); 286Debug.Assert((object)binary == node); 334Debug.Assert((object)ifStatement == node); 368Debug.Assert(left is { }); 374Debug.Assert(right is { }); 379Debug.Assert((object)binary == node);
BoundTree\BoundTreeVisitors.cs (2)
202Debug.Assert(node is BoundExpression or BoundPattern); 221Debug.Assert(saveRecursionDepth == recursionDepth);
BoundTree\BoundTreeWalker.cs (1)
88Debug.Assert(node is BoundExpression or BoundPattern);
BoundTree\BoundTypeOrValueExpression.cs (2)
14Debug.Assert(Syntax is IdentifierNameSyntax); 15Debug.Assert(!HasErrors);
BoundTree\BoundTypePattern.cs (1)
13Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\Constructors.cs (7)
140Debug.Assert(method.OriginalDefinition is ErrorMethodSymbol); 143Debug.Assert(resultKind is not LookupResultKind.Viable); 144Debug.Assert(arguments.IsDefaultOrEmpty || (object)receiverOpt != (object)arguments[0]); 201Debug.Assert(argumentRefKind is RefKind.None or RefKind.Ref or RefKind.In or RefKind.Out or RefKindExtensions.StrictIn && 213Debug.Assert(method is ErrorMethodSymbol || arguments[i].Kind == BoundKind.ArgListOperator); 487Debug.Assert((object)typeWithAnnotations.Type != null, "Field 'type' cannot be null"); 543Debug.Assert((object)type != null);
BoundTree\InterpolatedStringHandlerData.cs (4)
37Debug.Assert(construction is BoundObjectCreationExpression or BoundDynamicObjectCreationExpression or BoundBadExpression); 38Debug.Assert(!placeholders.IsDefault); 40Debug.Assert(placeholders.IsEmpty || placeholders.AsSpan()[..^1].All(item => item.ArgumentIndex != BoundInterpolatedStringArgumentPlaceholder.TrailingConstructorValidityParameter)); 41Debug.Assert(!positionInfo.IsDefault);
BoundTree\LengthBasedStringSwitchData.cs (12)
92Debug.Assert(lengthCaseLabels.Length > 0); 107Debug.Assert(charCaseLabels.Length > 0); 122Debug.Assert(stringCaseLabels.Length > 0); 139Debug.Assert(inputCases.All(c => c.value.IsString && c.label is not null)); 146Debug.Assert(nullCaseLabel is null, "At most one null case per string dispatch"); 168Debug.Assert(stringLength >= 0); 169Debug.Assert(casesWithGivenLength.All(c => c.value.Length == stringLength)); 170Debug.Assert(casesWithGivenLength.Length > 0); 206Debug.Assert(stringLength > 0); 207Debug.Assert(caseLabels.Length > 0); 234Debug.Assert(caseLabel.value is not null); 255Debug.Assert(cases.Length > 0 && cases.All(c => c.value is not null));
BoundTree\NullabilityRewriter.cs (8)
39Debug.Assert(rewrittenConsequence is { }); 87Debug.Assert(stack.Count > 0); 134Debug.Assert(currentBinary != null); 152Debug.Assert(stack.Count > 0); 245Debug.Assert(updatedContaining is object); 250Debug.Assert(updatedDelegateType is object); 256Debug.Assert(lambda.ParameterCount == updatedLambda.ParameterCount); 322Debug.Assert(updatedSymbol is object);
BoundTree\OutDeconstructVarPendingInference.cs (1)
16Debug.Assert(Placeholder is null);
BoundTree\TupleBinaryOperatorInfo.cs (5)
73Debug.Assert(Kind.IsUserDefined() == (MethodSymbolOpt is { })); 111Debug.Assert(leftConvertedTypeOpt is null || leftConvertedTypeOpt.StrippedType().IsTupleType); 112Debug.Assert(rightConvertedTypeOpt is null || rightConvertedTypeOpt.StrippedType().IsTupleType); 113Debug.Assert(!operators.IsDefault); 114Debug.Assert(operators.IsEmpty || operators.Length > 1); // an empty array is used for error cases, otherwise tuples must have cardinality > 1
BoundTree\UnboundLambda.cs (34)
90Debug.Assert( 126Debug.Assert(getterNullResilienceData is null || nullableState is not null); 146Debug.Assert(!UnboundLambda.HasExplicitReturnType(out _, out _, out _)); 147Debug.Assert(conversions != null); 200Debug.Assert(!node.UnboundLambda.HasExplicitReturnType(out _, out _, out _)); 207Debug.Assert(!node.HasExplicitReturnType(out _, out _, out _)); 240Debug.Assert(bestType.Type is not FunctionTypeSymbol); 244Debug.Assert(refKind != RefKind.RefReadOnly); 424Debug.Assert(binder != null); 425Debug.Assert(syntax.IsAnonymousFunction()); 555Debug.Assert(binder != null); 556Debug.Assert(binder.ContainingMemberOrLambda != null); 569Debug.Assert(unbound != null); 570Debug.Assert(_unboundLambda == null || (object)_unboundLambda == unbound); 584Debug.Assert((state._bindingCache == null) != includeCache); 740Debug.Assert(Binder.ContainingMemberOrLambda is { }); 792Debug.Assert(getEffectiveScopeFromSymbol); 797Debug.Assert(lambdaSymbol.Parameters[i].EffectiveScope == parameterScopesBuilder[i]); 820Debug.Assert(Binder.ContainingMemberOrLambda is { }); 1016Debug.Assert(refKind != CodeAnalysis.RefKind.RefReadOnly); 1017Debug.Assert(refCustomModifiers.IsEmpty); 1042Debug.Assert(refKind != CodeAnalysis.RefKind.RefReadOnly); 1043Debug.Assert(refCustomModifiers.IsEmpty); 1098Debug.Assert(parameterTypes.Length == parameterRefKinds.Length); 1099Debug.Assert(taskLikeReturnTypeOpt is null || ((object)taskLikeReturnTypeOpt == taskLikeReturnTypeOpt.ConstructedFrom && taskLikeReturnTypeOpt.IsCustomTaskType(out var builderArgument))); 1273Debug.Assert(!inferredReturnType.IsExplicitType); 1573Debug.Assert(HasSignature && 0 <= index && index < ParameterCount); 1596Debug.Assert(!_parameterNames.IsDefault && 0 <= index && index < _parameterNames.Length); 1602Debug.Assert(0 <= index && index < this.ParameterCount); 1608Debug.Assert(0 <= index && index < this.ParameterCount); 1614Debug.Assert(0 <= index && index < this.ParameterCount); 1620Debug.Assert(0 <= index && index < this.ParameterCount); 1626Debug.Assert(this.HasExplicitlyTypedParameterList); 1627Debug.Assert(0 <= index && index < _parameterTypesWithAnnotations.Length);
BoundTree\VariablePendingInference.cs (5)
29Debug.Assert(type.HasType); 36Debug.Assert(binderOpt != null || type.HasType); 37Debug.Assert(this.Syntax.Kind() == SyntaxKind.SingleVariableDesignation || 95Debug.Assert(inferenceDiagnostics.DependenciesBag is object); 96Debug.Assert(inferenceDiagnostics.DependenciesBag.Count == 0);
CodeGen\CodeGenerator_HasHome.cs (7)
49Debug.Assert(containingSymbol is object); 71Debug.Assert(IsAnyReadOnly(addressKind), "`this` is readonly in classes"); 129Debug.Assert(HasHome( 135Debug.Assert(HasHome( 182Debug.Assert(containingSymbol is object); 220Debug.Assert(field.RefKind == RefKind.None); 230Debug.Assert(!IsAnyReadOnly(addressKind));
CodeGen\CodeGenerator.cs (22)
95Debug.Assert((object)method != null); 96Debug.Assert(boundBody != null); 97Debug.Assert(builder != null); 98Debug.Assert(moduleBuilder != null); 99Debug.Assert(diagnostics != null); 100Debug.Assert(diagnostics.DiagnosticBag != null); 171Debug.Assert(!_method.ReturnsVoid, "returning something from void method?"); 184Debug.Assert(((InternalSpecialType)returnType.OriginalDefinition.ExtendedSpecialType) is InternalSpecialType.System_Threading_Tasks_ValueTask_T or InternalSpecialType.System_Threading_Tasks_Task_T); 228Debug.Assert(_asyncCatchHandlerOffset < 0); 229Debug.Assert(_asyncYieldPoints == null); 230Debug.Assert(_asyncResumePoints == null); 241Debug.Assert(_asyncCatchHandlerOffset >= 0); 248Debug.Assert((yieldPoints == null) == (resumePoints == null)); 264Debug.Assert(resumeOffset >= 0); // resume marker should always be reachable from dispatch 313Debug.Assert(_diagnostics.HasAnyErrors()); 318Debug.Assert(!(_expressionTemps?.Count > 0), "leaking expression temps?"); 327Debug.Assert(_method.ReturnsVoid == (_returnTemp == null) 464Debug.Assert(node.Syntax is { }); 508Debug.Assert(_emitPdbSequencePoints); 519Debug.Assert(syntaxTree != null); 520Debug.Assert(_emitPdbSequencePoints); 541Debug.Assert(!exprTemps.Contains(temp));
CodeGen\EmitAddress.cs (15)
36Debug.Assert(((BoundDup)expression).RefKind != RefKind.None, "taking address of a stack value?"); 41Debug.Assert(!expression.Type.IsReferenceType); 42Debug.Assert(!expression.Type.IsValueType || expression.Type.IsNullableType()); 65Debug.Assert(expression.Type.IsValueType || IsAnyReadOnly(addressKind), "'this' is readonly in classes"); 90Debug.Assert(false, "base is always a reference type, why one may need a reference to it?"); 102Debug.Assert(operand.Type.IsPointerType()); 166Debug.Assert(HasHome(right, addressKind)); 176Debug.Assert(!HasHome(expression, addressKind)); 221Debug.Assert(expr.ConstantValueOpt == null, "Constant value should have been emitted directly"); 242Debug.Assert(!expression.Type.IsReferenceType); 243Debug.Assert(!expression.Type.IsValueType); 255Debug.Assert(receiverTemp == null); 426Debug.Assert(arrayAccess.Type.TypeKind == TypeKind.TypeParameter, "constrained call should only be used with type parameter types"); 536Debug.Assert(receiverType.TypeKind == TypeKind.TypeParameter || receiverType.IsValueType); 542Debug.Assert(!receiverType.IsVerifierReference());
CodeGen\EmitArrayInitializer.cs (19)
150Debug.Assert(!indices.Any()); 195Debug.Assert(indices.Count == arrayType.Rank - 1); 369Debug.Assert(inits.All((init) => init.Kind != BoundKind.ArrayInitialization) || 432Debug.Assert(inPlaceTarget is null || TargetIsNotOnHeap(inPlaceTarget), "in-place construction target should not be on heap"); 467Debug.Assert(!rosPointerCtor.HasUnsupportedMetadata); 511Debug.Assert(arrayType is not null); 512Debug.Assert(elementType is not null); 525Debug.Assert(length is not null); 569Debug.Assert(used); 584Debug.Assert(specialElementType.SizeInBytes() is 2 or 4 or 8, "Supported primitives are expected to be 2, 4, or 8 bytes"); 612Debug.Assert(!createSpan.HasUnsupportedMetadata); 690Debug.Assert(initializer != null); 693Debug.Assert(initializers.All(static init => init.ConstantValueOpt != null)); 694Debug.Assert(!elementType.IsEnumType()); 739Debug.Assert(used); 770Debug.Assert(used); 784Debug.Assert(!rosArrayCtor.HasUnsupportedMetadata); 813Debug.Assert(initializers.Length > 0); 814Debug.Assert(initializers.All(static init => init.ConstantValueOpt != null));
CodeGen\EmitConversion.cs (9)
73Debug.Assert((operand.Type.IsArray()) && 155Debug.Assert(IsNumeric(toType)); 158Debug.Assert(IsNumeric(fromType)); 159Debug.Assert( 247Debug.Assert(IsNumeric(fromType)); 251Debug.Assert(IsNumeric(toType)); 319Debug.Assert(!conversion.Type.IsNullableType()); 328Debug.Assert(IsNumeric(fromType)); 337Debug.Assert(IsNumeric(toType));
CodeGen\EmitExpression.cs (120)
79Debug.Assert(_recursionDepth == 1); 84Debug.Assert(_recursionDepth == 1); 233Debug.Assert(used); 238Debug.Assert(used); 243Debug.Assert(!used); 248Debug.Assert(used); 253Debug.Assert(used); 258Debug.Assert(used); 263Debug.Assert(used); 268Debug.Assert(used); 273Debug.Assert(used); 278Debug.Assert(used); 313Debug.Assert(used); 359Debug.Assert(expression.Kind != BoundKind.BadExpression); 376Debug.Assert(!expression.Type.IsReferenceType); 377Debug.Assert(!expression.Type.IsValueType); 408Debug.Assert(!receiverType.IsValueType || 415Debug.Assert(receiverType.IsVerifierReference()); 519Debug.Assert(receiver.Type.IsNullableType()); 572Debug.Assert(receiverTemp == null); 575Debug.Assert(receiverTemp == null || receiver.IsDefaultValue()); 613Debug.Assert(walker._result.HasValue); 631Debug.Assert(!_result.HasValue); 640Debug.Assert(!_result.HasValue); 651Debug.Assert(!expression.Type.IsValueType); 674Debug.Assert(temp == null, "makeref should not create temps"); 691Debug.Assert((object)getTypeMethod != null); 721Debug.Assert(refKind is RefKind.In or RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn); 727Debug.Assert(refKind is RefKind.In || argument.Type.IsDynamic() || argument is BoundFieldAccess { FieldSymbol.RefKind: not RefKind.None }, "passing args byref should not clone them into temps"); 746Debug.Assert(refKind is RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn); 758Debug.Assert(temp == null, "If the operand is addressable, then a temp shouldn't be required."); 810Debug.Assert((object)meth != null); 817Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter); 867Debug.Assert(sequence.Value.Kind != BoundKind.TypeExpression || !used); 957Debug.Assert(arguments.Length == parameters.Length || 959Debug.Assert(parameters.All(p => p.RefKind == RefKind.None) || !argRefKindsOpt.IsDefault, "there are nontrivial parameters, so we must have argRefKinds"); 961Debug.Assert(argRefKindsOpt.IsDefault || argRefKindsOpt.Length == arguments.Length || 985Debug.Assert(argRefKind == parameters[i].RefKind || 996Debug.Assert(parameters[i].RefKind != RefKind.RefReadOnlyParameter, 1010Debug.Assert(arguments[i].Kind == BoundKind.ArgListOperator); 1150Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal, 1193Debug.Assert(FieldLoadMustUseRef(receiver), "only clr-ambiguous structs use temps here"); 1260Debug.Assert(!field.IsVolatile, "volatile valuetype fields are unexpected"); 1432Debug.Assert(parameter.Type.Equals(parameter.ParameterSymbol.Type, TypeCompareKind.AllIgnoreOptions) || 1540Debug.Assert(receiver.Type.IsVerifierReference(), "this is not a reference"); 1541Debug.Assert(receiver.Kind != BoundKind.BaseReference, "base should always use call"); 1669Debug.Assert(method.IsImplicitlyDeclared); 1670Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2)); 1671Debug.Assert(receiver.Kind == BoundKind.ThisReference); 1686Debug.Assert(method.IsStatic); 1755Debug.Assert(!box); 1763Debug.Assert(addressKind.GetValueOrDefault() != AddressKind.Constrained); 1764Debug.Assert(!parentCallReceiverType.IsVerifierValue()); 1765Debug.Assert(parentCallKind != CallKind.ConstrainedCallVirt); 1769Debug.Assert(!box); 1770Debug.Assert(!parentCallReceiverType.IsVerifierReference()); 1805Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1815Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1820Debug.Assert(!parentCallReceiverType.IsVerifierReference()); 1824Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1825Debug.Assert(!HasHome(nested, addressKind.GetValueOrDefault())); 1868Debug.Assert(!method.IsStatic && !method.IsDefaultValueTypeConstructor() && method.RequiresInstanceReceiver); 1908Debug.Assert(TypeSymbol.Equals(receiverType, methodContainingType, TypeCompareKind.ObliviousNullableModifierMatchesAny)); 1953Debug.Assert((callKind != CallKind.ConstrainedCallVirt) || (addressKind.GetValueOrDefault() == AddressKind.Constrained) || receiverType.IsVerifierValue()); 1976Debug.Assert(!box); 1977Debug.Assert(!receiverType.IsVerifierReference()); 2022Debug.Assert(receiver.Type.IsVerifierReference()); 2033Debug.Assert(receiver.Type.IsVerifierReference()); 2046Debug.Assert(false, "Taking this code path is likely unexpected."); 2205Debug.Assert(!b.OperatorKind.IsUserDefined()); 2218Debug.Assert(!conv.ConversionKind.IsUserDefinedConversion()); 2219Debug.Assert(!conv.ConversionKind.IsUnionConversion()); 2236Debug.Assert(methodContainingType.IsVerifierValue(), "only struct calls can be readonly"); 2351Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type"); 2399Debug.Assert(expression.Type.SpecialType == SpecialType.System_Int32 || 2732Debug.Assert(temp == null, "in-place init target should not create temps"); 2739Debug.Assert(TargetIsNotOnHeap(target), "cannot read-back the target since it could have been modified"); 2746Debug.Assert(TargetIsNotOnHeap(target), "in-place construction target should not be on heap"); 2761Debug.Assert(temp == null, "in-place ctor target should not create temps"); 2855Debug.Assert(temp == null, "temp is unexpected when assigning to a field"); 2939Debug.Assert(temp == null, "taking ref of this should not create a temp"); 2950Debug.Assert(temp == null, "taking ref of Dup should not create a temp"); 2959Debug.Assert(left.IsRef); 2962Debug.Assert(temp == null, "taking ref of this should not create a temp"); 2995Debug.Assert(left.Method.RefKind != RefKind.None); 3006Debug.Assert(left.FunctionPointer.Signature.RefKind != RefKind.None); 3061Debug.Assert(lhs.Kind != BoundKind.Parameter || exprTempsAfter <= exprTempsBefore); 3179Debug.Assert(((BoundDup)expression).RefKind != RefKind.None); 3184Debug.Assert(((BoundConditionalOperator)expression).IsRef); 3202Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None); 3207Debug.Assert(((BoundFunctionPointerInvocation)expression).FunctionPointer.Signature.RefKind != RefKind.None); 3258Debug.Assert(thisRef.Type.IsValueType); 3454Debug.Assert((object)operand.Type != null); 3473Debug.Assert(asOp.OperandPlaceholder is null); 3474Debug.Assert(asOp.OperandConversion is null); 3483Debug.Assert((object)targetType != null); 3535Debug.Assert(expression.Type.SpecialType == SpecialType.System_Decimal || 3580Debug.Assert((object)getTypeMethod != null); // Should have been checked during binding 3601Debug.Assert(node.Method.IsDefinition); 3602Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3619Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3633Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3647Debug.Assert(field.IsDefinition); 3656Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3692Debug.Assert(throwMethod != null); 3735Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3746Debug.Assert((object)getMethod != null); 3754Debug.Assert(getMethod.ParameterCount == 2); 3773Debug.Assert((object)getField != null); 3781Debug.Assert(getField.ParameterCount == 2); 3810Debug.Assert(expr.ConstantValueOpt == null, "Constant value should have been emitted directly"); 3908Debug.Assert(expr.LeftConversion is null, "coalesce with nontrivial left conversions are lowered into conditional."); 3909Debug.Assert(expr.Type.IsReferenceType); 3989Debug.Assert(conversionKind != ConversionKind.NullLiteral && conversionKind != ConversionKind.DefaultLiteral); 4056Debug.Assert(to.IsVerifierReference()); 4076Debug.Assert(!type.IsRefLikeType); 4129Debug.Assert(useKind == UseKind.Unused, "Using the return value of a void method."); 4130Debug.Assert(_method.GenerateDebugInfo, "Implied by this.emitSequencePoints"); 4169Debug.Assert(method.RefKind != RefKind.None); 4175Debug.Assert(load.Type is { TypeKind: TypeKind.FunctionPointer });
CodeGen\EmitOperators.cs (21)
153Debug.Assert((object)binary == expression); 305Debug.Assert(binOp.Left.Type.SpecialType == SpecialType.System_Boolean); 306Debug.Assert(binOp.Right.Type.SpecialType == SpecialType.System_Boolean); 314Debug.Assert(binOp.Left.Type.SpecialType == SpecialType.System_Boolean); 315Debug.Assert(binOp.Right.Type.SpecialType == SpecialType.System_Boolean); 331Debug.Assert(binOp.Left.Type.SpecialType == SpecialType.System_Boolean); 332Debug.Assert(binOp.Right.Type.SpecialType == SpecialType.System_Boolean); 337Debug.Assert(binOp.Left.Type.SpecialType == SpecialType.System_Boolean); 338Debug.Assert(binOp.Right.Type.SpecialType == SpecialType.System_Boolean); 343Debug.Assert(binOp.Left.Type.SpecialType == SpecialType.System_Boolean); 344Debug.Assert(binOp.Right.Type.SpecialType == SpecialType.System_Boolean); 496Debug.Assert(condition.Type.SpecialType == SpecialType.System_Boolean); 501Debug.Assert(constantValue.Discriminator == ConstantValueTypeDiscriminator.Boolean); 531Debug.Assert(condition.Type.SpecialType == SpecialType.System_Boolean); 535Debug.Assert(constantValue.Discriminator == ConstantValueTypeDiscriminator.Boolean); 575Debug.Assert(unOp.OperatorKind == UnaryOperatorKind.BoolLogicalNegation); 583Debug.Assert(expression.OperatorKind.Operator() == UnaryOperatorKind.UnaryMinus); 596Debug.Assert(type == UnaryOperatorKind.Int || type == UnaryOperatorKind.Long || type == UnaryOperatorKind.NInt); 659Debug.Assert(TypeSymbol.Equals(expression.Left.Type, expression.Right.Type, TypeCompareKind.ConsiderEverything2)); 676Debug.Assert(enumType.IsEnumType()); 779Debug.Assert(opKind.Operator() != BinaryOperatorKind.UnsignedRightShift);
CodeGen\EmitStackAllocInitializer.cs (4)
24Debug.Assert(type is PointerTypeSymbol || type is NamedTypeSymbol); 25Debug.Assert(_diagnostics.DiagnosticBag is not null); 75Debug.Assert(TypeSymbol.Equals(readOnlySpan.OriginalDefinition, _module.Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.ConsiderEverything)); 171Debug.Assert(!(init is BoundArrayInitialization), "Nested initializers are not allowed for stackalloc");
CodeGen\EmitStatement.cs (58)
145Debug.Assert((_asyncYieldPoints == null) == (_asyncResumePoints == null)); 151Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 156Debug.Assert(_asyncYieldPoints != null); 157Debug.Assert(_asyncYieldPoints != null); 159Debug.Assert(_asyncYieldPoints.Count == _asyncResumePoints.Count); 192Debug.Assert(label != null); 221Debug.Assert(tc != Microsoft.Cci.PrimitiveTypeCode.Invalid); 222Debug.Assert(tc != Microsoft.Cci.PrimitiveTypeCode.Void); 232Debug.Assert(opKind == BinaryOperatorKind.Equal || 378Debug.Assert(_recursionDepth == 1); 383Debug.Assert(_recursionDepth == 1); 421Debug.Assert(binOp.ConstantValueOpt is null); 589Debug.Assert((object)operand.Type != null); 708Debug.Fail("Exception handling constructs should be blocked at the binding layer, not here at emit time"); 759Debug.Assert(local.RefKind == RefKind.None || local.SynthesizedKind.IsLongLived(), 804Debug.Assert(!block.Locals.IsEmpty); 810Debug.Assert(local.Name != null); 811Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.UserDefined && 884Debug.Assert(unexpectedTemp == null, "ref-returning a temp?"); 937Debug.Fail("Exception handling constructs should be blocked at the binding layer, not here at emit time"); 943Debug.Assert(!statement.CatchBlocks.IsDefault); 1152Debug.Assert(exceptionSourceOpt.Type.IsTypeParameter()); // only expecting type parameters 1161Debug.Assert(seq.Locals.IsDefaultOrEmpty); 1170Debug.Assert(exceptionSourceLocal.LocalSymbol.RefKind == RefKind.None); 1180Debug.Assert(!left.FieldSymbol.IsStatic, "Not supported"); 1181Debug.Assert(!left.ReceiverOpt.Type.IsTypeParameter()); 1182Debug.Assert(left.FieldSymbol.RefKind == RefKind.None); 1196Debug.Assert(receiverTemp == null); 1215Debug.Assert(_builder.IsStackEmpty); 1240Debug.Assert(currentCatchFilterLevel == _inCatchFilterLevel); 1251Debug.Assert(_asyncCatchHandlerOffset < 0); // only one expected 1259Debug.Assert((object)dispatch.Expression.Type != null); 1260Debug.Assert(dispatch.Expression.Type.IsValidV6SwitchGoverningType() || dispatch.Expression.Type.IsSpanOrReadOnlySpanChar()); 1263Debug.Assert(!dispatch.Expression.Type.IsNullableType()); 1266Debug.Assert(dispatch.Cases.Any()); 1281Debug.Assert(expression.ConstantValueOpt == null); 1282Debug.Assert((object)expression.Type != null && 1284Debug.Assert(switchCaseLabels.Length > 0); 1286Debug.Assert(switchCaseLabels != null || lengthBasedSwitchStringJumpTableOpt != null); 1334Debug.Assert(lengthBasedSwitchStringJumpTableOpt is null || 1400Debug.Assert(indexerRef is not null); 1401Debug.Assert(lengthMethodRef is not null); 1506Debug.Assert(diag.IsEmptyWithoutResolution); 1571Debug.Assert(sequenceEqualsTMethod != null && !sequenceEqualsTMethod.HasUseSiteError); 1576Debug.Assert(asSpanMethod != null && !asSpanMethod.HasUseSiteError); 1582Debug.Assert(stringEqualityMethod != null && !stringEqualityMethod.HasUseSiteError); 1593Debug.Assert(!isSpanOrReadOnlySpan); 1623Debug.Assert(diag.IsEmptyWithoutResolution); 1666Debug.Assert(spanTLengthMethod != null && !spanTLengthMethod.HasUseSiteError); 1724Debug.Assert(stringEqualityMethodRef != null); 1728Debug.Assert(stringEqualityMethodRef == _module.Translate((MethodSymbol)_module.Compilation.GetSpecialTypeMember(SpecialMember.System_String__op_Equality), (CSharpSyntaxNode)syntaxNode, assertDiagnostics)); 1762Debug.Assert(sequenceEqualsRef != null); 1763Debug.Assert(asSpanRef != null); 1801Debug.Assert(local.HasConstantValue); 1823Debug.Assert(local.RefKind == RefKind.None); 1824Debug.Assert(local.TypeWithAnnotations.Type.IsPointerType()); 1889Debug.Assert((local.Name == null) == (localKind != SynthesizedLocalKind.UserDefined)); 1906Debug.Assert(ordinal == 0 || localKind != SynthesizedLocalKind.UserDefined);
CodeGen\Optimizer.cs (44)
298Debug.Assert(instance._localDefs == null); 450Debug.Assert(expr.Kind != BoundKind.Label); 520Debug.Assert(_recursionDepth == 1); 525Debug.Assert(_recursionDepth == 1); 541Debug.Assert(result != null || context == ExprContext.None); 567Debug.Assert(node == null || EvalStackIsEmpty()); 614Debug.Assert(EvalStackIsEmpty(), "entering blocks when evaluation stack is not empty?"); 793Debug.Assert(localUsedWalker.IsLocalUsedIn(assignment.Right), "who assigns the temp?"); 868Debug.Assert(_assignmentLocal == null); 928Debug.Assert(_context != ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment"); 938Debug.Assert(_context == ExprContext.Value || 972Debug.Assert( 978Debug.Assert(!isIndirectAssignment, "indirect assignment is a read, not a write"); 1039Debug.Assert(!node.IsRef || 1046Debug.Assert(lhs.Type.IsValueType, "'this' is assignable only in structs"); 1066Debug.Assert(((BoundCall)lhs).Method.RefKind == RefKind.Ref, "only ref returning methods are assignable"); 1070Debug.Assert(((BoundFunctionPointerInvocation)lhs).FunctionPointer.Signature.RefKind == RefKind.Ref, "only ref returning function pointers are assignable"); 1074Debug.Assert(((BoundConditionalOperator)lhs).IsRef, "only ref ternaries are assignable"); 1078Debug.Assert(((BoundAssignmentOperator)lhs).IsRef, "only ref assignments are assignable"); 1084Debug.Assert(!IsIndirectAssignment(node.Update(((BoundSequence)node.Left).Value, node.Right, node.IsRef, node.Type)), 1179Debug.Assert(method.IsStatic); 1268Debug.Assert(!arguments.IsDefault); 1269Debug.Assert(!parameters.IsDefault); 1271Debug.Assert(arguments.Length == parameters.Length || arguments.Length == parameters.Length + 1); 1331Debug.Assert(node.InitializerExpressionOpt == null); 1400Debug.Assert(false, "we should not have label expressions at this stage"); 1406Debug.Assert(false, "we should not have is-pattern expressions at this stage"); 1412Debug.Assert(node.CaseExpressionOpt == null, "we should not have label expressions at this stage"); 1431Debug.Assert(EvalStackIsEmpty()); 1538Debug.Assert(!binary.OperatorKind.IsDynamic()); 1552Debug.Assert((object)binary == node); 1573Debug.Assert(!node.OperatorKind.IsDynamic()); 1582Debug.Assert(node.LeftPlaceholder is null); 1583Debug.Assert(node.LeftConversion is null); 1887Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref"); 1934Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth()); 1955Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.OptimizerTemp); 1960Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth()); 1968Debug.Assert(local.SynthesizedKind != SynthesizedLocalKind.OptimizerTemp); 2023Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.LoweringTemp, "only lowering temps may be sometimes reused"); 2162Debug.Assert(!binary.OperatorKind.IsDynamic()); 2173Debug.Assert((object)binary == node); 2205Debug.Assert(node.InitializerExpressionOpt == null); 2245Debug.Assert(locInfo.LocalDefs.Any((d) => _nodeCounter == d.Start && _nodeCounter <= d.End));
CommandLine\CSharpCommandLineParser.cs (9)
54Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 169Debug.Assert(optionsEnded || !arg.StartsWith("@", StringComparison.Ordinal)); 442Debug.Assert(loweredValue == nameof(NullableContextOptions.Disable).ToLower()); 446Debug.Assert(loweredValue == nameof(NullableContextOptions.Enable).ToLower()); 450Debug.Assert(loweredValue == nameof(NullableContextOptions.Warnings).ToLower()); 454Debug.Assert(loweredValue == nameof(NullableContextOptions.Annotations).ToLower()); 1732Debug.Assert(!IsScriptCommandLineParser); 1774Debug.Assert(IsScriptCommandLineParser); 2081Debug.Assert(!PathUtilities.IsValidFilePath(fullPath));
CommandLine\CSharpCompiler.cs (6)
94Debug.Assert(hadErrors); 103Debug.Assert(normalizedFilePath != null); 104Debug.Assert(sourceFiles[i].IsInputRedirected || PathUtilities.IsAbsolute(normalizedFilePath)); 118Debug.Assert(touchedFilesLogger is object); 196Debug.Assert(fileDiagnostics.Count == 0); 243Debug.Assert(Arguments.CompilationOptions.OutputKind.IsApplication());
Compilation\AttributeSemanticModel.cs (1)
31Debug.Assert(syntax != null);
Compilation\BuiltInOperators.cs (8)
692Debug.Assert(_compilation.IsReadOnlySpanType(readonlySpanOfByte)); 693Debug.Assert(((NamedTypeSymbol)readonlySpanOfByte).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte); 766Debug.Assert(false, "Bad operator kind in left type"); 798Debug.Assert(false, "Bad operator kind in right type"); 829Debug.Assert(false, "Bad operator kind in return type"); 835Debug.Assert(kind.IsLifted()); 886Debug.Assert((object)leftType != null); 897Debug.Assert((object)rightType != null);
Compilation\CSharpCompilation.cs (63)
363Debug.Assert(ReferenceEquals(method.ContainingAssembly, Assembly)); 364Debug.Assert(method.IsDefinition); 365Debug.Assert(method is not Symbols.Metadata.PE.PEMethodSymbol); 493Debug.Assert(!isSubmission || options.ReferencesSupersedeLowerVersions); 530Debug.Assert(compilation._lazyAssemblySymbol is null); 573Debug.Assert(previousSubmission == null || previousSubmission.HostObjectType == hostObjectType); 578Debug.Assert(previousSubmission == null && submissionReturnType == null && hostObjectType == null); 601Debug.Assert(_lazyAssemblySymbol is null); 607Debug.Assert(debugEntryPoint != null); 854Debug.Assert(IsSubmission); 1121Debug.Assert(this.ContainsSyntaxTree(tree)); 1166Debug.Assert(contentHash.Length == InterceptableLocation1.ContentHashLength); 1230Debug.Assert(_lazyAssemblySymbol is object); 1284Debug.Assert(reference.Properties.Kind == MetadataImageKind.Module); 1608Debug.Assert(foundNamespace == !(@namespace is MissingNamespaceSymbol)); 1642Debug.Assert(tree != null); 1643Debug.Assert(!this.IsSubmission || _syntaxAndDeclarations.ExternalSyntaxTrees.Length <= 1); 1700Debug.Assert(this.IsSubmission); 1701Debug.Assert(_syntaxAndDeclarations.ExternalSyntaxTrees.Length <= 1); 1721Debug.Assert(this.IsSubmission); 1762Debug.Assert(result.ExtendedSpecialType == specialType); 1785Debug.Fail($"Unsupported type argument: {typeArgument.ToDisplayString()}"); 1908Debug.Assert(result?.IsErrorType() != true); 1975Debug.Assert(!this.Options.Errors.IsDefaultOrEmpty); 2202Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.Uninitialized)); 2203Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound)); 2298Debug.Assert(result is { Type: not null } || runtimeAwaitCall is { Type: not null }); 2527Debug.Assert(!_declarationDiagnosticsFrozen); 2557Debug.Assert(!_declarationDiagnosticsFrozen); 2558Debug.Assert(!InterceptorsDiscoveryComplete); 2633Debug.Assert(model != null); 2666Debug.Assert(System.Runtime.CompilerServices.Unsafe.AreSame(ref cachedBinderFactories, ref ignoreAccessibility ? ref _ignoreAccessibilityBinderFactories : ref _binderFactories)); 2697Debug.Assert(slot is object); 2739Debug.Assert(diagnostics is { }); 2741Debug.Assert(bag.DiagnosticBag is { }); 2941Debug.Assert(!_declarationDiagnosticsFrozen || true); 3032Debug.Assert(builder.DiagnosticBag is { }); 3140Debug.Assert(!loadDirectives.IsEmpty); 3215Debug.Assert(this.ContainsSyntaxTree(tree)); 3227Debug.Assert(bindingDiagnostics.DiagnosticBag is { }); 3253Debug.Assert(reportUnusedUsings); 3272Debug.Assert(reportUnusedUsings); 3275Debug.Assert(discarded.DiagnosticBag is object); 3319Debug.Assert(methodBodyDiagnostics.Diagnostics.SequenceEqual(diagnostics)); 3462Debug.Assert(!_lazyClsComplianceDependencies.IsDefault); 3463Debug.Assert(!_lazyClsComplianceDiagnostics.IsDefault); 3583Debug.Assert(!IsSubmission || HasCodeToEmit() || 3719Debug.Assert(methodBodyDiagnosticBag.DiagnosticBag is { }); 3720Debug.Assert(moduleBeingBuilt is object); 3733Debug.Assert(filterOpt == null || moduleBeingBuilt.IsEncDelta); 3819Debug.Assert(symbol.ContainingSymbol.Kind == SymbolKind.Namespace); // avoid unnecessary traversal of nested types 3851Debug.Assert(interceptionsOfAGivenLocation.Count != 0); 3869Debug.Assert(_declarationDiagnosticsFrozen); 3924Debug.Assert(xmlDiagnostics.DiagnosticBag is { }); 4447Debug.Assert(csharpReturnType is not null); 4448Debug.Assert(csharpLeftType is not null); 4449Debug.Assert(csharpRightType is not null); 4671Debug.Assert(csharpReturnType is not null); 4672Debug.Assert(csharpOperandType is not null); 4755Debug.Assert(loc1.IsInSource); 4756Debug.Assert(loc2.IsInSource); 4923Debug.Assert(symbol.IsDefinition); 4980Debug.Assert(LanguageVersion == LanguageVersion.MapSpecifiedToEffectiveVersion());
Compilation\CSharpCompilation.UsingsFromOptionsAndDiagnostics.cs (6)
57Debug.Assert(directiveDiagnostics.DiagnosticBag is object); 58Debug.Assert(directiveDiagnostics.DependenciesBag is object); 107Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports)); 133Debug.Assert(diagnostics.DiagnosticBag is object); 134Debug.Assert(diagnostics.DependenciesBag is object); 146Debug.Assert(@using.UsingDirective is null);
Compilation\CSharpDiagnosticFilter.cs (5)
153Debug.Assert(location.SourceTree is null || location.SourceTree is CSharpSyntaxTree); 325Debug.Assert(isEnabledByDefault); 326Debug.Assert(!specifiedWarnAsErrorMinus); 334Debug.Assert(report == ReportDiagnostic.Default); 335Debug.Assert(generalDiagnosticOption == ReportDiagnostic.Error);
Compilation\CSharpScriptCompilationInfo.cs (1)
17Debug.Assert(previousCompilationOpt == null || previousCompilationOpt.HostObjectType == globalsType);
Compilation\CSharpSemanticModel.cs (73)
62Debug.Assert(node != null); 206Debug.Assert(expression != null); 255Debug.Assert(binder != null); 256Debug.Assert(binder.IsSemanticModelBinder); 257Debug.Assert(expression != null); 258Debug.Assert(bindingOption != SpeculativeBindingOption.BindAsTypeOrNamespace || expression is TypeSyntax); 267Debug.Assert(bindingOption == SpeculativeBindingOption.BindAsExpression); 739Debug.Assert(boundNode == null || crefSymbols.IsDefault); 765Debug.Assert(CanGetSemanticInfo(attribute, isSpeculative: true)); 793Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true)); 865Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true)); 926Debug.Assert(CanGetSemanticInfo(cref, isSpeculative: true)); 1069Debug.Assert(boundNode == null || crefSymbols.IsDefault); 1216Debug.Assert(boundNode == null || crefSymbols.IsDefault); 1236Debug.Assert(result == null || result.IsSemanticModelBinder); 1328Debug.Assert(IsInTree(node)); 1346Debug.Assert(position == fullSpan.Start); 1354Debug.Assert(node.Width == 0); 1373Debug.Assert(position == CheckAndAdjustPosition(position), "Expected adjusted position"); 1581Debug.Assert((options & LookupOptions.UseBaseReferenceAccessibility) == 0, "Use the useBaseReferenceAccessibility parameter."); 1586Debug.Assert(!options.IsAttributeTypeLookup()); // Not exposed publicly. 1606Debug.Assert((object)container == null); 1677Debug.Assert((options & LookupOptions.NamespacesOrTypesOnly) == 0); 1678Debug.Assert((options & LookupOptions.NamespaceAliasesOnly) == 0); 1679Debug.Assert((options & LookupOptions.LabelsOnly) == 0); 1696Debug.Assert(symbol.IsExtensionBlockMember()); 1755Debug.Assert(results != null); 1758Debug.Assert((options & LookupOptions.AllMethodsOnArityZero) == 0); 2323Debug.Assert((object)symbol != null); 2361Debug.Assert((object)symbol != null); 3314Debug.Assert(catchClause.Kind() == SyntaxKind.CatchClause); 3438Debug.Assert(boundNode is not BoundTypeOrValueExpression, "The Binder is expected to resolve the member access in the most appropriate way, even in an error scenario."); 3495Debug.Assert((object)indexerAccess.Indexer != null); 3544Debug.Assert((object)symbol != null); 3595Debug.Assert(conditional.ExpressionSymbol is null); 3601Debug.Assert(boundNodeForSyntacticParent == null); 3613Debug.Assert(resultKind != LookupResultKind.Viable); 3647Debug.Assert(dynamicInvocation.ExpressionSymbol is null); 3655Debug.Assert(collectionInit.ExpressionSymbol is null); 3663Debug.Assert(dynamicIndexer.ExpressionSymbol is null); 3670Debug.Assert((object)boundNode.ExpressionSymbol == null); 3686Debug.Assert(boundObjectCreation.ConstructorsGroup.Contains(boundObjectCreation.Constructor)); 3832Debug.Assert((object)unaryOperator.MethodOpt == null && unaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3855Debug.Assert((object)increment.MethodOpt == null && increment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3880Debug.Assert((object)binaryOperator.BinaryOperatorMethod == null && binaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3919Debug.Assert(returnType.IsDynamic()); 3923Debug.Assert(rightType.IsDynamic()); 3928Debug.Assert(leftType.IsDynamic()); 3953Debug.Assert((object)compoundAssignment.Operator.Method == null && compoundAssignment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 4012Debug.Assert(resultKind != LookupResultKind.Viable || 4047Debug.Assert(lowestBoundNode != null); 4048Debug.Assert(binderOpt != null || IsInTree(lowestBoundNode.Syntax)); 4052Debug.Assert(lowestBoundNode.Syntax != null); 4073Debug.Assert(resultKind != LookupResultKind.Viable); 4084Debug.Assert(candidateConstructors.Contains(constructorOpt)); 4090Debug.Assert(resultKind != LookupResultKind.Viable); 4108Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4139Debug.Assert(symbol.IsIndexer(), "Only indexers can have name " + WellKnownMemberNames.Indexer); 4265Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4417Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4500Debug.Assert(SyntaxFacts.IsNamedArgumentName(identifierNameSyntax)); 4600Debug.Assert(nonHiddenMethods.Any()); // Something must be hiding, so can't all be hidden. 4636Debug.Assert(receiver != null); 4750Debug.Assert(members.Count > 0); 4757Debug.Assert((members.Count == 0) == (resultKind == LookupResultKind.Empty)); 4758Debug.Assert(members.Count == filteredMembers.Count); 4769Debug.Assert(!methods.IsDefault); 4783Debug.Assert((object)receiverType != null); 4804Debug.Assert((object)method != null); 4808Debug.Assert(call.Arguments.Length > 0); 4821Debug.Assert((object)method != null); 4956Debug.Assert(((options & SymbolInfoOptions.PreferConstructorsToType) != 0) != 4958Debug.Assert(((options & SymbolInfoOptions.ResolveAliases) != 0) !=
Compilation\InitializerSemanticModel.cs (7)
33Debug.Assert(!(syntax is ConstructorInitializerSyntax || syntax is PrimaryConstructorBaseTypeSyntax)); 41Debug.Assert(containingSemanticModel != null); 42Debug.Assert(syntax.IsKind(SyntaxKind.VariableDeclarator) || syntax.IsKind(SyntaxKind.EnumMemberDeclaration)); 51Debug.Assert(containingSemanticModel != null); 52Debug.Assert(syntax.IsKind(SyntaxKind.PropertyDeclaration)); 61Debug.Assert(containingSemanticModel != null); 279Debug.Assert(MemberSymbol.ContainingType is SourceMemberContainerTypeSymbol);
Compilation\LexicalOrderSymbolComparer.cs (2)
36Debug.Assert((object)x.DeclaringCompilation == y.DeclaringCompilation); 51Debug.Assert(comparison != 0);
Compilation\MemberSemanticModel.cs (58)
53Debug.Assert(root != null); 54Debug.Assert((object)memberSymbol != null); 55Debug.Assert(containingPublicSemanticModel.IsSpeculativeSemanticModel == (containingPublicSemanticModel is SpeculativeSemanticModelWithMemberModel)); 149Debug.Assert(false); 159Debug.Assert(_lazySnapshotManager is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled()); 166Debug.Assert(_lazyRemappedSymbols is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled()); 228Debug.Assert(root.Contains(node)); 237Debug.Assert(current != null); // Why were we asked for an enclosing binder for a node outside our root? 254Debug.Assert(ownerOfTypeParametersInScope == null); 282Debug.Assert(binder != null); 364Debug.Assert(!current.CanHaveAssociatedLocalBinder()); 374Debug.Assert(binder != null); 402Debug.Assert(binder != null); 412Debug.Assert(binder != null); 418Debug.Assert(binder != null); 429Debug.Assert(binder != null); 537Debug.Assert(node == GetBindableSyntaxNode(node)); 559Debug.Assert(node == GetBindableSyntaxNode(node)); 840Debug.Assert(parameter != null); 875Debug.Assert(parameter != null); 876Debug.Assert(lambda != null && lambda.IsAnonymousFunction()); 893Debug.Assert(this.GetMemberModel(lambda) == null, "Did not find a unique LambdaSymbol for lambda in member."); 992Debug.Assert(enumeratorInfoOpt != null || boundForEach.HasAnyErrors); 1052Debug.Assert(boundConversion != null); 1070Debug.Assert(boundDeconstruction != null || boundForEach.HasAnyErrors); 1140Debug.Assert(index >= 0); 1141Debug.Assert(index < anonymousObjectCreation.Initializers.Count); 1234Debug.Assert(highestBoundNode != null); 1246Debug.Assert(highestBoundNode.Kind != BoundKind.UnboundLambda); 1263Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1286Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1298Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later"); 1416Debug.Assert(node != null); 1424Debug.Assert(current != null, "Why are we being asked to find an enclosing lambda outside of our root?"); 1480Debug.Assert(_nodeMapLock.IsWriteLockHeld || _nodeMapLock.IsReadLockHeld); 1498Debug.Assert(_nodeMapLock.IsWriteLockHeld); 1512Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax)); 1529Debug.Assert(_nodeMapLock.IsWriteLockHeld); 1548Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax)); 1556Debug.Assert((manager is null && (!IsNullableAnalysisEnabled() || syntax != Root || syntax is TypeSyntax || 1574Debug.Assert(node != null); 1580Debug.Assert(current != null, "How did we get outside the root?"); 1709Debug.Assert(bindingRoot.Contains(enclosingLambdaOrQuery)); 1751Debug.Assert(lambdaOrQuery != nodeToBind); 1786Debug.Assert(boundInnerLambdaOrQuery != null); 1804Debug.Assert(result != null); 1945Debug.Assert(containingLambda.IsAnonymousFunction()); 1946Debug.Assert(LookupPosition.IsInAnonymousFunctionOrQuery(position, containingLambda)); 1997Debug.Assert(!isNullableAnalysisEnabled || 2043Debug.Assert(Compilation.IsNullableAnalysisEnabledAlways); 2071Debug.Assert(binder is SimpleProgramBinder); 2121Debug.Assert(node == GetBindableSyntaxNode(node)); 2286Debug.Assert(parent.Kind() == SyntaxKind.VariableDeclaration); 2365Debug.Assert(bindableParent != null); 2393Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod }); 2462Debug.Assert(!(binder is IncrementalBinder)); 2519Debug.Assert(!block.WasCompilerGenerated); 2583Debug.Assert(alternative is BoundIfStatement);
Compilation\MemberSemanticModel.NodeMapBuilder.cs (7)
41Debug.Assert(node == null || root == null || !(root.Syntax is StatementSyntax), "individually added nodes are not supposed to be statements."); 80Debug.Assert(existing.Count == nodesToAdd.Count, "existing.Count == nodesToAdd.Length"); 90Debug.Assert(!(key is StatementSyntax), "!(key is StatementSyntax)"); 95Debug.Assert( 103Debug.Assert( 111Debug.Assert(false, "New bound node does not match existing bound node"); 116Debug.Assert(
Compilation\MemberSemanticModel.SpeculativeMemberSemanticModel.cs (2)
34Debug.Assert(containingPublicSemanticModel is not null); 51Debug.Assert(boundRoot.Syntax is TypeSyntax);
Compilation\MethodBodySemanticModel.cs (8)
51Debug.Assert((object)owner != null); 52Debug.Assert(owner.Kind == SymbolKind.Method); 53Debug.Assert(syntax != null); 54Debug.Assert(parentRemappedSymbolsOpt is null || IsSpeculativeSemanticModel); 55Debug.Assert((syntax.Kind() == SyntaxKind.CompilationUnit) == (!IsSpeculativeSemanticModel && owner is SynthesizedSimpleProgramEntryPointSymbol)); 63Debug.Assert(containingSemanticModel != null); 185Debug.Assert(binder != null); 262Debug.Assert(typeDecl.Kind() is (SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration));
Compilation\SpeculativeSemanticModelWithMemberModel.cs (10)
33Debug.Assert(parentSemanticModel is not null); 51Debug.Assert(syntax != null); 52Debug.Assert(rootBinder != null); 53Debug.Assert(rootBinder.IsSemanticModelBinder); 80Debug.Assert(syntax != null); 81Debug.Assert(rootBinder != null); 82Debug.Assert(rootBinder.IsSemanticModelBinder); 110Debug.Assert(syntax != null); 111Debug.Assert(rootBinder != null); 112Debug.Assert(rootBinder.IsSemanticModelBinder);
Compilation\SpeculativeSyntaxTreeSemanticModel.cs (5)
39Debug.Assert(parentSemanticModel is SyntaxTreeSemanticModel); 40Debug.Assert(root != null); 41Debug.Assert(root is TypeSyntax || root is CrefSyntax); 42Debug.Assert(rootBinder != null); 43Debug.Assert(rootBinder.IsSemanticModelBinder);
Compilation\SymbolInfoFactory.cs (1)
40Debug.Assert(symbols.Count == 1);
Compilation\SyntaxAndDeclarationManager.cs (15)
211Debug.Assert(!directive.IsActive || tree.GetDiagnostics().Any(d => d.Severity == DiagnosticSeverity.Error)); 274Debug.Assert(diagnostics.IsEmptyWithoutResolution); 395Debug.Assert(!oldLoadDirectives.IsEmpty); 418Debug.Assert(!loadDirectives.IsEmpty); 448Debug.Assert(!nestedLoadDirectives.IsEmpty); 518Debug.Assert(!loadDirectiveMapBuilder.ContainsKey(oldTree)); 519Debug.Assert(!loadDirectiveMapBuilder.ContainsKey(newTree)); 562Debug.Assert(newTrees.Length == ordinalMap.Count); 572Debug.Assert(!oldLoadDirectives.IsDefault); 573Debug.Assert(!oldLoadDirectives.IsEmpty); 574Debug.Assert(oldLoadDirectives.Length == newLoadDirectivesSyntax.Count); 578Debug.Assert(ordinalMap.ContainsKey(oldTree)); // Checked by RemoveSyntaxTreeFromDeclarationMapAndTable 687Debug.Assert(!loadDirectives.IsEmpty); 691Debug.Assert((resolvedPath != null) || !directive.Diagnostics.IsEmpty); 736Debug.Assert(directive.Diagnostics.HasAnyErrors());
Compilation\SyntaxAndDeclarationManager.LazyState.cs (2)
55Debug.Assert(syntaxTrees.All(tree => syntaxTrees[syntaxTreeOrdinalMap[tree]] == tree)); 56Debug.Assert(syntaxTrees.SetEquals(rootNamespaces.Keys.AsImmutable(), EqualityComparer<SyntaxTree>.Default));
Compilation\SyntaxTreeSemanticModel.cs (37)
259Debug.Assert(symbols.All(s => s.Kind == SymbolKind.TypeParameter || s.Kind == SymbolKind.Parameter)); 332Debug.Assert(this.GetMemberModel(node) == null); 768Debug.Assert(speculativeSyntax.SyntaxTree != SyntaxTree); 1215Debug.Assert((object)scriptInitializer != null); 1323Debug.Assert(declarationSyntax != null); 1335Debug.Assert((object)container != null); 1339Debug.Assert((object)symbol != null); 1343Debug.Assert((object)symbol != null); 1379Debug.Assert(declarationSyntax != null); 1392Debug.Assert(extensionDeclaration != null); 1395Debug.Assert(container is not null); 1414Debug.Assert(declarationSyntax != null); 1422Debug.Assert(declarationSyntax != null); 1425Debug.Assert((object)container != null); 1615Debug.Assert((object)container != null); 1616Debug.Assert(declarationSyntax.Keyword.Kind() != SyntaxKind.IdentifierToken); 1636Debug.Assert((object)container != null); 1759Debug.Assert((object)left != null); 1794Debug.Assert(name is not null, "Should only be looking for a known namespace by name."); 1795Debug.Assert(namespaces is [NamespaceSymbol], "Namespace declarations of the same name are expected to appear as a single merged symbol."); 1799Debug.Assert(knownNamespace.HasLocationContainedWithin(SyntaxTree, declarationSpan, out _), "Namespace symbols should include all syntax declaration locations."); 1863Debug.Assert((object)container != null); 1866Debug.Assert((object)result != null); 2032Debug.Assert(parameter != null); 2063Debug.Assert(parameter != null); 2100Debug.Assert(parameter != null); 2127Debug.Assert(parameter != null); 2380Debug.Assert((object)container != null); 2452Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod }); 2479Debug.Assert(((INamespaceSymbol)declaredSymbol).IsGlobalNamespace); 2484Debug.Assert((object)declaredSymbol.GetSymbol() == (object)entryPoint); 2489Debug.Assert((object)declaredSymbol.GetSymbol() == (object)entryPoint.ContainingSymbol); 2504Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor); 2525Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor.ContainingSymbol); 2540Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor); 2553Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor.ContainingSymbol); 2574Debug.Assert(declaredSymbol.GetSymbol() is SynthesizedRecordPropertySymbol);
Compiler\AnonymousTypeMethodBodySynthesizer.cs (4)
38Debug.Assert(ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 50Debug.Assert(anonymousType.Properties.Length == paramCount); 126Debug.Assert(c.IsImplicit); 127Debug.Assert(c.IsReference);
Compiler\ClsComplianceChecker.cs (40)
44Debug.Assert(diagnostics.DependenciesBag is null || diagnostics.DependenciesBag is ConcurrentSet<AssemblySymbol>); 93System.Diagnostics.Debug.Assert(symbol is SourceAssemblySymbol); 122System.Diagnostics.Debug.Assert(warningLocation != null || !moduleDeclaredCompliance.HasValue || (i == 0 && _filterTree != null), 243Debug.Assert(!symbol.IsImplicitClass); 279System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(constructor), "Should be implied by IsAccessibleIfContainerIsAccessible"); 424System.Diagnostics.Debug.Assert( 430System.Diagnostics.Debug.Assert(!symbol.IsAccessor()); 499System.Diagnostics.Debug.Assert(!IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on non-compliant symbols"); 514System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 532System.Diagnostics.Debug.Assert((object)baseType != null || symbol.SpecialType == SpecialType.System_Object || symbol.IsExtension, "Only object or extension has no base."); 543System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 546System.Diagnostics.Debug.Assert((object)containingType == null || !containingType.IsImplicitClass); 555System.Diagnostics.Debug.Assert(typeParameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols"); 574System.Diagnostics.Debug.Assert(parameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols"); 587System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 665System.Diagnostics.Debug.Assert(syntaxRef.SyntaxTree.HasCompilationUnitRoot); 713System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols"); 738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate); 743System.Diagnostics.Debug.Assert(!method.IsAccessor()); 804System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(symbol)); 805System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol))); 886Debug.Assert(sameNameSymbols.Count > 0); 887Debug.Assert(symbol.Name == symbolName); 929System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol))); 930System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(symbol)); 952System.Diagnostics.Debug.Assert(name.Length == 0 || name[0] != '\uFF3F'); 1116System.Diagnostics.Debug.Assert(symbol.Kind == SymbolKind.NamedType || !((symbol is TypeSymbol)), 1136Debug.Assert(symbol.Kind != SymbolKind.Alias); 1137Debug.Assert(symbol.Kind != SymbolKind.Label); 1138Debug.Assert(symbol.Kind != SymbolKind.Namespace); 1139Debug.Assert(symbol.Kind != SymbolKind.Parameter); 1140Debug.Assert(symbol.Kind != SymbolKind.RangeVariable); 1172System.Diagnostics.Debug.Assert(symbol.Kind != SymbolKind.Assembly); 1175System.Diagnostics.Debug.Assert((object)containing != null); 1209System.Diagnostics.Debug.Assert(args.Length == 1, "We already checked the signature and HasErrors."); 1246System.Diagnostics.Debug.Assert(symbol.Kind == SymbolKind.ErrorType); 1318System.Diagnostics.Debug.Assert((object)x != null); 1319System.Diagnostics.Debug.Assert((object)y != null); 1320System.Diagnostics.Debug.Assert((object)x != (object)y); 1321System.Diagnostics.Debug.Assert(x.Kind == y.Kind);
Compiler\DocumentationCommentCompiler.cs (34)
105Debug.Assert(compiler._indentDepth == 0); 140Debug.Assert( 148Debug.Assert(compilation != null); 164Debug.Assert(compiler._indentDepth == 0); 179Debug.Assert(_assemblyName != null); 198Debug.Assert(!_isForSingleSymbol); 265Debug.Assert(!_isForSingleSymbol); 299Debug.Assert(firstExtension is not null); 308Debug.Assert(extension.IsExtension); 315Debug.Assert(firstExtension.GetEscapedDocumentationCommentId() == extension.GetEscapedDocumentationCommentId()); 484Debug.Assert(paramTags.Count > 0); 588Debug.Assert(location.SourceTree!.ReportDocumentationCommentDiagnostics()); //Should be the same tree as for the symbol. 609Debug.Assert(location.SourceTree!.ReportDocumentationCommentDiagnostics()); //Should be the same tree as for the symbol. 637Debug.Assert(!docCommentNodes.IsDefaultOrEmpty); 796Debug.Assert((object)symbol != null); 918Debug.Assert(numLines > 0); 923Debug.Assert(numLines > 0); 957Debug.Assert(start >= 0); 958Debug.Assert(start <= str.Length); 959Debug.Assert(end >= 0); 960Debug.Assert(end <= str.Length); 961Debug.Assert(end >= start); 1084Debug.Assert(numLines > 0); 1104Debug.Assert(pattern.StartsWith(currentLinePattern, StringComparison.Ordinal)); 1226Debug.Assert((object)symbol != null); 1237Debug.Assert(!ns.IsGlobalNamespace); 1332Debug.Assert(referencedSymbol.Kind == SymbolKind.Parameter); 1333Debug.Assert(documentedParameters != null); 1346Debug.Assert(referencedSymbol.Kind == SymbolKind.TypeParameter); 1347Debug.Assert(documentedTypeParameters != null); 1396Debug.Assert(_indentDepth >= 0); 1454Debug.Assert(depth >= 0); 1470Debug.Assert(false, "Didn't expect nesting to reach depth " + depth); 1505Debug.Assert(false, "If we hit this, then we might need to think about a different workaround " +
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (18)
104Debug.Assert(sourceIncludeElementNodes.All(syntax => syntax.SyntaxTree.Options.DocumentationMode < DocumentationMode.Diagnose), 135Debug.Assert(expander._nextSourceIncludeElementIndex == expander._sourceIncludeElementNodes.Length); 149Debug.Assert(nodes != null); 165Debug.Assert(builder == null || builder.All(node => node.Parent == null)); 193Debug.Assert(commentMessage == null, "How did we get an error comment for a non-container?"); 269Debug.Assert(originatingSyntax != null); 351Debug.Assert(doc != null); 458Debug.Assert(_inProgressIncludeElementNodes != null); 460Debug.Assert(result); 476Debug.Assert(_nextSourceIncludeElementIndex < _sourceIncludeElementNodes.Length); 477Debug.Assert(originatingSyntax == null); 490Debug.Assert(location != null); 513Debug.Assert(memberDeclSyntax != null, 535Debug.Assert(memberDeclSyntax != null, 553Debug.Assert((object)containingSymbol != null); 622Debug.Assert(leadingTrivia.Count == 1); 625Debug.Assert(structure.Content.Count == 2); 627Debug.Assert(elementSyntax.Attributes.Count == 1);
Compiler\MethodBodySynthesizer.cs (14)
37Debug.Assert((object)constructor.ContainingType.BaseTypeNoUseSiteDiagnostics == null || constructor.ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 90Debug.Assert(submissionConstructor.ParameterCount == 1); 99Debug.Assert(slotIndex >= 0); 145Debug.Assert(targetSubmissionIndex >= 0); 178Debug.Assert(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet); 199Debug.Assert(accessor.MethodKind == MethodKind.PropertySet); 219Debug.Assert(eventSymbol.HasAssociatedField); 239Debug.Assert((object)accessor != null); 242Debug.Assert((object)field != null); 245Debug.Assert(fieldType.Name == "EventRegistrationTokenTable"); 255Debug.Assert(diagnostics.DiagnosticBag is null || diagnostics.HasAnyErrors()); 273Debug.Assert(diagnostics.DiagnosticBag is null || diagnostics.HasAnyErrors()); 534Debug.Assert(method.MethodKind == MethodKind.Destructor); 535Debug.Assert(syntax.Kind() == SyntaxKind.Block || syntax.Kind() == SyntaxKind.ArrowExpressionClause);
Compiler\MethodBodySynthesizer.Lowered.cs (3)
328Debug.Assert(this.Arity == methodBeingWrapped.Arity); 361Debug.Assert(system_Int32.SpecialType == SpecialType.System_Int32); 404Debug.Assert(fields.Count > 0);
Compiler\MethodCompiler.cs (72)
90Debug.Assert(compilation != null); 91Debug.Assert(diagnostics != null); 92Debug.Assert(diagnostics.DiagnosticBag != null); 93Debug.Assert(diagnostics.DependenciesBag == null || diagnostics.DependenciesBag is ConcurrentSet<AssemblySymbol>); 119Debug.Assert(compilation != null); 120Debug.Assert(diagnostics != null); 121Debug.Assert(diagnostics.DiagnosticBag != null); 228Debug.Assert(diagnostics.DiagnosticBag != null); 232Debug.Assert(!entryPointAndDiagnostics.Diagnostics.Diagnostics.IsDefault); 295Debug.Assert(lazyVariableSlotAllocator is null); 296Debug.Assert(stateMachineTypeOpt is null); 297Debug.Assert(codeCoverageSpans.IsEmpty); 298Debug.Assert(lambdaDebugInfoBuilder.IsEmpty); 299Debug.Assert(lambdaRuntimeRudeEditsBuilder.IsEmpty); 300Debug.Assert(closureDebugInfoBuilder.IsEmpty); 301Debug.Assert(stateMachineStateDebugInfoBuilder.IsEmpty); 363Debug.Assert(_moduleBeingBuiltOpt != null); 476Debug.Assert((object)scriptCtor != null); 477Debug.Assert((object)scriptInitializer != null); 530Debug.Assert(scriptCtorOrdinal == -1); 531Debug.Assert((object)scriptCtor == method); 603Debug.Assert(containingType.IsScriptClass == (scriptCtorOrdinal >= 0)); 622Debug.Assert(processedStaticInitializers.BoundInitializers.All((init) => 662Debug.Assert(scriptCtorOrdinal >= 0); 692Debug.Assert(_moduleBeingBuiltOpt != null); 701Debug.Assert(method.SynthesizesLoweredBoundBody); 712Debug.Assert(diagnostics.DiagnosticBag != null); 735Debug.Assert(_moduleBeingBuiltOpt != null); 736Debug.Assert(compilationState.ModuleBuilderOpt == _moduleBeingBuiltOpt); 793Debug.Assert((object)iteratorStateMachine == null || (object)asyncStateMachine == null); 841Debug.Assert(emittedBody is null); 870Debug.Assert(synthesizedExplicitImpl.SynthesizesLoweredBoundBody); 880Debug.Assert(!discardedDiagnostics.HasAnyErrors()); 896Debug.Assert(synthesizedAccessor.SynthesizesLoweredBoundBody); 899Debug.Assert(!discardedDiagnostics.HasAnyErrors()); 941Debug.Assert(!methodSymbol.SynthesizesLoweredBoundBody); 1012Debug.Assert(methodSymbol.IsImplicitlyDeclared); 1017Debug.Assert(methodSymbol.IsImplicitlyDeclared); 1072Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || originalBodyNested); 1073Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType()); 1131Debug.Assert(importChain == null); 1135Debug.Assert(processedInitializers.BoundInitializers.IsDefaultOrEmpty || processedInitializers.FirstImportChain != null); 1184Debug.Assert(rootSyntax == forSemanticModel.Syntax); 1246Debug.Assert(loweredBodyOpt != null); 1260Debug.Assert(!(methodSymbol.IsImplicitInstanceConstructor && methodSymbol.ParameterCount == 0) || 1303Debug.Assert(!instrumentation.Kinds.Contains(InstrumentationKind.TestCoverage)); 1323Debug.Assert(initializerCodeCoverageSpans.IsEmpty); 1328Debug.Assert(initializerStateMachineTypeOpt is null); 1329Debug.Assert(!hasErrors); 1423Debug.Assert(_diagnostics.DiagnosticBag != null); 1424Debug.Assert(_moduleBeingBuiltOpt != null); 1499Debug.Assert(compilationState.ModuleBuilderOpt != null); 1618Debug.Assert(iteratorStateMachine is null || asyncStateMachine is null); 1655Debug.Assert(!diagnostics.HasAnyErrors(), "Running code generator when errors exist might be dangerous; code generator not expecting errors"); 1662Debug.Assert(diagnosticsForThisMethod.DiagnosticBag != null); 1685Debug.Assert(kickoffMethod != null); 1757Debug.Assert(method.IsAsync || method.IsIterator); 1759Debug.Assert(!diagnostics.HasAnyErrors()); 1827Debug.Assert(index >= 0); 1838Debug.Assert(index >= 0 && field.SlotDebugInfo.SynthesizedKind.IsLongLived()); 1925Debug.Assert(!sourceMethod.IsDefaultValueTypeConstructor()); 1961Debug.Assert(diagnostics.DiagnosticBag != null); 1997Debug.Assert(IsEmptyRewritePossible(methodBody)); 1998Debug.Assert(WasPropertyBackingFieldAccessChecked.FindUncheckedAccess(methodBody) is null); 2028Debug.Assert(constructor.Initializer is null); 2029Debug.Assert(constructor.Locals.IsEmpty); 2030Debug.Assert(BindImplicitConstructorInitializerIfAny(method, compilationState, BindingDiagnosticBag.Discarded) is null); 2038Debug.Assert(body != null); 2078Debug.Assert(diagnostics.AccumulatesDiagnostics); 2328Debug.Assert(false); 2497Debug.Assert(!method.ContainingType.IsDelegateType()); 2511Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
Compiler\SynthesizedMetadataCompiler.cs (2)
31Debug.Assert(moduleBeingBuilt != null); 46Debug.Assert(moduleBeingBuilt != null);
Compiler\TypeCompilationState.cs (2)
98Debug.Assert(_typeOpt is { }); 125Debug.Assert(_synthesizedMethods == null);
Declarations\DeclarationTable.cs (1)
76Debug.Assert(compilation.Declarations == this);
Declarations\DeclarationTreeBuilder.cs (6)
130Debug.Assert( 243Debug.Assert(nameLocation.SourceTree is not null); 268Debug.Assert(_syntaxTree.Options.Kind != SourceCodeKind.Regular); 328Debug.Assert(parent.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind != SourceCodeKind.Regular); 560Debug.Assert(node.Parent is CompilationUnitSyntax); 570Debug.Assert(node is NamespaceDeclarationSyntax);
Declarations\MergedNamespaceDeclaration.cs (2)
182Debug.Assert(namespaces.Count > 0); 209Debug.Assert(namespaces.Count > 0);
Declarations\RootSingleNamespaceDeclaration.cs (1)
43Debug.Assert(!referenceDirectives.IsDefault);
Declarations\SingleTypeDeclaration.cs (1)
91Debug.Assert(kind != DeclarationKind.Namespace);
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (2)
159Debug.Assert(containingSymbol is NamedTypeSymbol); 243Debug.Assert(_inParameterOrReturnType);
Emitter\EditAndContinue\CSharpDefinitionMap.cs (4)
62Debug.Assert(stateMachineType.ContainingAssembly is PEAssemblySymbol); 123Debug.Assert(!handle.IsNil); 127Debug.Assert(result.Length == localInfos.Length); 217Debug.Assert(name.Length >= closeBracketOffset + 1);
Emitter\EditAndContinue\CSharpSymbolMatcher.cs (44)
66Debug.Assert( 155Debug.Assert((object)symbol.ContainingAssembly != (object)_otherAssembly); 190Debug.Assert(symbol.IsDefinition); 275Debug.Assert(@namespace.IsGlobalNamespace); 333Debug.Assert(sourceType.IsDefinition); 348Debug.Assert((object)otherContainer == (object)_otherAssembly.GlobalNamespace); 354Debug.Assert((object)otherContainer == (object)_otherAssembly.GlobalNamespace); 495Debug.Assert(delegateTemplate.DelegateInvokeMethod != null); 509Debug.Assert(otherDelegateType is not null); 523Debug.Assert(type.Arity == otherType.Arity); 563Debug.Assert(!string.IsNullOrEmpty(sourceMember.MetadataName)); 583Debug.Assert(type.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 584Debug.Assert(other.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 592Debug.Assert(StringOrdinalComparer.Equals(@event.Name, other.Name)); 601Debug.Assert(StringOrdinalComparer.Equals(field.Name, other.Name)); 607Debug.Assert(StringOrdinalComparer.Equals(method.Name, other.Name)); 609Debug.Assert(method.IsDefinition); 610Debug.Assert(other.IsDefinition); 623Debug.Assert(method.IsDefinition); 637Debug.Assert(StringOrdinalComparer.Equals(type.MetadataName, other.MetadataName)); 640Debug.Assert(type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 641Debug.Assert(other.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 648Debug.Assert(type.IsDefinition); 662Debug.Assert(StringOrdinalComparer.Equals(@namespace.MetadataName, other.MetadataName)); 668Debug.Assert(parameter.Ordinal == other.Ordinal); 678Debug.Assert(type.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 679Debug.Assert(other.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 710Debug.Assert(type.CustomModifiers.IsEmpty); 711Debug.Assert(verifyRefModifiers(refCustomModifiers, refKind, allowOut)); 715Debug.Assert(RefKind.RefReadOnly == RefKind.In); 729Debug.Assert(StringOrdinalComparer.Equals(property.MetadataName, other.MetadataName)); 740Debug.Assert(type.Ordinal == other.Ordinal); 741Debug.Assert(StringOrdinalComparer.Equals(type.Name, other.Name)); 745Debug.Assert(type.HasConstructorConstraint == other.HasConstructorConstraint); 746Debug.Assert(type.HasValueTypeConstraint == other.HasValueTypeConstraint); 747Debug.Assert(type.AllowsRefLikeType == other.AllowsRefLikeType); 748Debug.Assert(type.HasUnmanagedTypeConstraint == other.HasUnmanagedTypeConstraint); 749Debug.Assert(type.HasReferenceTypeConstraint == other.HasReferenceTypeConstraint); 750Debug.Assert(type.ConstraintTypesNoUseSiteDiagnostics.Length == other.ConstraintTypesNoUseSiteDiagnostics.Length); 756Debug.Assert(type.CustomModifiers.IsDefaultOrEmpty); 757Debug.Assert(other.CustomModifiers.IsDefaultOrEmpty); 831Debug.Assert(matcher != null); 906Debug.Assert(type.IsDefinition); 965Debug.Assert((object)translatedType != null);
Emitter\EditAndContinue\EmitHelpers.cs (1)
80Debug.Assert(baseline.PEModuleBuilder != null);
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (3)
88Debug.Assert(visited is not null); 244Debug.Assert(EmitOptions.InstrumentationKinds.IsEmpty); 257Debug.Assert(Compilation == template.DeclaringCompilation);
Emitter\Model\AssemblyReference.cs (1)
25Debug.Assert((object)assemblySymbol != null);
Emitter\Model\AttributeDataAdapter.cs (4)
30Debug.Assert(argument.Kind != TypedConstantKind.Error); 121Debug.Assert(!argument.Values.IsDefault); 145Debug.Assert(argument.ValueInternal != null); 193Debug.Assert(false, "Name does not match an attribute field or a property. How can that be?");
Emitter\Model\ExpandedVarargsMethodReference.cs (5)
27Debug.Assert(underlyingMethod.AcceptsExtraArguments); 28Debug.Assert(!argListParams.IsEmpty); 66Debug.Assert(_underlyingMethod.AsGenericMethodInstanceReference == _underlyingMethod); 80Debug.Assert(_underlyingMethod.AsSpecializedMethodReference == _underlyingMethod); 211Debug.Assert(!(value is ISymbol));
Emitter\Model\FieldSymbolAdapter.cs (5)
65Debug.Assert(this.IsDefinitionOrDistinct()); 80Debug.Assert(this.IsDefinitionOrDistinct()); 95Debug.Assert(this.IsDefinitionOrDistinct()); 105Debug.Assert(this.IsDefinitionOrDistinct()); 293Debug.Assert(!AdaptedFieldSymbol.IsDefinition);
Emitter\Model\GenericMethodInstanceReference.cs (1)
36Debug.Assert(arg.CustomModifiers.IsEmpty);
Emitter\Model\GenericTypeInstanceReference.cs (3)
28Debug.Assert(underlyingNamedType.IsDefinition); 30Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any())); 52System.Diagnostics.Debug.Assert(UnderlyingNamedType.OriginalDefinition.IsDefinition);
Emitter\Model\MethodReference.cs (1)
21Debug.Assert((object)underlyingMethod != null);
Emitter\Model\MethodSymbolAdapter.cs (19)
39Debug.Assert(this.IsDefinitionOrDistinct()); 55Debug.Assert(this.IsDefinitionOrDistinct()); 60Debug.Assert((object)AdaptedMethodSymbol.ContainingType != null && 76Debug.Assert(this.IsDefinitionOrDistinct()); 105Debug.Assert(this.IsDefinitionOrDistinct()); 111Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 116Debug.Assert(((Cci.IMethodReference)this).AsSpecializedMethodReference != null); 125Debug.Assert(((Cci.IMethodReference)this).GetResolvedMethod(visitor.Context) != null); 171Debug.Assert(this.IsDefinitionOrDistinct()); 177Debug.Assert((object)AdaptedMethodSymbol.PartialDefinitionPart == null); // must be definition 202Debug.Assert(this.IsDefinitionOrDistinct()); 217Debug.Assert(AdaptedMethodSymbol.Parameters.All(p => p.IsDefinition)); 261Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 265Debug.Assert(arg.CustomModifiers.IsEmpty); 274Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 297Debug.Assert(((Cci.IMethodReference)this).AsSpecializedMethodReference != null); 359Debug.Assert(@param.IsDefinition); 379Debug.Assert(AdaptedMethodSymbol.HasDeclarativeSecurity); 671Debug.Assert(this.MethodKind != MethodKind.Destructor);
Emitter\Model\ModuleReference.cs (2)
25Debug.Assert(moduleBeingBuilt != null); 26Debug.Assert((object)underlyingModule != null);
Emitter\Model\NamedTypeReference.cs (1)
23Debug.Assert((object)underlyingNamedType != null);
Emitter\Model\NamedTypeSymbolAdapter.cs (34)
64Debug.Assert(this.IsDefinitionOrDistinct()); 98Debug.Assert(this.IsDefinitionOrDistinct()); 119Debug.Assert(this.IsDefinitionOrDistinct()); 135Debug.Assert(this.IsDefinitionOrDistinct()); 171Debug.Assert(this.IsDefinitionOrDistinct()); 187Debug.Assert(this.IsDefinitionOrDistinct()); 192Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null && 210Debug.Assert(this.IsDefinitionOrDistinct()); 290Debug.Assert(((Cci.ITypeReference)this).AsTypeDefinition(context) != null); 296Debug.Assert((object)baseType == null); 331Debug.Assert((object)method.PartialDefinitionPart == null); // must be definition 392Debug.Assert(body.ContainingType == (object)container); 412Debug.Assert((object)method.PartialDefinitionPart == null); // must be definition 419Debug.Assert(!method.RequiresExplicitOverride(out _)); 434Debug.Assert((object)(f.TupleUnderlyingField ?? f) == f); 435Debug.Assert(!(f is TupleErrorFieldSymbol)); 486Debug.Assert(((Cci.ITypeReference)this).AsTypeDefinition(context) != null); 632Debug.Assert((object)method != null); 693Debug.Assert((object)property != null); 812Debug.Assert(AdaptedNamedTypeSymbol.IsErrorType() || 824Debug.Assert(((Cci.ITypeReference)this).AsNamespaceTypeReference != null); 834Debug.Assert(((Cci.ITypeReference)this).AsNamespaceTypeReference != null); 844Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType == null && AdaptedNamedTypeSymbol.ContainingModule is SourceModuleSymbol); 854Debug.Assert(((Cci.ITypeReference)this).AsNestedTypeReference != null); 856Debug.Assert(this.IsDefinitionOrDistinct()); 868Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null); 879Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null); 890Debug.Assert(((Cci.ITypeReference)this).AsGenericTypeInstanceReference != null); 911Debug.Assert(((Cci.ITypeReference)this).AsGenericTypeInstanceReference != null); 924Debug.Assert(((Cci.ITypeReference)this).AsSpecializedNestedTypeReference != null); 927Debug.Assert(result != null); 941Debug.Assert(this is not SynthesizedPrivateImplementationDetailsType); 981Debug.Assert(this.IsDefinition); 982Debug.Assert(this.ContainingModule is SourceModuleSymbol);
Emitter\Model\ParameterSymbolAdapter.cs (1)
191Debug.Assert(this.IsDefinitionOrDistinct());
Emitter\Model\ParameterTypeInformation.cs (1)
22Debug.Assert((object)underlyingParameter != null);
Emitter\Model\PEAssemblyBuilder.cs (6)
80Debug.Assert(sourceAssembly is object); 548Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 672Debug.Assert(!allowUserDefinedAttribute || typeof(T) == typeof(NamedTypeSymbol)); 693Debug.Assert(symbol.Constructors.Length == description.Signatures.Length); 707Debug.Assert(userDefinedAttribute is null || (object)userDefinedAttribute.ContainingModule == _sourceAssembly.SourceModule); 708Debug.Assert(userDefinedAttribute?.IsErrorType() != true);
Emitter\Model\PEModuleBuilder.cs (76)
77Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 256Debug.Assert(debugDocuments.Count == 0); 257Debug.Assert(methodDocumentList.Count == 0); 258Debug.Assert(typesToProcess.Count == 0); 481Debug.Assert(Compilation == compilation, "How did we get symbol from different compilation?"); 530Debug.Assert(Compilation == template.DeclaringCompilation); 538Debug.Assert(Compilation == template.DeclaringCompilation); 591Debug.Assert(symbol.IsDefinition); 607Debug.Assert(namespaceOrType is PENamespaceSymbol or PENamedTypeSymbol); 624Debug.Assert(!groupingTypes.IsEmpty); 660Debug.Assert(HaveDeterminedTopLevelTypes); 693Debug.Assert(OutputKind.IsNetModule() == sourceAssembly.DeclaringCompilation.Options.OutputKind.IsNetModule()); 724Debug.Assert(exportedType.Type.AsGenericTypeInstanceReference is null); 725Debug.Assert(exportedType.Type.AsSpecializedNestedTypeReference is null); 735Debug.Assert(type.IsDefinition); 736Debug.Assert(type.IsTopLevelType()); 766Debug.Assert(contender.ContainingAssembly == sourceAssembly); 795Debug.Assert(builder is null || contextOpt is not null); 813Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?"); 821Debug.Assert(contextOpt is not null); 826Debug.Assert(stack.Count == 0); 843Debug.Assert(type is { ContainingModule: SourceModuleSymbol } or PENamedTypeSymbol or RetargetingNamedTypeSymbol); 869Debug.Assert(!groupingTypes.IsEmpty); 968Debug.Assert(diagnostics != null); 1113Debug.Assert(namedTypeSymbol.IsDefinitionOrDistinct()); 1114Debug.Assert(diagnostics != null); 1119Debug.Assert(!needDeclaration); 1152Debug.Assert(!needDeclaration); 1200Debug.Assert((object)container != null); 1219Debug.Assert(namedTypeSymbol.IsDefinition); 1292Debug.Assert(diagnostics != null); 1325Debug.Assert(fieldSymbol.IsDefinitionOrDistinct()); 1326Debug.Assert(!fieldSymbol.IsVirtualTupleField && 1332Debug.Assert(!needDeclaration); 1367Debug.Assert(!methodSymbol.IsDefaultValueTypeConstructor()); 1368Debug.Assert(optArgList == null || (methodSymbol.IsVararg && !needDeclaration)); 1407Debug.Assert(!needDeclaration); 1411Debug.Assert(methodSymbol.IsDefinitionOrDistinct()); 1415Debug.Assert(!needDeclaration); 1416Debug.Assert(!(methodSymbol.OriginalDefinition is NativeIntegerMethodSymbol)); 1417Debug.Assert(!(methodSymbol.ConstructedFrom is NativeIntegerMethodSymbol)); 1447Debug.Assert(typeIsGeneric); 1501Debug.Assert(methodSymbol.IsDefinition); 1518Debug.Assert(@params.All(p => p.IsDefinitionOrDistinct())); 1521Debug.Assert(@params.All(p => mustBeTranslated == MustBeWrapped(p)), "either all or no parameters need translating"); 1733Debug.Assert(flagsBuilder.All(f => f <= 2)); 1802Debug.Assert((object)type != null); 1803Debug.Assert(type.ContainsNativeIntegerWrapperType()); 1804Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 1815Debug.Assert(builder.Any()); 1816Debug.Assert(builder.Contains(true)); 1826Debug.Assert((object)booleanType != null); 1839Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 1848Debug.Assert(scope != ScopedKind.None); 1849Debug.Assert(!ParameterHelpers.IsRefScopedByDefault(symbol) || scope == ScopedKind.ScopedValue); 1850Debug.Assert(!symbol.IsThis); 1953Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 1954Debug.Assert(diagnosticsOpt is null || attribute == EmbeddableAttributes.ParamCollectionAttribute, "Don't report any errors. They should be reported during binding."); 1999Debug.Assert(Compilation.ShouldEmitNativeIntegerAttributes()); 2032Debug.Assert(methodAdapter.Name == methodName); 2037Debug.Assert(methodSymbol.Name == methodName); 2099Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 2116Debug.Assert(Compilation.Assembly.RuntimeSupportsInlineArrayTypes); 2117Debug.Assert(arrayLength > 0); 2118Debug.Assert(diagnostics.DiagnosticBag is not null); 2124Debug.Assert(arrayWellKnownType is >= WellKnownType.System_Runtime_CompilerServices_InlineArray2 and <= WellKnownType.System_Runtime_CompilerServices_InlineArray16); 2134Debug.Assert(attributeConstructor is { }); 2145Debug.Assert(syntaxNode is { }); 2146Debug.Assert(diagnostics is { }); 2170Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 2187Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 2203Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 2315Debug.Assert(container is not NamedTypeSymbol { IsExtension: true } || nestedType.GetInternalSymbol() is FixedFieldImplementationType); 2321Debug.Assert(container is not NamedTypeSymbol { IsExtension: true }); 2327Debug.Assert(container is not NamedTypeSymbol { IsExtension: true }); 2333Debug.Assert(container is not NamedTypeSymbol { IsExtension: true });
Emitter\Model\PropertySymbolAdapter.cs (2)
145Debug.Assert(AdaptedPropertySymbol.IsDefinition); 148Debug.Assert(AdaptedPropertySymbol.ContainingModule is SourceModuleSymbol || AdaptedPropertySymbol.ContainingAssembly.IsLinked);
Emitter\Model\SpecializedFieldReference.cs (2)
26Debug.Assert((object)underlyingField != null); 48Debug.Assert(_underlyingField.OriginalDefinition.IsDefinition);
Emitter\Model\SpecializedGenericMethodInstanceReference.cs (2)
27Debug.Assert(PEModuleBuilder.IsGenericType(underlyingMethod.ContainingType) && underlyingMethod.ContainingType.IsDefinition); 37Debug.Assert(arg.CustomModifiers.IsEmpty);
Emitter\Model\SpecializedGenericNestedTypeInstanceReference.cs (3)
27Debug.Assert(underlyingNamedType.IsDefinition); 29Debug.Assert(!underlyingNamedType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Any(static a => a.CustomModifiers.Any())); 51System.Diagnostics.Debug.Assert(UnderlyingNamedType.OriginalDefinition.IsDefinition);
Emitter\Model\SpecializedNestedTypeReference.cs (2)
28Debug.Assert(UnderlyingNamedType.OriginalDefinition.IsDefinition); 32Debug.Assert(result != null);
Emitter\Model\SymbolAdapter.cs (5)
65Debug.Assert(this.IsDefinition); 68Debug.Assert(this.ContainingModule is SourceModuleSymbol || 89Debug.Assert(this.Kind != SymbolKind.Assembly); 96Debug.Assert(this.Kind != SymbolKind.Assembly); 144Debug.Assert(attribute.ShouldEmitAttribute(this, isReturnType, emittingAssemblyAttributesInNetModule));
Emitter\Model\TypeParameterSymbolAdapter.cs (6)
78Debug.Assert(AdaptedTypeParameterSymbol.IsDefinition); 113Debug.Assert(AdaptedTypeParameterSymbol.IsDefinition); 200Debug.Assert(AdaptedTypeParameterSymbol.IsDefinition); 221Debug.Assert(AdaptedTypeParameterSymbol.IsDefinition); 230Debug.Assert(AdaptedTypeParameterSymbol.IsDefinition); 262Debug.Assert(!type.NullableAnnotation.IsAnnotated());
Emitter\NoPia\EmbeddedMethod.cs (1)
129Debug.Assert(!isMetadataFinal);
Emitter\NoPia\EmbeddedParameter.cs (1)
28Debug.Assert(underlyingParameter.AdaptedParameterSymbol.IsDefinition);
Emitter\NoPia\EmbeddedType.cs (5)
32Debug.Assert(underlyingNamedType.AdaptedNamedTypeSymbol.IsDefinition); 33Debug.Assert(underlyingNamedType.AdaptedNamedTypeSymbol.IsTopLevelType()); 34Debug.Assert(!underlyingNamedType.AdaptedNamedTypeSymbol.IsGenericType); 39Debug.Assert(UnderlyingNamedType.AdaptedNamedTypeSymbol.IsInterfaceType()); 125Debug.Assert((object)TypeManager.ModuleBeingBuilt == context.Module);
Emitter\NoPia\EmbeddedTypeParameter.cs (1)
24Debug.Assert(underlyingTypeParameter.AdaptedTypeParameterSymbol.IsDefinition);
Emitter\NoPia\EmbeddedTypesManager.cs (20)
226Debug.Assert(!IsFrozen); // After we freeze the set of types, we might add additional assemblies into this map without actual guid values. 235Debug.Assert(guidString == null); 275Debug.Assert(IsFrozen); 406Debug.Assert(namedType.IsDefinition); 407Debug.Assert(ModuleBeingBuilt.SourceModule.AnyReferencedAssembliesAreLinked); 423Debug.Assert(namedType.IsDefinition); 444Debug.Assert(!IsFrozen, "Set of embedded types is frozen."); 453Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 489Debug.Assert(field.AdaptedSymbol.IsDefinition); 501Debug.Assert(!IsFrozen, "Set of embedded fields is frozen."); 525Debug.Assert(method.AdaptedSymbol.IsDefinition); 526Debug.Assert(!method.AdaptedMethodSymbol.IsDefaultValueTypeConstructor()); 538Debug.Assert(!IsFrozen, "Set of embedded methods is frozen."); 586Debug.Assert(property.AdaptedPropertySymbol.IsDefinition); 605Debug.Assert(!IsFrozen, "Set of embedded properties is frozen."); 621Debug.Assert(@event.AdaptedSymbol.IsDefinition); 645Debug.Assert(!IsFrozen, "Set of embedded events is frozen."); 658Debug.Assert(member.AdaptedSymbol.IsDefinition); 659Debug.Assert(ModuleBeingBuilt.SourceModule.AnyReferencedAssembliesAreLinked); 689Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Errors\CSDiagnosticInfo.cs (1)
42Debug.Assert(code != ErrorCode.ERR_InternalError);
Errors\LazyMissingNonNullTypesContextDiagnosticInfo.cs (2)
24Debug.Assert(type.HasType); 63Debug.Assert(questionToken.SyntaxTree != null);
Errors\LazyObsoleteDiagnosticInfo.cs (3)
20Debug.Assert(symbol is Symbol || symbol is TypeWithAnnotations); 46Debug.Assert(kind != ObsoleteDiagnosticKind.Lazy); 47Debug.Assert(kind != ObsoleteDiagnosticKind.LazyPotentiallySuppressed);
Errors\LazyUnmanagedCallersOnlyMethodCalledDiagnosticInfo.cs (2)
36Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyAttributeData, UnmanagedCallersOnlyAttributeData.Uninitialized)); 37Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyAttributeData, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound));
Errors\MessageID.cs (1)
488Debug.Assert(RequiredFeature(feature) == null);
Errors\SyntaxDiagnosticInfo.cs (1)
34Debug.Assert(width >= 0);
FlowAnalysis\AbstractFlowPass.cs (43)
140Debug.Assert(newState != null); 190Debug.Assert(node != null); 199Debug.Assert(firstInRegion != null); 200Debug.Assert(lastInRegion != null); 204Debug.Assert(length >= 0, "last comes before first"); 272Debug.Assert(this.regionPlace == RegionPlace.Before); 289Debug.Assert(IsInside); 299Debug.Assert(span.Length > 0); 538Debug.Assert(_labelsSeen.Count == 0); 673Debug.Assert(!this.IsConditionalState); 827Debug.Assert(!this.IsConditionalState); 923Debug.Assert(!IsConditionalState); 926Debug.Assert(node.Pattern is 932Debug.Assert(negated == node.IsNegated); 936Debug.Assert(!IsConditionalState); 999Debug.Assert(binaryPatterns.Peek().Left is not BoundBinaryPattern); 1040Debug.Assert(binaryPatterns.Peek().Left is not BoundBinaryPattern); 1189Debug.Assert(shortCircuitState != null); 1519Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction); 1657Debug.Assert(node is not BoundTypeOrValueExpression, "The Binder is expected to resolve the member access in the most appropriate way, even in an error scenario."); 2205Debug.Assert(node.HasAnyErrors || (object)readMethod != (object)GetWriteMethod(property)); 2396Debug.Assert(!node.OperatorKind.IsUserDefined()); 2438Debug.Assert(!binOp.OperatorKind.IsUserDefined()); 2462Debug.Assert(stack.Count > 0); 2506Debug.Assert(!isBool || binary.Kind != BoundKind.UserDefinedConditionalLogicalOperator); 2508Debug.Assert(isAnd || op == BinaryOperatorKind.Or); 2715Debug.Assert(node.InterpolatedStringHandlerData.HasValue); 2728Debug.Assert(parts.Count >= 2); 2754Debug.Assert(shortCircuitState != null || (!usesBoolReturns && !firstPartIsConditional)); 2778Debug.Assert(shortCircuitState != null); 2842Debug.Assert(node.HasAnyErrors || (object)readMethod != (object)writeMethod); 2938Debug.Assert(!IsConditionalState); 2974Debug.Assert(!IsConditionalState); 3019Debug.Assert(!IsConditionalState); 3045Debug.Assert(method is object); 3046Debug.Assert(method.ParameterCount is 1); 3118Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion)); 3129Debug.Assert(expr is BoundExpression); 3258Debug.Assert(!this.IsConditionalState); 3266Debug.Assert(!this.IsConditionalState); 3369Debug.Assert(!this.IsConditionalState); 3466Debug.Assert(!this.IsConditionalState); 3581Debug.Assert(this.IsConditionalState);
FlowAnalysis\AlwaysAssignedWalker.cs (1)
52Debug.Assert(!IsInside);
FlowAnalysis\ControlFlowPass.cs (3)
83Debug.Assert(!self.Alive || !self.Reported); 92Debug.Assert(!self.Alive || !self.Reported); 166Debug.Assert(!badRegion);
FlowAnalysis\DefiniteAssignment.cs (32)
245Debug.Assert(member is TypeSymbol type && 249Debug.Assert((object)member.ContainingAssembly == compilation?.SourceAssembly); 289Debug.Assert(variableId.Symbol.Kind == SymbolKind.Field || variableId.Symbol.Kind == SymbolKind.Property || variableId.Symbol.Kind == SymbolKind.Event, 315Debug.Assert( 417Debug.Assert(node != null || location != null); 431Debug.Assert(thisSlot > 0); 492Debug.Assert(!parameter.IsThis); 509Debug.Assert(diagnostics != null); 523Debug.Assert(unused.IsDefault); 575Debug.Assert(newCode != oldCode || oldCode == ErrorCode.ERR_InsufficientStack, oldCode.ToString()); 602Debug.Assert(walker.TrackImplicitlyInitializedFields); 612Debug.Assert(!badRegion); 623Debug.Assert(strictAnalysis || implicitlyInitializedFieldsOpt.IsDefault); 644Debug.Assert(captured.Kind == SymbolKind.Parameter || captured.Kind == SymbolKind.Local || captured.Kind == SymbolKind.RangeVariable); 737Debug.Assert(fieldOrEventAccess.Kind == BoundKind.FieldAccess || fieldOrEventAccess.Kind == BoundKind.EventAccess); 1106Debug.Assert(!IsConditionalState); 1211Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1243Debug.Assert(foundUnassignedField); 1425Debug.Assert(unassignedSlot > 0); 1488Debug.Assert(!IsConditionalState); 1513Debug.Assert(local.InitializerOpt == value || value == null); 1642Debug.Assert(containingSlot != -1); 1643Debug.Assert(!state.IsAssigned(containingSlot)); 1682Debug.Assert(!_emptyStructTypeCache.IsEmptyStructType(type)); 1718Debug.Assert(!_emptyStructTypeCache.IsEmptyStructType(type)); 1899Debug.Assert(!this.IsConditionalState); 2230Debug.Assert(_usedVariables.Contains(local)); 2365Debug.Assert(target.LocalSymbol.Type is not null); 2372Debug.Assert(IsConditionalState); 2760Debug.Assert((object)iterationVariable != null); 2890Debug.Assert(!other.Reachable); 2909Debug.Assert(!assigned.IsNull);
FlowAnalysis\DefiniteAssignment.LocalFunctions.cs (3)
70Debug.Assert(!IsConditionalState); 97Debug.Assert(localFunc != null); 107Debug.Assert(!_emptyStructTypeCache.IsEmptyStructType(type));
FlowAnalysis\DefiniteAssignment.VariableIdentifier.cs (5)
27Debug.Assert(containingSlot >= 0); 28Debug.Assert(symbol.Kind switch 50Debug.Assert(Exists); 63Debug.Assert(Exists); 64Debug.Assert(other.Exists);
FlowAnalysis\EmptyStructTypeCache.cs (2)
55Debug.Assert(compilation != null || !dev12CompilerCompatibility); 105Debug.Assert(!Cache.ContainsKey(nts) || Cache[nts] == result);
FlowAnalysis\FlowAnalysisPass.cs (17)
41Debug.Assert(!hasTrailingExpression || method.IsScriptInitializer); 56Debug.Assert(!implicitlyInitializedFields.IsEmpty); 59Debug.Assert(method is not SourceMemberMethodSymbol { SyntaxNode: ConstructorDeclarationSyntax { Initializer: not null } } || block.HasErrors); 71Debug.Assert(unusedImplicitlyInitializedFields.IsDefault); 72Debug.Assert(needsImplicitReturn); 76Debug.Assert(method.MethodKind != MethodKind.AnonymousFunction); 82Debug.Assert(!submissionResultType.IsVoidType()); 92Debug.Assert(!Analyze(compilation, method, block, flowAnalysisDiagnostics, needsImplicitReturn: out _, out unusedImplicitlyInitializedFields)); 93Debug.Assert(unusedImplicitlyInitializedFields.IsDefault); 95Debug.Assert(getErrorsOnly(flowAnalysisDiagnostics.ToReadOnly()).SequenceEqual(getErrorsOnly(diagnostics.ToReadOnly().Diagnostics.Skip(initialDiagnosticCount)))); 115Debug.Assert(!implicitlyInitializedFields.IsEmpty); 116Debug.Assert(method.MethodKind == MethodKind.Constructor); 118Debug.Assert(containingType.IsStructType()); 128Debug.Assert(elementField == implicitlyInitializedFields.Single()); 192Debug.Assert(body != null); 193Debug.Assert(method != null); 197Debug.Assert(body.WasCompilerGenerated ||
FlowAnalysis\LocalDataFlowPass.cs (4)
42Debug.Assert(emptyStructs != null); 102Debug.Assert(containingSlot >= 0); 103Debug.Assert(symbol != null); 229Debug.Assert((receiver is null) != member.RequiresInstanceReceiver());
FlowAnalysis\NullableWalker_Patterns.cs (40)
38Debug.Assert(!IsConditionalState); 131Debug.Assert(current.Left is not BoundBinaryPattern); 400Debug.Assert(originalInputSlot > 0); 415Debug.Assert(isDerivedType(NominalSlotType(originalInputSlot), expressionTypeWithState.Type)); 426Debug.Assert(found); // the topologically sorted nodes should contain only reachable nodes 443Debug.Assert(inputSlot > 0); 464Debug.Assert(!IsConditionalState); 473Debug.Assert(outputSlot > 0); 478Debug.Assert(inputSlot > 0); 484Debug.Assert(outputSlot > 0); 498Debug.Assert(outputSlot > 0); 507Debug.Assert(outputSlot > 0); 517Debug.Assert(outputSlot > 0); 543Debug.Assert(foundTemp); 582Debug.Assert(t.Value != ConstantValue.Null); 659Debug.Assert(this.IsConditionalState); 665Debug.Assert(w.WhenFalse is null); 691Debug.Assert(inputSlot > 0); 704Debug.Assert(outputSlot > 0); 733Debug.Assert(inputSlot > 0); 763Debug.Assert(originalInputMap[outputSlot] == ((BoundTupleExpression)expression).Arguments[originalTupleElement.TupleElementIndex]); 772Debug.Assert(outputSlot > 0); 778Debug.Assert(inputSlot > 0); 787Debug.Assert(outputSlot > 0); 795Debug.Assert(outputSlot > 0); 802Debug.Assert(inputSlot > 0); 806Debug.Assert(outputSlot > 0); 813Debug.Assert(inputSlot > 0); 817Debug.Assert(outputSlot > 0); 856Debug.Assert(slot > 0); 860Debug.Assert(outputSlotAndType.slot == slot); 861Debug.Assert(isDerivedType(outputSlotAndType.type, type)); 865Debug.Assert(NominalSlotType(slot) is var slotType && (slotType.IsErrorType() || isDerivedType(slotType, type))); 897Debug.Assert(false); 902Debug.Assert(false); 907Debug.Assert(false); 936Debug.Assert(false); 1089Debug.Assert(reachabilityInfo is not null); 1160Debug.Assert((node is BoundUnconvertedSwitchExpression && (_returnTypesOpt is not null || _disableDiagnostics)) 1249Debug.Assert(!IsConditionalState);
FlowAnalysis\NullableWalker.cs (372)
82Debug.Assert(variables.Id == variableNullableStates.Id); 149Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything)); 166Debug.Assert(!StateForLambda.HasValue); 369Debug.Assert(TypeAllowsConditionalState(visitResult.RValueType.Type) 490Debug.Assert(_targetTypedAnalysisCompletionOpt is null or { Count: 0 }); 514Debug.Assert(!TrackingRegions); 515Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethodOpt is object); 516Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 584Debug.Assert(_resultForPlaceholdersOpt.Count == 0); 591Debug.Assert(AreCloseEnough(placeholder.Type, result.RValueType.Type)); 592Debug.Assert(expression != null || placeholder.Kind == BoundKind.InterpolatedStringArgumentPlaceholder); 601Debug.Assert(_resultForPlaceholdersOpt is { }); 603Debug.Assert(removed); 609Debug.Assert(placeholder is { }); 691Debug.Assert(_useConstructorExitWarnings); 1035Debug.Assert(requiredMember.IsRequired()); 1507Debug.Assert(node.SyntaxTree is object); 1553Debug.Assert(method.IsConstructor()); 1874Debug.Assert(diagnostics != null); 1875Debug.Assert(getterNullResilienceData is null || symbol is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet }); 1876Debug.Assert(getterNullResilienceData is null || !useConstructorExitWarnings); 1900Debug.Assert(!walker.IsConditionalState); 1918Debug.Assert(snapshotBuilderOpt is null || symbol is object); 1925Debug.Assert(walker._variables.Id == initialState.Value.Id); 1931Debug.Assert(!badRegion); 1952Debug.Assert(result.RequiredAnalysis == requiredAnalysis); 1968Debug.Assert(!IsConditionalState); 1991Debug.Assert(node is object); 2041Debug.Assert(slot > 0); 2136Debug.Assert(member?.RequiresInstanceReceiver() ?? true); 2155Debug.Assert(node.HasErrors || 2275Debug.Assert(containingSlot == 0); 2672Debug.Assert(!IsConditionalState); 2726Debug.Assert(ErrorFacts.NullableWarnings.Contains(MessageProvider.Instance.GetIdForErrorCode((int)errorCode))); 2735Debug.Assert(targetSlot > 0); 2736Debug.Assert(EmptyStructTypeCache.IsTrackableStructType(targetType)); 2762Debug.Assert(false, "If this assert fires, please add a unit test for the scenario."); 2778Debug.Assert(targetContainerSlot > 0); 2779Debug.Assert(skipSlot > 0); 2863Debug.Assert(slot > 0); 2884Debug.Assert(targetSlot > 0); 2888Debug.Assert(actualType is { }); 2896Debug.Assert(conversion.Kind is ConversionKind.Identity or ConversionKind.ImplicitReference); 2929Debug.Assert(false); 2957Debug.Assert(targetSlot > 0); 2958Debug.Assert(valueSlot > 0); 2966Debug.Assert(member.Kind == SymbolKind.Field || member.Kind == SymbolKind.Property || member.Kind == SymbolKind.Event); 3040Debug.Assert(!IsConditionalState); 3094Debug.Assert(!IsConditionalState); 3200Debug.Assert((object)returnType != LambdaSymbol.ReturnTypeIsBeingInferred); 3249Debug.Assert(node.Type.IsErrorType() || type.Type.IsErrorType()); 3281Debug.Assert(!TrackingRegions); 3348Debug.Assert(newBodiesVisited); 3438Debug.Assert((object?)variables.Container == container); 3450Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethod is object); 3451Debug.Assert(!useDelegateInvokeReturnType || delegateInvokeMethod is object); 3573Debug.Assert(!IsConditionalState); 3599Debug.Assert(!IsConditionalState); 3713Debug.Assert(!IsConditionalState); 3748Debug.Assert(type.Type.IsErrorType()); 3767Debug.Assert(node is BoundExpression or BoundPattern); 3768Debug.Assert(!IsConditionalState); 3785Debug.Assert((object?)resultType.Type != _invalidType.Type); 3786Debug.Assert(AreCloseEnough(resultType.Type, node.Type)); 3884Debug.Assert(!_completingTargetTypedExpression); 3993Debug.Assert(reinferenceResult.Completion != null); 4009Debug.Assert(collectionBuilderElementsPlaceholder != null); 4031Debug.Assert(reinferenceResult.Completion != null); 4052Debug.Assert(allTypeArguments.Length == call.Method.Arity, "Guaranteed by GetCollectionBuilderMethods"); 4091Debug.Assert(node.Placeholder is { }); 4095Debug.Assert(initializer.ArgsToParamsOpt.IsDefault); 4166Debug.Assert(completion is not null); 4180Debug.Assert(TypeSymbol.Equals(strippedTargetCollectionType, node.Type, TypeCompareKind.AllIgnoreOptions)); 4239Debug.Assert(foundIterationType); 4244Debug.Assert(!targetElementType.HasType); 4258Debug.Assert(node.ExpressionPlaceholder is { }); 4259Debug.Assert(node.EnumeratorInfoOpt is { }); 4271Debug.Assert(node.HasErrors); 4272Debug.Assert(node.Conversion is null); 4273Debug.Assert(node.EnumeratorInfoOpt is null); 4281Debug.Assert(!IsConditionalState); 4293Debug.Assert(isTargetTyped == argumentsCompletion is not null); 4324Debug.Assert(argumentsCompletion is not null); 4325Debug.Assert(initialStateInferenceCompletion is not null); 4330Debug.Assert(argumentsCompletion is null); 4331Debug.Assert(initialStateInferenceCompletion is null); 4332Debug.Assert(initializerCompletion is null); 4348Debug.Assert(resultState == NullableFlowState.NotNull); 4353Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4391Debug.Assert(node.Kind is BoundKind.ObjectCreationExpression or BoundKind.DynamicObjectCreationExpression or BoundKind.NewT or BoundKind.NoPiaObjectCreationExpression); 4482Debug.Assert(completion is null); 4483Debug.Assert(resultState == NullableFlowState.NotNull); 4491Debug.Assert(containingSlot > 0); 4505Debug.Assert(iUnionValuePropertySlot > 0); 4518Debug.Assert(!delayCompletionForType || containingSlot == -1); 4568Debug.Assert(!delayCompletionForType || containingSlot == -1); 4608Debug.Assert(symbol is not null); 4631Debug.Assert(argumentsCompletion is null); 4632Debug.Assert(initializationCompletion is null); 4642Debug.Assert(objectInitializer.MemberSymbol is not null); 4660Debug.Assert(argumentResults[0].LValueType.Type.Equals(containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4669Debug.Assert(initializationCompletion is null || symbol is not null); 4673Debug.Assert(result is null); 4685Debug.Assert(!delayCompletionForType || slot == -1); 4701Debug.Assert(nestedCompletion is null); 4726Debug.Assert(!delayCompletionForType || conversionCompletion is null); 4733Debug.Assert(GetTypeOrReturnTypeWithAnnotations(symbol).HasType); 4745Debug.Assert(conversionCompletion is not null); 4749Debug.Assert(conversionCompletion is null); 4762Debug.Assert(result is null); 4779Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4807Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4854Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4855Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4871Debug.Assert(visitArgumentsCompletion is not null); 4875Debug.Assert(visitArgumentsCompletion is null); 4876Debug.Assert(reinferredMethod is object); 4912Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4913Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4990Debug.Assert(node.Type is object); 5008Debug.Assert((object)placeholder != null); 5014Debug.Assert(!IsConditionalState); 5015Debug.Assert(node.Type.IsAnonymousType); 5192Debug.Assert(namedType.Name == "Span"); 5193Debug.Assert(namedType.OriginalDefinition.Arity == 1); 5199Debug.Assert(namedType.Name == "Span"); 5200Debug.Assert(namedType.OriginalDefinition.Arity == 1); 5309Debug.Assert(!IsConditionalState); 5313Debug.Assert(!IsConditionalState); 5314Debug.Assert(!node.Expression.Type!.IsValueType); 5343Debug.Assert(!IsConditionalState); 5347Debug.Assert(!IsConditionalState); 5348Debug.Assert(expressionType is not null); 5349Debug.Assert(expressionType.IsValueType); 5423Debug.Assert(!IsConditionalState); 5581Debug.Assert(binary.Type.SpecialType == SpecialType.System_Boolean); 5614Debug.Assert(!IsConditionalState); 5649Debug.Assert(operand == expr); 5667Debug.Assert(!IsConditionalState); 5671Debug.Assert(binary.Type!.SpecialType == SpecialType.System_Boolean); 5797Debug.Assert(!IsConditionalState); 5898Debug.Assert(operand != null); 6146Debug.Assert(targetType.Type.ContainsErrorType() || 6158Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions)); 6169Debug.Assert(!IsConditionalState); 6220Debug.Assert(rightType is object); 6227Debug.Assert(!conversion.IsUserDefined); 6228Debug.Assert(!conversion.IsUnion); 6233Debug.Assert(!conversion.IsUserDefined); 6234Debug.Assert(!conversion.IsUnion); 6257Debug.Assert(conversionResult.Type is not null); 6286Debug.Assert(targetType.HasType); 6298Debug.Assert(!IsConditionalState); 6336Debug.Assert(!IsConditionalState); 6382Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion)); 6394Debug.Assert(expr is BoundExpression); 6404Debug.Assert(expr is BoundExpression); 6475Debug.Assert(node is not BoundConditionalOperator { WasTargetTyped: true }, """ 6565Debug.Assert(!wasTargetTyped); 6572Debug.Assert(node is BoundUnconvertedConditionalOperator); 6573Debug.Assert(node.HasErrors || _returnTypesOpt is not null || _disableDiagnostics); 6665Debug.Assert(!isRef); 6677Debug.Assert(isRef); 6809Debug.Assert(node.InvokedAsExtensionMethod); 6829Debug.Assert(node.InvokedAsExtensionMethod || isExtensionBlockMethod); 6836Debug.Assert(node.Method.ContainingType.ExtensionParameter is not null); 6876Debug.Assert(node.ReceiverOpt is null); 6929Debug.Assert(reinferenceResult.Member is not null); 6993Debug.Assert(reinferenceResult.Completion is null); 6995Debug.Assert(newMethod is not null); 7020Debug.Assert(extensionParameter is not null); 7033Debug.Assert(member.IsExtensionBlockMember()); 7054Debug.Assert(extensionParameter is not null); 7125Debug.Assert(arguments.Length == 2); 7136Debug.Assert(arguments.Length == 1); 7225Debug.Assert(baseType is object); 7297Debug.Assert(!compareExchangeInfo.IsDefault); 7319Debug.Assert(argsToParamsOpt is { IsDefault: true } or { Length: 3 }); 7537Debug.Assert(reinferenceResult.Completion is null); 7551Debug.Assert(reinferenceResult.Completion is null); 7584Debug.Assert(!arguments.IsDefault); 7585Debug.Assert(!expanded || !parametersOpt.IsDefault); 7586Debug.Assert(refKindsOpt.IsDefaultOrEmpty || refKindsOpt.Length == arguments.Length); 7587Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Length); 7595Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection)); 7695Debug.Assert(method is ErrorMethodSymbol); 7821Debug.Assert(result.Completion is null); 7833Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) <= 1); 7840Debug.Assert(parametersOpt.IsDefault || arguments.Length == parametersOpt.Length); 7868Debug.Assert(defaultArguments.IsNull || elements.Length == 1); 7869Debug.Assert(elements.Length == 1 || a == arguments.Length - 1); 7874Debug.Assert(argumentsBuilder.Count == arguments.Length + elements.Length - 1); 7978Debug.Assert(receiverSlot >= 0); 8085Debug.Assert(!IsConditionalState); 8149Debug.Assert(!IsConditionalState); 8197Debug.Assert(!IsConditionalState); 8216Debug.Assert(!this.IsConditionalState); 8233Debug.Assert(argumentResultType is not null); 8289Debug.Assert(!this.IsConditionalState); 8475Debug.Assert(!IsConditionalState); 8480Debug.Assert(!IsConditionalState); 8659Debug.Assert(variables.Id == localState.Id); 8678Debug.Assert(!expanded); 8688Debug.Assert(paramsIterationType.HasType); 8705Debug.Assert(member.GetMemberArityIncludingExtension() != 0); 8841Debug.Assert(false); // unexpected value 8880Debug.Assert(lambdaState.HasValue); 8893Debug.Assert(collectionExpressionVisitResults is not null); 8894Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 9034Debug.Assert(group != null || !conversion.ExplicitCastInCode); // Explicit conversions should include a group. 9147Debug.Assert((object)symbol != null); 9148Debug.Assert(!symbol.IsExtensionBlockMember(), symbol.ToDisplayString()); 9182Debug.Assert(symbol.ContainingType.IsDefinition); 9219Debug.Assert(false); 9249Debug.Assert(targetType.HasType); 9294Debug.Assert(completion is null); 9325Debug.Assert(targetTypeOpt.HasType); 9354Debug.Assert(result.completion is null); 9384Debug.Assert(!IsConditionalState); 9420Debug.Assert(diagnostics.DiagnosticBag is { }); 9446Debug.Assert(tupleType.IsTupleType); 9447Debug.Assert(values.Length == types.Length); 9448Debug.Assert(values.Length == (useRestField ? Math.Min(tupleType.TupleElements.Length, NamedTypeSymbol.ValueTupleRestPosition) : tupleType.TupleElements.Length)); 9481Debug.Assert(index != -1); 9488Debug.Assert(containingType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T); 9489Debug.Assert(containingSlot > 0); 9490Debug.Assert(valueSlot > 0); 9512Debug.Assert(conversion.Kind == ConversionKind.ImplicitTuple || conversion.Kind == ConversionKind.ExplicitTuple); 9513Debug.Assert(slot > 0); 9514Debug.Assert(valueSlot > 0); 9603Debug.Assert(targetField.TypeWithAnnotations.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true }); 9623Debug.Assert(conversionOperandSlot > 0); 9673Debug.Assert(diagnostics.DiagnosticBag is { }); 9729Debug.Assert(diagnostics.DiagnosticBag is { }); 9784Debug.Assert(conversionOpt is null 9832Debug.Assert(!trackMembers || !IsConditionalState); 9833Debug.Assert(conversionOperand != null); 9834Debug.Assert(conversionOpt is null || targetInstanceSlotOpt < 0); 9860Debug.Assert(conversionOpt is null); 9909Debug.Assert(targetInstanceSlotOpt < 0); 9948Debug.Assert(targetInstanceSlotOpt < 0); 9953Debug.Assert(targetInstanceSlotOpt < 0); 10015Debug.Assert(containingSlot > 0); 10050Debug.Assert(targetInstanceSlotOpt < 0); 10064Debug.Assert(conversionOperand != null); 10072Debug.Assert(containingSlot > 0); 10109Debug.Assert(targetInstanceSlotOpt < 0); 10112Debug.Assert(conversionOperand != null); 10139Debug.Assert(conversionOperand != null); 10189Debug.Assert(targetType.IsValueType || targetType.IsErrorType()); 10292Debug.Assert(dependsOn); // If this case fails, add a corresponding test. 10365Debug.Assert(handlerData.ArgumentPlaceholders.IsEmpty 10387Debug.Assert(extensionBlockFormOffset == 1); 10444Debug.Assert(!IsConditionalState); 10445Debug.Assert(conversionOperand != null); 10446Debug.Assert(targetTypeWithNullability.HasType); 10447Debug.Assert(diagnosticLocation != null); 10448Debug.Assert(conversion.Kind == ConversionKind.ExplicitUserDefined || conversion.Kind == ConversionKind.ImplicitUserDefined); 10480Debug.Assert(method is object); 10481Debug.Assert(method.ParameterCount == 1); 10482Debug.Assert(operandType.Type is object); 10598Debug.Assert(!IsConditionalState); 10599Debug.Assert(conversionOperand != null); 10600Debug.Assert(targetTypeWithNullability.HasType); 10601Debug.Assert(diagnosticLocation != null); 10602Debug.Assert(conversion.IsUnion); 10603Debug.Assert(conversionOpt is null || targetInstanceSlotOpt < 0); 10612Debug.Assert(conversion.BestUnionConversionAnalysis is { }); 10615Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm); 10616Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 10617Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions)); 10618Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 10619Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions)); 10620Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true }); 10628Debug.Assert(unionConstructionConversion is not null, "Unexpected conversion group structure for union conversion."); 10629Debug.Assert(sourceToParameterConversion is not null || analysis.SourceConversion.IsIdentity); 10633Debug.Assert(conversionOpt is null); 10653Debug.Assert(i < candidates.Length); 10660Debug.Assert(TypeSymbol.Equals(analysis.FromType, parameterType.Type, TypeCompareKind.AllIgnoreOptions)); 10661Debug.Assert(TypeSymbol.Equals(toType, analysis.ToType, TypeCompareKind.AllIgnoreOptions)); 10679Debug.Assert(operandType.Type is object); 10699Debug.Assert(factory.MethodKind == MethodKind.Constructor); 10704Debug.Assert(factory is { IsStatic: true, ContainingType.IsInterface: true }); 10718Debug.Assert(conversionOperand != null); 10720Debug.Assert(containingSlot > 0); 10760Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup); 10773Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup); 10838Debug.Assert(operandType.Type is object); 10839Debug.Assert(diagnosticLocation != null); 10872Debug.Assert(node.Type.IsDelegateType()); 10919Debug.Assert(analysisCompletion is null); 10931Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 11008Debug.Assert(arg.Type is not null); 11027Debug.Assert(arg.Type is not null); 11048Debug.Assert(!IsConditionalState); 11114Debug.Assert(_binder is object); 11123Debug.Assert(receiverParameter is not null); 11157Debug.Assert(delegateTypeOpt?.IsDelegateType() != false); 11225Debug.Assert(!IsConditionalState); 11437Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 11463Debug.Assert(invocation is object); 11464Debug.Assert(rightResult.Type is object); 11490Debug.Assert(invocation.DefaultArguments.IsNull); 11502Debug.Assert(parameters.Length - offset == n); 11509Debug.Assert(receiverParameter is not null); 11554Debug.Assert(rightParts.Length == n); 11721Debug.Assert(!IsConditionalState); 11749Debug.Assert(reinferenceResult.Member is not null); 11817Debug.Assert(!operandConversion.IsUnion); 11914Debug.Assert(!IsConditionalState); 11942Debug.Assert(reinferenceResult.Member is not null); 12041Debug.Assert(MakeSlot(node) == -1); 12129Debug.Assert(property.Parameters.IsEmpty); 12143Debug.Assert(reinferenceResult.Completion is null); 12160Debug.Assert(property.IsExtensionBlockMember()); 12182Debug.Assert(node.ReceiverOpt is not null); 12184Debug.Assert(reinferenceResult.Member is not null); 12223Debug.Assert(node.ReceiverOpt is not null); 12229Debug.Assert(reinferrenceResult.Member is not null); 12303Debug.Assert(!IsConditionalState); 12304Debug.Assert(!member.IsExtensionBlockMember()); 12344Debug.Assert(!IsConditionalState); 12391Debug.Assert(containingType.IsNullableType()); 12392Debug.Assert(TypeSymbol.Equals(NominalSlotType(containingSlot), containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 12404Debug.Assert(node.HasErrors); 12454Debug.Assert(resultType is object); 12504Debug.Assert(!foundMultiple); 12505Debug.Assert(targetTypeWithAnnotations.HasType); 12511Debug.Assert(node.HasErrors); 12518Debug.Assert(node.HasErrors); 12569Debug.Assert(wellKnownSpan is WellKnownType.System_Span_T or WellKnownType.System_ReadOnlySpan_T); 12790Debug.Assert(!IsConditionalState); 12940Debug.Assert(stack.Count > 0); 12968Debug.Assert(leftOperand is not null); 12993Debug.Assert(isAnd || op == BinaryOperatorKind.Or); 12998Debug.Assert(IsConditionalState); 13024Debug.Assert(!isBool); 13097Debug.Assert(placeholder is object); 13152Debug.Assert(!this.IsConditionalState); 13172Debug.Assert(!this.IsConditionalState); 13191Debug.Assert(node.Type.SpecialType == SpecialType.System_Boolean); 13243Debug.Assert(node.Type.SpecialType == SpecialType.System_RuntimeArgumentHandle); 13251Debug.Assert(node.Type is null); 13258Debug.Assert(!IsConditionalState); 13266Debug.Assert(!IsConditionalState); 13275Debug.Assert(node.WasCompilerGenerated); 13283Debug.Assert(node.WasCompilerGenerated); 13322Debug.Assert(node.Type.IsDynamic()); 13341Debug.Assert(node.Type.IsDynamic()); 13342Debug.Assert(node.Type.IsReferenceType); 13352Debug.Assert(!IsConditionalState); 13448Debug.Assert(node.Type.IsDynamic()); 13461Debug.Assert(!this.IsConditionalState); 13471Debug.Assert(receiverOpt.Type is null || AreCloseEnough(receiverOpt.Type, resultTypeSymbol)); 13592Debug.Assert(node.Type is null || node.Type.IsErrorType() || node.Type.IsRefLikeType); 13612Debug.Assert(node.Type is not null); 13783Debug.Assert(node.AwaitableInstancePlaceholder is not null); 13787Debug.Assert(node.RuntimeAsyncAwaitCallPlaceholder is not null); 13793Debug.Assert(node.GetResult is null); 13824Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull }); 13896Debug.Assert(!otherIsConditional); 14033Debug.Assert(Id == variables.Container!.Id); 14092Debug.Assert(state.Id > id); 14106Debug.Assert(Id < variables.Id); 14152Debug.Assert(Id > id); 14165Debug.Assert(index < Capacity); 14167Debug.Assert((_state[index], _state[index + 1]) != (false, false)); 14184Debug.Assert(Id > id); 14239Debug.Assert(Id == other.Id); 14246Debug.Assert(_state.Capacity == other._state.Capacity); 14268Debug.Assert(Id == other.Id); 14275Debug.Assert(_state.Capacity == other._state.Capacity);
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
276Debug.Assert(node is not BoundTypeOrValueExpression, "The Binder is expected to resolve the member access in the most appropriate way, even in an error scenario.");
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
30Debug.Assert(identifier != null); 31Debug.Assert(containingSymbol is null || containingSymbol.DeclaringCompilation is not null);
FlowAnalysis\NullableWalker.SnapshotManager.cs (7)
42Debug.Assert(!incrementalSnapshots.IsDefaultOrEmpty); 47Debug.Assert(currentPosition > previousPosition); 116Debug.Fail($"Did not find a snapshot for {node} `{node.Syntax}.`"); 171Debug.Assert(_currentWalkerSlot == -1, "Attempting to finalize snapshots before all walks completed"); 172Debug.Assert(_symbolToSlot.Count == _walkerStates.Count); 173Debug.Assert(_symbolToSlot.Count > 0); 223Debug.Assert(AreCloseEnough(originalSymbol, updatedSymbol));
FlowAnalysis\NullableWalker.Variables.cs (16)
164Debug.Assert(_variableSlot.Count == 0); 165Debug.Assert(_variableTypes.Count == 0); 166Debug.Assert(_variableBySlot.Count == 1); 185Debug.Assert(id >= 0); 186Debug.Assert(id <= IdMask); 187Debug.Assert(container is null || container.Id < id); 215Debug.Assert(GetVariablesForMethodScope(method) is null); 216Debug.Assert(!(method.ContainingSymbol is MethodSymbol containingMethod) || 261Debug.Assert(slot <= 0 || 289Debug.Assert(id == Id); 305Debug.Assert((object)variables == this); 415Debug.Assert(id >= 0); 416Debug.Assert(id <= IdMask); 417Debug.Assert(index >= 0); 418Debug.Assert(index <= IndexMask); 425Debug.Assert(slot > -1);
FlowAnalysis\ReadWriteWalker.cs (1)
95Debug.Assert(!ignoreThisParameter || m is SynthesizedPrimaryConstructor);
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (1)
30Debug.Assert(!badRegion);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (22)
41Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 117Debug.Assert(containingSymbol != null); 118Debug.Assert((object)containingType != null); 119Debug.Assert(statement != null); 120Debug.Assert(compilationState != null); 121Debug.Assert(diagnostics != null); 177Debug.Assert(SyntaxBindingUtilities.BindsToTryStatement(tryStatementSyntax)); 207Debug.Assert(asTry.FinallyBlockOpt == null); 408Debug.Assert(node.Label == _currentAwaitFinallyFrame.ProxyLabelIfNeeded(node.Label), "conditional leave?"); 603Debug.Assert(!_inCatchWithoutAwaits); 608Debug.Assert(node.Syntax.IsKind(SyntaxKind.CatchClause)); 618Debug.Assert(pendingCaughtExceptionType.IsObjectType()); 620Debug.Assert(c.IsImplicit); 621Debug.Assert(c.IsReference || c.IsIdentity); 645Debug.Assert(filterPrologueOpt is null); 740Debug.Assert(pendingExceptionRef.Type.IsObjectType()); 742Debug.Assert(c.IsReference || c.IsIdentity); 1026Debug.Assert(parent != null); 1027Debug.Assert(syntax != null); 1029Debug.Assert(SyntaxBindingUtilities.BindsToTryStatement(syntax)); 1094Debug.Assert(_syntaxOpt != null); 1154Debug.Assert(pendingCatch.SyntaxOpt.IsKind(SyntaxKind.TryStatement));
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (7)
68Debug.Assert(asyncIteratorInfo != null); 204Debug.Assert(_currentDisposalLabel is object); 214Debug.Assert(_currentDisposalLabel is object); 254Debug.Assert(_exprReturnLabel.Equals(_currentDisposalLabel)); 304Debug.Assert(_currentDisposalLabel is object); // no yield return allowed inside a finally 317Debug.Assert(_asyncIteratorInfo != null); 323Debug.Assert(_currentDisposalLabel is object); // no yield break allowed inside a finally
Lowering\AsyncRewriter\AsyncMethodBuilderMemberCollection.cs (4)
117Debug.Assert((object)builderType != null); 151Debug.Assert((object)builderType != null); 214Debug.Assert((object)builderType != null); 296Debug.Assert((object)builderType != null);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (11)
293Debug.Assert(!CurrentMethod.IsIterator); // an override handles async-iterators 350Debug.Assert(node.AwaitableInfo.RuntimeAsyncAwaitCall is null); 377Debug.Assert(node.Syntax.IsKind(SyntaxKind.AwaitExpression) || node.WasCompilerGenerated); 429Debug.Assert(receiver != null); 437Debug.Assert(methodName != null); 494Debug.Assert(awaiterFieldType.IsObjectType() || TypeSymbol.Equals(awaiterFieldType, awaiterTempRef.Type, TypeCompareKind.AllIgnoreOptions)); 496Debug.Assert(c.IsImplicit); 497Debug.Assert(c.IsReference || c.IsIdentity); 536Debug.Assert(awaiterFieldRef.Type.IsObjectType() || TypeSymbol.Equals(awaiterTemp.Type, awaiterFieldRef.Type, TypeCompareKind.AllIgnoreOptions)); 538Debug.Assert(c.IsReference || c.IsIdentity); 685Debug.Assert(_method.IsAsyncEffectivelyReturningGenericTask(F.Compilation));
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (4)
45Debug.Assert(!TypeSymbol.Equals(method.IteratorElementTypeWithAnnotations.Type, null, TypeCompareKind.ConsiderEverything2)); 48Debug.Assert(_isEnumerable != method.IsAsyncReturningIAsyncEnumerator(method.DeclaringCompilation)); 160Debug.Assert(stateMachineType.Constructor is IteratorConstructor); 385Debug.Assert(!_asyncMethodBuilderMemberCollection.CheckGenericMethodConstraints);
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
51Debug.Assert(compilationState.ModuleBuilderOpt != null);
Lowering\AsyncRewriter\RuntimeAsyncRewriter.cs (22)
68Debug.Assert(rewriter._factory.CurrentFunction is not null); 97Debug.Assert(factory.CurrentFunction != null); 134Debug.Assert(nodeType is not null); 144Debug.Assert(runtimeAsyncAwaitCall is not null); 145Debug.Assert(awaitableInfo.RuntimeAsyncAwaitCallPlaceholder is not null); 147Debug.Assert(runtimeAsyncAwaitMethod is not null); 148Debug.Assert(ReferenceEquals( 151Debug.Assert(runtimeAsyncAwaitMethod.Name is "Await" or "UnsafeAwaitAwaiter" or "AwaitAwaiter"); 189Debug.Assert(getAwaiter is not null); 200Debug.Assert(awaitableInfo.IsCompleted is not null); 202Debug.Assert(isCompletedMethod is not null); 206Debug.Assert(awaitableInfo.RuntimeAsyncAwaitCall is not null); 207Debug.Assert(awaitableInfo.RuntimeAsyncAwaitCallPlaceholder is not null); 218Debug.Assert(getResultMethod is not null); 244Debug.Assert(expr is not null); 329Debug.Assert(leftLocal.LocalSymbol.SynthesizedKind == SynthesizedLocalKind.Spill || 331Debug.Assert(node.IsRef); 387Debug.Assert(!_variablesToHoist.Contains(node.LocalSymbol)); 401Debug.Assert(!_variablesToHoist.Contains(node.ParameterSymbol)); 407Debug.Assert(_factory.CurrentFunction is not null); 409Debug.Assert(thisParameter is not null); 415Debug.Assert(thisParameter is not { Type.IsValueType: true, RefKind: RefKind.Ref });
Lowering\BoundTreeToDifferentEnclosingContextRewriter.cs (5)
40Debug.Fail($"Override the visitor for {node.Kind}"); 149Debug.Assert(node.RuntimeAsyncAwaitCall is null); 163Debug.Assert(node.InterpolatedStringHandlerData is null); 164Debug.Assert(!node.OperatorKind.IsDynamic()); 244Debug.Assert(node.Type.Equals(VisitType(node.Type), TypeCompareKind.ConsiderEverything));
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (7)
84Debug.Assert(scopeTree != null); 181Debug.Assert(!oldEnv.IsStruct); 182Debug.Assert(oldEnv.Parent == null || oldEnv.Parent == env); 343Debug.Assert(scope.DeclaredEnvironment is null); 384Debug.Assert(environmentsToScopes.ContainsKey(env)); 530Debug.Assert(syntax != null); 536Debug.Assert(_slotAllocator == null || environment.Parent is null || parentClosure is not null);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (18)
82Debug.Assert(boundNode != null); 153Debug.Assert(value); 162Debug.Assert(symbol != null); 355Debug.Assert(rootScope != null); 356Debug.Assert(topLevelMethod != null); 357Debug.Assert(methodsConvertedToDelegates != null); 358Debug.Assert(diagnostics != null); 374Debug.Assert(node == FindNodeToAnalyze(node)); 375Debug.Assert(topLevelMethod != null); 407Debug.Assert(_labelsInScope.Count == 1); 608Debug.Assert( 632Debug.Assert(symbol.ContainingSymbol != null); 671Debug.Assert(_freeVariables.Contains(symbol)); 694Debug.Assert(capturedVariable.Kind == SymbolKind.Method); 700Debug.Assert(false); // Add test(s) for scenarios that hit this code path 745Debug.Assert(parentScope.BoundNode != node); 791Debug.Assert(!_localToScope.ContainsKey(local)); 795Debug.Assert(_freeVariables.Add(local));
Lowering\ClosureConversion\ClosureConversion.cs (40)
207Debug.Assert(localOrParameter is LocalSymbol || localOrParameter is ParameterSymbol || 246Debug.Assert(thisType is not null); 247Debug.Assert(thisParameter is null || TypeSymbol.Equals(thisParameter.Type, thisType, TypeCompareKind.ConsiderEverything2)); 248Debug.Assert(compilationState.ModuleBuilderOpt != null); 249Debug.Assert(diagnostics.DiagnosticBag != null); 322Debug.Assert(_addedStatements == null); 359Debug.Assert(!_frames.ContainsKey(scope.BoundNode)); 383Debug.Assert(syntax != null); 405Debug.Assert(!proxies.ContainsKey(captured)); 472Debug.Assert((object)translatedLambdaContainer != _topLevelMethod.ContainingType || 595Debug.Assert(TypeSymbol.Equals(result.Type, frameType, TypeCompareKind.ConsiderEverything2)); 609Debug.Assert(frameClass.IsDefinition); 680Debug.Assert(frame.ScopeSyntaxOpt != null); 692Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2)); 715Debug.Assert(capturedFrame.Type.IsReferenceType); // Make sure we're not accidentally capturing a struct by value 819Debug.Assert(_thisProxyInitDeferred == null); 824Debug.Assert(_currentMethod is not SynthesizedPrimaryConstructor primaryConstructor || 891Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 901Debug.Assert(!arguments.IsDefault); 914Debug.Assert(frameType is SynthesizedClosureEnvironment); 919Debug.Assert(typeParameters.Length == frameType.Arity); 977Debug.Assert(!typeArguments.IsDefault); 1013Debug.Assert((object)oldTypeArg.Type == newTypeArg.Type); 1017Debug.Assert(oldTypeArg.NullableAnnotation == newTypeArg.NullableAnnotation); 1038Debug.Assert((typeArgumentsOpt.IsDefault && !originalMethod.IsGenericMethod) || (typeArgumentsOpt.Length == originalMethod.Arity)); 1064Debug.Assert(realTypeArguments.Length == 0); 1092Debug.Assert(node.ArgsToParamsOpt.IsDefault, "should be done with argument reordering by now"); 1215Debug.Assert(!node.Locals.IsEmpty); 1269Debug.Assert(rewrittenFilter != null); 1379Debug.Assert(node.TargetMethod is { RequiresInstanceReceiver: false, IsStatic: true }); 1391Debug.Assert(arguments.IsDefault && 1405Debug.Assert(_inExpressionLambda || conversion.Conversion.MethodSymbol is null); 1407Debug.Assert(conversion.ConversionKind != ConversionKind.MethodGroup); 1455Debug.Assert(syntax != null); 1456Debug.Assert(CompilationState.ModuleBuilderOpt != null); 1457Debug.Assert(closureOrdinal >= LambdaDebugInfo.MinClosureOrdinal); 1486Debug.Assert(closureKind == ClosureKind.Singleton); 1495Debug.Assert(!isLambdaBody || LambdaUtilities.IsLambdaBody(lambdaOrLambdaBodySyntax)); 1536Debug.Assert(synthesizedMethod != null); 1555Debug.Assert(tmpScope != null);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (27)
134Debug.Assert(block.Locals.IsEmpty); 178Debug.Assert(c.IsImplicit); 179Debug.Assert(c.IsReference || c.IsIdentity); 199Debug.Assert(!binOp.OperatorKind.IsDynamic()); 280Debug.Assert(saveRecursionDepth == _recursionDepth); 377Debug.Assert(node.OperandPlaceholder is null); 378Debug.Assert(node.OperandConversion is null); 629Debug.Assert(useSiteInfo.Diagnostics.IsNullOrEmpty()); 777Debug.Assert(c.IsImplicit); 778Debug.Assert(c.IsBoxing); 899Debug.Assert(node.LeftPlaceholder is not null); 939Debug.Assert(c.IsImplicit); 940Debug.Assert(c.IsReference); 949Debug.Assert(c.IsImplicit); 950Debug.Assert(c.IsReference); 966Debug.Assert(c.IsImplicit); 967Debug.Assert(c.IsReference); 976Debug.Assert(c.IsImplicit); 977Debug.Assert(c.IsReference); 1000Debug.Assert((object)sym != null); 1045Debug.Assert(ci.Initializers.Length != 0); 1111Debug.Assert(args.Type.IsSZArray()); 1113Debug.Assert(c.IsImplicit); 1114Debug.Assert(c.IsReference); 1239Debug.Assert((object)node.MethodOpt == null); 1257Debug.Assert(c.IsImplicit); 1258Debug.Assert(c.IsBoxing || c.IsReference || c.IsIdentity);
Lowering\ClosureConversion\LambdaCapturedVariable.cs (5)
33Debug.Assert(type.HasType); 48Debug.Assert(captured is LocalSymbol || captured is ParameterSymbol); 98Debug.Assert(local.SynthesizedKind != SynthesizedLocalKind.LocalStoreTracker); 112Debug.Assert(variable.Name != null); 183Debug.Assert(parameter is { IsThis: false });
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
106Debug.Assert(methodId.Ordinal >= 0);
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (2)
45Debug.Assert(containingType.DeclaringCompilation is not null); 108Debug.Assert(originalMethod is not { MethodKind: MethodKind.LocalFunction } || !originalMethod.IsStatic || IsStatic);
Lowering\DiagnosticsPass_ExpressionTrees.cs (11)
33Debug.Assert(node != null); 34Debug.Assert((object)containingSymbol != null); 51Debug.Assert(diagnostics != null); 52Debug.Assert((object)containingSymbol != null); 208Debug.Assert(symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Parameter || symbol is LocalFunctionSymbol); 316Debug.Assert((object)method != null); 317Debug.Assert(((object)propertyAccess == null) || 347Debug.Assert(_compilation.IsFeatureEnabled(MessageID.IDS_FeatureExpressionOptionalAndNamedArguments)); 779Debug.Assert(!node.TrueOperator.IsExtensionBlockMember()); 780Debug.Assert(!node.FalseOperator.IsExtensionBlockMember()); 951Debug.Assert(!(!parentIsConversion && _inExpressionLambda));
Lowering\DiagnosticsPass_Warnings.cs (13)
25Debug.Assert(arguments.Length == argumentRefKindsOpt.Length); 228Debug.Assert(TypeSymbol.Equals(expr1.Type, expr2.Type, TypeCompareKind.ConsiderEverything2)); 305Debug.Assert(node != null); 382Debug.Assert(node != null); 383Debug.Assert(node.OperatorKind.IsComparison()); 393Debug.Assert(tree != null); 394Debug.Assert(constantValue != null); 395Debug.Assert(operand != null); 667Debug.Assert(false, "How did we get here?"); 719Debug.Assert(node != null); 734Debug.Assert(node != null); 781Debug.Assert(node != null); 911Debug.Assert(length == rightTuple.Arguments.Length);
Lowering\ExtensionMethodBodyRewriter.cs (7)
34Debug.Assert(sourceMethod is not null); 35Debug.Assert(implementationMethod is not null); 36Debug.Assert(sourceMethod == (object)implementationMethod.UnderlyingMethod); 43Debug.Assert(implementationMethod.ParameterCount - 1 == sourceMethod.ParameterCount); 48Debug.Assert(_rewrittenContainingMethod is not null); 56Debug.Assert(symbol.Parameters.Length == rewrittenParameters.Length); 187Debug.Assert(symbol?.IsExtensionBlockMember() != true);
Lowering\ExtensionMethodReferenceRewriter.cs (10)
36Debug.Assert(node != null); 77Debug.Assert(node.Method.MethodKind == MethodKind.LocalFunction || node.Method.IsStatic || node.ReceiverOpt is not null); 102Debug.Assert(boundCall.Method.OriginalDefinition.TryGetCorrespondingExtensionImplementationMethod() == (object)method.OriginalDefinition); 103Debug.Assert(!boundCall.Method.IsStatic); 123Debug.Assert(receiverOpt.Type!.Equals(method.Parameters[0].Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 168Debug.Assert(method?.IsExtensionBlockMember() != true || 221Debug.Assert(node.MethodOpt!.OriginalDefinition.TryGetCorrespondingExtensionImplementationMethod() == (object)methodOpt.OriginalDefinition); 249Debug.Assert(node.InterpolatedStringHandlerData is null); 250Debug.Assert(!node.OperatorKind.IsDynamic()); 271Debug.Assert(symbol?.IsExtensionBlockMember() != true);
Lowering\Extensions.cs (3)
34Debug.Assert(expr != null); 78Debug.Assert(expr != null); 131Debug.Assert(expr != null);
Lowering\InitializerRewriter.cs (5)
21Debug.Assert(!boundInitializers.IsDefault); 22Debug.Assert((method.MethodKind == MethodKind.Constructor) || (method.MethodKind == MethodKind.StaticConstructor)); 31Debug.Assert(!boundInitializers.IsDefault); 65Debug.Assert(!submissionResultType.IsVoidType()); 115Debug.Assert(LocalRewriter.IsFieldOrPropertyInitializer(boundStatement));
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (4)
143Debug.Assert(method.MethodKind != MethodKind.LocalFunction && method.MethodKind != MethodKind.AnonymousFunction); 417Debug.Assert(returnStatement.ExpressionOpt.Syntax.Parent != null); 441Debug.Assert(whenClause != null); 625Debug.Assert(keyword.Node != null || type != null);
Lowering\Instrumentation\CompoundInstrumenter.cs (1)
25Debug.Assert(previous != null);
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (9)
31Debug.Assert(declarationSyntax.Initializer != null); 56Debug.Assert(startFallbackOpt != default || endOpt != default); 90Debug.Assert(declaratorSyntax.Parent != null); 92Debug.Assert(declarationSyntax.Parent != null); 110Debug.Assert(!modifiers.Any(SyntaxKind.ConstKeyword)); // const locals don't have a sequence point 145Debug.Assert(declaratorSyntax.Parent != null); 149Debug.Assert(declarationSyntax.Parent != null); 174Debug.Assert(condition.Type is not null); 198Debug.Assert(condition.ConstantValueOpt != null ||
Lowering\Instrumentation\DebugInfoInjector.cs (8)
65Debug.Assert(ctorDecl.Initializer == null); 70Debug.Assert(ctorDecl.Body != null); 95Debug.Assert(typeDecl.ParameterList != null); 96Debug.Assert(typeDecl.BaseList?.Types.Any(t => t is PrimaryConstructorBaseTypeSyntax { ArgumentList: not null }) != true); 141Debug.Assert(syntax is { Parent: { Parent: { } } }); 414Debug.Assert(parameterSyntax is { Parent.Parent: RecordDeclarationSyntax }); 440Debug.Assert(whenClause != null); 481Debug.Assert(filterClause is not null);
Lowering\Instrumentation\Instrumenter.cs (47)
39Debug.Assert(!original.WasCompilerGenerated); 50Debug.Assert(!original.WasCompilerGenerated || original.Syntax.Kind() == SyntaxKind.Block); 103Debug.Assert(LocalRewriter.IsFieldOrPropertyInitializer(original)); 114Debug.Assert(!original.WasCompilerGenerated); 115Debug.Assert(original.Syntax.Kind() == SyntaxKind.DoStatement); 116Debug.Assert(factory != null); 122Debug.Assert(!original.WasCompilerGenerated); 123Debug.Assert(original.Syntax.Kind() == SyntaxKind.WhileStatement); 124Debug.Assert(factory != null); 130Debug.Assert(!original.WasCompilerGenerated); 131Debug.Assert(original.Syntax.Kind() == SyntaxKind.DoStatement); 137Debug.Assert(!original.WasCompilerGenerated); 138Debug.Assert(original.Syntax.Kind() == SyntaxKind.WhileStatement); 145Debug.Assert(!original.WasCompilerGenerated); 146Debug.Assert(original.Syntax is CommonForEachStatementSyntax); 152Debug.Assert(original.Syntax is CommonForEachStatementSyntax); 158Debug.Assert(!original.WasCompilerGenerated); 159Debug.Assert(original.Syntax.Kind() == SyntaxKind.ForEachStatement); 165Debug.Assert(!original.WasCompilerGenerated); 166Debug.Assert(original.Syntax.Kind() == SyntaxKind.ForEachVariableStatement); 172Debug.Assert(!original.WasCompilerGenerated); 173Debug.Assert(original.Syntax is CommonForEachStatementSyntax); 179Debug.Assert(!original.WasCompilerGenerated); 180Debug.Assert(original.Syntax.Kind() == SyntaxKind.ForStatement); 186Debug.Assert(!original.WasCompilerGenerated); 187Debug.Assert(original.Syntax.Kind() == SyntaxKind.ForStatement); 188Debug.Assert(factory != null); 194Debug.Assert(original.Syntax.Kind() == SyntaxKind.IfStatement); 200Debug.Assert(!original.WasCompilerGenerated); 201Debug.Assert(original.Syntax.Kind() == SyntaxKind.IfStatement); 202Debug.Assert(factory != null); 208Debug.Assert(original.Syntax.Kind() == SyntaxKind.LabeledStatement); 214Debug.Assert(original.Syntax.Kind() == SyntaxKind.VariableDeclarator || 222Debug.Assert(original.Left is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.UserDefined } or BoundParameter); 258Debug.Assert(!original.WasCompilerGenerated); 259Debug.Assert(original.Syntax.Kind() == SyntaxKind.LockStatement); 270Debug.Assert(original.Syntax.Kind() == SyntaxKind.SwitchStatement); 281Debug.Assert(!original.WasCompilerGenerated); 282Debug.Assert(original.Syntax.FirstAncestorOrSelf<WhenClauseSyntax>() != null); 288Debug.Assert(!original.WasCompilerGenerated); 289Debug.Assert(original.Syntax.Kind() == SyntaxKind.UsingStatement); 302Debug.Assert(original.Syntax.Kind() == SyntaxKind.CatchClause); 307Debug.Assert(original.Kind == BoundKind.SwitchStatement); 308Debug.Assert(!original.WasCompilerGenerated); 309Debug.Assert(original.Syntax.Kind() == SyntaxKind.SwitchStatement); 310Debug.Assert(factory != null); 319Debug.Assert(factory != null);
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (15)
114Debug.Assert(_lazyPreviousContextVariables?.IsEmpty != false); 259Debug.Assert(enumDelta == 0 || overloadOpt.Value != WellKnownMember.Microsoft_CodeAnalysis_Runtime_LocalStoreTracker__LogLocalStoreLocalAlias); 264Debug.Assert(symbol?.IsGenericMethod != true); 298Debug.Assert(_factory.TopLevelMethod is not null); 299Debug.Assert(_factory.CurrentFunction is not null); 364Debug.Assert(original.Left is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.UserDefined } or BoundParameter); 427Debug.Assert(!parameterSymbol.IsDiscard); 449Debug.Assert(index is BoundParameterId or BoundLocalId or BoundLiteral); 455Debug.Assert(parameter.RefKind == RefKind.None); 460Debug.Assert(!parameter.Type.IsManagedTypeNoUseSiteDiagnostics); 482Debug.Assert(targetType.IsStructType()); 490Debug.Assert(c.IsNumeric || c.IsReference || c.IsIdentity || c.IsPointer || c.IsBoxing || c.IsEnumeration); 561Debug.Assert(original.ReceiverOpt is not null); 576Debug.Assert(refKinds.IsDefault || arguments.Length == refKinds.Length); 577Debug.Assert(invocation.Type is not null);
Lowering\Instrumentation\ModuleCancellationInstrumenter.cs (2)
80Debug.Assert(_factory.TopLevelMethod is not null); 81Debug.Assert(_factory.CurrentFunction is not null);
Lowering\Instrumentation\StackOverflowProbingInstrumenter.cs (2)
70Debug.Assert(_factory.TopLevelMethod is not null); 71Debug.Assert(_factory.CurrentFunction is not null);
Lowering\IteratorRewriter\IteratorFinallyMethodSymbol.cs (2)
37Debug.Assert((object)stateMachineType != null); 38Debug.Assert(name != null);
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (8)
291Debug.Assert(body != null, "we should have either sub-dispatch or a handler"); 361Debug.Assert(node.Label == proxyLabel || !(F.CurrentFunction is IteratorFinallyMethodSymbol), "should not be proxying branches in finally"); 367Debug.Assert(node.Label == _currentFinallyFrame.ProxyLabelIfNeeded(node.Label), "conditional leave?"); 388Debug.Assert(node.CatchBlocks.IsEmpty, "try with yields must have no catches"); 389Debug.Assert(node.FinallyBlockOpt != null, "try with yields must have finally"); 396Debug.Assert(!frame.IsRoot()); 397Debug.Assert(frame.parent.knownStates.ContainsValue(frame), "parent must be aware about states in the child frame"); 414Debug.Assert(frame.parent.finalizeState == _currentFinallyFrame.finalizeState);
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.IteratorFinallyFrame.cs (2)
49Debug.Assert(parent != null, "non root frame must have a parent"); 50Debug.Assert((object)handler != null, "non root frame must have a handler");
Lowering\IteratorRewriter\IteratorRewriter.cs (2)
175Debug.Assert(F.ModuleBuilderOpt is not null); 277Debug.Assert(stateMachineType.Constructor is IteratorConstructor);
Lowering\LocalRewriter\DelegateCacheContainer.cs (7)
25Debug.Assert(containingType.IsDefinition); 38Debug.Assert(containingType.IsDefinition); 39Debug.Assert(owner.IsDefinition); 40Debug.Assert(owner is NamedTypeSymbol { Arity: > 0 } or MethodSymbol { Arity: > 0 }); 65Debug.Assert(delegateType.IsDelegateType()); 66Debug.Assert(targetMethod is { }); 83Debug.Assert(_constructedContainer is { });
Lowering\LocalRewriter\DelegateCacheRewriter.cs (7)
28Debug.Assert(factory.TopLevelMethod is { }); 38Debug.Assert(targetMethod is { }); 45Debug.Assert(boundDelegateCreation.MethodOpt is { }); 63Debug.Assert(_factory.ModuleBuilderOpt is { }); 64Debug.Assert(_factory.CurrentFunction is { }); 126Debug.Assert(targetMethod is { }); 167Debug.Assert(targetMethod.MethodKind == MethodKind.Ordinary);
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
22Debug.Assert(topLevelMethod != null);
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (7)
28Debug.Assert(result is { }); 42Debug.Assert(rewrittenTargetType.Type.Equals(rewrittenType)); 45Debug.Assert(!rewrittenType.IsValueType || rewrittenType.IsNullableType()); 62Debug.Assert(constantValue.IsNull); 85Debug.Assert(operandPlaceholder is not null); 86Debug.Assert(operandConversion is not null); 90Debug.Assert(result.Type!.Equals(rewrittenType, TypeCompareKind.ConsiderEverything));
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (18)
50Debug.Assert(!node.IsRef); 129Debug.Assert(eventAccess.IsUsableAsField); 194Debug.Assert(!isRef); 198Debug.Assert(!property.IsIndexer); 215Debug.Assert(!isRef); 220Debug.Assert(indexer.IsIndexer || indexer.IsIndexedProperty); 239Debug.Assert(!isRef || rewrittenLeft.GetRefKind() != RefKind.None); 276Debug.Assert(!isRef); 316Debug.Assert(autoProp.IsAutoPropertyOrUsesFieldKeyword, 318Debug.Assert(_factory.CurrentFunction.IsConstructor()); 319Debug.Assert(property.Equals(autoProp, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 364Debug.Assert(receiverIsKnownToBeCaptured || rewrittenReceiverBeforePossibleCapture != (object?)rewrittenReceiver); 366Debug.Assert(storesOpt is { }); 367Debug.Assert(receiverIsKnownToBeCaptured || storesOpt.Count != 0); 368Debug.Assert(receiverIsKnownToBeCaptured || argTempsBuilder is not null); 404Debug.Assert(exprType is object); 441Debug.Assert(sideEffects.IsEmpty); 459Debug.Assert(newElement is { });
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (1)
31Debug.Assert(sectionSyntax is { });
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (74)
118Debug.Assert(node.Type.SpecialType == SpecialType.System_String, "Non-string binary addition should have been handled by VisitConversion or VisitArguments"); 125Debug.Assert(applyParentUnaryOperator is null); 131Debug.Assert(applyParentUnaryOperator is null); 147Debug.Assert(stack.Count >= 1); 169Debug.Assert(node.OperatorKind == BinaryOperatorKind.StringConcatenation); 170Debug.Assert(node.InterpolatedStringHandlerData is not null); 209Debug.Assert(oldNode == null || (oldNode.Syntax == syntax)); 234Debug.Assert(!isPointerElementAccess); 242Debug.Assert(method is null); 340Debug.Assert(loweredLeft.Type is { }); 341Debug.Assert(loweredRight.Type is { }); 354Debug.Assert(loweredLeft.Type is { }); 355Debug.Assert(loweredRight.Type is { }); 368Debug.Assert(loweredLeft.Type is { }); 369Debug.Assert(loweredRight.Type is { }); 539Debug.Assert(!operatorKind.IsDynamic()); 577Debug.Assert(loweredLeft.Type is { }); 614Debug.Assert(operatorKind.Operator() == BinaryOperatorKind.And || operatorKind.Operator() == BinaryOperatorKind.Or); 631Debug.Assert(applyParentUnaryOperator == null || applyParentUnaryOperator.OperatorKind == testOperator); 637Debug.Assert(leftTruthOperator == null); 712Debug.Assert(temp is { }); 737Debug.Assert(leftTruthOperator == null); 750Debug.Assert(leftTruthOperator == null); 768Debug.Assert(leftTruthOperator != null); 772Debug.Assert(conversion.IsImplicit); 795Debug.Assert(!operatorKind.IsLogical()); 803Debug.Assert(method is { }); 804Debug.Assert(TypeSymbol.Equals(method.ReturnType, type, TypeCompareKind.ConsiderEverything2)); 822Debug.Assert(left != null); 823Debug.Assert(right != null); 865Debug.Assert(nonNull is { }); 909Debug.Assert(expression.Type is { }); 932Debug.Assert(expression.Type is { }); 946Debug.Assert(expression.Type is { }); 1023Debug.Assert(yNonNull is null, "Handled by trivial optimization above; otherwise we should use yNonNull here."); 1036Debug.Assert(xNonNull is null, "Handled by trivial optimization above; otherwise we should use xNonNull here."); 1324Debug.Assert(left != null); 1325Debug.Assert(right != null); 1392Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case. 1633Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 1634Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 1635Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 1685Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case. 1708Debug.Assert(alwaysNull.Type is { }); 1750Debug.Assert(conditionalExpression.Type is { }); 1784Debug.Assert(leftNonNull == null || rightNonNull == null); // We've already optimized the case where they are both non-null. 1785Debug.Assert(!NullableNeverHasValue(left) && !NullableNeverHasValue(right)); // We've already optimized the case where one is null. 1926Debug.Assert(nullableType2 is { }); 1958Debug.Assert(loweredLeft != null); 1959Debug.Assert(loweredRight != null); 1960Debug.Assert((object)returnType != null); 1961Debug.Assert(returnType.SpecialType == SpecialType.System_Boolean); 1962Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull()); 2022Debug.Assert((object)method != null); 2047Debug.Assert((object)method != null); 2059Debug.Assert(loweredLeft.Type is { SpecialType: SpecialType.System_Decimal }); 2060Debug.Assert(loweredRight.Type is { SpecialType: SpecialType.System_Decimal }); 2083Debug.Assert((object)method != null); 2090Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) || 2096Debug.Assert( 2156Debug.Assert(loweredRight.Type is { }); 2158Debug.Assert(rightType.SpecialType == SpecialType.System_Int32); 2223Debug.Assert(loweredLeft.Type is { }); 2225Debug.Assert(leftType.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr); 2228Debug.Assert(loweredRight.Type is { }); 2230Debug.Assert(rightType.SpecialType == SpecialType.System_Int32); 2279Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2284Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2290Debug.Assert(kind.Operator() == BinaryOperatorKind.Addition); 2324Debug.Assert(sizeOfExpression.Type is { SpecialType: SpecialType.System_Int32 }); 2334Debug.Assert(numericOperand.Type is { }); 2471Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2472Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2473Debug.Assert(returnType.SpecialType == SpecialType.System_Int64);
Lowering\LocalRewriter\LocalRewriter_Call.cs (80)
43Debug.Assert(methodGroup.ReceiverOpt == null || methodGroup.ReceiverOpt.Kind != BoundKind.TypeOrValueExpression); 49Debug.Assert(node.ApplicableMethods.All(m => !m.RequiresInstanceReceiver && TypeSymbol.Equals(m.ContainingType, firstContainer, TypeCompareKind.ConsiderEverything2))); 56Debug.Assert(_factory.CurrentType is { }); 57Debug.Assert(!_factory.CurrentType.IsExtension); // When binding a simple name for a call, you cannot get a member inside an extension type 86Debug.Assert(loweredReceiver != null); 163Debug.Assert(nameSyntax != null); 164Debug.Assert(interceptor.IsDefinition); 165Debug.Assert(!interceptor.ContainingType.IsGenericType); 201Debug.Assert(containingMethod is not null); 214Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic); 289Debug.Assert(methodThisParameter is not null); 290Debug.Assert(receiverOpt?.Type is not null); 296Debug.Assert(receiverOpt.Type.Equals(interceptor.Parameters[0].Type, TypeCompareKind.AllIgnoreOptions) 338Debug.Assert(node != null); 389Debug.Assert(invokedAsExtensionMethod && !arguments.IsEmpty); 446Debug.Assert(node.ReceiverOpt is null); 472Debug.Assert(rewrittenArguments.Length == 2); 525Debug.Assert(rewrittenBoundCall.Type is not null); 573Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 624Debug.Assert(false, "Not expected to survive lowering."); 632Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind); 676Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length == arguments.Length); 678Debug.Assert(!requiresInstanceReceiver || rewrittenReceiver != null || _inExpressionLambda); 679Debug.Assert(!forceReceiverCapturing || (requiresInstanceReceiver && rewrittenReceiver != null && storesOpt is object)); 680Debug.Assert(!forceReceiverCapturing || methodOrIndexer is PropertySymbol); 688Debug.Assert(!_inExpressionLambda); 689Debug.Assert(rewrittenReceiver is object); 690Debug.Assert(rewrittenReceiver.Type is { }); 793Debug.Assert(saveTempsOpt is object || tempsOpt?.Count is null or > 0); 800Debug.Assert(assignmentToTemp is object); 801Debug.Assert(tempsOpt is object); 858Debug.Assert(!_inExpressionLambda); 863Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 869Debug.Assert(!argumentsAssignedToTemp.IsNull); 875Debug.Assert(argIndex < argumentIndex); 882Debug.Assert(usesReceiver(argument)); 883Debug.Assert(requiresInstanceReceiver); 884Debug.Assert(receiverTemp is object); 898Debug.Assert(visitedArgumentsBuilder[argIndex] != null); 935Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 953Debug.Assert(rewrittenReceiver.Type is { }); 954Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is { }); 995Debug.Assert(assignmentToTemp.IsRef); 998Debug.Assert(receiverType is object); 1034Debug.Assert(SpillSequenceSpiller.IsComplexConditionalInitializationOfReceiverRef(assignmentToTemp, out _, out _, out _, out _)); 1051Debug.Assert(CodeGenerator.ReceiverIsKnownToReferToTempIfReferenceType(receiverTemp)); 1077Debug.Assert(rewrittenArguments.All(arg => arg is not BoundDiscardExpression), "Discards should have been substituted by VisitArguments"); 1082Debug.Assert(expanded ? rewrittenArguments.Length == parameters.Length : rewrittenArguments.Length >= parameters.Length); 1083Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); 1189Debug.Assert(actualArguments.All(static arg => arg is not null)); 1240Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length >= parameters.Length); 1249Debug.Assert(!argumentRefKindsOpt.IsEmpty); 1271Debug.Assert(initialArgRefKind is RefKind.None or RefKind.In or RefKind.Ref); 1286Debug.Assert(comRefKindMismatchPossible); 1310Debug.Assert(rewrittenArguments.Length == methodOrIndexer.GetParameterCount() + 1); 1311Debug.Assert(argsToParamsOpt.IsDefault); 1334Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is not null); 1357Debug.Assert(paramsArray.IsParamsArrayOrCollection); 1411Debug.Assert(refKinds.Count == arguments.Length); 1412Debug.Assert(storesToTemps.Count == 0); 1413Debug.Assert(rewrittenArguments.Length == parameters.Length); 1414Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); 1423Debug.Assert(arguments[p] == null); 1427Debug.Assert(expanded); 1428Debug.Assert(p == parameters.Length - 1); 1429Debug.Assert(argRefKind == RefKind.None); 1448Debug.Assert(arguments[p].IsParamsArrayOrCollection); 1543Debug.Assert(arguments != null); 1544Debug.Assert(storesToTemps != null); 1545Debug.Assert(temporariesBuilder != null); 1572Debug.Assert(arguments != null); 1573Debug.Assert(tempStores != null); 1613Debug.Assert(firstUnclaimedStore == tempStores.Count, "not all side-effects were claimed"); 1639Debug.Assert(value.Type is { }); 1691Debug.Assert(actualArguments != null); 1692Debug.Assert(actualArguments.Length == parameters.Length); 1694Debug.Assert(argsRefKindsBuilder != null); 1695Debug.Assert(argsRefKindsBuilder.Count == parameters.Length); 1721Debug.Assert(localRefKind == RefKind.None); 1748Debug.Assert(node.TypeArgumentsOpt.IsDefault);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (78)
31Debug.Assert(conversion.Kind == ConversionKind.CollectionExpression); 32Debug.Assert(!_inExpressionLambda); 33Debug.Assert(_additionalLocals is { }); 34Debug.Assert(node.Type is { }); 82Debug.Assert(elementType is { }); 128Debug.Assert(spreadElement.IteratorBody is { }); 146Debug.Assert(spreadElement.IteratorBody is { }); 148Debug.Assert(iteratorBody is { }); 161Debug.Assert(result is { }); 185Debug.Assert(singleSpread.Expression.Type is not null); 202Debug.Assert(targetEnumerableType.OriginalDefinition == (object)_compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)); 256Debug.Assert(!_inExpressionLambda); 257Debug.Assert(_additionalLocals is { }); 258Debug.Assert(node.Placeholder is null); 259Debug.Assert(collectionType is ArrayTypeSymbol or NamedTypeSymbol); 273Debug.Assert(namedType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Span_T)) || 280Debug.Assert(collectionType.OriginalDefinition == (object)_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T) || 320Debug.Assert(isReadOnlySpan 337Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, CollectionExpressionTypeKind.ReadOnlySpan, elementType.Type, _compilation)); 347Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, isReadOnlySpan ? CollectionExpressionTypeKind.ReadOnlySpan : CollectionExpressionTypeKind.Span, elementType.Type, _compilation)); 360Debug.Assert(isReadOnlySpan 384Debug.Assert(conversionKind == ConversionKind.Identity || (isReadOnlySpan && conversionKind == ConversionKind.ImplicitReference)); 408Debug.Assert(list.Type is { }); 409Debug.Assert(list.Type.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T), TypeCompareKind.AllIgnoreOptions)); 421Debug.Assert(!_inExpressionLambda); 426Debug.Assert(rewrittenReceiver is { }); 435Debug.Assert(placeholder is { }); 483Debug.Assert(!_inExpressionLambda); 484Debug.Assert(_factory.ModuleBuilderOpt is { }); 485Debug.Assert(_diagnostics.DiagnosticBag is { }); 486Debug.Assert(node.Type is NamedTypeSymbol); 487Debug.Assert(node.Placeholder is null); 488Debug.Assert(node.Type.IsArrayInterface(out _)); 498Debug.Assert(node.CollectionCreation is null); 505Debug.Assert(numberIncludingLastSpread == 0); 545Debug.Assert(collectionType.IsMutableArrayInterface(out _)); 551Debug.Assert(node.CollectionCreation is null or BoundObjectCreationExpression); 561Debug.Assert(c.IsImplicit); 562Debug.Assert(c.IsReference || c.IsIdentity); 567Debug.Assert(node.Type.OriginalDefinition.SpecialType is 581Debug.Assert(!_inExpressionLambda); 582Debug.Assert(node.Type is { }); 583Debug.Assert(node.CollectionCreation is { }); 584Debug.Assert(node.Placeholder is null); 585Debug.Assert(node.CollectionBuilderMethod is { }); 586Debug.Assert(node.CollectionBuilderElementsPlaceholder is { }); 593Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 642Debug.Assert(elements.Length > 0); 643Debug.Assert(elements.All(e => e is BoundExpression)); 644Debug.Assert(_factory.ModuleBuilderOpt is { }); 645Debug.Assert(_diagnostics.DiagnosticBag is { }); 646Debug.Assert(_compilation.Assembly.RuntimeSupportsInlineArrayTypes); 647Debug.Assert(_additionalLocals is { }); 668Debug.Assert(inlineArrayType.HasInlineArrayAttribute(out int inlineArrayLength) && inlineArrayLength == arrayLength); 709Debug.Assert(span.Type is { }); 839Debug.Assert(TryOptimizeSingleSpreadToArray_NoConversionApplied(node, targetsReadOnlyCollection: false, arrayType) is null); 904Debug.Assert(arrayTemp.Type is ArrayTypeSymbol); 947Debug.Assert(indexTemp is not null); 1036Debug.Assert(type is not null); 1132Debug.Assert((object)spreadOperandAsSpan != rewrittenSpreadOperand || spreadOperandAsSpan is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.LoweringTemp }); 1161Debug.Assert(!_inExpressionLambda); 1236Debug.Assert(useKnownLength); 1237Debug.Assert(setCount is { }); 1238Debug.Assert(asSpan is { }); 1239Debug.Assert(knownLengthTemp is { }); 1275Debug.Assert(spanTemp.Type is NamedTypeSymbol); 1318Debug.Assert(indexTemp is not null); 1345Debug.Assert(rewrittenSpreadOperand.Type is not null); 1426Debug.Assert(statements.Length > 0); 1443Debug.Assert(rewrittenExpressions.Count >= numberIncludingLastSpread); 1454Debug.Assert(collectionPlaceholder is { }); 1459Debug.Assert(lengthAccess is { }); 1478Debug.Assert(sum is { }); 1500Debug.Assert(enumeratorInfo is { }); 1501Debug.Assert(convertedExpression is { }); 1502Debug.Assert(expressionPlaceholder is { }); 1503Debug.Assert(elementPlaceholder is { }); 1504Debug.Assert(iteratorBody is { });
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (42)
24Debug.Assert(TypeSymbol.Equals(node.Right.Type, node.Operator.RightType, TypeCompareKind.ConsiderEverything2)); 38Debug.Assert(node.Operator.Method is { }); 39Debug.Assert(node.LeftConversion is null || (node.Left.Type!.IsReferenceType && node.Operator.Method.IsExtensionBlockMember())); 40Debug.Assert(node.FinalConversion is null); 54Debug.Assert(leftType is { }); 55Debug.Assert(TypeSymbol.Equals(leftType, node.Type, TypeCompareKind.AllIgnoreOptions)); 77Debug.Assert(node.LeftConversion is null); 116Debug.Assert(!IsBinaryStringConcatenation(binaryOperator)); 153Debug.Assert(rewrittenAssignment.Type is { }); 165Debug.Assert(rewrittenAssignment.Type is { }); 196Debug.Assert(node.LeftPlaceholder is not null); 206Debug.Assert(!rightIsVisited); 207Debug.Assert(node.Operator.ReturnType is { SpecialType: SpecialType.System_String }); 216Debug.Assert(node.Left.Type is { }); 221Debug.Assert(node.FinalPlaceholder is not null); 228Debug.Assert(TypeSymbol.Equals(transformedLHS.Type, node.Left.Type, TypeCompareKind.AllIgnoreOptions)); 236Debug.Assert(assignment.Type is { }); 264Debug.Assert(propertyOrEvent.Kind == SymbolKind.Property || propertyOrEvent.Kind == SymbolKind.Event); 290Debug.Assert(receiverOpt.Kind != BoundKind.TypeExpression); 293Debug.Assert(rewrittenReceiver.Type is { }); 370Debug.Assert(receiverOpt != null); 429Debug.Assert(temps is object); 499Debug.Assert(array is BoundArrayCreation); 520Debug.Assert(actualArguments.All(static arg => arg is not null)); 555Debug.Assert(implicitIndexerAccess.IndexerOrSliceAccess.GetRefKind() == RefKind.None); 564Debug.Assert(receiverIsKnownToBeCaptured); 594Debug.Assert(fieldOrEvent.Kind == SymbolKind.Field || fieldOrEvent.Kind == SymbolKind.Event); 602Debug.Assert(receiver is { Type: { } }); 612Debug.Assert(receiver.Type.IsReferenceType); 613Debug.Assert(receiver.Kind != BoundKind.TypeExpression); 616Debug.Assert(rewrittenReceiver.Type is { }); 755Debug.Assert(Binder.IsWellKnownSystemIndex(implicitIndexerAccess.Argument.Type, _compilation) 811Debug.Assert(originalLHS.GetRefKind() == RefKind.Ref); 827Debug.Assert((object)result == originalLHS || IsCapturedPrimaryConstructorParameter(originalLHS)); // If this fails, we might need to add tests for new scenarios and relax the assert. 832Debug.Assert(((BoundCall)originalLHS).Method.RefKind != RefKind.None); 836Debug.Assert(((BoundFunctionPointerInvocation)originalLHS).FunctionPointer.Signature.RefKind != RefKind.None); 840Debug.Assert(((BoundConditionalOperator)originalLHS).IsRef); 844Debug.Assert(((BoundAssignmentOperator)originalLHS).IsRef); 855Debug.Assert(eventAccess.IsUsableAsField); 1018Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 1038Debug.Assert(expression.Type is { }); 1058Debug.Assert(call.ReceiverOpt is { });
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (10)
40Debug.Assert(!_inExpressionLambda); 41Debug.Assert(node.AccessExpression.Type is { }); 44Debug.Assert(loweredReceiver.Type is { }); 119Debug.Assert(loweredAccessExpression != null); 120Debug.Assert(loweredAccessExpression.Type is { }); 135Debug.Assert(TypeSymbol.Equals(accessExpressionType, nodeType.GetNullableUnderlyingType(), TypeCompareKind.ConsiderEverything2)); 140Debug.Assert(TypeSymbol.Equals(accessExpressionType, nodeType, TypeCompareKind.ConsiderEverything2) || 149Debug.Assert(loweredReceiver.Type is { }); 166Debug.Assert(temp is { }); 205Debug.Assert(newtarget is { Type: { } });
Lowering\LocalRewriter\LocalRewriter_ConditionalOperator.cs (1)
21Debug.Assert(node.ConstantValueOpt == null);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (117)
25Debug.Assert(node.Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }); 39Debug.Assert(node.Operand is BoundConvertedSwitchExpression { WasTargetTyped: true }); 43Debug.Assert(node.Operand is BoundConditionalOperator { WasTargetTyped: true }); 47Debug.Assert(node.Operand is not null); 52Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true }); 56Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true } or 82Debug.Assert(result.Type!.Equals(toType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 94Debug.Assert(node.Type is not null); 95Debug.Assert(_compilation.IsReadOnlySpanType(node.Type)); 97Debug.Assert(byteType.SpecialType == SpecialType.System_Byte); 142Debug.Assert(byteArray.IsSZArray); 143Debug.Assert(byteArray.ElementType.SpecialType == SpecialType.System_Byte); 166Debug.Assert(node.OperatorKind is BinaryOperatorKind.Utf8Addition); 194Debug.Assert(utf8Addition.OperatorKind is BinaryOperatorKind.Utf8Addition); 224Debug.Assert(rewrittenNode.Type is { }); 271Debug.Assert(result.Type is { } rt && rt.Equals(rewrittenType, TypeCompareKind.AllIgnoreOptions)); 306Debug.Assert(oldNodeOpt == null || oldNodeOpt.Syntax == syntax); 307Debug.Assert(rewrittenType is { }); 308Debug.Assert(_factory.ModuleBuilderOpt is { }); 309Debug.Assert(_diagnostics.DiagnosticBag is { }); 319Debug.Assert(rewrittenOperand.Type is { }); 433Debug.Assert(rewrittenOperand.Type is { }); 448Debug.Assert(rewrittenOperand.Type is { }); 451Debug.Assert(rewrittenOperand.Type.Equals(rewrittenType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 494Debug.Assert(rewrittenOperand.Type is { }); 504Debug.Assert(rewrittenOperand.Type.IsEnumType()); 515Debug.Assert(rewrittenType.IsEnumType()); 541Debug.Assert(conversion.Method is null); 542Debug.Assert(!conversion.IsExtensionMethod); 543Debug.Assert(constantValueOpt == null); 560Debug.Assert(symbolOpt is { }); 570Debug.Assert(oldNodeOpt is { }); 573Debug.Assert(method is { }); 577Debug.Assert(receiver is { }); 584Debug.Assert(_factory.TopLevelMethod is { }); 602Debug.Assert(rewrittenOperand.Type is not null); 613Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions)); 629Debug.Assert(sourceType is not null); 642Debug.Assert(parameterType.IsSZArray()); 643Debug.Assert(rewrittenOperand.Type?.IsSZArray() == true); 645Debug.Assert(c.IsImplicit || conversion.IsExplicit); 646Debug.Assert(c.IsReference || c.IsIdentity); 660Debug.Assert(destinationType.IsReadOnlySpan()); 661Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 670Debug.Assert(implicitOperator.ParameterTypesWithAnnotations[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions)); 692Debug.Assert(destinationType.IsReadOnlySpan()); 693Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 694Debug.Assert(Binder.NeedsSpanCastUp(sourceType, destinationType)); 704Debug.Assert(method.ParameterTypesWithAnnotations[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions)); 711Debug.Assert(destinationType.IsReadOnlySpan()); 712Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 719Debug.Assert(method.Parameters[0].Type.IsStringType()); 720Debug.Assert(rewrittenOperand.Type?.IsStringType() == true); 757Debug.Assert(_factory.ModuleBuilderOpt is { }); 770Debug.Assert((object)target != null); 832Debug.Assert(rewrittenOperand.Type is { }); 864Debug.Assert(conversion.IsValid); 889Debug.Assert(conversion.Method is { }); 890Debug.Assert(conversion.BestUserDefinedConversionAnalysis is { }); 916Debug.Assert(rewrittenOperand.Type is { }); 956Debug.Assert(conversion.IsValid); 957Debug.Assert(conversion.BestUnionConversionAnalysis is { }); 961Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm); 962Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 963Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions)); 964Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions)); 965Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions)); 966Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true }); 970Debug.Assert(!analysis.SourceConversion.IsIdentity); 979Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions)); 986Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.ToType, TypeCompareKind.AllIgnoreOptions)); 990Debug.Assert(!analysis.TargetConversion.IsIdentity); 999Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, rewrittenType, TypeCompareKind.AllIgnoreOptions)); 1023Debug.Assert(rewrittenOperand.Type is { }); 1064Debug.Assert(expression.Type is { }); 1111Debug.Assert((object)rewrittenType != null); 1119Debug.Assert(rewrittenOperandType is { }); 1120Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType()); 1167Debug.Assert((object)rewrittenType != null); 1168Debug.Assert(rewrittenOperand.Type is { }); 1170Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType()); 1293Debug.Assert(conversion.Method is { }); 1313Debug.Assert(operand != null); 1314Debug.Assert((object)type != null); 1382Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 1383Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 1384Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 1415Debug.Assert(conversion.Method is { } && !conversion.Method.ReturnsVoid && conversion.Method.ParameterCount == 1); 1416Debug.Assert(rewrittenOperand.Type is { }); 1448Debug.Assert(TypeSymbol.Equals(result.Type, rewrittenType, TypeCompareKind.ConsiderEverything2)); 1456Debug.Assert(resultType.IsNullableType() && TypeSymbol.Equals(resultType.GetNullableUnderlyingType(), call.Method.ReturnType, TypeCompareKind.ConsiderEverything2)); 1471Debug.Assert(rewrittenOperand.Type is { }); 1487Debug.Assert((object)rewrittenType != null); 1488Debug.Assert(rewrittenOperand.Type.IsNullableType()); 1519Debug.Assert(conversion.Method is { }); 1559Debug.Assert(conversion.IsUnion); 1560Debug.Assert(conversion.Method is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true })); 1561Debug.Assert(rewrittenOperand.Type is { }); 1562Debug.Assert(!_inExpressionLambda); 1563Debug.Assert(conversion.Method.Parameters[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions)); 1602Debug.Assert(rewrittenOperand != null); 1603Debug.Assert((object)rewrittenType != null); 1604Debug.Assert(rewrittenOperand.Type is { }); 1605Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr); 1618Debug.Assert(!method.ReturnsVoid); 1619Debug.Assert(method.ParameterCount == 1); 1625Debug.Assert(target.IsNullableType()); 1651Debug.Assert((object)source != null); 1652Debug.Assert((object)target != null); 1811Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal); 1830Debug.Assert(operand.Type is { }); 1861Debug.Assert(TypeSymbol.Equals(method.ReturnType, toType, TypeCompareKind.ConsiderEverything2)); 1878Debug.Assert(meth is { }); 1914Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr); 1945Debug.Assert(underlying is { }); 1958Debug.Assert(underlying is { }); 1990Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (19)
20Debug.Assert(right.Conversion.Kind == ConversionKind.Deconstruction); 42Debug.Assert(left.Type is { }); 65Debug.Assert(!conditional.IsRef); 87Debug.Assert(returnValue is null); 114Debug.Assert(right is not ({ Kind: BoundKind.TupleLiteral } or BoundConversion { Operand.Kind: BoundKind.TupleLiteral })); 162Debug.Assert(target is { Single: not null, NestedVariables: null } or { Single: null, NestedVariables: not null }); 172Debug.Assert(!IsCapturedPrimaryConstructorParameter(single)); 219Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 223Debug.Assert(!deconstructConversionInfo.IsDefault); 224Debug.Assert(leftTargets.Count == rightParts.Length && leftTargets.Count == deconstructConversionInfo.Length); 231Debug.Assert(placeholder is not null); 232Debug.Assert(nestedConversion is not null); 247Debug.Assert(leftTarget is { Type: { } }); 259Debug.Assert(builder is null || resultPart is { }); 286Debug.Assert(!IsTupleExpression(right.Kind)); 319Debug.Assert(right.Type is { }); 338Debug.Assert(expression.Type is { }); 339Debug.Assert(expression.Type.IsTupleType); 463Debug.Assert(variable.Type is { });
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (2)
16Debug.Assert(!node.Type.IsAnonymousType); // Missing EnsureParamCollectionAttributeExists call? 32Debug.Assert(method is { });
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (2)
17Debug.Assert(node != null); 21Debug.Assert(rewrittenBody is { });
Lowering\LocalRewriter\LocalRewriter_Event.cs (17)
57Debug.Assert(method is { }); 58Debug.Assert(method.ReturnType.Equals(node.Type, TypeCompareKind.AllIgnoreOptions)); 91Debug.Assert(eventSymbol.IsStatic || rewrittenReceiverOpt is { }); 186Debug.Assert(sideEffects.Any(), "Otherwise, we shouldn't be building a sequence"); 193Debug.Assert(left.IsUsableAsField); 196Debug.Assert(eventSymbol.HasAssociatedField); 197Debug.Assert(eventSymbol.IsWindowsRuntimeEvent); 213Debug.Assert(node.IsUsableAsField); 227Debug.Assert(eventSymbol.HasAssociatedField); 230Debug.Assert(fieldSymbol is { }); 238Debug.Assert(fieldType.Name == "EventRegistrationTokenTable"); 311Debug.Assert(parameters0Type.IsObjectType()); 313Debug.Assert(c0.IsImplicit); 314Debug.Assert(c0.IsReference); 317Debug.Assert(parameters1Type.SpecialType == SpecialType.System_Delegate); 319Debug.Assert(c1.IsImplicit); 320Debug.Assert(c1.IsReference);
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (23)
49Debug.Assert(rewrittenBody is { }); 53Debug.Assert(statementBuilder.Count == numFixedLocals + 1 + 1); 84Debug.Assert(node is { }); 135Debug.Assert(node.Parent is TryStatementSyntax); 144Debug.Assert(node is { } && node.Kind() == SyntaxKind.TryStatement); 200Debug.Assert(!ReferenceEquals(initializer, null)); 241Debug.Assert(initializerExpr.Type is { TypeKind: TypeKind.Pointer }); 245Debug.Assert(initializerExpr.Kind == BoundKind.AddressOfOperator); 256Debug.Assert(declarator != null); 268Debug.Assert(pinnedTemp.IsPinned); 269Debug.Assert(!localSymbol.IsPinned); 308Debug.Assert(initializerExpr.Type is { }); 313Debug.Assert(getPinnableMethod is { }); 317Debug.Assert(declarator != null); 388Debug.Assert(nullableBoundTemp is not null); 389Debug.Assert(nullableTempAssignment is not null); 445Debug.Assert(initializerType is { }); 449Debug.Assert(declarator != null); 458Debug.Assert(pinnedTemp.IsPinned); 459Debug.Assert(!localSymbol.IsPinned); 514Debug.Assert(initializerType is { }); 521Debug.Assert(pinnedTemp.IsPinned); 522Debug.Assert(!localSymbol.IsPinned);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (35)
44Debug.Assert(nodeExpressionType is { }); 122Debug.Assert(enumeratorInfo != null); 125Debug.Assert(rewrittenBody is { }); 231Debug.Assert(moveNextAwaitableInfo is { GetResult: not null } or { RuntimeAsyncAwaitCall: not null }); 346Debug.Assert(_factory.CurrentFunction is { }); 372Debug.Assert(idisposableTypeSymbol is { }); 403Debug.Assert(enumeratorType.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T); 428Debug.Assert(!enumeratorType.IsSealed); 429Debug.Assert(!enumeratorInfo.IsAsync); 430Debug.Assert(idisposableTypeSymbol is { }); 431Debug.Assert(disposeMethod is { }); 507Debug.Assert(receiver.Type is { }); 510Debug.Assert(receiverConversion.IsImplicit); 511Debug.Assert(!receiverConversion.IsUserDefined); 512Debug.Assert(!receiverConversion.IsUnion); 537Debug.Assert(!receiverConversion.IsNumeric); 572Debug.Assert(rewrittenBody is { }); 574Debug.Assert(node.EnumeratorInfoOpt is not null); 609Debug.Assert(collectionType is { }); 747Debug.Assert(rewrittenExpression.Type is not null); 769Debug.Assert(rewriter._factory.ModuleBuilderOpt is { }); 770Debug.Assert(rewriter._diagnostics.DiagnosticBag is { }); 779Debug.Assert(enumeratorInfo.InlineArraySpanType == WellKnownType.System_ReadOnlySpan_T); 795Debug.Assert(length > 0); 819Debug.Assert(iterationVariables.Length == 1); 876Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 879Debug.Assert(rewrittenBody is { }); 904Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 910Debug.Assert(arrayType is { IsSZArray: true }); 1025Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1028Debug.Assert(rewrittenBody is { }); 1053Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1060Debug.Assert(!arrayType.IsSZArray); 1206Debug.Assert(forLoop != null); 1246Debug.Assert(result is { });
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (5)
17Debug.Assert(node != null); 23Debug.Assert(rewrittenBody is { }); 51Debug.Assert(original.Kind is BoundKind.ForStatement or BoundKind.ForEachStatement or BoundKind.CollectionExpressionSpreadElement); 52Debug.Assert(rewrittenBody != null); 213Debug.Assert(rewrittenBody != null);
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (2)
17Debug.Assert(rewrittenExpression != null); 36Debug.Assert(discardedReceiver is null);
Lowering\LocalRewriter\LocalRewriter_HostObjectMemberReference.cs (3)
13Debug.Assert(_previousSubmissionFields != null); 14Debug.Assert(_factory.TopLevelMethod is { IsStatic: false }); 15Debug.Assert(_factory.CurrentType is { });
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (4)
16Debug.Assert(node != null); 25Debug.Assert(rewrittenConsequence is { }); 91Debug.Assert(elseIfStatement is not null); 100Debug.Assert(builder[conditionalGotoIndex] is BoundConditionalGoto);
Lowering\LocalRewriter\LocalRewriter_Index.cs (3)
15Debug.Assert(node.MethodOpt != null); 71Debug.Assert(targetNullableType.IsNullableType()); 72Debug.Assert(TypeSymbol.Equals(targetNullableType.GetNullableUnderlyingType(), underlyingValue.Type, TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (81)
70Debug.Assert(node.AccessorKind != AccessorKind.Unknown); 71Debug.Assert(node.Indexer.IsIndexer || node.Indexer.IsIndexedProperty); 72Debug.Assert((object?)node.Indexer.GetOwnOrInheritedGetMethod() != null); 80Debug.Assert(indexer.IsIndexer || indexer.IsIndexedProperty); 81Debug.Assert(node.AccessorKind != AccessorKind.Unknown); 82Debug.Assert(isLeftOfAssignment || (node.AccessorKind != AccessorKind.Set)); 86Debug.Assert(rewrittenReceiver is { }); 117Debug.Assert(oldNode is BoundIndexerAccess or BoundObjectInitializerMember); 118Debug.Assert(arguments.Length != 0); 119Debug.Assert(rewrittenReceiver is { }); 124Debug.Assert(oldNode.Type is not null); 125Debug.Assert(oldNode.Type.Equals(type, TypeCompareKind.ConsiderEverything)); 162Debug.Assert(getMethod is not null); 197Debug.Assert(receiverIsKnownToBeCaptured || rewrittenReceiverBeforePossibleCapture != (object?)rewrittenReceiver); 199Debug.Assert(storesOpt is { }); 220Debug.Assert(call.Type is not null); 224Debug.Assert(sideEffects.IsEmpty); 242Debug.Assert(_factory.ModuleBuilderOpt is { }); 243Debug.Assert(_diagnostics.DiagnosticBag is { }); 244Debug.Assert(node.Expression.Type is object); 245Debug.Assert(node.Argument.Type is object); 257Debug.Assert(getItemOrSliceHelper is object); 268Debug.Assert(length > 0); 281Debug.Assert(receiverStore is null); 282Debug.Assert(Binder.IsWellKnownSystemRange(node.Argument.Type, _compilation)); 296Debug.Assert(!startOnlyOverload.IsExtensionBlockMember()); 324Debug.Assert(rewrittenRangeArg is not null); 388Debug.Assert(node.Expression.Type is object); 405Debug.Assert(node.Expression.Type is object); 406Debug.Assert(index.Type?.SpecialType == SpecialType.System_Int32); 423Debug.Assert(node.GetItemOrSliceHelper is WellKnownMember.System_ReadOnlySpan_T__get_Item); 442Debug.Assert(node.GetItemOrSliceHelper is WellKnownMember.System_ReadOnlySpan_T__get_Item); 452Debug.Assert(index.ConstantValueOpt is null); // Binder should have reported an error due to index out of bounds, or should have handled by code above. 507Debug.Assert(Binder.IsWellKnownSystemRange(argumentType, _compilation)); 508Debug.Assert(!isLeftOfAssignment || node.IndexerOrSliceAccess.GetRefKind() == RefKind.Ref); 542Debug.Assert(node.ArgumentPlaceholders.Length == 1); 543Debug.Assert(node.IndexerOrSliceAccess is BoundIndexerAccess or BoundArrayAccess); 545Debug.Assert(TypeSymbol.Equals( 563Debug.Assert(receiver.Type is { }); 577Debug.Assert(node.LengthOrCountAccess.ExpressionSymbol is not null); 578Debug.Assert(node.IndexerOrSliceAccess.ExpressionSymbol is not null); 589Debug.Assert(receiverLocal.LocalSymbol.Type is { IsReferenceType: false, IsValueType: false }); 640Debug.Assert(node.ArgumentPlaceholders.Length == 1); 642Debug.Assert(integerArgument.Type!.SpecialType == SpecialType.System_Int32); 648Debug.Assert(indexerAccess.Arguments.Length == 1); 665Debug.Assert(locals is not null); 732Debug.Assert(lengthAccess is not null); 736Debug.Assert(loweredExpr is not null); 737Debug.Assert(lengthAccess is not null); 738Debug.Assert(loweredExpr.Type!.SpecialType == SpecialType.System_Int32); 748Debug.Assert(loweredExpr is not null); 749Debug.Assert(loweredExpr.Type!.SpecialType == SpecialType.System_Int32); 753Debug.Assert(loweredExpr is not null); 754Debug.Assert(lengthAccess is not null); 755Debug.Assert(Binder.IsWellKnownSystemIndex(loweredExpr.Type, _compilation)); 785Debug.Assert(TypeSymbol.Equals( 794Debug.Assert(hatExpression.Operand is { Type: { SpecialType: SpecialType.System_Int32 } }); 854Debug.Assert(node.ArgumentPlaceholders.Length == 2); 855Debug.Assert(node.IndexerOrSliceAccess is BoundCall); 857Debug.Assert(Binder.IsWellKnownSystemRange(node.Argument.Type, _compilation)); 881Debug.Assert(receiver.Type is { }); 896Debug.Assert(node.LengthOrCountAccess.ExpressionSymbol is not null); 897Debug.Assert(node.IndexerOrSliceAccess.ExpressionSymbol is not null); 925Debug.Assert(receiverLocal.LocalSymbol.Type is { IsReferenceType: false, IsValueType: false }); 955Debug.Assert(startStrategy is not PatternIndexOffsetLoweringStrategy.Length); 956Debug.Assert(endMakeOffsetInput is not null || endStrategy == PatternIndexOffsetLoweringStrategy.Length); 963Debug.Assert(!startOnlyOverload.IsExtensionBlockMember()); 968Debug.Assert(startMakeOffsetInput is not null); 980Debug.Assert(!needSpecialExtensionReceiverReadOrder); 1044Debug.Assert(startStrategy != PatternIndexOffsetLoweringStrategy.Zero || (rewriteFlags & captureStartOffset) == 0); 1045Debug.Assert((rewriteFlags & captureEndOffset) == 0 || (rewriteFlags & captureStartOffset) != 0 || startStrategy == PatternIndexOffsetLoweringStrategy.Zero); 1046Debug.Assert((rewriteFlags & captureStartOffset) == 0 || (rewriteFlags & captureEndOffset) != 0 || endStrategy == PatternIndexOffsetLoweringStrategy.Length); 1047Debug.Assert(endStrategy != PatternIndexOffsetLoweringStrategy.Length || (rewriteFlags & captureEndOffset) == 0); 1048Debug.Assert((rewriteFlags & captureLength) == 0 || (rewriteFlags & useLength) != 0); 1052Debug.Assert(startMakeOffsetInput is not null); 1058Debug.Assert(endMakeOffsetInput is not null); 1095Debug.Assert(rewrittenRangeArg is not null); 1099Debug.Assert(node.ArgumentPlaceholders.Length == 2); 1138Debug.Assert(startLengthOverload.Name == startOverload.Name 1168Debug.Assert(methodDefinition.IsDefinition); 1179Debug.Assert(startLengthOverload.Name == startOverload.Name
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (4)
51Debug.Assert(operandType is { } || rewrittenOperand.ConstantValueOpt!.IsNull); 52Debug.Assert(targetType is { }); 88Debug.Assert(constantValue == ConstantValue.True || constantValue == ConstantValue.False); 89Debug.Assert((object)type != null);
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (8)
66Debug.Assert(w.WhenFalse is null); 119Debug.Assert(node.Type is { SpecialType: SpecialType.System_Boolean }); 178Debug.Assert(test.Type.SpecialType == SpecialType.System_Boolean); 278Debug.Assert(leafNode.Label == whenTrueLabel); 283Debug.Assert(whenNode.WhenExpression == null); 284Debug.Assert(whenNode.WhenTrue is BoundLeafDecisionDagNode d && d.Label == whenTrueLabel); 307Debug.Assert(_sideEffectBuilder.Count == 0); 315Debug.Assert(result != null);
Lowering\LocalRewriter\LocalRewriter_LabeledStatement.cs (1)
16Debug.Assert(node != null);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (13)
19Debug.Assert(node.ConstantValueOpt is { }); 25Debug.Assert(constantValue != null); 30Debug.Assert(type is { SpecialType: SpecialType.System_Decimal }); 38Debug.Assert(type is { SpecialType: SpecialType.System_DateTime }); 53Debug.Assert(constantValue != null); 54Debug.Assert(constantValue.IsDecimal); 71Debug.Assert(curMethod is { }); 132Debug.Assert((object)ctor != null); 133Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_Decimal); 144Debug.Assert(constantValue != null); 145Debug.Assert(constantValue.IsDateTime); 151Debug.Assert((object)ctor != null); 152Debug.Assert(ctor.ContainingType.SpecialType == SpecialType.System_DateTime);
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (4)
28Debug.Assert(rewrittenBody is { }); 35Debug.Assert(rewrittenArgument.ConstantValueOpt == ConstantValue.Null); 47Debug.Fail("We should have reported an error during binding if lock type info cannot be found."); 201Debug.Assert(enterMethod.ParameterCount == 1);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (10)
16Debug.Assert(node.Type is { }); 20Debug.Assert(node.LeftOperand.Type is { }); 24Debug.Assert(transformedLHS.Type is { }); 41Debug.Assert(TypeSymbol.Equals(transformedLHS.Type, node.LeftOperand.Type, TypeCompareKind.AllIgnoreOptions)); 50Debug.Assert(assignment.Type is { }); 61Debug.Assert(conditionalExpression.Type is { }); 82Debug.Assert(node.LeftOperand.Type.IsNullableType()); 113Debug.Assert(!_inExpressionLambda && lhsRead.Kind != BoundKind.PropertyAccess); 136Debug.Assert(transformedLHS.Type.GetNullableUnderlyingType().Equals(tmp.Type.StrippedType(), TypeCompareKind.AllIgnoreOptions)); 140Debug.Assert(TypeSymbol.Equals(transformedLHS.Type, node.LeftOperand.Type, TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (18)
31Debug.Assert(rewrittenLeft != null); 32Debug.Assert(rewrittenRight != null); 33Debug.Assert(BoundNode.GetConversion(leftConversion, leftPlaceholder).IsValid); 34Debug.Assert(rewrittenResultType is { }); 35Debug.Assert(rewrittenRight.Type is { }); 36Debug.Assert(rewrittenRight.Type.Equals(rewrittenResultType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 42Debug.Assert(rewrittenLeft.Type is { }); 46Debug.Assert(leftPlaceholder is not null); 75Debug.Assert(!rewrittenLeft.ConstantValueOpt.IsNull); 90Debug.Assert(rewrittenLeft.Type is { }); 167Debug.Assert(convertedLeft.HasErrors || convertedLeft.Type!.Equals(rewrittenResultType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 179Debug.Assert(conditionalExpression.ConstantValueOpt == null); // we shouldn't have hit this else case otherwise 180Debug.Assert(conditionalExpression.Type!.Equals(rewrittenResultType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 237Debug.Assert(rewrittenLeft != null); 238Debug.Assert(rewrittenLeft.Type is { }); 239Debug.Assert(rewrittenResultType is { }); 240Debug.Assert(BoundNode.GetConversion(leftConversion, leftPlaceholder).IsValid); 243Debug.Assert(rewrittenLeftType.IsNullableType() || !rewrittenLeftType.IsValueType);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (16)
33Debug.Assert(node != null); 55Debug.Assert(receiverDiscard is null); 81Debug.Assert(TypeSymbol.Equals(rewrittenObjectCreation.Type, ((NamedTypeSymbol)node.Type).ComImportCoClass, TypeCompareKind.ConsiderEverything2)); 114Debug.Assert(TypeSymbol.Equals(rewrittenObjectCreation.Type, ((NamedTypeSymbol)node.Type).ComImportCoClass, TypeCompareKind.ConsiderEverything2)); 135Debug.Assert(receiver.Type!.Equals(type, TypeCompareKind.ConsiderEverything)); 183Debug.Assert(withExpr.CloneMethod is not null); 184Debug.Assert(withExpr.CloneMethod.ParameterCount == 0); 191Debug.Assert(c.IsReference || c.IsIdentity); 214Debug.Assert(left.MemberSymbol is not null); 223Debug.Assert(property.MemberIndexOpt!.Value >= 0 && property.MemberIndexOpt.Value < anonymousType.Properties.Length); 266Debug.Assert(!_inExpressionLambda); 267Debug.Assert(initializerExpression != null && !initializerExpression.HasErrors); 345Debug.Assert((object)method != null); 389Debug.Assert(node.GuidString is { }); 421Debug.Assert(instance.Type.IsObjectType()); 423Debug.Assert(c.IsReference);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (42)
38Debug.Assert(!_inExpressionLambda); 39Debug.Assert(rewrittenReceiver != null); 68Debug.Assert(_inExpressionLambda); 100Debug.Assert(!elementInitializer.AddMethod.CallsAreOmitted(initializer.SyntaxTree)); 102Debug.Assert(!elementInitializer.InvokedAsExtensionMethod); 103Debug.Assert(!elementInitializer.AddMethod.IsExtensionMethod); 104Debug.Assert(!elementInitializer.AddMethod.IsExtensionBlockMember()); 105Debug.Assert(elementInitializer.Arguments.Length == elementInitializer.AddMethod.ParameterCount); 106Debug.Assert(elementInitializer.ImplicitReceiverOpt is BoundObjectOrCollectionValuePlaceholder); 129Debug.Assert(rewrittenReceiver is { } || _inExpressionLambda); 143Debug.Assert(!_inExpressionLambda); 144Debug.Assert(initializer.Kind == BoundKind.DynamicCollectionElementInitializer); 183Debug.Assert(addMethod.Name == "Add"); 184Debug.Assert(addMethod.Parameters 187Debug.Assert(initializer.Arguments.Any()); 188Debug.Assert(!_inExpressionLambda); 231Debug.Assert(addMethod.IsStatic); 232Debug.Assert(addMethod.IsExtensionMethod); 233Debug.Assert(rewrittenReceiver is null); 272Debug.Assert(temps != null); 289Debug.Assert(!_inExpressionLambda); 309Debug.Assert(rewrittenReceiver != null); 310Debug.Assert(!_inExpressionLambda); 332Debug.Assert(memberInit is { }); 336Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsArrayOrCollection) <= (memberInit.Expanded ? 1 : 0)); 360Debug.Assert(!memberInit.Expanded); 377Debug.Assert(setMember.SiteInitialization is { }); 389Debug.Assert(getMember.SiteInitialization is { }); 400Debug.Assert(assignment.Type.IsDynamic() || TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 411Debug.Assert(initializerMember is { }); 421Debug.Assert(setMember.SiteInitialization is { }); 428Debug.Assert(getMember.SiteInitialization is { }); 437Debug.Assert(rewrittenArrayAccess is { }); 441Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection)); 452Debug.Assert(getSubArrayCall.Arguments.Length == 2); 454Debug.Assert(Binder.IsWellKnownSystemRange(rangeArgument.Type, _compilation)); 472Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 505Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 540Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 579Debug.Assert(initializers is not null); 697Debug.Assert(memberSymbol is object); 701Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit ||
Lowering\LocalRewriter\LocalRewriter_PointerElementAccess.cs (2)
46Debug.Assert(rewrittenExpression.Type is { }); 47Debug.Assert(rewrittenIndex.Type is { });
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.cs (4)
15Debug.Assert(targetType.TypeKind == TypeKind.Submission); 16Debug.Assert(_factory.TopLevelMethod is { IsStatic: false }); 17Debug.Assert(_factory.CurrentType is { }); 19Debug.Assert(_previousSubmissionFields != null);
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (4)
84Debug.Assert(argumentRefKindsOpt.IsDefaultOrEmpty); 93Debug.Assert(getMethod is { }); 94Debug.Assert(getMethod.ParameterCount == rewrittenArguments.Length); 95Debug.Assert(getMethodOpt is null || ReferenceEquals(getMethod, getMethodOpt));
Lowering\LocalRewriter\LocalRewriter_Range.cs (17)
19Debug.Assert(node != null && node.MethodOpt != null); 54Debug.Assert(operand != null); 56Debug.Assert(operand.Type is { }); 65Debug.Assert(operand.Type is { }); 79Debug.Assert(node.Type.IsNullableType()); 80Debug.Assert(left?.Type?.IsNullableType() == true || right?.Type?.IsNullableType() == true); 81Debug.Assert(!(left is null && right is null)); 82Debug.Assert(node.MethodOpt is { }); 93Debug.Assert(condition != null); 131Debug.Assert(tempOperand.Type is { }); 181Debug.Assert(left is null ^ right is null); 182Debug.Assert(constructionMethod.MetadataName == "StartAt" || 184Debug.Assert(constructionMethod.IsStatic); 186Debug.Assert(arg is { }); 192Debug.Assert(constructionMethod.MetadataName == "get_All"); 193Debug.Assert(constructionMethod.IsStatic); 194Debug.Assert(left is null && right is null);
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (2)
29Debug.Assert(type is { }); 123Debug.Assert(size > 0);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (25)
25Debug.Assert(IsBinaryStringConcatenation(operatorKind)); 26Debug.Assert(!_inExpressionLambda); 32Debug.Assert(ReferenceEquals(arguments[0], left)); 48Debug.Assert(IsBinaryStringConcatenation(originalOperator)); 74Debug.Assert(!_inExpressionLambda); 75Debug.Assert(visitedArguments.All(arg => arg.Type!.SpecialType is SpecialType.System_String or SpecialType.System_Char or SpecialType.System_Object)); 109Debug.Assert(argumentType is not null); 195Debug.Assert(method is not null); 210Debug.Assert(!_inExpressionLambda); 225Debug.Assert(ReferenceEquals(singleConcatArgument, visitedCompoundAssignmentLeftRead)); 226Debug.Assert((destinationArguments.Count == 0 && followingArgument is null) || (destinationArguments.Count != 0 && ReferenceEquals(followingArgument, destinationArguments[^1]))); 227Debug.Assert(nestedConcatArguments.IsDefault); 334Debug.Assert(constantValue.IsString || constantValue.IsChar); 357Debug.Assert(argument is not BoundBinaryOperator { InterpolatedStringHandlerData: null } op || !IsBinaryStringConcatenation(op)); 380Debug.Assert((finalArguments.Count == 0 && followingArgument is null) || (finalArguments.Count != 0 && ReferenceEquals(followingArgument, finalArguments[^1]))); 381Debug.Assert(singleConcatArgument is null ^ nestedConcatArguments.IsDefault); 521Debug.Assert(arg.Type is not null); 528Debug.Assert(readOnlySpanCtorRefParamChar.Parameters[0].RefKind != RefKind.Out); 552Debug.Assert(arg.HasAnyErrors || arg.Type.SpecialType == SpecialType.System_String); 553Debug.Assert(stringImplicitConversionToReadOnlySpan is not null); 579Debug.Assert(IsBinaryStringConcatenation(current)); 596Debug.Assert(stack.Count > 0); 608Debug.Assert(method is not null); 652Debug.Assert(expr.Type is not null); 759Debug.Assert(!IsCapturedPrimaryConstructorParameter(expr));
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (21)
18Debug.Assert(conversion.ConversionKind == ConversionKind.InterpolatedString); 20Debug.Assert(interpolatedString.InterpolationData is { Construction: not null }); 31Debug.Assert(data.BuilderType is not null); 32Debug.Assert(data.ReceiverPlaceholder is not null); 33Debug.Assert(parts.All(static p => p is BoundCall or BoundDynamicInvocation)); 51Debug.Assert(construction.ArgumentRefKindsOpt[i] == RefKind.None); 52Debug.Assert(construction.DefaultArguments[i]); 58Debug.Assert(localType.SpecialType == SpecialType.System_Boolean); 75Debug.Assert(call.Type.SpecialType == SpecialType.System_Boolean == usesBoolReturns); 98Debug.Assert(!parts.IsEmpty); 118Debug.Assert(currentExpression != null); 145Debug.Assert(node.Type is { SpecialType: SpecialType.System_String }); // if target-converted, we should not get here. 177Debug.Assert(part is BoundLiteral && part.ConstantValueOpt?.StringValue is not null); 186Debug.Assert(result is not null); 193Debug.Assert(result is not null); 194Debug.Assert(result.Type is not null); 195Debug.Assert(result.Type.SpecialType == SpecialType.System_String || result.Type.IsErrorType()); 214Debug.Assert(node.InterpolationData is { Construction: not null }); 243Debug.Assert(((BoundObjectCreationExpression)data.Construction).Arguments.All( 251Debug.Assert(arguments.All(arg => arg is not BoundConversion { Conversion: { IsInterpolatedStringHandler: true }, ExplicitCastInCode: false })); 284Debug.Assert(_statements.IsDefault ^ _expressions.IsDefault);
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (9)
57Debug.Assert(savedInputExpression != null); 131Debug.Assert(c.IsImplicit); 132Debug.Assert(c.IsBoxing || c.IsReference || c.IsIdentity); 170Debug.Assert(factory.ModuleBuilderOpt is not null); 174Debug.Assert(diagnostics is not null); 185Debug.Assert(factory.ModuleBuilderOpt is not null); 189Debug.Assert(diagnostics is not null); 199Debug.Assert(factory.ModuleBuilderOpt is not null); 203Debug.Assert(diagnostics is not null);
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (2)
17Debug.Assert(tryBlock is { }); 89Debug.Assert(rewrittenBody is { });
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (11)
54Debug.Assert(expr.Type == (object?)o.Type || expr.Type is { } && expr.Type.Equals(o.Type, TypeCompareKind.AllIgnoreOptions)); 108Debug.Assert(expr.Type is { }); 111Debug.Assert(boundConversion.Operand.Type is { }); 374Debug.Assert(expr.Type is { }); 404Debug.Assert(expr.Type is { }); 447Debug.Assert(expr.Type is { }); 450Debug.Assert(operand.Type is { }); 455Debug.Assert(underlyingConversions.Length == tupleCardinality); 514Debug.Assert(currentResult is { }); 531Debug.Assert(tuple.Type is { IsTupleType: true }); 590Debug.Assert(boolOperator.ReturnType.SpecialType == SpecialType.System_Boolean);
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (2)
39Debug.Assert(node.Type is { }); 45Debug.Assert(type.IsTupleType);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (42)
38Debug.Assert(false); // these should have been represented as a BoundIncrementOperator 85Debug.Assert((kind == UnaryOperatorKind.DynamicTrue || kind == UnaryOperatorKind.DynamicFalse) && type.SpecialType == SpecialType.System_Boolean 87Debug.Assert(method is null); 113Debug.Assert(method is { }); 114Debug.Assert(TypeSymbol.Equals(type, method.ReturnType, TypeCompareKind.ConsiderEverything2)); 134Debug.Assert(underlyingType is { }); 277Debug.Assert(result.Type is { }); 328Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 329Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 330Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 407Debug.Assert(node.MethodOpt is { }); 408Debug.Assert(node.OperandConversion is null || (node.Operand.Type!.IsReferenceType && node.MethodOpt.IsExtensionBlockMember())); 414Debug.Assert(node.Type.IsVoidType()); 422Debug.Assert(operandType is { }); 423Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.AllIgnoreOptions)); 451Debug.Assert(node.OperandConversion is null); 459Debug.Assert(operandType is { }); 467Debug.Assert(TypeSymbol.Equals(operandType, transformedLHS.Type, TypeCompareKind.AllIgnoreOptions)); 588Debug.Assert(operandType is { }); 589Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.ConsiderEverything2)); 625Debug.Assert(transformedLHS is not BoundPropertyAccess); 641Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 661Debug.Assert(boundTemp.Type is not null); 701Debug.Assert(boundTemp.Type is not null); 704Debug.Assert(tempValue.Type is { }); 760Debug.Assert(placeholder is not null); 793Debug.Assert(node.MethodOpt is { }); 794Debug.Assert(node.MethodOpt.ParameterCount == 1); 805Debug.Assert(TypeSymbol.Equals(node.MethodOpt.GetParameterType(0), node.MethodOpt.ReturnType, TypeCompareKind.ConsiderEverything2)); 902Debug.Assert(constantOne != null); 903Debug.Assert(constantOne.SpecialType != SpecialType.None); 904Debug.Assert(binaryOperandType.SpecialType != SpecialType.None); 905Debug.Assert(binaryOperatorKind.OperandTypes() != 0); 932Debug.Assert(binaryOperatorKind.OperandTypes() == BinaryOperatorKind.PointerAndInt); 933Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer }); 934Debug.Assert(boundOne.Type is { SpecialType: SpecialType.System_Int32 }); 980Debug.Assert((object)method != null); // Should have been checked during Warnings pass 987Debug.Assert(operand.Type is { SpecialType: SpecialType.System_Decimal }); 994Debug.Assert(operand.Type is { } && operand.Type.IsNullableType() && operand.Type.GetNullableUnderlyingType().SpecialType == SpecialType.System_Decimal); 1180Debug.Assert(underlyingType is { }); 1185Debug.Assert(underlyingType.IsEnumType()); 1187Debug.Assert(underlyingType is { });
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (17)
38Debug.Assert(rewrittenBody is { }); 50Debug.Assert(node.DeclarationsOpt is { }); 70Debug.Assert(declarations != null); 110Debug.Assert(node.ExpressionOpt != null); 111Debug.Assert(node.DeclarationsOpt == null); 130Debug.Assert(node.Locals.IsEmpty); // TODO: This might not be a valid assumption in presence of semicolon operator. 149Debug.Assert(rewrittenExpression.Type is { }); 214Debug.Assert(localDeclaration.InitializerOpt is { }); 219Debug.Assert((object)localType != null); //otherwise, there wouldn't be a conversion to IDisposable 224Debug.Assert(rewrittenDeclaration is { }); 357Debug.Assert((awaitKeywordOpt == default) == (awaitOpt is null)); 442Debug.Assert(awaitOpt is null || awaitKeyword != default); 499Debug.Assert(expression == null); 500Debug.Assert(method.Parameters.AsSpan()[1..].All(static (p) => (p.IsOptional || p.IsParams) && p.RefKind is RefKind.None or RefKind.In or RefKind.RefReadOnlyParameter)); 504Debug.Assert(method.Parameters.All(p => p.IsOptional || p.IsParams)); 507Debug.Assert(method.ParameterRefKinds.IsDefaultOrEmpty || method.ParameterRefKinds.All(static refKind => refKind is RefKind.In or RefKind.RefReadOnlyParameter or RefKind.None)); 508Debug.Assert(methodArgumentInfo.Arguments.All(arg => arg is not BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler }));
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (3)
18Debug.Assert(node != null); 22Debug.Assert(rewrittenBody is { }); 49Debug.Assert(loop.Kind is BoundKind.WhileStatement or BoundKind.ForEachStatement or BoundKind.CollectionExpressionSpreadElement);
Lowering\LocalRewriter\LocalRewriter.cs (38)
67Debug.Assert(factory.InstrumentationState != null); 73Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 102Debug.Assert(statement != null); 103Debug.Assert(compilationState != null); 148Debug.Assert(loweredStatement is { }); 214Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered"); 232Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered"); 244Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered"); 253Debug.Assert(!nameofOperator.WasCompilerGenerated); 285Debug.Assert(visited == null || visited.HasErrors || ReferenceEquals(visited.Type, node.Type) || 322Debug.Assert(CanBePassedByReference(node)); 324Debug.Assert(CanBePassedByReference(result)); 333Debug.Assert(_factory.ModuleBuilderOpt is { }); 513Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { }); 522Debug.Assert(value.Type is { } && (value.Type.Equals(placeholder.Type, TypeCompareKind.AllIgnoreOptions) || value.HasErrors)); 531Debug.Assert(_placeholderReplacementMapDoNotUseDirectly.Count == 0); 559Debug.Assert(placeholder is { }); 560Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { }); 563Debug.Assert(removed); 587Debug.Assert(node.Type is { }); 608Debug.Assert((syntax != null) ^ (location != null)); 658Debug.Assert(node.Type.ExtendedSpecialType == InternalSpecialType.System_Type || 660Debug.Assert(node.GetTypeFromHandle is null); 663Debug.Assert(sourceType is { }); 684Debug.Assert(getTypeFromHandle is not null); 685Debug.Assert(TypeSymbol.Equals(type, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions)); 691Debug.Assert(node.GetTypeFromHandle is null); 724Debug.Assert(statement is { }); 850Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array }); 880Debug.Assert(parent.Parent is { }); 929Debug.Assert(assignment.Left.Kind == BoundKind.FieldAccess); 1071Debug.Assert(eventAccess.ReceiverOpt is { }); 1072Debug.Assert(eventAccess.ReceiverOpt.Type is { }); 1082Debug.Assert(fieldAccess.ReceiverOpt is { }); 1083Debug.Assert(fieldAccess.ReceiverOpt.Type is { }); 1155Debug.Assert(!member.IsStatic); 1157Debug.Assert(extensionParameter is not null); 1168Debug.Assert(Conversions.IsValidExtensionMethodThisArgConversion(this._compilation.Conversions.ClassifyConversionFromType(receiver.Type, extensionParameter.Type, isChecked: false, ref discardedUseSiteInfo)));
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (26)
361Debug.Assert(inputTemp != loweredSwitchGoverningExpression); 444Debug.Assert(node == nodesToLower[indexOfNode]); 475Debug.Assert(test != null); 500Debug.Assert(!loweredNodes.Contains(node)); 528Debug.Assert(!loweredNodes.Contains(test2)); 567Debug.Assert(foundLabel); 634Debug.Assert(cases.Length == whenTrueCases.Length + whenFalseCases.Length); 710Debug.Assert(_fac is { }); 717Debug.Assert(x.Discriminator switch 726Debug.Assert(y.Discriminator == x.Discriminator); 794Debug.Assert(c.IsImplicit); 795Debug.Assert(c.IsNumeric); 804Debug.Assert(c.IsImplicit); 805Debug.Assert(c.IsNumeric); 1076Debug.Assert(found); 1096Debug.Assert(whenNodes.Count > 1); 1097Debug.Assert(whenNodes.All(n => n.Syntax == whenClauseSyntax)); 1098Debug.Assert(whenNodes.All(n => n.WhenExpression == whenExpression)); 1099Debug.Assert(whenNodes.All(n => n.Bindings == whenNodes[0].Bindings)); 1100Debug.Assert(whenNodes.All(n => GetDagNodeLabel(n.WhenTrue) == whenTrueLabel)); 1111Debug.Assert(whenNode.WhenFalse != null); 1120Debug.Assert(_whenNodeIdentifierLocal is not null); 1174Debug.Assert(whenFalse != null); 1180Debug.Assert(whenFalse == null); 1192Debug.Assert(left.Kind == BoundKind.Local && left == binding.VariableAccess); 1214Debug.Assert(sideEffect != null);
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.ValueDispatchNode.cs (10)
88Debug.Assert(op.OperandTypes() != 0); 109Debug.Assert(Math.Abs(l - r) <= 1); 117Debug.Assert(_height < 2 * Math.Log(_weight)); 127Debug.Assert(whenTrue.Height == this.WhenTrue.Height); 128Debug.Assert(whenFalse.Height == this.WhenFalse.Height); 142Debug.Assert(op.OperandTypes() != 0); 162Debug.Assert(Math.Abs(left.Height - right.Height) <= 2); 190Debug.Assert(leftDispatch.Right.Height == right.Height); 231Debug.Assert(rightDispatch.Left.Height == left.Height); 251Debug.Assert(Math.Abs(left.Height - right.Height) < 2);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (31)
172Debug.Assert(method.Name is WellKnownMemberNames.DeconstructMethodName or WellKnownMemberNames.TryGetValueMethodName); 175Debug.Assert(method.IsExtensionMethod); 195Debug.Assert(method.Name is WellKnownMemberNames.TryGetValueMethodName); 196Debug.Assert(method.ReturnType.SpecialType == SpecialType.System_Boolean); 215Debug.Assert(inputType is { }); 220Debug.Assert(_factory.ClassifyEmitConversion(input, inputType).IsIdentity); 230Debug.Assert(!conversion.IsUserDefined); 231Debug.Assert(!conversion.IsUnion); 261Debug.Assert(e.Property.GetMethod.ParameterCount == 1); 262Debug.Assert(e.Property.GetMethod.Parameters[0].Type.SpecialType == SpecialType.System_Int32); 322Debug.Assert(!e.Target.Equals(e.Input)); 369Debug.Assert(input.Type is { }); 383Debug.Assert(!input.Type.IsNullableType()); 387Debug.Assert(!input.Type.IsNullableType()); 388Debug.Assert(input.Type.IsValueType); 398Debug.Assert(!rewrittenExpr.Type.IsSpanOrReadOnlySpanChar()); 425Debug.Assert(operatorType != BinaryOperatorKind.Error); 435Debug.Assert(operatorKind.Operator() == BinaryOperatorKind.Equal); 444Debug.Assert(comparisonType.SpecialType switch 455Debug.Assert(c.IsNumeric || c.IsEnumeration); 459Debug.Assert(c.IsNumeric || c.IsEnumeration); 477Debug.Assert(sequenceEqual != null && asSpan != null); 510Debug.Assert(output.Type is { }); 546Debug.Assert(loweredInput.Type is { }); 566Debug.Assert(tempAssigned); 580Debug.Assert(l.LocalSymbol.DeclarationKind == LocalDeclarationKind.PatternVariable); 610Debug.Assert(savedInputExpression != null); 659Debug.Assert(field != null); 677Debug.Assert(!IsCapturedPrimaryConstructorParameter(expr)); 708Debug.Assert(!evalNode.Evaluation.Input.IsOriginalInput); 712Debug.Assert(!testNode.Test.Input.IsOriginalInput);
Lowering\LocalRewriter\LocalRewriter.PlaceholderReplacer.cs (2)
24Debug.Assert(result is not null); 31Debug.Assert(value is not null);
Lowering\LocalRewriter\LoweredDynamicOperation.cs (3)
54Debug.Assert(children.Length > 0); 63Debug.Assert(SiteInitialization == null && SiteInvocation is BoundBadExpression && _temps.IsDefaultOrEmpty); 68Debug.Assert(SiteInitialization is { });
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (18)
25Debug.Assert(factory != null); 83Debug.Assert(!isExplicit || !isArrayIndex); 120Debug.Assert(operatorKind.IsDynamic()); 158Debug.Assert(operatorKind.IsDynamic()); 205Debug.Assert(_factory.TopLevelMethod is { }); 545Debug.Assert(loweredReceiver.Type is { }); 570Debug.Assert(argumentNames.IsDefaultOrEmpty || loweredArguments.Length == argumentNames.Length); 571Debug.Assert(refKinds.IsDefault || loweredArguments.Length == refKinds.Length); 572Debug.Assert(!receiverIsStaticType || receiverRefKind == RefKind.None); 608Debug.Assert(!loweredArguments.IsDefault); 687Debug.Assert(factory.CompilationState.ModuleBuilderOpt is { }); 688Debug.Assert(factory.TopLevelMethod is { }); 689Debug.Assert(factory.CurrentFunction is { }); 715Debug.Assert(_currentDynamicCallSiteContainer is { }); 727Debug.Assert(refKinds.IsDefaultOrEmpty || refKinds.Length == loweredArguments.Length); 786Debug.Assert(_factory.CompilationState.ModuleBuilderOpt is { }); 794Debug.Assert(refKind != RefKind.RefReadOnlyParameter); 818Debug.Assert(refKind == RefKind.None || refKind == RefKind.Ref || refKind == RefKind.Out, "unexpected refKind in dynamic");
Lowering\LocalRewriter\PipelinePhaseValidator.cs (1)
101Debug.Assert(false, $"Bound nodes of kind {node.Kind} should not survive past {DoesNotSurvive(node.Kind)}");
Lowering\MethodToClassRewriter.cs (17)
40Debug.Assert(compilationState != null); 41Debug.Assert(diagnostics != null); 42Debug.Assert(diagnostics.DiagnosticBag != null); 109Debug.Assert(rewrittenMethodSymbol.IsMetadataVirtual(CompilationState.Compilation.SourceModule)); 114Debug.Assert(!rewrittenMethodSymbol.IsMetadataVirtual(CompilationState.Compilation.SourceModule)); 143Debug.Assert(methodBeingCalled.IsGenericMethod); 145Debug.Assert(typeArgs.Length == newMethod.Arity); 178Debug.Assert(wrapper.SynthesizesLoweredBoundBody); 224Debug.Assert(!NeedsProxy(node.LocalSymbol)); 274Debug.Assert(!proxies.ContainsKey(leftLocal.LocalSymbol)); 275Debug.Assert(originalRight.Kind != BoundKind.ConvertedStackAllocExpression); 282Debug.Assert(leftLocal.LocalSymbol.DeclarationKind == LocalDeclarationKind.None); 308Debug.Assert(!node.IsRef); 362Debug.Assert(member is not null); 393Debug.Assert(containingType.ContainingModule is SourceModuleSymbol); 394Debug.Assert(ReferenceEquals(methodBeingWrapped, methodBeingWrapped.ConstructedFrom)); 395Debug.Assert(!methodBeingWrapped.IsStatic);
Lowering\SpillSequenceSpiller.cs (39)
47Debug.Assert(value?.Kind != SpillSequenceBuilderKind); 217Debug.Assert(!_receiverSubstitution.ContainsKey(node.LocalSymbol)); 272Debug.Assert(builder.Value == null); 286Debug.Assert(statement != null); 290Debug.Assert(builder.Value == null); 308Debug.Assert(builder != null); 317Debug.Assert(refKind == RefKind.None); 318Debug.Assert(!sideEffectsOnly); 324Debug.Assert(refKind == RefKind.None); 325Debug.Assert(!sideEffectsOnly); 362Debug.Assert(receiverRefLocal.IsKnownToReferToTempIfReferenceType); 441Debug.Assert(call.Arguments.Length == 1); 451Debug.Assert(call.Arguments.Length == 1); 465Debug.Assert(call.Arguments.Length == 2); 473Debug.Assert(call.Arguments.Length == 1); 486Debug.Assert(objectCreationExpression.Arguments.Length == 1); 522Debug.Assert(call.Arguments.Length == 2); 591Debug.Assert(!sideEffectsOnly || refKinds.IsDefault); 592Debug.Assert(refKinds.IsDefault || refKinds.Length == args.Length); 600Debug.Assert(newList.Length == args.Length); 638Debug.Assert(sideEffectsOnly || replacement != null); 682Debug.Assert(expr != null); 683Debug.Assert(builder == null || builder.Value == null); 722Debug.Assert(exceptionFilterPrologueOpt is null || builder is null, 728Debug.Assert(builder.Value is null); 743Debug.Assert(!(node is BoundStatement)); 864Debug.Assert(node.OperandPlaceholder is null); 865Debug.Assert(node.OperandConversion is null); 934Debug.Assert(field.ReceiverOpt is object); 994Debug.Assert(!node.OperatorKind.IsDynamic()); 1048Debug.Assert(refKind == RefKind.None || !receiver.Type.IsReferenceType); 1058Debug.Assert(!receiverType.IsReferenceType); 1161Debug.Assert(condition.Type.SpecialType == SpecialType.System_Boolean); 1249Debug.Assert(node.LeftPlaceholder is null); 1250Debug.Assert(node.LeftConversion is null); 1317Debug.Assert(node.HasValueMethodOpt == null); 1342Debug.Assert(whenNullOpt == null || !LocalRewriter.ReadIsSideeffecting(whenNullOpt)); 1388Debug.Assert(replacer._replaced == 1, "should have replaced exactly one node"); 1428Debug.Assert(node.InitializerExpressionOpt == null);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (6)
67Debug.Assert(!badRegion); 98Debug.Assert(local.RefKind != RefKind.None); 107Debug.Assert(parameter.TypeWithAnnotations.IsRestrictedType()); 118Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method)); 270Debug.Assert(parameter.IsThis || parameter.RefKind == RefKind.None); 306Debug.Assert(!topLevelMethod.IsExtensionBlockMember()); // extension methods were replaced with implementation methods earlier in the pipeline
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (22)
117Debug.Assert(F != null); 118Debug.Assert(originalMethod != null); 119Debug.Assert(state != null); 120Debug.Assert(nonReusableLocalProxies != null); 121Debug.Assert(!nonReusableFieldsForCleanup.IsDefault); 122Debug.Assert(diagnostics != null); 123Debug.Assert(hoistedVariables != null); 124Debug.Assert(nextFreeHoistedLocalSlot >= 0); 152Debug.Assert(thisProxyReplacement.Type is not null); 181Debug.Assert(localOrParameter.Kind == SymbolKind.Local || localOrParameter.Kind == SymbolKind.Parameter); 213Debug.Assert(TypeSymbol.Equals(frameClass, result.Type, TypeCompareKind.ConsiderEverything2)); 288Debug.Assert(!NeedsProxy(local) || proxies.ContainsKey(local)); 319Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.Spill || 540Debug.Assert(!node.Locals.IsEmpty); 547Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.UserDefined && 633Debug.Assert(!node.IsRef); 644Debug.Assert(leftLocal.SynthesizedKind == SynthesizedLocalKind.Spill || 646Debug.Assert(node.IsRef); 670Debug.Assert(assignedLocal.SynthesizedKind switch 679Debug.Assert(awaitSyntax != null); 835Debug.Assert(proxy != null); 851Debug.Assert(proxy != null);
Lowering\StateMachineRewriter\RefInitializationHoister.cs (13)
67Debug.Assert( 74Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.Spill || 76Debug.Assert(local.GetDeclaratorSyntax() != null); 78Debug.Assert(local.SynthesizedKind switch 98Debug.Assert(TypeSymbol.Equals(type, replacement.Type, TypeCompareKind.ConsiderEverything2)); 195Debug.Assert(field.ReceiverOpt != null); 240Debug.Assert(refKind is RefKindExtensions.StrictIn or RefKind.Ref or RefKind.Out); 261Debug.Assert(refKind is RefKindExtensions.StrictIn or RefKind.Ref or RefKind.In); 262Debug.Assert(conditional.IsRef); 284Debug.Assert(_reportedError || isFieldAccessOfStruct || expr.Type!.IsTypeParameter()); 285Debug.Assert(_reportedError || expr is BoundLocal { LocalSymbol.RefKind: RefKind.None } 293Debug.Assert(assignedLocal.SynthesizedKind == SynthesizedLocalKind.Spill); 303Debug.Assert(expr.Type is not null);
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (3)
52Debug.Assert(SyntaxBindingUtilities.BindsToResumableStateMachineState(awaitOrYieldReturnSyntax)); 60Debug.Assert(!_matchedStates[(int)state * direction]); 82Debug.Assert(f.ModuleBuilderOpt != null);
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (3)
51Debug.Assert((object)type != null); 52Debug.Assert(slotDebugInfo.SynthesizedKind.IsLongLived() == (slotIndex >= 0)); 98Debug.Assert(parameter is { IsThis: false });
Lowering\StateMachineRewriter\StateMachineRewriter.cs (15)
46Debug.Assert(body != null); 47Debug.Assert(method != null); 48Debug.Assert(stateMachineType is not null); 49Debug.Assert(compilationState != null); 50Debug.Assert(diagnostics != null); 51Debug.Assert(diagnostics.DiagnosticBag != null); 52Debug.Assert(stateMachineStateDebugInfoBuilder.IsEmpty); 63Debug.Assert(TypeSymbol.Equals(F.CurrentType, method.ContainingType, TypeCompareKind.ConsiderEverything2)); 64Debug.Assert(F.Syntax == body.Syntax); 157Debug.Assert(variable.Kind == SymbolKind.Local || variable.Kind == SymbolKind.Parameter); 178Debug.Assert(synthesizedKind == SynthesizedLocalKind.Spill || 183Debug.Assert(local.RefKind == RefKind.None); 317Debug.Assert((object)method.ThisParameter != null); 385Debug.Assert(CanGetThreadId()); 525Debug.Assert(!method.IsIterator || !method.IsAsync); // an override handles async-iterators
Lowering\StateMachineRewriter\StateMachineTypeSymbol.cs (2)
24Debug.Assert(kickoffMethod != null); 57Debug.Assert(base.GetAttributes().Length == 0);
Lowering\StateMachineRewriter\SynthesizedStateMachineMethod.cs (1)
74Debug.Assert(base.GetAttributes().Length == 0);
Lowering\SynthesizedMethodBaseSymbol.cs (8)
54Debug.Assert((object)containingType != null); 55Debug.Assert((object)baseMethod != null); 63Debug.Assert(typeMap != null); 64Debug.Assert(this.TypeMap == null); 65Debug.Assert(!typeParameters.IsDefault); 66Debug.Assert(_typeParameters.IsDefault); 155Debug.Assert(base.GetAttributes().IsEmpty); 163Debug.Assert(base.GetReturnTypeAttributes().IsEmpty);
Lowering\SynthesizedSubmissionFields.cs (2)
33Debug.Assert(compilation != null); 34Debug.Assert(submissionClass.IsSubmissionClass);
Lowering\SyntheticBoundNodeFactory.cs (79)
121Debug.Assert(node != null); 122Debug.Assert(compilationState != null); 123Debug.Assert(diagnostics != null); 139Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 145Debug.Assert(CurrentFunction is null || 155Debug.Assert(ModuleBuilderOpt is { }); 177Debug.Assert(CurrentType is { }); 185Debug.Assert(CurrentType is { }); 193Debug.Assert(CurrentType is { }); 201Debug.Assert(CurrentType is { }); 209Debug.Assert(CurrentType is { }); 218Debug.Assert(ModuleBuilderOpt is { }); 229Debug.Assert(CurrentFunction is { IsStatic: false, ThisParameter: { } }); 240Debug.Assert(CurrentFunction is { IsStatic: false }); 272Debug.Assert(receiverOpt is null || receiverOpt.Type is { } && 280Debug.Assert((receiverOpt is null) == property.IsStatic); 284Debug.Assert(!(receiverOpt is { Type: ArrayTypeSymbol { IsSZArray: true } } && 289Debug.Assert(accessor is not null); 295Debug.Assert((receiverOpt is null) == property.IsStatic); 297Debug.Assert(accessor is not null); 366Debug.Assert(result is not null); 407Debug.Assert(result is not null); 444Debug.Assert(left.Type is { } && right.Type is { } && 563Debug.Assert(CurrentFunction is { }); 575Debug.Assert(useSiteInfo.Diagnostics.IsNullOrEmpty()); 576Debug.Assert(conversion.Kind != ConversionKind.NoConversion); 580Debug.Assert(CurrentFunction.RefKind == RefKind.None); 590Debug.Assert(CurrentFunction is { }); 669Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 670Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 676Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 677Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 706Debug.Assert(c.IsImplicit); 707Debug.Assert(c.IsBoxing || c.IsReference || c.IsIdentity); 836Debug.Assert(methodSymbol.IsStatic); 844Debug.Assert(methodSymbol.IsStatic); 845Debug.Assert(methodSymbol.IsGenericMethod); 846Debug.Assert(methodSymbol.Arity == typeArgs.Length); 854Debug.Assert(methodSymbol.IsStatic); 883Debug.Assert(method.ParameterCount == args.Length); 925Debug.Assert(method.ParameterCount == args.Length); 940Debug.Assert(valueTypeReceiver.Type is { }); 941Debug.Assert(TypeSymbol.Equals(valueTypeReceiver.Type, referenceTypeReceiver.Type, TypeCompareKind.ConsiderEverything2)); 947Debug.Assert(left.Type!.Equals(right.Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes) || left.Type.IsErrorType()); 948Debug.Assert(left.Type.IsReferenceType); 976Debug.Assert(thenClause != null); 1058Debug.Assert(result.Type is { }); 1065Debug.Assert(result.Type is { }); 1074Debug.Assert(result.Type is { }); 1104Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 }); 1131Debug.Assert(statements[0] is null); 1148Debug.Assert(!labels.Contains(v2)); 1177Debug.Assert(stringConst.IsString || stringConst.IsNull); 1188Debug.Assert(charConst.IsChar || charConst.IsDefaultValue); 1199Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1205Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1218Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1225Debug.Assert(CurrentFunction is { ThisParameter: { } }); 1270Debug.Assert(type.CanBeAssignedNull()); 1289Debug.Assert(systemType.ExtendedSpecialType == InternalSpecialType.System_Type || 1303Debug.Assert(TypeSymbol.Equals(systemType, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions)); 1325Debug.Assert(this.CompilationState is { DynamicOperationContextType: { } }); 1347Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); 1454Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); 1471Debug.Assert(systemReflectionMethodOrConstructorInfo.ExtendedSpecialType == InternalSpecialType.System_Reflection_MethodInfo || 1534Debug.Assert(arg.Type is { }); 1641Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } }); 1662Debug.Assert(argument.Type is { }); 1664Debug.Assert(containingMethod is { }); 1665Debug.Assert(kind != SynthesizedLocalKind.UserDefined); 1682Debug.Assert(argument.GetRefKind() != RefKind.In); 1739Debug.Assert(node.Type is { }); 1762Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) || 1768Debug.Assert( 1838Debug.Assert(loweredLeft != null); 1839Debug.Assert(loweredRight != null); 1840Debug.Assert((object)returnType != null); 1841Debug.Assert(returnType.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 1842Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull());
Lowering\UnmatchedGotoFinder.cs (1)
30Debug.Assert(unmatchedLabelsCache != null);
Operations\CSharpOperationFactory_Methods.cs (8)
64Debug.Fail($"Unexpected syntax kind: {syntax.Kind()}"); 150Debug.Assert(boundConversion.SymbolOpt is not null); 202Debug.Assert(property is not null); 227Debug.Assert(attribute.Constructor is not null); 326Debug.Assert(methodOrIndexer.GetIsVararg() ^ parameters.Length == arguments.Length); 383Debug.Assert(argumentsInEvaluationBuilder.All(static arg => arg is not null)); 415Debug.Assert(arguments.Length >= declarations.Length); 471Debug.Assert(currentDeclarationIndex == declarations.Length);
Operations\CSharpOperationFactory.cs (48)
520Debug.Assert(initializer.Initializers.All(i => i is ISimpleAssignmentOperation)); 534Debug.Assert(declaredTypeOpt != null); 545Debug.Assert(declaredTypeOpt != null); 702Debug.Assert(type is not null); 726Debug.Assert(isImplicit); 727Debug.Assert(type is not null); 826Debug.Assert(!boundObjectInitializerMember.Expanded); 873Debug.Assert(boundObjectInitializerMember.Type.IsDynamic()); 1032Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1063Debug.Assert(!forceOperandImplicitLiteral); 1064Debug.Assert(!boundOperand.GetInterpolatedStringHandlerData().IsDefault); 1072Debug.Assert(!forceOperandImplicitLiteral); 1076Debug.Assert(boundConversion.SymbolOpt is object); 1090Debug.Assert(isImplicit || target.Syntax != syntax || target.IsImplicit || boundConversion.ConversionGroupOpt != null); 1110Debug.Assert(boundOperand.Kind == BoundKind.BadExpression || 1113Debug.Assert(!forceOperandImplicitLiteral); 1126Debug.Assert(!forceOperandImplicitLiteral); 1215Debug.Assert(typeOperand is not null); 1226Debug.Assert(typeOperand is not null); 1237Debug.Assert(typeOperand is not null); 1304Debug.Assert(!objectCreation.Type.IsAnonymousType); 1328Debug.Fail("Unhandled case: " + collectionCreation.GetType()); 1407Debug.Assert(!IsMemberInitializer(boundAssignmentOperator)); 1421Debug.Assert(IsMemberInitializer(boundAssignmentOperator)); 1539Debug.Assert(stack.Count > 0); 1554Debug.Assert(left is not null && stack.Count == 0); 1604Debug.Assert(boundBinaryOperator.InterpolatedStringHandlerData is not null); 1717Debug.Assert(lengthSymbol is not null); 1718Debug.Assert(indexerSymbol is not null); 2031Debug.Assert(boundForEachStatement.IterationVariables.Length == 1); 2075Debug.Assert(boundCatchBlock.ExceptionFilterPrologueOpt is null); 2097Debug.Assert((boundUsingStatement.DeclarationsOpt == null) != (boundUsingStatement.ExpressionOpt == null)); 2098Debug.Assert(boundUsingStatement.ExpressionOpt is object || boundUsingStatement.Locals.Length > 0); 2190Debug.Assert(node.Parent != null); 2198Debug.Fail($"Unexpected syntax: {kind}"); 2285Debug.Assert(boundExpressionStatement.Syntax == sequence.Value.Syntax); 2322Debug.Assert(positionInfo == null || boundInterpolatedString.InterpolationData is null or { BuilderType: null }); 2365Debug.Assert(parts.Length == positionInfo.Length); 2388Debug.Assert(bad.ChildBoundNodes.Length == 2416Debug.Assert(alignment is null); 2417Debug.Assert(format is null); 2425Debug.Assert(valueOperation.IsImplicit); 2435Debug.Assert(valueOperation.Syntax != part.Syntax); 2485Debug.Assert(conversion.Conversion.IsInterpolatedStringHandler); 2778Debug.Assert(boundSwitchExpression.DefaultLabel is GeneratedLabelSymbol); 2819Debug.Assert(boundSwitchLabel.Pattern.Kind == BoundKind.DiscardPattern); 2960Debug.Assert(nameSyntax is not null); 3009Debug.Assert(!patternDisposeInfo.Method.IsStatic);
Parser\Blender.cs (5)
37Debug.Assert(lexer != null); 93Debug.Assert(lexer != null); 94Debug.Assert(changes != null); 95Debug.Assert(newPosition >= 0); 134Debug.Assert(token.Kind() != SyntaxKind.None, "how could we not get a real token back?");
Parser\Blender.Cursor.cs (1)
132Debug.Assert(this.CurrentNodeOrToken.IsNode);
Parser\Blender.Reader.cs (2)
108Debug.Assert(!_oldTreeCursor.IsFinished); 140Debug.Assert(_changeDelta > 0 || _oldTreeCursor.IsFinished);
Parser\CharacterInfo.cs (3)
55Debug.Assert(IsHexDigit(c)); 65Debug.Assert(IsBinaryDigit(c)); 75Debug.Assert(IsDecDigit(c));
Parser\DirectiveParser.cs (1)
414Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken);
Parser\DocumentationCommentParser.cs (9)
813Debug.Assert(missingNodeOrToken.IsMissing); 973Debug.Assert(CurrentToken.Kind == SyntaxKind.ThisKeyword); 987Debug.Assert(CurrentToken.ContextualKind == SyntaxKind.ExtensionKeyword); 1018Debug.Assert(CurrentToken.Kind == SyntaxKind.OperatorKeyword); 1151Debug.Assert(SyntaxFacts.IsAnyOverloadableOperator(operatorToken.Kind)); 1161Debug.Assert(kind is not (SyntaxKind.GreaterThanGreaterThanEqualsToken or SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken)); // Reaching this code path is not expected 1207Debug.Assert(CurrentToken.Kind == SyntaxKind.ExplicitKeyword || 1270Debug.Assert(CurrentToken.Kind != SyntaxKind.CommaToken); 1364Debug.Assert(CurrentToken.Kind == SyntaxKind.LessThanToken);
Parser\LanguageParser_InterpolatedString.cs (16)
21Debug.Assert(expressionKind != SyntaxKind.None); 28Debug.Assert(originalToken.Text is ['"', '"', '"', ..]); 34Debug.Assert(interpolatedString.StringStartToken.Kind is SyntaxKind.InterpolatedSingleLineRawStringStartToken or SyntaxKind.InterpolatedMultiLineRawStringStartToken); 35Debug.Assert(interpolatedString.Contents is [InterpolatedStringTextSyntax]); 60Debug.Assert(!interpolatedText.TextToken.ContainsDiagnostics); 69Debug.Assert(diagnosticsBuilder.Count > 0); 112Debug.Assert(this.CurrentToken.Kind == SyntaxKind.InterpolatedStringToken); 115Debug.Assert(originalToken.Text[0] is '$' or '@'); 144Debug.Assert(originalToken.ToFullString() == result.ToFullString()); // yield from text equals yield from node 154Debug.Assert(!interpolatedText.TextToken.ContainsDiagnostics); 172Debug.Assert(isInterpolatedString || interpolations.Count == 0, "Non-interpolated parsing should never produce interpolations"); 244Debug.Assert(closeQuoteText[afterWhitespace] == '"'); 514Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 529Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 586Debug.Assert(kind is Lexer.InterpolatedStringKind.Normal or Lexer.InterpolatedStringKind.Verbatim); 595Debug.Assert(token.Kind == SyntaxKind.StringLiteralToken);
Parser\LanguageParser_Patterns.cs (1)
224Debug.Assert(precedence < Precedence.Shift);
Parser\LanguageParser.cs (152)
211Debug.Assert(_recursionDepth == 0); 251Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NamespaceKeyword); 282Debug.Assert(semicolon != null || openBrace != null); 289Debug.Assert(semicolon != null); 293Debug.Assert(initialBadNodes == null); // init bad nodes should have been attached to semicolon... 309Debug.Assert(initialBadNodes == null); // init bad nodes should have been attached to open brace... 570Debug.Assert(!IsInAsync); 941Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ExternKeyword); 952Debug.Assert(this.IsNamedAssignment()); 969Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UsingKeyword); 1365Debug.Assert(!(forAccessors && forTopLevelStatements)); 1373Debug.Assert(newMod != DeclarationModifiers.Scoped); 1493Debug.Assert(modTok.Kind is not (SyntaxKind.OutKeyword or SyntaxKind.InKeyword)); 1548Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None); 1666Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1702Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1754Debug.Assert(!IsInAsync); 1776Debug.Assert(CurrentToken.ContextualKind is SyntaxKind.RecordKeyword or SyntaxKind.ExtensionKeyword or SyntaxKind.UnionKeyword); 1786Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword or SyntaxKind.InterfaceKeyword || 1790Debug.Assert(!IsInAsync); 1970Debug.Assert(name is not null); 1986Debug.Assert(name is not null); 2002Debug.Assert(name is not null); 2018Debug.Assert(name is not null); 2037Debug.Assert(name is not null); 2056Debug.Assert(name is null); 2057Debug.Assert(baseList is null); 2168Debug.Assert((_termState & TerminatorState.IsEndOfTypeSignature) != 0); 2321Debug.Assert(list.Count > 0); 2608Debug.Assert(!IsInAsync); 2609Debug.Assert(parentKind == SyntaxKind.CompilationUnit); 2896Debug.Assert(identifierOrThisOpt != null || IsStartOfPropertyBody(index: 0)); 3257Debug.Assert(!IsInAsync); 3258Debug.Assert(parentKind != SyntaxKind.CompilationUnit); 3390Debug.Assert(identifierOrThisOpt != null || IsStartOfPropertyBody(index: 0)); 3565Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ColonToken or SyntaxKind.EqualsGreaterThanToken); 3590Debug.Assert(this.CurrentToken.Kind == SyntaxKind.TildeToken); 3735Debug.Assert(!IsInAsync); 3867Debug.Assert(!style.IsMissing || haveExplicitInterfaceName == explicitInterfaceOpt is not null); 4061Debug.Assert(!opToken.IsMissing); 4072Debug.Assert(opToken.IsMissing); // ConvertToMissingWithTrailingTrivia should have converted to a missing token. 4074Debug.Assert(type != null); // How could it be? The only caller got it from ParseReturnType. 4093Debug.Assert(!opToken.IsMissing); 4225Debug.Assert(thisKeyword.Kind == SyntaxKind.ThisKeyword); 4299Debug.Assert(IsStartOfPropertyBody(index: 0)); 4365Debug.Assert( 4709Debug.Assert(accessorName.ContainsDiagnostics); 4759Debug.Assert(accessorName.ContainsDiagnostics); 4962Debug.Assert(parent.Kind() == SyntaxKind.ParameterList); 5059Debug.Assert(!(isFunctionPointerParameter && isLambdaParameter), "Can't be parsing parameters for both a function pointer and a lambda at the same time"); 5111Debug.Assert(this.CurrentToken.Kind == SyntaxKind.FixedKeyword); 5129Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EventKeyword); 5155Debug.Assert(typeParameterList == null, "Exit condition of ParseMemberName in this scenario"); 5180Debug.Assert(identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword); 5188Debug.Assert(identifier != null); 5189Debug.Assert(identifier.Kind == SyntaxKind.IdentifierToken); 5330Debug.Assert(localFunction == null); 5360Debug.Assert(variables.Count == 0); 5410Debug.Assert(localFunction is null); 5422Debug.Assert(list.Count > 0); 5738Debug.Assert(argumentList is null); 5739Debug.Assert(initializer is null); 5747Debug.Assert(this.CurrentToken.Kind != SyntaxKind.EqualsToken); 5826Debug.Assert(this.CurrentToken.Kind is SyntaxKind.OpenParenToken or SyntaxKind.LessThanToken); 5883Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DelegateKeyword); 5916Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EnumKeyword); 6263Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6336Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 6420Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6433Debug.Assert(start.Kind == SyntaxKind.LessThanToken); 6434Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 6606Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6732Debug.Assert(list.Count > 0); 6812Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6936Debug.Assert(beforeIdentifierPointSet); 6981Debug.Assert(!ReferenceEquals(tmp, explicitInterfaceName), "We should have consumed something and updated explicitInterfaceName"); 7119Debug.Assert(separator.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken); 7260Debug.Assert(mode != ParseTypeMode.NewExpression); 7292Debug.Assert(this.CurrentToken.Kind is SyntaxKind.IdentifierToken); 7303Debug.Assert(result is ScanTypeFlags.GenericTypeOrExpression or ScanTypeFlags.GenericTypeOrMethod or ScanTypeFlags.NonGenericTypeOrExpression); 7324Debug.Assert(result is ScanTypeFlags.GenericTypeOrExpression or ScanTypeFlags.GenericTypeOrMethod or ScanTypeFlags.NonGenericTypeOrExpression); 7478Debug.Assert(IsFunctionPointerStart()); 7519Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7675Debug.Assert(type != null); 7742Debug.Assert(type != null); 7749Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 8070Debug.Assert(IsFunctionPointerStart()); 8119Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 8142Debug.Assert(list.Count > 0); 8199Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 8587Debug.Assert(PeekToken(1).Kind != SyntaxKind.OpenParenToken); 8593Debug.Assert(PeekToken(2).Kind != SyntaxKind.OpenParenToken); 8941Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DelegateKeyword); 8969Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenParenToken); 8989Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 9414Debug.Assert(this.CurrentToken.Kind is SyntaxKind.TryKeyword or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 9426Debug.Assert(@try.ContainsDiagnostics); 9427Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 9490Debug.Assert(this.CurrentToken.Kind == SyntaxKind.CatchKeyword); 9573Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 9590Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DoKeyword); 9631Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9652Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9796Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForEachKeyword || this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9845Debug.Assert(discard.Kind == SyntaxKind.UnderscoreToken); 9898Debug.Assert(mode is ParseTypeMode.Normal or ParseTypeMode.FirstElementOfPossibleTupleLiteral or ParseTypeMode.AfterTupleComma); 10013Debug.Assert(this.CurrentToken.Kind == SyntaxKind.GotoKeyword); 10079Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 10144Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ElseKeyword); 10167Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LockKeyword); 10179Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ReturnKeyword); 10189Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.YieldKeyword); 10226Debug.Assert(this.CurrentToken.Kind is SyntaxKind.SwitchKeyword or SyntaxKind.CaseKeyword); 10272Debug.Assert(parenExpression.GetDiagnostics().Length == 0); 10302Debug.Assert(this.IsPossibleSwitchSection()); 10352Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DefaultKeyword); 10374Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ThrowKeyword); 10384Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UnsafeKeyword); 10509Debug.Assert(st != ScanTypeFlags.NullableType); 10520Debug.Assert(this.CurrentToken.Kind == SyntaxKind.WhileKeyword); 10534Debug.Assert(this.IsTrueIdentifier() && this.PeekToken(1).Kind == SyntaxKind.ColonToken); 10595Debug.Assert(variables.Count == 0); 10802Debug.Assert(localFunction == null); 10904Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken); 11900Debug.Assert(IsExpectedAssignmentOperator(operatorToken.Kind)); 11901Debug.Assert(GetPrecedence(operatorExpressionKind) == Precedence.Assignment); 11942Debug.Assert(IsAtDotDotToken()); 12194Debug.Assert(expr != null); 12283Debug.Assert(this.CurrentToken.Kind == SyntaxKind.BaseKeyword); 12546Debug.Assert(openKind is SyntaxKind.OpenParenToken or SyntaxKind.OpenBracketToken); 12547Debug.Assert(closeKind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken); 12548Debug.Assert((openKind == SyntaxKind.OpenParenToken) == (closeKind == SyntaxKind.CloseParenToken)); 12744Debug.Assert(checkedOrUnchecked.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 12787Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12818Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12894Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenParenToken); 12982Debug.Assert(!inSwitchArmPattern || forPattern, "Can't be in a switch arm without also being in a pattern"); 13308Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 13327Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBracketToken); 13386Debug.Assert(IsAnonymousType()); 13389Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBraceToken); 13676Debug.Assert(this.CurrentToken.Kind is SyntaxKind.NewKeyword or SyntaxKind.StackAllocKeyword); 13874Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword); 14261Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword); 14294Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.JoinKeyword); 14314Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.LetKeyword); 14327Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword); 14335Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.OrderByKeyword); 14368Debug.Assert(list.Count > 0); 14398Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.SelectKeyword); 14406Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.GroupKeyword); 14416Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.IntoKeyword);
Parser\Lexer_RawStringLiteral.cs (5)
57Debug.Assert(startingQuoteCount >= 3); 73Debug.Assert(info.Kind is (SyntaxKind.SingleLineRawStringLiteralToken or SyntaxKind.MultiLineRawStringLiteralToken)); 94Debug.Assert(info.StringValue == null); 97Debug.Assert(!this.HasErrors); 137Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar()));
Parser\Lexer_StringLiteral.cs (26)
17Debug.Assert(quoteCharacter is '\'' or '"'); 63Debug.Assert(this.CurrentLexemeWidth > 0); 134Debug.Assert(ch == '\\'); 194Debug.Assert(TextWindow.PeekChar() == '@'); 208Debug.Assert(TextWindow.PeekChar() == '"'); 390Debug.Assert(_lexer.TextWindow.Position != start); 463Debug.Assert(startingDollarSignCount > 0); 467Debug.Assert(startingDollarSignCount == 0); 468Debug.Assert(totalAtCount == 0); 474Debug.Assert(totalAtCount + startingDollarSignCount + startingQuoteCount >= 2); 534Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 548Debug.Assert(kind is InterpolatedStringKind.Normal or InterpolatedStringKind.Verbatim); 554Debug.Assert(IsAtEnd(kind)); 569Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 577Debug.Assert(IsAtEnd(kind)); 593Debug.Assert(closeQuoteCount >= startingQuoteCount); 623Debug.Assert(closeQuoteCount >= startingQuoteCount); 640Debug.Assert(closeQuoteCount >= startingQuoteCount); 788Debug.Assert(kind == InterpolatedStringKind.Verbatim); 800Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 837Debug.Assert(kind is InterpolatedStringKind.MultiLineRaw or InterpolatedStringKind.SingleLineRaw); 869Debug.Assert(kind is InterpolatedStringKind.Normal or InterpolatedStringKind.Verbatim); 898Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 972Debug.Assert(_lexer.TextWindow.PeekChar() == ':'); 1058Debug.Assert(colonRange.Equals(default(Range))); 1158Debug.Assert(start == _lexer.TextWindow.PeekChar());
Parser\Lexer.cs (52)
120Debug.Assert(options != null); 329Debug.Assert(info.Kind != SyntaxKind.IdentifierToken || info.StringValue != null); 411Debug.Assert(SyntaxFacts.IsPunctuationOrKeyword(info.Kind)); 614Debug.Assert(TextWindow.PeekChar() == '@'); 738Debug.Assert(TextWindow.PeekChar() == '@'); 764Debug.Assert(TextWindow.PeekChar() == '$'); 1037Debug.Assert(info.Text != null); 1135Debug.Assert(hasUSuffix && hasLSuffix); 1600Debug.Assert(string.Equals(info.Text.Substring(0, objectAddressOffset + 1), "@0x", StringComparison.OrdinalIgnoreCase)); 1636Debug.Assert(InXmlCrefOrNameAttributeValue); 1695Debug.Assert(consumedSurrogate == SlidingTextWindow.InvalidCharacter, "Since consumedChar == '\\'"); 2070Debug.Assert(firstCh is '<' or '|' or '=' or '>'); 2210Debug.Assert(delimiter is '/' or '@'); 2211Debug.Assert(TextWindow.PeekChar() == delimiter && TextWindow.PeekChar(1) == '*'); 2277Debug.Assert(SyntaxFacts.IsWhitespace(TextWindow.PeekChar())); 2312Debug.Assert(this.CurrentLexemeWidth > 0); 2712Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 2807Debug.Assert(this.LocationIs(XmlDocCommentLocation.End) || TextWindow.PeekChar() == SlidingTextWindow.InvalidCharacter); 2843Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 2844Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 2888Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 2902Debug.Assert(TextWindow.PeekChar() == '<'); 2951Debug.Assert(TextWindow.PeekChar() == '&'); 3210Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3211Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3278Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3294Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't."); 3306Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 3383Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3384Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3450Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 3541Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3542Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3601Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3602Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3686Debug.Assert(TextWindow.Position > beforeConsumed, "First character or entity has been consumed."); 3797Debug.Assert(info.Text == null, "Haven't tried to set it yet."); 3798Debug.Assert(info.StringValue == null, "Haven't tried to set it yet."); 3886Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 4007Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4008Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4129Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4130Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4260Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4261Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4472Debug.Assert(this.StyleIs(XmlDocCommentStyle.Delimited)); 4601Debug.Assert(info == null, "Never produce a diagnostic while peeking."); 4609Debug.Assert(ch != SlidingTextWindow.InvalidCharacter, "Precondition established by all callers; required for correctness of AdvanceChar() call."); 4637Debug.Assert(character == '\\'); 4687Debug.Assert(character == 'u' || character == 'x'); 4741Debug.Assert(TextWindow.PeekChar() == '&'); 4855Debug.Assert(codepoint > 0x0000FFFF && codepoint <= 0x0010FFFF);
Parser\LexerCache.cs (1)
192Debug.Assert(span.Length > 0);
Parser\QuickScanner.cs (3)
234Debug.Assert(state == QuickScanState.Bad || state == QuickScanState.Done, "can only exit with Bad or Done"); 241Debug.Assert(tokenLength > 0); 269Debug.Assert(quickWidth == token.FullWidth);
Parser\SlidingTextWindow.cs (4)
119Debug.Assert(!_freed); 271Debug.Assert(_positionInText >= 0, "Position in text cannot be negative."); 290Debug.Assert(SyntaxFacts.IsNewLine(this.PeekChar())); 296Debug.Assert(SyntaxFacts.IsNewLine(currentChar));
Parser\SyntaxParser.cs (29)
173Debug.Assert(offset >= 0); 185Debug.Assert(offset >= 0 && offset < _tokenCount); 211Debug.Assert(_resetCount == point.ResetCount); 240Debug.Assert(_allowModeReset); 255Debug.Assert(_blendedTokens != null); 295Debug.Assert(_blendedTokens != null); 370Debug.Assert(tokenResult.Token != null); 382Debug.Assert(token != null); 406Debug.Assert(shiftOffset > 0); 434Debug.Assert(shiftOffset > 0); 468Debug.Assert(n >= 0); 523Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 539Debug.Assert(SyntaxFacts.IsAnyToken(expected)); 577Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 591Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 612Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 647Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 661Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 694Debug.Assert(missingNodeOrToken.IsMissing); 756Debug.Assert(!node.IsMissing); 767Debug.Assert(nodeOrToken.Width > 0 || nodeOrToken.RawKind is (int)SyntaxKind.EndOfFileToken); 785Debug.Assert(missingNodeOrToken.IsMissing); 861Debug.Assert(child.IsMissing, "All children of a missing node or token should themselves be missing."); 866Debug.Assert(childToken.Text == "", "All missing tokens should have no text"); 875Debug.Assert(allTrivia.Count > 0, "How can a token with skipped text not have trivia at all?"); 889Debug.Fail("This should not be reachable. We should have hit a skipped token in the trivia of this token."); 893Debug.Fail("This should not be reachable. We should have hit a child token with skipped text within this node."); 1125Debug.Assert(!token.IsMissing); 1187Debug.Assert(!assertIfFalse);
SourceGeneration\CSharpSyntaxHelper.cs (3)
44Debug.Assert(attribute is AttributeSyntax); 45Debug.Assert(attribute.Parent is AttributeListSyntax); 46Debug.Assert(attribute.Parent.Parent is not null);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
107Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplay.cs (2)
268Debug.Assert(semanticModelOpt == null); 269Debug.Assert(positionOpt < 0);
SymbolDisplay\SymbolDisplayVisitor_Constants.cs (2)
44Debug.Assert(value.GetType().GetTypeInfo().IsPrimitive || value is string || value is decimal); 46Debug.Assert(valueString != null);
SymbolDisplay\SymbolDisplayVisitor_Minimal.cs (6)
26Debug.Assert(IsMinimizing); 51Debug.Assert(IsMinimizing); 61Debug.Assert(IsMinimizing); 64Debug.Assert(symbol.ContainingNamespace != null || symbol.IsGlobalNamespace); 95Debug.Assert(Format.GlobalNamespaceStyle == SymbolDisplayGlobalNamespaceStyle.Included || 131Debug.Assert(IsMinimizing);
SymbolDisplay\SymbolDisplayVisitor.cs (3)
90Debug.Assert(visitor != this); 228Debug.Assert(this.IsFirstSymbolVisited, "Don't call with IsFirstSymbolVisited = false if OmittedAsContaining"); 371Debug.Assert((object)containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (7)
395Debug.Assert(containingType != null); 615Debug.Assert(!conventionTypes.IsDefaultOrEmpty); 626Debug.Assert(conventionType.Name.StartsWith("CallConv")); 690Debug.Assert(operatorKind != SyntaxKind.None); 736Debug.Assert(conversionKind != SyntaxKind.None); 932Debug.Assert(containingType != null || (symbol.ContainingSymbol is ITypeSymbol)); 1057Debug.Assert(implementedMember.ContainingType != null);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (8)
254Debug.Assert(symbol.DelegateInvokeMethod is not null); 317Debug.Assert(symbol.IsTupleType); 412Debug.Assert(symbol.Arity > 0); 495Debug.Assert(symbol.DelegateInvokeMethod is not null); 545Debug.Assert(tupleSymbol.IsTupleType); 584Debug.Assert(symbol.IsTupleType); 750Debug.Assert(!symbol.IsRefLikeType); 1002Debug.Assert(extension.IsExtension);
Symbols\AbstractTypeMap.cs (5)
27Debug.Assert((object)previous.ConstructedFrom == (object)previous); 166Debug.Assert(builder.Count == customModifiers.Length); 196Debug.Assert(0 <= interfaces.Length && interfaces.Length <= 2); 200Debug.Assert(interfaces[0] is NamedTypeSymbol); // IList<T> 205Debug.Assert(interfaces[0] is NamedTypeSymbol); // IList<T>
Symbols\AliasSymbol.cs (4)
58Debug.Assert(locations.Length == 1 || (locations.IsEmpty && aliasName == "global")); // It looks like equality implementation depends on this condition. 59Debug.Assert(containingSymbol is not null); 291Debug.Assert(syntax.Alias is object); 330Debug.Assert(won, "Only one thread can win the alias target CompareExchange");
Symbols\AnonymousTypes\AnonymousTypeDescriptor.cs (3)
54Debug.Assert(!this.Fields.IsDefault); 104Debug.Assert(!newFieldTypes.IsDefault); 105Debug.Assert(newFieldTypes.Length == this.Fields.Length);
Symbols\AnonymousTypes\AnonymousTypeField.cs (1)
74Debug.Assert(this.Name != null && this.Location != null && this.TypeWithAnnotations.HasType);
Symbols\AnonymousTypes\AnonymousTypeManager.cs (6)
19Debug.Assert(compilation != null); 57Debug.Assert((object)type != null); 58Debug.Assert(type.IsAnonymousType); 69Debug.Assert(type.IsAnonymousType); 81Debug.Assert(!newFieldTypes.IsDefault); 82Debug.Assert(type.IsAnonymousType);
Symbols\AnonymousTypes\AnonymousTypeManager.SymbolCollection.cs (3)
34Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor)); 35Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Diagnostics_DebuggerHiddenAttribute__ctor)); 36Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Diagnostics_DebuggerBrowsableAttribute__ctor));
Symbols\AnonymousTypes\AnonymousTypeManager.Templates.cs (22)
102Debug.Assert(_sourceLocationsSeen.ContainsKey(location)); 156Debug.Assert(refKinds.IsNull || parameterCount == refKinds.Capacity - (returnsVoid ? 0 : 1)); 159Debug.Assert(key.Name != null); 182Debug.Assert(typeDescr.Location.IsInSource); // AnonymousDelegateTemplateSymbol requires a location in source for ordering. 192Debug.Assert(fields.All(f => hasDefaultScope(useUpdatedEscapeRules, f))); 202Debug.Assert(needsIndexedName); 203Debug.Assert(i == fields.Length - 2); 204Debug.Assert(field.Type.IsSZArray()); 218Debug.Assert(nTypeArguments != 0); 226Debug.Assert(lastParam.Type.IsSZArray()); 264Debug.Assert(typeArguments.Length == template.TypeParameters.Length); 287Debug.Assert(typeParameters.Length == template.TypeParameters.Length); 339Debug.Assert(changed); 382Debug.Assert(isContainedIn(yOwner, xOwner)); 410Debug.Assert(ReferenceEquals(this, anonymous.Manager)); 554Debug.Assert(!builder.Any()); 572Debug.Assert(!builder.Any()); 594Debug.Assert(!builder.Any()); 711Debug.Assert((object)type != null); 720Debug.Assert((object)type != null); 721Debug.Assert(type.IsAnonymousType); 732Debug.Assert((object)method != null);
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (1)
55Debug.Assert(membersCount == _members.Length);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (7)
41Debug.Assert(refKinds.IsNull || parameterCount == refKinds.Capacity - (voidReturnTypeOpt is { } ? 0 : 1)); 103Debug.Assert(SmallestLocation != null); 104Debug.Assert(SmallestLocation != Location.None); 136Debug.Assert(field.Type.IsSZArray()); 137Debug.Assert(i == parameterCount - 1); 163Debug.Assert(SmallestLocation != null); 164Debug.Assert(SmallestLocation != Location.None);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.FieldSymbol.cs (1)
26Debug.Assert((object)property != null);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.PropertySymbol.cs (5)
47Debug.Assert((object)container != null); 48Debug.Assert((object)field != null); 49Debug.Assert(fieldTypeWithAnnotations.HasType); 50Debug.Assert(index >= 0); 51Debug.Assert(!locations.IsDefault);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TemplateSymbol.cs (1)
78Debug.Assert(membersCount == _members.Length);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeOrDelegateTemplateSymbol.cs (4)
68Debug.Assert(_smallestLocation != null); 81Debug.Assert(value != null); 83Debug.Assert(oldValue == null || 94Debug.Assert(location.IsInSource);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (2)
27Debug.Assert((object)container != null); 28Debug.Assert(!string.IsNullOrEmpty(name));
Symbols\ArrayTypeSymbol.cs (7)
30Debug.Assert(elementTypeWithAnnotations.HasType); 414Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 480Debug.Assert(nullableAnnotation != DefaultNullableAnnotation); 518Debug.Assert(constructedInterfaces.Length <= 2); 576Debug.Assert(rank >= 1); 639Debug.Assert(!sizes.IsDefaultOrEmpty || !lowerBounds.IsDefault); 640Debug.Assert(lowerBounds.IsDefaultOrEmpty || (!lowerBounds.IsEmpty && (lowerBounds.Length != rank || !lowerBounds.All(b => b == 0))));
Symbols\AssemblySymbol.cs (27)
69Debug.Assert((object)_corLibrary == null); 527Debug.Assert(SpecialMembers.GetDescriptor(feature).DeclaringSpecialType == SpecialType.System_Runtime_CompilerServices_RuntimeFeature); 680Debug.Assert(result?.IsErrorType() != true); 725Debug.Assert(parts.Length > 0); 735Debug.Assert(!type.IsErrorType()); 747Debug.Assert(!type.IsErrorType()); 762Debug.Assert(type?.IsErrorType() != true); 779Debug.Assert(!typeInfo.IsByRef); 782Debug.Assert(!typeInfo.ContainsGenericParameters); 808Debug.Assert(!typeInfo.IsArray); 818Debug.Assert(currentTypeInfo.IsGenericTypeDefinition || !currentTypeInfo.IsGenericType); 839Debug.Assert(symbol?.IsErrorType() != true); 855Debug.Assert(symbol is null || typeArgumentIndex == genericArguments.Length); 874Debug.Assert(!symbol.IsErrorType()); 879Debug.Assert(typeArgumentIndex == genericArguments.Length); 889Debug.Assert(remainingTypeArguments >= symbol.Arity); 928Debug.Assert(warnings is null || isWellKnownType); 935Debug.Assert(result?.IsErrorType() != true); 957Debug.Assert(corLibCandidate?.IsErrorType() != true); 966Debug.Assert(this is SourceAssemblySymbol, 984Debug.Assert(!(this is SourceAssemblySymbol && assembly.IsMissing)); // Non-source assemblies can have missing references 992Debug.Assert(candidate?.IsErrorType() != true); 999Debug.Assert(!TypeSymbol.Equals(candidate, result, TypeCompareKind.ConsiderEverything)); 1043Debug.Assert(result?.IsErrorType() != true); 1066Debug.Assert((object)result.ContainingType == null || IsValidWellKnownType(result.ContainingType), 1080Debug.Assert(result?.IsErrorType() != true); 1081Debug.Assert(result is null || ReferenceEquals(result.ContainingAssembly, assembly));
Symbols\Attributes\AttributeData.cs (20)
88Debug.Assert(!attributeType.IsErrorType()); 216Debug.Assert(!this.HasErrors); 217Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 245Debug.Assert(arguments.AttributeSyntaxOpt is object); 296Debug.Assert(arguments.AttributeSyntaxOpt is object); 339Debug.Assert((object)targetSymbol != null); 340Debug.Assert(targetSymbol.Kind == SymbolKind.Assembly || targetSymbol.Kind == SymbolKind.NamedType || targetSymbol.Kind == SymbolKind.Method); 341Debug.Assert(this.IsSecurityAttribute(compilation)); 382Debug.Assert((object)targetSymbol != null); 383Debug.Assert(targetSymbol.Kind == SymbolKind.Assembly || targetSymbol.Kind == SymbolKind.NamedType || targetSymbol.Kind == SymbolKind.Method); 384Debug.Assert(typedValue.ValueInternal is object); 508Debug.Assert(!this.HasErrors); 516Debug.Assert(AttributeClass is object); 572Debug.Assert(!this.HasErrors); 575Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 597Debug.Assert(!this.HasErrors); 600Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 623Debug.Assert(!this.HasErrors); 672Debug.Assert(target is SourceAssemblySymbol || target.ContainingAssembly is SourceAssemblySymbol); 805Debug.Assert(attribute is SourceAttributeData);
Symbols\Attributes\PEAttributeData.cs (1)
111Debug.Assert(lazyConstructorArguments != null && lazyNamedArguments != null);
Symbols\Attributes\RetargetingAttributeData.cs (4)
30Debug.Assert(underlying is SourceAttributeData or SynthesizedAttributeData); 31Debug.Assert(attributeClass is object || underlying.HasErrors); 54Debug.Assert(AttributeClass is object || _underlying.HasErrors); 62Debug.Assert(AttributeConstructor is null);
Symbols\Attributes\SourceAttributeData.cs (17)
41Debug.Assert(compilation is object); 42Debug.Assert(applicationNode is object); 43Debug.Assert(!isConditionallyOmitted || attributeClass is object && attributeClass.IsConditional); 44Debug.Assert(!constructorArguments.IsDefault); 45Debug.Assert(!namedArguments.IsDefault); 46Debug.Assert(constructorArgumentsSourceIndices.IsDefault || 48Debug.Assert(attributeConstructor is object || hasErrors); 129Debug.Assert(!this.HasErrors); 130Debug.Assert(this.AttributeConstructor is object); 131Debug.Assert(parameterIndex >= 0); 132Debug.Assert(parameterIndex < this.AttributeConstructor.ParameterCount); 139Debug.Assert(attributeSyntax.ArgumentList != null); 140Debug.Assert(this.AttributeConstructor.ParameterCount <= attributeSyntax.ArgumentList.Arguments.Count); 152Debug.Assert(this.AttributeConstructor.Parameters[parameterIndex].IsOptional || 158Debug.Assert(sourceArgIndex >= 0); 159Debug.Assert(sourceArgIndex < attributeSyntax.ArgumentList!.Arguments.Count); 475Debug.Assert(attributeClass is object);
Symbols\Attributes\WellKnownAttributeData\PropertyEarlyWellKnownAttributeData.cs (1)
32Debug.Assert(value != null);
Symbols\Attributes\WellKnownAttributeData\TypeWellKnownAttributeData.cs (2)
28Debug.Assert((object)_comImportCoClass == null); 29Debug.Assert((object)value != null);
Symbols\Attributes\WellKnownAttributeData\TypeWellKnownEarlyAttributeData.cs (1)
60Debug.Assert(value is -1 or > 0);
Symbols\BaseTypeAnalysis.cs (9)
20Debug.Assert((object)depends != null); 21Debug.Assert((object)on != null); 22Debug.Assert(on.IsDefinition); 65Debug.Assert((object)depends != null); 66Debug.Assert((object)on != null); 67Debug.Assert(on.IsDefinition); 82Debug.Assert((object)type != null); 175Debug.Assert((object)type != null); 188Debug.Assert((object)(field.AssociatedSymbol as EventSymbol) == null,
Symbols\Compilation_UsedAssemblies.cs (3)
174Debug.Assert(!dependency.IsLinked); 192Debug.Assert(retargetingAssembly.Modules[0].ReferencedAssemblySymbols.Contains(underlyingDependency)); 253Debug.Assert(!added || !wasFrozen);
Symbols\Compilation_WellKnownMembers.cs (27)
58Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 70Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 83Debug.Assert(member >= 0 && member < WellKnownMember.Count); 127Debug.Assert(type.IsValid()); 155Debug.Assert(result?.IsErrorType() != true); 169Debug.Assert(conflicts is (null, null)); 186Debug.Assert( 224Debug.Assert(wellKnownType == WellKnownType.System_Attribute || 270Debug.Assert(!isStatic); 405Debug.Assert(isOptionalUse || WellKnownMembers.IsSynthesizedAttributeOptional(constructor)); 428Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(constructor)); 451Debug.Assert(isOptionalUse); 469Debug.Assert(!systemByte.HasUseSiteError); 472Debug.Assert(!systemUnit32.HasUseSiteError); 520Debug.Assert(!modifyCompilation || !_needsGeneratedAttributes_IsFrozen); 581Debug.Assert(ShouldEmitNativeIntegerAttributes()); 645Debug.Assert(ShouldEmitNativeIntegerAttributes()); 718Debug.Assert(errorReported); 743Debug.Assert((object)debuggableAttribute != null, "GetWellKnownType unexpectedly returned null"); 820Debug.Assert(type.ContainsDynamic()); 840Debug.Assert(type.ContainsTuple()); 846Debug.Assert(!names.IsDefault, "should not need the attribute when no tuple names"); 935Debug.Assert(flagsBuilder.Any()); 936Debug.Assert(flagsBuilder.Contains(true)); 959Debug.Assert(!transformFlagsBuilder.Any()); 1007Debug.Assert(!isNestedNamedType); 1085Debug.Assert(type.ContainingAssembly?.RuntimeSupportsNumericIntPtr != true);
Symbols\ConstantValueUtils.cs (1)
50Debug.Assert(value != null);
Symbols\ConstraintsHelper.cs (31)
139Debug.Assert(currentCompilation == null || typeParameter.IsFromCompilation(currentCompilation)); 161Debug.Assert(!constraintType.Type.ContainsDynamic()); 223Debug.Assert(inherited || currentCompilation == null || constraintType.TypeKind != TypeKind.Delegate); 257Debug.Assert(inherited || currentCompilation == null); 263Debug.Assert(inherited || currentCompilation == null); 269Debug.Assert(inherited || currentCompilation == null); 322Debug.Assert((effectiveBaseClass.SpecialType == SpecialType.System_Object) || (deducedBaseType.SpecialType != SpecialType.System_Object)); 328Debug.Assert(effectiveBaseClass.SpecialType == SpecialType.System_Object); 329Debug.Assert(interfaces.Length == 0); 359Debug.Assert(!withTypeParametersBinder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 397Debug.Assert(!withTypeParametersBinder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 419Debug.Assert(constraintClauses.Length == arity); 431Debug.Assert((constraintKind & (TypeParameterConstraintKind.ValueTypeFromConstraintTypes | TypeParameterConstraintKind.ReferenceTypeFromConstraintTypes)) == 0); 474Debug.Assert(!deducedBase.IsValueType || typeParameter.HasReferenceTypeConstraint); 612Debug.Assert(tuple.IsTupleType); 683Debug.Assert(typeArgumentsSyntax.Count == 0 /*omitted*/ || typeArgumentsSyntax.Count == type.Arity); 907Debug.Assert(typeParameters.Length == typeArguments.Length); 908Debug.Assert(!args.Conversions.IncludeNullability || (nullabilityDiagnosticsBuilderOpt != null)); 915Debug.Assert(typeParameters.All(tp => ReferenceEquals(tp.ContainingSymbol, constructedContainingSymbol.OriginalDefinition))); 1064Debug.Assert(substitution != null); 1067Debug.Assert(ReferenceEquals(typeParameter.ContainingSymbol, constructedContainingSymbol.OriginalDefinition)); 1410Debug.Assert(iface.IsInterfaceType()); 1515Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1552Debug.Assert(IsValidEncompassedByArgument(a)); 1553Debug.Assert(IsValidEncompassedByArgument(b)); 1556Debug.Assert(!conversions.IncludeNullability); 1594Debug.Assert(!type.ConstructedFrom.Equals(type, TypeCompareKind.ConsiderEverything)); 1616Debug.Assert(method.ConstructedFrom != method 1624Debug.Assert((object)deducedBase != null); 1625Debug.Assert((object)effectiveBase != null); 1627Debug.Assert(deducedBase.IsErrorType() ||
Symbols\ConstructedNamedTypeSymbol.cs (4)
71Debug.Assert(constructedFrom.Arity == typeArgumentsWithAnnotations.Length); 72Debug.Assert(constructedFrom.Arity != 0); 99Debug.Assert(typeArguments.Length == n); 100Debug.Assert(typeArguments.Length > 0);
Symbols\CustomModifier.cs (1)
21Debug.Assert((object)modifier != null);
Symbols\DiscardSymbol.cs (1)
16Debug.Assert(typeWithAnnotations.Type is object);
Symbols\DynamicTypeEraser.cs (1)
20Debug.Assert((object)objectType != null);
Symbols\DynamicTypeSymbol.cs (2)
234Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 245Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\ErrorMethodSymbol.cs (1)
287Debug.Assert(MethodKind == MethodKind.Constructor);
Symbols\ErrorTypeSymbol.cs (4)
73Debug.Assert(ResultKind != LookupResultKind.Viable, "Shouldn't have viable result kind on error symbol"); 488Debug.Assert(this.IsDefinition); 489Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol?.OriginalDefinition)); 569Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\EventSymbol.cs (4)
267Debug.Assert(this.IsDefinition); 268Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 269Debug.Assert(newOwner.IsDefinition || newOwner is SubstitutedNamedTypeSymbol); 289Debug.Assert(this.IsDefinition);
Symbols\ExtendedErrorTypeSymbol.cs (3)
35Debug.Assert(((object?)containingSymbol == null) || 41Debug.Assert(unreported == false || errorInfo != null); 79Debug.Assert(candidateSymbols.IsEmpty || resultKind != LookupResultKind.Viable, "Shouldn't use LookupResultKind.Viable with candidate symbols");
Symbols\Extensions\ReceiverParameterSymbol.cs (1)
36Debug.Assert(_underlyingParameter.InterpolatedStringHandlerArgumentIndexes.IsEmpty);
Symbols\Extensions\RewrittenLambdaOrLocalFunctionSymbol.cs (2)
20Debug.Assert(lambdaOrLocalFunctionSymbol.AssociatedSymbol is null); 21Debug.Assert(lambdaOrLocalFunctionSymbol.TryGetThisParameter(out var thisParameter) && thisParameter is null);
Symbols\Extensions\RewrittenMethodSymbol.cs (2)
21Debug.Assert(originalMethod.IsDefinition); 22Debug.Assert(originalMethod.ExplicitInterfaceImplementations.IsEmpty);
Symbols\Extensions\SourceExtensionImplementationMethodSymbol.cs (5)
25Debug.Assert(sourceMethod.IsExtensionBlockMember()); 26Debug.Assert(sourceMethod.IsStatic || sourceMethod.ContainingType.ExtensionParameter is not null); 135Debug.Assert(parameters.Count == ParameterCount); 180Debug.Assert(string.Equals(result, withIncludes, System.StringComparison.Ordinal)); 227Debug.Assert(_underlyingParameter.ContainingSymbol is not NamedTypeSymbol);
Symbols\Extensions\SynthesizedExtensionMarker.cs (4)
29Debug.Assert(extensionType.IsDefinition); 30Debug.Assert(extensionType.IsExtension); 31Debug.Assert(parameterList is not null); 93Debug.Assert(parameterTypeSyntax is not null);
Symbols\FieldOrPropertyInitializer.cs (1)
31Debug.Assert(((syntax.IsKind(SyntaxKind.EqualsValueClause) || syntax.IsKind(SyntaxKind.Parameter)) && fieldOpt != null) || syntax is StatementSyntax);
Symbols\FieldSymbol.cs (9)
329Debug.Assert(this.IsDefinition); 330Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 353Debug.Assert(IsDefinition); 414Debug.Assert(!(this is TupleElementFieldSymbol or TupleErrorFieldSymbol)); 423Debug.Assert(!(this is TupleElementFieldSymbol or TupleErrorFieldSymbol)); 437Debug.Assert(!(this is TupleElementFieldSymbol)); 450Debug.Assert(!(this is TupleElementFieldSymbol)); 473Debug.Assert(!(this is TupleElementFieldSymbol or TupleErrorFieldSymbol or Retargeting.RetargetingFieldSymbol)); 491Debug.Assert(tupleElementPosition < NamedTypeSymbol.ValueTupleRestPosition);
Symbols\FunctionPointers\FunctionPointerMethodSymbol.cs (17)
59Debug.Assert(refKind != RefKind.None); 212Debug.Assert(specifierType?.IsErrorType() != true); 213Debug.Assert(specifierType is null || ReferenceEquals(specifierType.ContainingAssembly, compilation.Assembly.CorLibrary)); 280Debug.Assert(callingConvention == CallingConvention.Unmanaged); 312Debug.Assert(refKind is RefKind.None or RefKind.In or RefKind.Ref or RefKind.Out); 323Debug.Assert(refKind != RefKind.Out && refKind != RefKind.In); 350Debug.Assert(RefKind == signature.RefKind); 363Debug.Assert(thisParam.RefKind == otherParam.RefKind); 451Debug.Assert(originalParameters.Length == substitutedParameterTypes.Length); 452Debug.Assert(substitutedRefCustomModifiers.IsDefault || originalParameters.Length == substitutedRefCustomModifiers.Length); 496Debug.Assert(refKind != RefKind.Out); 497Debug.Assert(refCustomModifiers.IsDefaultOrEmpty || refKind != RefKind.None); 498Debug.Assert(parameterRefCustomModifiers.IsDefault || parameterRefCustomModifiers.Length == parameterTypes.Length); 509Debug.Assert(refCustomModifiers.IsEmpty || refKind != RefKind.None); 545Debug.Assert(retAndParamTypes.Length > 0); 554Debug.Assert(RefKind != RefKind.Out); 812Debug.Assert(!isVararg || HasUseSiteError);
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
18Debug.Assert(typeWithAnnotations.HasType);
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (3)
127Debug.Assert(nullableAnnotation != DefaultNullableAnnotation); 163Debug.Assert(this.Equals(other, TypeCompareKind.AllIgnoreOptions)); 209Debug.Assert(modifierType.ContainingAssembly is not null || modifierType.IsErrorType());
Symbols\FunctionTypeSymbol.cs (7)
66Debug.Assert((object?)_lazyDelegateType == Uninitialized); 67Debug.Assert(_expression is null); 68Debug.Assert(expression.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda); 81Debug.Assert(_binder is { }); 82Debug.Assert(_calculateDelegate is { }); 83Debug.Assert(_expression is { }); 162Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
Symbols\LexicalSortKey.cs (4)
56Debug.Assert(position >= 0); 57Debug.Assert(treeOrdinal >= 0); 114Debug.Assert(comparison != 0); 137Debug.Assert(other.IsInitialized);
Symbols\MemberSignatureComparer.cs (7)
379Debug.Assert(!considerExplicitlyImplementedInterfaces || considerName, "Doesn't make sense to consider interfaces separately from name."); 389Debug.Assert((_typeComparison & TypeCompareKind.FunctionPointerRefOutInRefReadonlyMatch) == 0, 391Debug.Assert(_refKindCompareMode == RefKindCompareMode.RefOutInRefReadonlyMatch || 486Debug.Assert(sawInterfaceInName2); 615Debug.Assert(typeParameters1.Length == typeParameters2.Length); 740Debug.Assert(params1.Length == params2.Length); 798Debug.Assert(refKindCompareMode == RefKindCompareMode.RefOutInRefReadonlyMatch);
Symbols\MemberSymbolExtensions.cs (16)
133Debug.Assert(member.GetMemberArityIncludingExtension() != 0); 144Debug.Assert(property.IsExtensionBlockMember()); 159Debug.Assert(originalTypeParameters.Length == method.Arity + method.ContainingType.Arity); 231Debug.Assert(property.IsExtensionBlockMember()); 233Debug.Assert(extension.Arity > 0); 234Debug.Assert(extension.Arity == typeArguments.Length); 257Debug.Assert((object)constructed != null); 283Debug.Assert(method.IsExtensionBlockMember()); 297Debug.Assert(receiverType is not null); 298Debug.Assert(property.IsExtensionBlockMember()); 375Debug.Assert(symbol.ContainingType.IsInterface); 796Debug.Assert(member.IsDefinition); 808Debug.Assert(member.IsDefinition); 820Debug.Assert(member.IsDefinition); 833Debug.Assert(member.IsDefinition); 845Debug.Assert(member.IsDefinition);
Symbols\MergedNamespaceSymbol.cs (2)
81Debug.Assert(namespacesToMerge.Length != 0); 101Debug.Assert(ns.ConstituentNamespaces.Length == 1);
Symbols\Metadata\PE\DynamicTypeDecoder.cs (16)
46Debug.Assert(!dynamicTransformFlags.IsEmpty); 47Debug.Assert((object)containingAssembly != null); 71Debug.Assert((object)metadataType != null); 112Debug.Assert((object)metadataType != null); 113Debug.Assert((object)containingAssembly != null); 114Debug.Assert(!dynamicTransformFlags.IsDefault); 131Debug.Assert(checkLength || decoder._dynamicTransformFlags.LastIndexOf(true) < decoder._index); 142Debug.Assert(_index >= 0); 173Debug.Assert(!_haveCustomModifierFlags, "This shouldn't happen during decoding."); 195Debug.Assert(customModifiersCount >= 0); 211Debug.Assert(_index >= 0); 221Debug.Assert(!flag); 234Debug.Assert(newContainingType.IsGenericType); 305Debug.Assert(!flag); 328Debug.Assert(!flag); 350Debug.Assert(!flag);
Symbols\Metadata\PE\MemberRefMetadataDecoder.cs (5)
38Debug.Assert((object)containingType != null); 78Debug.Assert(cumulativeArity <= position); 104Debug.Assert((object)typeArgument == null); 249Debug.Assert(candidateMethodTypeMap != null); 277Debug.Assert(candidateMethodTypeMap != null);
Symbols\Metadata\PE\MetadataDecoder.cs (16)
58Debug.Assert((object)moduleSymbol != null); 101Debug.Assert(position >= 0 && position < type.Arity); 121Debug.Assert(result?.IsErrorType() != true); 169Debug.Assert(result?.IsErrorType() != true); 310Debug.Assert((object)result != null); 313Debug.Assert(cache != null); 316Debug.Assert(ReferenceEquals(newresult, result) || (newresult.Kind == SymbolKind.ErrorType)); 364Debug.Assert((object)assembly != null); 372Debug.Assert(candidate?.IsGenericType != true); 373Debug.Assert(candidate?.IsErrorType() != true); 374Debug.Assert(candidate is null || ReferenceEquals(candidate.ContainingAssembly, assembly)); 388Debug.Assert(!(assembly is SourceAssemblySymbol) || !((SourceAssemblySymbol)assembly).SourceModule.MightContainNoPiaLocalTypes()); 490Debug.Assert(typeSymbol.IsDefinition); 517Debug.Assert(typeSymbol is PENamedTypeSymbol || typeSymbol is ErrorTypeSymbol); 540Debug.Assert(!targetTypeSymbol.IsTupleType); 544Debug.Assert(scope.Kind == SymbolKind.NamedType || scope.Kind == SymbolKind.ErrorType);
Symbols\Metadata\PE\NativeIntegerTypeDecoder.cs (4)
41Debug.Assert(type.ContainsErrorType()); 42Debug.Assert(result is null); 47Debug.Assert(result is object); 102Debug.Assert(type.TypeKind == TypeKind.Error);
Symbols\Metadata\PE\NullableTypeDecoder.cs (3)
27Debug.Assert(metadataType.HasType); 28Debug.Assert(accessSymbol.IsDefinition); 29Debug.Assert((object)accessSymbol.ContainingModule == containingModule);
Symbols\Metadata\PE\PEAssemblySymbol.cs (2)
75Debug.Assert(assembly != null); 76Debug.Assert(documentationProvider != null);
Symbols\Metadata\PE\PEEventSymbol.cs (2)
65Debug.Assert(!handle.IsNil); 163Debug.Assert(candidateAssociatedField.DeclaredAccessibility == Accessibility.Private);
Symbols\Metadata\PE\PEFieldSymbol.cs (9)
59Debug.Assert((value & ~(FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull | FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull)) == 0); 80Debug.Assert(value == 0 || result); 87Debug.Assert(IsVolatile == isVolatile); 96Debug.Assert(RefKind == refKind); 161Debug.Assert((object)moduleSymbol != null); 162Debug.Assert((object)containingType != null); 163Debug.Assert(!fieldDef.IsNil); 313Debug.Assert((object)eventSymbol != null); 314Debug.Assert(TypeSymbol.Equals(eventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2));
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
32Debug.Assert((object)moduleSymbol != null);
Symbols\Metadata\PE\PEMethodSymbol.cs (34)
129Debug.Assert((long)value == ((long)value & MethodKindMask)); 165Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>((int)MethodKindMask)); 166Debug.Assert(EnumUtilities.ContainsAllValues<NullableContextKind>((int)NullableContextMask)); 178Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 185Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 191Debug.Assert((long)methodKind == ((long)methodKind & MethodKindMask)); 193Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 203Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 258Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 422Debug.Assert((object)moduleSymbol != null); 423Debug.Assert((object)containingType != null); 424Debug.Assert(!methodDef.IsNil); 436Debug.Assert((uint)implFlags <= ushort.MaxValue); 449Debug.Assert((uint)localflags <= ushort.MaxValue); 475Debug.Assert(flag != 0 && ((ushort)flag & ((ushort)flag - 1)) == 0); 633Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated); 646Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated); 711Debug.Fail("Not expecting to get here; if we end up here through ENC, add tests to verify"); 742Debug.Assert(!memberNotNull.IsDefault); 750Debug.Assert(!memberNotNullWhenTrue.IsDefault); 756Debug.Assert(!memberNotNullWhenFalse.IsDefault); 817Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet)); 827Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove)); 835Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2)); 843Debug.Assert( 1032Debug.Assert(!attributeData.IsDefault); 1558Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.Uninitialized)); 1559Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound)); 1653Debug.Assert(!result.IsDefault); 1681Debug.Assert(MethodKind == MethodKind.Constructor); 1737Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyData, UnmanagedCallersOnlyAttributeData.Uninitialized) 1763Debug.Assert(result != null); 1830Debug.Assert(AssociatedSymbol?.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) != CallerUnsafeMode.Implicit); 1870Debug.Assert(_uncommonFields is null or { _lazyOverloadResolutionPriority: 0 });
Symbols\Metadata\PE\PEModuleSymbol.cs (19)
138Debug.Assert(ordinal >= 0); 144Debug.Assert(ordinal > 0); 150Debug.Assert(ordinal > 0); 155Debug.Assert((object)assemblySymbol != null); 156Debug.Assert(module != null); 380Debug.Assert(added); 452Debug.Assert((object)_lazyEventRegistrationTokenSymbol != null); 469Debug.Assert((object)_lazyEventRegistrationTokenTableSymbol != null); 484Debug.Assert((object)_lazySystemTypeSymbol != null); 495Debug.Assert(currentModuleResult?.IsErrorType() != true); 499Debug.Assert(isAcceptableSystemTypeSymbol(currentModuleResult)); 534Debug.Assert(isAcceptableSystemTypeSymbol(referencedAssemblyResult)); 603Debug.Assert(result?.IsErrorType() != true); 659Debug.Assert(forwarder.Value.FirstIndex >= 0, "First index should never be negative"); 661Debug.Assert((object)firstSymbol != null, "Invalid indexes (out of bound) are discarded during reading metadata in PEModule.EnsureForwardTypeToAssemblyMap()"); 666Debug.Assert((object)secondSymbol != null, "Invalid indexes (out of bound) are discarded during reading metadata in PEModule.EnsureForwardTypeToAssemblyMap()"); 682Debug.Assert(symbol is object); 683Debug.Assert(symbol.IsDefinition); 684Debug.Assert((object)symbol.ContainingModule == this);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (34)
99Debug.Assert(result != s_noUncommonProperties || result.IsDefaultValue(), "default value was modified"); 318Debug.Assert(!handle.IsNil); 319Debug.Assert((object)container != null); 320Debug.Assert(arity == 0 || this is PENamedTypeSymbolGeneric); 321Debug.Assert(markerType is null == markerMethod.IsNil); 322Debug.Assert(markerType is null || container.IsType); 358Debug.Assert(ReferenceEquals(_name, metadataName) == (_name == metadataName)); 371Debug.Assert(markerType is null); 464Debug.Assert(!uncommon.MarkerMethodHandle.IsNil); 476Debug.Assert(this.IsExtension); 477Debug.Assert(method.IsDefinition); 478Debug.Assert(method.ContainingType == (object)this); 967Debug.Assert(uncommon.lazyHasRequiredMembers.Value() == hasRequiredMembers); 973Debug.Assert(uncommon.lazyIsClosed.Value() == isClosed); 1429Debug.Assert(instanceIndex == uncommon.lazyInstanceEnumFields.Length); 1430Debug.Assert(staticIndex == staticFields.Length || staticFields[staticIndex].Kind != SymbolKind.Field); 1452Debug.Assert((object)associatedField.AssociatedSymbol != null); 1453Debug.Assert(!nonEventFields.Contains(associatedField)); 1504Debug.Assert(result.Count == count); 1729Debug.Assert(SymbolKind.Field.ToSortOrder() < SymbolKind.Method.ToSortOrder()); 1730Debug.Assert(SymbolKind.Method.ToSortOrder() < SymbolKind.Property.ToSortOrder()); 1731Debug.Assert(SymbolKind.Property.ToSortOrder() < SymbolKind.Event.ToSortOrder()); 1732Debug.Assert(SymbolKind.Event.ToSortOrder() < SymbolKind.NamedType.ToSortOrder()); 1828Debug.Assert(field.AssociatedSymbol.Kind == SymbolKind.Event); 1863Debug.Assert(previous.Kind.ToSortOrder() <= current.Kind.ToSortOrder()); 1876Debug.Assert(members is object); 2043Debug.Assert(exchangeResult == null); 2095Debug.Assert(!MangleName); 2690Debug.Assert(found || !module.ShouldImportMethod(typeDef, methodDef, this.ContainingPEModule.ImportOptions)); 2774Debug.Assert(DeriveCompilerFeatureRequiredDiagnostic() is null); 3011Debug.Assert(!conditionalSymbols.IsDefault); 3217Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr); 3265Debug.Assert(genericParameterHandles.Count > 0); 3330Debug.Assert(_arity > 0);
Symbols\Metadata\PE\PENamespaceSymbol.cs (4)
100Debug.Assert(lazyTypes != null); 213Debug.Assert(typesByNS != null); 344Debug.Assert(isNoPiaLocalType); 345Debug.Assert(result is not null);
Symbols\Metadata\PE\PENestedNamespaceSymbol.cs (4)
75Debug.Assert(name != null); 76Debug.Assert((object)containingNamespace != null); 77Debug.Assert(typesByNS != null); 132Debug.Assert(lazyNamespaces != null && lazyTypes != null);
Symbols\Metadata\PE\PEParameterSymbol.cs (27)
98Debug.Assert(EnumUtilities.ContainsAllValues<WellKnownAttributeFlags>(WellKnownAttributeDataMask)); 99Debug.Assert(EnumUtilities.ContainsAllValues<RefKind>(RefKindMask)); 100Debug.Assert(EnumUtilities.ContainsAllValues<FlowAnalysisAnnotations>(FlowAnalysisAnnotationsMask)); 101Debug.Assert(EnumUtilities.ContainsAllValues<ScopedKind>(ScopeMask)); 148Debug.Assert(value == 0 || result); 247Debug.Assert((object)moduleSymbol != null); 248Debug.Assert((object)containingSymbol != null); 249Debug.Assert(ordinal >= 0); 250Debug.Assert(typeWithAnnotations.HasType); 334Debug.Assert(refKind != RefKind.None); 370Debug.Assert(refKind == this.RefKind); 371Debug.Assert(hasNameInMetadata == this.HasNameInMetadata); 372Debug.Assert(_name is not null); 420Debug.Assert(parameter.RefKind != RefKind.RefReadOnlyParameter); 458Debug.Assert(_refCustomModifiers.IsEmpty || isByRef); 553Debug.Assert(!_handle.IsNil); 595Debug.Assert(!_handle.IsNil); 846Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 857Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 868Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 870Debug.Assert(initialized == s_defaultStringHandlerAttributeIndexes || indexes == initialized || indexes.SequenceEqual(initialized)); 915Debug.Assert(!ContainingSymbol.IsExtensionBlockMember()); 1007Debug.Assert(!_handle.IsNil); 1021Debug.Assert(!_handle.IsNil); 1112Debug.Assert(_lazyIsParams == 0 || _lazyIsParams == result); 1121Debug.Assert(!_lazyHiddenAttributes.IsDefault); 1130Debug.Assert(!_handle.IsNil);
Symbols\Metadata\PE\PEPropertySymbol.cs (8)
216Debug.Assert((object)moduleSymbol != null); 217Debug.Assert((object)containingType != null); 218Debug.Assert(!handle.IsNil); 224Debug.Assert(propertyParams.Length > 0); 930Debug.Assert((getMethodParams == null) == ((object)getMethod == null)); 931Debug.Assert((setMethodParams == null) == ((object)setMethod == null)); 1141Debug.Assert(IsIndexer || IsIndexedProperty || this.IsExtensionBlockMember()); 1153Debug.Assert(_uncommonFields is null or { _lazyOverloadResolutionPriority: 0 });
Symbols\Metadata\PE\PETypeParameterSymbol.cs (20)
71Debug.Assert((object)moduleSymbol != null); 72Debug.Assert((object)definingSymbol != null); 73Debug.Assert(ordinal >= 0); 74Debug.Assert(!handle.IsNil); 153Debug.Assert(!inProgress.ContainsReference(this)); 154Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 198Debug.Assert(!HasNotNullConstraint && !HasValueTypeConstraint); 322Debug.Assert(isNotNullable == true); 366Debug.Assert(fromTypes == true); 375Debug.Assert(fromNonTypeConstraints == null || fromNonTypeConstraints == true); 376Debug.Assert(fromTypes != true); 382Debug.Assert(!constraintTypes.IsDefaultOrEmpty); 392Debug.Assert(fromType == true); 546Debug.Assert(type.HasType && type.SpecialType == SpecialType.System_Object); 583Debug.Assert(!HasValueTypeConstraint); 671Debug.Assert(!inProgress.ContainsReference(this)); 672Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 677Debug.Assert(!constraintTypes.IsDefault); 708Debug.Assert(_lazyCachedConstraintsUseSiteInfo.IsInitialized); 715Debug.Assert(_lazyCachedConstraintsUseSiteInfo.IsInitialized);
Symbols\Metadata\PE\SymbolFactory.cs (1)
142Debug.Assert(typeParameters.Length > 0);
Symbols\Metadata\PE\TupleTypeDecoder.cs (3)
264Debug.Assert(decodedContainingType.IsGenericType); 297Debug.Assert(elementNames.IsDefault || elementNames.Length == tupleCardinality); 351Debug.Assert(numberOfElements > 0);
Symbols\MetadataOrSourceAssemblySymbol.cs (11)
50Debug.Assert(module.GetReferencedAssemblies().Length == 0); 60Debug.Assert(result?.IsErrorType() != true); 70Debug.Assert(_lazySpecialTypes is not null); 83Debug.Assert(typeId != SpecialType.None); 84Debug.Assert(ReferenceEquals(corType.ContainingAssembly, this)); 85Debug.Assert(corType.ContainingModule.Ordinal == 0); 86Debug.Assert(ReferenceEquals(this.CorLibrary, this)); 96Debug.Assert(ReferenceEquals(corType, _lazySpecialTypes[(int)typeId]) || 103Debug.Assert(_cachedSpecialTypes > 0 && _cachedSpecialTypes < (int)InternalSpecialType.NextAvailable); 137Debug.Assert(!underlyingType.IsNativeIntegerType); 186Debug.Assert(module.GetReferencedAssemblies().Length == 0);
Symbols\MetadataOrSourceOrRetargetingAssemblySymbol.cs (2)
58Debug.Assert(result != IVTConclusion.NoRelationshipClaimed); 72Debug.Assert(!assertUnexpectedGiver, "We are performing a check for an unrelated assembly which likely indicates a bug.");
Symbols\MethodSymbol.cs (12)
238Debug.Assert(this.RefKind != RefKind.Out); 404Debug.Assert(!(this is IAttributeTargetSymbol)); //such types must override 542Debug.Assert(conditionalSymbols != null); 726Debug.Assert(!this.IsExtensionBlockMember()); 906Debug.Assert(this.IsDefinition); 907Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 970Debug.Assert(this.IsDefinition); 1029Debug.Assert(callConvTypedConstant.Kind == TypedConstantKind.Type); 1055Debug.Assert((node == null) == (diagnostics == null)); 1291Debug.Assert(obsoleteData != ObsoleteAttributeData.Uninitialized, "getting synthesized attributes before attributes are decoded"); 1324Debug.Assert(this.IsDefinition); 1325Debug.Assert(this.IsExtensionBlockMember());
Symbols\MethodSymbolExtensions.cs (3)
23Debug.Assert((object)method != null); 86Debug.Assert(method.IsGenericMethod == (typeArguments.Length > 0)); 97Debug.Assert((object)hiddenMethod != null);
Symbols\MissingAssemblySymbol.cs (1)
34Debug.Assert(identity != null);
Symbols\MissingCorLibrarySymbol.cs (2)
44Debug.Assert(this == CorLibrary); 65Debug.Assert(module.GetReferencedAssemblies().Length == 0);
Symbols\MissingMetadataTypeSymbol.cs (2)
347Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr); 357Debug.Assert(other.SpecialType == this.SpecialType);
Symbols\MissingModuleSymbol.cs (3)
33Debug.Assert((object)assembly != null); 34Debug.Assert(ordinal >= -1); 217Debug.Assert(name != null);
Symbols\MissingNamespaceSymbol.cs (3)
25Debug.Assert((object)containingModule != null); 33Debug.Assert((object)containingNamespace != null); 34Debug.Assert(name != null);
Symbols\NamedTypeSymbol.cs (55)
319Debug.Assert(includeInstance || includeStatic); 338Debug.Assert(method.MethodKind == MethodKind.Constructor); 346Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 377Debug.Assert(((PropertySymbol)candidate).IsIndexer); 418Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 428Debug.Assert(thisParam is not null); 453Debug.Assert((options & ~(LookupOptions.AllMethodsOnArityZero 457Debug.Assert(name is not null || alternativeName is null); 536Debug.Assert(member.Kind != SymbolKind.NamedType); 635Debug.Assert(IsScriptClass); 641Debug.Assert(IsScriptClass); 647Debug.Assert(IsScriptClass); 680Debug.Assert(!(fileIdentifier != null && !MangleName && Arity > 0)); 851Debug.Assert(!_lazyRequiredMembers.IsDefault); 876Debug.Assert(!_lazyRequiredMembers.IsDefault); 1195Debug.Assert(count == otherTypeArguments.Length); 1308Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 1349Debug.Assert(typeA.IsGenericType); 1350Debug.Assert(typeA.Equals(typeB, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 1529Debug.Assert(!unbound || typeArguments.All(TypeWithAnnotationsIsErrorType)); 1669Debug.Assert(this.IsDefinition); 1670Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 1763Debug.Assert(owner.ContainingModule.HasUnifiedReferences); 2049Debug.Assert(IsUnionType); 2078Debug.Assert(interfaceForDefinition.IsInterface); 2087Debug.Assert(!interfaceForDefinition.Equals(definitionFactoryMethods[j].ContainingType, TypeCompareKind.ConsiderEverything)); 2117Debug.Assert(definitionFactoryMethod.IsDefinition); 2118Debug.Assert(definitionFactoryMethod.MethodKind == MethodKind.Constructor); 2146Debug.Assert(shadowingMethods is not null); 2154Debug.Assert(result.Count == 0 || 2186Debug.Assert(unionType.IsDefinition); 2187Debug.Assert(unionType.IsUnionType); 2188Debug.Assert(factory.IsDefinition || factory.ContainingType.IsInterface); 2244Debug.Assert(IsUnionType); 2251Debug.Assert(this.IsDefinition); 2280Debug.Assert(type.IsDefinition); 2370Debug.Assert(IsUnionType); 2372Debug.Assert(lazyUncommonProperties._lazyUnionData is not null); 2386Debug.Assert(IsClosed); 2388Debug.Assert(lazyUncommonProperties._lazyClosedClassData is not null); 2397Debug.Assert(ctor.MethodKind is MethodKind.Constructor); 2443Debug.Assert(unionTypeDefinition.IsDefinition); 2449Debug.Assert(valueProperty.Type.IsObjectType()); 2533Debug.Assert(this.IsUnionType); 2534Debug.Assert(this.IsDefinition); 2703Debug.Assert(this.IsUnionType); 2727Debug.Assert(bestMatch is null || 2730Debug.Assert(!bestMatchConversion.IsReference || !conversion.IsNullable); 2731Debug.Assert(!conversion.IsReference || !bestMatchConversion.IsNullable); 2732Debug.Assert(!bestMatchConversion.IsReference || !conversion.IsBoxing); 2733Debug.Assert(!conversion.IsReference || !bestMatchConversion.IsBoxing); 2772Debug.Assert(!containerForDefinition.Equals(definitionTryGetValueMethods[j].ContainingType, TypeCompareKind.ConsiderEverything)); 2864Debug.Assert(this.IsUnionType); 2930Debug.Assert(tupleCardinality < ValueTupleRestPosition); 2963Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\NamespaceOrTypeSymbol.cs (8)
224Debug.Assert(memberT.MergedDeclaration.Declarations.SelectAsArray(decl => decl.NameLocation).SequenceEqual(memberT.Locations)); 257Debug.Assert(!emittedTypeName.IsNull); 260Debug.Assert(scope is not MergedNamespaceSymbol); 261Debug.Assert(scope is NamespaceSymbol or NamedTypeSymbol); 273Debug.Assert(!isTopLevel || scope.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat) == emittedTypeName.NamespaceName); 277Debug.Assert(!emittedTypeName.UnmangledTypeName.Equals(emittedTypeName.TypeName) && emittedTypeName.InferredArity > 0); 303Debug.Assert(ReferenceEquals(emittedTypeName.UnmangledTypeName, emittedTypeName.TypeName) && emittedTypeName.InferredArity == 0); 326Debug.Assert(forcedArity == emittedTypeName.InferredArity);
Symbols\NamespaceSymbol.cs (2)
237Debug.Assert(types.Length == 1); 344Debug.Assert((object)assembly != null);
Symbols\NativeIntegerTypeSymbol.cs (15)
33Debug.Assert(underlyingType.TupleData is null); 34Debug.Assert(!underlyingType.IsNativeIntegerType); 35Debug.Assert(underlyingType.SpecialType == SpecialType.System_IntPtr || underlyingType.SpecialType == SpecialType.System_UIntPtr); 36Debug.Assert(!underlyingType.ContainingAssembly.RuntimeSupportsNumericIntPtr); 88Debug.Assert(_underlyingType.Equals(underlyingMember.ContainingSymbol)); 173Debug.Assert(useSiteInfo.DiagnosticInfo is null); // If assert fails, add unit test for use site diagnostic. 279Debug.Assert(!symbolA.Equals(symbolB, TypeCompareKind.ConsiderEverything)); 280Debug.Assert(!symbolB.Equals(symbolA, TypeCompareKind.ConsiderEverything)); 281Debug.Assert(symbolA.Equals(symbolB, TypeCompareKind.IgnoreNativeIntegers)); 282Debug.Assert(symbolB.Equals(symbolA, TypeCompareKind.IgnoreNativeIntegers)); 283Debug.Assert(symbolA.GetHashCode() == symbolB.GetHashCode()); 324Debug.Assert(_specialType == SpecialType.System_IntPtr || _specialType == SpecialType.System_UIntPtr); 352Debug.Assert(!underlyingMethod.IsGenericMethod); 454Debug.Assert(container != null); 510Debug.Assert(underlyingProperty.ParameterCount == 0);
Symbols\NonMissingAssemblySymbol.cs (3)
121Debug.Assert(result is null || ((object)result.ContainingAssembly == (object)this && !result.IsErrorType())); 173Debug.Assert(result is null || ((object)result.ContainingAssembly == (object)this && !result.IsErrorType())); 225System.Diagnostics.Debug.Assert(TypeSymbol.Equals(result1, result, TypeCompareKind.ConsiderEverything2)); // object identity may differ in error cases
Symbols\NonMissingModuleSymbol.cs (4)
156Debug.Assert(moduleReferences != null); 166Debug.Assert(_moduleReferences == null); 172Debug.Assert(_moduleReferences != null); 203Debug.Assert(result?.IsErrorType() != true);
Symbols\NoPiaAmbiguousCanonicalTypeSymbol.cs (1)
47Debug.Assert(Arity == 0);
Symbols\NoPiaIllegalGenericInstantiationSymbol.cs (1)
39Debug.Assert(Arity == 0);
Symbols\NoPiaMissingCanonicalTypeSymbol.cs (1)
71Debug.Assert(Arity == 0);
Symbols\NullableAnnotationExtensions.cs (9)
28Debug.Assert(a != NullableAnnotation.Ignored); 29Debug.Assert(b != NullableAnnotation.Ignored); 39Debug.Assert(a != NullableAnnotation.Ignored); 40Debug.Assert(b != NullableAnnotation.Ignored); 50Debug.Assert(a != NullableAnnotation.Ignored); 51Debug.Assert(b != NullableAnnotation.Ignored); 65Debug.Assert(a != NullableAnnotation.Ignored); 66Debug.Assert(b != NullableAnnotation.Ignored); 128Debug.Assert(annotation != NullableAnnotation.Ignored);
Symbols\ObsoleteAttributeHelpers.cs (8)
47Debug.Assert(obsoleteAttributeData == null || !obsoleteAttributeData.IsUninitialized); 155Debug.Assert(result?.IsObsoleteDiagnostic() != false); 161Debug.Assert(data != null); 170Debug.Assert(!data.IsUninitialized); 180Debug.Assert(data.Message == null); 181Debug.Assert(!data.IsError); 189Debug.Assert(!data.IsError); 206Debug.Assert(!isColInit || symbol.Name == WellKnownMemberNames.CollectionInitializerAddMethodName);
Symbols\OverriddenOrHiddenMembersHelpers.cs (23)
86Debug.Assert(member.Kind == SymbolKind.Method || member.Kind == SymbolKind.Property || member.Kind == SymbolKind.Event); 106Debug.Assert(associatedPropertyOrEvent.Kind == SymbolKind.Event); 112Debug.Assert(!member.IsAccessor()); 243Debug.Assert(accessor.IsAccessor()); 244Debug.Assert((object)associatedProperty != null); 335Debug.Assert(accessor.IsAccessor()); 336Debug.Assert((object)associatedEvent != null); 411Debug.Assert(!member.IsAccessor()); 414Debug.Assert(containingType.IsInterfaceType()); 500Debug.Assert(overriddenMembers.Length == 0); 506Debug.Assert(overriddenMembers.IsEmpty); 542Debug.Assert(!member.IsAccessor()); 622Debug.Assert(memberIsFromSomeCompilation || minCustomModifierCount == int.MaxValue, "Metadata members require exact custom modifier matches."); 669Debug.Assert(!(param.TypeWithAnnotations.CustomModifiers.Any() || param.RefCustomModifiers.Any())); 670Debug.Assert(!param.Type.HasCustomModifiers(flagNonDefaultArraySizesOrLowerBounds: false)); 755Debug.Assert((object)hiddenMember != null); 791Debug.Assert((object)representativeMember != null); 792Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 853Debug.Assert((object)representativeMember != null); 854Debug.Assert(representativeMember.Kind != SymbolKind.Field); 855Debug.Assert(representativeMember.Kind != SymbolKind.NamedType); 856Debug.Assert(representativeMember.Kind == SymbolKind.Property || !representativeMember.ContainingType.IsDefinition); 964Debug.Assert(runtimeOverriddenMethod is { });
Symbols\OverriddenOrHiddenMembersResult.cs (1)
56Debug.Assert(!substitutedOverridingMember.IsDefinition);
Symbols\PlaceholderTypeArgumentSymbol.cs (1)
46Debug.Assert(Arity == 0);
Symbols\PointerTypeSymbol.cs (3)
29Debug.Assert(pointedAtType.HasType); 276Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 307Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\PropertySymbol.cs (3)
380Debug.Assert(this.IsDefinition); 381Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 399Debug.Assert(this.IsDefinition);
Symbols\PublicModel\ArrayTypeSymbol.cs (2)
26Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 27Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\AssemblySymbol.cs (1)
93Debug.Assert(conclusion != IVTConclusion.NoRelationshipClaimed);
Symbols\PublicModel\DynamicTypeSymbol.cs (2)
23Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 24Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\ErrorTypeSymbol.cs (2)
24Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 25Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\FieldSymbol.cs (1)
20Debug.Assert(underlying is object);
Symbols\PublicModel\FunctionPointerTypeSymbol.cs (2)
42Debug.Assert(nullableAnnotation != this.NullableAnnotation); 43Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation);
Symbols\PublicModel\LocalSymbol.cs (1)
19Debug.Assert(underlying is object);
Symbols\PublicModel\MethodSymbol.cs (1)
27Debug.Assert(underlying is object);
Symbols\PublicModel\ModuleSymbol.cs (1)
18Debug.Assert(underlying is object);
Symbols\PublicModel\NamedTypeSymbol.cs (1)
212Debug.Assert(!isExtension
Symbols\PublicModel\NamespaceSymbol.cs (1)
19Debug.Assert(underlying is object);
Symbols\PublicModel\NonErrorNamedTypeSymbol.cs (4)
18Debug.Assert(underlying is object); 19Debug.Assert(!underlying.IsErrorType()); 25Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 26Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\NonSourceAssemblySymbol.cs (2)
17Debug.Assert(underlying is object); 18Debug.Assert(!(underlying is Symbols.SourceAssemblySymbol));
Symbols\PublicModel\ParameterSymbol.cs (1)
20Debug.Assert(underlying is object);
Symbols\PublicModel\PointerTypeSymbol.cs (3)
19Debug.Assert(underlying is object); 25Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 26Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\PropertySymbol.cs (1)
20Debug.Assert(underlying is object);
Symbols\PublicModel\RangeVariableSymbol.cs (1)
17Debug.Assert(underlying is object);
Symbols\PublicModel\SourceAssemblySymbol.cs (1)
17Debug.Assert(underlying is object);
Symbols\PublicModel\TypeParameterSymbol.cs (3)
19Debug.Assert(underlying is object); 25Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 26Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\RangeVariableSymbol.cs (3)
61Debug.Assert(_location.SourceTree != null); 63Debug.Assert(token.Kind() == SyntaxKind.IdentifierToken); 65Debug.Assert(node is QueryClauseSyntax || node is QueryContinuationSyntax || node is JoinIntoClauseSyntax);
Symbols\ReducedExtensionMethodSymbol.cs (18)
40Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 41Debug.Assert(method.ParameterCount > 0); 42Debug.Assert((object)receiverType != null); 75Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 88Debug.Assert(!method.TypeArgumentsWithAnnotations.IsEmpty); 94Debug.Assert((object)reducedFrom != null); 95Debug.Assert(reducedFrom.IsExtensionMethod); 96Debug.Assert((object)reducedFrom.ReducedFrom == null); 97Debug.Assert(reducedFrom.ConstructedFrom == reducedFrom); 98Debug.Assert(reducedFrom.ParameterCount > 0); 116Debug.Assert(method.IsExtensionMethod); 117Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 118Debug.Assert(method.ParameterCount > 0); 119Debug.Assert((object)thisType != null); 282Debug.Assert(_reducedFrom.ConstructedFrom == _reducedFrom); 568Debug.Assert(count == 1); 630Debug.Assert(containingMethod != null); 631Debug.Assert(underlyingParameter.Ordinal > 0);
Symbols\ReferenceManager.cs (33)
93Debug.Assert(csReference.Compilation._lazyAssemblySymbol is object); 120Debug.Assert(AssemblyIdentityComparer.SimpleNameComparer.Equals(identity1.Name, identity2.Name)); 126Debug.Assert(referencedAssemblySymbols.IsEmpty()); 206Debug.Assert(successful); 212Debug.Assert(compilation._lazyAssemblySymbol is object); 251Debug.Assert(!HasCircularReference); 260Debug.Assert(assembly is object); 302Debug.Assert(!HasCircularReference); 316Debug.Assert(ReferenceEquals(compilation._referenceManager, this)); 333Debug.Assert(assemblyModules.Length == referencedModulesReferences.Length + 1); 398Debug.Assert(bindingResult.Length == allAssemblyData.Length); 433Debug.Assert(allAssemblyData[i].IsLinked == bound.AssemblySymbol.IsLinked); 517Debug.Assert(ReferenceEquals(compilation._referenceManager, this) || HasCircularReference); 543Debug.Assert(newSymbols.Count > 0); 571Debug.Assert(currentBindingResult.AssemblySymbol is object); 572Debug.Assert(currentBindingResult.ReferenceBinding is object); 593Debug.Assert(linkedAssemblySymbol is object); 624Debug.Assert(current.AssemblySymbol is object); 645Debug.Assert(currentBindingResult.AssemblySymbol is object); 646Debug.Assert(currentBindingResult.ReferenceBinding is object); 686Debug.Assert(newIndex == filteredReferencedAssemblies.Length); 722Debug.Assert(currentBindingResult.AssemblySymbol is object); 723Debug.Assert(currentBindingResult.ReferenceBinding is object); 768Debug.Assert(moduleSymbols.Length == 1 + modules.Length); 784Debug.Assert(bindingResult[0].ReferenceBinding is object); 786Debug.Assert(boundReference.ReferenceIdentity is object); 823Debug.Assert(referenceBinding.IsBound); 824Debug.Assert(referenceBinding.ReferenceIdentity is object); 826Debug.Assert(assembly is object); 875Debug.Assert(!referencedAssemblies.IsDefault); 1102Debug.Assert(sourceReferencedAssemblies.Length == sourceReferencedAssemblySymbols.Length); 1128Debug.Assert(result.Count == builderSize); 1162Debug.Assert(!(asm is RetargetingAssemblySymbol));
Symbols\RefKindExtensions.cs (1)
16Debug.Assert(refKind <= RefKind.RefReadOnly);
Symbols\Retargeting\RetargetingAssemblySymbol.cs (2)
104Debug.Assert((object)underlyingAssembly != null); 218Debug.Fail("We are performing a check for an unrelated assembly which likely indicates a bug.");
Symbols\Retargeting\RetargetingEventSymbol.cs (1)
36Debug.Assert(!(underlyingEvent is RetargetingEventSymbol));
Symbols\Retargeting\RetargetingFieldSymbol.cs (2)
38Debug.Assert((object)retargetingModule != null); 39Debug.Assert(!(underlyingField is RetargetingFieldSymbol));
Symbols\Retargeting\RetargetingMethodSymbol.cs (3)
61Debug.Assert((object)retargetingModule != null); 62Debug.Assert((object)underlyingMethod != null); 63Debug.Assert(!(underlyingMethod is RetargetingMethodSymbol));
Symbols\Retargeting\RetargetingModuleSymbol.cs (9)
82Debug.Assert((object)retargetingAssembly != null); 83Debug.Assert((object)underlyingModule != null); 102Debug.Assert(_underlyingModule.Ordinal == 0); // Always a source module 198Debug.Assert(referencedAssemblySymbols.Length == moduleReferences.Identities.Length); 199Debug.Assert(referencedAssemblySymbols.Length <= underlyingBoundReferences.Length); // Linked references are filtered out. 216Debug.Assert(identityComparer.Compare(moduleReferences.Identities[i], definitionIdentity) != AssemblyIdentityComparer.ComparisonResult.NotEquivalent); 217Debug.Assert(identityComparer.Compare(moduleReferences.Identities[i], underlyingBoundReferences[j].Identity) != AssemblyIdentityComparer.ComparisonResult.NotEquivalent); 231Debug.Assert(ReferenceEquals(destinationData.To, referencedAssemblySymbols[i])); 242Debug.Assert(j == underlyingBoundReferences.Length);
Symbols\Retargeting\RetargetingNamedTypeSymbol.cs (8)
53Debug.Assert((object)retargetingModule != null); 54Debug.Assert(!(underlyingType is RetargetingNamedTypeSymbol)); 118Debug.Assert(this.IsExtension); 119Debug.Assert(method.IsDefinition); 120Debug.Assert(method.ContainingType == (object)this); 192Debug.Assert((object)method != null); 302Debug.Assert(!underlyingResult.IsErrorType()); 303Debug.Assert((object)_underlyingType == underlyingResult.ContainingSymbol);
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (6)
46Debug.Assert((object)retargetingModule != null); 47Debug.Assert((object)underlyingNamespace != null); 48Debug.Assert(!(underlyingNamespace is RetargetingNamespaceSymbol)); 139Debug.Assert(t.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 231Debug.Assert((object)underlying.ContainingModule == (object)_retargetingModule.UnderlyingModule); 232Debug.Assert(!underlying.IsErrorType());
Symbols\Retargeting\RetargetingParameterSymbol.cs (4)
33Debug.Assert(!(underlyingParameter is RetargetingParameterSymbol)); 178Debug.Assert((object)retargetingMethod != null); 200Debug.Assert((object)retargetingProperty != null); 222Debug.Assert((object)retargetingType != null);
Symbols\Retargeting\RetargetingPropertySymbol.cs (3)
42Debug.Assert((object)retargetingModule != null); 43Debug.Assert(!(underlyingProperty is RetargetingPropertySymbol)); 173Debug.Assert(!impls.IsDefault);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (39)
44Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 50Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 56Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 62Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 66Debug.Assert(correspondingTupleField is TupleErrorFieldSymbol); 88Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 94Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 100Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule)); 111Debug.Assert((object)retargetingModule != null); 164Debug.Assert(symbol.Kind != SymbolKind.NamedType || ((NamedTypeSymbol)symbol).PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 207Debug.Assert(type.IsDefinition); 241Debug.Assert(!retargetFrom.IsLinked); 283Debug.Assert(module.Ordinal == 0); 284Debug.Assert(!type.IsExplicitDefinitionOfNoPiaLocalType); 303Debug.Assert(module.Ordinal > 0); 305Debug.Assert(ReferenceEquals(((PEModuleSymbol)module).Module, addedModule.Module)); 350Debug.Assert(signatureIndex == 0 || signatureIndex == 1); 364Debug.Assert((object)type.ContainingAssembly != (object)RetargetingAssembly.UnderlyingAssembly); 386Debug.Assert((object)result != null); 403Debug.Assert(!type.ContainingModule.Equals(addedModule) && 435Debug.Assert(result is PENamedTypeSymbol peResult && peResult.Handle == type.Handle); 461Debug.Assert(result1?.IsErrorType() != true); 472Debug.Assert(result1.Arity == type.Arity); 475Debug.Assert(TypeSymbol.Equals(result1, result, TypeCompareKind.ConsiderEverything2)); 499Debug.Assert(originalDefinition.Arity == 0 || !ReferenceEquals(type.ConstructedFrom, type)); 510Debug.Assert((object)type.ContainingType == null || !type.ContainingType.IsUnboundGenericType()); 578Debug.Assert(newParameters.Count == newArguments.Count); 741Debug.Assert(newModifiers == null || newModifiers.Count == oldModifiers.Length); 842Debug.Assert(nts.TypeKind == TypeKind.Error || nts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 854Debug.Assert(ts.TypeKind == TypeKind.Error || ts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 876Debug.Assert(ReferenceEquals(method.ContainingModule, this.UnderlyingModule)); 877Debug.Assert(ReferenceEquals(method, method.OriginalDefinition)); 884Debug.Assert((object)method == method.ConstructedFrom); 901Debug.Assert(!retargetedType.IsDefinition); 913Debug.Assert(retargetedType.IsDefinition); 926Debug.Assert(ReferenceEquals(property.ContainingModule, this.UnderlyingModule)); 927Debug.Assert(ReferenceEquals(property, property.OriginalDefinition)); 1048Debug.Assert((object)typeParameter.ContainingSymbol == _toFind); 1320Debug.Assert(ReferenceEquals(symbol, _retargetingModule.UnderlyingModule));
Symbols\Retargeting\RetargetingTypeParameterSymbol.cs (2)
43Debug.Assert((object)retargetingModule != null); 44Debug.Assert(!(underlyingTypeParameter is RetargetingTypeParameterSymbol));
Symbols\SignatureOnlyMethodSymbol.cs (1)
48Debug.Assert(returnType.IsDefault || isInitOnly == CustomModifierUtils.HasIsExternalInitModifier(returnType.CustomModifiers));
Symbols\SignatureOnlyParameterSymbol.cs (2)
30Debug.Assert((object)type.Type != null); 31Debug.Assert(!refCustomModifiers.IsDefault);
Symbols\Source\AttributeLocation.cs (1)
119Debug.Assert(result == AttributeLocation.None ^ SyntaxFacts.IsAttributeTargetSpecifier(kind));
Symbols\Source\ConstantEvaluationHelpers.cs (12)
57Debug.Assert(order.Count == 0); 63Debug.Assert(graph.Count >= 1); 76Debug.Assert(fields.All(f => map.Contains(f))); 159Debug.Assert(graph.Count > 0); 269Debug.Assert(graph.Count > 0); 339Debug.Assert(node.Dependencies != null); 340Debug.Assert(node.DependedOnBy != null); 346Debug.Assert(ok); 347Debug.Assert(n.DependedOnBy.Contains(field)); 354Debug.Assert(ok); 355Debug.Assert(n.Dependencies.Contains(field)); 365Debug.Assert(graph.Values.Sum(n => n.DependedOnBy.Count) == graph.Values.Sum(n => n.Dependencies.Count));
Symbols\Source\CustomModifierUtils.cs (9)
29Debug.Assert((object)sourceMethod != null); 32Debug.Assert((object)sourceMethod == sourceMethod.ConstructedFrom); 71Debug.Assert(sourceType.Equals(destinationType, TypeCompareKind.AllIgnoreOptions)); 105Debug.Assert(transformResult && position == length); 107Debug.Assert(resultType.Equals(sourceType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes | TypeCompareKind.IgnoreNativeIntegers)); // Same custom modifiers as source type. 110Debug.Assert(resultType.Equals(destinationType, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds)); 117Debug.Assert(!destinationParameters.IsDefault); 118Debug.Assert(destinationParameters.All(p => p is SourceParameterSymbolBase)); 119Debug.Assert(sourceParameters.Length == destinationParameters.Length);
Symbols\Source\ExplicitInterfaceHelpers.cs (3)
112Debug.Assert(idx < fullName.Length); 131Debug.Assert((object)unsubstitutedInterfaceType != null); 133Debug.Assert((object)explicitInterfaceType != null);
Symbols\Source\ExtensionGroupingInfo.cs (22)
41Debug.Assert(sourceNamedType.ExtensionGroupingName is not null); 52Debug.Assert(sourceNamedType.ExtensionMarkerName is not null); 91Debug.Assert(groupingNamesMatch || !HaveSameILSignature(type1, type2), 95Debug.Assert(markerNamesMatch || !HaveSameCSharpSignature(type1, type2), 98Debug.Assert(groupingNamesMatch || !markerNamesMatch, "If the marker names are equal, then the grouping names must also be equal."); 115Debug.Assert(extension.IsExtension); 144Debug.Assert(Cci.TypeMemberVisibility.Public > Cci.TypeMemberVisibility.Assembly); 145Debug.Assert(Cci.TypeMemberVisibility.Assembly > Cci.TypeMemberVisibility.Private); 154Debug.Assert(memberVisibility is Cci.TypeMemberVisibility.Public or Cci.TypeMemberVisibility.Assembly or Cci.TypeMemberVisibility.Private); 175Debug.Assert(extension.IsExtension); 196Debug.Assert(extension.IsExtension); 216Debug.Assert(extension1.IsExtension); 217Debug.Assert(extension2.IsExtension); 251Debug.Assert(extension1.IsExtension); 252Debug.Assert(extension2.IsExtension); 463Debug.Assert(extension.IsExtension); 464Debug.Assert(extension.IsDefinition); 705Debug.Assert(other is { }); 736Debug.Assert(containingType is not null); 753Debug.Assert((object)method != null); 776Debug.Assert((object)property != null); 901Debug.Assert(other is { });
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (12)
99Debug.Assert(completed); 102Debug.Assert(_lazyCustomAttributesBag.IsSealed); 171Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 175Debug.Assert(!attribute.HasErrors); 176Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 321Debug.Assert(!boundAttributes.IsDefault); 322Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 323Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 324Debug.Assert(_lazyCustomAttributesBag != null); 325Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 326Debug.Assert(symbolPart == AttributeLocation.None); 335Debug.Assert(boundAttributes.Any());
Symbols\Source\GlobalExpressionVariable.cs (7)
38Debug.Assert(DeclaredAccessibility == Accessibility.Private); 52Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax); 73Debug.Assert(fieldsBeingBound != null); 102Debug.Assert(type.HasType || isVar); 107Debug.Assert(_lazyType != null); 135Debug.Assert((object)originalType == null || 179Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax);
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
24Debug.Assert(declaration.Kind == DeclarationKind.ImplicitClass ||
Symbols\Source\LambdaSymbol.cs (8)
56Debug.Assert(syntaxReferenceOpt is not null); 57Debug.Assert(containingSymbol.DeclaringCompilation == compilation); 171Debug.Assert(inferredReturnType.HasType); 172Debug.Assert((object)_returnType.Type == ReturnTypeIsBeingInferred); 173Debug.Assert(refKind != RefKind.RefReadOnly); 307Debug.Assert(diagnostics.DiagnosticBag is { }); 308Debug.Assert(diagnostics.DependenciesBag is { }); 343Debug.Assert(parameterTypes.Length == parameterRefKinds.Length);
Symbols\Source\LocalFunctionOrSourceMemberMethodSymbol.cs (1)
38Debug.Assert(TypeSymbol.Equals(_lazyIteratorElementType.Value.Type, elementType.Type, TypeCompareKind.ConsiderEverything));
Symbols\Source\LocalFunctionSymbol.cs (12)
45Debug.Assert(containingSymbol.DeclaringCompilation == binder.Compilation); 56Debug.Assert(diagnostics.DiagnosticBag is { }); 57Debug.Assert(diagnostics.DependenciesBag is { }); 219Debug.Assert(diagnostics.DiagnosticBag is { }); 220Debug.Assert(diagnostics.DependenciesBag is { }); 280Debug.Assert(diagnostics.DiagnosticBag is { }); 281Debug.Assert(diagnostics.DependenciesBag is { }); 284Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 320Debug.Assert(_refKind == RefKind.None 498Debug.Assert(tpEnclosing.ContainingSymbol.Kind == SymbolKind.NamedType); 527Debug.Assert(diagnostics.DiagnosticBag is { }); 528Debug.Assert(diagnostics.DependenciesBag is { });
Symbols\Source\ModifierUtils.cs (8)
50Debug.Assert(!isForTypeDeclaration || !isForInterfaceMember); 57Debug.Assert((allowedModifiers & (DeclarationModifiers.Override | DeclarationModifiers.Virtual)) == 0); 79Debug.Assert(oneError != DeclarationModifiers.None); 138Debug.Assert(modifier.Kind() == SyntaxKind.ScopedKeyword); 220Debug.Assert(oneError != DeclarationModifiers.None); 233Debug.Assert(location.SourceTree is not null); 247Debug.Assert(location.SourceTree is not null); 295Debug.Assert(!isExplicitInterfaceImplementation);
Symbols\Source\ParameterHelpers.cs (16)
76Debug.Assert(ordinal == 0); 77Debug.Assert(paramsKeyword.Kind() == SyntaxKind.None); 141Debug.Assert(addRefReadOnlyModifier, "If addReadonlyRef isn't true, we must have found a different location to encode the readonlyness of a function pointer"); 183Debug.Assert(!parsingFunctionPointer || owner is FunctionPointerMethodSymbol); 227Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 265Debug.Assert(parameterContext is ParameterContext.Default or ParameterContext.FunctionPointer or ParameterContext.ExtensionReceiverParameter); 307Debug.Assert(parameterSyntax.Type != null); 312Debug.Assert(refnessKeyword.Kind() != SyntaxKind.None); 320Debug.Assert(parameter is SourceComplexParameterSymbolBase || !parameter.IsParams); // Only SourceComplexParameterSymbolBase validates 'params' type. 321Debug.Assert(parameter is SourceComplexParameterSymbolBase || parameter is not SourceParameterSymbol s || s.DeclaredScope == ScopedKind.None); // Only SourceComplexParameterSymbolBase validates 'scope'. 391Debug.Assert(moduleBuilder.Compilation.ShouldEmitNativeIntegerAttributes()); 414Debug.Assert(compilation.ShouldEmitNativeIntegerAttributes()); 433Debug.Assert(!parameter.IsThis); 532Debug.Assert(extensionMember.IsExtensionBlockMember()); 556Debug.Assert(extensionMemberArity == 0); // we currently only apply the check for members which may not be generic 875Debug.Assert(containingSymbol is null
Symbols\Source\QuickAttributeChecker.cs (4)
77Debug.Assert(!_sealed); 126Debug.Assert(_sealed); 165Debug.Assert(QuickAttributes.Last == QuickAttributes.AssemblySignatureKey); 197Debug.Assert(attributeDescription.Name.EndsWith(nameof(System.Attribute)));
Symbols\Source\SourceAssemblySymbol.cs (57)
122Debug.Assert(compilation != null); 123Debug.Assert(assemblySimpleName != null); 124Debug.Assert(!String.IsNullOrWhiteSpace(moduleName)); 125Debug.Assert(!netModules.IsDefault); 497Debug.Assert(!DeclaringCompilation.Options.Errors.IsEmpty); 652Debug.Assert((object)compilationRelaxationsAttribute != null, "GetWellKnownType unexpectedly returned null"); 661Debug.Assert((object)runtimeCompatibilityAttribute != null, "GetWellKnownType unexpectedly returned null"); 694Debug.Assert((object)unverifiableCodeAttribute != null, "GetWellKnownType unexpectedly returned null"); 706Debug.Assert((object)securityPermissionAttribute != null, "GetWellKnownType unexpectedly returned null"); 713Debug.Assert((object)securityAction != null, "GetWellKnownType unexpectedly returned null"); 925Debug.Assert(thisThreadCompleted); 938Debug.Assert(locationOpt != null || filter != null, "If no location or filter was specified, then the module members should be completed"); 949Debug.Assert(thisThreadCompleted); 1071Debug.Assert(moduleNs.Extent.Kind == NamespaceKind.Module); 1212Debug.Assert(!attribute.HasErrors); 1224Debug.Assert(!attribute.HasErrors); 1241Debug.Assert(success); 1318Debug.Assert(attributesFromNetModules.Any()); 1319Debug.Assert(netModuleNames.Any()); 1320Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length); 1455Debug.Assert(lazyNetModuleAttributesBag.IsSealed); 1461Debug.Assert(attributeMatches is QuickAttributes.AssemblyKeyFile 1487Debug.Assert(attributesFromNetModules.Any()); 1488Debug.Assert(netModuleNames.Any()); 1489Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length); 1547Debug.Assert(attributesBag.IsSealed); 1600Debug.Assert(!attributes.IsDefault); 1601Debug.Assert(!netmoduleAttributes.IsDefault); 1615Debug.Assert(!attributes.IsDefault); 1628Debug.Assert(_lazyOmittedAttributeIndices == null || !_lazyOmittedAttributeIndices.Any(i => i < 0 || i >= this.GetAttributes().Length)); 1629Debug.Assert(_lazySourceAttributesBag.IsSealed); 1630Debug.Assert(_lazyNetModuleAttributesBag.IsSealed); 1631Debug.Assert(index >= 0); 1632Debug.Assert(index < this.GetAttributes().Length); 1751Debug.Assert(added); 1757Debug.Assert(removed); 1782Debug.Assert(attributesBag.IsSealed); 1832Debug.Assert(!boolType.HasUseSiteError, 1972Debug.Assert(!int32Type.HasUseSiteError, 1992Debug.Assert(!boolType.HasUseSiteError, "Use site errors should have been checked ahead of time (type bool)."); 2026Debug.Assert(!stringType.HasUseSiteError, "Use site errors should have been checked ahead of time (type string)."); 2036Debug.Assert(!stringType.HasUseSiteError, "Use site errors should have been checked ahead of time (type string)."); 2110Debug.Assert(conclusion != IVTConclusion.NoRelationshipClaimed); 2207Debug.Assert(!arguments.Attribute.HasErrors); 2226Debug.Assert(forwardedType.TypeKind != TypeKind.Error); 2278Debug.Assert(!attrData.HasErrors); 2368Debug.Assert(!attribute.HasErrors); 2369Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 2617Debug.Assert(!attribute.HasErrors); 2660Debug.Assert( 2664Debug.Assert( 2672Debug.Assert(_unusedFieldWarnings.IsDefault, "We shouldn't have computed the diagnostics if we're still noting definitions."); 2693Debug.Assert(this.HasComplete(CompletionPart.Module), 2715Debug.Assert(success, "Once CompletionPart.Module is set, no-one should be modifying the map."); 2798Debug.Assert(!_unusedFieldWarnings.IsDefault); 2844Debug.Assert(forcedArity == emittedName.InferredArity); 2860Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?");
Symbols\Source\SourceClonedParameterSymbol.cs (1)
28Debug.Assert((object)originalParam != null);
Symbols\Source\SourceComplexParameterSymbol.cs (51)
56Debug.Assert((syntaxRef == null) || (syntaxRef.GetSyntax().IsKind(SyntaxKind.Parameter))); 254Debug.Assert(diagnostics.DiagnosticBag != null); 259Debug.Assert(previousValue == ConstantValue.Unset); 262Debug.Assert(completedOnThisThread); 272Debug.Assert(_lazyDefaultSyntaxValue is not null); 293Debug.Assert(completedOnThisThread); 314Debug.Assert(binder.GetBinder(syntax) == null); 359Debug.Assert(diagnostics.DiagnosticBag != null); 388Debug.Assert(binder.InParameterDefaultValue); 389Debug.Assert(binder.ContainingMemberOrLambda == ContainingSymbol); 488Debug.Assert(!this.ContainingSymbol.IsPartialImplementation()); 504Debug.Assert(!this.ContainingSymbol.IsPartialDefinition()); 525Debug.Assert(PartialImplementationPart is null); 587Debug.Assert(!ReferenceEquals(copyFrom, this)); 621Debug.Assert(!attributeType.IsErrorType()); 684Debug.Assert(constructorArguments.Length == 1); 733Debug.Assert(description.Equals(AttributeDescription.DefaultParameterValueAttribute) || 762Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 765Debug.Assert(!attribute.HasErrors); 766Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 767Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 787Debug.Assert(_lazyHasOptionalAttribute == ThreeState.True); 922Debug.Assert(syntax != null); 923Debug.Assert(diagnostics != null); 960Debug.Assert(!attribute.HasErrors); 972Debug.Assert(description.Equals(AttributeDescription.DateTimeConstantAttribute)); 979Debug.Assert(!diagnose || diagnosticsOpt != null); 999Debug.Assert(attribute.CommonConstructorArguments.Length == 1); 1071Debug.Assert(this.GetAttributeDeclarations().Any(attrLists => attrLists.Any(attrList => attrList.Contains(node)))); 1283Debug.Assert(attributeIndex is 0 or 1); 1284Debug.Assert(arguments.Attribute.IsTargetAttribute(AttributeDescription.InterpolatedStringHandlerArgumentAttribute) && arguments.Attribute.CommonConstructorArguments.Length == 1); 1285Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1369Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1384Debug.Assert(name != null); 1447Debug.Assert(!boundAttributes.IsDefault); 1448Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1449Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1450Debug.Assert(_lazyCustomAttributesBag != null); 1451Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1452Debug.Assert(symbolPart == AttributeLocation.None); 1516Debug.Assert(!ReferenceEquals(copyFrom, this)); 1538Debug.Assert(_lazyHasOptionalAttribute.HasValue()); 1576Debug.Assert(filter == null); 1598Debug.Assert(ParameterSyntax is not null); 1606Debug.Assert(completedOnThisThread); 1653Debug.Assert(!addMethods.IsDefaultOrEmpty); 1700Debug.Assert(collectionBuilderMethods.Length <= 1); 1704Debug.Assert(diagnostics.HasAnyErrors(), $"{nameof(binder.GetCollectionBuilderMethods)} should have reported an error in this case"); 1718Debug.Assert(elementType is { }); 1799Debug.Assert(!refCustomModifiers.IsEmpty); 1804Debug.Assert(refKind != RefKind.None || _refCustomModifiers.IsEmpty);
Symbols\Source\SourceConstructorSymbol.cs (13)
53Debug.Assert(reported); 122Debug.Assert(syntaxReferenceOpt != null); 222Debug.Assert(PartialDefinitionPart is null); 302Debug.Assert(this.IsPartialDefinition); 303Debug.Assert(!ReferenceEquals(this, implementation)); 304Debug.Assert(ReferenceEquals(this.OtherPartOfPartial, implementation)); 339Debug.Assert(this.ParameterCount == implementation.ParameterCount); 375Debug.Assert(definition.IsPartialDefinition); 376Debug.Assert(implementation.IsPartialImplementation); 378Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || ReferenceEquals(alreadySetImplPart, implementation)); 379Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || ReferenceEquals(alreadySetDefPart, definition)); 384Debug.Assert(ReferenceEquals(definition._otherPartOfPartial, implementation)); 385Debug.Assert(ReferenceEquals(implementation._otherPartOfPartial, definition));
Symbols\Source\SourceConstructorSymbolBase.cs (3)
31Debug.Assert(syntax.Kind() is SyntaxKind.ConstructorDeclaration or SyntaxKind.RecordDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.StructDeclaration or SyntaxKind.UnionDeclaration); 107Debug.Assert(!IsPartial); 180Debug.Assert(position >= 0 && tree != null);
Symbols\Source\SourceCustomEventAccessorSymbol.cs (5)
38Debug.Assert(syntax != null); 39Debug.Assert(syntax.Kind() == SyntaxKind.AddAccessorDeclaration || syntax.Kind() == SyntaxKind.RemoveAccessorDeclaration); 64Debug.Assert(syntaxReferenceOpt != null); 86Debug.Assert(PartialImplementationPart is null); 90Debug.Assert(PartialDefinitionPart is null
Symbols\Source\SourceCustomEventSymbol.cs (1)
149Debug.Assert(containingType.IsInterface);
Symbols\Source\SourceDelegateMethodSymbol.cs (3)
43Debug.Assert(_parameters.IsDefault); 55Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 323Debug.Assert(location != null);
Symbols\Source\SourceDestructorSymbol.cs (2)
50Debug.Assert(syntax.ParameterList.Parameters.Count == 0); 91Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceEnumConstantSymbol.cs (7)
40Debug.Assert(otherConstantOffset == 0); 45Debug.Assert(otherConstantOffset > 0); 125Debug.Assert(!this.IsFixedSizeBuffer); 172Debug.Assert(syntax.EqualsValue != null); 178Debug.Assert(syntax.EqualsValue != null); 197Debug.Assert((object)otherConstant != null); 198Debug.Assert(otherConstantOffset > 0);
Symbols\Source\SourceEventAccessorSymbol.cs (5)
109Debug.Assert(compilation != null); 127Debug.Assert(this.MethodKind == MethodKind.EventRemove); 155Debug.Assert(!_lazyReturnType.IsDefault); 165Debug.Assert(!_lazyReturnType.IsDefault); 205Debug.Assert(this.Locations.Length == 1);
Symbols\Source\SourceEventSymbol.cs (21)
166Debug.Assert(syntax.Parent?.Parent is not null); 218Debug.Assert(!ReferenceEquals(definitionPart, this)); 231Debug.Assert(wasCompletedThisThread); 242Debug.Assert(PartialDefinitionPart is null); 346Debug.Assert(!attribute.HasErrors); 347Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 575Debug.Assert(explicitInterfaceImplementation); 619Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 620Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 770Debug.Assert(_lazyIsWindowsRuntimeEvent.HasValue()); 787Debug.Assert(explicitInterfaceImplementations.Length == 1); 789Debug.Assert((object?)this.OverriddenEvent == null); 920Debug.Assert(this.IsPartialDefinition); 921Debug.Assert(!ReferenceEquals(this, implementation)); 922Debug.Assert(ReferenceEquals(this.OtherPartOfPartial, implementation)); 993Debug.Assert(definition.IsPartialDefinition); 994Debug.Assert(implementation.IsPartialImplementation); 996Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || ReferenceEquals(alreadySetImplPart, implementation)); 997Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || ReferenceEquals(alreadySetDefPart, definition)); 1002Debug.Assert(ReferenceEquals(definition._otherPartOfPartial, implementation)); 1003Debug.Assert(ReferenceEquals(implementation._otherPartOfPartial, definition));
Symbols\Source\SourceFieldLikeEventSymbol.cs (11)
35Debug.Assert(declaratorSyntax.Parent is object); 215Debug.Assert(field.Name == _name); 249Debug.Assert(ev.IsPartialDefinition); 279Debug.Assert(IsPartialDefinition); 287Debug.Assert(IsExtern); 295Debug.Assert(false); 303Debug.Assert(IsPartialDefinition); 311Debug.Assert(IsExtern); 321Debug.Assert(false); 330Debug.Assert(IsPartialDefinition); 339Debug.Assert(false);
Symbols\Source\SourceFieldSymbol.cs (10)
24Debug.Assert((object)containingType != null); 116Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 117Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 120Debug.Assert(!attribute.HasErrors); 121Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 181Debug.Assert(name != null); 182Debug.Assert(syntax != null); 357Debug.Assert(value != Microsoft.CodeAnalysis.ConstantValue.Unset); 358Debug.Assert((GetLazyConstantValue(earlyDecodingWellKnownAttributes) == Microsoft.CodeAnalysis.ConstantValue.Unset) || 376Debug.Assert(wasSetThisThread);
Symbols\Source\SourceFixedFieldSymbol.cs (5)
38Debug.Assert(this.IsFixedSizeBuffer); 75Debug.Assert(declarator.ArgumentList.ContainsDiagnostics, "The parser should have caught this."); 100Debug.Assert(sizeConstant != null); 101Debug.Assert(sizeConstant.IsIntegral || diagnostics.HasAnyErrors() || sizeExpression.HasErrors); 137Debug.Assert(_fixedSize != FixedSizeNotInitialized);
Symbols\Source\SourceLabelSymbol.cs (1)
31Debug.Assert(identifierNodeOrToken.IsToken || identifierNodeOrToken.IsNode);
Symbols\Source\SourceLocalSymbol.cs (35)
81Debug.Assert(identifierToken.Kind() != SyntaxKind.None); 82Debug.Assert(declarationKind != LocalDeclarationKind.None); 83Debug.Assert(scopeBinder != null); 84Debug.Assert(containingSymbol.DeclaringCompilation == scopeBinder.Compilation); 175Debug.Assert(closestTypeSyntax != null); 176Debug.Assert(nodeBinder != null); 197Debug.Assert( 209Debug.Assert(!(nodeToBind.Kind() == SyntaxKind.SwitchExpressionArm) || nodeBinder is SwitchExpressionArmBinder); 245Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 375Debug.Assert(concurrentTypeResolutions < 50); 414Debug.Assert(!free); 415Debug.Assert(reference != CSharpSyntaxTree.Dummy.GetRoot()); 423Debug.Assert(added); // This assert can fail if there is a race between multiple threads. We can remove it if it becomes a problem, confirming the case. 436Debug.Assert(localTypeInferenceInProgress == s_LocalTypeInferenceInProgress); 438Debug.Assert(removed); 439Debug.Assert(free == (localTypeInferenceInProgress.Count == 0)); 467Debug.Assert(declType.HasType); 486Debug.Assert(newType.Type is object); 492Debug.Assert((object)originalType?.DefaultType == null || 531Debug.Assert(node is VariableDeclaratorSyntax); 537Debug.Assert(node is VariableDeclaratorSyntax); 541Debug.Assert(node is ForEachStatementSyntax || node is SingleVariableDesignationSyntax); 545Debug.Assert(node is CatchDeclarationSyntax); 552Debug.Assert(node is SingleVariableDesignationSyntax); 633Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 634Debug.Assert(initializer != null); 677Debug.Assert(inProgress != this); 707Debug.Assert(boundInitValue != null); 730Debug.Assert(declarationKind == LocalDeclarationKind.ForEachIterationVariable); 778Debug.Assert(assignment.IsDeconstruction()); 785Debug.Assert(this.ScopeBinder.GetBinder((ForEachVariableStatementSyntax)_deconstruction) == _nodeBinder); 812Debug.Assert(declarationKind is LocalDeclarationKind.OutVariable or LocalDeclarationKind.PatternVariable); 813Debug.Assert( 823Debug.Assert(!(nodeToBind.Kind() == SyntaxKind.SwitchExpressionArm) || nodeBinder is SwitchExpressionArmBinder); 882Debug.Assert(this.DeclarationKind is LocalDeclarationKind.DeclarationExpressionVariable or LocalDeclarationKind.OutVariable);
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (27)
199Debug.Assert(methodImpl is { Body: not null, Implemented: not null }); 356Debug.Assert(this.InterfacesAndTheirBaseInterfacesNoUseSiteDiagnostics[implementedInterface].Contains(implementedInterface)); 373Debug.Assert((object)directInterface != null); 387Debug.Assert((object)interfacePropertyOrEvent != null); 673Debug.Assert((object)sourceField == null || (object)sourceField.AssociatedSymbol == null || 687Debug.Assert(symbol.Kind == SymbolKind.Field || symbol.Kind == SymbolKind.NamedType); 762Debug.Assert((object)overridingMember != null); 763Debug.Assert(overriddenOrHiddenMembers != null); 771Debug.Assert(overridingMemberIsMethod ^ overridingMemberIsProperty ^ overridingMemberIsEvent); 776Debug.Assert(!overriddenMembers.IsDefault); 781Debug.Assert(!hiddenMembers.IsDefault); 895Debug.Assert(AccessCheck.IsSymbolAccessible(overriddenMember, overridingType, ref discardedUseSiteInfo)); 899Debug.Assert(overriddenMember.Kind == overridingMember.Kind); 949Debug.Assert(overridingMember.ObsoleteState != ThreeState.Unknown); 950Debug.Assert(leastOverriddenMember.ObsoleteState != ThreeState.Unknown); 1004Debug.Assert(overridingMemberIsMethod); 1105Debug.Assert(diagnosticInfo is { }); 1297Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1401Debug.Assert(conversions.IncludeNullability); 1490Debug.Assert(reportMismatchInParameterType is { }); 1501Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1542Debug.Assert(reportMismatchInParameterType is { }); 1552Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1578Debug.Assert(implementedMember is not null || overridingMember.IsDefinition); 1631Debug.Assert(overriddenOrHiddenMembers != null); 1632Debug.Assert(!overriddenOrHiddenMembers.OverriddenMembers.Any()); //since hidingMethod.IsOverride is false 1635Debug.Assert(!hiddenMembers.IsDefault);
Symbols\Source\SourceMemberContainerSymbol.cs (105)
113Debug.Assert(EnumUtilities.ContainsAllValues<SpecialType>(SpecialTypeMask)); 114Debug.Assert(EnumUtilities.ContainsAllValues<InternalSpecialType>(SpecialTypeMask)); //This assert might false fail in the future, we don't really need to be able to represent NextAvailable 115Debug.Assert(EnumUtilities.ContainsAllValues<NullableContextKind>(NullableContextMask)); 146Debug.Assert(BitsAreUnsetOrSame(_flags, bitsToSet)); 235Debug.Assert(containingSymbol is NamespaceSymbol { IsGlobalNamespace: true } || !declaration.Declarations.Any(static d => d.IsSimpleProgram)); 264Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 664Debug.Assert(thisThreadCompleted); 719Debug.Assert(thisThreadCompleted); 730Debug.Assert((incompletePart & CompletionPart.NamedTypeSymbolAll) == 0); 870Debug.Assert(!useSiteDiagnostics.IsDefault); 879Debug.Assert(!useSiteDependencies.IsDefault); 1179Debug.Assert(!nonTypeMembers.IsDefault); 1180Debug.Assert(!staticInitializers.IsDefault); 1181Debug.Assert(staticInitializers.All(g => !g.IsDefault)); 1182Debug.Assert(!instanceInitializers.IsDefault); 1183Debug.Assert(instanceInitializers.All(g => !g.IsDefault)); 1185Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol)); 1186Debug.Assert(haveIndexers == nonTypeMembers.Any(static s => s.IsIndexer())); 1253Debug.Assert(ctorInitializerLength >= 0); 1276Debug.Assert(distanceFromCtorBody > 0); 1484Debug.Assert(s_emptyTypeMembers.Count == 0); 1568Debug.Assert(symbol is not null); 1573Debug.Assert(attr is SourceAttributeData); 2060Debug.Assert(IsFileLocal); 2068Debug.Assert(fileIdentifier.FilePathChecksumOpt.IsDefault); 2397Debug.Assert(method1.ParameterCount == method2.ParameterCount); 2477Debug.Assert(checkCollisionWithTypeParameters || typeParameterNames == null); 2529Debug.Assert(!membersByName[indexerName.AsMemory()].Any(SymbolExtensions.IsIndexer)); 2621Debug.Assert(cloneMembersByName); 2625Debug.Assert(masterExtension is not null); 2661Debug.Assert(!newMembers.IsEmpty); 2665Debug.Assert(newMembers.All(static (m, membersUnordered) => membersUnordered.Contains(m), membersUnordered)); 2782Debug.Assert(value == _lazyKnownCircularStruct); 2793Debug.Assert(TypeKind == TypeKind.Struct); 2812Debug.Assert(field.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list."); 3027Debug.Assert(!this.IsExtension); 3110Debug.Assert(IsSubmissionClass || IsScriptClass); 3136Debug.Assert(ReferenceEquals(this, this.OriginalDefinition)); 3149Debug.Assert(f.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list."); 3422Debug.Assert(!nonTypeMembersWithPartialImplementations.IsDefault); 3426Debug.Assert(!nonTypeMembersWithPartialImplementations.Any(static s => s is TypeSymbol)); 3427Debug.Assert(declarationWithParameters is object || primaryConstructor is null); 3442Debug.Assert(!initializers.IsDefault); 3450Debug.Assert(!group.IsDefaultOrEmpty); 3457Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3462Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0); 3467Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3492Debug.Assert(declaredMembersAndInitializers != DeclaredMembersAndInitializers.UninitializedSentinel); 3517Debug.Assert(InstanceInitializersForPositionalMembers.Count != 0); 3518Debug.Assert(declaredMembers.PrimaryConstructor is object); 3519Debug.Assert(declaredMembers.DeclarationWithParameters is object); 3520Debug.Assert(declaredMembers.DeclarationWithParameters.SyntaxTree == InstanceInitializersForPositionalMembers[0].Syntax.SyntaxTree); 3521Debug.Assert(declaredMembers.DeclarationWithParameters.Span.Contains(InstanceInitializersForPositionalMembers[0].Syntax.Span.Start)); 3554Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.SyntaxTree == declaredInitializers[0].Syntax.SyntaxTree); 3555Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.Span.Start < declaredInitializers[0].Syntax.Span.Start); 3564Debug.Assert(groupsBuilder.Count == groupCount); 3568Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree && 3574Debug.Assert(groupsBuilder.Count == groupCount + 1); 3773Debug.Assert(partialMembersToMerge.Count != 0); 3814Debug.Assert(!_lazySimpleProgramEntryPoints.IsDefault); 3873Debug.Assert(result is object); 3896Debug.Assert(primaryConstructor is not null); 3897Debug.Assert(!this.IsDelegateType()); 3928Debug.Assert(HasPrimaryConstructor); 3933Debug.Assert(declared.PrimaryConstructor is not null); 3939Debug.Assert(membersAndInitializers.PrimaryConstructor is not null); 3946Debug.Assert(HasPrimaryConstructor); 3970Debug.Assert(primaryConstructor is not null); 4175Debug.Assert(symbol.IsPartialMember()); 4201Debug.Assert(pair.Key.Equals(WellKnownMemberNames.InstanceConstructorName.AsMemory())); 4212Debug.Assert(symbol.Kind != prev.Kind); 4213Debug.Assert(symbol is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol or SourceEventAccessorSymbol); 4214Debug.Assert(prev is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol or SourceEventAccessorSymbol); 4222Debug.Assert(symbol.IsPartialMember()); 4301Debug.Assert(symbol.IsPartialMember()); 4553Debug.Assert(!propertySymbol.IsExplicitInterfaceImplementation); // checked by caller 4604Debug.Assert(!eventSymbol.IsExplicitInterfaceImplementation); // checked by caller 4739Debug.Assert(node.SyntaxTree == initializers.Last().Syntax.SyntaxTree); 4740Debug.Assert(node.SpanStart > initializers.Last().Syntax.Span.Start); 4826Debug.Assert(property.IsIndexer); 4915Debug.Assert(TypeKind == TypeKind.Struct); 4919Debug.Assert(builder.DeclarationWithParameters is TypeDeclarationSyntax { ParameterList: not null } type 4964Debug.Assert(ctor is object); 4974Debug.Assert(declaredMembersAndInitializers.PrimaryConstructor?.GetBackingFields().Any() != true); 4983Debug.Assert(valueProperty.GetMethod is object); 4984Debug.Assert(valueProperty.SetMethod is null); 4987Debug.Assert(backingField is object); 5016Debug.Assert(typeSyntax != null); 5053Debug.Assert(memberOffset == members.Count - typesBuilder.Count); 5102Debug.Assert(declaredMembersAndInitializers.DeclarationWithParameters is object); 5106Debug.Assert(ctor is object); 5159Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false })); 5170Debug.Assert(positionalMembers.All(p => p is PropertySymbol or FieldSymbol)); 5218Debug.Assert(isRecordClass); 5266Debug.Assert(isRecordClass); 5473Debug.Assert(property.GetMethod is object); 5474Debug.Assert(property.SetMethod is object); 5478Debug.Assert(backingField is object); 5540Debug.Assert(isRecordClass); 5662Debug.Assert(isRecordClass); 5995Debug.Assert(@event.IsPartial || @event.AddMethod is not null); 5996Debug.Assert(@event.IsPartial || @event.RemoveMethod is not null); 6019Debug.Assert(@event.AssociatedField is null); 6124Debug.Assert( 6329Debug.Assert(this.declaration.ContainsExtensionDeclarations);
Symbols\Source\SourceMemberFieldSymbol.cs (8)
87Debug.Assert(constToken.Kind() == SyntaxKind.ConstKeyword); 187Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override"); 253Debug.Assert((result & ~(DeclarationModifiers.AccessibilityMask | DeclarationModifiers.Fixed | DeclarationModifiers.Unsafe | DeclarationModifiers.Safe | DeclarationModifiers.New)) == 0); 360Debug.Assert(!this.IsFixedSizeBuffer, "Subclasses representing fixed fields must override"); 483Debug.Assert(fieldsBeingBound != null); 534Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly); 553Debug.Assert(refKindToAssert == RefKind.None); // Otherwise we might need to report an error 554Debug.Assert(type.HasType || isVar);
Symbols\Source\SourceMemberMethodSymbol.cs (20)
113Debug.Assert((bits & ReturnsVoidIsSetBit) != 0); 121Debug.Assert((bits & ReturnsVoidIsSetBit) == 0); 122Debug.Assert(value || (bits & ReturnsVoidBit) == 0); 176Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>(MethodKindMask)); 177Debug.Assert(EnumUtilities.ContainsAllValues<RefKind>(RefKindMask)); 178Debug.Assert(EnumUtilities.ContainsAllValues<NullableContextKind>(NullableContextMask)); 202Debug.Assert(!returnsVoid || returnsVoidIsSet); 284Debug.Assert(!IsMetadataVirtualLocked); 340Debug.Assert(containingType is not null); 341Debug.Assert(location is not null); 342Debug.Assert(containingType.DeclaringCompilation is not null); 470Debug.Assert(lockObject != null); 590Debug.Assert(context is not null || ignoreInterfaceImplementationChanges); 603Debug.Assert(!this.IsStatic); 763Debug.Assert(arrowExpression.Parent.Kind() == SyntaxKind.PropertyDeclaration || 769Debug.Assert(this is SynthesizedClosureMethod); 800Debug.Assert(current is InMethodBinder); 1054Debug.Assert(!this.IsConstructor()); // Constructors should use IsNullableEnabledForConstructorsAndInitializers() instead. 1138Debug.Assert(this.SyntaxNode.SyntaxTree == localTree); 1155Debug.Assert(bodySyntax != null);
Symbols\Source\SourceMethodSymbol.cs (3)
130Debug.Assert(AssociatedSymbol?.GetCallerUnsafeMode(fieldsBeingBound) != CallerUnsafeMode.Implicit); 159Debug.Assert(target is not (LambdaSymbol or LocalFunctionSymbol)); 244Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Source\SourceMethodSymbolWithAttributes.cs (36)
53Debug.Assert(arrowExpression.Parent!.Kind() == SyntaxKind.PropertyDeclaration || 61Debug.Assert(recordDecl.IsKind(SyntaxKind.RecordDeclaration)); 279Debug.Assert(!ReferenceEquals(copyFrom, this)); 333Debug.Assert(arguments.SymbolPart == AttributeLocation.None || arguments.SymbolPart == AttributeLocation.Return); 463Debug.Assert(!forceComplete); 479Debug.Assert(!forceComplete); 492Debug.Assert(earlyData is { UnmanagedCallersOnlyAttributePresent: true }); 496Debug.Assert(lateData is null or { UnmanagedCallersOnlyAttributeData: null }); 511Debug.Assert(!arguments.Attribute.HasErrors); 512Debug.Assert(arguments.SymbolPart == AttributeLocation.None || arguments.SymbolPart == AttributeLocation.Return); 526Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 530Debug.Assert(!attribute.HasErrors); 732Debug.Assert(this.IsConditional); 796Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 800Debug.Assert(!attribute.HasErrors); 838Debug.Assert(!attribute.HasErrors); 959Debug.Assert(arguments.AttributeSyntaxOpt is object); 968Debug.Assert(ContainingType is object); 1008Debug.Assert(!arguments.Attribute.HasErrors); 1019Debug.Assert(arguments.Attribute.AttributeConstructor.Parameters is [{ Type.SpecialType: SpecialType.System_Int32 }, { Type.SpecialType: SpecialType.System_String }]); 1027Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1073Debug.Assert(matchingTrees.Count == 1); 1128Debug.Assert(namespaceSegments.Length > 0); 1172Debug.Assert(attributeSyntax is object); 1253Debug.Assert(matchingTrees.Count == 1); 1328Debug.Assert(namespaceSegments.Length > 0); 1378Debug.Assert(_lazyCustomAttributesBag.IsEarlyDecodedWellKnownAttributeDataComputed); 1391Debug.Assert(arguments.AttributeSyntaxOpt != null); 1407Debug.Assert(reportedError); 1447Debug.Assert(attribute.AttributeClass is not null); 1477Debug.Assert(!boundAttributes.IsDefault); 1478Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1479Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1480Debug.Assert(symbolPart == AttributeLocation.None || symbolPart == AttributeLocation.Return); 1484Debug.Assert(_lazyCustomAttributesBag != null); 1485Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed);
Symbols\Source\SourceModuleSymbol.cs (9)
58Debug.Assert((object)assemblySymbol != null); 148Debug.Assert(!_lazyAssembliesToEmbedTypesFrom.IsDefault); 161Debug.Assert(_lazyContainsExplicitDefinitionOfNoPiaLocalTypes != ThreeState.Unknown); 278Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingReferencedAssemblies)); 294Debug.Assert(locationOpt != null || filter != null, "If no location or filter was specified, then the namespace members should be completed"); 543Debug.Assert(completed); 582Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 585Debug.Assert(!attribute.HasErrors); 586Debug.Assert(arguments.SymbolPart == AttributeLocation.None);
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (8)
103Debug.Assert(!this.IsClassType() || localBase.IsObjectType() || baseLocation != null); 186Debug.Assert(!other.Equals(@interface, TypeCompareKind.ConsiderEverything)); 187Debug.Assert(other.Equals(@interface, TypeCompareKind.CLRSignatureCompareOptions)); 289Debug.Assert(basesBeingResolved == null || !basesBeingResolved.ContainsReference(this.OriginalDefinition)); 388Debug.Assert(baseTypeLocation != null); 582Debug.Assert((object)localBase != null); 725Debug.Assert(GetDeclaredInterfaces(basesBeingResolved: null).IsEmpty, "Computation skipped for enums"); 779Debug.Assert((object)GetDeclaredBaseType(basesBeingResolved: null) == null, "Computation skipped for enums");
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
96Debug.Assert((object)this.EnumUnderlyingType != null);
Symbols\Source\SourceNamedTypeSymbol_Extension.cs (25)
43Debug.Assert(this.IsExtension && this.IsDefinition); 71Debug.Assert(extendedType.CustomModifiers.IsEmpty); 121Debug.Assert(typeConstraint.CustomModifiers.IsEmpty); 281Debug.Assert(array.Sizes.IsEmpty && array.LowerBounds.IsDefault); // We only deal with source array types 369Debug.Assert(this.IsExtension && this.IsDefinition); 436Debug.Assert(type.CustomModifiers.IsEmpty); 457Debug.Assert(false); 526Debug.Assert(elementType.CustomModifiers.IsEmpty); 587Debug.Assert(typeArguments[i].CustomModifiers.IsEmpty); 777Debug.Assert(callingConventionTypes[i].Name.StartsWith("CallConv", StringComparison.Ordinal)); 818Debug.Assert(attribute.AttributeClass is not null); 883Debug.Assert(argument.TypeInternal is not null); 895Debug.Assert(argument.TypeInternal is not null); 901Debug.Assert(argument.ValueInternal is not null); 908Debug.Assert(argument.TypeInternal is not null); 1033Debug.Assert(this.IsExtension); 1034Debug.Assert(method.IsDefinition); 1035Debug.Assert(method.ContainingType == (object)this); 1066Debug.Assert(IsExtension); 1084Debug.Assert(parameterList is not null); 1092Debug.Assert(count > 0); 1160Debug.Assert(bytesWritten == hash.Length); 1165Debug.Assert(bytesWritten == hash.Length); 1177Debug.Assert(extensionMember.IsExtensionBlockMember()); 1205Debug.Assert(result.ContainingType.ExtensionParameter is not null);
Symbols\Source\SourceNamedTypeSymbol.cs (43)
92Debug.Assert(false, "bad declaration kind"); 295Debug.Assert(!_typeParameterInfo.LazyTypeParameterConstraintTypes.IsDefault); 317Debug.Assert(!_typeParameterInfo.LazyTypeParameterConstraintKinds.IsDefault); 358Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 364Debug.Assert(constraints.Length == arity); 439Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 446Debug.Assert(constraints.Length == arity); 511Debug.Assert(constraintClauses.Length == arity); 541Debug.Assert(originalConstraintTypes.Length == mergedConstraintTypes.Count); 545Debug.Assert(originalConstraintTypes[j].Equals(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny)); 664Debug.Assert(constraintClauses.Length == arity); 680Debug.Assert((constraint.Constraints & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) == 682Debug.Assert((mergedKind & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0 || 684Debug.Assert((constraint.Constraints & TypeParameterConstraintKind.AllReferenceTypeKinds) == (mergedKind & TypeParameterConstraintKind.AllReferenceTypeKinds) || 856Debug.Assert(completed); 859Debug.Assert(_lazyCustomAttributesBag.IsSealed); 1040Debug.Assert(attributeData.CommonConstructorArguments[0].Kind == TypedConstantKind.Type); 1076Debug.Assert(this.SpecialType == SpecialType.System_Object || this.DeclaringCompilation.IsAttributeType(this)); 1117Debug.Assert(arguments.AttributeSyntaxOpt is { }); 1121Debug.Assert(!attribute.HasErrors); 1122Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 1275Debug.Assert(_lazyIsExplicitDefinitionOfNoPiaLocalType != ThreeState.Unknown); 1318Debug.Assert(diagnose == (diagnosticsOpt != null)); 1319Debug.Assert(!attribute.HasErrors); 1321Debug.Assert(!this.IsErrorType()); 1356Debug.Assert(!attribute.HasErrors); 1361Debug.Assert(argument.Kind == TypedConstantKind.Type); 1408Debug.Assert(this.IsConditional); 1409Debug.Assert(!attribute.HasErrors); 1638Debug.Assert(!boundAttributes.IsDefault); 1639Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1640Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1641Debug.Assert(_lazyCustomAttributesBag != null); 1642Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1643Debug.Assert(symbolPart == AttributeLocation.None); 1649Debug.Assert(boundAttributes.Any()); 1699Debug.Assert(boundAttributes.Any()); 1709Debug.Assert(boundAttributes.Any()); 1753Debug.Assert(obsoleteData != ObsoleteAttributeData.Uninitialized, "getting synthesized attributes before attributes are decoded"); 1914Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr); 1947Debug.Assert(ExtensionMarkerName is not null); 1977Debug.Assert(ObsoleteKind != ObsoleteAttributeKind.Uninitialized); 1978Debug.Assert(GetMembers().All(m => m.ObsoleteKind != ObsoleteAttributeKind.Uninitialized));
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (35)
33Debug.Assert((object)result == calculated); 37Debug.Assert(result.ExternAliases.SequenceEqual(calculated.ExternAliases)); 38Debug.Assert(result.UsingAliases.SetEquals(calculated.UsingAliases)); 39Debug.Assert(result.Usings.SequenceEqual(calculated.Usings)); 51Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetImports(this, declarationSyntax, basesBeingResolved) == Imports.Empty); 120Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetExternAliases(this, declarationSyntax).IsEmpty); 130Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetExternAliases(this, declarationSyntax).IsEmpty); 151Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliases(this, declarationSyntax, basesBeingResolved).IsEmpty); 161Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliases(this, declarationSyntax, basesBeingResolved).IsEmpty); 183Debug.Assert(result.SetEquals(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliasesMap(this, declarationSyntax, basesBeingResolved))); 193Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliasesMap(this, declarationSyntax, basesBeingResolved).IsEmpty); 215Debug.Assert(result.SequenceEqual(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingNamespacesOrTypes(this, declarationSyntax, basesBeingResolved))); 225Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingNamespacesOrTypes(this, declarationSyntax, basesBeingResolved).IsEmpty); 447Debug.Assert(result.IsEmpty); 448Debug.Assert(diagnostics.IsEmptyWithoutResolution); 564Debug.Assert(!onlyGlobal); 580Debug.Assert(calculated.UsingAliases.IsEmpty); 581Debug.Assert(calculated.UsingAliasesMap?.IsEmpty ?? true); 582Debug.Assert(calculated.UsingNamespacesOrTypes.IsEmpty); 583Debug.Assert(calculated.Diagnostics?.IsEmptyWithoutResolution ?? true); 598Debug.Assert(calculated.UsingAliases.SequenceEqual(result.UsingAliases)); 599Debug.Assert((calculated.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty).SetEquals(result.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty)); 600Debug.Assert(calculated.UsingNamespacesOrTypes.SequenceEqual(result.UsingNamespacesOrTypes)); 601Debug.Assert(calculated.Diagnostics?.IsEmptyWithoutResolution ?? true); 763Debug.Assert(directiveDiagnostics.DiagnosticBag is object); 764Debug.Assert(directiveDiagnostics.DependenciesBag is object); 784Debug.Assert(directiveDiagnostics.DependenciesBag.IsEmpty()); 959Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports)); 983Debug.Assert(diagnostics.DiagnosticBag is object); 984Debug.Assert(diagnostics.DependenciesBag is object); 994Debug.Assert(declaringSymbol.IsGlobalNamespace); 1008Debug.Assert(alias.UsingDirective != null); 1027Debug.Assert(declaringSymbol.IsGlobalNamespace); 1063Debug.Assert(target.IsGlobalNamespace); 1202Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports));
Symbols\Source\SourceNamespaceSymbol.cs (4)
58Debug.Assert(mergedDeclaration != null); 239Debug.Assert(wasSetThisThread); 308Debug.Assert((object)nts != null || symbol is not TypeSymbol); 347Debug.Assert((object)nts?.OriginalDefinition == nts && (object)other.OriginalDefinition == other);
Symbols\Source\SourceOrdinaryMethodOrUserDefinedOperatorSymbol.cs (6)
84Debug.Assert(_lazyReturnType.CustomModifiers.IsEmpty); 94Debug.Assert(_lazyExplicitInterfaceImplementations.IsDefault); 132Debug.Assert(_lazyExplicitInterfaceImplementations.IsDefault); 143Debug.Assert(_lazyExplicitInterfaceImplementations.IsDefault); 146Debug.Assert(_lazyReturnType.CustomModifiers.IsEmpty); 166Debug.Assert(result == GetParameterCountFromSyntax());
Symbols\Source\SourceOrdinaryMethodSymbol.cs (28)
63Debug.Assert(diagnostics.DiagnosticBag is object); 78Debug.Assert(syntax.ReturnType is not ScopedTypeSyntax); 135Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 155Debug.Assert(this.RefKind == RefKind.None || !returnType.IsVoidType() || returnTypeSyntax.HasErrors); 174Debug.Assert(declaredConstraints.All(clause => clause.ConstraintTypes.IsEmpty)); 217Debug.Assert(parameterSyntax.Type != null); 282Debug.Assert(syntaxReferenceOpt != null); 303Debug.Assert(definition.IsPartialDefinition); 304Debug.Assert(implementation.IsPartialImplementation); 430Debug.Assert(PartialDefinitionPart is null); 480Debug.Assert(this.DeclaringSyntaxReferences.Length == 1); 508Debug.Assert(!ReferenceEquals(definition, implementation)); 624Debug.Assert(!ReferenceEquals(definition, implementation)); 625Debug.Assert(definition.Arity == implementation.Arity); 690Debug.Assert(this.MethodKind != MethodKind.UserDefinedOperator, "SourceUserDefinedOperatorSymbolBase overrides this"); 745Debug.Assert(!available, "Should have been parsed as partial constructor."); 797Debug.Assert(isExplicitInterfaceImplementation); 868Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 869Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 1071Debug.Assert(definition.IsPartialDefinition); 1072Debug.Assert(implementation.IsPartialImplementation); 1074Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || alreadySetImplPart == implementation); 1075Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || alreadySetDefPart == definition); 1080Debug.Assert(definition._otherPartOfPartial == implementation); 1081Debug.Assert(implementation._otherPartOfPartial == definition); 1094Debug.Assert(!_typeParameterInfo.LazyTypeParameters.IsDefault); 1157Debug.Assert(syntax.ExplicitInterfaceSpecifier != null); 1169Debug.Assert(syntax.TypeParameterList != null);
Symbols\Source\SourceParameterSymbol.cs (5)
44Debug.Assert(owner is not LambdaSymbol); // therefore we don't need to deal with discard parameters 59Debug.Assert(!inModifiers.IsDefault); 111Debug.Assert((owner.Kind == SymbolKind.Method) || (owner.Kind == SymbolKind.Property) || owner is NamedTypeSymbol { IsExtension: true }); 146Debug.Assert(!(ContainingSymbol is LocalFunctionSymbol)); 175Debug.Assert(filter == null);
Symbols\Source\SourceParameterSymbolBase.cs (2)
23Debug.Assert((object)containingSymbol != null); 24Debug.Assert(containingSymbol.ContainingAssembly != null);
Symbols\Source\SourcePropertyAccessorSymbol.cs (7)
37Debug.Assert(syntax.Kind() == SyntaxKind.GetAccessorDeclaration || 222Debug.Assert(!_property.IsExpressionBodied, "Cannot have accessors in expression bodied lightweight properties"); 298Debug.Assert(explicitInterfaceImplementations.Length == 1); 338Debug.Assert(propertyAccessibility != Accessibility.NotApplicable); 633Debug.Assert(syntaxReferenceOpt != null); 690Debug.Assert(MethodKind == MethodKind.PropertySet); 873Debug.Assert(IsPartialDefinition);
Symbols\Source\SourcePropertySymbol.cs (18)
52Debug.Assert(!(getterUsesFieldKeyword || setterUsesFieldKeyword) || 143Debug.Assert(syntax.Type is not ScopedTypeSyntax); 195Debug.Assert(PartialDefinitionPart is null 299Debug.Assert(hasGetAccessorImplementation); // it's not clear how this even parsed as a property if it has no accessor list and no arrow expression. 434Debug.Assert(isExplicitInterfaceImplementation); 460Debug.Assert(location.SourceTree is not null); 520Debug.Assert(!(syntax.AccessorList is null && GetArrowExpression(syntax) != null)); 574Debug.Assert(typeSyntax is not ScopedTypeSyntax); 728Debug.Assert(this.IsPartialDefinition); 729Debug.Assert((object)this != implementation); 730Debug.Assert((object?)this.OtherPartOfPartial == implementation); 803Debug.Assert(this.ParameterCount == implementation.ParameterCount); 859Debug.Assert(definition.IsPartialDefinition); 860Debug.Assert(implementation.IsPartialImplementation); 862Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || alreadySetImplPart == implementation); 863Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || alreadySetDefPart == definition); 868Debug.Assert(definition._otherPartOfPartial == implementation); 869Debug.Assert(implementation._otherPartOfPartial == definition);
Symbols\Source\SourcePropertySymbolBase.cs (42)
105Debug.Assert(!isExpressionBodied || !(hasAutoPropertyGet || hasAutoPropertySet)); 106Debug.Assert(!isExpressionBodied || !hasInitializer); 107Debug.Assert(!isExpressionBodied || accessorsHaveImplementation); 108Debug.Assert((modifiers & DeclarationModifiers.Required) == 0 || this is SourcePropertySymbol); 174Debug.Assert(memberName == DefaultIndexerName); 186Debug.Assert(!IsIndexer); 201Debug.Assert(_lazyDeclaredBackingField is null); 278Debug.Assert(isExplicitInterfaceImplementation || _lazyExplicitInterfaceImplementations.IsEmpty); 321Debug.Assert(property.PartialImplementationPart is null); 460Debug.Assert(IsIndexer); 463Debug.Assert(indexerNameAttributeLists.Count != 0); 464Debug.Assert(!IsExplicitInterfaceImplementation); 482Debug.Assert(temp.IsEarlyDecodedWellKnownAttributeDataComputed); 499Debug.Assert(rootBinderOpt is not null); 693Debug.Assert(_lazyExplicitInterfaceImplementations.IsEmpty); 787Debug.Assert(!IsPartial); 810Debug.Assert((object?)_lazyMergedBackingField.Value == backingField); 957Debug.Assert(_getMethod is object); 958Debug.Assert(_setMethod is object); 1053Debug.Assert(typeLocation != null); 1062Debug.Assert(explicitInterfaceSpecifier != null); 1125Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 1126Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 1252Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet); 1300Debug.Assert(this.IsSealed && (GetMethod is null || SetMethod is null)); 1361Debug.Assert(!ReferenceEquals(copyFrom, this)); 1380Debug.Assert(completed); 1383Debug.Assert(_lazyCustomAttributesBag.IsSealed); 1581Debug.Assert(arguments.AttributeSyntaxOpt != null); 1584Debug.Assert(diagnostics.DiagnosticBag is object); 1587Debug.Assert(!attribute.HasErrors); 1588Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 1766Debug.Assert(!boundAttributes.IsDefault); 1767Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1768Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1769Debug.Assert(_lazyCustomAttributesBag != null); 1770Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1771Debug.Assert(symbolPart == AttributeLocation.None); 1800Debug.Assert(this.IsIndexer || this.IsExtensionBlockMember()); 1841Debug.Assert(_state.HasComplete(CompletionPart.FinishPropertyEnsureSignature)); 1876Debug.Assert(completedOnThisThread); 1899Debug.Assert(completedOnThisThread);
Symbols\Source\SourceSimpleParameterSymbol.cs (1)
29Debug.Assert(locations.Length <= 1);
Symbols\Source\SourceTypeParameterSymbol.cs (18)
37Debug.Assert(!syntaxRefs.IsEmpty); 224Debug.Assert(!inProgress.ContainsReference(this)); 225Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 352Debug.Assert(filter == null); 369Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.EffectiveBaseClassNoUseSiteDiagnostics)); 370Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.DeducedBaseTypeNoUseSiteDiagnostics)); 406Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 407Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 410Debug.Assert(!attribute.HasErrors); 411Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 511Debug.Assert(!HasValueTypeConstraint); 692Debug.Assert(!HasValueTypeConstraint); 819Debug.Assert(overriddenTypeParameters.Length == overridingTypeParameters.Length); 850Debug.Assert(overridingMethod.IsOverride); 856Debug.Assert(method.IsOverride); 871Debug.Assert(implementationMethod.IsExplicitInterfaceImplementation); 877Debug.Assert(explicitImplementations.Length <= 1); 1002Debug.Assert(map != null);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
97Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
99Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (7)
59Debug.Assert(!this.IsStatic); 123Debug.Assert(!(IsAbstract && IsExtern)); 222Debug.Assert(isExplicitInterfaceImplementation); 762Debug.Assert(!different.IsTypeParameter()); 926Debug.Assert(containingType.IsDefinition); 1018Debug.Assert(operatorDeclaration.ExplicitInterfaceSpecifier != null); 1023Debug.Assert(conversionDeclaration.ExplicitInterfaceSpecifier != null);
Symbols\Source\SynthesizedAttributeData.cs (3)
36Debug.Assert((object)wellKnownMember != null); 37Debug.Assert(!arguments.IsDefault); 38Debug.Assert(!namedArguments.IsDefault); // Frequently empty though.
Symbols\Source\SynthesizedSourceOrdinaryMethodSymbol.cs (1)
29Debug.Assert(Arity == 0);
Symbols\Source\ThisParameterSymbol.cs (1)
145Debug.Assert(containingType is not null);
Symbols\Source\TypeParameterBuilder.cs (1)
29Debug.Assert(syntaxRef.GetSyntax().IsKind(SyntaxKind.TypeParameter));
Symbols\Source\TypeParameterConstraintClause.cs (4)
85Debug.Assert(!constraintTypes.IsDefault); 118Debug.Assert((constraints & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0 || 135Debug.Assert(constraintClauses.Length == typeParameters.Length); 200Debug.Assert(constraintClauses.Length == typeParameters.Length);
Symbols\SpecializedSymbolCollections.cs (2)
16Debug.Assert(instance.Count == 0); 28Debug.Assert(instance.Count == 0);
Symbols\SubstitutedEventSymbol.cs (1)
21Debug.Assert(originalDefinition.IsDefinition);
Symbols\SubstitutedMethodSymbol.cs (8)
44Debug.Assert(containingSymbol is SubstitutedNamedTypeSymbol || containingSymbol is SubstitutedErrorTypeSymbol); 45Debug.Assert(TypeSymbol.Equals(originalDefinition.ContainingType, containingSymbol.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 50Debug.Assert((object)originalDefinition != null); 51Debug.Assert(originalDefinition.IsDefinition); 58Debug.Assert(ReferenceEquals(constructedFrom.ConstructedFrom, constructedFrom)); 110Debug.Assert(ReferenceEquals(_constructedFrom, this)); 124Debug.Assert(_lazyTypeParameters != null); 183Debug.Assert(notUsed.Type is null && OriginalDefinition.ReducedFrom is not null);
Symbols\SubstitutedNamedTypeSymbol.cs (6)
60Debug.Assert(originalDefinition.IsDefinition); 61Debug.Assert(!originalDefinition.IsErrorType()); 70Debug.Assert(ReferenceEquals(constructedFrom.ConstructedFrom, constructedFrom)); 123Debug.Assert(_lazyTypeParameters != null); 174Debug.Assert(!ReferenceEquals(_lazyBaseType, ErrorTypeSymbol.UnknownResultType)); 290Debug.Assert(builder is object);
Symbols\SubstitutedParameterSymbol.cs (1)
37Debug.Assert(originalParameter.IsDefinition);
Symbols\SubstitutedTypeParameterSymbol.cs (2)
23Debug.Assert(ContainingSymbol.OriginalDefinition == _underlyingTypeParameter.ContainingSymbol.OriginalDefinition); 128Debug.Assert(!HasNotNullConstraint && !HasValueTypeConstraint);
Symbols\Symbol_Attributes.cs (36)
30Debug.Assert(!(this is IAttributeTargetSymbol)); //such types must override 218Debug.Assert(arguments.Diagnostics.DiagnosticBag is not null); 219Debug.Assert(arguments.AttributeSyntaxOpt is not null); 320Debug.Assert(!attributesToBind.IsDefault); 327Debug.Assert(!binders.IsDefault); 328Debug.Assert(binders.Length == attributesToBind.Length); 364Debug.Assert(!attributeDataArray.Contains((attr) => attr != null && attr.HasErrors)); 381Debug.Assert(!boundAttributes.Any(static (attr) => attr == null)); 404Debug.Assert(!earlyDecodingOnly); 415Debug.Assert(diagnostics.DiagnosticBag is not null); 421Debug.Assert(boundAttributeArray is not null); 425Debug.Assert(boundAttribute is not null); 443Debug.Assert(lazyCustomAttributesBag.IsSealed); 449Debug.Assert(diagnostics.DiagnosticBag is not null); 474Debug.Assert(totalAttributesCount == boundAttributes.Length); 574Debug.Assert(compilation != null); 644Debug.Assert(bindersBuilder != null); 678Debug.Assert(!binder.InAttributeArgument || this is MethodSymbol { MethodKind: MethodKind.LambdaMethod or MethodKind.LocalFunction }, "Possible cycle in attribute binding"); 785Debug.Assert(boundAttributeTypes.Any()); 786Debug.Assert(attributesToBind.Any()); 787Debug.Assert(binders.Any()); 788Debug.Assert(attributeDataArray != null); 789Debug.Assert(!attributeDataArray.Contains((attr) => attr != null)); 811Debug.Assert(earlyAttributeDataOpt == null || !earlyAttributeDataOpt.HasErrors); 812Debug.Assert(boundAttributeOpt is null == earlyAttributeDataOpt is null); 828Debug.Assert(attributeSyntaxList.Any()); 829Debug.Assert(attributeTypes.Any()); 856Debug.Assert(binders.Any()); 857Debug.Assert(attributeSyntaxList.Any()); 858Debug.Assert(boundAttributes.Any()); 859Debug.Assert(binders.Length == boundAttributes.Length); 860Debug.Assert(attributeSyntaxList.Length == boundAttributes.Length); 906Debug.Assert(!attribute.HasErrors); 929Debug.Assert(this.Kind == SymbolKind.Method); 972Debug.Assert(this.ObsoleteState != ThreeState.Unknown, "ObsoleteState should be true or false now."); 973Debug.Assert(this.ExperimentalState != ThreeState.Unknown, "ExperimentalState should be true or false now.");
Symbols\Symbol.cs (12)
54Debug.Assert(!this.RequiresCompletion); 61Debug.Assert(!this.RequiresCompletion); 203Debug.Assert(!(this is SourceAssemblySymbol), "SourceAssemblySymbol must override DeclaringCompilation"); 206Debug.Assert(!(this is SourceModuleSymbol), "SourceModuleSymbol must override DeclaringCompilation"); 290Debug.Assert(ContainingType.TypeKind != TypeKind.Submission); 407Debug.Assert(declaringCompilation != null); // require that it is a source symbol 912Debug.Assert(this.Kind == SymbolKind.NamedType || this.Kind == SymbolKind.Method); 918Debug.Assert(compilation != null); 1008Debug.Assert(!s.Contains("&")); 1051Debug.Assert(compilation != null); 1180Debug.Assert(!retVal); 1554Debug.Assert(attribute is SourceAttributeData);
Symbols\SymbolCompletionState.cs (2)
50Debug.Assert(symbol.RequiresCompletion); 106Debug.Assert(HasAtMostOneBitSet(next), "ForceComplete won't handle the result correctly if more than one bit is set.");
Symbols\SymbolDistinguisher.cs (3)
33Debug.Assert(symbol0 != symbol1); 161Debug.Assert((object)unwrappedSymbol == UnwrapSymbol(unwrappedSymbol)); 194Debug.Assert(unwrappedSymbol.Kind == SymbolKind.DynamicType || unwrappedSymbol.Kind == SymbolKind.ErrorType || unwrappedSymbol.Kind == SymbolKind.FunctionPointerType);
Symbols\SymbolEqualityComparer.cs (1)
57Debug.Assert(false, "Consider optimizing as above when we need to handle a new type comparison kind.");
Symbols\SymbolExtensions.cs (5)
36Debug.Assert(type.TypeParameters.IsEmpty == (typeArguments.Length == 0)); 107Debug.Assert(!useSiteInfo.AccumulatesDependencies); 269Debug.Assert(!(symbol is TypeSymbol)); 820Debug.Assert(symbol is MethodSymbol or PropertySymbol); 831Debug.Assert(parameter.IsDefinition);
Symbols\Synthesized\GeneratedNameParser.cs (2)
179Debug.Assert((char)GeneratedNameKind.PrimaryConstructorParameter == 'P'); 200Debug.Assert(s_regexPatternString[0] == FileTypeNameStartChar);
Symbols\Synthesized\GeneratedNames.cs (50)
23Debug.Assert((char)GeneratedNameKind.AutoPropertyBackingField == 'k'); 29Debug.Assert((char)GeneratedNameKind.PrimaryConstructorParameter == 'P'); 35Debug.Assert((int)finalizeState < -2); 39Debug.Assert((char)GeneratedNameKind.IteratorFinallyMethod == 'm'); 51Debug.Assert(closureOrdinal >= -1); 52Debug.Assert(methodOrdinal >= 0); 75Debug.Assert((char)GeneratedNameKind.Extension == 'E'); 86Debug.Assert(generation >= 0); 87Debug.Assert(methodOrdinal >= -1); 94Debug.Assert((char)GeneratedNameKind.BaseMethodWrapper == 'n'); 100Debug.Assert(methodOrdinal >= -1); 101Debug.Assert(methodGeneration >= 0); 102Debug.Assert(lambdaOrdinal >= 0); 103Debug.Assert(lambdaGeneration >= 0); 112Debug.Assert(methodOrdinal >= -1); 113Debug.Assert(lambdaOrdinal >= 0); 120Debug.Assert(methodOrdinal >= -1); 121Debug.Assert(methodGeneration >= 0); 122Debug.Assert(lambdaOrdinal >= 0); 123Debug.Assert(lambdaGeneration >= 0); 138Debug.Assert(methodOrdinal >= -1); 139Debug.Assert(methodGeneration >= 0 || methodGeneration == -1 && methodOrdinal == -1); 140Debug.Assert(entityOrdinal >= -1); 141Debug.Assert(entityGeneration >= 0 || entityGeneration == -1 && entityOrdinal == -1); 142Debug.Assert(entityGeneration == -1 || entityGeneration >= methodGeneration); 143Debug.Assert(suffixTerminator != GeneratedNameConstants.IdSeparator); 211Debug.Assert((localName != null) == (kind == SynthesizedLocalKind.UserDefined)); 212Debug.Assert(slotIndex >= 0); 213Debug.Assert(kind.IsLongLived()); 227Debug.Assert(localName.IndexOf('.') == -1); 254Debug.Assert((char)GeneratedNameKind.AwaiterField == 'u'); 260Debug.Assert((char)GeneratedNameKind.LambdaCacheField == '9'); 266Debug.Assert(kind.IsLongLived()); 284Debug.Assert((char)GeneratedNameKind.DisplayClassLocalOrField == '8'); 291Debug.Assert((char)GeneratedNameKind.FixedBufferField == 'e'); 298Debug.Assert((char)GeneratedNameKind.StateMachineStateField == '1'); 304Debug.Assert((char)GeneratedNameKind.AsyncIteratorPromiseOfValueOrEndBackingField == 'v'); 310Debug.Assert((char)GeneratedNameKind.CombinedTokensField == 'x'); 316Debug.Assert((char)GeneratedNameKind.IteratorCurrentBackingField == '2'); 322Debug.Assert((char)GeneratedNameKind.DisposeModeField == 'w'); 328Debug.Assert((char)GeneratedNameKind.IteratorCurrentThreadIdField == 'l'); 334Debug.Assert((char)GeneratedNameKind.StateMachineStateIdField == 'I'); 340Debug.Assert((char)GeneratedNameKind.ThisProxyField == '4'); 351Debug.Assert((char)GeneratedNameKind.StateMachineParameterProxyField == '3'); 364Debug.Assert((char)GeneratedNameKind.DynamicCallSiteField == 'p'); 461Debug.Assert(name == MakeSynthesizedDelegateName(byRefs, returnsVoid, generation)); 467Debug.Assert((char)GeneratedNameKind.InlineArrayType == 'y'); 476Debug.Assert((char)GeneratedNameKind.ReadOnlyListType == 'z'); 492Debug.Assert((char)GeneratedNameKind.AsyncBuilderField == 't'); 532Debug.Assert((char)GeneratedNameKind.ReusableHoistedLocalField == '7');
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (5)
59Debug.Assert(method.ReturnType.IsObjectType()); 60Debug.Assert(itemFieldReference.Type.IsTypeParameter()); 63Debug.Assert(c.IsImplicit); 64Debug.Assert(c.IsBoxing); 123Debug.Assert(property is { GetMethod: not null, SetMethod: null });
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
22Debug.Assert(setAccessorBody is null == interfaceProperty.SetMethod is null);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
17Debug.Assert(containingType.IsClassType());
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (24)
253Debug.Assert(diagnosticInfo is { }); 487Debug.Assert(enumeratorType is not null); 495Debug.Assert(interfaceType.IsInterface); 497Debug.Assert(c.IsImplicit); 498Debug.Assert(c.IsReference); 551Debug.Assert(returnType.IsObjectType()); 553Debug.Assert(c.IsImplicit); 554Debug.Assert(c.IsReference); 594Debug.Assert(interfaceType.IsInterface); 596Debug.Assert(c.IsImplicit); 597Debug.Assert(c.IsReference); 638Debug.Assert(c.IsImplicit); 639Debug.Assert(c.IsBoxing); 660Debug.Assert(interfaceType.IsInterface); 662Debug.Assert(c.IsImplicit); 663Debug.Assert(c.IsReference); 744Debug.Assert(interfaceType.IsInterface); 746Debug.Assert(c.IsImplicit); 747Debug.Assert(c.IsReference); 788Debug.Assert(fieldType.IsTypeParameter()); 789Debug.Assert(parameterReference.Type.Equals(fieldType) || 800Debug.Assert(c.IsUnboxing || c.IsIdentity); 824Debug.Assert(symbol is { }); 825Debug.Assert(_field.Type.OriginalDefinition.Equals(symbol.ContainingType, TypeCompareKind.AllIgnoreOptions));
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (14)
26Debug.Assert(syntax.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.StructDeclaration); 27Debug.Assert(containingType.HasPrimaryConstructor); 28Debug.Assert(containingType is SourceNamedTypeSymbol); 29Debug.Assert(containingType is IAttributeTargetSymbol); 39Debug.Assert(syntax.ParameterList != null); 60Debug.Assert(syntaxReferenceOpt != null); 111Debug.Assert(typeDecl.ParameterList is not null); 147Debug.Assert(arguments.SymbolPart == AttributeLocation.Method); 156Debug.Assert(arguments.SymbolPart == AttributeLocation.Method); 164Debug.Assert(symbolPart is AttributeLocation.Method or AttributeLocation.Return); 170Debug.Assert(attributeDeclarationSyntax.Target is object); 220Debug.Assert(count == value.Count); 229Debug.Assert(oldSet.Contains(p)); 233Debug.Assert(count == 0);
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (3)
22Debug.Assert(!containingType.IsRecordStruct); 68Debug.Assert(c.IsImplicit); 69Debug.Assert(c.IsReference);
Symbols\Synthesized\Records\SynthesizedRecordClone.cs (3)
27Debug.Assert(!containingType.IsRecordStruct); 50Debug.Assert(modifiersAreValid(result)); 108Debug.Assert(!IsAbstract);
Symbols\Synthesized\Records\SynthesizedRecordCopyCtor.cs (2)
78Debug.Assert(IsImplicitlyDeclared); 81Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\Records\SynthesizedRecordDeconstruct.cs (1)
26Debug.Assert(positionalMembers.All(p => p is PropertySymbol { GetMethod: not null } or FieldSymbol));
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (2)
48Debug.Assert(!containingType.IsRecordStruct); 101Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (1)
44Debug.Assert(name == WellKnownMemberNames.EqualityOperatorName || name == WellKnownMemberNames.InequalityOperatorName);
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (5)
27Debug.Assert(equalityContract is null == containingType.IsRecordStruct); 69Debug.Assert(_equalityContract is not null); 93Debug.Assert(!other.Type.IsStructType()); 132Debug.Assert(c.IsImplicit); 133Debug.Assert(c.IsReference);
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (2)
23Debug.Assert(containingType.IsRecordStruct == equalityContract is null); 56Debug.Assert(_equalityContract is not null);
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (2)
62Debug.Assert(paramAccess.Type.IsObjectType()); 64Debug.Assert(c.IsUnboxing);
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (5)
51Debug.Assert(modifiersAreValid(result)); 187Debug.Assert(!printableMembers.IsEmpty); 215Debug.Assert(value.Type is not null); 228Debug.Assert(c.IsImplicit); 229Debug.Assert(c.IsIdentity || c.IsReference || c.IsBoxing);
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (2)
64Debug.Assert(isAutoPropertyAccessor); 70Debug.Assert(isAutoPropertyAccessor);
Symbols\Synthesized\Records\SynthesizedRecordToString.cs (1)
32Debug.Assert(printMethod is object);
Symbols\Synthesized\RefKindVector.cs (2)
104Debug.Assert(i > 0); 137Debug.Assert(firstWord is not null);
Symbols\Synthesized\SynthesizedAccessorValueParameterSymbol.cs (3)
31Debug.Assert(accessor.Locations.Length <= 1); 109Debug.Assert(accessor.Locations.Length <= 1); 122Debug.Assert(accessor.Locations.Length <= 1);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (11)
34Debug.Assert(!string.IsNullOrEmpty(name)); 95Debug.Assert(!string.IsNullOrEmpty(name)); 96Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly); 168Debug.Assert(inferredAnnotation is not NullableAnnotation.Ignored); 171Debug.Assert((NullableAnnotation)_inferredNullableAnnotation is NullableAnnotation.NotAnnotated or NullableAnnotation.Annotated); 178Debug.Assert(InfersNullableAnnotation); 183Debug.Assert(_property.GetMethod is null); 251Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 252Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 255Debug.Assert(!attribute.HasErrors); 256Debug.Assert(arguments.SymbolPart == AttributeLocation.None);
Symbols\Synthesized\SynthesizedContainer.cs (3)
29Debug.Assert(name != null); 37Debug.Assert(name != null); 69Debug.Assert(compilation != null, "SynthesizedClass is not contained in a source module?");
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (4)
42Debug.Assert(name is object); 43Debug.Assert(containingNamespace is object); 44Debug.Assert(containingModule is object); 45Debug.Assert(baseType is object);
Symbols\Synthesized\SynthesizedEmbeddedExtensionMarkerNameAttributeSymbol.cs (2)
30Debug.Assert(FieldName == GeneratedNames.MakeBackingFieldName(PropertyName)); 37Debug.Assert(_constructors.Length == AttributeDescription.ExtensionMarkerAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedMemorySafetyRulesAttributeSymbol.cs (4)
83Debug.Assert(_fields.Length == 1); 84Debug.Assert(parameters.Length == 1); 103Debug.Assert(property.GetMethod is not null); 104Debug.Assert(property.SetMethod is null);
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (1)
57Debug.Assert(_constructors.Length == AttributeDescription.NativeIntegerAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (1)
61Debug.Assert(_constructors.Length == AttributeDescription.NullableAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullableContextAttributeSymbol.cs (1)
45Debug.Assert(_constructors.Length == AttributeDescription.NullableContextAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEmbeddedNullablePublicOnlyAttributeSymbol.cs (1)
45Debug.Assert(_constructors.Length == AttributeDescription.NullablePublicOnlyAttribute.Signatures.Length);
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (15)
50Debug.Assert((object)containingType != null); 355Debug.Assert(userMain.ParameterCount == 0 || userMain.ParameterCount == 1); 415Debug.Assert( 418Debug.Assert(!compilation.IsRuntimeAsyncEnabledIn(this)); 489Debug.Assert(containingType.IsScriptClass); 490Debug.Assert(returnType.IsVoidType()); 517Debug.Assert(ctor.ParameterCount == 0); 520Debug.Assert(initializer.ParameterCount == 0); 529Debug.Assert(!initializer.ReturnType.IsDynamic()); 532Debug.Assert(!compilation.IsRuntimeAsyncEnabledIn(this)); 579Debug.Assert(containingType.IsSubmissionClass); 580Debug.Assert(!returnType.IsVoidType()); 609Debug.Assert(ctor.ParameterCount == 1); 612Debug.Assert(initializer.ParameterCount == 0); 651Debug.Assert(TypeSymbol.Equals(initializeResult.Type, _returnType.Type, TypeCompareKind.ConsiderEverything2));
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (3)
32Debug.Assert(IsAbstract || IsExtern || IsFieldLikeEventAccessor()); 54Debug.Assert(PartialImplementationPart is null); 129Debug.Assert(TryGetBodyBinder() is null);
Symbols\Synthesized\SynthesizedFieldSymbol.cs (1)
32Debug.Assert((object)type != null);
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (4)
31Debug.Assert((object)containingType != null); 32Debug.Assert(!string.IsNullOrEmpty(name)); 33Debug.Assert((accessibility & DeclarationModifiers.AccessibilityMask) != 0); 34Debug.Assert((accessibility & ~DeclarationModifiers.AccessibilityMask) == 0);
Symbols\Synthesized\SynthesizedGlobalMethodSymbol.cs (9)
31Debug.Assert(privateImplType is not null); 32Debug.Assert(name != null); 41Debug.Assert((object)returnType != null); 48Debug.Assert(returnType is not null); 49Debug.Assert(_returnType is null); 55Debug.Assert(!parameters.IsDefault); 56Debug.Assert(_parameters.IsDefault); 62Debug.Assert(!typeParameters.IsDefault); 63Debug.Assert(_typeParameters.IsDefault);
Symbols\Synthesized\SynthesizedImplementationMethod.cs (1)
36Debug.Assert(implementingType.IsDefinition);
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (1)
51Debug.Assert(inlineArrayParameter.RefKind is RefKind.Ref or RefKind.In);
Symbols\Synthesized\SynthesizedInlineArrayTypeSymbol.cs (2)
33Debug.Assert(arrayLength > 0); 206Debug.Assert(compilation is { });
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
22Debug.Assert((object)containingType != null); 84Debug.Assert(_containingType.TypeKind == TypeKind.Class);
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (3)
28Debug.Assert(containingType.IsScriptClass); 172Debug.Assert(!this.IsStatic); 173Debug.Assert(!this.IsGenericMethod);
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (3)
35Debug.Assert(leftType.Equals(returnType, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 42Debug.Assert((leftType.IsDynamic() || rightType.IsDynamic()) == returnType.IsDynamic()); 43Debug.Assert(_containingType.IsDynamic() == returnType.IsDynamic());
Symbols\Synthesized\SynthesizedLambdaCacheFieldSymbol.cs (2)
22Debug.Assert((object)type != null); 23Debug.Assert((object)topLevelMethod != null);
Symbols\Synthesized\SynthesizedLocal.cs (6)
49Debug.Assert(!type.IsVoidType()); 50Debug.Assert(!kind.IsLongLived() || syntaxOpt != null); 51Debug.Assert(refKind != RefKind.Out); 52Debug.Assert(containingMethodOpt is null || containingMethodOpt.DeclaringCompilation is not null); 155Debug.Assert(_syntaxOpt != null); 179Debug.Assert(!_isKnownToReferToTempIfReferenceType);
Symbols\Synthesized\SynthesizedMethodSymbol.cs (1)
51Debug.Assert(!this.IsExtensionBlockMember());
Symbols\Synthesized\SynthesizedParameterSymbol.cs (11)
33Debug.Assert(type.HasType); 34Debug.Assert(name != null); 35Debug.Assert(ordinal >= 0); 309Debug.Assert(!(oldParam is SynthesizedComplexParameterSymbol)); 362Debug.Assert(!refCustomModifiers.IsDefault); 363Debug.Assert(isParams || !refCustomModifiers.IsEmpty || baseParameterForAttributes is object || defaultValue is not null || hasUnscopedRefAttribute); 364Debug.Assert(baseParameterForAttributes is null || baseParameterForAttributes.ExplicitDefaultConstantValue == defaultValue); 365Debug.Assert(baseParameterForAttributes is null || baseParameterForAttributes.RefKind == refKind); 366Debug.Assert(!isParams || container is SynthesizedDelegateInvokeMethod or SynthesizedClosureMethod, 425Debug.Assert(_baseParameterForAttributes is null); 434Debug.Assert(_baseParameterForAttributes is null);
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
27Debug.Assert(globalNamespace.IsGlobalNamespace); 28Debug.Assert(objectType.IsObjectType());
Symbols\Synthesized\SynthesizedSealedPropertyAccessor.cs (4)
31Debug.Assert((object)property != null); 32Debug.Assert(property.IsSealed); 33Debug.Assert((object)overriddenAccessor != null); 95Debug.Assert(AccessCheck.IsSymbolAccessible(_overriddenAccessor, this.ContainingType, ref discardedUseSiteInfo));
Symbols\Synthesized\SynthesizedSimpleProgramEntryPointSymbol.cs (2)
32Debug.Assert(declaration.SyntaxReference.GetSyntax() is CompilationUnitSyntax); 158Debug.Assert(!HasUnsafeModifier, $"Revisit {nameof(CanBeCallerUnsafe)} implementation if {nameof(SynthesizedSimpleProgramEntryPointSymbol)} can be marked 'unsafe'.");
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
406Debug.Assert(ContainingType is SynthesizedClosureEnvironment);
Symbols\Synthesized\SynthesizedSubmissionConstructor.cs (2)
19Debug.Assert(containingType.TypeKind == TypeKind.Submission); 20Debug.Assert(diagnostics != null);
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
33Debug.Assert(unmatchedValue.Type.SpecialType == SpecialType.System_Object);
Symbols\Synthesized\SynthesizedTypeParameterSymbol.cs (2)
28Debug.Assert(ContainingSymbol.OriginalDefinition != _underlyingTypeParameter.ContainingSymbol.OriginalDefinition); 30Debug.Assert(this.TypeParameterKind == (ContainingSymbol is MethodSymbol ? TypeParameterKind.Method :
Symbols\Synthesized\SynthesizedUnionCtor.cs (4)
45Debug.Assert(valueProperty.DeclaredBackingField is not null); 62Debug.Assert(F.Syntax is TypeDeclarationSyntax); 74Debug.Assert(IsImplicitlyDeclared); 77Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\SynthesizedUnionValuePropertySymbol.cs (1)
58Debug.Assert(isAutoPropertyAccessor);
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (4)
22Debug.Assert(originalVariable != null); 23Debug.Assert(type.HasType); 24Debug.Assert(containingSymbol != null); 25Debug.Assert(containingSymbol.DeclaringCompilation is not null);
Symbols\SynthesizedNamespaceSymbol.cs (2)
26Debug.Assert(containingNamespace is object); 27Debug.Assert(name is object);
Symbols\Tuples\TupleErrorFieldSymbol.cs (4)
50Debug.Assert(name != null); 57Debug.Assert((correspondingDefaultFieldOpt == null) == this.IsDefaultTupleElement); 58Debug.Assert(correspondingDefaultFieldOpt == null || correspondingDefaultFieldOpt.IsDefaultTupleElement); 197Debug.Assert(newOwner.IsTupleType && newOwner.TupleElementTypesWithAnnotations.Length > TupleElementIndex);
Symbols\Tuples\TupleFieldSymbol.cs (15)
46Debug.Assert(tupleElementIndex >= 0); 47Debug.Assert(container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames) || this is TupleVirtualElementFieldSymbol, 49Debug.Assert(!(underlyingField is TupleElementFieldSymbol)); 52Debug.Assert(!container.IsDefinition); 54Debug.Assert(container.IsTupleType); 57Debug.Assert(!locations.IsDefault); 213Debug.Assert(newOwner.IsTupleType); 269Debug.Assert(container.IsTupleType); 270Debug.Assert(underlyingField.ContainingType.IsTupleType); 271Debug.Assert(name != null); 272Debug.Assert(name != underlyingField.Name || !container.Equals(underlyingField.ContainingType, TypeCompareKind.IgnoreDynamicAndTupleNames), 274Debug.Assert((correspondingDefaultFieldOpt is null) == (NamedTypeSymbol.TupleMemberName(tupleElementIndex + 1) == name)); 275Debug.Assert(!(correspondingDefaultFieldOpt is TupleErrorFieldSymbol)); 334Debug.Assert(newOwner.IsTupleType); 335Debug.Assert(newOwner.TupleElements.Length == this._containingTuple.TupleElements.Length);
Symbols\Tuples\TupleTypeSymbol.cs (29)
44Debug.Assert(!shouldCheckConstraints || syntax is object); 45Debug.Assert(elementNames.IsDefault || elementTypesWithAnnotations.Length == elementNames.Length); 46Debug.Assert(!includeNullability || shouldCheckConstraints); 67Debug.Assert(syntax is object); 109Debug.Assert(tupleCompatibleType.IsTupleType); 131Debug.Assert(TupleElementTypesWithAnnotations.Length == newElementTypes.Length); 132Debug.Assert(newElementTypes.All(t => t.HasType)); 168Debug.Assert(IsTupleType); 169Debug.Assert(newElementNames.IsDefault || this.TupleElementTypesWithAnnotations.Length == newElementNames.Length); 175Debug.Assert(IsTupleType); 236Debug.Assert(chainedTupleTypeOpt is null == elementTypes.Length < ValueTupleRestPosition); 293Debug.Assert(allMissing || destinationNames.Length == sourceLength); 520Debug.Assert(relativeMember >= WellKnownMember.System_ValueTuple_T1__Item1 && relativeMember <= WellKnownMember.System_ValueTuple_TRest__ctor); 521Debug.Assert(type.IsDefinition); 578Debug.Assert(IsTupleType); 579Debug.Assert(currentMembers.All(m => !(m is TupleVirtualElementFieldSymbol))); 658Debug.Assert(fieldSymbol.Name == defaultName, "top level underlying field must match default name"); 730Debug.Assert((object)oldUnderlying.OriginalDefinition == currentValueTuple.OriginalDefinition); 818Debug.Assert(relativeMember >= WellKnownMember.System_ValueTuple_T1__Item1 && relativeMember <= WellKnownMember.System_ValueTuple_TRest__ctor); 844Debug.Assert(fields.All(f => f is object)); 872Debug.Assert(names1.Length == names2.Length); 929Debug.Assert(underlyingType.IsTupleType); 930Debug.Assert(underlyingType.TupleElementNames.IsDefault); 976Debug.Assert(tuple.Equals(TupleUnderlyingType, TypeCompareKind.IgnoreTupleNames)); 1008Debug.Assert(tuple.Equals(TupleUnderlyingType, TypeCompareKind.IgnoreTupleNames)); 1040Debug.Assert(candidate.IsDefaultTupleElement); 1045Debug.Assert(builder.All(f => f is object)); 1089Debug.Assert((object)underlyingAssociatedField.ContainingSymbol == TupleUnderlyingType); 1090Debug.Assert(TupleUnderlyingType.GetMembers(underlyingAssociatedField.Name).IndexOf(underlyingAssociatedField) < 0);
Symbols\TypedConstantExtensions.cs (11)
32Debug.Assert(constant.Value is object); 42Debug.Assert(constant.ValueInternal is object); 44Debug.Assert(result != null); 51Debug.Assert(constant.Kind == TypedConstantKind.Enum); 55Debug.Assert(constant.ValueInternal is object); 71Debug.Assert(constant.Kind == TypedConstantKind.Enum); 142Debug.Assert(constant.ValueInternal is object); 144Debug.Assert(result is object); 150Debug.Assert(constant.Kind == TypedConstantKind.Enum); 220Debug.Assert(constant.ValueInternal is object); 222Debug.Assert(result is object);
Symbols\TypeMap.cs (9)
45Debug.Assert(allowAlpha || from.All(static tp => tp.IsDefinition)); 89Debug.Assert(s_emptyDictionary.IsEmpty()); 97Debug.Assert(s_emptyTypeMap.Mapping.IsEmpty()); 141Debug.Assert(TypeSymbol.Equals(oldOwner.ConstructedFrom, oldOwner, TypeCompareKind.ConsiderEverything2)); 147Debug.Assert(oldOwner.ConstructedFrom == oldOwner); 153Debug.Assert(oldOwner.ConstructedFrom == oldOwner); 154Debug.Assert(stopAt == null || stopAt.ConstructedFrom == stopAt); 186Debug.Assert( 198Debug.Assert(from.Length == to.Length);
Symbols\TypeParameterBounds.cs (4)
29Debug.Assert(!constraintTypes.IsDefault); 30Debug.Assert(!interfaces.IsDefault); 31Debug.Assert((object)effectiveBaseClass != null); 32Debug.Assert((object)deducedBaseType != null);
Symbols\TypeParameterSymbol.cs (6)
404Debug.Assert(constraint.TypeKind != TypeKind.TypeParameter); 451Debug.Assert(!constraintTypes.IsDefaultOrEmpty); 570Debug.Assert(fromNonTypeConstraints == null); 571Debug.Assert(fromTypes != true); 699Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 710Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\TypeParameterSymbolExtensions.cs (2)
13Debug.Assert((object)typeParameter1 != null); 14Debug.Assert((object)typeParameter2 != null);
Symbols\TypeSymbol.cs (26)
104Debug.Assert(info != s_noInterfaces || info.IsDefaultValue(), "default value was modified"); 255Debug.Assert((object)type != null); 256Debug.Assert(!type.IsTypeParameter()); 389Debug.Assert(InterfaceInfo.EmptyInterfacesAndTheirBaseInterfaces.IsEmpty); 726Debug.Assert((object)interfaceMember != null); 727Debug.Assert(!this.IsInterfaceType()); 762Debug.Assert(ignoreImplementationInInterfacesIfResultIsNotReady || !implementationInInterfacesMightChangeResult); 763Debug.Assert(!implementationInInterfacesMightChangeResult || result.Symbol is null); 809Debug.Assert(!implementingType.IsInterfaceType()); 810Debug.Assert(interfaceMember.Kind == SymbolKind.Method || interfaceMember.Kind == SymbolKind.Property || interfaceMember.Kind == SymbolKind.Event); 811Debug.Assert(interfaceMember.IsImplementableInterfaceMember()); 814Debug.Assert((object)interfaceType != null && interfaceType.IsInterface); 943Debug.Assert(!canBeImplementedImplicitlyInCSharp9 || (object)implementingBaseOpt == null); 1062Debug.Assert(!implementingType.IsInterfaceType()); 1079Debug.Assert((object)defaultImpl == null); 1080Debug.Assert((object)conflict2 != null); 1086Debug.Assert(((object)conflict2 == null)); 1304Debug.Assert(implementations.Count == 1); 1385Debug.Assert(interfaceType.IsInterface); 1551Debug.Assert(!implementingType.IsInterfaceType()); 1552Debug.Assert(interfaceMethod.IsAccessor()); 2001Debug.Assert(false); 2105Debug.Assert((object)implementingType != null); 2119Debug.Assert(interfaceMethod.Arity == implicitImpl.Arity); 2318Debug.Assert(interfaceMember.Kind != SymbolKind.Method || (object)interfaceMember == ((MethodSymbol)interfaceMember).ConstructedFrom); 2552Debug.Assert(HasInlineArrayAttribute(out var length) && length > 0);
Symbols\TypeSymbolExtensions.cs (1)
626Debug.Assert(type is FunctionPointerTypeSymbol || type.IsDelegateType());
Symbols\TypeUnification.cs (7)
27Debug.Assert(candidateSubtype.IsDefinition); 28Debug.Assert(closedType.IsClosed); 31Debug.Assert(TypeSymbol.Equals(candidateBaseType.OriginalDefinition, closedType.OriginalDefinition, TypeCompareKind.CLRSignatureCompareOptions)); 54Debug.Assert(substituted1.Type.Equals(substituted2.Type, TypeCompareKind.CLRSignatureCompareOptions)); 55Debug.Assert(substituted1.CustomModifiers.SequenceEqual(substituted2.CustomModifiers)); 126Debug.Assert(t1.Type.IsTypeParameter() || !t2.Type.IsTypeParameter()); 173Debug.Assert(!nt1.Equals(nt2, TypeCompareKind.CLRSignatureCompareOptions));
Symbols\TypeWithAnnotations.cs (24)
55Debug.Assert(defaultType?.IsNullableType() != true || defaultAnnotation == NullableAnnotation.Annotated); 56Debug.Assert(extensions != null); 92Debug.Assert(nullableAnnotation != NullableAnnotation.Ignored || typeSymbol.IsTypeParameter()); 196Debug.Assert(CustomModifiers.IsEmpty); 246Debug.Assert((object)type != null); 442Debug.Assert(NullableAnnotation != NullableAnnotation.Ignored); 450Debug.Assert(newTypeWithModifiers.NullableAnnotation.IsOblivious() || (typeSymbol.IsNullableType() && newTypeWithModifiers.NullableAnnotation.IsAnnotated())); 451Debug.Assert(newTypeWithModifiers.CustomModifiers.IsEmpty); 452Debug.Assert(NullableAnnotation != NullableAnnotation.Ignored); 484Debug.Assert(newTypeWithModifiers.Type is not IndexedTypeParameterSymbol || newTypeWithModifiers.NullableAnnotation == NullableAnnotation.Ignored); 496Debug.Assert(NullableAnnotation == NullableAnnotation.NotAnnotated); 512Debug.Assert((object)newTypeWithModifiers.DefaultType == newTypeWithModifiers.Type); 518Debug.Assert(newTypeWithModifiers.NullableAnnotation is NullableAnnotation.NotAnnotated); 528Debug.Assert(NullableAnnotation.IsOblivious()); 529Debug.Assert(newTypeWithModifiers.NullableAnnotation.IsOblivious()); 888Debug.Assert(!customModifiers.IsDefault); 964Debug.Assert(!customModifiers.IsDefault); 980Debug.Assert(defaultAnnotation == NullableAnnotation.Ignored); 986Debug.Assert(_resolved != Unresolved); 1050Debug.Assert(!asValueType); 1067Debug.Assert(!underlying.NullableAnnotation.IsAnnotated()); 1068Debug.Assert(underlying.TypeKind == TypeKind.TypeParameter); 1069Debug.Assert(underlying.CustomModifiers.IsEmpty); 1103Debug.Assert(resolvedType.IsNullableType() && CustomModifiers.IsEmpty);
Symbols\TypeWithState.cs (4)
33Debug.Assert(type?.IsNullableTypeOrTypeParameter() != true); 43Debug.Assert((object)type != null); 71Debug.Assert(state == NullableFlowState.NotNull || type?.CanContainNull() != false); 72Debug.Assert(state != NullableFlowState.MaybeDefault || type is null || type.IsTypeParameterDisallowingAnnotationInCSharp8());
Symbols\UnboundGenericType.cs (1)
89Debug.Assert(Arity == 0);
Symbols\UpdatedContainingSymbolLocal.cs (2)
27Debug.Assert(updatedContainingSymbol.DeclaringCompilation is not null); 28Debug.Assert(!assertContaining || updatedContainingSymbol.Equals(underlyingLocal.ContainingSymbol, TypeCompareKind.AllNullableIgnoreOptions));
Symbols\VarianceSafety.cs (6)
31Debug.Assert((object)interfaceType != null && interfaceType.IsInterface); 93Debug.Assert(container.IsInterfaceType()); 94Debug.Assert(container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None)); 105Debug.Assert(!container.IsDelegateType()); 301Debug.Assert(requireOutputSafety || requireInputSafety); 369Debug.Assert(requireOutputSafety || requireInputSafety);
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
32Debug.Assert((object)underlyingField != null);
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
35Debug.Assert((object)underlyingType != null);
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
28Debug.Assert((object)underlyingParameter != null);
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
32Debug.Assert((object)underlyingProperty != null);
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
33Debug.Assert((object)underlyingTypeParameter != null);
Syntax\AttributeSyntax.cs (1)
25Debug.Assert(!String.IsNullOrEmpty(namedArgName));
Syntax\CSharpLineDirectiveMap.cs (8)
30Debug.Assert(ShouldAddDirective(directiveNode)); 188Debug.Assert(Entries[0].State == PositionState.Unmapped); 196Debug.Assert(entry.State != PositionState.Unknown && 237Debug.Assert(this.Entries[0].State == PositionState.Unmapped); 238Debug.Assert(this.Entries[0].MappedLine == this.Entries[0].UnmappedLine); 239Debug.Assert(this.Entries[0].MappedLine == 0); 240Debug.Assert(this.Entries[0].MappedPathOpt == null); 249Debug.Assert(entry.State != PositionState.Unknown &&
Syntax\CSharpPragmaWarningStateMap.cs (1)
152Debug.Assert(entries[i].CompareTo(entries[i + 1]) < 0);
Syntax\CSharpSyntaxNode.cs (4)
51Debug.Assert(result != null); 95Debug.Assert(tree != null); 102Debug.Assert(existingTree == tree, "how could this node belong to a different tree?"); 388Debug.Assert(trivia.HasStructure);
Syntax\CSharpSyntaxRewriter.cs (2)
72Debug.Assert(leadingTrivia == null || !leadingTrivia.IsList || leadingTrivia.SlotCount > 0); 73Debug.Assert(trailingTrivia == null || !trailingTrivia.IsList || trailingTrivia.SlotCount > 0);
Syntax\CSharpSyntaxTree.cs (8)
134Debug.Assert(HasCompilationUnitRoot); 144Debug.Assert(HasCompilationUnitRoot); 165Debug.Assert(!_lazyDirectives.IsNull); 293Debug.Assert(currentPos < pos); 381Debug.Assert(root != null); 396Debug.Assert(root != null); 517Debug.Assert(compilationUnit._syntaxTree == null); 677Debug.Assert(map.Entries.Length >= 1);
Syntax\CSharpSyntaxTree.LazySyntaxTree.cs (1)
31Debug.Assert(options != null);
Syntax\CSharpSyntaxTree.ParsedSyntaxTree.cs (3)
43Debug.Assert(root != null); 44Debug.Assert(options != null); 45Debug.Assert(textOpt == null || textOpt.Encoding == encodingOpt && textOpt.ChecksumAlgorithm == checksumAlgorithm);
Syntax\InternalSyntax\CSharpSyntaxNode.cs (1)
84System.Diagnostics.Debug.Assert(index < 11); // Max. slots 11 (TypeDeclarationSyntax)
Syntax\InternalSyntax\CSharpSyntaxRewriter.cs (1)
57Debug.Assert(visited != null && visited.Kind != SyntaxKind.None, "Cannot remove node using Syntax.InternalSyntax.SyntaxRewriter.");
Syntax\InternalSyntax\SyntaxFactory.cs (4)
136Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 137Debug.Assert(kind != SyntaxKind.IdentifierToken); 138Debug.Assert(kind != SyntaxKind.CharacterLiteralToken); 139Debug.Assert(kind != SyntaxKind.NumericLiteralToken);
Syntax\InternalSyntax\SyntaxFirstTokenReplacer.cs (2)
34Debug.Assert(replacer._foundOldToken); 47Debug.Assert(token == _oldToken);
Syntax\InternalSyntax\SyntaxLastTokenReplacer.cs (2)
33Debug.Assert(replacer._found); 52Debug.Assert(token == _oldToken);
Syntax\InternalSyntax\SyntaxToken.cs (2)
364System.Diagnostics.Debug.Assert(this.GetType() == typeof(SyntaxToken)); 370System.Diagnostics.Debug.Assert(this.GetType() == typeof(SyntaxToken));
Syntax\InternalSyntax\SyntaxTrivia.cs (1)
50Debug.Assert(this.FullWidth == this.Text.Length);
Syntax\LambdaUtilities.cs (7)
55Debug.Assert(lambdaBody.Parent is object); 63Debug.Assert(lambda.IsKind(SyntaxKind.LocalFunctionStatement)); 66Debug.Assert(IsLambda(lambda)); 75Debug.Assert(oldBody.Parent is object); 107Debug.Assert(oldJoin.LeftExpression == oldBody || oldJoin.RightExpression == oldBody); 113Debug.Assert(oldGroup.GroupExpression == oldBody || oldGroup.ByExpression == oldBody); 230Debug.Assert(selectOrGroupClause.Parent!.Parent is object);
Syntax\LookupPosition.cs (17)
128Debug.Assert(methodDecl != null); 142Debug.Assert(accessorDecl != null); 151Debug.Assert(delegateDecl != null); 158Debug.Assert(typeDecl != null); 165Debug.Assert(namespaceDecl != null); 172Debug.Assert(namespaceDecl != null); 179Debug.Assert(constructorDecl != null); 200Debug.Assert(methodDecl != null); 201Debug.Assert(IsInMethodDeclaration(position, methodDecl)); 231Debug.Assert(localFunction != null); 264Debug.Assert(statement != null); 284Debug.Assert(section != null); 294Debug.Assert(catchClause != null); 305Debug.Assert(filterClause != null); 312Debug.Assert(statement != null); 374Debug.Assert(statement != null); 475Debug.Assert(lambdaExpressionOrQueryNode.IsAnonymousFunction() || lambdaExpressionOrQueryNode.IsQuery());
Syntax\NamespaceDeclarationSyntaxReference.cs (1)
40Debug.Assert(node is CompilationUnitSyntax || node is BaseNamespaceDeclarationSyntax);
Syntax\NullableContextStateMap.cs (6)
55Debug.Assert(contexts[i - 1].Position < contexts[i].Position); 79Debug.Assert(index >= -1); 80Debug.Assert(index < _contexts.Length); 84Debug.Assert(_contexts[index].Position <= position); 85Debug.Assert(index == _contexts.Length - 1 || position < _contexts[index + 1].Position); 108Debug.Assert(context.Position <= span.Start);
Syntax\StructuredTriviaSyntax.cs (1)
19System.Diagnostics.Debug.Assert(parent == null || position >= 0);
Syntax\SyntaxEquivalence.cs (3)
36Debug.Assert(!topLevel || ignoreChildNode == null); 69Debug.Assert(before.RawKind == after.RawKind); 147Debug.Assert(after.IsToken);
Syntax\SyntaxExtensions.cs (7)
133Debug.Assert(attributeSyntax.Parent is object); 142Debug.Assert(parent.Name.Prefix is null); 148Debug.Assert(parent.Name.Prefix is null); 198Debug.Assert(typeNode != null); 235Debug.Assert(node != null); 353Debug.Assert(expr.Kind() == SyntaxKind.TupleExpression || expr.Kind() == SyntaxKind.DeclarationExpression || expr.Kind() == SyntaxKind.IdentifierName); 443Debug.Assert(paramType is object);
Syntax\SyntaxFactory.cs (6)
1652Debug.Assert(leadingTrivia.Count == 1); 1655Debug.Assert(structure.Content.Count == 2); 1657Debug.Assert(elementSyntax.Attributes.Count == 1); 1940Debug.Assert(red._syntaxTree is null); 2295Debug.Assert(currentNode.Kind() == SyntaxKind.MemberBindingExpression || 2303Debug.Assert(currentNode != null, "binding should be enclosed in a conditional access");
Syntax\SyntaxFacts.cs (1)
583Debug.Assert(node.Green == current || current is not Syntax.InternalSyntax.MemberDeclarationSyntax and not Syntax.InternalSyntax.TypeDeclarationSyntax);
Syntax\SyntaxKindFacts.cs (6)
22Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 151Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 181Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 187Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 193Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i)); 1247Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
Syntax\SyntaxNodeExtensions.cs (5)
20Debug.Assert(syntax != null); 34Debug.Assert(syntax != null); 149Debug.Assert(node != null); 266Debug.Assert( 371Debug.Assert(invocation.Expression is not QualifiedNameSyntax);
Syntax\SyntaxNodeRemover.cs (2)
326Debug.Assert(node.Parent is object); 366Debug.Assert(node.Parent is object);
Syntax\SyntaxNormalizer.cs (3)
334Debug.Assert(openBraceToken.IsKind(SyntaxKind.OpenBraceToken)); 351Debug.Assert(closeBraceToken.IsKind(SyntaxKind.CloseBraceToken)); 464Debug.Assert(((PropertyDeclarationSyntax)currentToken.Parent).SemicolonToken == currentToken);
Syntax\SyntaxTreeDiagnosticEnumerator.cs (1)
37Debug.Assert(root.ContainsDiagnostics, "Caller should have checked that the root has diagnostics");
Utilities\FirstAmongEqualsSet.cs (1)
76Debug.Assert(_hashSet.Count == 0);
Utilities\InterceptableLocation.cs (5)
66Debug.Assert(checksum.Length == ContentHashLength); 67Debug.Assert(path is not null); 68Debug.Assert(position >= 0); 69Debug.Assert(lineNumberOneIndexed > 0); 70Debug.Assert(characterNumberOneIndexed > 0);
Utilities\TypeSymbolExtensions.cs (1)
213Debug.Assert(visited == null || !visited.Contains(type.OriginalDefinition));
Utilities\TypeUnionValueSet.cs (12)
66Debug.Assert(!typesInUnion.IsEmpty); 67Debug.Assert(!typesInUnion.Any(t => t.CaseType.IsNullableType())); 68Debug.Assert(!typesInUnion.Any(t => t.CaseType is NamedTypeSymbol { IsClosed: true } closedType && closedType.TryGetClosedSubtypes(out var subtypes) && subtypes is not [])); 93Debug.Assert(!typesInUnion.IsEmpty); 94Debug.Assert(!typesInUnion.Any(t => t.CaseType.IsNullableType())); 163Debug.Assert(result.HasValue); 308Debug.Assert(originalClosedBase is NamedTypeSymbol { IsClosed: true }); 379Debug.Assert(_typesInUnion.SequenceEqual(other._typesInUnion)); 406Debug.Assert(_typesInUnion.SequenceEqual(other._typesInUnion)); 541Debug.Assert(left is not (IsTrueNode or IsFalseNode)); 542Debug.Assert(right is not (IsTrueNode or IsFalseNode)); 567Debug.Assert(negated is not (IsTrueNode or IsFalseNode));
Utilities\ValueSetFactory.BoolValueSetFactory.cs (1)
60Debug.Assert(relation == BinaryOperatorKind.Equal);
Utilities\ValueSetFactory.ByteTC.cs (2)
45Debug.Assert(value != byte.MaxValue); 51Debug.Assert(value != byte.MinValue);
Utilities\ValueSetFactory.CharTC.cs (3)
45Debug.Assert(value != char.MaxValue); 54Debug.Assert(result != null); 60Debug.Assert(value != char.MinValue);
Utilities\ValueSetFactory.ClosedClassTypeUnionValueSetFactory.cs (2)
21Debug.Assert(closedClassOrTypeParameter is NamedTypeSymbol { IsClosed: true } or TypeParameterSymbol { EffectiveBaseClassNoUseSiteDiagnostics.IsClosed: true }); 38Debug.Assert(!subtypes.IsDefaultOrEmpty);
Utilities\ValueSetFactory.DecimalTC.cs (8)
41Debug.Assert(value != decimal.MaxValue); 45Debug.Assert(scale == DecimalRep.FromValue(value).Normalize().scale); // assert that the input is normalized 53Debug.Assert(!(scale < 28 && low == transitionLow && mid == transitionMid && high == transitionHigh)); 59Debug.Assert(high > 0); // otherwise value == 0m 77Debug.Assert(scale > 0); // otherwise value == decimal.MaxValue 83Debug.Assert(new DecimalRep(low: low, mid: mid, high: high, isNegative: isNegative, scale: scale).Value <= value); 84Debug.Assert(result > value); 185Debug.Assert(scale <= maxScale);
Utilities\ValueSetFactory.DoubleTC.cs (2)
33Debug.Assert(!double.IsNaN(value)); 34Debug.Assert(value != double.PositiveInfinity);
Utilities\ValueSetFactory.EnumeratedValueSet.cs (3)
122Debug.Assert(object.ReferenceEquals(this._tc, other._tc)); 145Debug.Assert(object.ReferenceEquals(this._tc, other._tc)); 168Debug.Assert(object.ReferenceEquals(this._tc, other._tc));
Utilities\ValueSetFactory.EnumeratedValueSetFactory.cs (2)
43Debug.Assert(relation == BinaryOperatorKind.Equal); 51Debug.Assert(result.IsEmpty);
Utilities\ValueSetFactory.FloatingValueSet.cs (4)
61Debug.Assert(sample is { }); 65Debug.Assert(_hasNaN); 103Debug.Assert(object.ReferenceEquals(this._tc, other._tc)); 118Debug.Assert(object.ReferenceEquals(this._tc, other._tc));
Utilities\ValueSetFactory.IntTC.cs (2)
55Debug.Assert(value != int.MaxValue); 61Debug.Assert(value != MinValue);
Utilities\ValueSetFactory.LongTC.cs (2)
45Debug.Assert(value != long.MaxValue); 51Debug.Assert(value != long.MinValue);
Utilities\ValueSetFactory.NumericValueSet.cs (10)
33Debug.Assert(tc.Related(LessThanOrEqual, first, last)); 39Debug.Assert(intervals.Length == 0 || tc.Related(GreaterThanOrEqual, intervals[0].first, tc.MinValue)); 42Debug.Assert(tc.Related(LessThanOrEqual, intervals[i].first, intervals[i].last)); 46Debug.Assert(tc.Related(LessThan, tc.Next(intervals[i - 1].last), intervals[i].first)); 165Debug.Assert(this._tc.GetType() == other._tc.GetType()); 211Debug.Assert(tc.Related(LessThanOrEqual, first, last)); 212Debug.Assert(tc.Related(GreaterThanOrEqual, first, tc.MinValue)); 213Debug.Assert(tc.Related(LessThanOrEqual, last, tc.MaxValue)); 214Debug.Assert(builder.Count == 0 || tc.Related(LessThanOrEqual, builder.Last().first, first)); 242Debug.Assert(this._tc.GetType() == other._tc.GetType());
Utilities\ValueSetFactory.SByteTC.cs (2)
44Debug.Assert(value != sbyte.MaxValue); 50Debug.Assert(value != sbyte.MinValue);
Utilities\ValueSetFactory.ShortTC.cs (2)
45Debug.Assert(value != short.MaxValue); 51Debug.Assert(value != short.MinValue);
Utilities\ValueSetFactory.SingleTC.cs (2)
33Debug.Assert(!float.IsNaN(value)); 34Debug.Assert(value != float.PositiveInfinity);
Utilities\ValueSetFactory.StringTC.cs (4)
20Debug.Assert(result != null); 26Debug.Assert(count > 0); 27Debug.Assert(scope >= count); 40Debug.Assert(next == count);
Utilities\ValueSetFactory.UIntTC.cs (2)
45Debug.Assert(value != uint.MaxValue); 57Debug.Assert(value != uint.MinValue);
Utilities\ValueSetFactory.ULongTC.cs (2)
45Debug.Assert(value != ulong.MaxValue); 51Debug.Assert(value != ulong.MinValue);
Utilities\ValueSetFactory.UnionTypeTypeUnionValueSetFactory.cs (1)
20Debug.Assert(unionType is NamedTypeSymbol { IsUnionType: true });
Utilities\ValueSetFactory.UShortTC.cs (2)
45Debug.Assert(value != ushort.MaxValue); 57Debug.Assert(value != ushort.MinValue);
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
MetaAnalyzers\Fixers\CSharpPreferIsKindFix.cs (1)
61Debug.Fail("Unreachable.");
Microsoft.CodeAnalysis.CSharp.CodeStyle (80)
src\984dec8966cb7923\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
135Debug.Assert(labels.Count >= 1);
src\roslyn\src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
273Debug.Assert(ifStatementOrElseClause.IsKind(SyntaxKind.IfStatement));
src\roslyn\src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
61Debug.Assert(IsBinaryLike(binaryLike));
src\roslyn\src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
33Debug.Assert(IsBinaryLike(binaryPattern));
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
92Debug.Assert(recursivePattern.Designation is not null, "If we got to this point variable designation cannot be null"); 96Debug.Assert(listPattern.Designation is not null, "If we got to this point variable designation cannot be null");
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
189Debug.Assert(initializer.Parent is EqualsValueClauseSyntax);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
70Debug.Assert(IsIntIndexingMethod(method)); 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
132Debug.Assert(IsTwoArgumentSliceLikeMethod(sliceLikeMethod) || IsOneArgumentSliceLikeMethod(sliceLikeMethod));
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
42Debug.Assert(localStatement.IsKind(SyntaxKind.LocalDeclarationStatement)); 43Debug.Assert(enclosingBlock.Kind() is SyntaxKind.Block or SyntaxKind.SwitchSection);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
377Debug.Assert(constructorDeclaration.Initializer.Kind() == SyntaxKind.ThisConstructorInitializer);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (17)
59Debug.Assert(!token.ContainsDiagnostics); 235Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 241Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 311Debug.Assert(tokenText[index] == '\\'); 325Debug.Assert(tokenText[index] == '\\'); 360Debug.Assert(tokenText[index] == '\\'); 370Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 383Debug.Assert(tokenText[index] == '\\'); 394Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 403Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 414Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 427Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 448Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 457Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 471Debug.Assert(character == 'x'); 477Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 504Debug.Assert(IsHexDigit(c));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
44Debug.Assert(typeSymbol.GetParameters().IsDefaultOrEmpty, "If GetParameters extension handles record, we can remove the handling here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
827Debug.Fail("Unhandled pattern type");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxKindExtensions.cs (1)
73Debug.Fail($"Unhandled compound assignment kind: {syntaxKind}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
155Debug.Assert(trivia.Kind() == SyntaxKind.WhitespaceTrivia); 156Debug.Assert(trivia.Width() == trivia.FullWidth());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
48Debug.Assert(trivia.ToString() == trivia.ToFullString()); 138Debug.Assert(trivia.ToString() == trivia.ToFullString()); 323Debug.Assert(trivia.HasStructure);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.cs (1)
74Debug.Assert(this.SecondTokenIsFirstTokenOnLine);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (11)
34Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 42Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 54Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 62Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 74Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 82Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 133Debug.Assert(result.Tab >= 0); 134Debug.Assert(result.LineBreaks >= 0); 158Debug.Assert(Options.UseTabs); 171Debug.Assert((indentation / Options.TabSize) == result.Tab); 172Debug.Assert((indentation % Options.TabSize) == result.Space);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (3)
556Debug.Assert(previousToken != default); 557Debug.Assert(currentToken != default); 558Debug.Assert(previousToken.FullSpan.End == currentToken.FullSpan.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
93Debug.Assert(_options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents) != _options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
365System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
326Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
125Debug.Assert(oldNode.Kind() == newNode.Kind());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
865Debug.Assert(memberDeclaration.Kind() == SyntaxKind.IncompleteMember); 875Debug.Fail("Unexpected node type " + node.Kind()); 912Debug.Assert(topLevel || methodLevel);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
820Debug.Assert(rewrittenBitwiseNotExpression.Kind() == SyntaxKind.BitwiseNotExpression); 1308Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1364Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1393Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1573Debug.Assert(!rewrittenType.IsReferenceType && !IsIntrinsicOrEnum(rewrittenType));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (12)
73Debug.Assert(expression != null); 106Debug.Assert(speculativeSemanticModel != null || 128Debug.Assert(semanticModel.ParentModel != null); 129Debug.Assert(!semanticModel.ParentModel.IsSpeculativeSemanticModel); 181Debug.Assert(nodeToSpeculate is ExpressionSyntax); 212Debug.Assert(originalParams.Count == replacedParams.Count); 277Debug.Assert(originalIdentifierNodes.Any()); 278Debug.Assert(originalIdentifierNodes.Count() == replacedIdentifierNodes.Count()); 297Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 298Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 372Debug.Assert(newExpression.WhenTrue == previousReplacedNode); 378Debug.Assert(newExpression.WhenFalse == previousReplacedNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
61Debug.Assert(node.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
95Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
src\50a3a051b0fef0d6\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
242Debug.Assert(IsDiscardDeclaration(variable));
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
99Debug.Assert(nextStatement.Kind() is SyntaxKind.ThrowStatement or SyntaxKind.ReturnStatement);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (6)
85Debug.Assert(SyntaxFacts.IsAssignmentExpression(nodeToGenerate)); 86Debug.Assert(_assignmentTarget != null); 144Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 149Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 207Debug.Assert(statements.Count is 1 or 2); 208Debug.Assert(!statements[0].IsKind(SyntaxKind.BreakStatement));
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
82Debug.Assert(leftSymbol.Equals(rightSymbol));
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
64Debug.Assert(diagnostics.Length == 1);
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
50Debug.Fail("The diagnostic can only be produced in context of a deconstruction-assignment, deconstruction-foreach or deconstruction-positionalpattern"); 101Debug.Assert(!codeActions.IsDefault);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
63Debug.Assert(diagnostic.Properties[Constants.Kind] == Constants.SingleIfStatementForm);
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
83Debug.Assert(addAsyncModifier || node is MethodDeclarationSyntax);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (3)
70Debug.Fail("Could not find close brace in fixer"); 77Debug.Fail("Could not find previous close brace in fixer"); 84Debug.Fail("Could not match analyzer pattern");
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
72Debug.Fail("Couldn't find statement in fixer");
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67Debug.Assert(node.Kind() is SyntaxKind.IsExpression or SyntaxKind.IsPatternExpression);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (2)
86Debug.Fail($"Unexpected node kind for local/parameter declaration or reference: '{node.Kind()}'"); 205Debug.Fail($"Unexpected kind for originalCompoundAssignment: {originalCompoundAssignment.Kind()}");
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
188Debug.Assert(typeSymbol.IsTupleType); 190Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
240Debug.Assert(method.ExplicitInterfaceImplementations.Any() || method.IsOverride);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
130Debug.Assert(!endOfLine.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
132Debug.Assert(oldUsings.Count == newUsings.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
77Debug.Assert(_seenContextNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1235Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null"); 1782Debug.Assert(expressionOpt != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
205Debug.Assert(block.Statements.Count == 0); 240Debug.Assert(IsExpressionBody(body));
Microsoft.CodeAnalysis.CSharp.Features (144)
BraceCompletion\AbstractCurlyBraceOrBracketCompletionService.cs (2)
145Debug.Assert(desiredCaretLine.GetFirstNonWhitespacePosition() == null, "the line between the formatted braces is not empty"); 284Debug.Assert(IsValidClosingBraceToken(closeBraceToken));
BraceCompletion\CurlyBraceCompletionService.cs (1)
109Debug.Assert(s_instances[(int)indentStyle]._indentStyle == indentStyle);
ChangeSignature\CSharpChangeSignatureService.cs (1)
525Debug.Assert(false, "Unknown reference location");
ChangeSignature\UnifiedArgumentSyntax.cs (2)
19Debug.Assert(argument.Kind() is SyntaxKind.Argument or SyntaxKind.AttributeArgument); 41Debug.Assert(nameColonSyntax is NameColonSyntax);
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.cs (1)
154Debug.Fail("Unexpected state?");
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (1)
35Debug.Assert(fixAllContext.Scope == RefactorAllScope.Solution);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (3)
356Debug.Assert(annotatedNodesOrTokens.Count == 1, "Only a single variable declarator should have been annotated."); 363Debug.Assert(variableDeclaration.Variables.Count > 1); 364Debug.Assert(variableDeclaration.Variables.Contains(variableDeclarator));
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (5)
243Debug.Assert(!declaredNamespaceParts.IsDefault && !targetNamespaceParts.IsDefault); 249Debug.Assert(IsGlobalNamespace(declaredNamespaceParts)); 320Debug.Assert(!compilationUnit.Members.Any(m => m is BaseNamespaceDeclarationSyntax)); 423Debug.Assert(part.Length > 0); 436Debug.Assert(part.Length > 0);
CodeRefactorings\UseExplicitOrImplicitType\AbstractUseTypeCodeRefactoringProvider.cs (1)
41Debug.Assert(declaration.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
CodeRefactorings\UseRecursivePatterns\UseRecursivePatternsCodeRefactoringProvider.cs (4)
108Debug.Assert(leftTarget == isPatternExpression.Pattern); 109Debug.Assert(leftReceiver == isPatternExpression.Expression); 324Debug.Assert(containingPattern.Kind() is SyntaxKind.VarPattern or SyntaxKind.DeclarationPattern or SyntaxKind.RecursivePattern); 382Debug.Assert(!names.IsDefaultOrEmpty);
Completion\CompletionProviders\ExplicitInterfaceTypeCompletionProvider.cs (1)
105Debug.Assert(IsClassOrStructOrInterfaceOrRecord(typeDeclaration));
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
164Debug.Assert(!chars.IsDefault);
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (3)
45Debug.Assert(whenClause == null || section.Labels.Length == 1, "We shouldn't have guards when we're combining multiple cases into a single arm"); 50Debug.Assert(label.Guards.Length == 0, "We shouldn't have guards when we're combining multiple cases into a single arm"); 125Debug.Assert(operation.SemanticModel is not null);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
150Debug.Assert(equivalenceKey != null);
Debugging\BreakpointResolver.cs (1)
48Debug.Assert(text != null);
Diagnostics\Analyzers\CSharpSimplifyTypeNamesDiagnosticAnalyzer.cs (1)
53Debug.Assert(context.CodeBlock.DescendantNodesAndSelf().Contains(root));
EditAndContinue\BreakpointSpans.cs (5)
124Debug.Assert(startFallbackOpt != default || endOpt != default); 486Debug.Assert(typeDeclaration.ParameterList != null); 492Debug.Assert(typeDeclaration.ParameterList != null); 973Debug.Assert(((ArrowExpressionClauseSyntax)parent).Expression == expression); 977Debug.Assert(((SwitchExpressionArmSyntax)parent).Expression == expression);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (37)
113Debug.Assert(((PropertyDeclarationSyntax)current).Initializer != null); 136Debug.Assert(current.Parent.IsKind(SyntaxKind.VariableDeclaration)); 160Debug.Assert(current.Parent.IsKind(SyntaxKind.CompilationUnit)); 221Debug.Assert(!isBody); 229Debug.Assert(position == ((DoStatementSyntax)node).WhileKeyword.SpanStart); 230Debug.Assert(!isBody); 237Debug.Assert(position == ((PropertyDeclarationSyntax)node).Initializer!.SpanStart); 245Debug.Assert(!isBody); 265Debug.Assert(span.End == switchExpression.CloseBraceToken.Span.End); 273Debug.Assert(position == switchExpression.Span.Start); 288Debug.Assert(position == ((SwitchExpressionArmSyntax)node).Expression.SpanStart); 289Debug.Assert(!isBody); 422Debug.Assert(oldBody is ExpressionSyntax or BlockSyntax); 423Debug.Assert(newBody is ExpressionSyntax or BlockSyntax); 585Debug.Assert(statementPart is DefaultStatementPart or (int)BlockPart.OpenBrace or (int)BlockPart.CloseBrace); 605Debug.Assert(statementPart == DefaultStatementPart); 614Debug.Assert(statementPart == DefaultStatementPart); 637Debug.Assert(statementPart == DefaultStatementPart); 657Debug.Assert(statementPart == DefaultStatementPart); 1114Debug.Assert(matchingNewContainingMemberOrType == null); 1289Debug.Assert(oldCopyConstructor != null || newCopyConstructor != null); 1307Debug.Assert(node.Parent.IsKind(SyntaxKind.AccessorList)); 1356Debug.Assert(oldNode.RawKind == newNode.RawKind); 1357Debug.Assert(SupportsMove(oldNode)); 1358Debug.Assert(SupportsMove(newNode)); 1416Debug.Assert(node is null or ParameterSyntax or TypeParameterSyntax or TypeParameterConstraintClauseSyntax); 1423Debug.Assert(otherNode != null); 1570Debug.Assert(oldParameters.Length is 1 or 2); 1571Debug.Assert(newParameters.Length is 1 or 2); 1942Debug.Assert(ordinal >= 0); 1950Debug.Assert(ordinal == 0); 2268Debug.Assert(((CommonForEachStatementSyntax)node).AwaitKeyword.IsKind(SyntaxKind.AwaitKeyword)); 2526Debug.Assert(IsMember(newSymbol)); 2630Debug.Assert(current.Parent != null); 2646Debug.Assert(edit.Kind != EditKind.Update || edit.OldNode.RawKind == edit.NewNode.RawKind); 2782Debug.Assert(awaitExpression.IsKind(SyntaxKind.AwaitExpression)); 2892Debug.Assert(newActiveStatement.IsKind(SyntaxKind.WhenClause));
EditAndContinue\DeclarationBody\InstanceConstructorDeclarationBody.cs (3)
51Debug.Assert(partnerCtorBody == null || partnerCtorBody.HasExplicitInitializer); 61Debug.Assert(ExplicitBody != null); 64Debug.Assert(partnerCtorBody == null || partnerCtorBody.ExplicitBody != null);
EditAndContinue\DeclarationBody\PropertyOrIndexerAccessorDeclarationBody.cs (3)
84Debug.Assert(partnerDeclarationBody is null or PropertyOrIndexerAccessorDeclarationBody { HeaderActiveStatement: not null }); 91Debug.Assert(ExplicitBody != null); 92Debug.Assert(partnerDeclarationBody is null or PropertyOrIndexerAccessorDeclarationBody { ExplicitBody: not null });
EditAndContinue\SyntaxComparer.cs (4)
1520Debug.Assert(GetLabel(oldNode) == GetLabel(newNode) && GetLabel(oldNode) != IgnoredNode); 1556Debug.Assert(newNodeOrToken.IsToken == oldNodeOrToken.IsToken); 1565Debug.Assert(!SyntaxFactory.AreEquivalent(leftToken, rightToken) || distance == ExactMatchDist); 1573Debug.Assert(!SyntaxFactory.AreEquivalent(leftNode, rightNode) || distance == ExactMatchDist);
EditAndContinue\SyntaxUtilities.cs (3)
95Debug.Assert(allowLambda); 96Debug.Assert(syntax is ExpressionSyntax or BlockSyntax); 130Debug.Assert(false);
GenerateType\CSharpGenerateTypeService.cs (2)
328Debug.Assert(nameOrMemberAccessExpression.IsParentKind(SyntaxKind.SimpleMemberAccessExpression)); 627Debug.Assert(name is SimpleNameSyntax);
Highlighting\KeywordHighlighters\LoopHighlighter.cs (1)
84Debug.Assert(highlightBreaks || highlightContinues || labelName != null);
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
62Debug.Assert(highlightBreaks || highlightGotos || labelName != null);
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (3)
30Debug.Assert(parameters.Length >= 1); 31Debug.Assert(fieldsOrProperties.Length >= 1); 32Debug.Assert(parameters.Length == fieldsOrProperties.Length);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
312Debug.Assert(matches.Contains(expression)); 378Debug.Assert(matches.Contains(expression));
NavigationBar\CSharpNavigationBarItemService.cs (1)
100Debug.Assert(member is IMethodSymbol { PartialDefinitionPart: null } or IPropertySymbol { PartialDefinitionPart: null } or IEventSymbol { PartialDefinitionPart: null },
Organizing\Organizers\MemberDeclarationsOrganizer.cs (1)
44Debug.Assert(originalList.Count == finalList.Count);
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
105Debug.Assert(type.TypeKind == TypeKind.Delegate); 106Debug.Assert(objectCreationExpression.ArgumentList is not null);
Snippets\AbstractCSharpForLoopSnippetProvider.cs (1)
100Debug.Assert(inlineExpressionType is not null);
SolutionExplorer\CSharpSolutionExplorerSymbolTreeItemProvider.cs (1)
520Debug.Fail("Unhandled type: " + type.GetType().FullName);
src\984dec8966cb7923\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
135Debug.Assert(labels.Count >= 1);
src\roslyn\src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
273Debug.Assert(ifStatementOrElseClause.IsKind(SyntaxKind.IfStatement));
src\roslyn\src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
61Debug.Assert(IsBinaryLike(binaryLike));
src\roslyn\src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
33Debug.Assert(IsBinaryLike(binaryPattern));
src\roslyn\src\Analyzers\CSharp\Analyzers\RemoveUnusedParametersAndValues\CSharpRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (2)
92Debug.Assert(recursivePattern.Designation is not null, "If we got to this point variable designation cannot be null"); 96Debug.Assert(listPattern.Designation is not null, "If we got to this point variable designation cannot be null");
src\roslyn\src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
189Debug.Assert(initializer.Parent is EqualsValueClauseSyntax);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
70Debug.Assert(IsIntIndexingMethod(method)); 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\roslyn\src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
132Debug.Assert(IsTwoArgumentSliceLikeMethod(sliceLikeMethod) || IsOneArgumentSliceLikeMethod(sliceLikeMethod));
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePatternMatching\CSharpAsAndNullCheckDiagnosticAnalyzer.Analyzer.cs (2)
42Debug.Assert(localStatement.IsKind(SyntaxKind.LocalDeclarationStatement)); 43Debug.Assert(enclosingBlock.Kind() is SyntaxKind.Block or SyntaxKind.SwitchSection);
src\roslyn\src\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
377Debug.Assert(constructorDeclaration.Initializer.Kind() == SyntaxKind.ThisConstructorInitializer);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
99Debug.Assert(nextStatement.Kind() is SyntaxKind.ThrowStatement or SyntaxKind.ReturnStatement);
src\roslyn\src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (6)
85Debug.Assert(SyntaxFacts.IsAssignmentExpression(nodeToGenerate)); 86Debug.Assert(_assignmentTarget != null); 144Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 149Debug.Assert(whenClauseUnused == null, "We should not have offered to convert multiple cases if any have a when clause"); 207Debug.Assert(statements.Count is 1 or 2); 208Debug.Assert(!statements[0].IsKind(SyntaxKind.BreakStatement));
src\roslyn\src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
82Debug.Assert(leftSymbol.Equals(rightSymbol));
src\roslyn\src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
64Debug.Assert(diagnostics.Length == 1);
src\roslyn\src\Analyzers\CSharp\CodeFixes\GenerateMethod\GenerateDeconstructMethodCodeFixProvider.cs (2)
50Debug.Fail("The diagnostic can only be produced in context of a deconstruction-assignment, deconstruction-foreach or deconstruction-positionalpattern"); 101Debug.Assert(!codeActions.IsDefault);
src\roslyn\src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
63Debug.Assert(diagnostic.Properties[Constants.Kind] == Constants.SingleIfStatementForm);
src\roslyn\src\Analyzers\CSharp\CodeFixes\MakeMethodAsynchronous\CSharpMakeMethodAsynchronousCodeFixProvider.cs (1)
83Debug.Assert(addAsyncModifier || node is MethodDeclarationSyntax);
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\ConsecutiveBracePlacement\ConsecutiveBracePlacementCodeFixProvider.cs (3)
70Debug.Fail("Could not find close brace in fixer"); 77Debug.Fail("Could not find previous close brace in fixer"); 84Debug.Fail("Could not match analyzer pattern");
src\roslyn\src\Analyzers\CSharp\CodeFixes\NewLines\EmbeddedStatementPlacement\EmbeddedStatementPlacementCodeFixProvider.cs (1)
72Debug.Fail("Couldn't find statement in fixer");
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
67Debug.Assert(node.Kind() is SyntaxKind.IsExpression or SyntaxKind.IsPatternExpression);
src\roslyn\src\Analyzers\CSharp\CodeFixes\RemoveUnusedParametersAndValues\CSharpRemoveUnusedValuesCodeFixProvider.cs (2)
86Debug.Fail($"Unexpected node kind for local/parameter declaration or reference: '{node.Kind()}'"); 205Debug.Fail($"Unexpected kind for originalCompoundAssignment: {originalCompoundAssignment.Kind()}");
src\roslyn\src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
188Debug.Assert(typeSymbol.IsTupleType); 190Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\roslyn\src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
107Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
src\roslyn\src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (7)
55Debug.Assert(lambdaBody.Parent is object); 63Debug.Assert(lambda.IsKind(SyntaxKind.LocalFunctionStatement)); 66Debug.Assert(IsLambda(lambda)); 75Debug.Assert(oldBody.Parent is object); 107Debug.Assert(oldJoin.LeftExpression == oldBody || oldJoin.RightExpression == oldBody); 113Debug.Assert(oldGroup.GroupExpression == oldBody || oldGroup.ByExpression == oldBody); 230Debug.Assert(selectOrGroupClause.Parent!.Parent is object);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
194Debug.Assert(equivalenceKey != null);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
40Debug.Assert(diagnostics.Length == 1);
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (10)
Microsoft.CodeQuality.Analyzers\Maintainability\CSharpUseCrossPlatformIntrinsicsFixer.cs (4)
36Debug.Fail($"Found unexpected node kind: {currentNode.RawKind}"); 44Debug.Fail($"Found unexpected number of arguments for binary operator replacement: {arguments.Count}"); 60Debug.Fail($"Found unexpected node kind: {currentNode.RawKind}"); 68Debug.Fail($"Found unexpected number of arguments for unary operator replacement: {arguments.Count}");
Microsoft.NetCore.Analyzers\Performance\CSharpPreferHashDataOverComputeHash.Fixer.cs (1)
111Debug.Fail("there is only 3 type of ComputeHash");
Microsoft.NetCore.Analyzers\Performance\CSharpRecommendCaseInsensitiveStringComparisonFixer.cs (1)
108Debug.Assert(mainInvocationInstance != null);
Microsoft.NetCore.Analyzers\Performance\CSharpUseSearchValues.Fixer.cs (2)
79Debug.Assert(invocation.Instance is not null); 96Debug.Assert(namedType.Name.Contains("Span", StringComparison.Ordinal), namedType.Name);
Microsoft.NetCore.Analyzers\Runtime\CSharpSpecifyCultureForToLowerAndToUpper.cs (1)
18Debug.Assert(node.IsKind(SyntaxKind.InvocationExpression));
Microsoft.NetCore.Analyzers\Runtime\CSharpUseOrdinalStringComparison.cs (1)
18Debug.Assert(invocationNode.IsKind(SyntaxKind.InvocationExpression));
Microsoft.CodeAnalysis.CSharp.Workspaces (101)
Classification\Worker.cs (1)
69Debug.Assert(nodeOrToken.IsNode || nodeOrToken.IsToken);
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
636Debug.Assert(IsExtensionMethod(methodDeclaration));
Recommendations\CSharpRecommendationServiceRunner.cs (1)
892Debug.Assert(!excludeInstance || !excludeStatic);
Simplification\CSharpSimplificationService.cs (1)
205Debug.Assert(tuple.IsKind(SyntaxKind.TupleExpression));
Simplification\CSharpSimplificationService.Expander.cs (4)
591Debug.Assert(name.StartsWith(originalSimpleName.Identifier.ValueText, StringComparison.Ordinal)); 894Debug.Assert(!replaceNode || rewrittenNode.Kind() == SyntaxKind.IdentifierName); 966Debug.Assert(rewrittenNode is SimpleNameSyntax); 1009Debug.Assert(false, "This method is used only replacing the '<' and '>' to '{' and '}' respectively");
Simplification\Reducers\CSharpExtensionMethodReducer.cs (1)
96Debug.Assert(false, "The expression kind is not MemberAccessExpression or IdentifierName or GenericName to be converted to Member Access Expression for Ext Method Reduction");
src\50a3a051b0fef0d6\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
242Debug.Assert(IsDiscardDeclaration(variable));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (17)
59Debug.Assert(!token.ContainsDiagnostics); 235Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 241Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 311Debug.Assert(tokenText[index] == '\\'); 325Debug.Assert(tokenText[index] == '\\'); 360Debug.Assert(tokenText[index] == '\\'); 370Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 383Debug.Assert(tokenText[index] == '\\'); 394Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 403Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 414Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 427Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 448Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 457Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 471Debug.Assert(character == 'x'); 477Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 504Debug.Assert(IsHexDigit(c));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
44Debug.Assert(typeSymbol.GetParameters().IsDefaultOrEmpty, "If GetParameters extension handles record, we can remove the handling here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
827Debug.Fail("Unhandled pattern type");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxKindExtensions.cs (1)
73Debug.Fail($"Unhandled compound assignment kind: {syntaxKind}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
155Debug.Assert(trivia.Kind() == SyntaxKind.WhitespaceTrivia); 156Debug.Assert(trivia.Width() == trivia.FullWidth());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
48Debug.Assert(trivia.ToString() == trivia.ToFullString()); 138Debug.Assert(trivia.ToString() == trivia.ToFullString()); 323Debug.Assert(trivia.HasStructure);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.cs (1)
74Debug.Assert(this.SecondTokenIsFirstTokenOnLine);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (11)
34Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 42Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 54Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 62Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 74Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 82Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 133Debug.Assert(result.Tab >= 0); 134Debug.Assert(result.LineBreaks >= 0); 158Debug.Assert(Options.UseTabs); 171Debug.Assert((indentation / Options.TabSize) == result.Tab); 172Debug.Assert((indentation % Options.TabSize) == result.Space);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (3)
556Debug.Assert(previousToken != default); 557Debug.Assert(currentToken != default); 558Debug.Assert(previousToken.FullSpan.End == currentToken.FullSpan.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
93Debug.Assert(_options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents) != _options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
365System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
326Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
125Debug.Assert(oldNode.Kind() == newNode.Kind());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
865Debug.Assert(memberDeclaration.Kind() == SyntaxKind.IncompleteMember); 875Debug.Fail("Unexpected node type " + node.Kind()); 912Debug.Assert(topLevel || methodLevel);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
820Debug.Assert(rewrittenBitwiseNotExpression.Kind() == SyntaxKind.BitwiseNotExpression); 1308Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1364Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1393Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1573Debug.Assert(!rewrittenType.IsReferenceType && !IsIntrinsicOrEnum(rewrittenType));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (12)
73Debug.Assert(expression != null); 106Debug.Assert(speculativeSemanticModel != null || 128Debug.Assert(semanticModel.ParentModel != null); 129Debug.Assert(!semanticModel.ParentModel.IsSpeculativeSemanticModel); 181Debug.Assert(nodeToSpeculate is ExpressionSyntax); 212Debug.Assert(originalParams.Count == replacedParams.Count); 277Debug.Assert(originalIdentifierNodes.Any()); 278Debug.Assert(originalIdentifierNodes.Count() == replacedIdentifierNodes.Count()); 297Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 298Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 372Debug.Assert(newExpression.WhenTrue == previousReplacedNode); 378Debug.Assert(newExpression.WhenFalse == previousReplacedNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
61Debug.Assert(node.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
95Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
240Debug.Assert(method.ExplicitInterfaceImplementations.Any() || method.IsOverride);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
130Debug.Assert(!endOfLine.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
132Debug.Assert(oldUsings.Count == newUsings.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
77Debug.Assert(_seenContextNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1235Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null"); 1782Debug.Assert(expressionOpt != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
205Debug.Assert(block.Statements.Count == 0); 240Debug.Assert(IsExpressionBody(body));
SyncedSource\FileBasedPrograms\FileLevelDirectiveHelpers.cs (7)
105Debug.Assert(previousWhiteSpaceSpan.IsEmpty); 134Debug.Assert(!(parts.Length > 2)); 355Debug.Assert(secondPart.Length == 0, 749Debug.Assert(ItemType is null); 926Debug.Assert(NamedDirectiveComparer.Instance.Equals(existingDirective, directive)); 927Debug.Assert(existingDirective is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package); 928Debug.Assert(directive is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package);
SyncedSource\FileBasedPrograms\VirtualProjectBuilder.cs (9)
70Debug.Assert(ExternalHelpers.IsPathFullyQualified(entryPointFileFullPath)); 396Debug.Assert(compileItem.Length == 1); 531Debug.Assert(refDirective.ResolvedPath is not null); 593Debug.Assert(userSecretsId == null || !isVirtualProject); 622Debug.Assert(!string.IsNullOrWhiteSpace(artifactsPath)); 623Debug.Assert(entryPointFilePath is not null); 919Debug.Assert(processedDirectives + directives.OfType<CSharpDirective.Shebang>().Count() == directives.Length); 923Debug.Assert(entryPointFilePath is not null); 954Debug.Assert(firstSdkName == defaultSdkName && firstSdkVersion == null);
Microsoft.CodeAnalysis.Extensions.Package (163)
Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Api\HotReloadMSBuildWorkspace.cs (2)
180Debug.Assert(project?.FilePath != null); 183Debug.Assert(oldText.Encoding != null);
Microsoft.CodeAnalysis.Features (558)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (2)
155Debug.Assert(equivalenceKey != null); 164Debug.Assert(banner.Length > 0);
AddImport\AbstractAddImportCodeRefactoringProvider.cs (2)
196Debug.Assert(qualifiedTypeReference is TQualifiedNameSyntax or TMemberAccessExpressionSyntax); 254Debug.Assert(rightSideName != null);
AddImport\AbstractAddImportFeatureService.cs (1)
612Debug.Assert(syntaxFactsService.IsAwaitExpression(awaitExpression));
AddImport\SearchScopes\SearchScope.cs (1)
85Debug.Assert(areSimilar);
AddImport\SymbolResult.cs (1)
43Debug.Assert(DesiredNameDiffersFromSourceName());
BraceCompletion\AbstractBraceCompletionService.cs (1)
58Debug.Assert(context.HasCompletionForOpeningBrace(OpeningBrace));
ChangeSignature\AbstractChangeSignatureService.cs (1)
450Debug.Assert(false, "Change Signature: Attempted to modify node twice with different semantic parameters.");
CodeFixes\Configuration\ConfigurationUpdater.cs (7)
85Debug.Assert(configurationKind != ConfigurationKind.OptionValue || !string.IsNullOrEmpty(newOptionValueOpt)); 86Debug.Assert(!string.IsNullOrEmpty(newSeverity)); 87Debug.Assert(diagnosticToConfigure != null ^ categoryToBulkConfigure != null); 88Debug.Assert((categoryToBulkConfigure != null) == (configurationKind == ConfigurationKind.BulkConfigure)); 217Debug.Assert(!codeStyleOptionValues.IsEmpty()); 236Debug.Assert(!string.IsNullOrEmpty(optionName)); 237Debug.Assert(optionValue != null);
CodeFixes\Service\CodeFixService.cs (1)
471Debug.Assert(!isInteractive);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (3)
116Debug.Assert(!diagnostics.IsDefault); 319Debug.Assert(orderedDocuments.Length > 1); 330Debug.Assert(currentDocument.Id == oldDocument.Id);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (2)
62Debug.Assert(unambiguousFixes.All(d => d.Kind == AddImportFixKind.ProjectSymbol)); 169Debug.Assert(textChanges.Last().Span.IntersectsWith(insertSpan.End));
CodeRefactorings\MoveType\AbstractMoveTypeService.cs (1)
133Debug.Assert(actions.Count != 0, "No code actions found for MoveType Refactoring");
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (2)
116Debug.Assert(document.Name != FileName, $"New document name is same as old document name:{FileName}"); 279Debug.Assert(!removableCandidates.Contains(ancestor));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (5)
163Debug.Assert(namespaces.Length == originalNamespaceDeclarations.Length); 464Debug.Assert(!PathUtilities.PathsEqual(refLocation.Document.FilePath, document.FilePath)); 558Debug.Assert(newNamespace != null); 596Debug.Assert(containersToAddImports.Length > 0); 751Debug.Assert(document.Id == refLoc.Document.Id);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (2)
53Debug.Assert(state.RelativeDeclaredNamespace != null); 65Debug.Assert(parts.IsEmpty || parts.Any(static s => s.IndexOfAny(Path.GetInvalidPathChars()) < 0));
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
202Debug.Assert(relativeTo != null && @namespace != null);
Completion\CommonCompletionProvider.cs (2)
36Debug.Fail("For backwards API compat only, should not be called"); 58Debug.Fail("For backwards API compat only, should not be called");
Completion\CompletionContext.cs (1)
95Debug.Assert(!Provider.IsExpandItemProvider);
Completion\CompletionHelper.cs (1)
273Debug.Assert(isItem1Expanded && match1.Kind == PatternMatchKind.Exact && !isItem2Expanded && match2.Kind > PatternMatchKind.Prefix ||
Completion\CompletionService_GetCompletions.cs (4)
150Debug.Assert(ValidatePossibleTriggerCharacterSet(trigger.Kind, triggeredProviders, document, text, caretPosition, options)); 227Debug.Assert(lspProvider.TriggerCharacters.Contains(character), 266Debug.Assert(!completionContexts.IsDefaultOrEmpty); 275Debug.Assert(item != null);
Completion\CompletionService.cs (2)
75Debug.Fail("For backwards API compat only, should not be called"); 255Debug.Assert(item.Span == change.TextChange.Span || item.IsComplexTextEdit);
Completion\FileSystemCompletionHelper.cs (7)
43Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 44Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 68Debug.Assert(PathUtilities.IsAbsolute(fullDirectoryPath)); 75Debug.Assert(PathUtilities.IsAbsolute(fullDirectoryPath)); 82Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 216Debug.Assert(PathUtilities.IsAbsolute(fullDirectoryPath));
Completion\Providers\AbstractAwaitCompletionProvider.cs (1)
191Debug.Fail("Expected non-null value for declaration.");
Completion\Providers\AbstractMemberInsertingCompletionProvider.cs (1)
242Debug.Assert(targetSelectionSpan.End < destinationSpan.Start);
Completion\Providers\AbstractObjectInitializerCompletionProvider.cs (1)
113Debug.Assert(!fieldOrProperty.IsWriteableFieldOrProperty(), "Assertion failed - expected writable field/property check before calling this method.");
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
115Debug.Assert(!attributeItem.TryGetProperty(AttributeFullName, out var _));
Completion\Providers\Scripting\AbstractDirectivePathCompletionProvider.cs (1)
193Debug.Assert(result == null || PathUtilities.IsAbsolute(result));
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (1)
25Debug.Assert(itemRules != null);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (3)
83Debug.Assert(anonymousObject != null); 84Debug.Assert(anonymousType != null); 204Debug.Fail("We should always be able to get an anonymous type for any anonymous creation node.");
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.cs (1)
171Debug.Fail("How did we not get any labels?");
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
53Debug.Assert(root is object); // we didn't remove the root
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
204Debug.Assert(remainingArgCount > 0);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (6)
268Debug.Assert(tupleExprOrTypeNode != null); 269Debug.Assert(tupleType != null); 370Debug.Assert(documentToUpdate.NodesToUpdate.IsDefault || 521Debug.Assert(containingType != null, 651Debug.Fail("We should always be able to get an tuple type for any tuple expression node."); 764Debug.Fail("We should always be able to get an tuple type for any tuple type syntax node.");
Copilot\IProposalAdjusterService.cs (1)
118Debug.Assert(allowableAdjustments is not null);
Debugging\AbstractBreakpointResolver.cs (2)
174Debug.Assert(type != null); 175Debug.Assert(names.Length >= 2);
Debugging\DebugInformationReaderProvider.cs (1)
97Debug.Assert(OperatingSystem.IsWindows());
Diagnostics\DiagnosticsUpdatedArgs.cs (2)
34Debug.Assert(diagnostics.All(d => d.ProjectId == projectId && d.DocumentId == documentId)); 35Debug.Assert(kind != DiagnosticsUpdatedKind.DiagnosticsRemoved || diagnostics.IsEmpty);
Diagnostics\Service\DiagnosticAnalyzerService_CoreAnalyze.cs (2)
36Debug.Assert(getTelemetryInfo || result.TelemetryInfo.IsEmpty); 109Debug.Assert(documentAnalysisScope.Analyzers.ToSet().IsSubsetOf(compilationWithAnalyzers.Analyzers));
Diagnostics\Service\DiagnosticAnalyzerService_GetDiagnosticsForSpan.cs (2)
318Debug.Assert(!incrementalAnalysis || kind == AnalysisKind.Semantic); 319Debug.Assert(!incrementalAnalysis || analyzers.All(analyzer => analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis()));
Diagnostics\Service\DiagnosticAnalyzerService.HostAnalyzerInfo.cs (2)
174Debug.Assert(analyzer != FileContentLoadAnalyzer.Instance && analyzer != GeneratorDiagnosticsPlaceholderAnalyzer.Instance); 183Debug.Assert(analyzer != FileContentLoadAnalyzer.Instance && analyzer != GeneratorDiagnosticsPlaceholderAnalyzer.Instance);
Diagnostics\Service\DiagnosticAnalyzerService.IncrementalMemberEditAnalyzer.cs (4)
63Debug.Assert(!analysisScope.Span.HasValue); 66Debug.Assert(analyzers.All(analyzer => analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis())); 179Debug.Assert(changedMember != null); 180Debug.Assert(analysisScope.Kind == AnalysisKind.Semantic);
Diagnostics\Service\DocumentAnalysisExecutor.cs (3)
159Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, compilation).Count()); 160Debug.Assert(diagnostics.Length == Extensions.ConvertToLocalDiagnostics(diags, textDocument, span).Length); 272Debug.Assert(isCompilerAnalyzer);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (5)
173Debug.Assert(lines.Count >= 1); 327Debug.Assert(!line.IsEmptyOrWhitespace()); 330Debug.Assert(lines.Count >= 1); 337Debug.Assert(line.Start + lineOffset == startPosition); 435Debug.Assert(trimmedPreviousLine.StartsWith(ExteriorTriviaText), "Unexpected: previous line does not begin with doc comment exterior trivia.");
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
253Debug.Assert(solution.WorkspaceKind is WorkspaceKind.Interactive or WorkspaceKind.MiscellaneousFiles);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (77)
670Debug.Assert(newActiveStatements.All(a => a != null)); 960Debug.Assert(!newActiveStatementSpans.IsDefault); 961Debug.Assert(oldActiveStatements.Length == newActiveStatements.Count); 962Debug.Assert(oldActiveStatements.Length == newExceptionRegions.Count); 1126Debug.Assert(!newActiveStatementSpans.IsDefault); 1127Debug.Assert(newActiveStatementSpans.IsEmpty || oldActiveStatements.Length == newActiveStatementSpans.Length); 1128Debug.Assert(oldActiveStatements.IsEmpty || oldActiveStatements.Length == newActiveStatements.Count); 1129Debug.Assert(newActiveStatements.Count == newExceptionRegions.Count); 1130Debug.Assert(oldMemberBody != null || newMemberBody != null); 1172Debug.Assert(oldDeclaration != null); 1178Debug.Assert(IsDeclarationWithSharedBody(oldDeclaration, oldMember)); 1192Debug.Assert(oldMemberBody != null); 1319Debug.Assert(oldMemberBody != null); 1320Debug.Assert(oldDeclaration != null); 1342Debug.Assert(lazyActiveOrMatchedLambdas != null); 1358Debug.Assert(!enclosingBodyMap.Forward.IsEmpty()); 1402Debug.Assert(oldEnclosingLambdaBody != null); 1403Debug.Assert(lazyActiveOrMatchedLambdas != null); 1448Debug.Assert(newSpan != default); 1458Debug.Assert(IsDeclarationWithSharedBody(oldDeclaration, oldMember)); 1569Debug.Assert(oldAncestors.Count == newAncestors.Count); 1760Debug.Assert(node != null); 1878Debug.Assert(hasAncestor && newAncestor != null); 1892Debug.Assert(hasAncestor && newAncestor != null); 2247Debug.Assert(editMap[newNode] is EditKind.Update or EditKind.Insert); 2309Debug.Assert(currentSegment.path != null); 2310Debug.Assert(lastOldStartLine >= 0); 2487Debug.Assert(previousOldEndLine >= 0); 2716Debug.Assert(inBreakState || newActiveStatementSpans.IsEmpty); 2742Debug.Assert(edit.OldNode is null || edit.NewNode is null || IsNamespaceDeclaration(edit.OldNode) == IsNamespaceDeclaration(edit.NewNode)); 2754Debug.Assert(oldSymbol is INamedTypeSymbol); 2755Debug.Assert(newSymbol is INamedTypeSymbol); 2772Debug.Assert(newTypeDeclaration != null); 2971Debug.Assert(oldSymbol is INamedTypeSymbol); 3261Debug.Assert(newDeclaration != null); 3262Debug.Assert(oldProperty.ContainingType.IsRecord); 3263Debug.Assert(newProperty.ContainingType.IsRecord); 3267Debug.Assert(synthesizedProperty.IsSynthesizedAutoProperty()); 3268Debug.Assert(synthesizedProperty.SetMethod != null); 3340Debug.Assert(newSymbol != null); 3564Debug.Assert(IsConstructorWithMemberInitializers(oldSymbol, cancellationToken) == IsConstructorWithMemberInitializers(newSymbol, cancellationToken)); 3565Debug.Assert(IsDeclarationWithInitializer(oldDeclaration) == IsDeclarationWithInitializer(newDeclaration)); 3735Debug.Assert(oldSymbol != null); 3736Debug.Assert(newSymbol != null); 3759Debug.Assert(member is IPropertySymbol or IMethodSymbol); 4272Debug.Assert(oldBody == null || oldDeclaration != null && oldMemberBody != null); 4273Debug.Assert(newBody == null || newDeclaration != null && newMemberBody != null); 4458Debug.Assert(ReturnTypesEquivalent(oldField, newField, exact: false)); 4480Debug.Assert(oldImportData.BestFitMapping == newImportData.BestFitMapping || 4535Debug.Assert(ReturnTypesEquivalent(oldMethod, newMethod, exact: false)); 4559Debug.Assert(ReturnTypesEquivalent(oldType.DelegateInvokeMethod, newType.DelegateInvokeMethod, exact: false)); 4569Debug.Assert(ReturnTypesEquivalent(oldProperty, newProperty, exact: false)); 4583Debug.Assert(ReturnTypesEquivalent(oldEvent, newEvent, exact: false)); 4700Debug.Assert(ParameterTypesEquivalent(oldMember.GetParameters(), newMember.GetParameters(), exact: true)); 5099Debug.Assert(recordType.IsRecord); 5113Debug.Assert(record.IsRecord); 5200Debug.Assert(oldSymbol != null); 5347Debug.Assert(newSymbol != null); 5532Debug.Assert(oldBody != null); 5533Debug.Assert(newBody != null); 5667Debug.Assert(oldCtor == null || MemberOrDelegateSignaturesEquivalent(oldCtor, newCtor, exact: false)); 5674Debug.Assert(newCtor.Parameters.IsEmpty); 5872Debug.Assert(IsNestedFunction(newLambda) == IsNestedFunction(oldLambda)); 6446Debug.Assert(!parameter.IsThis); 6490Debug.Assert(parameterKey.Syntax != null); 6611Debug.Assert(oldCapture.Kind == newCapture.Kind); 6685Debug.Assert(IsNestedFunction(newLambda)); 6686Debug.Assert(IsNestedFunction(oldLambda)); 6746Debug.Assert(local.Kind is not SymbolKind.RangeVariable); 6758Debug.Assert(node != null); 6830Debug.Assert(rootNodes.Count == otherRootNodes.Count); 6846Debug.Assert(otherNode.SyntaxTree == otherRoot.SyntaxTree); 6847Debug.Assert(otherRoot.FullSpan.Contains(otherNode.SpanStart)); 6850Debug.Assert(otherNode.FullSpan.Length > 0); 6859Debug.Assert(otherNode.RawKind == rightNode.RawKind); 6863Debug.Assert(!leftChild.IsToken); 6908Debug.Assert(!self.FullSpan.Contains(position), "Position is valid. How could we not find a child?");
EditAndContinue\ActiveStatement.cs (1)
48Debug.Assert(!IsStale || !IsMethodUpToDate);
EditAndContinue\ActiveStatementsMap.cs (4)
51Debug.Assert(documentPathMap.All(entry => entry.Value.IsSorted(Comparer))); 176Debug.Assert(oldRoot.SyntaxTree == oldSyntaxTree); 233Debug.Assert(builder.IsEmpty); 244Debug.Assert(builder.IsSorted(Comparer<UnmappedActiveStatement>.Create((x, y) => x.UnmappedSpan.Start.CompareTo(y.UnmappedSpan.End))));
EditAndContinue\CommittedSolution.cs (1)
283Debug.Assert(_solution.ContainsProject(documentId.ProjectId));
EditAndContinue\DebuggingSession.cs (5)
167Debug.Assert(!_isDisposed); 280Debug.Assert(!project.IgnoreForEditAndContinue()); 761Debug.Assert(oldProject.SupportsEditAndContinue()); 762Debug.Assert(newProject.SupportsEditAndContinue()); 851Debug.Assert(spans.Count == documentIds.Length);
EditAndContinue\DocumentActiveStatementChanges.cs (1)
28Debug.Assert(oldSpans[i].ExceptionRegions.Spans.Length == newExceptionRegions[i].Length);
EditAndContinue\DocumentAnalysisResults.cs (21)
122Debug.Assert(!rudeEdits.IsDefault); 123Debug.Assert(hasBlockingRudeEdits == (!rudeEdits.IsDefault && rudeEdits.HasBlockingRudeEdits())); 127Debug.Assert(activeStatementsOpt.IsDefault); 128Debug.Assert(semanticEditsOpt.IsDefault); 129Debug.Assert(exceptionRegionsOpt.IsDefault); 130Debug.Assert(lineEditsOpt.IsDefault); 131Debug.Assert(syntaxError != null || hasBlockingRudeEdits || !hasChanges); 132Debug.Assert(requiredCapabilities == EditAndContinueCapabilities.None); 136Debug.Assert(!activeStatementsOpt.IsDefault); 137Debug.Assert(syntaxError == null); 141Debug.Assert(semanticEditsOpt.IsDefault); 142Debug.Assert(exceptionRegionsOpt.IsDefault); 143Debug.Assert(lineEditsOpt.IsDefault); 144Debug.Assert(requiredCapabilities == EditAndContinueCapabilities.None); 148Debug.Assert(!semanticEditsOpt.IsDefault); 149Debug.Assert(!exceptionRegionsOpt.IsDefault); 150Debug.Assert(!lineEditsOpt.IsDefault); 153Debug.Assert(lineEditsOpt.Select(edit => edit.FileName).Distinct().Count() == lineEditsOpt.Length); 156Debug.Assert(lineEditsOpt.All(documentLineEdits => documentLineEdits.LineUpdates.IsSorted(Comparer<SourceLineUpdate>.Create( 159Debug.Assert(exceptionRegionsOpt.Length == activeStatementsOpt.Length); 160Debug.Assert(requiredCapabilities != EditAndContinueCapabilities.None);
EditAndContinue\DocumentSemanticModel.cs (1)
29Debug.Assert(syntaxTree.GetText().Length == 0);
EditAndContinue\EditAndContinueDebugInfoReader.cs (2)
51Debug.Assert(symReader != null); 52Debug.Assert(version >= 1);
EditAndContinue\EditAndContinueDiagnosticDescriptors.cs (1)
51Debug.Assert(!isNoEffect || severity == DiagnosticSeverity.Warning);
EditAndContinue\EditAndContinueDocumentAnalysesCache.cs (3)
163Debug.Assert(newMappedDocumentActiveSpan.UnmappedDocumentId == null || newMappedDocumentActiveSpan.UnmappedDocumentId == newDocument.Id); 177Debug.Assert(oldDocument == null || oldDocument.Project == oldProject); 178Debug.Assert(newDocument == null || newDocument.Project == newProject);
EditAndContinue\EditSession.cs (17)
124Debug.Assert(emitResult.Success); 125Debug.Assert(emitResult.Baseline is not null); 335Debug.Assert(!oldProject.IgnoreForEditAndContinue()); 336Debug.Assert(!newProject.IgnoreForEditAndContinue()); 607Debug.Assert(oldProject.Id == newProject.Id); 829Debug.Assert(oldNames.Comparer == AssemblyIdentityComparer.SimpleNameComparer); 965Debug.Assert(m.MatchingNodes == first.MatchingNodes); 966Debug.Assert(m.RuntimeRudeEdits == first.RuntimeRudeEdits); 1277Debug.Assert(staleDocumentPath != null); 1690Debug.Assert(oldActiveStatements.Length == newExceptionRegions.Length); 1691Debug.Assert(newActiveStatements.Length == newExceptionRegions.Length); 1708Debug.Assert(!oldActiveStatement.IsStale); 1713Debug.Assert(string.Equals(oldSpan.Path, newSpan.Path, StringComparison.Ordinal)); 1716Debug.Assert(oldActiveStatement.IsMethodUpToDate == newActiveStatement.IsMethodUpToDate); 1798Debug.Assert(newSpan.Span.End.Line - newSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line); 1799Debug.Assert(region.OldSpan.Span.End.Line - region.OldSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line); 1800Debug.Assert(newSpan.Path == region.OldSpan.Path);
EditAndContinue\EditSessionTelemetry.cs (1)
158Debug.Assert(_capabilities == EditAndContinueCapabilities.None || _capabilities == capabilities);
EditAndContinue\EmitSolutionUpdateResults.cs (7)
67Debug.Assert(SyntaxError.DataLocation != null); 68Debug.Assert(SyntaxError.Message != null); 194Debug.Assert(Solution != null); 195Debug.Assert(SyntaxError.Location.SourceTree != null); 221Debug.Assert(!diagnostics.HasDuplicates(d => d.ProjectId)); 222Debug.Assert(diagnostics.Select(re => re.ProjectId).IsSorted()); 225Debug.Assert(diagnostics
EditAndContinue\ProjectChanges.cs (4)
46Debug.Assert(!semanticEdits.IsDefault); 47Debug.Assert(!lineChanges.IsDefault); 48Debug.Assert(!activeStatementChanges.IsDefault); 49Debug.Assert(requiredCapabilities != EditAndContinueCapabilities.None);
EditAndContinue\SemanticEditInfo.cs (5)
29Debug.Assert(runtimeRudeEdits == null || matchingNodes != null); 49Debug.Assert(kind == SemanticEditKind.Delete || deletedSymbolContainer == null); 63Debug.Assert(!symbol.IsPartialDefinition()); 73Debug.Assert(!symbol.IsPartialDefinition()); 86Debug.Assert(!symbol.IsPartialDefinition());
EditAndContinue\TraceLog.cs (3)
63Debug.Assert(document.FilePath != null); 64Debug.Assert(document.Project.FilePath != null); 109Debug.Assert(document.FilePath != null);
EmbeddedLanguages\DateAndTime\LanguageServices\DateAndTimeLanguageDetector.cs (1)
169Debug.Assert(argName != null || argIndex != null);
EmbeddedLanguages\Json\JsonLexer.cs (5)
50Debug.Assert(chars.Length > 0); 62Debug.Assert(Position < Text.Length); 277Debug.Assert(IsAt("//")); 298Debug.Assert(IsAt("/*")); 311Debug.Assert(Position == Text.Length);
EmbeddedLanguages\Json\JsonNodes.cs (18)
21Debug.Assert(sequence != null); 22Debug.Assert(endOfFileToken.Kind == JsonKind.EndOfFile); 68Debug.Assert(textToken.Kind == JsonKind.TextToken); 95Debug.Assert(openBraceToken.Kind == JsonKind.OpenBraceToken); 96Debug.Assert(closeBraceToken.Kind == JsonKind.CloseBraceToken); 132Debug.Assert(openBracketToken.Kind == JsonKind.OpenBracketToken); 133Debug.Assert(sequence != null); 134Debug.Assert(closeBracketToken.Kind == JsonKind.CloseBracketToken); 167Debug.Assert(minusToken.Kind == JsonKind.MinusToken); 214Debug.Assert(commaToken.Kind == JsonKind.CommaToken); 240Debug.Assert(nameToken.Kind is JsonKind.StringToken or JsonKind.TextToken); 241Debug.Assert(colonToken.Kind == JsonKind.ColonToken); 242Debug.Assert(value != null); 280Debug.Assert(newKeyword.Kind == JsonKind.NewKeyword); 281Debug.Assert(nameToken.Kind == JsonKind.TextToken); 282Debug.Assert(openParenToken.Kind == JsonKind.OpenParenToken); 283Debug.Assert(sequence != null); 284Debug.Assert(closeParenToken.Kind == JsonKind.CloseParenToken);
EmbeddedLanguages\Json\JsonParser.cs (4)
123Debug.Assert(_lexer.Position == _lexer.Text.Length); 124Debug.Assert(_currentToken.Kind == JsonKind.EndOfFile); 409Debug.Assert(_currentToken.Kind == JsonKind.ColonToken); 471Debug.Assert(token.VirtualChars.Length > 0);
EmbeddedLanguages\Json\JsonParser.JsonNetSyntaxChecks.cs (2)
80Debug.Assert(chars.Length > 1); 111Debug.Assert(chars.Length > 1 && chars[0] == '0');
EmbeddedLanguages\Json\LanguageServices\AbstractJsonDetectionCodeFixProvider.cs (1)
44Debug.Assert(_info.IsAnyStringLiteral(stringLiteral.RawKind));
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (6)
374Debug.Assert(Text[beforeSlash] == '\\'); 375Debug.Assert(Text[beforeSlash + 1].Value is 'x' or 'u'); 417Debug.Assert(Text[beforeSlash] == '\\'); 418Debug.Assert(IsOctalDigit(Text[start])); 428Debug.Assert(octalVal is >= 0 and <= 7); 444Debug.Assert(Position - start > 0);
EmbeddedLanguages\RegularExpressions\RegexNodes.cs (62)
21Debug.Assert(expression != null); 22Debug.Assert(endOfFileToken.Kind == RegexKind.EndOfFile); 76Debug.Assert(textToken.Kind == RegexKind.TextToken); 104Debug.Assert(openBracketToken.Kind == RegexKind.OpenBracketToken); 105Debug.Assert(components != null); 106Debug.Assert(closeBracketToken.Kind == RegexKind.CloseBracketToken); 147Debug.Assert(caretToken.Kind == RegexKind.CaretToken); 178Debug.Assert(left != null); 179Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 180Debug.Assert(right != null); 216Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 217Debug.Assert(characterClass != null); 269Debug.Assert(dotToken.Kind == RegexKind.DotToken); 308Debug.Assert(expression != null); 309Debug.Assert(asteriskToken.Kind == RegexKind.AsteriskToken); 340Debug.Assert(expression != null); 341Debug.Assert(plusToken.Kind == RegexKind.PlusToken); 372Debug.Assert(expression != null); 373Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 406Debug.Assert(quantifier != null); 407Debug.Assert(quantifier.Kind != RegexKind.LazyQuantifier); 408Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 440Debug.Assert(expression != null); 441Debug.Assert(openBraceToken.Kind == RegexKind.OpenBraceToken); 442Debug.Assert(firstNumberToken.Kind == RegexKind.NumberToken); 443Debug.Assert(closeBraceToken.Kind == RegexKind.CloseBraceToken); 489Debug.Assert(commaToken.Kind == RegexKind.CommaToken); 523Debug.Assert(commaToken.Kind == RegexKind.CommaToken); 524Debug.Assert(secondNumberToken.Kind == RegexKind.NumberToken); 558Debug.Assert(anchorToken.Kind is RegexKind.DollarToken or RegexKind.CaretToken); 585Debug.Assert(sequenceList.NodesAndTokens.Length > 0); 587Debug.Assert(sequenceList.NodesAndTokens[i].Kind == RegexKind.BarToken); 611Debug.Assert(openParenToken.Kind == RegexKind.OpenParenToken); 612Debug.Assert(closeParenToken.Kind == RegexKind.CloseParenToken); 629Debug.Assert(expression != null); 658Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 711Debug.Assert(colonToken.Kind == RegexKind.ColonToken); 712Debug.Assert(expression != null); 748Debug.Assert(colonToken.Kind == RegexKind.ColonToken); 749Debug.Assert(expression != null); 784Debug.Assert(equalsToken.Kind == RegexKind.EqualsToken); 785Debug.Assert(expression != null); 820Debug.Assert(exclamationToken.Kind == RegexKind.ExclamationToken); 821Debug.Assert(expression != null); 853Debug.Assert(lessThanToken.Kind == RegexKind.LessThanToken); 870Debug.Assert(equalsToken.Kind == RegexKind.EqualsToken); 871Debug.Assert(expression != null); 907Debug.Assert(exclamationToken.Kind == RegexKind.ExclamationToken); 908Debug.Assert(expression != null); 944Debug.Assert(greaterThanToken.Kind == RegexKind.GreaterThanToken); 945Debug.Assert(expression != null); 981Debug.Assert(expression != null); 1023Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 1024Debug.Assert(expression != null); 1068Debug.Assert(result != null); 1086Debug.Assert(innerOpenParenToken.Kind == RegexKind.OpenParenToken); 1087Debug.Assert(innerCloseParenToken.Kind == RegexKind.CloseParenToken); 1129Debug.Assert(grouping != null); 1159Debug.Assert(backslashToken.Kind == RegexKind.BackslashToken); 1188Debug.Assert(typeToken.Kind == RegexKind.TextToken); 1417Debug.Assert(openBraceToken.Kind == RegexKind.OpenBraceToken); 1418Debug.Assert(closeBraceToken.Kind == RegexKind.CloseBraceToken);
EmbeddedLanguages\RegularExpressions\RegexParser.CaptureInfoAnalyzer.cs (1)
141Debug.Assert(!grouping.OpenParenToken.IsMissing);
EmbeddedLanguages\RegularExpressions\RegexParser.cs (25)
168Debug.Assert(_lexer.Position == _lexer.Text.Length); 169Debug.Assert(_currentToken.Kind == RegexKind.EndOfFile); 214Debug.Assert(token.TrailingTrivia.IsEmpty); 644Debug.Assert(token.Value == null); 938Debug.Assert(_currentToken.Kind == RegexKind.OpenParenToken); 1244Debug.Assert(openBracketToken.Kind == RegexKind.OpenBracketToken); 1265Debug.Assert(_currentToken.VirtualChars.Length == 1); 1403Debug.Assert(sequence.ChildCount > 0); 1405Debug.Assert(IsEscapedMinus(sequence.ChildAt(i).Node)); 1437Debug.Assert(RegexLexer.IsHexChar(ch)); 1498Debug.Assert(_currentToken.VirtualChars.Length == 1); 1584Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1597Debug.Assert(_currentToken.VirtualChars.Length == 1); 1630Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1643Debug.Assert(_currentToken.VirtualChars.Length == 1); 1668Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1683Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1722Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1744Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1745Debug.Assert(_lexer.Text[_lexer.Position].Value is '<' or '\''); 1827Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1831Debug.Assert(_currentToken.VirtualChars.Length == 1); 1838Debug.Assert(octalDigits.VirtualChars.Length > 0); 1905Debug.Assert(_currentToken.VirtualChars.Length == 1); 1951Debug.Assert(_lexer.Text[_lexer.Position - 1] is var ch && (ch == 'P' || ch == 'p'));
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (1)
426Debug.Assert(virtualChars.Length > 0);
EmbeddedLanguages\StackFrame\StackFrameNodeDefinitions.cs (29)
91Debug.Assert(identifier.Kind is StackFrameKind.IdentifierToken or StackFrameKind.ConstructorToken); 107Debug.Assert(dotToken.Kind == StackFrameKind.DotToken); 108Debug.Assert(left.Kind is not StackFrameKind.Constructor); 180Debug.Assert(graveAccentToken.Kind == StackFrameKind.GraveAccentToken); 181Debug.Assert(numberToken.Kind == StackFrameKind.NumberToken); 223Debug.Assert(lessThanToken.Kind == StackFrameKind.LessThanToken); 224Debug.Assert(greaterThanToken.Kind == StackFrameKind.GreaterThanToken); 225Debug.Assert(!dollarToken.HasValue || dollarToken.Value.Kind == StackFrameKind.DollarToken); 275Debug.Assert(generatedNameSeparator.Kind == StackFrameKind.GeneratedNameSeparatorToken); 276Debug.Assert(identifier.Kind == StackFrameKind.IdentifierToken); 277Debug.Assert(pipeToken.Kind == StackFrameKind.PipeToken); 278Debug.Assert(suffix.Kind == StackFrameKind.GeneratedNameSuffixToken); 316Debug.Assert(generatedNameSeparator.Kind == StackFrameKind.GeneratedNameSeparatorToken); 317Debug.Assert(dotToken.Kind == StackFrameKind.DotToken); 318Debug.Assert(stateMachineIdentifier.Kind == StackFrameKind.IdentifierToken); 365Debug.Assert(!arrayRankSpecifiers.IsDefaultOrEmpty); 392Debug.Assert(!commaTokens.IsDefault); 393Debug.Assert(openBracket.Kind == StackFrameKind.OpenBracketToken); 394Debug.Assert(closeBracket.Kind == StackFrameKind.CloseBracketToken); 395Debug.Assert(commaTokens.All(static t => t.Kind == StackFrameKind.CommaToken)); 446Debug.Assert(openToken.Kind is StackFrameKind.OpenBracketToken or StackFrameKind.LessThanToken); 447Debug.Assert(typeArguments.Length > 0); 448Debug.Assert(openToken.Kind == StackFrameKind.OpenBracketToken ? closeToken.Kind == StackFrameKind.CloseBracketToken : closeToken.Kind == StackFrameKind.GreaterThanToken); 492Debug.Assert(identifier.Kind == StackFrameKind.IdentifierToken); 521Debug.Assert(openToken.Kind == StackFrameKind.OpenParenToken); 522Debug.Assert(closeToken.Kind == StackFrameKind.CloseParenToken); 561Debug.Assert(path.Kind == StackFrameKind.PathToken); 562Debug.Assert(colon.HasValue == line.HasValue); 563Debug.Assert(!line.HasValue || line.Value.Kind == StackFrameKind.NumberToken);
EmbeddedLanguages\StackFrame\StackFrameParser.cs (1)
174Debug.Assert(nameNode is StackFrameQualifiedNameNode or StackFrameSimpleNameNode);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingSolutionCrawlerRegistrationService.cs (2)
224Debug.Assert(set.Add(Default)); 230Debug.Assert(set.Add(kind));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncDocumentWorkItemQueue.cs (1)
105Debug.Assert(existingWorkItem.Language == item.Language);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingAsyncWorkItemQueue.cs (1)
232Debug.Assert(!_cancellationMap.ContainsKey(key));
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingNormalPriorityProcessor.cs (1)
254Debug.Assert(!workItem.InvocationReasons.Contains(UnitTestingPredefinedInvocationReasons.Reanalyze) || workItem.SpecificAnalyzers.Count > 0);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingSemanticChangeProcessor.cs (2)
181Debug.Assert(location.IsInSource); 280Debug.Assert(result);
ExternalAccess\UnitTesting\SolutionCrawler\UnitTestingWorkCoordinator.UnitTestingWorkItem.cs (1)
66Debug.Assert(documentId == null || documentId.ProjectId == projectId);
ExternalAccess\VSTypeScript\Api\VSTypeScriptCompletionProvider.cs (1)
17Debug.Fail("For backwards API compat only, should not be called");
ExtractInterface\AbstractExtractInterfaceService.cs (1)
419Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString()));
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
30Debug.Assert(Enum.GetNames(typeof(TriviaLocation)).Length == TriviaLocationsCount);
FindUsages\DefinitionItemFactory.cs (2)
216Debug.Assert(originatingProjectId == null || originatingProjectId == info.ProjectId); 307Debug.Assert(location.IsInSource);
FullyQualify\AbstractFullyQualifyService.SymbolResult.cs (2)
48Debug.Assert(Symbol is INamespaceSymbol || !((INamedTypeSymbol)Symbol).IsGenericType); 49Debug.Assert(other.Symbol is INamespaceSymbol || !((INamedTypeSymbol)other.Symbol).IsGenericType);
GenerateType\AbstractGenerateTypeService.Editor.cs (3)
195Debug.Assert(targetProject.Language == LanguageNames.VisualBasic); 203Debug.Assert(_targetLanguageService != null); 542Debug.Assert(includeUsingsOrImports != null);
InheritanceMargin\AbstractInheritanceMarginService_Helpers.cs (1)
337Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
InitializeParameter\AbstractAddParameterCheckCodeRefactoringProvider.cs (1)
989Debug.Fail("Should have found {0} in the resource string.");
InitializeParameter\AbstractInitializeMemberFromParameterCodeRefactoringProviderMemberCreation.cs (3)
364Debug.Assert(parameters.Length >= 2); 365Debug.Assert(fieldsOrProperties.Length > 0); 366Debug.Assert(parameters.Length == fieldsOrProperties.Length);
InlineMethod\AbstractInlineMethodRefactoringProvider.MethodParametersInfo.cs (1)
498Debug.Assert(parameterSymbol is not null);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (2)
489Debug.Assert(statementRange.FirstStatement == statementRange.LastStatement); 648Debug.Assert(subsequentSingleExitPoint is TStatementSyntax);
InvertIf\AbstractInvertIfCodeRefactoringProvider.StatementRange.cs (5)
25Debug.Assert(firstStatement != null); 26Debug.Assert(lastStatement != null); 27Debug.Assert(firstStatement.Parent != null); 28Debug.Assert(firstStatement.Parent == lastStatement.Parent); 29Debug.Assert(firstStatement.SpanStart <= lastStatement.SpanStart);
LanguageServices\SymbolDisplayService\AbstractSymbolDisplayService.AbstractSymbolDescriptionBuilder.cs (1)
145Debug.Assert(false, "How?");
MoveToNamespace\AbstractMoveToNamespaceService.cs (2)
203Debug.Assert(compilationUnitMembers.Count == 1); 289Debug.Assert(symbol != null && !string.IsNullOrEmpty(targetNamespace));
MoveToNamespace\MoveToNamespaceCodeAction.cs (1)
62Debug.Assert(moveToNamespaceResult.Succeeded);
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
85Debug.Assert(priorityDocuments.All(d => projects.Contains(d.Project)));
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
323Debug.Assert(Enum.GetUnderlyingType(typeof(DeclaredSymbolInfoKind)) == typeof(byte));
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
163Debug.Assert(priorityDocuments.All(d => projects.Contains(d.Project)));
NavigateTo\NavigateToSearcher.cs (5)
118Debug.Assert(count >= 0); 119Debug.Assert(_remainingProgressItems >= 0); 128Debug.Assert(newValue >= 0); 177Debug.Assert(_remainingProgressItems == 0); 239Debug.Assert(searchRegularDocuments || searchGeneratedDocuments);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
210Debug.Assert(assemblyName is not null);
PdbSourceDocument\SourceLinkMap.cs (1)
201Debug.Assert(mappedUri.Suffix.Length == 0);
QuickInfo\QuickInfoService.cs (1)
39Debug.Fail("For backwards API compat only, should not be called");
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
214Debug.Assert(startInclusive > 0);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (3)
253Debug.Fail($"Parent node of {nameToken} is null."); 293Debug.Fail($"Parent node of {nameToken} is null."); 440Debug.Assert(method.DeclaringSyntaxReferences.Length == 1);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
421Debug.Assert(property.DeclaringSyntaxReferences.Length == 1);
Shared\Extensions\DocumentExtensions.cs (1)
37Debug.Assert(document.GetRequiredSyntaxRootSynchronously(CancellationToken.None) == root);
Shared\Utilities\ExtractTypeHelpers.cs (1)
221Debug.Assert(false, string.Format(FeaturesResources.Unexpected_interface_member_kind_colon_0, member.Kind.ToString()));
SignatureHelp\SignatureHelpItems.cs (1)
91Debug.Assert(selectedItem.Value >= 0, "actual item was not part of the final list");
Snippets\AbstractSnippetService.cs (1)
61Debug.Assert(!_identifierToProviderMap.TryGetValue(providerData.Identifier, out var _));
SplitOrMergeIfStatements\AbstractMergeIfStatementsCodeRefactoringProvider.cs (2)
73Debug.Assert(ifGenerator.IsIfOrElseIf(upperIfOrElseIf)); 74Debug.Assert(ifGenerator.IsIfOrElseIf(lowerIfOrElseIf));
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (3)
122Debug.Assert(syntaxFacts.IsExecutableStatement(secondIfOrElseIf)); 123Debug.Assert(syntaxFacts.IsExecutableStatement(firstIfOrElseIf)); 124Debug.Assert(ifGenerator.GetElseIfAndElseClauses(firstIfOrElseIf).Length == 0);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (2)
82Debug.Assert(syntaxFacts.IsExecutableStatement(ifOrElseIf)); 83Debug.Assert(ifGenerator.GetElseIfAndElseClauses(ifOrElseIf).Length == 0);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (3)
75Debug.Assert(syntaxFacts.IsExecutableStatement(innerIfStatement)); 127Debug.Assert(blockFacts.IsStatementContainer(ifOrElseIf)); 204Debug.Assert(blockFacts.GetStatementContainer(outerIfStatement) is object);
src\9547feb31df4cc5d\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
275Debug.Assert(operation.Kind is OperationKind.DelegateCreation or OperationKind.AnonymousFunction); 324Debug.Assert(operation.Kind is OperationKind.LocalReference or OperationKind.ParameterReference); 525Debug.Assert(!SymbolUsageAnalysis.Run(context.GetControlFlowGraph(operationBlock), context.OwningSymbol, context.CancellationToken)
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer_Core.cs (4)
29Debug.Assert(!isUnnecessary || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer); 43Debug.Assert(!supportedDiagnostics.Any(descriptor => descriptor.CustomTags.Any(t => t == WellKnownDiagnosticTags.Unnecessary)) || this is AbstractBuiltInUnnecessaryCodeStyleDiagnosticAnalyzer); 161Debug.Assert(_minimumReportedSeverity != null); 245Debug.Assert(editorConfigSeverity != null);
src\roslyn\src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
75Debug.Assert(options.Count > 1); 87Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
src\roslyn\src\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
64Debug.Assert(customTags.Length == tags.Length); 68Debug.Assert(customTags[i] == tags[i]); 74Debug.Assert(isConfigurable || enforceOnBuild == EnforceOnBuild.Never);
src\roslyn\src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
337Debug.Assert(id.StartsWith("IDE", StringComparison.Ordinal));
src\roslyn\src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (3)
47Debug.Assert(perLanguageValuedOption.IsPerLanguage); 83Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions)); 84Debug.Assert(options.All(option => option.Definition.IsEditorConfigOption));
src\roslyn\src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (3)
109Debug.Assert(fieldStateMap.ContainsKey(field.OriginalDefinition)); 219Debug.Assert(IsCandidateField(field)); 293Debug.Assert(isInInstanceConstructor);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
108Debug.Assert(preference.Value == ParenthesesPreference.NeverIfUnnecessary ||
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (5)
69Debug.Fail(ex.Message); 422Debug.Assert(!analyzer.IsCompilerAnalyzer()); 454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics); 554Debug.Assert(diagnostic.Location.IsInSource); 555Debug.Assert(diagnostic.Location.SourceTree == tree);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
406Debug.Assert(memberReference.Parent is ICompoundAssignmentOperation compoundAssignment && 633Debug.Assert(IsCandidateSymbol(member)); 634Debug.Assert(!member.IsImplicitlyDeclared);
src\roslyn\src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
256Debug.Assert(unusedValueExpressionStatementSeverity.Severity != ReportDiagnostic.Suppress || 317Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _)); 323Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _));
src\roslyn\src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
36Debug.Assert(binaryToAssignmentMap.Count == assignmentToTokenMap.Count); 37Debug.Assert(binaryToAssignmentMap.Values.All(assignmentToTokenMap.ContainsKey));
src\roslyn\src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
70Debug.Assert(elementCount >= 2 || statements.Length >= 2);
src\roslyn\src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
202Debug.Assert(syntaxFacts.IsArgument(argsArgument));
src\roslyn\src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (2)
97Debug.Assert(false, "All conflict markers should start at the beginning of a line."); 396Debug.Assert(
src\roslyn\src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
87Debug.Assert(constructor.Parameters.Length == expressions.Length);
src\roslyn\src\Analyzers\Core\CodeFixes\MakeMethodSynchronous\AbstractMakeMethodSynchronousCodeFixProvider.cs (1)
222Debug.Assert(syntaxFacts.IsInvocationExpression(invocationExpression));
src\roslyn\src\Analyzers\Core\CodeFixes\MakeTypePartial\AbstractMakeTypePartialCodeFixProvider.cs (1)
36Debug.Fail("Declared symbol must never be null here");
src\roslyn\src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
43Debug.Assert(diagnostics.Select(diagnostic => diagnostic.Properties[MatchFolderAndNamespaceConstants.TargetNamespace]).Distinct().Count() == 1); 62Debug.Assert(newSolution != document.Project.Solution);
src\roslyn\src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
57Debug.Assert(missingCases || missingDefaultCase);
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveAsyncModifier\AbstractRemoveAsyncModifierCodeFixProvider.cs (2)
70Debug.Fail("We should always be able to find the node from the diagnostic."); 77Debug.Fail("We should always be able to find the method symbol for the diagnostic.");
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
98Debug.Assert(childDeclarators.All(c => !declarators.Contains(c)));
src\roslyn\src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (7)
249Debug.Assert(success); 254Debug.Assert(diagnosticId == diagnostic.Id); 255Debug.Assert(AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.TryGetUnusedValuePreference(diagnostic, out var diagnosticPreference) && 257Debug.Assert(removeAssignments == AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.GetIsRemovableAssignmentDiagnostic(diagnostic)); 410Debug.Assert(semanticModel.Language != LanguageNames.VisualBasic); 517Debug.Assert(syntaxFacts.IsLeftSideOfAnyAssignment(node)); 726Debug.Assert(removeAssignments);
src\roslyn\src\Analyzers\Core\CodeFixes\UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
130Debug.Assert(fieldDocument.Project == propertyDocument.Project); 171Debug.Assert(fieldDocument.Project == propertyDocument.Project);
src\roslyn\src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
285Debug.Assert(syntaxFacts.IsElementAccessExpression(elementAccess));
src\roslyn\src\Analyzers\Core\CodeFixes\UseSystemHashCode\UseSystemHashCodeCodeFixProvider.cs (1)
48Debug.Fail("Could not get analyzer");
src\roslyn\src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
81Debug.Assert(assemblyScopedNamespaceSymbol.ConstituentNamespaces.Length == 1);
src\roslyn\src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
17Debug.Assert(declaredNode != null); 18Debug.Assert(!executableCodeBlocks.IsDefault);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\SuppressMessageAttributeState.TargetSymbolResolver.cs (7)
308Debug.Assert(PeekNextChar() is '(' or '['); 495Debug.Assert(PeekNextChar() == '!'); 542Debug.Assert(bindingContext != null); 657Debug.Assert(PeekNextChar() == '<'); 698Debug.Assert(PeekNextChar() == '['); 884Debug.Assert(type != null); 890Debug.Assert(startIndex >= 0);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (8)
25Debug.Assert(builder.Count == 0); 50Debug.Assert(_recordCount <= byte.MaxValue); 85Debug.Assert(groupSizes.Count <= ushort.MaxValue); 102Debug.Assert(usingCount <= ushort.MaxValue); 152Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 153Debug.Assert(info.LocalName.Length <= IdentifierSize); 172Debug.Assert(infos.Count > 0); 179Debug.Assert((info.SlotIndex == -1) ^ (info.ScopeStart == 0 && info.ScopeEnd == 0));
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (7)
257Debug.Assert(flagsBuilder.Count == 0); 258Debug.Assert(nameBuilder.Length == 0); 398Debug.Assert(!allModuleInfoImportStrings.IsDefault); 422Debug.Assert(!importStrings.IsDefault); 452Debug.Assert(groupBuilder.Count == 0); 493Debug.Assert(!importStrings.IsDefault); 512Debug.Assert(!importStrings.IsDefault);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\StateMachineHoistedLocalScope.cs (2)
26Debug.Assert(startOffset >= 0); 27Debug.Assert(endOffset > startOffset || startOffset == 0 && endOffset == 0);
src\roslyn\src\Dependencies\CodeAnalysis.Debugging\TupleElementNamesInfo.cs (1)
22Debug.Assert(!elementNames.IsDefault);
SyncNamespaces\AbstractSyncNamespacesService.cs (1)
38Debug.Assert(projects.All(project => project.Language == projects[0].Language));
ValueTracking\ValueTracker.OperationCollector.cs (1)
113Debug.Assert(operation is
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (3)
74Debug.Assert(exprsAndOperators.Length >= 3); 75Debug.Assert(exprsAndOperators.Length % 2 == 1, "Should have odd number of exprs and operators"); 79Debug.Assert(((i % 2) == 0 && item.IsNode) ||
Microsoft.CodeAnalysis.NetAnalyzers (561)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CollectionPropertiesShouldBeReadOnly.cs (1)
144Debug.Assert(SymbolEqualityComparer.Default.Equals(baseType, baseType.OriginalDefinition));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\CollectionsShouldImplementGenericInterface.cs (1)
104Debug.Assert(interfacePairs.All(kvp => kvp.Key.TypeKind == TypeKind.Interface && kvp.Value.All(x => x.TypeKind == TypeKind.Interface)));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumShouldNotHaveDuplicatedValues.cs (1)
83Debug.Assert(added);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumsShouldHaveZeroValue.cs (2)
116Debug.Assert(context.Options.MatchesConfiguredVisibility(RuleNoZero, symbol, context.Compilation)); 117Debug.Assert(context.Options.MatchesConfiguredVisibility(RuleRename, symbol, context.Compilation));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumWithFlagsAttribute.cs (2)
103Debug.Assert(missingValues != null); 124Debug.Assert(list != null);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\Helpers\EnumHelpers.cs (1)
64Debug.Assert(enumType.TypeKind == TypeKind.Enum);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldHaveCorrectPrefix.cs (2)
60Debug.Assert(!context.Options.MatchesConfiguredVisibility(TypeParameterRule, context.Symbol, context.Compilation)); 64Debug.Assert(context.Options.MatchesConfiguredVisibility(TypeParameterRule, context.Symbol, context.Compilation));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\IdentifiersShouldHaveCorrectSuffix.cs (4)
141Debug.Assert(!context.Options.MatchesConfiguredVisibility(MultipleSuffixesRule, namedTypeSymbol, context.Compilation)); 142Debug.Assert(!context.Options.MatchesConfiguredVisibility(UserSuffixRule, namedTypeSymbol, context.Compilation)); 146Debug.Assert(context.Options.MatchesConfiguredVisibility(MultipleSuffixesRule, namedTypeSymbol, context.Compilation)); 147Debug.Assert(context.Options.MatchesConfiguredVisibility(UserSuffixRule, namedTypeSymbol, context.Compilation));
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorOverloadsHaveNamedAlternates.cs (1)
97Debug.Assert(methodSymbol.MethodKind is MethodKind.UserDefinedOperator or MethodKind.Conversion);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\OperatorsShouldHaveSymmetricalOverloads.Fixer.cs (1)
48Debug.Assert(containingOperator.IsUserDefinedOperator());
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\PropertiesShouldNotBeWriteOnly.cs (2)
71Debug.Assert(context.Options.MatchesConfiguredVisibility(MakeMoreAccessibleRule, property, context.Compilation) == context.Options.MatchesConfiguredVisibility(AddGetterRule, property, context.Compilation)); 72Debug.Assert(descriptor == MakeMoreAccessibleRule || descriptor == AddGetterRule);
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\UseEventsWhereAppropriate.cs (1)
52Debug.Assert(!HasEventLikeName(method), "fast check failed but eventual check succeeds?");
Microsoft.CodeQuality.Analyzers\Maintainability\AvoidDeadConditionalCode.cs (3)
69var debugAssertMethods = debugAssert?.GetMembers(nameof(Debug.Assert)).OfType<IMethodSymbol>().ToArray() ?? Array.Empty<IMethodSymbol>(); 199Debug.Assert(operation.Kind is OperationKind.BinaryOperator or 237Debug.Assert(predicateKind != PredicateValueKind.Unknown);
Microsoft.CodeQuality.Analyzers\Maintainability\UseCrossPlatformIntrinsicsFixer.cs (2)
37Debug.Fail($"Found diagnostic without an associated {nameof(RuleKind)} property."); 43Debug.Fail($"Found diagnostic with an unrecognized {nameof(RuleKind)} property: {ruleKindName}.");
Microsoft.NetCore.Analyzers\ImmutableCollections\DoNotCallToImmutableCollectionOnAnImmutableCollectionValue.cs (1)
77Debug.Assert(!string.IsNullOrEmpty(metadataName));
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.AutoLayoutTypeCache.cs (1)
38Debug.Assert(type.IsValueType);
Microsoft.NetCore.Analyzers\InteropServices\DisableRuntimeMarshallingAnalyzer.DisabledRuntimeMarshallingAssemblyAnalyzer.cs (1)
119Debug.Assert(_unmanagedFunctionPointerAttribute is not null);
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.cs (5)
394Debug.Assert(operation.Type!.Equals(osPlatformType)); 421Debug.Assert(results.Any(), "Expected at least one analysis result for lambda/local function"); 425Debug.Assert(localResult.ControlFlowGraph.OriginalOperation == containingLambdaOrLocalFunctionOperation); 444Debug.Assert(runtimeIsOSPlatformMethod == null || guardMethods.Contains(runtimeIsOSPlatformMethod)); 2170Debug.Assert(name == ObsoletedOSPlatformAttribute);
Microsoft.NetCore.Analyzers\InteropServices\PlatformCompatibilityAnalyzer.Value.cs (2)
62Debug.Assert(osPlatformNamesBuilder.Count > 0); 89Debug.Assert(invokedPlatformCheckMethod.Name == "IsOSPlatformVersionAtLeast");
Microsoft.NetCore.Analyzers\Performance\AvoidSingleUseOfLocalJsonSerializerOptions.cs (1)
180Debug.Assert(loop.Body is IBlockOperation);
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Analyzer.cs (1)
275Debug.Assert(!invocation.Arguments.IsEmpty);
Microsoft.NetCore.Analyzers\Performance\RecommendCaseInsensitiveStringComparison.Fixer.cs (3)
101Debug.Assert(caseChangingApproachValue != null, "Unexpected offending methods"); 146Debug.Assert(mainInvocation.Arguments.Length <= 3); 168Debug.Assert(diagnosableMethodName is
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.cs (1)
73Debug.Assert(invocation.Arguments.Length is 1 or 2);
Microsoft.NetCore.Analyzers\Performance\UseSearchValues.Fixer.cs (2)
355Debug.Assert(invocation.TargetMethod.Name == nameof(string.ToCharArray)); 400Debug.Assert(symbol.DeclaringSyntaxReferences.Length == 1);
Microsoft.NetCore.Analyzers\Performance\UseStartsWithInsteadOfIndexOfComparisonWithZero.Fixer.cs (1)
90Debug.Fail("This should never happen.");
Microsoft.NetCore.Analyzers\Runtime\DetectPreviewFeatureAnalyzer.cs (3)
916Debug.Fail($"Should never reach this line. This means the symbol {symbol.Name} was not processed in this analyzer"); 943Debug.Fail($"Should never reach this line. This means the symbol {previewSymbol.Name} was not processed in this analyzer"); 970Debug.Fail($"Should never reach this line. This means the symbol {previewSymbol.Name} was not processed in this analyzer");
Microsoft.NetCore.Analyzers\Runtime\DisposableFieldsShouldBeDisposed.cs (3)
77Debug.Assert(!field.IsStatic); 78Debug.Assert(disposeAnalysisHelper!.IsDisposable(field.Type)); 232Debug.Assert(disposeAnalysisHelper.IsDisposable(field.Type));
Microsoft.NetCore.Analyzers\Runtime\DisposeMethodsShouldCallBaseClassDispose.cs (1)
91Debug.Assert(disposeAnalysisHelper.GetDisposeMethodKind(invocation.TargetMethod) == disposeMethodKind);
Microsoft.NetCore.Analyzers\Runtime\DoNotPassLiteralsAsLocalizedParameters.cs (2)
124Debug.Assert(!stringContentValue.LiteralValues.IsEmpty); 225Debug.Assert(parameterSymbol.ContainingSymbol.Kind == SymbolKind.Method);
Microsoft.NetCore.Analyzers\Runtime\DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.cs (1)
131Debug.Assert(methodSymbol.ReducedFrom == null);
Microsoft.NetCore.Analyzers\Runtime\DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectly.Fixer.cs (1)
127Debug.Fail($"Unexpected method name '{methodName}' for {DoNotUseEnumerableMethodsOnIndexableCollectionsInsteadUseTheCollectionDirectlyAnalyzer.RuleId} code fix.");
Microsoft.NetCore.Analyzers\Runtime\InstantiateArgumentExceptionsCorrectly.Fixer.cs (1)
104Debug.Assert(argumentCount == 3);
Microsoft.NetCore.Analyzers\Runtime\UseAsyncMethodInAsyncContext.cs (1)
177Debug.Assert(!invocation.Arguments.IsEmpty);
Microsoft.NetCore.Analyzers\Security\DoNotAlwaysSkipTokenValidationInDelegates.cs (1)
122Debug.Fail("Unhandled OperationKind " + delegateCreationOperation.Target.Kind);
Microsoft.NetCore.Analyzers\Security\DoNotCallDangerousMethodsInDeserialization.cs (2)
253Debug.Fail(methodSymbol.Name + " was not found in callGraph"); 281Debug.Assert(dangerousMethods.Count > 0);
Microsoft.NetCore.Analyzers\Security\DoNotDisableHttpClientCRLCheck.cs (1)
232Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotInstallRootCert.cs (1)
221Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseCreateEncryptorWithNonDefaultIV.cs (1)
197Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureCryptographicAlgorithms.cs (1)
83Debug.Fail($"Unhandled IOperation {operationAnalysisContext.Operation.Kind}");
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerJavascriptSerializerWithSimpleTypeResolver.cs (3)
142Debug.Fail($"Unhandled PointsToAbstractValueKind {pointsTo.Kind}"); 149Debug.Fail($"Unhandled JavaScriptSerializer constructor {constructorMethod.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)}"); 256Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerJsonNetWithoutBinder.cs (2)
81Debug.Fail($"Unhandled JsonSerializer constructor {constructorMethod.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)}"); 236Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerMethodsBase.cs (1)
65Debug.Assert(!cachedDeserializationMethodNames.IsEmpty);
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureDeserializerWithoutBinderBase.cs (6)
72Debug.Assert(!string.IsNullOrWhiteSpace(this.DeserializerTypeMetadataName)); 73Debug.Assert(!string.IsNullOrWhiteSpace(this.SerializationBinderPropertyMetadataName)); 74Debug.Assert(!cachedDeserializationMethodNames.IsEmpty); 75Debug.Assert(this.BinderDefinitelyNotSetDescriptor != null); 76Debug.Assert(this.BinderMaybeNotSetDescriptor != null); 220Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseInsecureSettingsForJsonNet.cs (2)
80Debug.Fail($"Unhandled JsonSerializerSettings constructor {constructorMethod.ToDisplayString(SymbolDisplayFormat.MinimallyQualifiedFormat)}"); 263Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\DoNotUseWeakKDFInsufficientIterationCount.cs (1)
217Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Security\SslProtocolsAnalyzer.cs (1)
146Debug.Fail("Unhandled IOperation " + operationAnalysisContext.Operation.Kind);
Microsoft.NetCore.Analyzers\Security\UseAutoValidateAntiforgeryToken.cs (2)
387Debug.Fail(methodSymbol.Name + " was not found in inverseGraph."); 410Debug.Fail(child.Name + " was not found in results.");
Microsoft.NetCore.Analyzers\Security\UseSecureCookiesASPNetCore.cs (1)
215Debug.Fail($"Unhandled result value {kvp.Value}");
Microsoft.NetCore.Analyzers\Tasks\UseValueTasksCorrectly.cs (1)
474assert.TargetMethod?.Name == nameof(Debug.Assert) &&
Microsoft.NetFramework.Analyzers\TypesShouldNotExtendCertainBaseTypes.cs (1)
76Debug.Assert(s_badBaseTypesToMessage.ContainsKey(baseTypeName));
src\0437c1690f5501bd\CopyAnalysis.CopyAbstractValueDomain.cs (4)
72Debug.Assert(value1.Kind.IsKnown()); 73Debug.Assert(value2.Kind.IsKnown()); 82Debug.Assert(_entitiesDomain.Equals(mergedEntities, value1.AnalysisEntities)); 87Debug.Assert(_entitiesDomain.Equals(mergedEntities, value2.AnalysisEntities));
src\0437c1690f5501bd\CopyAnalysis.CopyDataFlowOperationVisitor.cs (7)
157Debug.Assert(ReferenceEquals(sourceCopyAnalysisData, targetCopyAnalysisData) || fromPredicateKind.HasValue); 181Debug.Assert(existingValue.AnalysisEntities.Contains(analysisEntity)); 319Debug.Assert(operation.Parameter?.RefKind is RefKind.Ref or RefKind.Out); 453Debug.Assert(SymbolEqualityComparer.Default.Equals(throwBranchWithExceptionType.ExceptionType, ExceptionNamedType)); 545Debug.Assert(copyValue.AnalysisEntities.Contains(key)); 546Debug.Assert(predicate == null || copyValue.AnalysisEntities.All(predicate)); 628Debug.Assert(!inference.AlwaysSucceed || !inference.AlwaysFail);
src\11b41c7305441175\PropertySetAbstractValue.cs (1)
153Debug.Assert(index >= 0);
src\11b41c7305441175\PropertySetAbstractValue.ValuePool.cs (1)
32Debug.Assert(values[i] == i, $"{nameof(PropertySetAbstractValueKind)} isn't a contiguous enum starting at 0");
src\11b41c7305441175\PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs (12)
57Debug.Assert(analysisContext.PointsToAnalysisResult != null); 75Debug.Assert(this.TrackedTypeSymbols.Any()); 170Debug.Assert(this.DataFlowAnalysisContext.ValueContentAnalysisResult != null); 184Debug.Fail("Unhandled ConstructorMapper"); 268Debug.Fail($"Unhandled PointsToAbstractValue: Kind = {pointsToAbstractValue.Kind}, NullState = {pointsToAbstractValue.NullState}"); 297Debug.Assert(this.DataFlowAnalysisContext.ValueContentAnalysisResult != null); 303Debug.Fail("Unhandled PropertyMapper"); 378Debug.Fail("Expected to have tracked assignment operations for a given location"); 405Debug.Fail("Expected to have tracked assignment operations with locations"); 428Debug.Fail("Expected to have tracked assignment operations with unknown PointsTo"); 437Debug.Fail($"Unhandled PointsToAbstractValue: Kind = {pointsToAbstractValue.Kind}, NullState = {pointsToAbstractValue.NullState}"); 719Debug.Fail("Can LValues FlowCaptureReferences have more than one operation?");
src\11b41c7305441175\PropertySetAnalysisContext.cs (2)
114Debug.Assert(pointsToAnalysisResult != null); 115Debug.Assert(copyAnalysisResult == null);
src\40daf5e1cab76dff\TaintedDataAbstractValue.cs (3)
76Debug.Assert(value1.Kind == TaintedDataAbstractValueKind.Tainted); 77Debug.Assert(value2.Kind == TaintedDataAbstractValueKind.Tainted); 94Debug.Assert(value.Kind == TaintedDataAbstractValueKind.Tainted);
src\40daf5e1cab76dff\TaintedDataAnalysis.TaintedDataOperationVisitor.cs (5)
140Debug.Fail("Can we have a tainted data parameter with no syntax references?"); 326Debug.Fail("Are the tainted data sources misconfigured?"); 365Debug.Fail("Are the tainted data sources misconfigured?"); 404Debug.Fail("Are the tainted data sanitizers misconfigured?"); 464Debug.Assert(!this.TryGetInterproceduralAnalysisResult(invocationOperation, out _));
src\40daf5e1cab76dff\TaintedDataAnalysisContext.cs (2)
57Debug.Assert(pointsToAnalysisResult != null); 80Debug.Assert(pointsToAnalysisResult != null);
src\440320f3f10733a8\ValueContentAbstractValue.cs (4)
203Debug.Assert(value1 == ValueContainsNonLiteralState.No); 204Debug.Assert(value2 == ValueContainsNonLiteralState.No); 240Debug.Assert(IsLiteralState); 241Debug.Assert(value2.IsLiteralState);
src\440320f3f10733a8\ValueContentAnalysis.CoreAnalysisDataDomain.cs (2)
51Debug.Assert(Compare(forwardEdgeAnalysisData, resultMap) <= 0); 52Debug.Assert(Compare(backEdgeAnalysisData, resultMap) <= 0);
src\440320f3f10733a8\ValueContentAnalysis.cs (1)
63Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, wellKnownTypeProvider.Compilation));
src\440320f3f10733a8\ValueContentAnalysis.ValueContentAnalysisDomain.cs (1)
34Debug.Assert(forwardEdgeAnalysisData.IsReachableBlockData == backEdgeAnalysisData.IsReachableBlockData);
src\440320f3f10733a8\ValueContentAnalysisContext.cs (1)
81Debug.Assert(valueContentAnalysisResult == null);
src\47c588c5b8785708\ParameterValidationAnalysis.cs (1)
40Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, compilation));
src\47c588c5b8785708\ParameterValidationAnalysis.ParameterValidationDataFlowOperationVisitor.cs (7)
32Debug.Assert(analysisContext.OwningSymbol.Kind == SymbolKind.Method); 33Debug.Assert(analysisContext.PointsToAnalysisResult != null); 174Debug.Assert(_hazardousParameterUsageBuilder != null); 191Debug.Assert(IsNotOrMaybeValidatedLocation(location)); 288Debug.Assert(!targetMethod.IsLambdaOrLocalFunctionOrDelegate()); 317Debug.Assert(!targetMethod.IsVirtual && !targetMethod.IsOverride); 356Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or MethodKind.LocalFunction);
src\47c588c5b8785708\ParameterValidationAnalysisContext.cs (3)
75Debug.Assert(pointsToAnalysisResult != null); 76Debug.Assert(copyAnalysisResult == null); 77Debug.Assert(valueContentAnalysisResult == null);
src\8ce1f4f68b646e6d\GlobalFlowStateAnalysis.GlobalFlowStateAnalysisValueSetDomain.cs (5)
77Debug.Assert(value1.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 78Debug.Assert(value2.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 143Debug.Assert(value1.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 144Debug.Assert(value2.Kind == GlobalFlowStateAnalysisValueSetKind.Known); 227Debug.Assert(value1.Height == value2.Height);
src\8ce1f4f68b646e6d\GlobalFlowStateAnalysisValueSet.cs (13)
31Debug.Assert((!analysisValues.IsEmpty || !parents.IsEmpty) == (kind == GlobalFlowStateAnalysisValueSetKind.Known)); 32Debug.Assert(analysisValues.All(value => value != default)); 33Debug.Assert(parents.All(parent => parent != null)); 34Debug.Assert(height >= 0); 35Debug.Assert(height == 0 || kind == GlobalFlowStateAnalysisValueSetKind.Known); 36Debug.Assert(height == 0 == parents.IsEmpty); 49Debug.Assert(!analysisValues.IsEmpty || !parents.IsEmpty); 63Debug.Assert(Kind == GlobalFlowStateAnalysisValueSetKind.Known); 87Debug.Assert(Kind != GlobalFlowStateAnalysisValueSetKind.Unknown); 105Debug.Assert(Kind == GlobalFlowStateAnalysisValueSetKind.Known); 133Debug.Assert(AnalysisValues.Count > 1); 134Debug.Assert(parentsBuilder.Count > 1); 143Debug.Assert(parents.Count > 0);
src\8ce1f4f68b646e6d\GlobalFlowStateDataFlowOperationVisitor.cs (1)
85Debug.Assert(input.ContainsKey(GlobalEntity));
src\8ce1f4f68b646e6d\GlobalFlowStateValueSetFlowOperationVisitor.cs (2)
44Debug.Assert(HasPredicatedGlobalState || !negate); 62Debug.Assert(HasPredicatedGlobalState || value.Parents.IsEmpty);
src\9382845807600969\AbstractDataFlowAnalysisContext.cs (5)
45Debug.Assert(owningSymbol.Kind is SymbolKind.Method or 49Debug.Assert(Equals(owningSymbol.OriginalDefinition, owningSymbol)); 50Debug.Assert(pointsToAnalysisResult == null || 52Debug.Assert(copyAnalysisResult == null || 54Debug.Assert(valueContentAnalysisResult == null ||
src\9382845807600969\AbstractLocationDataFlowOperationVisitor.cs (5)
24Debug.Assert(analysisContext.PointsToAnalysisResult != null); 42Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData != null); 68Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 98Debug.Assert(Equals(analysisEntity.Symbol, parameter)); 108Debug.Assert(SymbolEqualityComparer.Default.Equals(analysisEntity.Symbol, parameter));
src\9382845807600969\AnalysisEntityBasedPredicateAnalysisData.cs (5)
43Debug.Assert(data1.IsReachableBlockData == data2.IsReachableBlockData); 74Debug.Assert(baseCompareResult < 0, "Non-monotonic Merge function"); 79Debug.Assert(coreAnalysisDataCompareResult <= 0, "Non-monotonic Merge function"); 94Debug.Assert(!CoreAnalysisData.IsDisposed); 95AssertValidPredicatedAnalysisData(map => Debug.Assert(!map.IsDisposed));
src\9382845807600969\AnalysisEntityDataFlowOperationVisitor.cs (21)
33Debug.Assert(!analysisContext.PredicateAnalysis || SupportsPredicateAnalysis); 65Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 81Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 102Debug.Assert(locals.Any() || flowCaptures.Any()); 118Debug.Fail("TryCreateForSymbolDeclaration failed"); 156Debug.Assert(analysisEntity.Symbol is IParameterSymbol parameter && parameter.IsParams); 257Debug.Assert(success || assignedValueEntity == null); 279Debug.Assert(addressSharedCopyValue.AnalysisEntities.Contains(targetAnalysisEntity)); 293Debug.Assert(SymbolEqualityComparer.Default.Equals(analysisEntity.Symbol, parameter)); 306Debug.Assert(Equals(analysisEntity.Symbol, parameter)); 327Debug.Assert(HasPointsToAnalysisResult); 328Debug.Assert(analysisEntity.Type.HasValueCopySemantics()); 336Debug.Assert(HasPointsToAnalysisResult); 361Debug.Assert(HasPointsToAnalysisResult); 362Debug.Assert(targetAnalysisEntity.Type.HasValueCopySemantics()); 410Debug.Assert(analysisEntity.Type.HasValueCopySemantics()); 570Debug.Assert(ShouldProcessPointsToValue(pointsToValue)); 687Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData != null); 741Debug.Assert(throwBranchWithExceptionType.ExceptionType.Equals(ExceptionNamedType)); 768Debug.Assert(tupleOperation.Elements.Length == tupleElementEntities.Length); 775Debug.Assert(tupleElementEntity.Symbol is IFieldSymbol field);
src\9382845807600969\AnalysisEntityMapAbstractDomain.cs (16)
98Debug.Assert(!map2.ContainsKey(key1)); 99Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 163Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 164Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 184Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 185Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 193Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 205Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 212Debug.Assert(!map1.ContainsKey(newKey)); 213Debug.Assert(!map2.ContainsKey(newKey)); 225Debug.Assert(Compare(map1, resultMap) <= 0); 226Debug.Assert(Compare(map2, resultMap) <= 0); 246Debug.Assert(values.Count > 0); 258Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0); 259Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0); 266Debug.Assert(isNewKey == (!map1.ContainsKey(key) && !map2.ContainsKey(key)));
src\9382845807600969\PerEntityPredicatedAnalysisData.cs (1)
21Debug.Assert(truePredicatedData != null || falsePredicatedData != null);
src\9382845807600969\PredicateAnalysisEntityDataFlowOperationVisitor.cs (2)
29Debug.Assert(PredicateAnalysis); 32Debug.Assert(!isReachable || predicatedData.IsReachableBlockData);
src\afc74d572e54ec72\DisposeAnalysis.DisposeAbstractValueDomain.cs (3)
82Debug.Assert(!mergedDisposingOperations.IsEmpty); 88Debug.Assert(!value1.DisposingOrEscapingOperations.IsEmpty || !value2.DisposingOrEscapingOperations.IsEmpty); 155Debug.Fail($"Unhandled dispose value kind merge: {value1.Kind} and {value2.Kind}");
src\afc74d572e54ec72\DisposeAnalysis.DisposeDataFlowOperationVisitor.cs (8)
33Debug.Assert(IDisposableNamedType != null); 34Debug.Assert(CollectionNamedTypes.All(ct => ct.TypeKind == TypeKind.Interface)); 35Debug.Assert(analysisContext.DisposeOwnershipTransferLikelyTypes != null); 36Debug.Assert(analysisContext.PointsToAnalysisResult != null); 178Debug.Assert(!escapedLocations.IsEmpty); 179Debug.Assert(parameter.RefKind != RefKind.None); 187Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 424Debug.Assert(disposedState == DisposeAbstractValue.NotDisposed);
src\ffd9070534249528\PointsToAnalysis.CorePointsToAnalysisDataDomain.cs (2)
120Debug.Assert(Compare(forwardEdgeAnalysisData.CoreAnalysisData, resultMap) <= 0); 121Debug.Assert(Compare(backEdgeAnalysisData.CoreAnalysisData, resultMap) <= 0);
src\ffd9070534249528\PointsToAnalysis.PointsToAbstractValueDomain.cs (5)
126Debug.Assert(value2.Kind == PointsToAbstractValueKind.KnownLValueCaptures); 132Debug.Assert(value1.Kind == PointsToAbstractValueKind.KnownLocations); 133Debug.Assert(value2.Kind == PointsToAbstractValueKind.KnownLocations); 140Debug.Assert(Compare(value1, result) <= 0); 141Debug.Assert(Compare(value2, result) <= 0);
src\ffd9070534249528\PointsToAnalysis.PointsToAnalysisDomain.cs (1)
38Debug.Assert(forwardEdgeAnalysisData.IsReachableBlockData == backEdgeAnalysisData.IsReachableBlockData);
src\ffd9070534249528\PointsToAnalysis.PointsToDataFlowOperationVisitor.cs (16)
88Debug.Assert(!ShouldBeTracked(analysisEntity)); 89Debug.Assert(!CurrentAnalysisData.TryGetValue(analysisEntity, out var existingValue) || existingValue == PointsToAbstractValue.NoLocation); 174Debug.Assert(ShouldBeTracked(analysisEntity) || !HasAbstractValue(analysisEntity)); 180Debug.Assert(value == _defaultPointsToValueGenerator.GetOrCreateDefaultValue(analysisEntity)); 181Debug.Assert(!CurrentAnalysisData.TryGetValue(analysisEntity, out var currentValue) || 251Debug.Assert(DataFlowAnalysisContext.InterproceduralAnalysisData == null); 279Debug.Assert(operation.Type == null || !operation.Type.IsNonNullableValueType() || defaultValue == PointsToAbstractValue.NoLocation); 286Debug.Assert(operation.Parameter!.RefKind is RefKind.Ref or RefKind.Out); 448Debug.Assert(!targetAnalysisData.HasAbstractValue(key)); 449Debug.Assert(!sourceAnalysisData.HasAbstractValue(key)); 511Debug.Assert(IsValidValueForPredicateAnalysis(nullState) || nullState == NullAbstractValue.Invalid); 560Debug.Assert(IsValidValueForPredicateAnalysis(value)); 788Debug.Assert(value.NullState == NullAbstractValue.NotNull || DataFlowAnalysisContext.InterproceduralAnalysisData != null); 890Debug.Assert(operation.Initializer == null || initializerValue == pointsToAbstractValue); 1190Debug.Assert(!inference.AlwaysSucceed || !inference.AlwaysFail); 1211Debug.Assert(!inference.IsUnboxing);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CachingBase`1.cs (1)
36Debug.Assert(size > 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (3)
61Debug.Assert(child.Symbol.Kind == SymbolKind.Namespace); 62Debug.Assert(!child.Children.IsEmpty); 63Debug.Assert(child.Children.All(grandChild => grandChild.Symbol.Kind == SymbolKind.NamedType));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
36Debug.Assert( 44Debug.Assert(depthOfInheritance.HasValue == (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace || symbol.Kind == SymbolKind.NamedType));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
27Debug.Assert(childrenCount != 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Debug.cs (4)
11/// <inheritdoc cref="Debug.Assert(bool)"/> 13public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 15/// <inheritdoc cref="Debug.Assert(bool, string)"/> 18=> Debug.Assert(b, message);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\DiagnosticDescriptorHelper.cs (2)
27Debug.Assert(!isDataflowRule || ruleLevel == RuleLevel.Disabled || ruleLevel == RuleLevel.CandidateForRemoval); 30Debug.Assert(isEnabledByDefaultInAggressiveMode || ruleLevel == RuleLevel.Disabled || ruleLevel == RuleLevel.CandidateForRemoval);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
664Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 676Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\IOperationExtensions.cs (10)
324Debug.Assert(isInsideAnonymousObjectInitializer == 459Debug.Assert(success); 460Debug.Assert(cfg != null); 491Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 503Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 855Debug.Assert(parameterIndex >= 0); 856Debug.Assert(parameterIndex < arguments.Length); 896Debug.Assert(parameterOrderedArguments[argument.Parameter.Ordinal] == null); 991Debug.Fail("Unhandled declaration pattern context"); 1012Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Extensions\ISymbolExtensions.cs (1)
553Debug.Assert(symbol.IsOverride);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
47Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
41Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
36Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
64Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 142Debug.Assert(parts.SymbolName[^1] == WildcardChar); 143Debug.Assert(parts.SymbolName.Length >= 2);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\ArrayBuilder.cs (2)
334Debug.Assert(builder.Count == 0); 480Debug.Assert(limit <= Count);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\ObjectPool.cs (3)
116Debug.Assert(size >= 1); 272Debug.Assert(_firstItem != obj, "freeing twice?"); 283Debug.Assert(value != obj, "freeing twice?");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
70Debug.Assert(instance.IsEmpty); 80Debug.Assert(added);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
98Debug.Assert(instance.Count == 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledHashSet.cs (1)
79Debug.Assert(instance.Count == 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
67Debug.Assert(instance.Count == 0);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
101Debug.Assert(rulesetNode.Name == RuleSetNodeName); 130Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\SmallDictionary.cs (2)
426Debug.Assert(unbalanced != currentNode); 432Debug.Assert(n.HashCode != hashCode);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\WellKnownTypeProvider.cs (1)
94Debug.Assert(result
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\Extensions\BasicBlockExtensions.cs (1)
217Debug.Assert(ordinal < basicBlock.Ordinal);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\Extensions\ControlFlowConditionKindExtensions.cs (1)
21Debug.Fail($"Unsupported conditional kind: '{controlFlowConditionKind}'");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAbstractValue.cs (10)
23Debug.Assert(analysisEntities.IsEmpty != kind.IsKnown()); 24Debug.Assert(kind != CopyAbstractValueKind.KnownReferenceCopy || analysisEntities.All(a => !a.Type.IsValueType)); 40Debug.Assert(!kind.IsKnown()); 53Debug.Assert(!analysisEntities.IsEmpty); 58Debug.Assert(AnalysisEntities.Contains(entityToRemove)); 59Debug.Assert(AnalysisEntities.Count > 1); 60Debug.Assert(Kind.IsKnown()); 67Debug.Assert(entitiesToRemove.All(AnalysisEntities.Contains)); 68Debug.Assert(AnalysisEntities.Count > 1); 69Debug.Assert(Kind.IsKnown());
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysis.cs (1)
40Debug.Fail("Expected non-null CFG");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\CopyAnalysis\CopyAnalysisData.cs (10)
51Debug.Assert(IsReachableBlockData || !data.IsReachableBlockData); 92Debug.Assert(HasPredicatedData); 168Debug.Assert(newCopyEntities.SetEquals(currentValue.AnalysisEntities)); 179Debug.Assert(predicatedData.All(kvp => kvp.Value.AnalysisEntities.IsSubsetOf(coreAnalysisData[kvp.Key].AnalysisEntities))); 205Debug.Assert(!coreCopyAnalysisData.IsDisposed); 211Debug.Assert(kvp.Value.AnalysisEntities.Contains(kvp.Key)); 215Debug.Assert(map[analysisEntity] == kvp.Value); 227Debug.Assert(kvp.Value.AnalysisEntities.Contains(defaultCopyValyeEntity)); 228Debug.Assert(map.ContainsKey(defaultCopyValyeEntity)); 238Debug.Assert(!analysisEntity.HasUnknownInstanceLocation, "Don't track entities if do not know about it's instance location");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAbstractValue.cs (6)
25Debug.Assert(kind != DisposeAbstractValueKind.Disposed); 37Debug.Assert(Kind != DisposeAbstractValueKind.NotDisposable); 44Debug.Assert(Kind != DisposeAbstractValueKind.NotDisposable); 45Debug.Assert(Kind != DisposeAbstractValueKind.Unknown); 59Debug.Assert(disposingOrEscapingOperations.IsEmpty); 65Debug.Assert(!disposingOrEscapingOperations.IsEmpty);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysis.cs (2)
57Debug.Assert(!analyzerOptions.IsConfiguredToSkipAnalysis(rule, owningSymbol, wellKnownTypeProvider.Compilation)); 98Debug.Assert(wellKnownTypeProvider.TryGetOrCreateTypeByMetadataName(WellKnownTypeNames.SystemIDisposable, out _));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\DisposeAnalysis\DisposeAnalysisContext.cs (3)
98Debug.Assert(pointsToAnalysisResult != null); 99Debug.Assert(copyAnalysisResult == null); 100Debug.Assert(valueContentAnalysisResult == null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAbstractValue.cs (18)
32Debug.Assert(!locations.IsEmpty); 33Debug.Assert(locations.All(location => !location.IsNull) || nullState != NullAbstractValue.NotNull); 34Debug.Assert(nullState != NullAbstractValue.Undefined); 35Debug.Assert(nullState != NullAbstractValue.Invalid); 36Debug.Assert(!locations.Any(l => l.IsAnalysisEntityDefaultLocation && l.AnalysisEntity!.HasUnknownInstanceLocation)); 37Debug.Assert(locations.Count <= LocationThreshold); 47Debug.Assert(!lValueCapturedOperations.IsEmpty); 57Debug.Assert(kind != PointsToAbstractValueKind.KnownLocations); 58Debug.Assert(kind != PointsToAbstractValueKind.KnownLValueCaptures); 68Debug.Assert(!location.IsNull, "Use 'PointsToAbstractValue.NullLocation' singleton"); 69Debug.Assert(!location.IsNoLocation, "Use 'PointsToAbstractValue.NoLocation' singleton"); 81Debug.Assert(!locations.IsEmpty); 113Debug.Assert(!lValueCapturedOperations.IsEmpty); 119Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 146Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 163Debug.Assert(Kind != PointsToAbstractValueKind.KnownLValueCaptures); 164Debug.Assert(NullState != NullAbstractValue.Null); 176Debug.Assert(Locations.All(location => !location.IsNull));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysis.cs (2)
72Debug.Fail("Expected non-null CFG"); 99Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisContext.cs (3)
41Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None); 75Debug.Assert(pointsToAnalysisResult == null); 76Debug.Assert(valueContentAnalysisResult == null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\PointsToAnalysisData.cs (6)
75Debug.Assert(IsReachableBlockData || !data.IsReachableBlockData); 107Debug.Assert(key.CaptureId == null); 125Debug.Assert(!corePointsToAnalysisData.IsDisposed); 140Debug.Assert(value.Kind != PointsToAbstractValueKind.Undefined); 141Debug.Assert(!key.IsLValueFlowCaptureEntity || value.Kind == PointsToAbstractValueKind.KnownLValueCaptures); 142Debug.Assert(PointsToAnalysis.ShouldBeTracked(key, PointsToAnalysisKind.Complete, isDisposable));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PointsToAnalysis\TrackedEntitiesBuilder.cs (2)
32Debug.Assert(pointsToAnalysisKind != PointsToAnalysisKind.None); 49Debug.Assert(analysisEntity.ShouldBeTrackedForPointsToAnalysis(PointsToAnalysisKind));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAnalysis.cs (2)
202Debug.Assert(success); 205Debug.Fail("Expected non-null CFG");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataAnalysis.cs (1)
55Debug.Fail("Expected non-null CFG");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataConfig.cs (4)
199Debug.Fail($"SinkKind {sinkKind} entry missing from {typeof(T).Name} map"); 250Debug.Fail($"Unhandled SinkKind {sinkKind}"); 306Debug.Fail($"Unhandled SinkKind {sinkKind}"); 361Debug.Fail($"Unhandled SinkKind {sinkKind}");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Analysis\TaintedDataAnalysis\TaintedDataSymbolMap.cs (1)
115Debug.Fail("Expected non-null 'namedTypeSymbol'");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractDomain.cs (1)
58Debug.Fail("Non-monotonic merge");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AbstractLocation.cs (4)
36Debug.Assert(isSpecialSingleton ^ (locationType != null)); 49Debug.Assert(creation != null ^ symbol != null ^ analysisEntity != null ^ captureId != null); 50Debug.Assert(locationType != null); 128Debug.Assert(Creation != null);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AddressSharedEntitiesProvider.cs (1)
83Debug.Assert(builder.All(e => !e.HasUnknownInstanceLocation));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntity.cs (16)
48Debug.Assert(!indices.IsDefault); 49Debug.Assert(symbol != null || !indices.IsEmpty || instanceReferenceOperationSyntax != null || captureId.HasValue); 50Debug.Assert(parent == null || parent.Type.HasValueCopySemantics() || !indices.IsEmpty); 51Debug.Assert(entityForInstanceLocation == null || parent == null); 52Debug.Assert(entityForInstanceLocation == null || location.Kind == PointsToAbstractValueKind.KnownLocations); 71Debug.Assert(symbol != null || !indices.IsEmpty); 78Debug.Assert(instanceReferenceOperation != null); 96Debug.Assert(symbol != null || !indices.IsEmpty); 97Debug.Assert(parent == null || parent.InstanceLocation == instanceLocation); 98Debug.Assert(entityForInstanceLocation == null || instanceLocation.Kind == PointsToAbstractValueKind.KnownLocations); 118Debug.Assert(instanceLocation.Locations.Count == 1); 119Debug.Assert(instanceLocation.Locations.Single().Creation == null); 120Debug.Assert(Equals(instanceLocation.Locations.Single().Symbol, typeSymbol)); 127Debug.Assert(EqualsIgnoringInstanceLocation(analysisEntityToMerge)); 128Debug.Assert(!InstanceLocation.Equals(analysisEntityToMerge.InstanceLocation)); 159Debug.Assert(Parent == null || result);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityFactory.cs (8)
311Debug.Assert(symbol.Kind is SymbolKind.Local or SymbolKind.Parameter or SymbolKind.Field or SymbolKind.Property); 350Debug.Assert(parentTupleOperationOpt.Elements.Length == parentTupleElementEntities.Length); 370Debug.Assert(parentEntity.InstanceLocation == instanceLocation); 397Debug.Assert(!indices.IsEmpty); 419Debug.Assert(_interproceduralCallStack.Last().Descendants().Contains(flowCaptureOrReference)); 423Debug.Assert(_controlFlowGraph.DescendantOperations().Contains(flowCaptureOrReference)); 440Debug.Assert(symbol != null || !indices.IsEmpty); 517Debug.Assert(symbol.Kind == SymbolKind.Local || symbol.Kind == SymbolKind.Parameter || symbol.IsStatic || symbol.IsLambdaOrLocalFunction());
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysis.cs (19)
231Debug.Assert(tryRegion.Kind == ControlFlowRegionKind.Try); 258Debug.Assert(needsAtLeastOnePass); 265Debug.Assert(!currentInfeasibleData.IsDisposed); 276Debug.Assert(enclosingTryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 277Debug.Assert(block.EnclosingRegion.Kind is ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter); 278Debug.Assert(block.EnclosingRegion.FirstBlockOrdinal == block.Ordinal); 279Debug.Assert(!catchBlockInput.IsDisposed); 350Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 378Debug.Assert(!ReferenceEquals(dataToDispose, newSuccessorInput)); 426Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 437Debug.Assert(currentSuccessorInput == null || AnalysisDomain.Compare(currentSuccessorInput, newSuccessorInput) <= 0); 453Debug.Assert(dominatorBlockOrdinal >= block.Ordinal); 454Debug.Assert(dominatorBlockOrdinal >= successorBlock.Ordinal); 468Debug.Assert(IsValidWorklistState()); 490Debug.Assert(tryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 535Debug.Assert(compare <= 0, "The newly computed abstract value must be greater or equal than the previous one."); 625Debug.Assert(basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Finally); 727Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 781Debug.Assert(builder[block] == null || AnalysisDomain.Compare(builder[block]!, newInput) <= 0, "Non-monotonic update");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysisResult.cs (4)
107Debug.Assert(operation.GetRoot() != ControlFlowGraph.OriginalOperation, 117Debug.Assert(operation.GetAncestor<IBlockOperation>(OperationKind.Block, predicate: b => b.Parent == null) == null); 158Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 169Debug.Assert(lambdaOrLocalFunctionOperation.Kind is OperationKind.AnonymousFunction or OperationKind.LocalFunction);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (103)
174Debug.Assert(!_currentAnalysisData.IsDisposed); 179Debug.Assert(!value.IsDisposed); 188Debug.Assert(_currentBasicBlock != null); 231Debug.Assert(ExceptionNamedType != null); 427Debug.Assert(_pendingArgumentsToReset.Count == 0); 428Debug.Assert(_pendingArgumentsToPostProcess.Count == 0); 548Debug.Assert(entryBlock.Kind == BasicBlockKind.Entry); 561Debug.Assert(result); 581Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit); 631Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction); 632Debug.Assert(DataFlowAnalysisContext.ControlFlowGraph.LocalFunctions.Contains(localFunction)); 640Debug.Assert(_visitedLambdas.Contains(lambda)); 648Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit); 742Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None); 785Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None); 820Debug.Assert(implicitTaskPointsToValueOpt.Kind == PointsToAbstractValueKind.KnownLocations); 849Debug.Assert(ExecutingExceptionPathsAnalysisPostPass); 850Debug.Assert(!SkipExceptionPathsAnalysisPostPass); 929Debug.Assert(ExecutingExceptionPathsAnalysisPostPass); 930Debug.Assert(!SkipExceptionPathsAnalysisPostPass); 959Debug.Assert(locals.Any() || flowCaptures.Any()); 1001/// Checks if the method is an overload of the <see cref="Debug.Assert(bool)"/> method. 1004/// <returns>True if the method is an overlaod of the <see cref="Debug.Assert(bool)"/> method.</returns> 1138Debug.Assert(parameterEntity.Symbol?.Kind == SymbolKind.Parameter); 1151Debug.Assert(CurrentBasicBlock.Kind == BasicBlockKind.Entry); 1299Debug.Fail($"Unexpected 'null' target type for '{operation.Syntax}'"); 1355Debug.Assert(PredicateAnalysis); 1361Debug.Assert(PredicateAnalysis); 1385Debug.Assert(PredicateAnalysis); 1386Debug.Assert(operation.Kind is OperationKind.BinaryOperator or 1421Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 1433Debug.Assert(result); 1436Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity)); 1450Debug.Assert(!ReferenceEquals(truePredicatedData, CurrentAnalysisData)); 1455Debug.Assert(!ReferenceEquals(falsePredicatedData, CurrentAnalysisData)); 1459Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData"); 1488Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation)); 1526Debug.Assert(targetEntity.CaptureId != null); 1543Debug.Assert(PredicateAnalysis); 1544Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None); 1638Debug.Fail($"Unknown pattern kind '{isPatternOperation.Pattern.Kind}'"); 1667Debug.Assert(IsContractCheckArgument(argument)); 1681Debug.Assert(result); 1824Debug.Assert(PredicateAnalysis); 1849Debug.Assert(PredicateAnalysis); 1850Debug.Assert(operation.IsComparisonOperator()); 1851Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None); 1893Debug.Assert(PredicateAnalysis); 1899Debug.Assert(PredicateAnalysis); 1905Debug.Assert(PredicateAnalysis); 1911Debug.Assert(PredicateAnalysis); 1920Debug.Assert(PredicateAnalysis); 1926Debug.Assert(PredicateAnalysis); 1932Debug.Assert(PredicateAnalysis); 1948Debug.Assert(IsLValueFlowCaptureReference(flowCaptureReference)); 2023Debug.Assert(HasPointsToAnalysisResult); 2024Debug.Assert(operation.Type!.HasValueCopySemantics()); 2042Debug.Assert(HasPointsToAnalysisResult); 2043Debug.Assert(!operation.Type!.HasValueCopySemantics()); 2265Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2266Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2267Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 2330Debug.Assert(arguments.All(arg => !_pendingArgumentsToReset.Contains(arg))); 2345Debug.Assert(popped == originalOperation); 2392Debug.Assert(arguments.All(_pendingArgumentsToReset.Contains)); 2482Debug.Assert(originalOperation.Kind == OperationKind.ObjectCreation); 2513Debug.Assert(arguments.Length == invokedMethod.Parameters.Length); 2555Debug.Assert(invokedMethod.Parameters.Length == method.GetParameters().Length || 2621Debug.Assert(success); 2632Debug.Assert(IsStandaloneAnalysisRequiredForLocalFunction(localFunction)); 2650Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2651Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2652Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 2682Debug.Assert(IsStandaloneAnalysisRequiredForLambda(lambda)); 2700Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph); 2701Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph); 2702Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph); 2997Debug.Assert(result); 3006Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity)); 3032Debug.Assert(flowCaptureEntity.CaptureId != null); 3076Debug.Assert(FlowBranchConditionKind == ControlFlowConditionKind.None); 3155Debug.Assert(operation.Initializer == null, "Object or collection initializer must have been lowered in the CFG"); 3238Debug.Assert(!arguments.IsEmpty); 3257Debug.Assert(arguments.Length >= 2); 3281Debug.Assert(IsPointsToAnalysis); 3325Debug.Assert(operation != null ^ invocationTarget != null); 3336Debug.Assert(invocation.Instance == null); 3344Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or 3378Debug.Assert(knownTargetInvocations); 3385Debug.Assert(knownTargetInvocations); 3392Debug.Assert(knownTargetInvocations); 3414Debug.Assert(knownTargetInvocations); 3459Debug.Assert(methodTargetsOptBuilder.Count > 0 || lambdaTargets.Count > 0); 3477Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData)); 3489Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData)); 3493Debug.Assert(mergedCurrentAnalysisData == null || ReferenceEquals(mergedCurrentAnalysisData, CurrentAnalysisData)); 3584Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation)); 3602Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation)); 3679Debug.Assert(elementEntities.Length == elementValueBuilder.Count); 3680Debug.Assert(elementEntities.Length == operation.Elements.Length); 3758Debug.Assert(caughtExceptionType != null || CurrentBasicBlock.IsFirstBlockOfFinally(out _)); 3791Debug.Assert(CurrentBasicBlock.IsFirstBlockOfFinally(out _)); 3825Debug.Assert(operation.Kind == OperationKind.YieldReturn, "IReturnOperation must have been lowered in the CFG");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DictionaryAnalysisData.cs (17)
34Debug.Assert(!IsDisposed); 42Debug.Assert(!IsDisposed); 47Debug.Assert(!IsDisposed); 56Debug.Assert(!IsDisposed); 70Debug.Assert(!IsDisposed); 79Debug.Assert(!IsDisposed); 86Debug.Assert(!IsDisposed); 92Debug.Assert(!IsDisposed); 98Debug.Assert(!IsDisposed); 104Debug.Assert(!IsDisposed); 110Debug.Assert(!IsDisposed); 116Debug.Assert(!IsDisposed); 122Debug.Assert(!IsDisposed); 128Debug.Assert(!IsDisposed); 134Debug.Assert(!IsDisposed); 142Debug.Assert(!IsDisposed); 148Debug.Assert(!IsDisposed);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\LValueFlowCapturesProvider.cs (1)
70Debug.Fail("Flow capture used as both an r-value and an l-value?");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\MapAbstractDomain.cs (1)
92Debug.Fail("Non-monotonic merge");
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\PredicatedAnalysisData.cs (12)
63Debug.Assert(!_lazyPredicateDataMap.IsDisposed); 69Debug.Assert(!value.TruePredicatedData.IsDisposed); 70Debug.Assert(builder.Add(value.TruePredicatedData)); 75Debug.Assert(!value.FalsePredicatedData.IsDisposed); 76Debug.Assert(builder.Add(value.FalsePredicatedData)); 89Debug.Assert(predicatedEntity.IsCandidatePredicateEntity()); 90Debug.Assert(predicatedEntity.CaptureId != null, "Currently we only support predicated data tracking for flow captures"); 103Debug.Assert(HasPredicatedDataForEntity(predicatedEntity)); 126Debug.Assert(HasPredicatedDataForEntity(fromEntity)); 142Debug.Assert(HasPredicatedDataForEntity(predicatedEntity)); 173Debug.Assert(HasPredicatedData); 435Debug.Assert(_lazyPredicateDataMap.IsDisposed);
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\ThrownExceptionInfo.cs (2)
48Debug.Assert(enclosingRegion.NestedRegions[0].Kind == ControlFlowRegionKind.Try); 69Debug.Assert(interproceduralCallStack != InterproceduralCallStack);
Microsoft.CodeAnalysis.Razor.Compiler (306)
CSharp\DefaultTagHelperDescriptorFactory.cs (1)
327Debug.Assert(result.Length == 2 || result.Length == 0,
CSharp\RequiredAttributeParser.cs (4)
104Debug.Assert(!AtEnd, "Cannot move past the end of the input."); 176Debug.Assert(_diagnostics.Length == 0, "Diagnostics should only be added if we fail to parse."); 250Debug.Assert(At('[')); 329Debug.Assert(!AtEnd);
CSharp\SymbolExtensions.cs (1)
93Debug.Assert(endIndex >= 0, "Symbol name ends in '<' but does not contain '>'!");
Language\AllowedChildTagDescriptor.cs (2)
35Debug.Assert(parent != null); 36Debug.Assert(_parent == null);
Language\BoundAttributeDescriptor.cs (2)
111Debug.Assert(parent != null); 112Debug.Assert(_parent == null);
Language\BoundAttributeParameterDescriptor.cs (2)
65Debug.Assert(parent != null); 66Debug.Assert(_parent == null);
Language\CodeGeneration\CodeWriter.cs (7)
161Debug.Fail("Do not use this indexer without reimplementing it more efficiently."); 411Debug.Assert(chunkIndex >= 0); 412Debug.Assert(charIndex >= 0); 504Debug.Assert(page is not null); 505Debug.Assert(chunkIndex >= 0); 506Debug.Assert(charIndex >= 0); 538Debug.Assert(destination.Length == 0, "We didn't fill the whole span!");
Language\CodeGeneration\CodeWriter.WriteInterpolatedStringHandler.cs (1)
81Debug.Assert(!typeof(T).IsValueType, $"Handle {typeof(T).FullName} to avoid boxing to {nameof(IWriteableValue)}");
Language\CodeGeneration\CodeWriterExtensions.cs (6)
207Debug.Assert(group >= 0 && group < 1000, "Digit group should be in the range [0, 999]"); 211Debug.Assert(!first, "The first group should never be 0."); 692Debug.Assert(context == null || context.CodeWriter == writer); 911Debug.Assert(index == -1); // We've hit all of the double-quotes. 967Debug.Assert(false, "Unknown escape character."); 974Debug.Assert(index == -1); // We've hit all of chars that need escaping.
Language\Components\ComponentDiagnosticFactory.cs (5)
225Debug.Assert(childContent1.ParameterName == childContent2.ParameterName); 226Debug.Assert(childContent1.IsParameterized); 227Debug.Assert(childContent2.IsParameterized); 249Debug.Assert(component.Component.IsGenericTypedComponent()); 266Debug.Assert(component.Component.IsGenericTypedComponent());
Language\Components\ComponentGenericTypePass.cs (2)
350Debug.Assert(bindings != null || hasTypeArgumentSpecified == true); 357Debug.Assert(attribute.TypeName is not null);
Language\Components\ComponentInjectDirectivePass.cs (2)
33Debug.Assert(hasType || isMalformed); 38Debug.Assert(hasMemberName || isMalformed);
Language\Components\ComponentLoweringPass.cs (1)
347Debug.Assert(node.StartTagSpan.HasValue, "Component tags should always have a start tag span.");
Language\Components\ComponentMarkupEncodingPass.cs (1)
196Debug.Assert(builder.Length > 0, "How could builder be empty if content was not?");
Language\Components\ComponentNodeWriter.cs (8)
831Debug.Assert(!hasFormName); 868Debug.Assert(_currentAttributeValues.Count == 0); 1051Debug.Assert(!hasRenderMode); 1288Debug.Assert(attribute.BoundAttribute?.ContainingType is not null); 1298Debug.Assert(node.HasDiagnostics, "We should have reported an error for mixed content."); 1590Debug.Assert(node.HasDiagnostics, "We should have reported an error for mixed content."); 1761Debug.Assert(token is HtmlIntermediateToken); 1789Debug.Assert(token is HtmlIntermediateToken);
Language\Components\ComponentRenderModeDirectivePass.cs (2)
34Debug.Assert(directives.Length == 1); 119Debug.Assert(@namespace.Children.Count == childCount + 1);
Language\Components\ScopeStack.cs (1)
70Debug.Assert(_stack is not null && _stack.Count > 0);
Language\DefaultRazorIntermediateNodeLoweringPhase.cs (1)
199Debug.Assert(!imports.IsDefaultOrEmpty);
Language\DefaultRazorProjectFileSystem.cs (1)
152Debug.Assert(span.Length == pathSpan.Length, "The span should be the same length as the path.");
Language\DefaultRazorTagHelperContextDiscoveryPhase.cs (2)
267Debug.Assert(!IsInitialized); 430Debug.Assert(!IsInitialized);
Language\DefaultTagHelperResolutionPhase.cs (1)
888Debug.Assert(first.AbsoluteIndex <= last.AbsoluteIndex,
Language\DocumentationDescriptor.FormattedDescriptor.cs (1)
24Debug.Assert(
Language\Extensions\DefaultTagHelperTargetExtension.cs (2)
461Debug.Assert(tagHelperNode.Children.Contains(propertyNode)); 462Debug.Assert(propertyNode.IsIndexerNameMatch);
Language\Extensions\MetadataAttributePass.cs (2)
21Debug.Assert(_identifierFeature is not null); 124Debug.Assert(_identifierFeature != null);
Language\Extensions\PreallocatedAttributeTargetExtension.cs (2)
138Debug.Assert(tagHelperNode.Children.Contains(propertyNode)); 139Debug.Assert(propertyNode.IsIndexerNameMatch);
Language\HtmlConventions.cs (1)
94Debug.Assert(char.IsUpper(input[i]));
Language\Intermediate\IntermediateNodeFormatter.cs (2)
66Debug.Assert(children != null); 91Debug.Assert(key != null);
Language\Intermediate\IntermediateNodeWalker.Stack.cs (2)
46Debug.Assert(!IsEmpty); 64Debug.Assert(_stackPointer == 0, "We should only grow the ancestor stack when the stack pointer reaches 0.");
Language\Intermediate\LazyContent.cs (1)
57Debug.Assert(_contentFactory is not null, "Content factory should not be null at this point.");
Language\Intermediate\ReferenceCaptureIntermediateNode.cs (1)
57Debug.Assert(IsComponentCapture);
Language\Intermediate\TagHelperDirectiveAttributeIntermediateNode.cs (1)
27Debug.Assert(!match.IsParameterMatch);
Language\Legacy\AutoCompleteEditHandler.cs (2)
83Debug.Assert(canCompleteBrace is not null); 88Debug.Assert(canCompleteBrace is null);
Language\Legacy\ClassifiedSpanVisitor.cs (2)
419Debug.Assert(_currentBlock != null, "Current block should not be null when writing a span for a node."); 437Debug.Assert(_currentBlock != null, "Current block should not be null when writing a span for a token.");
Language\Legacy\CSharpCodeParser.cs (14)
254Debug.Assert(_htmlParser != null, "HtmlParser should have been set during initialization"); 429Debug.Assert(TokenBuilder.Count == 0, "We should not have any tokens left."); 1068Debug.Assert(transition.Kind == SyntaxKind.Transition); 1317Debug.Assert(CurrentToken.Kind == SyntaxKind.Identifier || CurrentToken.Kind == SyntaxKind.Keyword); 1318Debug.Assert(string.Equals(CurrentToken.Content, directive, StringComparison.Ordinal)); 2095Debug.Assert(CurrentToken.Kind == SyntaxKind.Keyword && result.HasValue); 2112Debug.Assert(CurrentToken.Kind == SyntaxKind.Keyword && result.HasValue); 2276Debug.Assert(result is CSharpSyntaxKind.CaseKeyword or CSharpSyntaxKind.DefaultKeyword); 2571Debug.Assert(transition != null); 2654Debug.Assert(directiveBuilder.Count == 0, "We should not have built any blocks so far."); 2809Debug.Assert(whitespace.Count == 0, "Expected empty builder."); 3100Debug.Assert(CurrentToken.Kind == SyntaxKind.Transition); 3103Debug.Assert(CurrentToken.Kind is SyntaxKind.Identifier or SyntaxKind.Keyword); 3115Debug.Assert(CurrentToken.Kind == SyntaxKind.Keyword &&
Language\Legacy\DirectiveCSharpTokenizer.cs (2)
34Debug.Assert(Buffer.Length == 0); 45Debug.Assert(Buffer.Length == 0);
Language\Legacy\DirectiveHtmlTokenizer.cs (2)
32Debug.Assert(Buffer.Length == 0); 45Debug.Assert(Buffer.Length == 0);
Language\Legacy\HtmlLanguageCharacteristics.cs (1)
84Debug.Fail("FlipBracket must be called with a bracket character");
Language\Legacy\HtmlMarkupParser.cs (8)
44Debug.Assert(_codeParser != null, "CodeParser should have been set during initialization"); 1160Debug.Assert(nameParsingResult is AttributeNameParsingResult.Success); 1224Debug.Assert(nameTokens.Count == 0); 1612Debug.Assert(CurrentToken.Kind == SyntaxKind.Text && string.Equals(CurrentToken.Content, "cdata", StringComparison.OrdinalIgnoreCase)); 1771Debug.Assert(false, "Unexpected tokens after NullGenerateWhitespaceAndNewLine"); 1883Debug.Assert(EndOfFile); 1890Debug.Assert(whitespaceTokens.Count == 0, "Expected empty builder."); 2203Debug.Assert(right != null);
Language\Legacy\HtmlTokenizer.cs (6)
52Debug.Assert(token.Content == content); 79Debug.Fail("Invalid TokenizerState"); 221Debug.Assert(AtToken()); 249Debug.Assert(CurrentCharacter == '-'); 254Debug.Fail("Unexpected token!"); 271Debug.Assert(SyntaxFacts.IsNewLine(CurrentCharacter));
Language\Legacy\ImplicitExpressionEditHandler.cs (3)
417Debug.Assert(change.IsInsert); 427Debug.Assert(change.IsInsert); 431Debug.Assert(!IsAtEndOfSpan(target, change));
Language\Legacy\NativeCSharpLanguageCharacteristics.cs (1)
169Debug.Fail("FlipBracket must be called with a bracket character");
Language\Legacy\NativeCSharpTokenizer.cs (3)
176Debug.Fail("Invalid TokenizerState"); 693Debug.Assert(Char.IsDigit(CurrentCharacter)); 721Debug.Assert(SyntaxFacts.IsIdentifierStartCharacter(CurrentCharacter));
Language\Legacy\ParserHelpers.cs (1)
100Debug.Assert(entity.Span is ['&',.., ';'], "At this point, entity must start with '&' and end with ';'.");
Language\Legacy\RoslynCSharpLanguageCharacteristics.cs (1)
161Debug.Fail("FlipBracket must be called with a bracket character");
Language\Legacy\RoslynCSharpTokenizer.cs (28)
97Debug.Assert(CurrentState == RoslynCSharpTokenizerState.TriviaForCSharpToken, $"Unexpected state: {CurrentState}"); 98Debug.Assert(_currentCSharpTokenTriviaEnumerator is (_, isLeading: false)); 99Debug.Assert(_resultCache.Count > 0); 136Debug.Assert(_currentCSharpTokenTriviaEnumerator is not null); 140Debug.Fail("Invalid TokenizerState"); 148Debug.Assert(type != SyntaxKind.CSharpOperator, "CSharpOperator should be handled by getting the interned text from C#"); 172Debug.Fail("This should be handled by using the C# lexer's interned string in NumericLiteral()"); 189Debug.Fail("This should be handled by using the C# lexer's interned string in Operator()"); 204Debug.Fail("This should be handled by using the C# lexer's interned string in Operator()"); 220Debug.Assert(leadingTriviaResult.ContextualKind == CSharpSyntaxKind.None); 221Debug.Assert(leadingTriviaResult.Token.IsKind(CSharpSyntaxKind.None)); 315Debug.Assert(nextResult.Token.IsKind(CSharpSyntaxKind.None)); 316Debug.Assert(nextResult.Token.FullSpan.Length == 0); 352Debug.Assert(content == Buffer.ToString()); 408Debug.Assert(expectedPrefix != null); 409Debug.Assert(expectedPostfix != null); 410Debug.Assert(expectedPrefix == expectedPostfix); 440Debug.Assert(expectedPrefix[^1] == '"'); 465Debug.Assert(_currentCSharpTokenTriviaEnumerator is not null); 483Debug.Assert(CurrentCharacter == '@'); 550Debug.Assert(directiveTrivia != null); 617Debug.Assert(currentChar == '#'); 733Debug.Assert(_resultCache.All(r => r.position <= nextResult.Token.FullSpan.Start)); 739Debug.Assert(_resultCache[^1].result is { Token.FullSpan.Length: 0 }); 740Debug.Assert(!nextResult.Token.HasLeadingTrivia); 759Debug.Assert(_resultCache.Count > 0); 777Debug.Assert(isOnlyWhitespaceOnLine == _isOnlyWhitespaceOnLine); 797Debug.Assert(currentPosition > position);
Language\Legacy\SpanEditHandlerBuilder.cs (2)
61Debug.Assert(_currentInstance is null || _currentInstance.Tokenizer == Tokenizer); 79Debug.Assert(_defaultLanguageEditHandler is not null);
Language\Legacy\TagHelperParseTreeRewriter.cs (2)
603Debug.Assert(firstChild is MarkupTextLiteralSyntax); 635Debug.Assert(firstChild is MarkupTextLiteralSyntax);
Language\Legacy\Tokenizer.cs (7)
77Debug.Assert(Buffer.Length == 0); 88Debug.Assert(Buffer.Length == 0); 91Debug.Assert(EndOfFile || !CurrentStart.Equals(CurrentLocation)); 194Debug.Assert(Buffer.Length == 0); 195Debug.Assert(CurrentErrors.Count == 0); 206Debug.Assert(tokenContent == Buffer.ToString(), $"Token content mismatch: '{tokenContent}' != '{Buffer}'. Token Type: '{type}'."); 396Debug.Assert(CurrentCharacter == current, "CurrentCharacter Assumption violated", "Assumed that the current character would be {0}, but it is actually {1}", current, CurrentCharacter);
Language\Legacy\TokenizerBackedParser.cs (6)
184Debug.Assert(!EndOfFile && CurrentToken.Kind == expectedType); 304Debug.Assert(!expectsEmptyBuilder || result.Count == 0, "Expected empty builder."); 323Debug.Assert(result.Count == 0, "Expected empty builder."); 373Debug.Assert(At(SyntaxKind.RazorCommentTransition)); 432Debug.Assert(!EndOfFile && CurrentToken != null); 440Debug.Assert(!EndOfFile && CurrentToken != null && kind == CurrentToken.Kind);
Language\NamespaceComputer.cs (1)
248Debug.Assert(_source != null);
Language\RazorCodeDocument.cs (9)
158Debug.Assert(value is not null); 180Debug.Assert(value is not null); 205Debug.Assert(!value.IsDefault); 206Debug.Assert(value.IsEmpty || value.All(static t => t is not null)); 229Debug.Assert(value is not null); 252Debug.Assert(value is not null); 274Debug.Assert(value is not null); 321Debug.Assert(validateResult, "We couldn't compute the namespace, but have a cached value, so something has gone wrong"); 322Debug.Assert(validateNamespace == @namespace, $"We cached a namespace of {@namespace} but calculated that it should be {validateNamespace}");
Language\RazorCodeDocumentExtensions.cs (1)
163Debug.Assert(directive is RazorUsingDirectiveSyntax || directive.DirectiveBody.Keyword.GetContent() == SyntaxConstants.CSharp.AddTagHelperKeyword);
Language\RazorCSharpDocument.cs (1)
42Debug.Fail("input not sorted");
Language\RazorHtmlWriter.cs (2)
53Debug.Assert( 311Debug.Assert(nextIndex <= text.Length, "The next index should not exceed the length of the source text.");
Language\RazorProjectEngineBuilder.cs (1)
44Debug.Fail($"Encountered an {nameof(IRazorFeature)} that is not an {nameof(IRazorEngineFeature)} or {nameof(IRazorProjectEngineFeature)}.");
Language\RazorProjectFileSystem.cs (2)
88Debug.Assert(!string.IsNullOrEmpty(path)); 134Debug.Assert(span[fileName.Length..].IsEmpty);
Language\RequiredAttributeDescriptor.cs (2)
57Debug.Assert(parent != null); 58Debug.Assert(_parent == null);
Language\RequiredAttributeDescriptorBuilder.cs (1)
71Debug.Assert(nameSpan.Length > 0, "Name should not be empty at this point.");
Language\SpanComputer.cs (4)
101Debug.Assert(_lastToken.Kind != SyntaxKind.None, "Last token should not be None when first token is set."); 106Debug.Assert(start <= end, "Start position should not be greater than end position."); 125Debug.Assert(_lastToken.Kind != SyntaxKind.None, "Last token should not be None when first token is set."); 130Debug.Assert(start <= end, "Start position should not be greater than end position.");
Language\Syntax\ChildSyntaxList.cs (5)
131Debug.Assert(idx >= 0); 215Debug.Assert(node.Span.Contains(targetPosition)); 221Debug.Assert(!green.IsList); 298Debug.Assert(idx >= 0); 392Debug.Assert(_node != null);
Language\Syntax\GreenNode.cs (4)
92Debug.Assert(node is not null); 120Debug.Assert(0 <= offset && offset < Width); 126Debug.Assert(i < SlotCount); 224Debug.Assert(span.IsEmpty);
Language\Syntax\InternalSyntax\SyntaxList.cs (8)
57Debug.Assert(child0 != null); 58Debug.Assert(child1 != null); 66Debug.Assert(child0 != null); 67Debug.Assert(child1 != null); 68Debug.Assert(child2 != null); 82Debug.Assert(nodes[i] != null); 96Debug.Assert(nodes[i] != null); 395Debug.Assert(offset >= 0 && offset < Width);
Language\Syntax\InternalSyntax\SyntaxListBuilder.cs (2)
95Debug.Assert(_nodes[i].Value != null); 149Debug.Assert(newSize >= requiredSize);
Language\Syntax\InternalSyntax\SyntaxListOfT.cs (3)
43Debug.Assert(index >= 0); 44Debug.Assert(index <= _node.SlotCount); 67Debug.Assert(index == 0);
Language\Syntax\InternalSyntax\SyntaxListPool.cs (2)
40Debug.Assert(!_allocated.Contains(item)); 60Debug.Assert(_allocated.Contains(item));
Language\Syntax\SyntaxList`1.cs (6)
103Debug.Assert(index == 0); 185Debug.Assert(builder.Count == count + tokens.Length); 251Debug.Assert(builder.Count == count + nodeCount); 400Debug.Assert(builder.Count == index + nodeCount); 405Debug.Assert(builder.Count == newCount + nodeCount); 439Debug.Assert(Node == null || Count != 0);
Language\Syntax\SyntaxNavigator.cs (4)
152Debug.Assert(child.IsNode); 194Debug.Assert(child.IsNode); 236Debug.Assert(child.IsNode); 278Debug.Assert(child.IsNode);
Language\Syntax\SyntaxNode.cs (4)
119Debug.Assert(IsList); 191Debug.Assert(childNodeOrToken.Span.Contains(position), "ChildThatContainsPosition's return value does not contain the requested position."); 469Debug.Assert(curNode.Kind is < SyntaxKind.FirstAvailableTokenKind and >= 0); 470Debug.Assert(curNode.Span.Contains(position));
Language\Syntax\SyntaxNode.Iterators.cs (4)
121Debug.Assert(_stack != null); 137Debug.Assert(_stack != null); 154Debug.Assert(_stack != null); 200Debug.Assert(_selector is not null || typeof(TResult) == typeof(SyntaxNode),
Language\Syntax\SyntaxNodeExtensions.cs (2)
78Debug.Assert(false, "Node position should stay within document length."); 113Debug.Assert(false, "Node position should stay within document length.");
Language\Syntax\SyntaxNodeOrToken.cs (8)
35Debug.Assert(!node.Green.IsList, "node cannot be a list"); 43Debug.Assert(parent == null || !parent.Green.IsList, "parent cannot be a list"); 44Debug.Assert(token != null || (parent == null && position == 0 && index == 0), "parts must form a token"); 45Debug.Assert(token == null || token.IsToken, "token must be a token"); 46Debug.Assert(index >= 0, "index must not be negative"); 47Debug.Assert(parent == null || token != null, "null token cannot have parent"); 79Debug.Assert(UnderlyingNode != null); 280Debug.Assert(
Language\Syntax\SyntaxRewriter.cs (2)
19Debug.Assert(!node.IsToken); 20Debug.Assert(!node.IsList);
Language\Syntax\SyntaxToken.cs (4)
26Debug.Assert(parent == null || !parent.Green.IsList, "list cannot be a parent"); 27Debug.Assert(token == null || token.IsToken, "token must be a token"); 38Debug.Assert(token == null || token.IsToken, "token must be a token"); 56Debug.Assert(Node != null);
Language\Syntax\SyntaxTokenList.cs (8)
32Debug.Assert(tokenOrList != null || (position == 0 && index == 0 && parent == null)); 33Debug.Assert(position >= 0); 34Debug.Assert(tokenOrList == null || tokenOrList.IsToken || tokenOrList.IsList); 127Debug.Assert(node.IsList || index == 0); 200Debug.Assert(builder.Count == count + tokens.Length); 261Debug.Assert(builder.Count == count + tokenCount); 385Debug.Assert(builder.Count == index + tokenCount); 390Debug.Assert(builder.Count == newCount + tokenCount);
Language\Syntax\SyntaxTokenList.Enumerator.cs (2)
84Debug.Assert(_singleNodeOrList != null); 86Debug.Assert(_current != null);
Language\Syntax\SyntaxTokenList.Reversed.cs (2)
77Debug.Assert(_singleNodeOrList != null); 79Debug.Assert(_current != null);
Language\Syntax\SyntaxVisitor.cs (8)
22Debug.Assert(!node.IsToken); 23Debug.Assert(!node.IsList); 33Debug.Assert(!node.IsToken); 34Debug.Assert(!node.IsList); 50Debug.Assert(!node.IsToken); 51Debug.Assert(!node.IsList); 59Debug.Assert(!node.IsToken); 60Debug.Assert(!node.IsList);
Language\Syntax\SyntaxWalker.cs (4)
22Debug.Assert(!node.IsToken); 23Debug.Assert(!node.IsList); 36Debug.Assert(!node.IsToken); 37Debug.Assert(!node.IsList);
Language\TagHelperBinder.cs (2)
147Debug.Assert( 195Debug.Assert(tempRulesBuilder.Count == 0);
Language\TagHelperBinder.TagHelperSet.cs (4)
112Debug.Assert(_valueOrArray is null, "Cannot increase size once items have been added."); 118Debug.Assert(_index < _size, "Cannot add more items."); 128Debug.Assert(_valueOrArray is null or TagHelperDescriptor[]); 141Debug.Assert(_index == _size, "Must have added all items.");
Language\TagHelperCollection_Factories.cs (1)
216Debug.Assert(collections.Length >= 2);
Language\TagHelperCollection.MultiSegmentCollection.cs (3)
31Debug.Assert(segments.Length > 0, "Segments cannot be empty."); 41Debug.Assert(segments[i].Length > 0, "Segments cannot be empty."); 54Debug.Assert(index >= 0 && index < _segments.Length);
Language\TagHelperCollection.SegmentBuilder.cs (1)
104Debug.Assert(!segment.IsEmpty, "SegmentBuilder should not contain an empty segment.");
Language\TagHelperCollection.SegmentCollectionBase.cs (1)
63Debug.Assert(UseLookupTable);
Language\TagHelperCollection.SingleSegmentCollection.cs (2)
26Debug.Assert(segment.Length > 0, "Segments cannot be empty."); 35Debug.Assert(index == 0);
Language\TagHelperDiscoverer.cs (1)
27Debug.Assert(producers.Length <= 30, "Too many TagHelperProducer kinds to fit in a cache key.");
Language\TagHelperMatchingConventions.cs (2)
278Debug.Assert(false, "Unknown name comparison."); 297Debug.Assert(false, "Unknown value comparison.");
Language\TagHelpers\Producers\ComponentTagHelperProducer.cs (2)
531Debug.Assert(attribute.AttributeClass != null); 567Debug.Assert(false, $"Need to add support for '{arg.Kind}' and make sure the output is 'global::' prefixed.");
Language\TagMatchingRuleDescriptor.cs (2)
64Debug.Assert(parent != null); 65Debug.Assert(_parent == null);
Language\TypeNameObject.cs (3)
62Debug.Assert(knownTypeNames.Count < byte.MaxValue, "Too many known type names to fit in a byte index."); 86Debug.Assert(index >= 0 && index < s_knownTypeNames.Length); 94Debug.Assert(stringValue is null || !s_typeNameToIndex.ContainsKey(stringValue));
Language\VirtualRazorProjectFileSystem.cs (2)
56Debug.Assert(directory != null); 133Debug.Assert(!string.IsNullOrEmpty(path));
Mvc.Version2_X\AssemblyAttributeInjectionPass.cs (1)
65Debug.Assert(index >= 0);
Mvc.Version2_X\RazorPageDocumentClassifierPass.cs (1)
112Debug.Assert(pageDirective != null);
Mvc\InjectDirective.cs (2)
72Debug.Assert(hasType || isMalformed); 77Debug.Assert(hasMemberName || isMalformed);
Mvc\PageDirective.cs (3)
82Debug.Assert(content.Length >= 2); 83Debug.Assert(content.StartsWith("\"", StringComparison.Ordinal)); 84Debug.Assert(content.EndsWith("\"", StringComparison.Ordinal));
Mvc\RazorPageDocumentClassifierPass.cs (1)
131Debug.Assert(pageDirective != null);
Mvc\ViewComponentTagHelperTargetExtensionBase.cs (1)
89Debug.Assert(tagHelper.TagMatchingRules.Length == 1);
SourceGenerators\SourceGeneratorProjectEngine.cs (6)
50Debug.Assert(_discoveryPhase is not null); 51Debug.Assert(_discoveryPhaseIndex >= 0); 52Debug.Assert(_rewritePhaseIndex >= 0); 53Debug.Assert(_discoveryPhaseIndex < _rewritePhaseIndex); 73Debug.Assert(sgDocument.CodeDocument.GetSyntaxTree() is not null); 172Debug.Assert(codeDocument.GetReferencedTagHelpers() is not null);
Microsoft.CodeAnalysis.Rebuild (3)
CSharpCompilationFactory.cs (2)
33Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.CSharp); 40Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.CSharp);
VisualBasicCompilationFactory.cs (1)
40Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.VisualBasic);
Microsoft.CodeAnalysis.ResxSourceGenerator (547)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (11)
111Debug.Assert(source != null); 112Debug.Assert(scheduler != null); 113Debug.Assert(body != null); 276Debug.Assert(source != null); 277Debug.Assert(scheduler != null); 278Debug.Assert(body != null); 488Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 495Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 528Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 540Debug.Assert(!Cancellation.IsCancellationRequested); 556Debug.Assert(taskSet, "Complete should only be called once.");
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (3)
60Debug.Assert(child.Symbol.Kind == SymbolKind.Namespace); 61Debug.Assert(!child.Children.IsEmpty); 62Debug.Assert(child.Children.All(grandChild => grandChild.Symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
35Debug.Assert( 43Debug.Assert(depthOfInheritance.HasValue == (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace || symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
26Debug.Assert(childrenCount != 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
495Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 507Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
210Debug.Assert(isInsideAnonymousObjectInitializer == 288Debug.Assert(success); 289Debug.Assert(cfg != null); 320Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 333Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 495Debug.Assert(parameterIndex >= 0); 496Debug.Assert(parameterIndex < arguments.Length);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
46Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
38Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
32Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.Scripting (64)
Hosting\AssemblyLoader\MetadataShadowCopy.cs (2)
34Debug.Assert(primaryModule != null); 35Debug.Assert(metadataCopy != null);
Hosting\AssemblyLoader\MetadataShadowCopyProvider.cs (5)
42Debug.Assert(@public != null); 43Debug.Assert(@private != null); 583Debug.Assert(assemblyDirectory != null); 584Debug.Assert(assemblyFileName != null); 585Debug.Assert(culture != null);
Hosting\AssemblyLoader\ShadowCopy.cs (3)
27Debug.Assert(stream != null); 28Debug.Assert(originalPath != null); 29Debug.Assert(fullPath != null);
Hosting\CommandLine\CommandLineRunner.cs (7)
34Debug.Assert(console != null); 35Debug.Assert(compiler != null); 36Debug.Assert(scriptCompiler != null); 37Debug.Assert(objectFormatter != null); 76Debug.Assert(Compiler.Arguments.IsScriptRunner); 138Debug.Assert(scriptOptions is not null); 366Debug.Assert(text != null);
Hosting\CommandLine\ConsoleIO.cs (2)
23Debug.Assert(output != null); 24Debug.Assert(input != null);
Hosting\InteractiveScriptGlobals.cs (2)
59Debug.Assert(outputWriter != null); 60Debug.Assert(objectFormatter != null);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (2)
327Debug.Assert(obj != null); 644Debug.Assert(array.Rank > 1);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.FormattedMember.cs (1)
28Debug.Assert((name != null) || (index >= 0));
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
277Debug.Assert(type != null); 410Debug.Assert(str != null && start >= 0 && end >= start);
Hosting\Resolvers\NuGetPackageResolver.cs (1)
25Debug.Assert(parts.Length > 0);
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
149Debug.Assert(!paths.IsDefault);
Script.cs (5)
41Debug.Assert(sourceText != null); 42Debug.Assert(options != null); 43Debug.Assert(compiler != null); 44Debug.Assert(builder != null); 403Debug.Assert(!preceding.IsDefault);
ScriptBuilder.cs (1)
62Debug.Assert(assemblyLoader != null);
ScriptExecutionState.cs (3)
63Debug.Assert(index >= 0 && index < SubmissionStateCount); 74Debug.Assert(_frozen == 0); 75Debug.Assert((exceptionHolderOpt != null) == (catchExceptionOpt != null));
ScriptOptions.cs (5)
160Debug.Assert(filePath != null); 161Debug.Assert(!references.IsDefault); 162Debug.Assert(!namespaces.IsDefault); 163Debug.Assert(metadataResolver != null); 164Debug.Assert(sourceResolver != null);
ScriptState.cs (3)
44Debug.Assert(executionState != null); 45Debug.Assert(script != null); 104Debug.Assert(state != null);
ScriptVariable.cs (2)
24Debug.Assert(instance != null); 25Debug.Assert(field != null);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (3)
249Debug.Assert(info.pszCurrentAssemblyPathBuf != null); 250Debug.Assert(info.pszCurrentAssemblyPathBuf[info.cchBuf - 1] == '\0'); 253Debug.Assert(result.IndexOf('\0') == -1);
src\roslyn\src\Compilers\Shared\GlobalAssemblyCacheHelpers\FusionAssemblyIdentity.cs (10)
203Debug.Assert(propertyId == PropertyId.NULL_PUBLIC_KEY_TOKEN || propertyId == PropertyId.NULL_PUBLIC_KEY); 215Debug.Assert(hr == FUSION_E_INVALID_NAME); 345Debug.Assert(data.IndexOf('\0') == -1); 349Debug.Assert(p[data.Length] == '\0'); 507Debug.Assert(displayName != null); 515Debug.Assert(result != null); 533Debug.Assert(candidateVersion != null); 538Debug.Assert(bestVersion != null); 547Debug.Assert(candidateCulture != null); 552Debug.Assert(bestCulture != null);
Microsoft.CodeAnalysis.VisualBasic (1124)
Analysis\Analyzer.vb (1)
26Debug.Assert(diagnostics IsNot Nothing)
Analysis\FlowAnalysis\AbstractFlowPass.Regions.vb (3)
54Debug.Assert(Me._firstInRegion IsNot Nothing) 65Debug.Assert(Me._regionPlace = RegionPlace.Before) 73Debug.Assert(IsInside)
Analysis\FlowAnalysis\DataFlowPass.LocalState.vb (1)
102Debug.Assert(Not assigned.IsNull)
Analysis\FlowAnalysis\DataFlowPass.VariableIdentifier.vb (2)
24Debug.Assert(symbol IsNot Nothing) 48Debug.Assert(obj IsNot Nothing)
Analysis\FlowAnalysis\FlowAnalysisInfo.vb (5)
25Debug.Assert(_compilation IsNot Nothing) 26Debug.Assert(_symbol IsNot Nothing) 27Debug.Assert(_node IsNot Nothing) 48Debug.Assert(_firstInRegion IsNot Nothing) 49Debug.Assert(_lastInRegion IsNot Nothing)
Analysis\FlowAnalysis\ReadWriteWalker.vb (1)
202Debug.Assert(node.RangeVariables.Length = 1)
Binding\BlockBaseBinder.vb (1)
46Debug.Assert(Not locals.IsEmpty)
BoundTree\BoundExpressionExtensions.vb (12)
151Debug.Assert(node.IsSupportingAssignment()) 288Debug.Assert(Not propertyAccess.PropertySymbol.ReturnsByRef OrElse (newAccessKind And PropertyAccessKind.Set) = 0) 371Debug.Assert(node.Value.IsBad OrElse node.Type.IsValidForConstantValue(node.Value)) 410Debug.Assert(expression IsNot Nothing) 423Debug.Assert(expression IsNot Nothing) 459Debug.Assert(type IsNot Nothing OrElse node.Kind = BoundKind.Literal OrElse node.Kind = BoundKind.Parenthesized) 474Debug.Assert(node.Type Is Nothing) 637Debug.Assert(node.IsValue) 638Debug.Assert(Not node.IsLValue) 639Debug.Assert(Not node.IsPropertyOrXmlPropertyAccess() OrElse node.GetAccessKind() = PropertyAccessKind.Get) 640Debug.Assert(Not node.IsLateBound() OrElse node.GetLateBoundAccessKind() = LateBoundAccessKind.Get) 641Debug.Assert(If(node.Type Is Nothing,
BoundTree\BoundLateInvocation.vb (4)
18Debug.Assert(newAccessKind = LateBoundAccessKind.Unknown OrElse 33Debug.Assert((AccessKind And LateBoundAccessKind.Call) = 0 OrElse (AccessKind And Not LateBoundAccessKind.Call) = 0) 36Debug.Assert(DirectCast(Member, BoundLateMemberAccess).AccessKind = Me.AccessKind) 39Debug.Assert(Type.IsObjectType())
BoundTree\BoundNewT.vb (1)
16Debug.Assert(Type.TypeKind = TypeKind.TypeParameter)
BoundTree\BoundSequence.vb (5)
16Debug.Assert(Me.ValueOpt IsNot Nothing OrElse Me.HasErrors OrElse Me.Type.SpecialType = SpecialType.System_Void) 27Debug.Assert(Me.ValueOpt IsNot Nothing) 37Debug.Assert(Type.IsVoidType()) 39Debug.Assert(Type.IsSameTypeIgnoringAll(ValueOpt.Type)) 47Debug.Assert(val.IsValue AndAlso Not val.IsLValue AndAlso val.Type IsNot Nothing)
BoundTree\BoundTypeOrValueExpression.vb (2)
45Debug.Assert(valueExpression IsNot Nothing, "Field 'valueExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 46Debug.Assert(typeExpression IsNot Nothing, "Field 'typeExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
CodeGen\ResumableStateMachineStateAllocator.vb (4)
47Debug.Assert(SyntaxBindingUtilities.BindsToResumableStateMachineState(awaitOrYieldReturnSyntax)) 55Debug.Assert(Not _matchedStates(state * direction)) 77Debug.Assert(f.CompilationState IsNot Nothing) 78Debug.Assert(f.CompilationState.ModuleBuilderOpt IsNot Nothing)
CommandLine\VisualBasicCommandLineArguments.vb (1)
116Debug.Assert(diagnostics Is Nothing OrElse diagnostics.Any())
Compilation\DocumentationComments\DocumentationCommentCompiler.Namespace.vb (2)
30Debug.Assert(Me._assemblyName IsNot Nothing) 50Debug.Assert(Not Me._isForSingleSymbol, "Do not expect a doc comment query for a single namespace")
Compilation\DocumentationComments\DocumentationCommentWalker.vb (6)
46Debug.Assert(symbol IsNot Nothing) 47Debug.Assert(syntaxTree IsNot Nothing) 48Debug.Assert(diagnostics IsNot Nothing) 59Debug.Assert(node IsNot Nothing) 60Debug.Assert(name IsNot Nothing) 148Debug.Assert(Not reference.ContainsDiagnostics)
Compilation\DocumentationComments\DocWriter.vb (4)
55Debug.Assert(Me._indentDepth >= 0) 108Debug.Assert(Me._indentDepth = t.InitialIndentDepth, 118Debug.Assert(depth >= 0) 129Debug.Assert(False, "Didn't expect nesting to reach depth " & depth)
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (2)
35Debug.Assert(diagnostics IsNot Nothing) 142Debug.Assert(parent IsNot Nothing)
Compilation\LookupSymbolsInfo.vb (1)
30Debug.Assert(info.Count = 0)
Declarations\SingleNamespaceDeclaration.vb (1)
84Debug.Assert(Not singleDeclarations.IsEmpty)
Generated\BoundNodes.xml.Generated.vb (427)
225Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 233Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 301Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 313Debug.Assert(underlyingLValue IsNot Nothing, "Field 'underlyingLValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 314Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 353Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 360Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 372Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 379Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 391Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 398Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 424Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 431Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 457Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 469Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 497Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 509Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 573Debug.Assert(Not (symbols.IsDefault), "Field 'symbols' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 574Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 629Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 663Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 702Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 744Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 745Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 746Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 801Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 802Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 836Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 837Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 879Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 880Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 888Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 889Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 923Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 924Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 925Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 934Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 935Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 936Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 978Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1020Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1028Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1062Debug.Assert(namespaceSymbol IsNot Nothing, "Field 'namespaceSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1117Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1118Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1131Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1132Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1168Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1175Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1201Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1210Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1252Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1260Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1301Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1327Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1328Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1336Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1337Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1371Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1372Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1435Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1436Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1483Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1484Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1523Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1524Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1525Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1596Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1597Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1652Debug.Assert(bitwiseOperator IsNot Nothing, "Field 'bitwiseOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1653Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1716Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1723Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1749Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1750Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1751Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1814Debug.Assert(byRefLocal IsNot Nothing, "Field 'byRefLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1815Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1870Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1871Debug.Assert(methodGroup IsNot Nothing, "Field 'methodGroup' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1921Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1922Debug.Assert(whenTrue IsNot Nothing, "Field 'whenTrue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1923Debug.Assert(whenFalse IsNot Nothing, "Field 'whenFalse' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1924Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1987Debug.Assert(testExpression IsNot Nothing, "Field 'testExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1988Debug.Assert(elseExpression IsNot Nothing, "Field 'elseExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 1989Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2060Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2067Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2079Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2080Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2172Debug.Assert(lambda IsNot Nothing, "Field 'lambda' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2214Debug.Assert(Not (elementPlaceholders.IsDefault), "Field 'elementPlaceholders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2215Debug.Assert(Not (convertedElements.IsDefault), "Field 'convertedElements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2262Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2263Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2310Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2311Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2382Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2383Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2446Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2447Debug.Assert(targetType IsNot Nothing, "Field 'targetType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2448Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2542Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2676Debug.Assert(Not (methods.IsDefault), "Field 'methods' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2734Debug.Assert(Not (properties.IsDefault), "Field 'properties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2828Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2898Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2932Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2933Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 2996Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3030Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3031Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3032Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3127Debug.Assert(Not (constructorArguments.IsDefault), "Field 'constructorArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3128Debug.Assert(Not (namedArguments.IsDefault), "Field 'namedArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3129Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3195Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3266Debug.Assert(member IsNot Nothing, "Field 'member' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3267Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3338Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3339Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3381Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3401Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3451Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3452Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3486Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3511Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3512Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3575Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3609Debug.Assert(Not (declarations.IsDefault), "Field 'declarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3610Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3660Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3669Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3711Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3712Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3754Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3782Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3821Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3852Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3883Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3884Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3950Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 3951Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4022Debug.Assert(inferredType IsNot Nothing, "Field 'inferredType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4023Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4024Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4025Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4099Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4133Debug.Assert(fieldSymbol IsNot Nothing, "Field 'fieldSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4134Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4205Debug.Assert(propertySymbol IsNot Nothing, "Field 'propertySymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4206Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4207Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4302Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4303Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4345Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4346Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4396Debug.Assert(Not (fields.IsDefault), "Field 'fields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4397Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4452Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4515Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4516Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4517Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4567Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4635Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4671Debug.Assert(Not (initializedFields.IsDefault), "Field 'initializedFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4672Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4706Debug.Assert(Not (initializedProperties.IsDefault), "Field 'initializedProperties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4707Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4741Debug.Assert(parameter IsNot Nothing, "Field 'parameter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4742Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4784Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4818Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4819Debug.Assert(Not (sideEffects.IsDefault), "Field 'sideEffects' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4820Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4875Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4909Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4910Debug.Assert(consequence IsNot Nothing, "Field 'consequence' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4960Debug.Assert(expressionStatement IsNot Nothing, "Field 'expressionStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4961Debug.Assert(Not (caseBlocks.IsDefault), "Field 'caseBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 4962Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5028Debug.Assert(caseStatement IsNot Nothing, "Field 'caseStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5029Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5071Debug.Assert(Not (caseClauses.IsDefault), "Field 'caseClauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5275Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5276Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5285Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5286Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5314Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5315Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5316Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5382Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5383Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5384Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5385Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5427Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5428Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5429Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5430Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5474Debug.Assert(leftOperandPlaceholder IsNot Nothing, "Field 'leftOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5475Debug.Assert(rightOperandPlaceholder IsNot Nothing, "Field 'rightOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5476Debug.Assert(addition IsNot Nothing, "Field 'addition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5477Debug.Assert(subtraction IsNot Nothing, "Field 'subtraction' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5478Debug.Assert(lessThanOrEqual IsNot Nothing, "Field 'lessThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5479Debug.Assert(greaterThanOrEqual IsNot Nothing, "Field 'greaterThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5558Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5559Debug.Assert(limitValue IsNot Nothing, "Field 'limitValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5560Debug.Assert(stepValue IsNot Nothing, "Field 'stepValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5561Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5562Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5563Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5564Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5630Debug.Assert(collection IsNot Nothing, "Field 'collection' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5631Debug.Assert(enumeratorInfo IsNot Nothing, "Field 'enumeratorInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5632Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5633Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5634Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5635Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5677Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5685Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5719Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5727Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5761Debug.Assert(tryBlock IsNot Nothing, "Field 'tryBlock' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5762Debug.Assert(Not (catchBlocks.IsDefault), "Field 'catchBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5820Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5894Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5907Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5943Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5950Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5976Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 5988Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6016Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6023Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6049Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6056Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6082Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6083Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6091Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6092Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6126Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6133Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6159Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6160Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6174Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6175Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6219Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6220Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6221Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6236Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6237Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6238Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6290Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6291Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6301Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6302Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6352Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6360Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6394Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6395Debug.Assert(inConversion IsNot Nothing, "Field 'inConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6396Debug.Assert(inPlaceholder IsNot Nothing, "Field 'inPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6397Debug.Assert(outConversion IsNot Nothing, "Field 'outConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6398Debug.Assert(outPlaceholder IsNot Nothing, "Field 'outPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6469Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6470Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6517Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6525Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6559Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6567Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6601Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6643Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6677Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6678Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6728Debug.Assert(originalExpression IsNot Nothing, "Field 'originalExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6729Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6730Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6780Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6781Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6782Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6799Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6800Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6801Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6869Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6870Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6949Debug.Assert(lastOperator IsNot Nothing, "Field 'lastOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6950Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6984Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 6991Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7003Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7004Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7038Debug.Assert(conversionCall IsNot Nothing, "Field 'conversionCall' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7039Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7073Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7074Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7075Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7076Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7086Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7087Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7088Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7089Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7125Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7126Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7127Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7128Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7129Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7176Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7177Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7178Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7179Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7180Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7214Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7215Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7249Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7250Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7251Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7309Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7310Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7311Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7353Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7354Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7355Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7365Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7366Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7367Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7417Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7418Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7419Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7420Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7421Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7471Debug.Assert(group IsNot Nothing, "Field 'group' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7472Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7506Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7507Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7515Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7516Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7550Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7551Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7579Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7580Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7606Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7607Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7633Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7634Debug.Assert(eventInvocation IsNot Nothing, "Field 'eventInvocation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7676Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7677Debug.Assert(usingInfo IsNot Nothing, "Field 'usingInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7678Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7744Debug.Assert(lockExpression IsNot Nothing, "Field 'lockExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7745Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7787Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7788Debug.Assert(localName IsNot Nothing, "Field 'localName' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7789Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7790Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7840Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7841Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7842Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7884Debug.Assert(declaration IsNot Nothing, "Field 'declaration' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7885Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7886Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7887Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7937Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7938Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7996Debug.Assert(target IsNot Nothing, "Field 'target' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7997Debug.Assert(data IsNot Nothing, "Field 'data' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7998Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 7999Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8049Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8050Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8051Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8093Debug.Assert(name IsNot Nothing, "Field 'name' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8094Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8095Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8096Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8159Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8160Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8161Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8162Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8212Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8213Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8247Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8248Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8282Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8283Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8284Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8430Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8501Debug.Assert(activeHandlerLocal IsNot Nothing, "Field 'activeHandlerLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8502Debug.Assert(resumeTargetLocal IsNot Nothing, "Field 'resumeTargetLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8503Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8550Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8551Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8598Debug.Assert(resumeTargetTemporary IsNot Nothing, "Field 'resumeTargetTemporary' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8599Debug.Assert(resumeLabel IsNot Nothing, "Field 'resumeLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8600Debug.Assert(resumeNextLabel IsNot Nothing, "Field 'resumeNextLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8601Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8664Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8665Debug.Assert(awaitableInstancePlaceholder IsNot Nothing, "Field 'awaitableInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8666Debug.Assert(getAwaiter IsNot Nothing, "Field 'getAwaiter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8667Debug.Assert(awaiterInstancePlaceholder IsNot Nothing, "Field 'awaiterInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8668Debug.Assert(isCompleted IsNot Nothing, "Field 'isCompleted' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8669Debug.Assert(getResult IsNot Nothing, "Field 'getResult' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8670Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8749Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8750Debug.Assert(Not (spillFields.IsDefault), "Field 'spillFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8751Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8850Debug.Assert(original IsNot Nothing, "Field 'original' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8851Debug.Assert(start IsNot Nothing, "Field 'start' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8852Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8853Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8916Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8917Debug.Assert(placeholder IsNot Nothing, "Field 'placeholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8918Debug.Assert(accessExpression IsNot Nothing, "Field 'accessExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8968Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 8982Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9026Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9027Debug.Assert(whenNotNull IsNot Nothing, "Field 'whenNotNull' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9028Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9099Debug.Assert(valueTypeReceiver IsNot Nothing, "Field 'valueTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9100Debug.Assert(referenceTypeReceiver IsNot Nothing, "Field 'referenceTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9101Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9148Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9149Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9196Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9197Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9236Debug.Assert(Not (contents.IsDefault), "Field 'contents' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9237Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)") 9284Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
Lowering\Diagnostics\DiagnosticsPass_ExpressionLambdas.vb (6)
69Debug.Assert(node.Declarations.All(Function(d) d.Kind = BoundKind.AnonymousTypePropertyAccess)) 117Debug.Assert(placeholder IsNot Nothing) 128Debug.Assert(assignment.LeftOnTheRightOpt Is Nothing) 297Debug.Assert(operand IsNot Nothing AndAlso 308Debug.Assert(Me.IsInExpressionLambda) 309Debug.Assert(lambda IsNot Nothing)
Lowering\Diagnostics\DiagnosticsPass.vb (5)
32Debug.Assert(node IsNot Nothing) 33Debug.Assert(containingSymbol IsNot Nothing) 138Debug.Assert(_containingSymbol.IsLambdaMethod) ' What else can it be? 174Debug.Assert(info.ExpressionPlaceholder IsNot Nothing) 211Debug.Assert(_expressionsBeingVisited.Peek Is node)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (7)
126Debug.Assert(nullableType.IsNullableType) 185Debug.Assert((conversion.ConversionKind And ConversionKind.UserDefined) <> 0) 192Debug.Assert(outConv IsNot Nothing AndAlso 195Debug.Assert(TypeSymbol.Equals(method.ReturnType, callType, TypeCompareKind.ConsiderEverything)) 196Debug.Assert(TypeSymbol.Equals(toType, conversion.Type, TypeCompareKind.ConsiderEverything)) 200Debug.Assert(TypeSymbol.Equals(expectedParameterType.GetNullableUnderlyingTypeOrSelf, realParameterType.GetNullableUnderlyingTypeOrSelf, TypeCompareKind.ConsiderEverything)) 208Debug.Assert((innerConversion And ConversionKind.NarrowingNullable) = ConversionKind.NarrowingNullable)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (14)
25Debug.Assert(node.ExtendedInfoOpt Is Nothing) 34Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 43Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 66Debug.Assert(conversion = ConversionKind.WideningNothingLiteral OrElse 96Debug.Assert(semantics = ConversionSemantics.Default) 149Debug.Assert(semantics <> ConversionSemantics.TryCast) 159Debug.Assert(semantics <> ConversionSemantics.TryCast) 162Debug.Assert(Not TypeSymbol.Equals(interimType, typeTo, TypeCompareKind.ConsiderEverything)) 177Debug.Assert(semantics <> ConversionSemantics.TryCast) 187Debug.Assert(semantics <> ConversionSemantics.TryCast) 190Debug.Assert(Not TypeSymbol.Equals(interimType, typeTo, TypeCompareKind.ConsiderEverything)) 295Debug.Assert(semantics <> ConversionSemantics.TryCast) 367Debug.Assert(method.ParameterCount = 1) 393Debug.Assert(outerConversion.Type.IsSameTypeIgnoringAll(resultType))
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_UnaryOperator.vb (7)
27Debug.Assert(TypeSymbol.Equals(origArgType, node.Type, TypeCompareKind.ConsiderEverything)) 34Debug.Assert((node.OperatorKind And UnaryOperatorKind.UserDefined) = 0) 117Debug.Assert(node.Type.IsBooleanType()) 118Debug.Assert(node.Operand.Type.IsNullableOfBoolean()) 155Debug.Assert(resultType.IsBooleanType) 156Debug.Assert(lambdaParameter.Type.IsNullableType) 189Debug.Assert(Not isLifted OrElse Not node.Call.Method.ReturnType.IsNullableType)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (31)
137Debug.Assert(block.Statements(0).Kind <> BoundKind.SequencePoint) 138Debug.Assert(block.Statements.Length = 1 OrElse 147Debug.Assert(block.Locals.IsEmpty OrElse 176Debug.Assert(False) 308Debug.Assert(saveRecursionDepth = _recursionDepth) 331Debug.Assert(Not p.IsByRef, "DiagnosticsPass should have reported an error") 351Debug.Assert(Not node.LambdaSymbol.IsAsync AndAlso Not node.LambdaSymbol.IsIterator, 353Debug.Assert(node.WasCompilerGenerated OrElse node.IsSingleLine, 406Debug.Assert(origReceiverOpt IsNot Nothing OrElse fieldIsShared) 412Debug.Assert(origReceiverOpt IsNot Nothing) 433Debug.Assert(origReceiverOpt IsNot Nothing OrElse propertyIsShared) 439Debug.Assert(origReceiverOpt IsNot Nothing) 440Debug.Assert(origReceiverOpt.Kind <> BoundKind.MyBaseReference AndAlso origReceiverOpt.Kind <> BoundKind.MyClassReference) 456Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 457Debug.Assert(node.RelaxationReceiverPlaceholderOpt Is Nothing) 458Debug.Assert(node.MethodGroupOpt Is Nothing) 461Debug.Assert(delegateType.TypeKind = TYPEKIND.Delegate) 532Debug.Assert(arg.Type Is Me.Int32Type) 543Debug.Assert(expressions(i).Type Is Me.Int32Type) 585Debug.Assert(initializer.CreateTemporaryLocalForInitialization, 593Debug.Assert(initializers(i).Kind = BoundKind.AssignmentOperator) 596Debug.Assert(assignment.LeftOnTheRightOpt Is Nothing) 605Debug.Assert(DirectCast(assignment.Left, BoundPropertyAccess).AccessKind = PropertyAccessKind.Set) 611Debug.Assert(leftSymbol IsNot Nothing) 615Debug.Assert(initializer.PlaceholderOpt IsNot Nothing) 616Debug.Assert(Not BoundNodeFinder.ContainsNode(right, initializer.PlaceholderOpt, _recursionDepth, convertInsufficientExecutionStackExceptionToCancelledByStackGuardException:=True), "Should be addressed in DiagnosticsPass") 617Debug.Assert(leftSymbol.Kind = SymbolKind.Field OrElse leftSymbol.Kind = SymbolKind.Property) 642Debug.Assert(initializers(i).Kind = BoundKind.Call) 683Debug.Assert(properties.Length = node.Arguments.Length) 739Debug.Assert(arrayType.IsSZArray, "Not SZArray should be addressed in DiagnosticsPass") 790Debug.Assert(type.IsValueType)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (9)
138Debug.Assert(Not node.HasErrors) 254Debug.Assert(local.ContainingSymbol = Me._currentParent OrElse 301Debug.Assert(node.LambdaSymbol IsNot Nothing) 338Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 349Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 360Debug.Assert(conversion.ExtendedInfoOpt Is Nothing) 385Debug.Assert(DirectCast(variableOrParameter, ParameterSymbol).IsMe) 417Debug.Assert(container IsNot Nothing) 540Debug.Assert(False, "should not have nodes like this")
Lowering\LocalRewriter\LocalRewriter_AddRemoveHandler.vb (2)
198Debug.Assert(False, "All event accesses should be handled by AddHandler/RemoveHandler/RaiseEvent.") 252Debug.Assert(node.Kind = BoundKind.Parenthesized, "node can only be EventAccess or Parenthesized")
Lowering\LocalRewriter\LocalRewriter_AnonymousTypeCreationExpression.vb (2)
21Debug.Assert(fieldsCount > 0) 80Debug.Assert(local IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_AsNewLocalDeclarations.vb (4)
21Debug.Assert(localDeclaration.InitializerOpt Is Nothing) 53Debug.Assert(node.Syntax IsNot Nothing) 54Debug.Assert(node.Syntax.Kind = SyntaxKind.VariableDeclarator) 82Debug.Assert(objectInitializer.PlaceholderOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.vb (19)
27Debug.Assert(midResult.Original Is node.LeftOnTheRightOpt OrElse 42Debug.Assert((accessKind And PropertyAccessKind.Set) <> 0) 43Debug.Assert(((accessKind And PropertyAccessKind.Get) = 0) = (node.LeftOnTheRightOpt Is Nothing)) 51Debug.Assert(nodeLeft.Kind <> BoundKind.FieldAccess OrElse 78Debug.Assert(assignmentTarget.IsLValue) 91Debug.Assert(assignmentTarget Is setNode) 140Debug.Assert(node.LeftOnTheRightOpt Is Nothing) 155Debug.Assert(Not _rewrittenNodes.Contains(node), "LocalRewriter: Rewriting the same node several times.") 195Debug.Assert( 207Debug.Assert(setNode.AccessKind = PropertyAccessKind.Set) 216Debug.Assert(backingField IsNot Nothing, "autoproperty must have a backing field") 253Debug.Assert((accessKind And LateBoundAccessKind.Set) <> 0) 254Debug.Assert(((accessKind And LateBoundAccessKind.Get) = 0) = (node.LeftOnTheRightOpt Is Nothing)) 358Debug.Assert(nodeToCheck.ConstantValueOpt.IsNothing) 427Debug.Assert((conversionKind And ConversionKind.UserDefined) = 0) 462Debug.Assert(node.Left.IsLValue AndAlso node.LeftOnTheRightOpt IsNot Nothing AndAlso 465Debug.Assert(midResult.Type.IsStringType()) 499Debug.Assert(temporaries.IsDefault) 500Debug.Assert(copyBack.IsDefault)
Lowering\LocalRewriter\LocalRewriter_Block.vb (1)
43Debug.Assert(builder.Count < node.Locals.Length)
Lowering\LocalRewriter\LocalRewriter_Call.vb (7)
17Debug.Assert(Not node.IsConstant, "Constant calls should become literals by now") 200Debug.Assert(temporaries.IsDefault OrElse changed) 262Debug.Assert(originalArgument.GetAccessKind() = If( 268Debug.Assert(originalArgument.GetLateBoundAccessKind() = (LateBoundAccessKind.Get Or LateBoundAccessKind.Set)) 274Debug.Assert(originalArgument.GetAccessKind() = PropertyAccessKind.Unknown) 277Debug.Assert(originalArgument.GetLateBoundAccessKind() = LateBoundAccessKind.Unknown) 316Debug.Assert(secondUse.IsLValue)
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.vb (9)
33Debug.Assert(node.Type IsNot Nothing) 71Debug.Assert(newPlaceholderId <> 0) 107Debug.Assert(newPlaceholderId <> 0) 142Debug.Assert(needWhenNotNullPart OrElse needWhenNullPart) 148Debug.Assert(receiver Is Nothing) 149Debug.Assert(newPlaceHolder Is Nothing) 153Debug.Assert(receiver Is Nothing) 156Debug.Assert(receiver Is Nothing) 157Debug.Assert(node.Type.IsVoidType())
Lowering\LocalRewriter\LocalRewriter_DoLoop.vb (4)
16Debug.Assert(node IsNot Nothing) 30Debug.Assert(node.ConditionOpt IsNot Nothing AndAlso node.ConditionIsTop) 64Debug.Assert(node.ConditionOpt IsNot Nothing AndAlso Not node.ConditionIsTop) 148Debug.Assert(node.ConditionOpt Is Nothing)
Lowering\LocalRewriter\LocalRewriter_FieldOrPropertyInitializer.vb (4)
40Debug.Assert( 51Debug.Assert(_currentMethodOrLambda IsNot Nothing) 117Debug.Assert(node.MemberAccessExpressionOpt IsNot Nothing) 126Debug.Assert(objectInitializer.PlaceholderOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_ForEach.vb (8)
209Debug.Assert(collectionExpression.Type.SpecialType = SpecialType.System_String OrElse 359Debug.Assert(kind.IsLongLived()) 366Debug.Assert(expressionType.SpecialType <> SpecialType.System_Object) 397Debug.Assert(expressionType.SpecialType <> SpecialType.System_Object) 586Debug.Assert(enumeratorInfo.EnumeratorPlaceholder IsNot Nothing) 592Debug.Assert(enumeratorInfo.MoveNext.Type.SpecialType = SpecialType.System_Boolean) 670Debug.Assert(Not needTryFinally) 757Debug.Assert(rewrittenDisposeConversion IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_ForTo.vb (7)
37Debug.Assert(node.OperatorsOpt Is Nothing) 370Debug.Assert(initialConst.IsFloating) 416Debug.Assert(Compilation.GetSpecialType(SpecialType.System_Object) Is rewrittenControlVariable.Type) 454Debug.Assert(rewrittenInitCondition IsNot Nothing) 511Debug.Assert(rewrittenLoopCondition IsNot Nothing) 563Debug.Assert(controlVariable.IsLValue) 657Debug.Assert(operatorsOpt Is Nothing OrElse positiveFlag IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_HostObjectMemberReference.vb (2)
14Debug.Assert(_previousSubmissionFields IsNot Nothing) 15Debug.Assert(Not _topMethod.IsShared)
Lowering\LocalRewriter\LocalRewriter_LateAddressOf.vb (1)
36Debug.Assert(delegateInvoke.MethodKind = MethodKind.DelegateInvoke)
Lowering\LocalRewriter\LocalRewriter_LateInvocation.vb (3)
20Debug.Assert(node.Member IsNot Nothing, "late invocation always has a member that is invoked") 50Debug.Assert(invocation.AccessKind = LateBoundAccessKind.Get) 51Debug.Assert(receiverExpression.Kind <> BoundKind.LateMemberAccess)
Lowering\LocalRewriter\LocalRewriter_ObjectCreation.vb (12)
40Debug.Assert(result.Type.Equals(DirectCast(node.Type, NamedTypeSymbol).CoClassType)) 44Debug.Assert(Conversions.ConversionExists(conv)) 48Debug.Assert(node.Type.IsSameTypeIgnoringAll(result.Type)) 140Debug.Assert(method IsNot Nothing) 184Debug.Assert(node.PlaceholderOpt IsNot Nothing) 240Debug.Assert(tempLocalSymbol Is Nothing) 241Debug.Assert(tempLocal Is Nothing) 254Debug.Assert(tempLocalSymbol IsNot Nothing) 255Debug.Assert(tempLocal IsNot Nothing) 306Debug.Assert(node.PlaceholderOpt IsNot Nothing) 360Debug.Assert(assignment.LeftOnTheRightOpt Is Nothing) 418Debug.Assert(sequence.ValueOpt IsNot Nothing AndAlso sequence.ValueOpt.Kind = BoundKind.ObjectCreationExpression)
Lowering\LocalRewriter\LocalRewriter_OmittedArgument.vb (1)
15Debug.Assert(node.Type.IsObjectType)
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.vb (3)
15Debug.Assert(targetType.TypeKind = TypeKind.Submission) 16Debug.Assert(Not _topMethod.IsShared) 17Debug.Assert(_previousSubmissionFields IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_Query.vb (4)
115Debug.Assert(IdentifierComparison.Equals(parameterName, nodeRangeVariables(firstUnmappedRangeVariable).Name)) 121Debug.Assert(firstUnmappedRangeVariable = nodeRangeVariables.Length) 167Debug.Assert(IdentifierComparison.Equals(propertyDefName, rangeVariables(firstUnmappedRangeVariable).Name)) 235Debug.Assert(node.GroupPlaceholderOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (5)
30Debug.Assert(receiver.Kind = BoundKind.FieldAccess) 36Debug.Assert(fieldAccessReceiver Is Nothing OrElse 116Debug.Assert(fieldType.Name = "EventRegistrationTokenTable") 121Debug.Assert(getOrCreateMethod IsNot Nothing, "Checked during initial binding") 122Debug.Assert(TypeSymbol.Equals(getOrCreateMethod.ReturnType, fieldType.OriginalDefinition, TypeCompareKind.ConsiderEverything), "Shape of well-known member")
Lowering\LocalRewriter\LocalRewriter_RedimClause.vb (1)
18Debug.Assert(node.ArrayTypeOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_Return.vb (5)
16Debug.Assert(node.FunctionLocalOpt Is Nothing OrElse 48Debug.Assert(node.FunctionLocalOpt IsNot Nothing) 85Debug.Assert(node.FunctionLocalOpt Is Nothing) 108Debug.Assert(node.ExitLabelOpt Is Nothing) 109Debug.Assert(node.FunctionLocalOpt Is Nothing)
Lowering\LocalRewriter\LocalRewriter_SelectCase.vb (21)
102Debug.Assert(node.WasCompilerGenerated) 205Debug.Assert(statementBuilder IsNot Nothing) 206Debug.Assert(Not caseBlocks.IsDefault) 260Debug.Assert(startFrom <= caseBlocks.Length) 270Debug.Assert(generateUnstructuredExceptionHandlingResumeCode = ShouldGenerateUnstructuredExceptionHandlingResumeCode(curCaseBlock)) 285Debug.Assert(curCaseBlock.Syntax.Kind = SyntaxKind.CaseElseBlock) 286Debug.Assert(Not curCaseBlock.CaseStatement.CaseClauses.Any()) 289Debug.Assert(startFrom = caseBlocks.Length - 1) 298Debug.Assert(curCaseBlock.Syntax.Kind = SyntaxKind.CaseBlock) 325Debug.Assert(node.Syntax.Kind = SyntaxKind.CaseStatement) 326Debug.Assert(node.ConditionOpt IsNot Nothing) 333Debug.Assert(node.Syntax.Kind = SyntaxKind.CaseElseStatement) 341Debug.Assert(Not node.HasErrors) 342Debug.Assert(node.ExpressionStatement.Expression.Type.IsStringType) 343Debug.Assert(node.RecommendSwitchTable) 355Debug.Assert(simpleCaseClause.ValueOpt IsNot Nothing) 356Debug.Assert(simpleCaseClause.ConditionOpt Is Nothing) 363Debug.Assert(relationalCaseClause.OperatorKind = BinaryOperatorKind.Equals) 364Debug.Assert(relationalCaseClause.ValueOpt IsNot Nothing) 365Debug.Assert(relationalCaseClause.ConditionOpt Is Nothing) 373Debug.Assert(constant IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_StringConcat.vb (1)
36Debug.Assert(node.Type.IsStringType() AndAlso
Lowering\LocalRewriter\LocalRewriter_SyncLock.vb (2)
188Debug.Assert(tempLockTaken.Type.IsBooleanType()) 256Debug.Assert(boundLockTakenLocal.Type.IsBooleanType())
Lowering\LocalRewriter\LocalRewriter_Throw.vb (1)
23Debug.Assert(node.Syntax.Kind = SyntaxKind.ErrorStatement, "Must be an Error statement.")
Lowering\LocalRewriter\LocalRewriter_Try.vb (3)
16Debug.Assert(_unstructuredExceptionHandling.Context Is Nothing) 167Debug.Assert(_currentLineTemporary Is Nothing) 168Debug.Assert((Me._flags And RewritingFlags.AllowCatchWithErrorLineNumberReference) <> 0)
Lowering\LocalRewriter\LocalRewriter_UnaryOperators.vb (12)
18Debug.Assert(node.Operand.Type.IsNullableOfBoolean()) 49Debug.Assert((binary.OperatorKind And BinaryOperatorKind.Lifted) <> 0) 111Debug.Assert(node.Operand.Type.IsObjectType() AndAlso node.Type.IsObjectType()) 123Debug.Assert(opKind = UnaryOperatorKind.Not) 139Debug.Assert(node.Operand.Type.IsDecimalType() AndAlso node.Type.IsDecimalType()) 147Debug.Assert(opKind = UnaryOperatorKind.Minus) 240Debug.Assert(resultType.IsNullableType()) 243Debug.Assert(operand.Type.IsNullableType, "operand must be nullable") 266Debug.Assert(callInput.Type.IsSameTypeIgnoringAll(operatorCall.Method.Parameters(0).Type), 283Debug.Assert(whenHasValue.Type.IsSameTypeIgnoringAll(resultType), "result type must be same as resultType") 288Debug.Assert(temps Is Nothing AndAlso inits Is Nothing) 313Debug.Assert(Not operandValue.Type.IsNullableType)
Lowering\LocalRewriter\LocalRewriter_UnstructuredExceptionHandling.vb (25)
35Debug.Assert(_currentLineTemporary Is Nothing) 65Debug.Assert(node.ContainsOnError OrElse node.ContainsResume) 67Debug.Assert(_unstructuredExceptionHandling.Context Is Nothing) 68Debug.Assert(_unstructuredExceptionHandling.ExceptionHandlers Is Nothing) 69Debug.Assert(_unstructuredExceptionHandling.ResumeTargets Is Nothing) 70Debug.Assert(_unstructuredExceptionHandling.OnErrorResumeNextCount = 0) 71Debug.Assert(_unstructuredExceptionHandling.ActiveHandlerTemporary Is Nothing) 72Debug.Assert(_unstructuredExceptionHandling.ResumeTargetTemporary Is Nothing) 73Debug.Assert(_unstructuredExceptionHandling.CurrentStatementTemporary Is Nothing) 74Debug.Assert(_unstructuredExceptionHandling.ResumeNextLabel Is Nothing) 75Debug.Assert(_unstructuredExceptionHandling.ResumeLabel Is Nothing) 77Debug.Assert(_currentMethodOrLambda Is _topMethod) 366Debug.Assert(node.OnErrorKind = OnErrorStatementKind.GoToZero) 373Debug.Assert(Not node.WasCompilerGenerated) 435Debug.Assert(node.ResumeKind = ResumeStatementKind.Plain) 439Debug.Assert(Not node.WasCompilerGenerated) 450Debug.Assert(InsideValidUnstructuredExceptionHandlingResumeContext()) 458Debug.Assert(InsideValidUnstructuredExceptionHandlingResumeContext()) 481Debug.Assert(TypeOf statement.Syntax Is ExpressionSyntax) 524Debug.Assert(statement.Syntax.Kind = SyntaxKind.ElseIfBlock AndAlso 530Debug.Assert((statement.Syntax.Kind = SyntaxKind.CaseBlock OrElse statement.Syntax.Kind = SyntaxKind.CaseElseBlock) AndAlso 536Debug.Assert(statement.Syntax.Kind = SyntaxKind.ModifiedIdentifier AndAlso 543Debug.Assert((statement.Syntax.Kind = SyntaxKind.RedimClause AndAlso 549Debug.Assert(TypeOf statement.Syntax Is ExecutableStatementSyntax) 583Debug.Assert(_leaveRestoreUnstructuredExceptionHandlingContextTracker.Peek Is node)
Lowering\LocalRewriter\LocalRewriter_Using.vb (1)
124Debug.Assert(node.ResourceExpressionOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_With.vb (8)
57Debug.Assert(Not locals.IsDefault) 58Debug.Assert(Not initializers.IsDefault) 59Debug.Assert(placeholder IsNot Nothing) 60Debug.Assert(replaceWith IsNot Nothing) 148Debug.Assert(currentType IsNot Nothing) 155Debug.Assert(currentType.IsValueType) 177Debug.Assert(fieldType IsNot Nothing) 193Debug.Assert(Not _valueTypesCleanUpCache(currentType))
Lowering\LocalRewriter\LocalRewriter_XmlLiteralFixupData.vb (1)
45Debug.Assert(Not Me.IsEmpty)
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (7)
41Debug.Assert(originalMethodBeingCalled.IsGenericMethod) 44Debug.Assert(typeArgs.Length = newMethod.Arity) 61Debug.Assert(receiver IsNot Nothing) 62Debug.Assert(receiver.IsMyClassReference() OrElse receiver.IsMyBaseReference()) 63Debug.Assert(method IsNot Nothing) 84Debug.Assert(isMyBase OrElse receiver.Kind = BoundKind.MyClassReference) 99Debug.Assert(wrappedMethod.ConstructedFrom() Is method)
Lowering\SynthesizedSubmissionFields.vb (2)
30Debug.Assert(compilation IsNot Nothing) 31Debug.Assert(submissionClass.IsSubmissionClass)
Lowering\SyntheticBoundNodeFactory.vb (41)
72Debug.Assert(compilationState IsNot Nothing) 157Debug.Assert(Me.CurrentMethod IsNot Nothing AndAlso Not Me.CurrentMethod.IsShared) 164Debug.Assert(Me.CurrentMethod IsNot Nothing AndAlso Not Me.CurrentMethod.IsShared) 177Debug.Assert(Me.CurrentMethod IsNot Nothing AndAlso Not Me.CurrentMethod.IsShared) 198Debug.Assert(propertySym.IsShared) 204Debug.Assert(receiver.Type.GetMembers(propertySym.Name).OfType(Of PropertySymbol)().Single() = propertySym) 206Debug.Assert(Not propertySym.IsShared) 215Debug.Assert(Not propertySym.IsShared) 222Debug.Assert(propertySym.IsShared) 238Debug.Assert(nullableType.IsGenericType AndAlso nullableType.Arity = 1) 300Debug.Assert(left.Type.IsSameTypeIgnoringAll(right.Type) OrElse right.Type.IsErrorType() OrElse left.Type.IsErrorType()) 307Debug.Assert(TypeSymbol.Equals(byRefLocal.Type, lValue.Type, TypeCompareKind.ConsiderEverything)) 308Debug.Assert(byRefLocal.IsByRef) 358Debug.Assert(Conversions.IsWideningConversion(conversion)) 594Debug.Assert(method.ParameterCount = args.Length) 609Debug.Assert(thenClause IsNot Nothing AndAlso elseClause IsNot Nothing) 618Debug.Assert(ifTrue IsNot Nothing) 619Debug.Assert(ifFalse IsNot Nothing) 624Debug.Assert(expression IsNot Nothing) 625Debug.Assert(Not expression.IsNothingLiteral) ' Not supported yet 626Debug.Assert(expression.Type.IsReferenceType) 'Others are not supported yet 627Debug.Assert(type.IsReferenceType) 'Others are not supported yet 628Debug.Assert(Not expression.Type.IsErrorType) 629Debug.Assert(Not type.IsErrorType) 635Debug.Assert(expression IsNot Nothing) 636Debug.Assert(expression.IsNothingLiteral OrElse expression.Type.IsReferenceType OrElse expression.Type.IsTypeParameter()) 'Others are not supported yet 637Debug.Assert(type.IsReferenceType OrElse (type.IsTypeParameter AndAlso expression.IsNothingLiteral)) 'Others are not supported yet 638Debug.Assert(expression.Type Is Nothing OrElse Not expression.Type.IsErrorType) 639Debug.Assert(Not type.IsErrorType) 666Debug.Assert(parts IsNot Nothing AndAlso parts.Length > 0) 714Debug.Assert(Not labels.Contains(v1)) 768Debug.Assert(value.IsString OrElse value.IsNull) 793Debug.Assert(array.Type IsNot Nothing AndAlso array.Type.IsArrayType()) 847Debug.Assert(systemTypeSymbol.ExtendedSpecialType = InternalSpecialType.System_Type OrElse 858Debug.Assert(getTypeFromHandle Is Nothing OrElse 890Debug.Assert(systemReflectionMethodInfo.ExtendedSpecialType = InternalSpecialType.System_Reflection_MethodInfo OrElse 920Debug.Assert(systemReflectionMethodInfo.IsErrorType() OrElse Conversions.IsDerivedFrom(systemReflectionMethodInfo, getMethodFromHandle.ReturnType, discardedUseSiteInfo)) 1025Debug.Assert((convKind And ConversionKind.UserDefined) = 0) 1072Debug.Assert(operand.Type.IsReferenceType) 1079Debug.Assert(operand.Type.IsReferenceType) 1126Debug.Assert(Me.CurrentMethod IsNot Nothing)
Semantics\Operators.vb (80)
306Debug.Assert(method.IsMethodKindBasedOnSyntax OrElse diagnosticsOpt Is Nothing) 307Debug.Assert(opInfo.ParamCount <> 0) 308Debug.Assert(diagnosticsOpt Is Nothing OrElse assemblyBeingBuiltOpt IsNot Nothing) 354Debug.Assert(opInfo.IsBinary) 381Debug.Assert(Not method.IsMethodKindBasedOnSyntax) 505Debug.Assert((opCode And UnaryOperatorKind.IntrinsicOpMask) = opCode AndAlso opCode <> UnaryOperatorKind.Error) 709Debug.Assert(operand IsNot Nothing) 710Debug.Assert(resultType IsNot Nothing) 728Debug.Assert(underlyingResultType.IsValidForConstantValue(operandValue)) 738Debug.Assert(Not underlyingResultType.IsUnsignedIntegralType()) 801Debug.Assert((op And UnaryOperatorKind.IntrinsicOpMask) = UnaryOperatorKind.Not) 863Debug.Assert((opCode And BinaryOperatorKind.OpMask) = opCode AndAlso opCode <> BinaryOperatorKind.Error) 1029Debug.Assert(left IsNot Nothing) 1030Debug.Assert(right IsNot Nothing) 1031Debug.Assert(resultType IsNot Nothing) 1059Debug.Assert(leftType.IsSameTypeIgnoringAll(rightType) OrElse 1096Debug.Assert((operatorKind And BinaryOperatorKind.CompareText) = 0) 1113Debug.Assert(result IsNot Nothing) 1128Debug.Assert(operandType.IsIntegralType() OrElse operandType.IsCharType() OrElse operandType.IsDateTimeType()) 1129Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1130Debug.Assert(Not integerOverflow) 1131Debug.Assert(Not divideByZero) 1301Debug.Assert(operandType.IsFloatingType()) 1302Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1424Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1425Debug.Assert(Not divideByZero) 1510Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1572Debug.Assert(Not result.IsBad) 1581Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1931Debug.Assert(Not source.IsErrorType()) 1932Debug.Assert(Not destination.IsErrorType()) 2002Debug.Assert(Not bestMatch.Parameters(0).Type.IsNullableType()) 2003Debug.Assert(Not bestMatch.ReturnType.IsNullableType()) 2010Debug.Assert(Not bestMatch.Parameters(0).Type.IsNullableType()) 2011Debug.Assert(Not bestMatch.ReturnType.IsNullableType()) 2042Debug.Assert(bestMatch Is Nothing) 2044Debug.Assert(Not applicable(i)) 2105Debug.Assert(Not suppressViabilityChecks) 2108Debug.Assert(currentIndex = i) 2122Debug.Assert(Not suppressViabilityChecks) 2148Debug.Assert(bestMatch Is Nothing) 2171Debug.Assert(opSet(i) IsNot Nothing) 2184Debug.Assert(bestMatch Is Nothing) 2185Debug.Assert(Not bestMatchIsAmbiguous) 2202Debug.Assert(typeSet.Count = applicableCount) 2222Debug.Assert(typeSet.Count = applicableCount) 2246Debug.Assert(bestMatch IsNot Nothing) 2252Debug.Assert(bestMatch Is Nothing) 2317Debug.Assert(IsConversionOperatorViableBasedOnTypesInvolved(method, inputType, outputType, CompoundUseSiteInfo(Of AssemblySymbol).Discarded)) 2379Debug.Assert(bestMatch Is Nothing) 2381Debug.Assert(Not applicable(i)) 2452Debug.Assert(Not suppressViabilityChecks) 2456Debug.Assert(currentIndex = i) 2472Debug.Assert(Not (Conversions.IsWideningConversion(conversionIn) AndAlso Conversions.IsWideningConversion(conversionOut))) 2478Debug.Assert(Not suppressViabilityChecks) 2504Debug.Assert(bestMatch Is Nothing) 2523Debug.Assert(Conversions.IsNarrowingConversion(conversionOut)) 2526Debug.Assert(Conversions.IsNarrowingConversion(conversionIn)) 2531Debug.Assert(Conversions.IsWideningConversion(conversionOut) AndAlso Not Conversions.IsIdentityConversion(conversionOut)) 2544Debug.Assert(Conversions.IsNarrowingConversion(conversionOut)) 2565Debug.Assert(opSet(i) IsNot Nothing) 2577Debug.Assert(bestMatch Is Nothing) 2578Debug.Assert(Not bestMatchIsAmbiguous) 2597Debug.Assert(Conversions.IsNarrowingConversion(conversionKinds(i).Key)) 2603Debug.Assert(typeSet.Count = applicableCount OrElse (haveWideningInConversions <> 0 AndAlso typeSet.Count = haveWideningInConversions)) 2629Debug.Assert(Conversions.IsNarrowingConversion(conversionKinds(i).Value)) 2635Debug.Assert(typeSet.Count = applicableCount OrElse (haveWideningOutConversions <> 0 AndAlso typeSet.Count = haveWideningOutConversions)) 2664Debug.Assert(bestMatch IsNot Nothing) 2688Debug.Assert(Not type.IsErrorType()) 2706Debug.Assert(Not best.IsSameTypeIgnoringAll(type)) 2733Debug.Assert(Not type.IsErrorType()) 2751Debug.Assert(Not best.IsSameTypeIgnoringAll(type)) 2806Debug.Assert(result > 0) 2814Debug.Assert(method.MethodKind = MethodKind.Conversion) 2821Debug.Assert(forth = "E"c OrElse forth = "e"c) 3171Debug.Assert(method.ParameterCount = If(argument2 Is Nothing, 1, 2)) 3172Debug.Assert(method.Arity = 0) 3173Debug.Assert(Not method.IsSub) 3292Debug.Assert(parameter.IsDefinition) 3293Debug.Assert(type.IsNullableType())
Semantics\OverloadResolution.vb (117)
155Debug.Assert(method IsNot Nothing) 156Debug.Assert(method.ReducedFrom Is Nothing OrElse Me.IsExtensionMethod) 287Debug.Assert(method.ReducedFrom IsNot Nothing) 358Debug.Assert(parameters.Length = method.ParameterCount) 395Debug.Assert([property] IsNot Nothing) 595Debug.Assert((value And SmallFieldMask.InferenceLevelMask) = value) 637Debug.Assert(RequiresNarrowingConversion) 656Debug.Assert(relaxationLevel <= ConversionKind.DelegateRelaxationLevelNarrowing) 698Debug.Assert((value And SmallFieldMask.InferenceErrorReasonsMask) = value) 714Debug.Assert((value And (Not SmallFieldMask.State)) = 0) 929Debug.Assert(methodGroup.ResultKind = LookupResultKind.Good OrElse methodGroup.ResultKind = LookupResultKind.Inaccessible) 1008Debug.Assert(candidates.All(Function(candidate) candidate.State <> CandidateAnalysisResultState.Applicable OrElse 1057Debug.Assert(applicableNarrowingCandidateCount = 0) 1086Debug.Assert(propertyGroup.ResultKind = LookupResultKind.Good OrElse propertyGroup.ResultKind = LookupResultKind.Inaccessible) 1116Debug.Assert(asyncLambdaSubToFunctionMismatch Is Nothing) 1141Debug.Assert(Not candidate.Candidate.IsExtensionMethod) 1166Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length = arguments.Length) 1258Debug.Assert(applicableNarrowingCandidates < applicableCandidates) 1261Debug.Assert(applicableCandidates > 0) 1403Debug.Assert(existingWins Xor newWins) ' Both cannot win! 1433Debug.Assert(newCandidate.State = CandidateAnalysisResultState.Applicable) 1437Debug.Assert(newCandidate.Candidate.ParameterCount >= argumentCount OrElse newCandidate.IsExpandedParamArrayForm) 1438Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0) 1439Debug.Assert(Not operatorResolution OrElse argumentNames.IsDefault) 1456Debug.Assert(existingCandidate.Candidate.ParameterCount >= argumentCount OrElse existingCandidate.IsExpandedParamArrayForm) 1471Debug.Assert(Not operatorResolution) 1478Debug.Assert(Not operatorResolution) 1481Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 1482Debug.Assert(argumentCount = existingCandidate.Candidate.ParameterCount) 1499Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 1519Debug.Assert(argumentNames.IsDefault OrElse signatureMatch) 1610Debug.Assert(indexesOfEqualMostApplicableCandidates.Count > 0) 1688Debug.Assert(buckets.Count > 0) 1756Debug.Assert(cmp = ApplicabilityComparisonResult.LeftIsMoreApplicable) 1778Debug.Assert(cmp = ApplicabilityComparisonResult.LeftIsMoreApplicable) 1816Debug.Assert(Not (leftWins AndAlso rightWins)) 1823Debug.Assert(rightWins) 1833Debug.Assert(applicableCandidates >= 0) 1966Debug.Assert(delegateReturnType.IsVoidType() = rightReturnsVoid) 2075Debug.Assert(Not haveNamedArguments OrElse Not candidates(0).Candidate.IsOperator) 2110Debug.Assert(Not candidates(0).Candidate.IsOperator) 2120Debug.Assert(indexesOfApplicableCandidates.Count = applicableCandidates) 2128Debug.Assert(level <= candidates(index).InferenceLevel) 2193Debug.Assert(leftWins Xor rightWins) 2299Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 2346Debug.Assert(cmp = ApplicabilityComparisonResult.EquallyApplicable) 2350Debug.Assert(Not (leftHasMoreApplicableParameterType AndAlso rightHasMoreApplicableParameterType)) 2380Debug.Assert(argument Is Nothing OrElse argument.Kind <> BoundKind.OmittedArgument) 2470Debug.Assert(rightSpecialType < leftSpecialType) 2602Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 2637Debug.Assert(argument Is Nothing OrElse argument.Kind <> BoundKind.OmittedArgument) 2714Debug.Assert(current.Candidate.IsOperator) 2721Debug.Assert(contender.Candidate.IsOperator) 2738Debug.Assert(applicableCandidates > 1) ' source and lifted operators are not equally applicable. 2745Debug.Assert(current.Candidate.IsOperator) 2752Debug.Assert(contender.Candidate.IsOperator) 2837Debug.Assert(applicableCandidates > 0) 2878Debug.Assert(applicableCandidates = 1) 2886Debug.Assert(False, "Should not reach this line.") 2900Debug.Assert((conv And ConversionKind.UserDefined) = 0) 3008Debug.Assert(applicableCandidates > 0) 3039Debug.Assert(Not arguments.IsDefault) 3040Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3041Debug.Assert(Not candidate.ArgumentMatchingDone) 3042Debug.Assert(candidate.State = CandidateAnalysisResultState.Applicable) 3092Debug.Assert(parameterToArgumentMap(paramIndex) = -1) 3131Debug.Assert(argumentNames(i) Is Nothing OrElse argumentNames(i).Length > 0) 3224Debug.Assert(Not arguments.IsDefault) 3225Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3226Debug.Assert(Not candidate.ArgumentMatchingDone) 3227Debug.Assert(candidate.State = CandidateAnalysisResultState.Applicable) 3228Debug.Assert(Not candidate.Candidate.UnderlyingSymbol.IsReducedExtensionMethod() OrElse methodOrPropertyGroup.ReceiverOpt IsNot Nothing OrElse TypeOf methodOrPropertyGroup.SyntaxTree Is DummySyntaxTree) 3240Debug.Assert(Not candidate.IgnoreExtensionMethods) 3308Debug.Assert(paramArrayArgument Is Nothing OrElse paramArrayArgument.Kind <> BoundKind.OmittedArgument) 3329Debug.Assert(paramArrayArgument.IsNothingLiteral()) 3339Debug.Assert(Conversions.IsWideningConversion(arrayConversion.Key)) 3354Debug.Assert(candidate.IsExpandedParamArrayForm) 3444Debug.Assert(Not defaultValueDiagnostics.DiagnosticBag.AsEnumerable().Any()) 3475Debug.Assert(Not isByRef OrElse param.IsExplicitByRef OrElse targetType.IsStringType()) 3519Debug.Assert(defaultArgument Is Nothing) 3599Debug.Assert((conv.Key And ConversionKind.InvolvesNarrowingFromNumericConstant) = 0) 3683Debug.Assert(delegateInvoke IsNot Nothing) 3687Debug.Assert(bound IsNot Nothing) 3759Debug.Assert(Not argument.HasErrors) 3811Debug.Assert(Conversions.IsNarrowingConversion(outConvKind.Key)) 3863Debug.Assert(results IsNot Nothing) 3864Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3958Debug.Assert(isExtensionMethod = info2.Candidate.IsExtensionMethod) 3991Debug.Assert(accessibilityCmp = 0) 4047Debug.Assert(candidate IsNot Nothing) 4048Debug.Assert(appliesToNormalForm OrElse appliesToParamArrayForm) 4174Debug.Assert(candidate.AppliesToNormalForm <> candidate.AppliesToParamArrayForm) 4228Debug.Assert(triedToAddSomething) 4265Debug.Assert(newCandidate.State <> CandidateAnalysisResultState.Applicable) 4287Debug.Assert(newCandidate.State = CandidateAnalysisResultState.Applicable) 4291Debug.Assert(newCandidate.Candidate.ParameterCount >= argumentCount OrElse newCandidate.IsExpandedParamArrayForm) 4292Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0) 4293Debug.Assert(Not operatorResolution OrElse argumentNames.IsDefault) 4309Debug.Assert(Not operatorResolution) 4350Debug.Assert(existingCandidate.Candidate.ParameterCount >= argumentCount OrElse existingCandidate.IsExpandedParamArrayForm) 4358Debug.Assert(Not operatorResolution) 4365Debug.Assert(Not operatorResolution) 4368Debug.Assert(argumentCount = existingCandidate.Candidate.ParameterCount) 4369Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 4390Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 4410Debug.Assert(argumentNames.IsDefault OrElse signatureMatch) 4439Debug.Assert(Not existingWins OrElse Not newWins) ' Both cannot win! 4514Debug.Assert(Not existingCandidate.Candidate.IsLifted) 4659Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 4727Debug.Assert((saveTrack And TypeParameterKind.Method) = 0 OrElse (leftHasLeastGenericParameterAgainstMethod AndAlso rightHasLeastGenericParameterAgainstMethod)) 4728Debug.Assert((saveTrack And TypeParameterKind.Type) = 0 OrElse (leftHasLeastGenericParameterAgainstType AndAlso rightHasLeastGenericParameterAgainstType)) 4763Debug.Assert(argument.Kind <> BoundKind.OmittedArgument) 4839Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 4871Debug.Assert(leftParamWins <> rightParamWins) 4892Debug.Assert(Not leftWins OrElse Not rightWins) 4960Debug.Assert(leftArgWins <> rightArgWins) 4982Debug.Assert(Not leftWins OrElse Not rightWins)
Semantics\TypeInference\Graph.vb (5)
84Debug.Assert(node.Graph Is Me) 96Debug.Assert(Contains(source)) 97Debug.Assert(Contains(target)) 182Debug.Assert(node.AlgorithmData.StronglyConnectedComponent Is Nothing) 208Debug.Assert(insertAt = oldListSize - 1)
Semantics\TypeInference\TypeInferenceCollection.vb (16)
190Debug.Assert(numberOfStrictCandidates = 0, "code logic error: since every strict candidate is also an unstrict candidate.") 197Debug.Assert(numberOfUnstrictCandidates > 1, "code logic error: we should already have covered this case") 205Debug.Assert(resultList.Count() = numberOfUnstrictCandidates, "code logic error: we should have >1 unstrict candidates, like we calculated earlier") 211Debug.Assert(numberOfStrictCandidates > 1, "code logic error: we should have >1 widening candidates; all other possibilities have already been covered") 251Debug.Assert(False, "How can a typeless hint be a candidate?") 326Debug.Assert(rank <> -1) ' Can we get different ranks at all? If we can, we should investigate if we can do something better than just give up. 393Debug.Assert(False, "unexpected: how can there be multiple strict candidates and no widest ones??? please tell lwischik if you find such a case.") 401Debug.Assert(resultList.Count > 0, "code logic error: we already said there were multiple strict candidates") 425Debug.Assert(RequiredConversion.Count = 8, "If you've updated the type argument inference restrictions, then please also update CheckHintSatisfaction()") 493Debug.Assert(Conversions.IsWideningConversion(inConversion) AndAlso Conversions.IsWideningConversion(outConversion) AndAlso 536Debug.Assert(False, "code logic error: inferenceRestrictions; we should have dealt with all of them already") 549Debug.Assert(False, "code logic error: ConversionClass; we should have dealt with them already") 564Debug.Assert(type IsNot Nothing) 567Debug.Assert(Not type.IsVoidType(), "Please do not put Void types into the dominant type algorithm. That doesn't make sense.") 594Debug.Assert(Not foundInList, "List is supposed to be unique: how can we already find two of the same type in this list.") 630Debug.Assert(names1.Length = names2.Length)
Symbols\ConstraintsHelper.vb (18)
117Debug.Assert(explicitKind = DirectTypeConstraintKind.ExplicitType) 134Debug.Assert(explicitKind = DirectTypeConstraintKind.ExplicitType) 501Debug.Assert(Not type.IsTupleType) 502Debug.Assert(typeArgumentsSyntax.Count = type.Arity) 622Debug.Assert(typeParameters.Length = typeArguments.Length) 652Debug.Assert(((constructedSymbol Is Nothing) AndAlso (substitution Is Nothing)) OrElse 747Debug.Assert(info.Severity = DiagnosticSeverity.Error) 843Debug.Assert(Not baseType.IsInterfaceType()) 844Debug.Assert(baseType.TypeKind <> TypeKind.TypeParameter) 905Debug.Assert(Not IsBad) 936Debug.Assert(typeParameter.HasConstructorConstraint) 994Debug.Assert((typeParameter Is Nothing) OrElse typeParameter.HasReferenceTypeConstraint) 1015Debug.Assert((typeParameter Is Nothing) OrElse typeParameter.HasValueTypeConstraint) 1138Debug.Assert(cycle.Any()) 1166Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Structure) 1208Debug.Assert(constraintType IsNot Nothing) 1232Debug.Assert(Not TypeSymbol.Equals(type.ConstructedFrom, type, TypeCompareKind.ConsiderEverything)) 1250Debug.Assert(method.ConstructedFrom <> method)
Symbols\EventSymbol.vb (2)
196Debug.Assert(Me.IsDefinition) 233Debug.Assert(errorInfo.Severity = DiagnosticSeverity.Error)
Symbols\LabelSymbol.vb (1)
169Debug.Assert(resumeStmt.Kind = SyntaxKind.OnErrorResumeNextStatement OrElse
Symbols\Metadata\PE\MemberRefMetadataDecoder.vb (3)
30Debug.Assert(containingType IsNot Nothing) 63Debug.Assert(cumulativeArity <= position) 87Debug.Assert(typeArgument Is Nothing)
Symbols\Metadata\PE\SymbolFactory.vb (1)
121Debug.Assert(genericParameters.Length > 0)
Symbols\MethodSignatureComparer.vb (3)
393Debug.Assert((comparisons And SymbolComparisonResults.ArityMismatch) <> 0) 816Debug.Assert(containingType.TypeSubstitution Is Nothing OrElse TypeOf method Is SignatureOnlyMethodSymbol) 847Debug.Assert(typeParameters2.Length = arity)
Symbols\ObsoleteAttributeHelpers.vb (8)
37Debug.Assert(obsoleteAttributeData Is Nothing OrElse Not obsoleteAttributeData.IsUninitialized) 72Debug.Assert(context IsNot Nothing) 73Debug.Assert(symbol IsNot Nothing) 131Debug.Assert(data IsNot Nothing) 139Debug.Assert(Not data.IsUninitialized) 142Debug.Assert(data.Message Is Nothing) 143Debug.Assert(Not data.IsError) 149Debug.Assert(Not data.IsError)
Symbols\Source\ImplementsHelper.vb (9)
43Debug.Assert(GetExplicitInterfaceImplementations(sourceSym).Contains(implementedSym)) 73Debug.Assert(implementedSym IsNot Nothing) 96Debug.Assert(implementsClause IsNot Nothing) 134Debug.Assert(implementedMember.Kind = SymbolKind.Event) 330Debug.Assert(candidatesCount = 0) 425Debug.Assert(implementingSym.Kind = implementedSym.Kind) 564Debug.Assert(TypeOf interfaceMember Is PropertySymbol OrElse 569Debug.Assert(interfaceType IsNot Nothing AndAlso interfaceType.IsInterface) 642Debug.Assert(Not currType.Dangerous_IsFromSomeCompilationIncludingRetargeting)
Symbols\Source\ImplicitNamedTypeSymbol.vb (2)
30Debug.Assert(declaration.Kind = DeclarationKind.ImplicitClass OrElse declaration.Kind = DeclarationKind.Submission OrElse declaration.Kind = DeclarationKind.Script) 191Debug.Assert(Me.IsScriptClass OrElse Me.IsImplicitClass)
Symbols\Source\OverloadingHelper.vb (1)
29Debug.Assert(kind = SymbolKind.Method OrElse kind = SymbolKind.Property)
Symbols\Source\OverrideHidingHelper.vb (15)
24Debug.Assert(container.IsDefinition) ' Don't do this on constructed types 121Debug.Assert(Not exactMatch OrElse exactMatchIgnoringCustomModifiers) 259Debug.Assert(unimplementedMembers.Contains(DirectCast(member, MethodSymbol).AssociatedSymbol)) 280Debug.Assert(IdentifierComparison.Equals(hidingMember.Name, hiddenMember.Name)) 350Debug.Assert(container.IsDefinition) 387Debug.Assert(Not (hidingMember.IsAccessor() AndAlso hiddenMember.IsAccessor)) 450Debug.Assert(hidingMember.GetFirstLocation().IsInSource) 469Debug.Assert(hidingMember.GetFirstLocation().IsInSource) 504Debug.Assert(False, String.Format("Unexpected method kind '{0}'", DirectCast(sym, MethodSymbol).MethodKind)) 621Debug.Assert(Not (TypeOf overridingSym Is MethodSymbol AndAlso DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).ConstructedFrom <> overridingSym)) 625Debug.Assert(Not (TypeOf overridingSym Is MethodSymbol AndAlso 644Debug.Assert(Not containingType.IsInterface, "An interface member can't be marked overrides") 687Debug.Assert(Not (TypeOf overridingSym Is MethodSymbol AndAlso 719Debug.Assert(stopLookup) 835Debug.Assert(overriddenMembersResult IsNot Nothing)
Symbols\Source\SourceDeclareMethodSymbol.vb (4)
36Debug.Assert(MyBase.MethodKind = MethodKind.DeclareMethod) 37Debug.Assert(platformInvokeInfo IsNot Nothing) 60Debug.Assert(_lazyMetadataName IsNot Nothing) 69Debug.Assert(old Is Nothing OrElse old = metadataName)
Symbols\Source\SourceLabelSymbol.vb (2)
27Debug.Assert(labelNameToken.Kind = SyntaxKind.IdentifierToken OrElse labelNameToken.Kind = SyntaxKind.IntegerLiteralToken) 63Debug.Assert(TypeOf parentNode Is LabelStatementSyntax)
Symbols\Source\SourcePropertySymbol.vb (24)
70Debug.Assert(container IsNot Nothing) 71Debug.Assert(syntaxRef IsNot Nothing) 72Debug.Assert(location IsNot Nothing) 193Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor)) 225Debug.Assert((prop._getMethod Is Nothing) OrElse prop._getMethod.ImplicitlyDefinedBy Is prop) 226Debug.Assert((prop._setMethod Is Nothing) OrElse prop._setMethod.ImplicitlyDefinedBy Is prop) 285Debug.Assert((prop._getMethod Is Nothing) OrElse prop._getMethod.ImplicitlyDefinedBy Is prop) 286Debug.Assert((prop._setMethod Is Nothing) OrElse prop._setMethod.ImplicitlyDefinedBy Is prop) 315Debug.Assert(syntax.Kind = SyntaxKind.ModifiedIdentifier) 376Debug.Assert(type IsNot Nothing) 417Debug.Assert(_lazyMetadataName IsNot Nothing) 426Debug.Assert(old Is Nothing OrElse old = metadataName) 541Debug.Assert(arguments.AttributeType IsNot Nothing) 542Debug.Assert(Not arguments.AttributeType.IsErrorType()) 574Debug.Assert(arguments.AttributeSyntaxOpt IsNot Nothing) 822Debug.Assert(IsDefinition) 941Debug.Assert(Not implementedProperties.IsDefault) 1050Debug.Assert(ExplicitInterfaceImplementations.Contains(implementedProperty)) 1079Debug.Assert(accessor IsNot Nothing) 1182Debug.Assert(syntaxTree IsNot Nothing) 1183Debug.Assert(block IsNot Nothing) 1184Debug.Assert(block.BlockStatement IsNot Nothing) 1232Debug.Assert(attributeData IsNot Nothing) 1233Debug.Assert(_lazyCustomAttributesBag Is Nothing)
Symbols\Source\SynthesizedFieldSymbol.vb (3)
37Debug.Assert(containingType IsNot Nothing) 38Debug.Assert(implicitlyDefinedBy IsNot Nothing) 39Debug.Assert(type IsNot Nothing)
Symbols\Source\SynthesizedMainTypeEntryPoint.vb (1)
55Debug.Assert(binder.IsDefaultInstancePropertyAllowed)
Symbols\Source\SynthesizedMyGroupCollectionPropertyAccessorSymbol.vb (3)
29Debug.Assert(createOrDisposeMethod IsNot Nothing AndAlso createOrDisposeMethod.Length > 0) 60Debug.Assert(targetTypeName.StartsWith("Global.", StringComparison.Ordinal)) 82Debug.Assert(Not vbdiag.HasLazyInfo,
Symbols\Source\SynthesizedStaticLocalBackingField.vb (1)
40Debug.Assert(implicitlyDefinedBy.IsStatic)
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (3)
41Debug.Assert(correspondingMethodTypeParameter.IsDefinition) 42Debug.Assert(correspondingMethodTypeParameter.ContainingSymbol <> container) 49Debug.Assert(Me.TypeParameterKind = If(TypeOf Me.ContainingSymbol Is MethodSymbol, TypeParameterKind.Method,
Symbols\SynthesizedSymbols\SynthesizedOverridingWitheventsProperty.vb (2)
191Debug.Assert(_baseProperty.Parameters.IsEmpty) 198Debug.Assert(_baseProperty.ParameterCount = 0)
Symbols\TypeSymbolExtensions.vb (1)
691Call Global.System.Diagnostics.Debug.Assert(matchingInterface.Arity = 1)
Utilities\TypeUnification.vb (2)
32Debug.Assert(Not result OrElse 91Debug.Assert(t1.Type.IsTypeParameter() OrElse Not t2.Type.IsTypeParameter())
Utilities\VarianceAmbiguity.vb (3)
53Debug.Assert(i1.IsInterfaceType() AndAlso i2.IsInterfaceType()) 54Debug.Assert(i1.IsGenericType AndAlso i2.IsGenericType) 55Debug.Assert(TypeSymbol.Equals(i1.OriginalDefinition, i2.OriginalDefinition, TypeCompareKind.ConsiderEverything))
Microsoft.CodeAnalysis.Workspaces (753)
Classification\ClassifierHelper.cs (5)
195Debug.Assert(!span.TextSpan.IsEmpty); 292Debug.Assert(firstSemanticPartSpan.OverlapsWith(syntacticPartSpan)); 293Debug.Assert(lastSemanticPartSpan.OverlapsWith(syntacticPartSpan)); 310Debug.Assert(semanticPart1Span.OverlapsWith(syntacticPartSpan)); 311Debug.Assert(semanticPart1Span.OverlapsWith(syntacticPartSpan));
CodeActions\CodeAction.cs (1)
606Debug.Assert(nestedActions.Length > 0);
CodeFixes\CodeFixProvider.cs (1)
65Debug.Assert(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Default or CodeActionRequestPriority.High, "Provider returned invalid priority");
CodeFixes\FixAllOccurrences\FixAllState.cs (1)
39Debug.Assert(diagnosticSpan.HasValue || scope is not (FixAllScope.ContainingMember or FixAllScope.ContainingType));
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (6)
46Debug.Assert(newDocument.Id == _oldDocument.Id); 158Debug.Assert(IsPureInsertion(change)); 159Debug.Assert(overlappingSpans.Count == 0); 203Debug.Assert(!IsPureInsertion(change)); 213Debug.Assert(!IsPureInsertion(change)); 233Debug.Assert(!IsPureInsertion(change));
CodeFixesAndRefactorings\CommonFixAllState.cs (1)
35Debug.Assert(document == null || document.Project == project);
CodeRefactorings\CodeRefactoringProvider.cs (1)
61Debug.Assert(priority is CodeActionRequestPriority.Low or CodeActionRequestPriority.Default or CodeActionRequestPriority.High, "Provider returned invalid priority");
Diagnostics\DiagnosticAnalysisResult.cs (5)
53Debug.Assert(!others.IsDefault); 54Debug.Assert(!syntaxLocals.Values.Any(item => item.IsDefault)); 55Debug.Assert(!semanticLocals.Values.Any(item => item.IsDefault)); 56Debug.Assert(!nonLocals.Values.Any(item => item.IsDefault)); 164Debug.Assert(textDocument?.SupportsDiagnostics() == true);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
123Debug.Assert(dummy == null);
Diagnostics\DiagnosticAnalysisResultMap.cs (1)
39Debug.Assert(telemetryInfo.IsEmpty || telemetryInfo.Count == analysisResult.Count);
Diagnostics\DocumentAnalysisScope.cs (2)
27Debug.Assert(kind is AnalysisKind.Syntax or AnalysisKind.Semantic); 28Debug.Assert(!analyzers.IsDefaultOrEmpty);
Diagnostics\Extensions.cs (2)
283Debug.Assert(diagnostics.All(d => d.Location.SourceTree == tree)); 295Debug.Assert(diagnostics.All(d => d.Location.SourceTree == tree));
Differencing\AbstractSyntaxComparer.cs (1)
189Debug.Assert(label != IgnoredNode || isLeaf);
Differencing\Edit.cs (3)
24Debug.Assert((oldNode == null || oldNode.Equals(null)) == (kind == EditKind.Insert)); 25Debug.Assert((newNode == null || newNode.Equals(null)) == (kind == EditKind.Delete)); 27Debug.Assert(comparer == null ||
Differencing\EditScript.cs (5)
72Debug.Assert(Comparer.TreesEqual(x, Root2)); 163Debug.Assert(Comparer.TreesEqual(w, Root1)); 164Debug.Assert(Comparer.TreesEqual(x, Root2)); 233Debug.Assert(Comparer.TreesEqual(a, Root1)); 234Debug.Assert(Comparer.TreesEqual(b, Root2));
Differencing\LongestCommonSubsequence.cs (12)
92Debug.Assert(previous != null); 97Debug.Assert(minDepth > 0); 98Debug.Assert(minDepth <= maxDepth); 113Debug.Assert(start >= 0); 114Debug.Assert(start + length <= _array.Length); 260Debug.Assert(hasNext); 285Debug.Assert(yEnd > yMid); 313Debug.Assert(hasNext); 338Debug.Assert(yEnd > yMid); 374Debug.Assert(oldLength >= 0 && newLength >= 0); 397Debug.Assert(lcsLength <= max); 484Debug.Assert(xEnd == yEnd + k);
Differencing\Match.cs (13)
104Debug.Assert(nodes1.Length == nodes2.Length); 167Debug.Assert(maxAcceptableDistance is >= ExactMatchDistance and <= MaxDistance); 223Debug.Assert(Comparer.GetLabel(ancestor1) <= Comparer.GetLabel(node1)); 264Debug.Assert(added); 282Debug.Assert(Comparer.TreesEqual(node1, OldRoot)); 283Debug.Assert(Comparer.TreesEqual(node2, NewRoot)); 298Debug.Assert(Comparer.TreesEqual(node2, NewRoot)); 299Debug.Assert(!result || Comparer.TreesEqual(partner1, OldRoot)); 305Debug.Assert(Comparer.TreesEqual(node2, NewRoot)); 312Debug.Assert(Comparer.TreesEqual(node1, OldRoot)); 313Debug.Assert(!result || Comparer.TreesEqual(partner2, NewRoot)); 319Debug.Assert(Comparer.TreesEqual(node1, OldRoot)); 325Debug.Assert(Comparer.TreesEqual(node2, NewRoot));
Differencing\Match.LongestCommonSubsequence.cs (1)
20Debug.Assert(match != null);
Differencing\SequenceEdit.cs (3)
21Debug.Assert(oldIndex >= -1); 22Debug.Assert(newIndex >= -1); 23Debug.Assert(newIndex != -1 || oldIndex != -1);
Differencing\TreeComparer.cs (1)
99Debug.Assert(hasParent);
Editing\SyntaxGenerator.cs (1)
1958Debug.Assert(!parts.IsEmpty());
ExtensionManager\ServicesLayerExtensionManager.cs (1)
19Debug.Assert(exception is not OperationCanceledException);
FindSymbols\FindReferences\DependentTypeFinder.cs (5)
146Debug.Assert(project.SupportsCompilation); 260Debug.Assert(infos.Count > 0); 294Debug.Assert(project.SupportsCompilation); 379Debug.Assert(type.Locations.All(assert), message); 564Debug.Assert(pooledInstance.Count == 0);
FindSymbols\FindReferences\Finders\ExplicitConversionSymbolReferenceFinder.UnderlyingNamedTypeVisitor.cs (1)
39Debug.Fail($"Symbol case not handled: {symbol.Kind}");
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
255Debug.Assert(syntaxFacts.IsIndexerMemberCref(node));
FindSymbols\FindReferences\FindReferencesSearchEngine_FindReferencesInDocuments.cs (1)
27Debug.Assert(_options.UnidirectionalHierarchyCascade);
FindSymbols\FindReferences\MetadataUnifyingSymbolHashSet.cs (1)
22Debug.Assert(instance.Count == 0);
FindSymbols\IStreamingFindReferencesProgress.cs (1)
38Debug.Assert(symbols.All(s => s.Kind == symbols[0].Kind));
FindSymbols\SymbolFinder.cs (1)
199Debug.Assert(solution.WorkspaceKind is WorkspaceKind.Interactive or WorkspaceKind.MiscellaneousFiles);
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (3)
695Debug.Assert(typeDefinition.Kind == MetadataDefinitionKind.Type); 988Debug.Assert(node.Name == null); 995Debug.Assert(node.Name != null);
FindSymbols\SymbolTree\SymbolTreeInfo_Serialization.cs (1)
46Debug.Assert(read.Checksum == checksum);
FindSymbols\SymbolTree\SymbolTreeInfo.cs (6)
433Debug.Assert(Checksum.Equals(other.Checksum)); 434Debug.Assert(_nodes.Length == other._nodes.Length); 441Debug.Assert(_inheritanceMap.Keys.Count == other._inheritanceMap.Keys.Count); 449Debug.Assert(values1.Length == values2.Length); 452Debug.Assert(values1[j] == values2[j]); 478Debug.Assert(baseNameIndex >= 0);
FindSymbols\SymbolTree\SymbolTreeInfo.Node.cs (2)
56Debug.Assert(node.Name == this.Name); 57Debug.Assert(node.ParentIndex == this.ParentIndex);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (8)
370Debug.Assert(identifiers.Comparer == StringComparer.OrdinalIgnoreCase); 371Debug.Assert(escapedIdentifiers.Comparer == StringComparer.OrdinalIgnoreCase); 378Debug.Assert(identifiers.Comparer == StringComparer.Ordinal); 379Debug.Assert(escapedIdentifiers.Comparer == StringComparer.Ordinal); 386Debug.Assert(identifiers.Comparer == StringComparer.OrdinalIgnoreCase); 387Debug.Assert(escapedIdentifiers.Comparer == StringComparer.OrdinalIgnoreCase); 394Debug.Assert(identifiers.Comparer == StringComparer.Ordinal); 395Debug.Assert(escapedIdentifiers.Comparer == StringComparer.Ordinal);
FindSymbols\TopLevelSyntaxTree\NavigateToSearchIndex.NavigateToSearchInfo.cs (5)
617Debug.Assert(_ngramFilter != null); 797Debug.Assert(text == text.ToLowerInvariant()); 798Debug.Assert(text.Length >= 2); 799Debug.Assert(!_fuzzyBigramBitset.IsDefault); 809Debug.Assert(_ngramFilter != null);
LanguageServices\DeclaredSymbolFactoryService\ArityUtilities.cs (1)
18Debug.Assert(arity > 0);
Log\HistogramLogAggregator.cs (1)
64Debug.Assert(bucketSize > 0 && maxBucketValue > 0 && bucketCount > 0);
Log\KeyValueLogMessage.cs (1)
218Debug.Assert(str != null && !str.Contains(PairSeparator) && !str.Contains(KeyValueSeparator) && !str.Contains(ItemSeparator));
Log\RoslynEventSource.LogBlock.cs (4)
64Debug.Assert(message != null || entityForMessage != null); 110Debug.Assert(_message != null); 111Debug.Assert(!_startLogged); 136Debug.Assert(_message != null);
Options\GlobalOptionService.cs (2)
122Debug.Assert(optionKey.Option is IOption2 { Definition.StorageMapping: null }); 228Debug.Assert(!changedOptions.IsEmpty);
Options\LegacyWorkspaceOptionService.cs (2)
41Debug.Assert(key.Option is not IOption2); 56Debug.Assert(internallyDefinedOptions.All(entry => OptionSet.IsInternalOptionValue(entry.Value)));
Options\Option.cs (1)
59Debug.Assert(storageLocations.All(l => l is not IEditorConfigValueSerializer));
Options\OptionSet.cs (1)
31Debug.Assert(IsPublicOptionValue(result));
Options\PerLanguageOption.cs (1)
51Debug.Assert(storageLocations.All(l => l is not IEditorConfigValueSerializer));
PatternMatching\CamelCaseResult.cs (1)
31Debug.Assert(matchedSpansInReverse == null || matchedSpansInReverse.Count == matchCount);
PatternMatching\PatternMatcher.cs (2)
544Debug.Assert(firstMatch.HasValue); 545Debug.Assert(contiguous.HasValue);
PatternMatching\RegexQuery.cs (2)
71Debug.Assert(text.Length >= 2); 72Debug.Assert(text == text.ToLowerInvariant());
Rename\ConflictEngine\ConflictResolver.cs (1)
462Debug.Assert(index <= str1.Length && index <= str2.Length, "Index cannot be greater than the string");
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
81Debug.Assert(location.ComplexifiedTargetSpan.Contains(location.ConflictCheckSpan) || location.Type == RelatedLocationType.UnresolvableConflict);
Rename\RenameUtilities.cs (2)
302Debug.Assert(subSpan.Start <= replaceInsideString.Length); 303Debug.Assert(subSpan.End <= replaceInsideString.Length);
Rename\SymbolicRenameLocations.cs (1)
41Debug.Assert(locations.Distinct().Length == locations.Length, "Locations should be unique");
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
460Debug.Assert(renameText.Length == match.Length);
Serialization\SerializableSourceText.cs (2)
72Debug.Assert(storageHandle is null != text is null); 80Debug.Assert(contentChecksum == Checksum.Create(computedContentHash));
Serialization\SerializerService_Reference.cs (1)
511Debug.Assert(stream.Length == span.Length);
Shared\Extensions\ISymbolExtensions.cs (3)
580Debug.Assert(copy != node); 581Debug.Assert(copy.Parent == null); // Otherwise, when we give it one, it will be copied. 598Debug.Assert(sourceAttributes.Current.Name == targetAttributes.Current.Name);
Shared\Extensions\ProjectExtensions.cs (1)
24Debug.Assert(location.Kind == LocationKind.ExternalFile);
Shared\Extensions\SafeHandleExtensions.cs (1)
34Debug.Assert(success, $"{nameof(SafeHandle.DangerousAddRef)} does not return when {nameof(success)} is false.");
Shared\Extensions\SemanticModelExtensions.cs (1)
110Debug.Assert(tokenParent is not null);
Shared\TestHooks\AsynchronousOperationListener.cs (1)
152Debug.Assert(removed, "IAsyncToken and Listener mismatch");
Shared\Utilities\BloomFilter.cs (2)
188Debug.Assert(numberOfCharsLeft == 0); 243Debug.Assert(index <= 3);
Shared\Utilities\XmlFragmentParser.cs (2)
199Debug.Assert(charCount > 0); 204Debug.Assert(destCount >= 0);
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\AnalyzerAssemblyLoader.cs (1)
194Debug.Assert(GeneratedPathComparer.Equals(_originalPathInfoMap[originalPath].ResolvedPath, resolvedPath));
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ProgramFilesAnalyzerPathResolver.cs (2)
43Debug.Assert(IsAnalyzerPathHandled(originalAnalyzerPath)); 49Debug.Assert(IsAnalyzerPathHandled(originalAnalyzerPath));
src\roslyn\src\Compilers\Core\Portable\DiagnosticAnalyzer\ShadowCopyAnalyzerPathResolver.cs (2)
370Debug.Assert(AnalyzerAssemblyLoader.GeneratedPathComparer.Equals(shadowCopyPath, task.Result)); 452Debug.Assert(bytesWritten == hash.Length);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (1)
714Debug.Assert(data.All(d => d.Count() == count));
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
342Debug.Assert(desiredGroupIndex >= 0); 343Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
206Debug.Assert(false, message + ". " + diagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
34Debug.Assert(diagnostic != null); 88Debug.Assert(analyzerConfigPath != null); 89Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
102Debug.Fail("Previous container didn't map back to a normal accessor container."); 111Debug.Fail("Accessor count shouldn't have changed as there were no top level edits."); 132Debug.Fail("Member count shouldn't have changed as there were no top level edits."); 139Debug.Fail("Child at indicated index should be a node as there were no top level edits.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (3)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel); 227Debug.Assert(replacedParent.GetAnnotatedNodesAndTokens(annotation).Count() == 1); 246Debug.Assert(newRoot.GetAnnotatedNodesAndTokens(marker).Count() == 1);
TemporaryStorage\TemporaryStorageService.cs (1)
317Debug.Assert(*src == 0xFEFF);
TemporaryStorage\TemporaryStorageService.MemoryMappedInfo.cs (1)
88Debug.Assert(streamAccessor.Target.CanRead);
Utilities\Deque.cs (6)
39Debug.Assert((uint)index < (uint)_count); 48Debug.Assert(_count > 0); 57Debug.Assert(_count > 0); 71Debug.Assert(_count > 0); 82Debug.Assert(_count > 0); 147Debug.Assert(instance._count == 0);
Utilities\Documentation\XmlDocumentationProvider.cs (1)
156Debug.Assert(PathUtilities.IsAbsolute(filePath));
Workspace\Host\Metadata\WorkspaceMetadataFileReferenceResolver.cs (2)
21Debug.Assert(metadataService != null); 22Debug.Assert(pathResolver != null);
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
1088Debug.Assert(_gate.CurrentCount == 0); 1158Debug.Assert(_gate.CurrentCount == 0);
Workspace\ProjectSystem\ProjectSystemProjectOptionsProcessor.cs (1)
131Debug.Assert(!arguments.IsDefault);
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (1)
94Debug.Assert(references.IsSupersetOf(referencedProjectIds));
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (2)
85Debug.Assert(references.Contains(referencedProjectId)); 139Debug.Assert(references.Contains(projectId));
Workspace\Solution\ProjectDependencyGraph.cs (11)
494Debug.Assert(projectIds.Count >= referencesMap.Count); 495Debug.Assert(referencesMap.Keys.All(projectIds.Contains)); 499Debug.Assert(!referencedProjects.IsEmpty, "Unexpected empty value in the forward references map."); 502Debug.Assert(projectIds.Contains(referencedProject), "Unexpected reference to unknown project."); 516Debug.Assert(projectIds.Count >= reverseReferencesMap.Count); 517Debug.Assert(reverseReferencesMap.Keys.All(projectIds.Contains)); 523Debug.Assert(reverseReferencesMap.ContainsKey(referencedProject)); 524Debug.Assert(reverseReferencesMap[referencedProject].Contains(project)); 530Debug.Assert(!referencingProjects.IsEmpty, "Unexpected empty value in the reverse references map."); 533Debug.Assert(forwardReferencesMap.ContainsKey(referencingProject)); 534Debug.Assert(forwardReferencesMap[referencingProject].Contains(project));
Workspace\Solution\ProjectState.cs (7)
717Debug.Assert(attributes.Version != Attributes.Version); 871Debug.Assert(!documents.Any(d => DocumentStates.Contains(d.Id))); 883Debug.Assert(!documents.Any(d => AdditionalDocumentStates.Contains(d.Id))); 895Debug.Assert(!documents.Any(d => AnalyzerConfigDocumentStates.Contains(d.Id))); 974Debug.Assert(!oldDocuments.SequenceEqual(newDocuments)); 1000Debug.Assert(!oldDocuments.SequenceEqual(newDocuments)); 1023Debug.Assert(!oldDocuments.SequenceEqual(newDocuments));
Workspace\Solution\SolutionCompilationState.CompilationTracker.CompilationTrackerState.cs (2)
197Debug.Assert(object.ReferenceEquals(finalCompilationWithGeneratedDocuments, compilationWithoutGeneratedDocuments)); 284Debug.Assert(tmp == projectId);
Workspace\Solution\SolutionCompilationState.cs (7)
635Debug.Assert(addedDocumentInfos.IsEmpty); 636Debug.Assert(removedDocumentInfos.IsEmpty); 1075Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1090Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1105Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1119Debug.Assert(stateChange.OldProjectState != stateChange.NewProjectState); 1138Debug.Assert(stateChange.OldProjectState != stateChange.NewProjectState);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (2)
108Debug.Assert(symbol.Kind is SymbolKind.Assembly or SymbolKind.NetModule or SymbolKind.DynamicType); 511Debug.Assert(this.ProjectState.IsSubmission);
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (2)
149Debug.Assert(version != VersionStamp.Default); 164Debug.Assert(version != VersionStamp.Default);
Workspace\Solution\SolutionState.CachingFilePathComparer.cs (2)
84Debug.Assert(src[obj.Length] == '\0', "src[this.Length] == '\\0'"); 85Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
Workspace\Solution\SolutionState.cs (6)
177Debug.Assert(SortedProjectStates.Select(static state => state.Id).SetEquals(ProjectIds)); 178Debug.Assert(SortedProjectStates.Select(static state => state.Id).SetEquals(_dependencyGraph.ProjectIds)); 181Debug.Assert(SortedProjectStates.IsSorted()); 1152Debug.Assert(oldProject != newProject); 1165Debug.Assert(oldProject != newProject); 1176Debug.Assert(oldProject != newProject);
Workspace\Solution\StateChecksums.cs (1)
519Debug.Assert(state.TryGetStateChecksums(out var stateChecksum) && this == stateChecksum);
Workspace\Solution\TextDocumentStates.cs (1)
61Debug.Assert(map.KeyComparer == DocumentIdComparer.Instance);
Workspace\Solution\VersionStamp.cs (1)
125Debug.Assert(_globalIncrement != GlobalVersionMarker);
Workspace\Workspace_Editor.cs (2)
577Debug.Assert(oldDocument.Kind is TextDocumentKind.AdditionalDocument or TextDocumentKind.AnalyzerConfigDocument); 778Debug.Assert(oldDocument.Kind is TextDocumentKind.AdditionalDocument or TextDocumentKind.AnalyzerConfigDocument);
Workspace\Workspace.cs (22)
2056Debug.Assert(CanApplyChange(ApplyChangesKind.AddProject)); 2067Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProject)); 2082Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeCompilationOptions) || 2100Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeParseOptions) || 2113Debug.Assert(CanApplyChange(ApplyChangesKind.AddProjectReference)); 2124Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveProjectReference)); 2135Debug.Assert(CanApplyChange(ApplyChangesKind.AddMetadataReference)); 2146Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveMetadataReference)); 2157Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerReference)); 2168Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerReference)); 2179Debug.Assert(CanApplyChange(ApplyChangesKind.AddSolutionAnalyzerReference)); 2190Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveSolutionAnalyzerReference)); 2201Debug.Assert(CanApplyChange(ApplyChangesKind.AddDocument)); 2212Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveDocument)); 2223Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocument)); 2234Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeDocumentInfo)); 2245Debug.Assert(CanApplyChange(ApplyChangesKind.AddAdditionalDocument)); 2256Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAdditionalDocument)); 2267Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAdditionalDocument)); 2278Debug.Assert(CanApplyChange(ApplyChangesKind.AddAnalyzerConfigDocument)); 2289Debug.Assert(CanApplyChange(ApplyChangesKind.RemoveAnalyzerConfigDocument)); 2300Debug.Assert(CanApplyChange(ApplyChangesKind.ChangeAnalyzerConfigDocument));
Workspace\WorkspaceEventMap.cs (2)
40Debug.Assert(originalHandlers != newHandlers); 78Debug.Assert(registry != null, "Expected to find a registry for the handler and options.");
Microsoft.CodeAnalysis.Workspaces.MSBuild (13)
MSBuild\FileBasedProgramsProjectLoader.cs (1)
100Debug.Assert(projectCollection == ProjectCollection.Instance);
MSBuild\MSBuildProjectLoader.cs (1)
296Debug.Assert(projectFilePaths.All(PathUtilities.IsAbsolute));
MSBuild\MSBuildWorkspace.cs (10)
324Debug.Assert(_applyChangesBuildHostProcessManager == null); 339Debug.Assert(_applyChangesBuildHostProcessManager != null); 340Debug.Assert(_applyChangesProjectFile == null); 478Debug.Assert(_applyChangesProjectFile != null); 526Debug.Assert(encoding != null); 538Debug.Assert(_applyChangesProjectFile != null); 677Debug.Assert(_applyChangesProjectFile != null); 692Debug.Assert(_applyChangesProjectFile != null); 705Debug.Assert(_applyChangesProjectFile != null); 717Debug.Assert(_applyChangesProjectFile != null);
MSBuild\ProjectFileExtensionRegistry.cs (1)
64Debug.Assert(projectFilePath != null);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (30)
Build\ProjectBuildManager.cs (1)
132Debug.Assert(loadedProjects.Count == 1);
MSBuild\Logging\MSBuildDiagnosticLogger.cs (3)
50Debug.Assert(buildEventContext != null); 57Debug.Fail($"No log is registered for submission {buildEventContext.SubmissionId}."); 66Debug.Assert(_eventSource == null);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (3)
ProjectFileReference.cs (1)
40Debug.Assert(aliases != null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.CSharp (912)
Microsoft\CSharp\RuntimeBinder\ArgumentObject.cs (1)
22Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (8)
44Debug.Assert(o.HasValue); 265Debug.Assert(action.ReturnType == typeof(object)); 274Debug.Assert(action.ReturnType == typeof(object)); 289Debug.Assert(args != null); 290Debug.Assert(args.Length != 0); 291Debug.Assert(args[0].Value is Type); 368Debug.Assert(discard <= argCount); 369Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\ComInterop\BoolArgBuilder.cs (1)
16Debug.Assert(parameterType == typeof(bool));
Microsoft\CSharp\RuntimeBinder\ComInterop\ComBinderHelpers.cs (2)
20Debug.Assert(type != null); 53Debug.Assert(args != null);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeAction.cs (1)
66Debug.Assert(args.Length == 2);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComInvokeBinder.cs (8)
53Debug.Assert(callInfo != null); 54Debug.Assert(args != null); 55Debug.Assert(isByRef != null); 56Debug.Assert(method != null); 57Debug.Assert(dispatch != null); 59Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(ComMethodDesc), method.Type)); 60Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(IDispatch), dispatch.Type)); 393Debug.Assert(_varEnumSelector.VariantBuilders.Length == _totalExplicitArgs);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComMethodDesc.cs (1)
43Debug.Assert(cNames == rgNames.Length);
Microsoft\CSharp\RuntimeBinder\ComInterop\ComObject.cs (3)
22Debug.Assert(ComBinder.IsComObject(rcw)); 38Debug.Assert(ComBinder.IsComObject(rcw)); 67Debug.Assert(comObject != null && (typeof(ComObject).IsAssignableFrom(comObject.Type) || comObject.Type == typeof(object)), "must be ComObject");
Microsoft\CSharp\RuntimeBinder\ComInterop\ComRuntimeHelpers.cs (3)
131Debug.Assert(typeCount == 1); 147Debug.Assert(hresult == ComHresults.TYPE_E_LIBNOTREGISTERED); 252Debug.Assert(obj != null);
Microsoft\CSharp\RuntimeBinder\ComInterop\CurrencyArgBuilder.cs (1)
19Debug.Assert(parameterType == typeof(CurrencyWrapper));
Microsoft\CSharp\RuntimeBinder\ComInterop\DateTimeArgBuilder.cs (1)
16Debug.Assert(parameterType == typeof(DateTime));
Microsoft\CSharp\RuntimeBinder\ComInterop\DynamicVariantExtensions.cs (5)
50Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise 222Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise 241Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise 242Debug.Assert((value.VarType & VarEnum.VT_BYREF) == 0, "double indirection"); 402Debug.Assert(variant.VarType == VarEnum.VT_EMPTY); // The setter can only be called once as VariantClear might be needed otherwise
Microsoft\CSharp\RuntimeBinder\ComInterop\ErrorArgBuilder.cs (1)
17Debug.Assert(parameterType == typeof(ErrorWrapper));
Microsoft\CSharp\RuntimeBinder\ComInterop\ExcepInfo.cs (3)
32Debug.Assert(Marshal.SizeOf<ExcepInfo>() == Marshal.SizeOf<ComTypes.EXCEPINFO>()); 52Debug.Assert(pfnDeferredFillIn == IntPtr.Zero); 54System.Diagnostics.Debug.Assert(wReserved != -1);
Microsoft\CSharp\RuntimeBinder\ComInterop\IDispatchComObject.cs (1)
474Debug.Assert(typeInfo != null);
Microsoft\CSharp\RuntimeBinder\ComInterop\SimpleArgBuilder.cs (2)
28Debug.Assert(parameter != null); 34Debug.Assert(newValue != null && newValue.Type.IsAssignableFrom(ParameterType));
Microsoft\CSharp\RuntimeBinder\ComInterop\SplatCallSite.cs (2)
23Debug.Assert(callable != null); 33Debug.Assert(args != null);
Microsoft\CSharp\RuntimeBinder\ComInterop\StringArgBuilder.cs (1)
19Debug.Assert(parameterType == typeof(string) || parameterType == typeof(BStrWrapper));
Microsoft\CSharp\RuntimeBinder\ComInterop\VarEnumSelector.cs (1)
61Debug.Assert((varEnum & VarEnum.VT_BYREF) == 0);
Microsoft\CSharp\RuntimeBinder\ComInterop\VariantArray.cs (1)
68Debug.Assert(args >= 0);
Microsoft\CSharp\RuntimeBinder\ComInterop\VariantBuilder.cs (7)
47Debug.Assert(TempVariable == null); 98Debug.Fail("Unexpected VarEnum"); 114Debug.Assert(TempVariable != null); 120Debug.Assert(TempVariable != null); 126Debug.Assert(TempVariable != null); 132Debug.Assert(TempVariable != null); 154Debug.Assert(_targetComType.IsPrimitiveType(), "Unexpected VarEnum");
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (3)
28Debug.Fail("Name should not be called for this binder"); 41Debug.Assert(name != null); 83Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (2)
27Debug.Fail("Name should not be called for this binder"); 36Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (1)
27Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (2)
28Debug.Fail("Name should not be called for this binder"); 69Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\DynamicDebuggerProxy.cs (1)
180Debug.Assert((numberOfArguments == argTypes.Length) && (numberOfArguments == argFlags.Length), "Argument arrays size mismatch.");
Microsoft\CSharp\RuntimeBinder\Errors\ErrorFacts.cs (1)
198Debug.Fail("Missing resources for the error " + code.ToString());
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (5)
73Debug.Assert(0 != (arg.eaf & ErrArgFlags.Unique) && 0 == (arg.eaf & ErrArgFlags.NoStr)); 93Debug.Fail("Shouldn't be here!"); 103Debug.Assert(0 != (args[prgiarg[j]].eaf & ErrArgFlags.Unique)); 117Debug.Assert(0 != (arg2.eaf & ErrArgFlags.Unique) && 0 == (arg2.eaf & ErrArgFlags.NoStr)); 137Debug.Fail("Shouldn't be here!");
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (8)
19Debug.Assert(_strBuilder == null || _strBuilder.Length == 0); 25Debug.Assert(_strBuilder != null); 61Debug.Fail("impossible sk"); 195Debug.Assert(meth == prop.SetterMethod); 215Debug.Assert(meth == @event.methRemove); 397Debug.Fail($"Bad symbol kind: {sym.getKind()}"); 481Debug.Assert(elementType != null, "No element type"); 544Debug.Fail("Bad type kind");
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (26)
56Debug.Assert(binOp != null); 57Debug.Assert(binOp.Kind == ExpressionKind.Sequence); 58Debug.Assert(binOp.OptionalRightChild is ExprCall); 59Debug.Assert(((ExprCall)binOp.OptionalRightChild).PredefinedMethod == PREDEFMETH.PM_EXPRESSION_LAMBDA); 60Debug.Assert(binOp.OptionalLeftChild != null); 78Debug.Assert(call?.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_PARAMETER); 79Debug.Assert(pExpr.OptionalRightChild is ExprWrap); 207Debug.Fail("Invalid Predefined Method in VisitCALL"); 272Debug.Fail("How did we get a call that doesn't have a methodinfo?"); 297Debug.Assert(list != null); 307Debug.Assert(pExpr.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2); 340Debug.Assert((pExpr.Flags & EXPRFLAG.EXF_UNBOXRUNTIME) == 0); 352Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 409Debug.Fail("How did we get a prop that doesn't have a propinfo?"); 428Debug.Assert(fieldInfo != null); 502Debug.Assert(list != null); 554Debug.Fail("Invalid Predefined Method in GenerateBinaryOperator"); 574Debug.Assert(isLifted != null); 631Debug.Fail("Invalid Predefined Method in GenerateUserDefinedBinaryOperator"); 656Debug.Fail("Invalid Predefined Method in GenerateUnaryOperator"); 686Debug.Fail("Invalid Predefined Method in GenerateUserDefinedUnaryOperator"); 704Debug.Assert(pExpr.Type is NullType); 711Debug.Assert(call != null); 713Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 882Debug.Fail("Invalid Predefined Method in GetExpression"); 913Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (22)
79Debug.Assert(args.Length >= 1); 121Debug.Assert(pResult != null); 132Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock)); 212Debug.Assert(t != null); 264Debug.Assert(array[i].Type != null); 406Debug.Assert(type.IsByRef); 499Debug.Assert(argument.Info.Name != null); 578Debug.Fail("Unhandled kind"); 714Debug.Assert(t != null); // Would have thrown in PopulateSymbolTableWithPayloadInformation already 772Debug.Fail("Unexpected type returned from lookup"); 843Debug.Assert(result != null); 880Debug.Assert(prop != null); 969Debug.Assert(arguments.Length == 1); 1010Debug.Assert(arguments.Length == 2); 1039Debug.Fail("Unknown operator: " + p); 1163Debug.Assert(type != typeof(string)); 1171Debug.Assert(callingObject.Type is ArrayType); 1202Debug.Fail("Unexpected type returned from lookup"); 1220Debug.Assert(arguments.Length == 1); 1256Debug.Assert(arguments.Length == 1); 1280Debug.Assert(arguments.Length >= 2); 1281Debug.Assert(Array.TrueForAll(arguments, a => a.Type != null));
Microsoft\CSharp\RuntimeBinder\RuntimeBinderExtensions.cs (4)
141Debug.Assert(!(member1 is MethodBase) || 223Debug.Assert(typeParam.IsGenericParameter); 322Debug.Assert(type != null); 342Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Binding\Better.cs (10)
142Debug.Fail("Bad kind in CompareTypes"); 186Debug.Assert(index != -1); 210Debug.Assert(!(args.prgexpr[i] is ExprNamedArgumentSpecification)); 355Debug.Assert(betterMethod == BetterType.Neither); 404Debug.Assert(argType != null); 405Debug.Assert(p1 != null); 406Debug.Assert(p2 != null); 494Debug.Assert(list.Count != 0); 495Debug.Assert(list[0].mpwi != null); 520Debug.Assert(candidate != contender);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpArgInfo.cs (2)
15Debug.Assert(op1 != null); 16Debug.Assert(op2 != null);
Microsoft\CSharp\RuntimeBinder\Semantics\BinOpSig.cs (2)
108Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0)); 109Debug.Assert(((_grflt & LiftFlags.Lift2) == 0) || ((_grflt & LiftFlags.Convert2) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (40)
223Debug.Assert(s_simpleTypeBetter[i][i] == same); 226Debug.Assert(s_simpleTypeBetter[i][j] != same && s_simpleTypeBetter[j][i] != same); 227Debug.Assert( 231Debug.Assert( 250Debug.Assert((int)pt1 < NUM_EXT_TYPES); 251Debug.Assert((int)pt2 < NUM_EXT_TYPES); 302Debug.Assert(type1 != null && type2 != null); 370Debug.Assert(!(expr is ExprMemberGroup)); 456Debug.Assert(!(expr is ExprMemberGroup)); 457Debug.Assert(dest != null); 512Debug.Assert(exprType <= FUNDTYPE.FT_LASTNUMERIC, "Error in constant conversion logic!"); 533Debug.Assert(expr.Type != null); 656Debug.Assert(exprSrc == null || exprSrc.Type == typeSrc); 748Debug.Assert(convCur.getClass() == aggCur); 836Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); // If typeBestSrc is null then typeBestDst should be null. 837Debug.Assert(fFromImplicit); 844Debug.Assert(iuciBestSrc == -1); 850Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 864Debug.Assert(fToImplicit); 871Debug.Assert(iuciBestDst == -1); 877Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 890Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); 893Debug.Assert(iuciBestSrc == -1 && iuciBestDst == -1); 897Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 898Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 960Debug.Assert(typeFrom != typeBestSrc || typeTo != typeBestDst); 968Debug.Assert(n <= 0); 982Debug.Assert(n <= 0); 1009Debug.Assert(ctypeLiftBest <= 2); 1023Debug.Assert(fLiftSrc || fLiftDst); 1061Debug.Assert(pConversionArgument != null); 1085Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1086Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1094Debug.Assert(pExpr != null); 1132Debug.Assert(pTransformedArgument != null); 1136Debug.Assert(pCast != null); 1157Debug.Assert(constSrc != null); 1359Debug.Assert(type1 != type2); 1394Debug.Assert(type1 != type2); 1522Debug.Assert(typeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (5)
80Debug.Assert(typeSrc != null); 81Debug.Assert(typeDst != null); 188Debug.Assert(!(typeArr is MethodGroupType)); 245Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 246Debug.Assert(pTypeParams.Count == pTargetArgs.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (33)
75Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 135Debug.Fail($"Bad type kind: {_typeDest.TypeKind}"); 190Debug.Assert(_typeSrc != null); 191Debug.Assert(_typeDest != null); 205Debug.Assert(valueSrc.Type == _typeSrc.StripNubs()); 208Debug.Fail("BindExplicitConversion failed unexpectedly"); 236Debug.Assert(_typeSrc != null); 237Debug.Assert(_typeDest != null); 300Debug.Assert(!(typeArr is MethodGroupType)); 346Debug.Assert(_typeSrc != null); 347Debug.Assert(arrayDest != null); 413Debug.Assert(_typeSrc != null); 414Debug.Assert(aggTypeDest != null); 456Debug.Assert(_typeSrc != null); 457Debug.Assert(_typeSrc.IsPredefType(PredefinedType.PT_DECIMAL)); 458Debug.Assert(aggTypeDest.IsEnumType); 498Debug.Assert(_typeSrc != null); 499Debug.Assert(aggTypeDest != null); 500Debug.Assert(aggTypeDest.IsPredefType(PredefinedType.PT_DECIMAL)); 501Debug.Assert(_typeSrc.IsEnumType); 543Debug.Assert(ok); 552Debug.Assert(_typeSrc != null); 553Debug.Assert(aggTypeDest != null); 605Debug.Assert(_typeSrc != null); 606Debug.Assert(aggTypeDest != null); 615Debug.Assert(_typeSrc.IsPredefined && aggDest.IsPredefined()); 620Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 624Debug.Assert(convertKind != ConvKind.Implicit); 625Debug.Assert(convertKind != ConvKind.Identity); 680Debug.Assert(_typeSrc != null); 681Debug.Assert(aggTypeDest != null); 738Debug.Assert(_typeSrc != null); 739Debug.Assert(aggTypeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (45)
276Debug.Assert(pt != PredefinedType.PT_VOID); // use getVoidType() 293Debug.Assert(op1 is ExprCast 312Debug.Assert(pArrayType != null); 357Debug.Assert(typeDest != null); 385Debug.Assert(exprCast.Argument != null); 401Debug.Assert(mwi.Sym is MethodSymbol && (!mwi.Meth().isOverride || mwi.Meth().isHideByName)); 402Debug.Assert(pMemGroup != null); 431Debug.Assert(pResult.Type == VoidType.Instance); 447Debug.Assert(fwt.GetType() != null && fwt.Field().getClass() == fwt.GetType().OwningAggregate); 462Debug.Assert(BindingFlag.BIND_MEMBERSET == (BindingFlag)EXPRFLAG.EXF_MEMBERSET); 474Debug.Assert(pwt.Sym is PropertySymbol && 477Debug.Assert(pwt.Prop().Params.Count == 0 || pwt.Prop() is IndexerSymbol); 552Debug.Assert(pName != null); 610Debug.Assert(methCur.typeVars.Count == 0); 673Debug.Assert(arg.Type is NullableType); 732Debug.Assert(grp.SymKind == SYMKIND.SK_MethodSymbol || grp.SymKind == SYMKIND.SK_PropertySymbol && ((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0)); 737Debug.Assert(grp.Name != null); 746Debug.Assert((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0); 779Debug.Assert(arg != null); 813Debug.Assert(pOperand1 != null); 814Debug.Assert(pOperand1.Type != null); 822Debug.Assert(pOperand2.Type != null); 831Debug.Assert(kind >= CheckLvalueKind.Assignment && kind <= CheckLvalueKind.Increment); 841Debug.Assert(prop != null); 842Debug.Assert(prop.isLvalue()); 885Debug.Assert(!(expr is ExprLocal)); 886Debug.Assert(!(expr is ExprMemberGroup)); 892Debug.Assert(!prop.MethWithTypeSet || ExprProperty.HasIsExternalInitModifier(prop.MethWithTypeSet)); 920Debug.Assert(field.FieldWithType.Field().isReadOnly); 951Debug.Assert(prop != null); 971Debug.Assert(swt.GetType() != null && swt.GetType().OwningAggregate == swt.Sym.parent as AggregateSymbol); 1023Debug.Assert(swt.GetType().OwningAggregate == aggCalled); 1026Debug.Assert(pObject != null); 1073Debug.Assert( 1088Debug.Assert(call != null); 1102Debug.Assert(mp != null); 1103Debug.Assert(mp.Params != null); 1114Debug.Assert(!Array.Exists(@params.Items, p => p is ArgumentListType)); // We should never have picked a varargs method to bind to. 1161Debug.Assert(index != mp.Params.Count); 1215Debug.Assert(rval != null); 1357Debug.Assert(arg != null); 1358Debug.Assert(arg.Type != null); 1364Debug.Assert(iarg <= argInfo.carg); 1635Debug.Assert(ek >= ExpressionKind.FirstOp && (ek - ExpressionKind.FirstOp) < (int)EK2NAME.Length); 1674Debug.Assert(arg != null);
Microsoft\CSharp\RuntimeBinder\Semantics\EXPRExtensions.cs (2)
14Debug.Assert(f != null); 52Debug.Assert(expr?.Kind >= ExpressionKind.TypeLimit && 0 != (expr.Flags & EXPRFLAG.EXF_BINOP));
Microsoft\CSharp\RuntimeBinder\Semantics\ExprFactory.cs (11)
121Debug.Assert(type != null); 130Debug.Assert(type.FundamentalType > FUNDTYPE.FT_NONE); 131Debug.Assert(type.FundamentalType < FUNDTYPE.FT_COUNT); 179Debug.Assert(arg1 != null); 180Debug.Assert(exprKind.IsUnaryOperator() == (arg2 == null)); 195Debug.Assert(operand != null); 221Debug.Assert(wrap != null); 238Debug.Assert(last == first); 245Debug.Assert(last == first); 250Debug.Assert((last as ExprList)?.OptionalNextListNode != null); 251Debug.Assert((last as ExprList).OptionalNextListNode.Kind != ExpressionKind.List);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (27)
62Debug.Assert(grp != null); 63Debug.Assert(args != null); 94Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 107Debug.Assert(pGroup != null); 243Debug.Assert(!_results.InaccessibleResult); 248Debug.Assert(!_misnamed); 255Debug.Assert(!_mpwiBogus); 275Debug.Assert(type.IsInterfaceType); 346Debug.Assert(pmethBest != null); 573Debug.Assert(optionalArgument != null); 632Debug.Assert(meth is MethodSymbol); 648Debug.Assert(method.parent is AggregateSymbol); 853Debug.Assert(_methList.IsEmpty() || _methList.Head().mpwi.MethProp() != _pCurrentSym); 875Debug.Assert(methSym.typeVars.Count > 0); 1035Debug.Assert(pMethod != null); 1037Debug.Assert(pMethod.IsParameterOptional(iParam)); 1077Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 1078Debug.Assert(_pGroup.TypeArgs.Count == 0 || _pGroup.SymKind == SYMKIND.SK_MethodSymbol); 1079Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_USERCALLABLE) || _results.BestResult.MethProp().isUserCallable()); 1083Debug.Assert(_results.BestResult.MethProp() is MethodSymbol); 1102Debug.Assert(_methList.IsEmpty()); 1156Debug.Assert(!_results.BestResult || _results.BestResult.MethProp().getClass().IsDelegate()); 1157Debug.Assert(!_results.BestResult || _results.BestResult.GetType().OwningAggregate.IsDelegate()); 1175Debug.Assert(_results.UninferableResult.Sym is MethodSymbol); 1191Debug.Fail("Unreachable"); 1219Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_CTOR)); 1225Debug.Assert(!(_pGroup.ParentType is TypeParameterType));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (20)
88Debug.Assert(_typeSrc != null && _typeDest != null); // types must be supplied. 89Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.Type); // type of source should be correct if source supplied 90Debug.Assert(!_needsExprDest || _exprSrc != null); // need source expr to create dest expr 145Debug.Assert(ftDest != FUNDTYPE.FT_NONE || _typeDest is ParameterModifierType); 150Debug.Fail($"Bad type symbol kind: {_typeSrc.TypeKind}"); 270Debug.Assert(0 != (~_flags & (CONVERTTYPE.STANDARD | CONVERTTYPE.ISEXPLICIT))); 271Debug.Assert(_exprSrc == null || _exprSrc.Type == _typeSrc); 272Debug.Assert(!_needsExprDest || _exprSrc != null); 273Debug.Assert(_typeSrc != nubDst); // BindImplicitConversion should have taken care of this already. 280Debug.Assert(atsDst != _typeSrc); 306Debug.Assert(_typeSrc == typeSrcBase); 349Debug.Assert(exprTmp.Type == nubDst); 384Debug.Fail("bind(Im|Ex)plicitConversion failed unexpectedly"); 674Debug.Assert(aggSrc.getThisType().IsSimpleType); 675Debug.Assert(_typeDest.IsSimpleType); 677Debug.Assert(aggSrc.IsPredefined() && _typeDest.IsPredefined); 682Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 704Debug.Assert(ptSrc == PredefinedType.PT_FLOAT || ptSrc == PredefinedType.PT_DOUBLE); 705Debug.Assert(0 != (_flags & CONVERTTYPE.ISEXPLICIT)); 711Debug.Assert(convertKind != ConvKind.Identity);
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (30)
71Debug.Assert(type != null && sym != null); 86Debug.Assert(_csym == 1); 87Debug.Assert(_prgtype[0] == type); 118Debug.Assert(!(symCur is AggregateSymbol)); 229Debug.Assert(_fMulti || typeCur == _prgtype[0]); 300Debug.Assert(!fInaccess || !fFoundSome); 329Debug.Assert(sym is PropertySymbol); 361Debug.Assert(!_swtFirst || _fMulti); 362Debug.Assert(typeStart != null && !typeStart.IsInterfaceType && (ptypeEnd == null || typeStart != ptypeEnd)); 370Debug.Assert(!typeCur.IsInterfaceType); 396Debug.Assert(typeCur == typeEnd); 406Debug.Assert(!_swtFirst || _fMulti); 407Debug.Assert(typeStart == null || typeStart.IsInterfaceType); 408Debug.Assert(typeStart != null || types.Count != 0); 421Debug.Assert(type.IsInterfaceType); 431Debug.Assert(typeCur != null); 436Debug.Assert(typeCur != null && typeCur.IsInterfaceType); 445Debug.Assert(type.IsInterfaceType); 473Debug.Assert(CSemanticChecker.CheckBogus(swt.Sym)); 476Debug.Assert((meth1 ?? meth2) != null); 524Debug.Assert((flags & ~MemLookFlags.All) == 0); 525Debug.Assert(obj == null || obj.Type != null); 526Debug.Assert(typeSrc is AggregateType); 546Debug.Assert((_flags & (MemLookFlags.Ctor | MemLookFlags.NewObj | MemLookFlags.Operator | MemLookFlags.BaseCall)) == 0); 569Debug.Assert(typeCls2 != null && typeCls2.IsPredefType(PredefinedType.PT_OBJECT)); 597Debug.Assert(FError()); 601Debug.Assert(!_swtFirst || _swtAmbig); 618Debug.Assert(_typeSrc is AggregateType); 646Debug.Assert(_arity != 0); 647Debug.Assert(!(_swtBadArity.Sym is AggregateSymbol));
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs (2)
26Debug.Assert(containingTypes != null); 27Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (3)
30Debug.Assert(name != null); 31Debug.Assert(containingTypes != null); 32Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (55)
91Debug.Assert(pMethod != null); 92Debug.Assert(pMethod.typeVars.Count > 0); 93Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes); 99Debug.Assert(pMethodArguments != null); 100Debug.Assert(pMethodFormalParameterTypes != null); 101Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.Count); 148Debug.Assert(0 <= iParam); 149Debug.Assert(iParam < _pMethodTypeParameters.Count); 157Debug.Assert(pParam != null); 158Debug.Assert(pParam.IsMethodTypeParameter); 160Debug.Assert(_pMethodTypeParameters[iParam] == pParam); 182Debug.Assert(IsUnfixed(pParam)); 194Debug.Assert(IsUnfixed(pParam)); 206Debug.Assert(IsUnfixed(pParam)); 218Debug.Assert(0 <= iParam); 219Debug.Assert(iParam < _pMethodTypeParameters.Count); 255Debug.Assert(_pMethodFormalParameterTypes != null); 256Debug.Assert(_pMethodArguments != null); 257Debug.Assert(_pMethodArguments.carg <= _pMethodFormalParameterTypes.Count); 400Debug.Assert(res != NewInferenceResult.NoProgress); 580Debug.Assert(_ppDependencies == null); 594Debug.Assert(_ppDependencies != null); 600Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 601Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 615Debug.Assert(_ppDependencies != null); 616Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 617Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 655Debug.Assert(_ppDependencies != null); 678Debug.Assert(_ppDependencies != null); 695Debug.Assert(_ppDependencies != null); 729Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 744Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 872Debug.Assert(pSource != null); 873Debug.Assert(pDest != null); 874Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 879Debug.Assert(pSourceArgs != null); 880Debug.Assert(pDestArgs != null); 881Debug.Assert(pSourceArgs.Count == pDestArgs.Count); 1234Debug.Assert(pSource != null); 1235Debug.Assert(pDest != null); 1236Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1242Debug.Assert(pTypeParams != null); 1243Debug.Assert(pSourceArgs != null); 1244Debug.Assert(pDestArgs != null); 1246Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1247Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1541Debug.Assert(pSource != null); 1542Debug.Assert(pDest != null); 1543Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1549Debug.Assert(pTypeParams != null); 1550Debug.Assert(pSourceArgs != null); 1551Debug.Assert(pDestArgs != null); 1553Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1554Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1589Debug.Assert(IsUnfixed(iParam));
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (5)
13Debug.Assert(expr != null); 31Debug.Assert(pExpr != null && !(pExpr is ExprList)); 42Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 48Debug.Assert(args != null && !(args is ExprList)); 67Debug.Assert(exprSrc != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (134)
187Debug.Assert(prgbofs != null); 204Debug.Assert(rgbofs != null); 227Debug.Fail("Shouldn't happen!"); 249Debug.Assert(typeSig1.IsValueType); 276Debug.Assert(typeSig1.IsValueType); 313Debug.Fail("Shouldn't happen!"); 333Debug.Assert(typeSig2.IsValueType); 361Debug.Assert(typeSig2.IsValueType); 411Debug.Assert(binopSignatures != null); 502Debug.Assert(arg1 != null); 503Debug.Assert(arg2 != null); 541Debug.Assert(binopSignatures.Count > 0); 567Debug.Assert(bestBinopSignature < binopSignatures.Count); 600Debug.Assert(bofs.fnkind != BinOpFuncKind.BoolBitwiseOp); 621Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 665Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 756Debug.Assert(!(typeDst is NullableType)); 790Debug.Assert(!(typeDst is NullableType)); 832Debug.Assert(info.type1 is NullableType); 843Debug.Assert(info.type2 is NullableType); 971Debug.Assert(type1.FundamentalType != FUNDTYPE.FT_VAR); 987Debug.Assert(type2.FundamentalType != FUNDTYPE.FT_VAR); 1022Debug.Assert( 1025Debug.Assert( 1073Debug.Assert(Enum.IsDefined(bt1)); 1074Debug.Assert(Enum.IsDefined(bt2)); 1170Debug.Fail($"Bad op: {op}"); 1181Debug.Assert(pArgument != null); 1184Debug.Assert(type != null); 1217Debug.Assert(pResult != null); 1284Debug.Assert(nBestSignature < pSignatures.Count); 1325Debug.Assert(pArgument != null); 1326Debug.Assert(pArgument.Type != null); 1342Debug.Assert(pRawType == pArgumentType); 1343Debug.Assert(pArgumentType is AggregateType); 1371Debug.Assert(!(pArgumentType is PointerType)); 1384Debug.Assert(pArgument != null); 1420Debug.Assert(pArgument != null); 1421Debug.Assert(pArgument.Type != null); 1444Debug.Fail("Shouldn't happen!"); 1544Debug.Assert(arg?.Type != null); 1558Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1582Debug.Assert(Enum.IsDefined(bt)); 1597Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1608Debug.Assert(arg.Type.IsPredefined); 1619Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1630Debug.Assert(arg.Type.IsPredefined); 1642Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1667Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1676Debug.Assert(type.FundamentalType != FUNDTYPE.FT_PTR); // Can't have a pointer. 1680Debug.Assert(type.IsPredefType(PredefinedType.PT_DECIMAL)); 1741Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1742Debug.Assert(!uofs.isLifted()); 1744Debug.Assert(arg != null); 1748Debug.Assert(!(type is NullableType)); 1769Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1770Debug.Assert(uofs.isLifted()); 1773Debug.Assert(arg != null); 1804Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1807Debug.Assert(typeDec != null); 1814Debug.Fail($"Bad kind: {ek}"); 1847Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1848Debug.Assert(ek == ExpressionKind.Negate || ek == ExpressionKind.UnaryPlus); 1851Debug.Assert(typeDec != null); 1868Debug.Assert(ek == ExpressionKind.Add); 1869Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) || arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1881Debug.Assert(ek == ExpressionKind.LeftShirt || ek == ExpressionKind.RightShift); 1882Debug.Assert(arg1.Type.IsPredefined); 1883Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_INT)); 1886Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 1900Debug.Assert(arg1 != null); 1901Debug.Assert(arg2 != null); 1902Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1903Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1912Debug.Assert(ek == ExpressionKind.BitwiseAnd || ek == ExpressionKind.BitwiseOr); 1913Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1914Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1940Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1957Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_BOOL)); 1958Debug.Assert(ek == ExpressionKind.LogicalNot); 1983Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1984Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) && arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 2002Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 2019Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract || ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 2020Debug.Assert(arg1.Type == arg2.Type && (arg1.Type.IsDelegateType || arg1.Type.IsPredefType(PredefinedType.PT_DELEGATE))); 2063Debug.Assert(typeEnum != null); 2080Debug.Assert(!typeDst.IsPredefType(PredefinedType.PT_BOOL)); 2091Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 2105Debug.Assert(typeEnum != null); 2121Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2139Debug.Assert(ek == ExpressionKind.BitwiseNot); 2140Debug.Assert((ExprCast)arg != null); 2141Debug.Assert(((ExprCast)arg).Argument.Type.IsEnumType); 2225Debug.Fail($"Bad ek: {ek}"); 2242Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2244Debug.Assert(typeOp != null); 2245Debug.Assert(op1 != null && op1.Type == typeOp); 2246Debug.Assert(op2 == null || op2.Type == typeOp); 2247Debug.Assert((op2 == null) == (kind == ExpressionKind.Negate || kind == ExpressionKind.UnaryPlus || kind == ExpressionKind.BitwiseNot)); 2258Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2297Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2299Debug.Assert(typeOp != null); 2300Debug.Assert(op != null && op.Type == typeOp); 2313Debug.Assert(0 == (exprRes.Flags & EXPRFLAG.EXF_LVALUE)); 2329Debug.Assert(op2 == null || op1.Type == op2.Type); 2330Debug.Assert(op1.Type.IsPredefType(PredefinedType.PT_FLOAT) || op1.Type.IsPredefType(PredefinedType.PT_DOUBLE)); 2362Debug.Assert(op1 != null); 2363Debug.Assert(op2 != null); 2373Debug.Assert(op1 != null); 2389Debug.Assert(pCall != null); 2390Debug.Assert(pCall.MethWithInst.Meth() != null); 2391Debug.Assert(pCall.OptionalArguments != null); 2392Debug.Assert(kind == ExpressionKind.LogicalAnd || kind == ExpressionKind.LogicalOr); 2396Debug.Assert(pCall.MethWithInst.Meth().Params.Count == 2); 2404Debug.Assert(list != null); 2517Debug.Assert(method.typeVars.Count == 0); 2554Debug.Assert(name != null); 2606Debug.Assert(cats == 2); 2635Debug.Assert(pmethBest.ctypeLift == 2); 2685Debug.Assert(Params != paramsRaw); 2686Debug.Assert(paramsRaw[0] == Params[0].BaseOrParameterOrElementType); 2687Debug.Assert(paramsRaw[1] == Params[1].BaseOrParameterOrElementType); 2706Debug.Assert(paramsRaw[0] == paramsRaw[1]); 2707Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2715Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2723Debug.Assert(!(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq) || nonLiftedArg1.Type == nonLiftedArg2.Type); 2748Debug.Assert(argType1.IsEnumType || argType2.IsEnumType); 2755Debug.Assert(type1 == typeEnum || type1 == typeEnum.UnderlyingEnumType); 2756Debug.Assert(type2 == typeEnum || type2 == typeEnum.UnderlyingEnumType); 2765Debug.Assert(type1 == type2); 2769Debug.Assert(type1 != type2); 2778Debug.Assert(ek.IsRelational()); 2792Debug.Assert(methSym != null); 2808Debug.Assert(methSym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (22)
216Debug.Assert(propertyName != null); 217Debug.Assert(propertyGetter >= 0 && propertyGetter < PREDEFMETH.PM_COUNT); 225Debug.Assert(property != null); 237Debug.Assert(signature != null); 257Debug.Assert(current >= 0 && (int)current < (int)PredefinedType.PT_COUNT); 279Debug.Assert(signature != null); 284Debug.Assert(count >= 0); 301Debug.Assert((int)GetMethInfo((PREDEFMETH)i).method == i); 305Debug.Assert((int)GetPropInfo((PREDEFPROP)i).property == i); 314Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 322Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 338Debug.Assert(signature != null); 339Debug.Assert(cMethodTyVars >= 0); 340Debug.Assert(methodName != null); 341Debug.Assert(type != null); 346Debug.Assert(returnType != null); 349Debug.Assert(argumentTypes != null); 404Debug.Assert(result >= 0 && result < PREDEFMETH.PM_COUNT); 422Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 423Debug.Assert(s_predefinedProperties[(int)property].property == property); 430Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 431Debug.Assert(s_predefinedMethods[(int)method].method == method);
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (13)
37Debug.Assert(symCheck != null); 38Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 39Debug.Assert(typeThru == null || 53Debug.Assert(atsCheck != null); 73Debug.Assert(atsCheck != null); 88Debug.Assert(type != null); 95Debug.Assert(type is VoidType || type is TypeParameterType); 123Debug.Assert(symCheck != null); 124Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 125Debug.Assert(typeThru == null || 214Debug.Assert(symCheck.GetAccess() == ACCESS.ACC_PROTECTED 232Debug.Assert(agg != aggCheck); // We checked for this above. 261Debug.Assert(!CheckAccess(swtBad.Sym, swtBad.GetType(), symWhere, typeQual) ||
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\AggregateSymbol.cs (3)
86Debug.Assert(GetTypeVars() == GetTypeVarsAll() || isNested()); 286Debug.Assert(GetOuterAgg().GetTypeVars() != null); 287Debug.Assert(GetOuterAgg().GetTypeVarsAll() != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\FieldSymbol.cs (1)
41Debug.Assert(isEvent);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodOrPropertySymbol.cs (10)
61Debug.Assert(_Params == null, "Should only be set once"); 92Debug.Assert(index < Params.Count); 103Debug.Assert(_optionalParameterIndex != null); 125Debug.Assert(index < Params.Count); 126Debug.Assert(_defaultParameterIndex != null); 132Debug.Assert(_defaultParameterIndex != null); 140Debug.Assert(HasDefaultParameterValue(index)); 141Debug.Assert(_defaultParameterIndex != null); 147Debug.Assert(HasDefaultParameterValue(index)); 164Debug.Assert(IsMarshalAsParameter(index));
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\MethodSymbol.cs (7)
40Debug.Assert(!_inferenceMustFail); 114Debug.Assert(isPropertyAccessor()); 120Debug.Assert(isPropertyAccessor()); 126Debug.Assert(isEventAccessor()); 132Debug.Assert(isEventAccessor()); 139Debug.Assert(MethKind == MethodKindEnum.ExplicitConv || MethKind == MethodKindEnum.ImplicitConv); 166Debug.Fail("cannot find property for accessor");
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\ParentSymbol.cs (5)
24Debug.Assert(sym != null /*&& this != null */); 27Debug.Assert(sym.parent == null || sym.parent == this); 29Debug.Assert(sym.nextChild == null); 33Debug.Assert(firstChild == null); 48Debug.Assert(_lastChild == psym || count == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\Symbol.cs (3)
86Debug.Assert(_access != ACCESS.ACC_UNKNOWN); 169Debug.Fail("GetAssemblyID called on bad sym kind"); 192Debug.Fail("InternalsVisibleTo called on bad sym kind");
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (28)
26Debug.Assert(atsDer != null); 27Debug.Assert(pBase != null); 51Debug.Assert(pDerived != null); 52Debug.Assert(pBase != null); 63Debug.Assert(pDerived != null); 64Debug.Assert(pBase != null); 102Debug.Assert(pSource != null); 103Debug.Assert(pDest != null); 115Debug.Assert(pSource != null); 116Debug.Assert(pDest != null); 131Debug.Assert(pSource != null); 132Debug.Assert(pDest != null); 165Debug.Assert(atsDest.TypeArgsAll.Count == 1); 174Debug.Assert(pSource != null); 175Debug.Assert(pDest != null); 176Debug.Assert(!(pSource is TypeParameterType)); 341Debug.Assert(pSource != null && pSource.IsInterfaceType); 342Debug.Assert(pDest != null && pDest.IsInterfaceType); 352Debug.Assert(pSource != null && pSource.IsDelegateType); 353Debug.Assert(pDest != null && pDest.IsDelegateType); 363Debug.Assert(pSource != null); 364Debug.Assert(pDest != null); 380Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 381Debug.Assert(pTypeParams.Count == pDestArgs.Count); 419Debug.Assert(pSource != null); 420Debug.Assert(pDest != null); 421Debug.Assert(!(pSource is TypeParameterType)); 501Debug.Assert(!derived.IsEnum() && !@base.IsEnum());
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolStore.cs (4)
28Debug.Assert(child.nextSameName == null); 29Debug.Assert(child.parent == null || child.parent == parent); 54Debug.Assert(sym != null && sym.nextSameName == null); 96Debug.Fail("Sub-optimal overload called. Check if this can be avoided.");
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs (7)
91Debug.Assert(name != null); 92Debug.Assert(parent != null); 109Debug.Assert(name != null); 113Debug.Assert(sym != null); 136Debug.Assert(sym != null); 145Debug.Assert(sym != null); 185Debug.Assert(sym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\TypeParameterSymbol.cs (1)
61Debug.Assert(index >= _nIndexInOwnParameters);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BinaryOperator.cs (7)
13Debug.Assert(kind > ExpressionKind.TypeLimit); 14Debug.Assert(left != null); 15Debug.Assert(right != null); 24Debug.Assert(kind > ExpressionKind.TypeLimit); 25Debug.Assert(left != null); 26Debug.Assert(right != null); 27Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\BoundAnonymousFunction.cs (3)
13Debug.Assert(type != null); 14Debug.Assert(type.IsDelegateType); 15Debug.Assert(argumentScope != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Call.cs (1)
13Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Cast.cs (2)
14Debug.Assert(argument != null); 15Debug.Assert((flags & ~(EXPRFLAG.EXF_CAST_ALL | EXPRFLAG.EXF_MASK_ANY)) == 0);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Class.cs (1)
13Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\CompoundOperator.cs (3)
13Debug.Assert((flags & ~EXPRFLAG.EXF_MASK_ANY) == 0); 26Debug.Assert(left != null); 27Debug.Assert(op != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Concatenate.cs (4)
14Debug.Assert(first?.Type != null); 15Debug.Assert(second?.Type != null); 16Debug.Assert(first.Type.IsPredefType(PredefinedType.PT_STRING) || second.Type.IsPredefType(PredefinedType.PT_STRING)); 29Debug.Assert(second.Type.IsPredefType(PredefinedType.PT_STRING));
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\EXPR.cs (3)
34Debug.Assert(!(this is ExprList)); 35Debug.Assert(_type != null); 47Debug.Fail("Invalid Expr in GetObject");
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\ExprOperator.cs (1)
13Debug.Assert(kind.IsUnaryOperator() || kind > ExpressionKind.TypeLimit);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\FieldInfo.cs (2)
13Debug.Assert(field != null); 14Debug.Assert(fieldType != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs (1)
14Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MethodInfo.cs (4)
17Debug.Assert(method != null); 18Debug.Assert(methodType != null); 57Debug.Assert(m.Name == methodInfo.Name && 126Debug.Assert(c.GetParameters() == null || c.GetParameters().Length == genericInstanceParams.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\PropertyInfo.cs (3)
16Debug.Assert(propertySymbol != null); 17Debug.Assert(propertyType != null); 53Debug.Assert((p.Name == propertyInfo.Name) &&
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UnaryOperator.cs (7)
13Debug.Assert(kind.IsUnaryOperator()); 14Debug.Assert(operand != null); 21Debug.Assert(kind.IsUnaryOperator()); 22Debug.Assert(operand != null); 23Debug.Assert(type != null); 24Debug.Assert(call != null); 25Debug.Assert(userMethod != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedConversion.cs (2)
15Debug.Assert(argument != null); 16Debug.Assert(call != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\UserDefinedLogicalOperator.cs (3)
13Debug.Assert(trueFalseCall != null); 14Debug.Assert((operatorCall?.OptionalArguments as ExprList)?.OptionalElement != null); 21Debug.Assert(FirstOperandToExamine != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExpressionTreeRewriter.cs (55)
19Debug.Assert(expr != null); 34Debug.Assert(assignment != null); 90Debug.Assert(anonmeth != null); 98Debug.Assert(createParameters != null); 99Debug.Assert(anonmeth.Expression != null); 101Debug.Assert(anonmeth.ArgumentScope.nextChild == null); 114Debug.Assert(expr != null); 121Debug.Assert(local != null); 122Debug.Assert(local.Local.wrap != null); 129Debug.Assert(expr != null); 146Debug.Assert(expr != null); 153Debug.Assert(pExpr != null); 187Debug.Assert(expr != null); 207Debug.Assert(expr != null); 221Debug.Assert(pExpr != null); 235Debug.Assert(pExpr != null); 249Debug.Assert(expr != null); 306Debug.Assert(!expr.MethWithInst.Meth().isVirtual || expr.MemberGroup.OptionalObject != null); 314Debug.Assert(expr != null); 338Debug.Assert(expr != null); 349Debug.Assert(expr != null); 356Debug.Assert(expr != null); 363Debug.Assert(expr != null); 365Debug.Assert(memberGroup.IsDelegate); 367Debug.Assert(oldObject != null); 377Debug.Assert(expr != null); 406Debug.Assert(origL != null); 407Debug.Assert(origR != null); 421Debug.Assert(expr.IsLifted); 428Debug.Assert(expr.IsLifted); 435Debug.Assert(expr.IsLifted); 442Debug.Assert(expr.IsLifted); 478Debug.Assert(expr != null); 495Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 502Debug.Assert(expr != null); 546Debug.Assert(udcall.Kind == ExpressionKind.Call || udcall.Kind == ExpressionKind.UserLogicalOp); 550Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 557Debug.Assert(userLogOp != null); 559Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 582Debug.Assert(expr != null); 593Debug.Assert(arg != null && arg.Kind != ExpressionKind.List); 633Debug.Assert(expr != null); 655Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 683Debug.Assert(pArgument != null); 776Debug.Assert(pUDConversion is ExprUserDefinedConversion); 814Debug.Assert(anonmeth.Expression != null); 834Debug.Assert(expr != null); 835Debug.Assert(expr.MethWithInst.Meth().IsConstructor()); 977Debug.Assert(expr != null); 978Debug.Assert(pp1 != null); 979Debug.Assert(pp1 != null); 980Debug.Assert(pp2 != null); 981Debug.Assert(pp2 != null); 985Debug.Assert(orig1 != null && orig2 != null); 1023Debug.Assert(pExpr != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Visitors\ExprVisitorBase.cs (17)
94Debug.Assert(pExpr != null); 125Debug.Assert(exprRet != null); 128Debug.Assert(exprRet != null); 134Debug.Assert(exprRet != null); 137Debug.Assert(exprRet != null); 155Debug.Assert(exprRet != null); 161Debug.Assert(exprRet != null); 164Debug.Assert(exprRet != null); 167Debug.Assert(exprRet != null); 176Debug.Assert(exprRet != null); 182Debug.Assert(exprRet != null); 200Debug.Assert(exprRet != null); 208Debug.Assert(exprRet != null); 254Debug.Assert(exprRet != null); 257Debug.Assert(exprRet != null); 263Debug.Assert(exprRet != null); 266Debug.Assert(exprRet != null);
Microsoft\CSharp\RuntimeBinder\Semantics\TypeBind.cs (12)
80Debug.Assert(typeVars.Count == typeArgsThis.Count); 127Debug.Assert(mwi.Meth() != null && mwi.GetType() != null && mwi.TypeArgs != null); 128Debug.Assert(mwi.Meth().typeVars.Count == mwi.TypeArgs.Count); 129Debug.Assert(mwi.GetType().OwningAggregate == mwi.Meth().getClass()); 145Debug.Assert(typeVars.Count == typeArgs.Count); 146Debug.Assert(typeVars.Count > 0); 147Debug.Assert(flags == CheckConstraintsFlags.None || flags == CheckConstraintsFlags.NoErrors); 168Debug.Assert(!(arg is PointerType)); 169Debug.Assert(!arg.IsStaticClass); 257Debug.Assert(typeBnd.IsInterfaceType); 320Debug.Fail("Unexpected type."); 339Debug.Assert(typeBnd is AggregateType || typeBnd is TypeParameterType || typeBnd is ArrayType);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\AggregateType.cs (7)
30Debug.Assert(typeArgsThis != null); 62Debug.Assert(outerType == null || outerType.TypeArgsAll != null); 105Debug.Assert(baseClass != null); 194Debug.Assert(type.IsInterfaceType); 222Debug.Assert(IsPredefined); 298Debug.Assert(IsEnumType); 383Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Types\NullableType.cs (1)
63Debug.Fail("Constant nullable?");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PointerType.cs (1)
37Debug.Fail("Constant of pointer in dynamic code?");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\PredefinedTypes.cs (1)
189Debug.Assert(s_types[i].Type == (PredefinedType)i);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\Type.cs (1)
132Debug.Fail("Bad type for AsAggregateType");
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (4)
73Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 88Debug.Assert(types != null); 101Debug.Assert(Count >= 0); 102Debug.Assert(Array.TrueForAll(Items, item => item != null));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (46)
45Debug.Assert(iv >= 0); 62Debug.Assert(tpt != null); 70Debug.Assert(args > 0 && args < 32767); 71Debug.Assert(args == 1 || !isSZArray); 84Debug.Assert(pArray.Rank == args); 85Debug.Assert(pArray.ElementType == elementType); 93Debug.Assert(atsOuter == null || atsOuter.OwningAggregate == agg.Parent, ""); 97Debug.Assert(agg.GetTypeVars().Count == typeArgs.Count); 103Debug.Assert(!pAggregate.ConstraintError.HasValue); 108Debug.Assert(pAggregate.OwningAggregate == agg); 109Debug.Assert(pAggregate.TypeArgsThis != null && pAggregate.TypeArgsAll != null); 110Debug.Assert(pAggregate.TypeArgsThis == typeArgs); 118Debug.Assert(typeArgsAll != null && typeArgsAll.Count == agg.GetTypeVarsAll().Count); 129Debug.Assert(cvarOuter <= typeArgsAll.Count); 149Debug.Assert(pPointer.ReferentType == baseType); 157Debug.Assert(!(pUnderlyingType is NullableType), "Attempt to make nullable of nullable"); 179Debug.Assert(pParamModifier.ParameterType == paramType); 191Debug.Assert(typeSrc != null); 199Debug.Assert(typeSrc != null); 271Debug.Fail("Unknown type kind"); 312Debug.Assert(tvs.GetIndexInOwnParameters() == tvs.GetIndexInTotalParameters()); 315Debug.Assert(pctx.MethodTypes != null); 332Debug.Assert(typeDst.Equals(SubstType(typeSrc, typeArgsCls, typeArgsMeth, denormMeth))); 387Debug.Fail("Bad Symbol kind in SubstEqualTypesCore"); 393Debug.Assert(typeDst.TypeKind != typeSrc.TypeKind); 428Debug.Assert(atsSrc.TypeArgsAll.Count == atsDst.TypeArgsAll.Count); 449Debug.Assert(typeDst != typeSrc); 453Debug.Assert(tvs.GetIndexInOwnParameters() == index); 454Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 462Debug.Assert(index < pctx.ClassTypes.Length); 483Debug.Fail("Bad Symbol kind in TypeContainsType"); 489Debug.Assert(typeFind.TypeKind != type.TypeKind); 522Debug.Fail("Bad Symbol kind in TypeContainsTyVars"); 603Debug.Assert(pSymbol.GetTypeParameterType() == null); // Should have been checked first before creating 621Debug.Assert(typeSrc != null); 622Debug.Assert(!(typeSrc is ParameterModifierType)); 623Debug.Assert(!(typeSrc is PointerType)); 632Debug.Assert(!(typeSrc is VoidType) && !(typeSrc is TypeParameterType)); 643Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 674Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 683Debug.Assert(typeSrc is NullableType); 693Debug.Assert(typeSrc != null); 694Debug.Assert(typeSrc.IsInterfaceType || typeSrc.IsDelegateType); 747Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 755Debug.Assert(typeSrc != null); 768Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeParameterType.cs (1)
19Debug.Assert(symbol.GetTypeParameterType() == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeTable.cs (6)
33Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 77Debug.Assert(LookupAggregate(aggregate, outer, args) == null); 92Debug.Assert(LookupArray(elementType, rankNum) == null); 106Debug.Assert(LookupParameterModifier(elementType, isOut) == null); 118Debug.Assert(LookupPointer(elementType) == null); 130Debug.Assert(LookupNullable(underlyingType) == null);
Microsoft\CSharp\RuntimeBinder\Semantics\UnaOpSig.cs (5)
44Debug.Assert(type != null); 62Debug.Assert(pt != PredefinedType.PT_UNDEFINEDINDEX); 73Debug.Assert((_grflt & LiftFlags.Lift2) == 0); 74Debug.Assert((_grflt & LiftFlags.Convert2) == 0); 80Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\WithType.cs (4)
82Debug.Fail("Sub-optimal equality called. Check if this is correct."); 91Debug.Fail("If using this as a key, implement IEquatable<SymWithType>"); 131Debug.Assert(ats == null || sym.parent == ats.OwningAggregate); 225Debug.Assert(ats == null || mps != null && mps.getClass() == ats.OwningAggregate);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (27)
41Debug.Fail("Sub-optimal overload called. Check if this can be avoided."); 144Debug.Assert(!s_namesLoadedForEachType.Contains(key)); 215Debug.Assert(addedField == null); 416Debug.Assert(t1.IsGenericParameter && t2.IsGenericParameter); 466Debug.Assert(t.IsGenericParameter); 535Debug.Assert((agg != null && bIsAggregate) || (meth != null && !bIsAggregate)); 623Debug.Assert(!(ctype is AggregateType)); 641Debug.Assert(i + 1 < declarationChain.Count); 646Debug.Assert(o is string); 651Debug.Fail("Should be unreachable"); 670Debug.Assert(meth != null); 709Debug.Assert(agg != null); 771Debug.Assert(!bAdded); 775Debug.Assert(bAdded); 829Debug.Assert(types != null); 841Debug.Assert(t != null); 936Debug.Assert(type.IsPublic || type.IsNestedPublic); 1080Debug.Assert(fieldInfo.IsFamilyAndAssembly); 1106Debug.Assert(ev.AssociatedEventInfo == eventInfo); 1131Debug.Assert(ev.methAdd != null || ev.methRemove != null); 1366Debug.Assert(method != null || member is ConstructorInfo); 1424Debug.Assert(member.IsFamilyAndAssembly); 1540Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1729Debug.Assert(baseMethod != null); 1743Debug.Assert(t is AggregateType); 1745Debug.Assert(aggregate != null); 1822Debug.Assert(t is AggregateType);
Microsoft\CSharp\RuntimeBinder\Syntax\NameManager.cs (3)
161Debug.Assert(key != null); 162Debug.Assert(key.Length >= length); 168Debug.Assert(id < PredefinedName.PN_COUNT);
Microsoft\CSharp\RuntimeBinder\Syntax\NameTable.cs (6)
67Debug.Assert(Array.TrueForAll(_entries, e => e?.Name.Text != name.Text)); 94Debug.Assert(key != null); 95Debug.Assert(length <= key.Length); 115Debug.Assert(candidate != null); 116Debug.Assert(key != null); 117Debug.Assert(length <= key.Length);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\BuiltInVariantExtensions.cs (1)
20Debug.Assert(variant.VarType.HasFlag(VarEnum.VT_BYREF));
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsMethod.cs (3)
131Debug.Assert(methods != null, "removing method from empty methods collection"); 132Debug.Assert(method != null, "specify method is null"); 214Debug.Assert(!Empty);
src\runtime\src\libraries\Common\src\System\Runtime\InteropServices\ComEventsSink.cs (4)
59Debug.Assert(sinks != null, "removing event sink from empty sinks collection"); 60Debug.Assert(sink != null, "specify event sink is null"); 247Debug.Assert(_connectionPoint == null, "COM event sink is already advised"); 261Debug.Assert(_connectionPoint != null, "Can not unadvise from empty connection point");
Microsoft.Data.Analysis (59)
DataFrame.cs (1)
957Debug.Assert(newColumn.NullCount == oldColumn.NullCount);
DataFrame.IDataView.cs (3)
77Debug.Assert(dataFrame != null); 78Debug.Assert(activeColumns != null); 88Debug.Assert(_getters[i] != null);
DataFrameColumn.cs (14)
527Debug.Assert(n >= 2); 554Debug.Assert(comparer != null); 555Debug.Assert(lo >= 0); 602Debug.Assert(comparer != null); 603Debug.Assert(lo >= 0); 604Debug.Assert(hi > lo); 660Debug.Assert(comparer != null); 661Debug.Assert(lo >= 0); 662Debug.Assert(hi > lo); 683Debug.Assert(comparer != null); 684Debug.Assert(lo >= 0); 715Debug.Assert(lo >= 0); 716Debug.Assert(hi >= lo); 753Debug.Assert(i != j);
DataFrameColumns\ArrowStringDataFrameColumn.cs (5)
83Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); 86Debug.Assert(bitMapBuffer.Length > bitMapBufferIndex); 99Debug.Assert(_nullBitMapBuffers.Count > bitMapIndex); 104Debug.Assert(bitMapBuffer.Length >= bitMapBufferIndex); 334Debug.Assert(indexInBuffer <= Int32.MaxValue);
DataFrameColumns\StringDataFrameColumn.cs (1)
511Debug.Assert(getter != null, "Excepted getter to be valid");
DataFrameColumns\VBufferDataFrameColumn.cs (1)
194Debug.Assert(getter != null, "Excepted getter to be valid");
DataFrameRow.cs (1)
24Debug.Assert(rowIndex < df.Columns.RowCount);
PrimitiveColumnContainer.cs (5)
295Debug.Assert(bitMapBufferSpan.Length >= bitMapBufferIndex); 315Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); 321Debug.Assert(bitMapBuffer.Length >= bitMapBufferIndex); 335Debug.Assert(NullBitMapBuffers.Count > bitMapIndex); 341Debug.Assert(bitMapBuffer.Length > bitMapBufferIndex);
PrimitiveDataFrameColumn.cs (2)
306Debug.Assert(_columnContainer.NullCount >= 0); 901Debug.Assert(getter != null, "Excepted getter to be valid");
TextFieldParser.cs (25)
439Debug.Fail("The TextFieldType is not supported"); 627Debug.Assert(_buffer != null, "There's no buffer"); 628Debug.Assert(_reader != null, "There's no StreamReader"); 631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default"); 643Debug.Assert(_buffer != null, "There's no buffer"); 644Debug.Assert(_reader != null, "There's no StreamReader"); 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 662Debug.Assert(_buffer != null, "There's no buffer"); 663Debug.Assert(_reader != null, "There's no StreamReader"); 675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for"); 712Debug.Assert(_buffer != null, "There's no buffer"); 713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range"); 878Debug.Assert(_fieldWidths != null, "No field widths"); 910Debug.Assert(line != null, "We are parsing null"); 912Debug.Assert(length > 0, "A blank line shouldn't be parsed"); 915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed"); 934Debug.Assert(line != null, "No Line sent"); 960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input"); 972Debug.Assert(widths != null, "There are no field widths"); 1011Debug.Fail("Delimiter element is empty. This should have been caught on input"); 1036Debug.Fail("Unknown TextFieldType"); 1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing"); 1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing"); 1119Debug.Fail("Unknown TextFieldType"); 1142Debug.Assert(_delimiters != null, "No delimiters set!");
Utils\BitUtility.cs (1)
151Debug.Assert(span.Length >= endByteIndex);
Microsoft.Data.Analysis.Tests (27)
src\Microsoft.Data.Analysis\TextFieldParser.cs (25)
439Debug.Fail("The TextFieldType is not supported"); 627Debug.Assert(_buffer != null, "There's no buffer"); 628Debug.Assert(_reader != null, "There's no StreamReader"); 631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default"); 643Debug.Assert(_buffer != null, "There's no buffer"); 644Debug.Assert(_reader != null, "There's no StreamReader"); 645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range"); 662Debug.Assert(_buffer != null, "There's no buffer"); 663Debug.Assert(_reader != null, "There's no StreamReader"); 675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for"); 712Debug.Assert(_buffer != null, "There's no buffer"); 713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range"); 878Debug.Assert(_fieldWidths != null, "No field widths"); 910Debug.Assert(line != null, "We are parsing null"); 912Debug.Assert(length > 0, "A blank line shouldn't be parsed"); 915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed"); 934Debug.Assert(line != null, "No Line sent"); 960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input"); 972Debug.Assert(widths != null, "There are no field widths"); 1011Debug.Fail("Delimiter element is empty. This should have been caught on input"); 1036Debug.Fail("Unknown TextFieldType"); 1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing"); 1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing"); 1119Debug.Fail("Unknown TextFieldType"); 1142Debug.Assert(_delimiters != null, "No delimiters set!");
test\Microsoft.ML.TestFramework\GlobalBase.cs (2)
24System.Diagnostics.Debug.WriteLine("*** Setting test assertion handler"); 63System.Diagnostics.Debug.WriteLine("*** Restoring test assertion handler");
Microsoft.Diagnostics.DataContractReader (3)
ContractDescriptorTarget.cs (3)
838Debug.Assert( 866Debug.Assert( 967Debug.Assert(found);
Microsoft.Diagnostics.DataContractReader.Abstractions (7)
TargetFieldExtensions.cs (7)
75Debug.Assert( 88Debug.Assert( 101Debug.Assert( 116Debug.Assert( 180Debug.Assert( 207Debug.Assert( 215Debug.Assert(
Microsoft.Diagnostics.DataContractReader.Contracts (196)
CodePointerUtils.cs (2)
31Debug.Assert(flags == default); 47Debug.Assert(flags == default);
Contracts\CallingConvention\CdacTypeHandle.cs (1)
133Debug.Assert(IsHomogeneousAggregate());
Contracts\CodeVersions_1.cs (1)
212Debug.Assert(codeVersionHandle.Valid);
Contracts\Debugger\Debugger_1.cs (1)
309Debug.Assert(espRecord == TargetPointer.Null);
Contracts\DebugInfo\DebugInfoHelpers.cs (1)
55Debug.Assert(boundsEntryCount > 0, "Expected at least one entry in bounds.");
Contracts\ExecutionManager\ExecutionManagerCore.EEJitManager.cs (11)
28Debug.Assert(!rangeSection.IsRangeList); 37Debug.Assert(codeStart.Value <= jittedCodeAddress.Value); 63Debug.Assert(hotSize > 0); 68Debug.Assert(!rangeSection.IsRangeList); 75Debug.Assert(codeStart.Value <= jittedCodeAddress.Value); 99Debug.Assert(!rangeSection.IsRangeList); 106Debug.Assert(codeStart.Value <= jittedCodeAddress.Value); 133Debug.Assert(!rangeSection.IsRangeList); 141Debug.Assert(codeStart.Value <= jittedCodeAddress.Value); 153Debug.Assert(rangeSection.Data != null); 203Debug.Assert(!rangeSection.IsRangeList);
Contracts\ExecutionManager\ExecutionManagerCore.InterpreterJitManager.cs (3)
35Debug.Assert(codeStart.Value <= jittedCodeAddress.Value); 60Debug.Assert(hotSize > 0); 131Debug.Assert(rangeSection.Data is not null);
Contracts\ExecutionManager\ExecutionManagerCore.ReadyToRunJitManager.cs (5)
57Debug.Assert(coldFunctionIndex < r2rInfo.NumRuntimeFunctions); 202Debug.Assert(rangeSection.Data.R2RModule != TargetPointer.Null); 205Debug.Assert(r2rModule.ReadyToRunInfo != TargetPointer.Null); 238Debug.Assert(index < r2rInfo.NumRuntimeFunctions); 254Debug.Assert(methodDesc != TargetPointer.Null);
Contracts\ExecutionManager\Helpers\HashMapLookup.cs (1)
66Debug.Assert(increment > 0 && increment < size);
Contracts\ExecutionManager\Helpers\HotColdLookup.cs (2)
53Debug.Assert(hotIndex % 2 != 0, "Hot part index should be an odd number"); 65Debug.Assert(coldIndex % 2 == 0, "Cold part index should be an even number");
Contracts\ExecutionManager\Helpers\NibbleMapHelpers.cs (3)
56Debug.Assert(value <= 0xF); 67Debug.Assert(Value != 0); 97Debug.Assert(_mapIdx > 0);
Contracts\ExecutionManager\Helpers\RuntimeFunctionLookup.cs (1)
31Debug.Assert(unwindInfo.Header.HasValue);
Contracts\GC\GC_1.cs (1)
611Debug.Assert(GetInternalHandleType(type) < _handleMaxInternalTypes);
Contracts\GCInfo\GCInfoDecoder.cs (14)
321Debug.Assert(rangeStartOffset < rangeStopOffset); 322Debug.Assert(rangeStartOffset >= prevEndOffset); 428Debug.Assert(_validRangeStart < _validRangeEnd); 990Debug.Assert(pseudoBreakOffset == 0); 996Debug.Assert(countIntersections <= 1); 1040Debug.Assert(readSlots == numTracked); 1072Debug.Assert(_numInterruptibleRanges > 0); 1073Debug.Assert(numInterruptibleLength > 0); 1077Debug.Assert(breakChunk < numChunks); 1124Debug.Assert(readSlots == numTracked); 1134Debug.Assert(numCouldBeLiveSlots > 0); 1188Debug.Assert(transitionOffset > 0 && transitionOffset < TTraits.NUM_NORM_CODE_OFFSETS_PER_CHUNK); 1221Debug.Assert(slotIndex < _slots.Count); 1267Debug.Assert(value > 0);
Contracts\GCInfo\X86\GCInfo.cs (4)
118Debug.Assert(relativeOffset >= 0); 119Debug.Assert(relativeOffset <= MethodSize); 173Debug.Assert(Header.EbpSaved); 587Debug.Assert(Header.LocalAlloc && Header.EbpFrame);
Contracts\GCInfo\X86\InfoHdr.cs (10)
192Debug.Assert(!infoHdr.EpilogAtEnd || infoHdr.EpilogCount == 1); 390Debug.Assert(infoHdr.PrologSize + (infoHdr.EpilogCount * infoHdr.EpilogSize) <= codeLength); 391Debug.Assert(infoHdr.EpilogCount == 1 || !infoHdr.EpilogAtEnd); 393Debug.Assert(infoHdr.UntrackedCount <= infoHdr.ArgCount + infoHdr.FrameSize); 395Debug.Assert(infoHdr.EbpSaved || !(infoHdr.EbpFrame || infoHdr.DoubleAlign)); 396Debug.Assert(!infoHdr.EbpFrame || !infoHdr.DoubleAlign); 397Debug.Assert(infoHdr.EbpFrame || !infoHdr.Security); 398Debug.Assert(infoHdr.EbpFrame || !infoHdr.Handlers); 399Debug.Assert(infoHdr.EbpFrame || !infoHdr.LocalAlloc); 400Debug.Assert(infoHdr.EbpFrame || !infoHdr.EditAndContinue);
Contracts\Object_1.cs (3)
87Debug.Assert(corType is CorElementType.Array or CorElementType.SzArray); 119Debug.Assert(rankValue == 1); 193Debug.Assert(mt != TargetPointer.Null);
Contracts\PrecodeStubs_Common.cs (1)
114Debug.Assert(_codePointerFlags == 0);
Contracts\RuntimeTypeSystem_1.cs (12)
556System.Diagnostics.Debug.Assert(IsFunctionPointer(typeHandle, out _, out _)); 1047Debug.Assert(methodTable.Flags.HasInstantiation); 1528System.Diagnostics.Debug.Assert(IsFunctionPointer(typeHandle, out _, out _)); 1597Debug.Assert(methodDesc.Classification == MethodClassification.Instantiated); 1603Debug.Assert(methodDesc.Classification == MethodClassification.Dynamic); 1609Debug.Assert(methodDesc.Classification == MethodClassification.Dynamic || 1911Debug.Assert(slotNum < GetNumVtableSlots(typeHandle), "Slot number is greater than the number of slots"); 1922Debug.Assert(mt.NumVirtuals < GetNumVtableSlots(typeHandle), "Method table does not have non-virtual slots"); 2028Debug.Assert(typeHandle.IsMethodTable()); 2216Debug.Assert(md.HasStableEntryPoint); 2231Debug.Assert(_methodTables[typeHandle.Address].IsCanonMT); 2341Debug.Assert(_methodTables[typeHandle.Address].IsCanonMT);
Contracts\Signature\Signature_1.cs (1)
78Debug.Assert(signatureAddress != TargetPointer.Null || signatureLength == 0,
Contracts\StackWalk\Context\AMD64\AMD64Unwinder.cs (5)
806Debug.Fail("Any remaining operation must be a machine frame"); 849Debug.Fail("Expected unwind code"); 855Debug.Assert(_target.Contracts.RuntimeInfo.GetTargetOperatingSystem() == RuntimeInfoOperatingSystem.Windows); 858Debug.Fail("Expected unwind code"); 1042Debug.Fail("Unexpected unwind operation code.");
Contracts\StackWalk\Context\X86\X86Unwinder.cs (35)
102Debug.Assert(gcInfo.IsInEpilog); 103Debug.Assert(gcInfo.EpilogOffset > 0); 137Debug.Assert(gcInfo.RawStackSize != 0); 247Debug.Assert(gcInfo.IsInEpilog); 248Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign); 249Debug.Assert(gcInfo.EpilogOffset > 0); 268Debug.Assert(gcInfo.RawStackSize == _target.PointerSize); 301Debug.Assert( 313Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign); 314Debug.Assert(!gcInfo.IsInEpilog); 353Debug.Assert(gcInfo.IsInProlog); 354Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign); 435Debug.Assert(gcInfo.Header.EbpFrame || gcInfo.Header.DoubleAlign); 516Debug.Assert(gcInfo.IsInProlog); 517Debug.Assert(gcInfo.Header.EbpFrame || gcInfo.Header.DoubleAlign); 536Debug.Assert(CheckInstrByte(ReadByteAt(methodStart + offset), X86_INSTR_PUSH_EBP) || 629Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xFD), 0x81, ReadByteAt(baseAddress + offset))); 630Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset + 1) & 0xC0), 0xC0, ReadByteAt(baseAddress + offset + 1))); 633Debug.Assert(((ReadByteAt(baseAddress + offset) & 2) != 0 == CAN_COMPRESS(val)) || IsMarkerInstr(ReadByteAt(baseAddress + offset))); 643Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xF8), 0x58, ReadByteAt(baseAddress + offset))); 651Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xF8), 0x50, ReadByteAt(baseAddress + offset))); 660Debug.Assert( 679Debug.Assert( 689Debug.Assert(size != 0); 715Debug.Assert(size < 0x3000); 723Debug.Assert(CheckInstrWord(ReadShortAt(baseAddress + offset), X86_INSTR_w_TEST_ESP_DWORD_OFFSET_EAX)); 748Debug.Assert(size >= 0x3000); 813Debug.Assert(CheckInstrWord(_target.Read<ushort>(baseAddress + offset), X86_INSTR_w_TEST_ESP_EAX)); 827Debug.Assert(val == _target.Read<sbyte>(baseAddress + offset + 3)); 828Debug.Assert(CAN_COMPRESS(val)); 832Debug.Assert(CheckInstrWord(wOpcode, X86_INSTR_w_LEA_EAX_ESP_DWORD_OFFSET)); 833Debug.Assert(val == _target.Read<int>(baseAddress + offset + 3)); 834Debug.Assert(!CAN_COMPRESS(val)); 851Debug.Assert(CheckInstrWord(_target.Read<ushort>(baseAddress + offset), X86_INSTR_W_CALL_IND_IMM)); 913Debug.Assert((valPattern & val) == valPattern);
Contracts\StackWalk\FrameHandling\ARM64FrameHandler.cs (1)
35Debug.Assert(hijackArgsSize % 8 == 0, "HijackArgs contains register values and should be a multiple of the pointer size (8 bytes for ARM64)");
Contracts\StackWalk\FrameHandling\ARMFrameHandler.cs (1)
24Debug.Assert(hijackArgsSize % 4 == 0, "HijackArgs contains register values and should be a multiple of the pointer size (4 bytes for ARM)");
Contracts\StackWalk\FrameHandling\LoongArch64FrameHandler.cs (1)
23Debug.Assert(hijackArgsSize % 8 == 0, "HijackArgs contains register values and should be a multiple of the pointer size (8 bytes for LoongArch64)");
Contracts\StackWalk\FrameHandling\RISCV64FrameHandler.cs (1)
23Debug.Assert(hijackArgsSize % 8 == 0, "HijackArgs contains register values and should be a multiple of the pointer size (8 bytes for RISC-V64)");
Contracts\StackWalk\StackWalk_1.cs (14)
363Debug.WriteLine($"Skipping frame at IP=0x{gcFrame.Frame.Context.InstructionPointer:X}: {ex.Message}"); 370Debug.WriteLine($"Exception during WalkStackReferences at IP=0x{gcFrame.Frame.Context.InstructionPointer:X}: {ex.GetType().Name}: {ex.Message}"); 560Debug.Assert(!IsFilterFunclet(handle)); 564Debug.Assert(intermediaryFuncletParentStackFrame != TargetPointer.Null); 576Debug.Assert(funcletParentStackFrame == TargetPointer.Null); 588Debug.Assert(frameWasUnwound, "This can only happen if the funclet (and its parent) have been unwound"); 592Debug.Assert(funcletParentStackFrame != TargetPointer.Null); 612Debug.Assert(isFilterFunclet); 643Debug.Assert(didFuncletReportGCReferences); 699Debug.Assert(!skipFrameDueToUnwind); 714Debug.Assert(pExInfo != TargetPointer.Null); 814Debug.Assert(handle.State is StackWalkState.Frameless); 829Debug.Assert( 999Debug.Assert(IsManaged(handle.Context.InstructionPointer, out _));
Data\ReadyToRunInfo.cs (1)
44Debug.Assert(NumHotColdMap % 2 == 0, "Hot/cold map should have an even number of entries (pairs of hot/cold runtime function indexes)");
EcmaMetadataUtils.cs (2)
43Debug.Assert((tokenParts & 0xff000000) == 0, $"Token type should not be set in {nameof(tokenParts)}"); 49Debug.Assert((tokenParts & 0xff000000) == 0, $"Token type should not be set in {nameof(tokenParts)}");
PrintfStressMessageFormatter.cs (1)
208Debug.Assert(stressMsg.FormatString != TargetPointer.Null);
RuntimeTypeSystemHelpers\MethodValidation.cs (2)
148Debug.Assert(umd.HasStableEntryPoint); 165Debug.Assert(methodTablePointer != TargetPointer.Null);
src\runtime\src\coreclr\tools\Common\CallingConvention\ArgIterator.cs (34)
134Debug.Assert(IsStructPassedInRegs()); 141Debug.Assert(IsStructPassedInRegs()); 152Debug.Assert(IsStructPassedInRegs()); 169Debug.Assert(eightByteSize == 8); 170Debug.Assert((genRegDest & 7) == 0); 318Debug.Assert(argNum >= 0); 391Debug.Assert(_SIZE_OF_ARG_STACK_COMPUTED); 392Debug.Assert((_nSizeOfArgStack % _transitionBlock.PointerSize) == 0); 412Debug.Assert((size % _transitionBlock.PointerSize) == 0); 474Debug.Assert(!_argTypeHandle.IsNull()); 481Debug.Assert(!_argTypeHandle.IsNull()); 488Debug.Assert(!_argTypeHandle.IsNull()); 528Debug.Assert(IsVarArg); 557Debug.Assert(HasParamType); 600Debug.Assert(HasAsyncContinuation); 677Debug.Assert(!IsVarArg || !HasParamType); 785Debug.Assert(argOfs >= _transitionBlock.OffsetOfArgs); 832Debug.Assert(false); 1004Debug.Assert((cbArg % _transitionBlock.PointerSize) == 0); 1188Debug.Assert(_transitionBlock.IsAppleArm64ABI || (cbArg % _transitionBlock.PointerSize) == 0); 1227Debug.Assert((cbArg & (cbArg - 1)) == 0); 1296Debug.Assert(cFPRegs == 1); 1297Debug.Assert((info.flags & (FpStruct.OnlyOne | FpStruct.BothFloat)) == 0); 1326Debug.Assert((info.flags & (FpStruct.OnlyOne | FpStruct.BothFloat)) != 0); 1340Debug.Assert((cbArg % _transitionBlock.PointerSize) == 0); 1353Debug.Assert(regSlots == 2); 1355Debug.Assert(_rvLa64IdxGenReg == lastReg, "pass head in last register"); 1356Debug.Assert(_rvLa64OfsStack == 0, "pass tail in first stack slot"); 1414Debug.Assert(!_ITERATION_STARTED); 1595Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1634Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1685Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0); 1732Debug.Assert(false); 1741Debug.Assert((floatRegOfsInBytes % _transitionBlock.FloatRegisterSize) == 0);
src\runtime\src\coreclr\tools\Common\CallingConvention\TransitionBlock.cs (18)
147Debug.Assert(!IsX64UnixABI || offset != StructInRegsOffset); 155Debug.Assert(!IsX86); 157Debug.Assert((offset % PointerSize) == 0); 163Debug.Assert(!IsX86); 169Debug.Assert(!IsX86); 188Debug.Assert(IsX86); 240Debug.Assert(IsX64); 306Debug.Assert(!thRetType.IsNull() && thRetType.IsValueType()); 469Debug.Assert(!th.IsNull()); 470Debug.Assert(th.IsValueType()); 588Debug.Assert(!th.IsNull()); 589Debug.Assert(th.IsValueType()); 616Debug.Assert((parmSize & (parmSize - 1)) == 0); 622Debug.Assert((parmSize % 4) == 0); 653Debug.Assert(!th.IsNull()); 654Debug.Assert(th.IsValueType()); 697Debug.Assert(!th.IsNull()); 698Debug.Assert(th.IsValueType());
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\Dwarf\DwarfHelper.cs (2)
129Debug.Assert(source.CanSeek); 130Debug.Assert(source.Length >= 0);
Microsoft.Diagnostics.DataContractReader.DataGenerator (2)
Emitter.cs (2)
360Debug.Assert(member.DescriptorNativeType is not null); 416Debug.Assert(member.DescriptorNativeType is not null);
Microsoft.Diagnostics.DataContractReader.Legacy (1279)
ClrDataAppDomain.cs (8)
76Debug.ValidateHResult(hr, hrLocal); 80Debug.Assert(*nameLen == nameLenLocal, $"cDAC: {*nameLen}, DAC: {nameLenLocal}"); 91Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}"); 121Debug.ValidateHResult(hr, hrLocal); 122Debug.Assert(*id == idLocal, $"cDAC: {*id}, DAC: {idLocal}"); 150Debug.ValidateHResult(hr, hrLocal); 151Debug.Assert(*flags == flagsLocal, $"cDAC: {*flags}, DAC: {flagsLocal}"); 178Debug.Assert(hrLocal == hr, $"cDAC: {hr}, DAC: {hrLocal}");
ClrDataExceptionState.cs (13)
61Debug.ValidateHResult(hr, hrLocal); 63Debug.Assert(*flags == legacyFlags, $"cDAC flags: {*flags:x}, DAC flags: {legacyFlags:x}"); 111Debug.ValidateHResult(hr, hrLocal); 172Debug.ValidateHResult(hr, hrLocal); 231Debug.ValidateHResult(hr, hrLocal); 234Debug.Assert(strLen == null || *strLen == legacyStrLen); 236Debug.Assert(str == null || cmpLen <= 0 || new ReadOnlySpan<char>(strLocal, 0, cmpLen).SequenceEqual(new ReadOnlySpan<char>(str, cmpLen))); 263Debug.ValidateHResult(hr, hrLocal); 266Debug.Assert(outBufferSize == sizeof(uint) && outBuffer is not null); 269Debug.Assert(revision == legacyRevision); 284Debug.ValidateHResult(hr, hrLocal); 297Debug.ValidateHResult(hr, hrLocal); 375Debug.ValidateHResult(hr, hrLocal);
ClrDataFrame.cs (10)
77Debug.ValidateHResult(hr, hrLocal); 86Debug.Assert(contextStruct.Equals(localContextStruct)); 131Debug.ValidateHResult(hr, hrLegacy); 163Debug.ValidateHResult(hr, hrLocal); 165Debug.Assert(*numArgs == numArgsLocal, $"cDAC: {*numArgs}, DAC: {numArgsLocal}"); 261Debug.ValidateHResult(hr, hrLegacy, HResultValidationMode.AllowCdacSuccess); 285Debug.ValidateHResult(hr, hrLocal); 287Debug.Assert(*numLocals == numLocalsLocal, $"cDAC: {*numLocals}, DAC: {numLocalsLocal}"); 352Debug.ValidateHResult(hr, hrLegacy, HResultValidationMode.AllowCdacSuccess); 394Debug.ValidateHResult(hr, hrLocal);
ClrDataMethodDefinition.cs (20)
201Debug.ValidateHResult(hr, hrLocal); 261Debug.ValidateHResult(hr, hrLocal); 352Debug.ValidateHResult(hr, hrLocal); 356Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}"); 362Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}"); 410Debug.ValidateHResult(hr, hrLocal); 414Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}"); 466Debug.ValidateHResult(hr, hrLocal); 522Debug.ValidateHResult(hr, hrLocal); 525Debug.Assert(extent->startAddress == extentLocal.startAddress, $"StartAddress - cDAC: {extent->startAddress:x}, DAC: {extentLocal.startAddress:x}"); 526Debug.Assert(extent->endAddress == extentLocal.endAddress, $"EndAddress - cDAC: {extent->endAddress:x}, DAC: {extentLocal.endAddress:x}"); 527Debug.Assert(extent->enCVersion == extentLocal.enCVersion, $"EnCVersion - cDAC: {extent->enCVersion:x}, DAC: {extentLocal.enCVersion:x}"); 528Debug.Assert(extent->type == extentLocal.type, $"Type - cDAC: {extent->type:x}, DAC: {extentLocal.type:x}"); 562Debug.ValidateHResult(hr, hrLocal); 651Debug.ValidateHResult(hr, hrLocal); 653Debug.Assert(*(uint*)outBuffer == revisionLocal); 684Debug.ValidateHResult(hr, hrLocal); 687Debug.Assert(*addr == addrLocal, $"cDAC: {*addr:x}, DAC: {addrLocal:x}"); 723Debug.ValidateHResult(hr, hrLocal); 726Debug.Assert(bGenericLocal == *bGeneric, $"cDAC: {*bGeneric}, DAC: {bGenericLocal}");
ClrDataMethodInstance.cs (28)
78Debug.ValidateHResult(hr, hrLocal); 129Debug.ValidateHResult(hr, hrLocal); 133Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}"); 203Debug.ValidateHResult(hr, hrLocal); 205Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}"); 211Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}"); 302Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess); 308Debug.Assert(localOffsetsNeeded == *offsetsNeeded, $"cDAC: {*offsetsNeeded:x}, DAC: {localOffsetsNeeded:x}"); 315Debug.Assert(localIlOffsets[i] == ilOffsets[i], $"cDAC: {localIlOffsets[i]:x}, DAC: {ilOffsets[i]:x}"); 398Debug.ValidateHResult(hr, hrLocal); 404Debug.Assert(rangesNeededLocal == *rangesNeeded, $"cDAC: {*rangesNeeded:x}, DAC: {rangesNeededLocal:x}"); 412Debug.Assert(addressRangesLocal[i].startAddress == addressRanges[i].startAddress, $"StartAddress - cDAC: {addressRanges[i].startAddress:x}, DAC: {addressRangesLocal[i].startAddress:x}"); 413Debug.Assert(addressRangesLocal[i].endAddress == addressRanges[i].endAddress, $"EndAddress - cDAC: {addressRanges[i].endAddress:x}, DAC: {addressRangesLocal[i].endAddress:x}"); 490Debug.ValidateHResult(hr, hrLocal); 494Debug.Assert(mapNeeded == null || *mapNeeded == mapNeededLocal); 500Debug.Assert(mapsLocal[i].ilOffset == maps![i].ilOffset, $"ILOffset - cDAC: {maps[i].ilOffset:x}, DAC: {mapsLocal[i].ilOffset:x}"); 501Debug.Assert(mapsLocal[i].startAddress == maps[i].startAddress, $"StartAddress - cDAC: {maps[i].startAddress:x}, DAC: {mapsLocal[i].startAddress:x}"); 502Debug.Assert(mapsLocal[i].endAddress == maps[i].endAddress, $"EndAddress - cDAC: {maps[i].endAddress:x}, DAC: {mapsLocal[i].endAddress:x}"); 503Debug.Assert(mapsLocal[i].type == maps[i].type, $"Type - cDAC: {maps[i].type:x}, DAC: {mapsLocal[i].type:x}"); 573Debug.ValidateHResult(hr, hrLocal); 629Debug.ValidateHResult(hr, hrLocal); 632Debug.Assert(extent->startAddress == extentLocal.startAddress, $"StartAddress - cDAC: {extent->startAddress:x}, DAC: {extentLocal.startAddress:x}"); 633Debug.Assert(extent->endAddress == extentLocal.endAddress, $"EndAddress - cDAC: {extent->endAddress:x}, DAC: {extentLocal.endAddress:x}"); 667Debug.ValidateHResult(hr, hrLocal); 708Debug.ValidateHResult(hr, hrLocal); 710Debug.Assert(*(uint*)outBuffer == revisionLocal); 747Debug.ValidateHResult(hr, hrLocal); 748Debug.Assert(addrLocal == *addr, $"cDAC: {*addr:x}, DAC: {addrLocal:x}");
ClrDataModule.cs (20)
315Debug.ValidateHResult(hr, hrLocal); 372Debug.ValidateHResult(hr, hrLocal); 439Debug.ValidateHResult(hr, hrLocal); 487Debug.ValidateHResult(hr, hrLocal); 490Debug.Assert(nameLen == null || *nameLen == nameLenLocal); 491Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)nameLenLocal - 1).SequenceEqual(new string(name))); 538Debug.Assert(hrLocal == HResults.S_OK); 539Debug.Assert(nameLen == null || *nameLen == nameLenLocal); 540Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)nameLenLocal - 1).SequenceEqual(new string(name))); 575Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}"); 576Debug.Assert(flagsLocal == *flags, $"cDAC: {*flags}, DAC: {flagsLocal}"); 628Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}"); 671Debug.Assert(hr == hrLocal, $"cDAC: {hr}, DAC: {hrLocal}"); 675Debug.Assert(dataModuleExtent->baseAddress == dataModuleExtentLocal.baseAddress, $"cDAC: {dataModuleExtent->baseAddress}, DAC: {dataModuleExtentLocal.baseAddress}"); 676Debug.Assert(dataModuleExtent->length == dataModuleExtentLocal.length, $"cDAC: {dataModuleExtent->length}, DAC: {dataModuleExtentLocal.length}"); 677Debug.Assert(dataModuleExtent->type == dataModuleExtentLocal.type, $"cDAC: {dataModuleExtent->type}, DAC: {dataModuleExtentLocal.type}"); 690Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}"); 741Debug.ValidateHResult(hr, hrLocal); 743Debug.Assert(new ReadOnlySpan<byte>(outBuffer, (int)outBufferSize).SequenceEqual(localBuffer)); 836Debug.ValidateHResult(hr, hrLocal);
ClrDataStackWalk.cs (11)
112Debug.ValidateHResult(hr, hrLocal); 121Debug.Assert(contextStruct.Equals(localContextStruct)); 198Debug.ValidateHResult(hr, hrLocal); 202Debug.Assert(*simpleType == simpleTypeLocal, $"cDAC: {*simpleType:x}, DAC: {simpleTypeLocal:x}"); 204Debug.Assert(*detailedType == detailedTypeLocal, $"cDAC: {*detailedType:x}, DAC: {detailedTypeLocal:x}"); 228Debug.ValidateHResult(hr, hrLocal); 231Debug.Assert(*stackSizeSkipped == stackSizeSkippedLocal, $"cDAC: {*stackSizeSkipped:x}, DAC: {stackSizeSkippedLocal:x}"); 259Debug.ValidateHResult(hr, hrLocal); 313Debug.ValidateHResult(hr, hrLocal); 315Debug.Assert(new ReadOnlySpan<byte>(outBuffer, (int)outBufferSize).SequenceEqual(localOutBuffer)); 342Debug.ValidateHResult(hr, hrLocal);
ClrDataTask.cs (5)
51Debug.ValidateHResult(hr, hrLocal); 127Debug.ValidateHResult(hr, hrLocal); 167Debug.ValidateHResult(hr, hrLocal); 169Debug.Assert(*(uint*)outBuffer == revisionLocal); 208Debug.ValidateHResult(hr, hrLocal);
ClrDataTypeDefinition.cs (7)
113Debug.ValidateHResult(hr, hrLocal); 117Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}"); 123Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}"); 168Debug.ValidateHResult(hr, hrLocal); 170Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}"); 201Debug.ValidateHResult(hr, hrLocal); 203Debug.Assert(typeLocal == *type, $"cDAC: {*type:x}, DAC: {typeLocal:x}");
ClrDataTypeInstance.cs (4)
99Debug.ValidateHResult(hr, hrLocal); 105Debug.Assert(nameLen is null || nameLenLocal == *nameLen, nameLenMessage); 111Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}"); 183Debug.ValidateHResult(hr, hrLocal);
ClrDataValue.cs (36)
89Debug.ValidateHResult(hr, hrLocal); 91Debug.Assert(*flags == flagsLocal, $"GetFlags cDAC: 0x{*flags:X}, DAC: 0x{flagsLocal:X}"); 121Debug.ValidateHResult(hr, hrLocal); 123Debug.Assert((ulong)*address == (ulong)addressLocal, $"GetAddress cDAC: 0x{(ulong)*address:X}, DAC: 0x{(ulong)addressLocal:X}"); 153Debug.ValidateHResult(hr, hrLocal); 155Debug.Assert(*size == sizeLocal, $"GetSize cDAC: {*size}, DAC: {sizeLocal}"); 213Debug.ValidateHResult(hr, hrLocal); 217Debug.Assert(*dataSize == legacyDataSize, $"GetBytes dataSize cDAC: {*dataSize}, DAC: {legacyDataSize}"); 221Debug.Assert(buffer[i] == legacyBuf[i], $"GetBytes mismatch at byte {i}: cDAC: 0x{buffer[i]:X2}, DAC: 0x{legacyBuf[i]:X2}"); 267Debug.ValidateHResult(hr, hrLocal); 318Debug.ValidateHResult(hr, hrLocal); 320Debug.Assert(*(uint*)outBuffer == revisionLocal); 348Debug.ValidateHResult(hr, hrLocal); 350Debug.Assert(*numFields == numFieldsLocal, $"GetNumFields2 cDAC: {*numFields}, DAC: {numFieldsLocal}"); 430Debug.ValidateHResult(hr, hrLocal); 475Debug.ValidateHResult(hr, hrLocal); 507Debug.ValidateHResult(hr, hrLocal); 509Debug.Assert(*strLen == strLenLocal, $"GetString length cDAC: {*strLen}, DAC: {strLenLocal}"); 513Debug.Assert(new string(str) == new string(strLocalPtr)); 556Debug.ValidateHResult(hr, hrLocal); 559Debug.Assert(rank is null || *rank == rankLocal); 560Debug.Assert(totalElements is null || *totalElements == totalElementsLocal); 561Debug.Assert(dims.AsSpan().SequenceEqual(dimsLocal)); 562Debug.Assert(bases.AsSpan().SequenceEqual(basesLocal)); 629Debug.ValidateHResult(hr, hrLocal); 705Debug.ValidateHResult(hr, hrLocal); 776Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess); 779Debug.Assert(token is null || *token == tokenLocal); 780Debug.Assert(nameLen is null || *nameLen == nameLenLocal); 781Debug.Assert(nameBuf is null || new ReadOnlySpan<char>(nameBuf, checked((int)nameLenLocal)).SequenceEqual(nameBufLocal.AsSpan(0, checked((int)nameLenLocal)))); 821Debug.ValidateHResult(hr, hrLocal); 1074Debug.ValidateHResult(hr, hrLocal); 1076Debug.Assert(*numLocs == numLocsLocal, $"GetNumLocations cDAC: {*numLocs}, DAC: {numLocsLocal}"); 1109Debug.ValidateHResult(hr, hrLocal); 1112Debug.Assert(*flags == flagsLocal, $"GetLocationByIndex[{loc}] flags cDAC: {*flags}, DAC: {flagsLocal}"); 1118Debug.WriteLine($"GetLocationByIndex[{loc}] addr divergence - cDAC: 0x{(ulong)*arg:X}, DAC: 0x{(ulong)argLocal:X}");
ConversionExtensions.cs (1)
101Debug.Assert(flags == default);
Dbi\DacDbiImpl.cs (382)
121Debug.ValidateHResult(hr, hrLocal); 123Debug.Assert(*pResult == resultLocal); 147Debug.ValidateHResult(hr, hrLocal); 149Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 171Debug.ValidateHResult(hr, hrLocal); 197Debug.ValidateHResult(hr, hrLocal); 200Debug.Assert( 237Debug.ValidateHResult(hr, hrLocal); 239Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 317Debug.ValidateHResult(hr, hrLocal); 320Debug.Assert(pTargetRefInfo->vmAssembly == targetLocal.vmAssembly, $"cDAC: {pTargetRefInfo->vmAssembly:x}, DAC: {targetLocal.vmAssembly:x}"); 321Debug.Assert(pTargetRefInfo->typeToken == targetLocal.typeToken, $"cDAC: {pTargetRefInfo->typeToken:x}, DAC: {targetLocal.typeToken:x}"); 367Debug.ValidateHResult(hr, hrLocal); 369Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 408Debug.ValidateHResult(hr, hrLocal); 411Debug.Assert(pTargetBuffer->pAddress == pTargetBufferLocal.pAddress, $"pAddress: cDAC: {pTargetBuffer->pAddress:x}, DAC: {pTargetBufferLocal.pAddress:x}"); 412Debug.Assert(pTargetBuffer->cbSize == pTargetBufferLocal.cbSize, $"cbSize: cDAC: {pTargetBuffer->cbSize}, DAC: {pTargetBufferLocal.cbSize}"); 445Debug.ValidateHResult(hr, hrLocal); 448Debug.Assert(*pSize == sizeLocal, $"cDAC size: {*pSize}, DAC size: {sizeLocal}"); 489Debug.ValidateHResult(hr, hrLocal); 492Debug.Assert(new Span<byte>(pBuffer, blobLength).SequenceEqual(bufferLocal.AsSpan(0, blobLength)), "cDAC and DAC read-write metadata buffers differ."); 536Debug.ValidateHResult(hr, hrLocal); 539Debug.Assert(pTargetBuffer->pAddress == bufferLocal.pAddress, $"pAddress: cDAC: {pTargetBuffer->pAddress:x}, DAC: {bufferLocal.pAddress:x}"); 540Debug.Assert(pTargetBuffer->cbSize == bufferLocal.cbSize, $"cbSize: cDAC: {pTargetBuffer->cbSize}, DAC: {bufferLocal.cbSize}"); 541Debug.Assert(*pSymbolFormat == formatLocal, $"pSymbolFormat: cDAC: {*pSymbolFormat}, DAC: {formatLocal}"); 584Debug.ValidateHResult(hr, hrLocal); 587Debug.Assert(pData->vmAssembly == dataLocal.vmAssembly, $"vmAssembly: cDAC: {pData->vmAssembly:x}, DAC: {dataLocal.vmAssembly:x}"); 588Debug.Assert(pData->vmPEAssembly == dataLocal.vmPEAssembly, $"vmPEAssembly: cDAC: {pData->vmPEAssembly:x}, DAC: {dataLocal.vmPEAssembly:x}"); 589Debug.Assert(pData->fIsDynamic == dataLocal.fIsDynamic, $"fIsDynamic: cDAC: {pData->fIsDynamic}, DAC: {dataLocal.fIsDynamic}"); 590Debug.Assert(pData->fInMemory == dataLocal.fInMemory, $"fInMemory: cDAC: {pData->fInMemory}, DAC: {dataLocal.fInMemory}"); 591Debug.Assert(pData->pPEBaseAddress == dataLocal.pPEBaseAddress, $"pPEBaseAddress: cDAC: {pData->pPEBaseAddress:x}, DAC: {dataLocal.pPEBaseAddress:x}"); 592Debug.Assert(pData->nPESize == dataLocal.nPESize, $"nPESize: cDAC: {pData->nPESize}, DAC: {dataLocal.nPESize}"); 628Debug.ValidateHResult(hr, hrLocal); 631Debug.Assert(*pModule == moduleLocal, $"cDAC: {*pModule:x}, DAC: {moduleLocal:x}"); 633Debug.Assert(*pIsModuleLoaded == isModuleLoadedLocal, $"cDAC: {*pIsModuleLoaded}, DAC: {isModuleLoadedLocal}"); 663Debug.ValidateHResult(hr, hrLocal); 666Debug.Assert(*pIsManaged == isManagedLocal, $"cDAC: {*pIsManaged}, DAC: {isManagedLocal}"); 700Debug.ValidateHResult(hr, hrLocal); 703Debug.Assert(*pfAllowJITOpts == allowJITOptsLocal, $"cDAC: {*pfAllowJITOpts}, DAC: {allowJITOptsLocal}"); 704Debug.Assert(*pfEnableEnC == enableEnCLocal, $"cDAC: {*pfEnableEnC}, DAC: {enableEnCLocal}"); 752Debug.ValidateHResult(hr, hrLocal); 800Debug.ValidateHResult(hr, hrLocal); 803Debug.Assert( 834Debug.ValidateHResult(hr, hrLocal); 855Debug.ValidateHResult(hr, hrLocal); 885Debug.ValidateHResult(hr, hrLocal); 916Debug.ValidateHResult(hr, hrLocal); 1025Debug.ValidateHResult(hr, hrLocal); 1028Debug.Assert( 1064Debug.ValidateHResult(hr, hrLocal); 1066Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 1089Debug.ValidateHResult(hr, hrLocal); 1091Debug.Assert(*pRetVal == retValLocal, $"cDAC: {(nuint)(*pRetVal):x}, DAC: {(nuint)retValLocal:x}"); 1118Debug.ValidateHResult(hr, hrLocal); 1120Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 1149Debug.ValidateHResult(hr, hrLocal); 1152Debug.Assert(pThreadAllocInfo->allocBytesSOH == allocInfoLocal.allocBytesSOH, $"cDAC: {pThreadAllocInfo->allocBytesSOH}, DAC: {allocInfoLocal.allocBytesSOH}"); 1153Debug.Assert(pThreadAllocInfo->allocBytesUOH == allocInfoLocal.allocBytesUOH, $"cDAC: {pThreadAllocInfo->allocBytesUOH}, DAC: {allocInfoLocal.allocBytesUOH}"); 1188Debug.ValidateHResult(hr, hrLocal); 1212Debug.ValidateHResult(hr, hrLocal); 1214Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 1253Debug.ValidateHResult(hr, hrLocal); 1255Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1298Debug.ValidateHResult(hr, hrLocal); 1300Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1315Debug.ValidateHResult(hr, hrLocal); 1317Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1332Debug.ValidateHResult(hr, hrLocal); 1334Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1361Debug.ValidateHResult(hr, hrLocal); 1363Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1387Debug.ValidateHResult(hr, hrLocal); 1389Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1420Debug.ValidateHResult(hr, hrLocal); 1422Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 1469Debug.ValidateHResult(hr, hrLocal); 1471Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 1495Debug.ValidateHResult(hr, hrLocal); 1497Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 1521Debug.ValidateHResult(hr, hrLocal); 1523Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 1557Debug.ValidateHResult(hr, hrLocal); 1559Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 1582Debug.Assert(vmMethodDesc != 0, $"vmMethodDesc is null"); 1583Debug.Assert(fCodeAvailable != 0, $"fCodeAvailable is false"); 1680Debug.ValidateHResult(hr, hrLocal); 1682Debug.Assert(*pRetVal == pRetValLocal, $"cDAC: {*pRetVal:x}, DAC: {pRetValLocal:x}"); 1766Debug.ValidateHResult(hr, hrLocal); 1774Debug.Fail(DescribeContextDiff(cdacBytes, legacyBytes)); 1815Debug.ValidateHResult(hr, hrLocal); 1859Debug.ValidateHResult(hr, hrLocal); 1865Debug.Fail(DescribeContextDiff(cdacBytes, legacyBytes)); 1903Debug.ValidateHResult(hr, hrLocal); 1949Debug.ValidateHResult(hr, hrLocal); 1953Debug.Assert(*pResult == localResult, $"cDAC: {*pResult}, DAC: {localResult}"); 1986Debug.ValidateHResult(hr, hrLocal); 2072Debug.ValidateHResult(hr, hrLocal); 2075Debug.Assert(ftResult == legacyRetVal, $"FrameType mismatch - cDAC: {ftResult}, DAC: {legacyRetVal}"); 2079Debug.Assert(pcdac->fp == legacyData.fp, $"fp mismatch - cDAC: 0x{pcdac->fp:x}, DAC: 0x{legacyData.fp:x}"); 2080Debug.Assert(pcdac->vmCurrentAppDomainToken == legacyData.vmCurrentAppDomainToken, $"appDomain mismatch - cDAC: 0x{pcdac->vmCurrentAppDomainToken:x}, DAC: 0x{legacyData.vmCurrentAppDomainToken:x}"); 2081Debug.Assert(pcdac->eType == legacyData.eType, $"eType mismatch - cDAC: {pcdac->eType}, DAC: {legacyData.eType}"); 2088Debug.Fail(DescribeContextDiff(cctx, lctx)); 2095Debug.Assert(cv.mapping == lv.mapping, $"mapping mismatch - cDAC: {cv.mapping}, DAC: {lv.mapping}"); 2096Debug.Assert(cv.fVarArgs == lv.fVarArgs, $"fVarArgs mismatch - cDAC: {cv.fVarArgs}, DAC: {lv.fVarArgs}"); 2097Debug.Assert(cv.fNoMetadata == lv.fNoMetadata, $"fNoMetadata mismatch - cDAC: {cv.fNoMetadata}, DAC: {lv.fNoMetadata}"); 2098Debug.Assert(cv.taAmbientESP == lv.taAmbientESP, $"taAmbientESP mismatch - cDAC: 0x{cv.taAmbientESP:x}, DAC: 0x{lv.taAmbientESP:x}"); 2099Debug.Assert(cv.exactGenericArgsToken == lv.exactGenericArgsToken, $"exactGenericArgsToken mismatch - cDAC: 0x{cv.exactGenericArgsToken:x}, DAC: 0x{lv.exactGenericArgsToken:x}"); 2100Debug.Assert(cv.dwExactGenericArgsTokenIndex == lv.dwExactGenericArgsTokenIndex, $"dwExactGenericArgsTokenIndex mismatch - cDAC: 0x{cv.dwExactGenericArgsTokenIndex:x}, DAC: 0x{lv.dwExactGenericArgsTokenIndex:x}"); 2101Debug.Assert(cv.funcData.funcMetadataToken == lv.funcData.funcMetadataToken, $"funcMetadataToken mismatch - cDAC: 0x{cv.funcData.funcMetadataToken:x}, DAC: 0x{lv.funcData.funcMetadataToken:x}"); 2102Debug.Assert(cv.funcData.vmAssembly == lv.funcData.vmAssembly, $"vmAssembly mismatch - cDAC: 0x{cv.funcData.vmAssembly:x}, DAC: 0x{lv.funcData.vmAssembly:x}"); 2103Debug.Assert(cv.jitFuncData.nativeStartAddressPtr == lv.jitFuncData.nativeStartAddressPtr, $"nativeStartAddressPtr mismatch - cDAC: 0x{cv.jitFuncData.nativeStartAddressPtr:x}, DAC: 0x{lv.jitFuncData.nativeStartAddressPtr:x}"); 2104Debug.Assert(cv.jitFuncData.nativeOffset == lv.jitFuncData.nativeOffset, $"nativeOffset mismatch - cDAC: 0x{cv.jitFuncData.nativeOffset:x}, DAC: 0x{lv.jitFuncData.nativeOffset:x}"); 2105Debug.Assert(cv.jitFuncData.vmNativeCodeMethodDescToken == lv.jitFuncData.vmNativeCodeMethodDescToken, $"vmNativeCodeMethodDescToken mismatch - cDAC: 0x{cv.jitFuncData.vmNativeCodeMethodDescToken:x}, DAC: 0x{lv.jitFuncData.vmNativeCodeMethodDescToken:x}"); 2106Debug.Assert(cv.jitFuncData.fIsFilterFrame == lv.jitFuncData.fIsFilterFrame, $"fIsFilterFrame mismatch - cDAC: {cv.jitFuncData.fIsFilterFrame}, DAC: {lv.jitFuncData.fIsFilterFrame}"); 2107Debug.Assert(cv.jitFuncData.isInstantiatedGeneric == lv.jitFuncData.isInstantiatedGeneric, $"isInstantiatedGeneric mismatch - cDAC: {cv.jitFuncData.isInstantiatedGeneric}, DAC: {lv.jitFuncData.isInstantiatedGeneric}"); 2108Debug.Assert(cv.jitFuncData.fpParentOrSelf == lv.jitFuncData.fpParentOrSelf, $"fpParentOrSelf mismatch - cDAC: 0x{cv.jitFuncData.fpParentOrSelf:x}, DAC: 0x{lv.jitFuncData.fpParentOrSelf:x}"); 2109Debug.Assert(cv.jitFuncData.parentNativeOffset == lv.jitFuncData.parentNativeOffset, $"parentNativeOffset mismatch - cDAC: 0x{cv.jitFuncData.parentNativeOffset:x}, DAC: 0x{lv.jitFuncData.parentNativeOffset:x}"); 2111Debug.Assert(cv.jitFuncData.justAfterILThrow == lv.jitFuncData.justAfterILThrow, $"justAfterILThrow mismatch - cDAC: {cv.jitFuncData.justAfterILThrow}, DAC: {lv.jitFuncData.justAfterILThrow}"); 2306Debug.ValidateHResult(hr, hrLocal); 2308Debug.Assert(*pRetVal == dacCount, $"Internal frame count mismatch - cDAC: {*pRetVal}, DAC: {dacCount}"); 2374Debug.ValidateHResult(hr, hrLocal); 2377Debug.Assert(cdacFrames!.Count == dacFrames.Count, $"Internal frame count mismatch - cDAC: {cdacFrames!.Count}, DAC: {dacFrames.Count}"); 2383Debug.Assert(c.fp == d.fp, $"Frame[{i}] fp mismatch - cDAC: 0x{c.fp:x}, DAC: 0x{d.fp:x}"); 2384Debug.Assert(c.vmCurrentAppDomainToken == d.vmCurrentAppDomainToken, $"Frame[{i}] vmCurrentAppDomainToken mismatch - cDAC: 0x{c.vmCurrentAppDomainToken:x}, DAC: 0x{d.vmCurrentAppDomainToken:x}"); 2385Debug.Assert(c.eType == d.eType, $"Frame[{i}] eType mismatch - cDAC: {c.eType}, DAC: {d.eType}"); 2386Debug.Assert(c.stubFrame.funcMetadataToken == d.stubFrame.funcMetadataToken, $"Frame[{i}] funcMetadataToken mismatch - cDAC: 0x{c.stubFrame.funcMetadataToken:x}, DAC: 0x{d.stubFrame.funcMetadataToken:x}"); 2387Debug.Assert(c.stubFrame.vmAssembly == d.stubFrame.vmAssembly, $"Frame[{i}] vmAssembly mismatch - cDAC: 0x{c.stubFrame.vmAssembly:x}, DAC: 0x{d.stubFrame.vmAssembly:x}"); 2388Debug.Assert(c.stubFrame.vmMethodDesc == d.stubFrame.vmMethodDesc, $"Frame[{i}] vmMethodDesc mismatch - cDAC: 0x{c.stubFrame.vmMethodDesc:x}, DAC: 0x{d.stubFrame.vmMethodDesc:x}"); 2389Debug.Assert(c.stubFrame.frameType == d.stubFrame.frameType, $"Frame[{i}] frameType mismatch - cDAC: {c.stubFrame.frameType}, DAC: {d.stubFrame.frameType}"); 2479Debug.ValidateHResult(hr, hrLocal); 2481Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 2529Debug.ValidateHResult(hr, hrLocal); 2531Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 2560Debug.ValidateHResult(hr, hrLocal); 2569Debug.Assert(contextStruct.Equals(localContextStruct)); 2603Debug.ValidateHResult(hr, hrLocal); 2605Debug.Assert(*pRetVal == resultLocal, $"cDAC: {*pRetVal}, DAC: {resultLocal}"); 2635Debug.ValidateHResult(hr, hrLocal); 2638Debug.Assert(*pArgBase == argBaseLocal, $"cDAC argBase: 0x{*pArgBase:X}, DAC argBase: 0x{argBaseLocal:X}"); 2639Debug.Assert(pRetVal->pAddress == retValLocal.pAddress, $"cDAC sigAddr: 0x{pRetVal->pAddress:X}, DAC sigAddr: 0x{retValLocal.pAddress:X}"); 2640Debug.Assert(pRetVal->cbSize == retValLocal.cbSize, $"cDAC sigLen: {pRetVal->cbSize}, DAC sigLen: {retValLocal.cbSize}"); 2675Debug.ValidateHResult(hr, hrLocal); 2677Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 2714Debug.Fail($"Unexpected generics type token index: {dwExactGenericArgsTokenIndex}"); 2727Debug.ValidateHResult(hr, hrLocal); 2729Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 2795Debug.ValidateHResult(hr, hrLocal); 2798Debug.Assert(pTargetBuffer->pAddress == bufferLocal.pAddress, $"cDAC ILAddr: 0x{pTargetBuffer->pAddress:X}, DAC ILAddr: 0x{bufferLocal.pAddress:X}"); 2799Debug.Assert(pTargetBuffer->cbSize == bufferLocal.cbSize, $"cDAC ILSize: {pTargetBuffer->cbSize}, DAC ILSize: {bufferLocal.cbSize}"); 2800Debug.Assert(*pLocalSigToken == sigLocal, $"cDAC LocalSig: 0x{*pLocalSigToken:X}, DAC LocalSig: 0x{sigLocal:X}"); 2864Debug.ValidateHResult(hr, hrLocal); 2950Debug.ValidateHResult(hr, hrLocal); 2955Debug.Assert(*pVmModule == vmModuleLocal, $"cDAC: 0x{*pVmModule:X}, DAC: 0x{vmModuleLocal:X}"); 2957Debug.Assert(*pFunctionToken == functionTokenLocal, $"cDAC: 0x{*pFunctionToken:X}, DAC: 0x{functionTokenLocal:X}"); 2982Debug.Assert(codeInfo.hotRegion.pAddress == codeInfoLocal.hotRegion.pAddress, $"cDAC: 0x{codeInfo.hotRegion.pAddress:X}, DAC: 0x{codeInfoLocal.hotRegion.pAddress:X}"); 2983Debug.Assert(codeInfo.hotRegion.cbSize == codeInfoLocal.hotRegion.cbSize, $"cDAC: {codeInfo.hotRegion.cbSize}, DAC: {codeInfoLocal.hotRegion.cbSize}"); 2984Debug.Assert(codeInfo.coldRegion.pAddress == codeInfoLocal.coldRegion.pAddress, $"cDAC: 0x{codeInfo.coldRegion.pAddress:X}, DAC: 0x{codeInfoLocal.coldRegion.pAddress:X}"); 2985Debug.Assert(codeInfo.coldRegion.cbSize == codeInfoLocal.coldRegion.cbSize, $"cDAC: {codeInfo.coldRegion.cbSize}, DAC: {codeInfoLocal.coldRegion.cbSize}"); 2986Debug.Assert(codeInfo.isInstantiatedGeneric == codeInfoLocal.isInstantiatedGeneric, $"cDAC: {codeInfo.isInstantiatedGeneric}, DAC: {codeInfoLocal.isInstantiatedGeneric}"); 2987Debug.Assert(codeInfo.vmNativeCodeMethodDescToken == codeInfoLocal.vmNativeCodeMethodDescToken, $"cDAC: 0x{codeInfo.vmNativeCodeMethodDescToken:X}, DAC: 0x{codeInfoLocal.vmNativeCodeMethodDescToken:X}"); 2988Debug.Assert(codeInfo.encVersion == codeInfoLocal.encVersion, $"cDAC: {codeInfo.encVersion}, DAC: {codeInfoLocal.encVersion}"); 3011Debug.ValidateHResult(hr, hrLocal); 3013Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 3038Debug.ValidateHResult(hr, hrLocal); 3040Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 3289Debug.ValidateHResult(hr, hrLocal); 3292Debug.Assert(cdacObjectSize == dacObjectSize, $"{label} object size mismatch - cDAC: {cdacObjectSize}, DAC: {dacObjectSize}"); 3299Debug.Assert(cdacFields!.Count == dacFields.Count, $"{label} field count mismatch - cDAC: {cdacFields!.Count}, DAC: {dacFields.Count}"); 3305Debug.Assert(c.m_fldMetadataToken == d.m_fldMetadataToken, $"{label} field[{i}] m_fldMetadataToken mismatch - cDAC: 0x{c.m_fldMetadataToken:x}, DAC: 0x{d.m_fldMetadataToken:x}"); 3306Debug.Assert(c.m_fFldStorageAvailable == d.m_fFldStorageAvailable, $"{label} field[{i}] m_fFldStorageAvailable mismatch - cDAC: {c.m_fFldStorageAvailable}, DAC: {d.m_fFldStorageAvailable}"); 3307Debug.Assert(c.m_fFldIsStatic == d.m_fFldIsStatic, $"{label} field[{i}] m_fFldIsStatic mismatch - cDAC: {c.m_fFldIsStatic}, DAC: {d.m_fFldIsStatic}"); 3308Debug.Assert(c.m_fFldIsRVA == d.m_fFldIsRVA, $"{label} field[{i}] m_fFldIsRVA mismatch - cDAC: {c.m_fFldIsRVA}, DAC: {d.m_fFldIsRVA}"); 3309Debug.Assert(c.m_fFldIsTLS == d.m_fFldIsTLS, $"{label} field[{i}] m_fFldIsTLS mismatch - cDAC: {c.m_fFldIsTLS}, DAC: {d.m_fFldIsTLS}"); 3310Debug.Assert(c.m_fFldIsPrimitive == d.m_fFldIsPrimitive, $"{label} field[{i}] m_fFldIsPrimitive mismatch - cDAC: {c.m_fFldIsPrimitive}, DAC: {d.m_fFldIsPrimitive}"); 3311Debug.Assert(c.m_fFldIsCollectibleStatic == d.m_fFldIsCollectibleStatic, $"{label} field[{i}] m_fFldIsCollectibleStatic mismatch - cDAC: {c.m_fFldIsCollectibleStatic}, DAC: {d.m_fFldIsCollectibleStatic}"); 3312Debug.Assert(c.m_fldInstanceOffset == d.m_fldInstanceOffset, $"{label} field[{i}] m_fldInstanceOffset mismatch - cDAC: 0x{c.m_fldInstanceOffset:x}, DAC: 0x{d.m_fldInstanceOffset:x}"); 3313Debug.Assert(c.m_pFldStaticAddress == d.m_pFldStaticAddress, $"{label} field[{i}] m_pFldStaticAddress mismatch - cDAC: 0x{c.m_pFldStaticAddress:x}, DAC: 0x{d.m_pFldStaticAddress:x}"); 3314Debug.Assert(c.m_vmFieldDesc == d.m_vmFieldDesc, $"{label} field[{i}] m_vmFieldDesc mismatch - cDAC: 0x{c.m_vmFieldDesc:x}, DAC: 0x{d.m_vmFieldDesc:x}"); 3337Debug.ValidateHResult(hr, hrLocal); 3366Debug.ValidateHResult(hr, hrLocal); 3379Debug.Assert(cdac->elementType == dac->elementType, 3385Debug.Assert(cdac->ClassTypeData_metadataToken == dac->ClassTypeData_metadataToken, 3387Debug.Assert(cdac->ClassTypeData_vmAssembly == dac->ClassTypeData_vmAssembly, 3389Debug.Assert(cdac->ClassTypeData_typeHandle == dac->ClassTypeData_typeHandle, 3394Debug.Assert(cdac->ArrayTypeData_arrayRank == dac->ArrayTypeData_arrayRank, 3396Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.elementType == dac->ArrayTypeData_arrayTypeArg.elementType, 3398Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.metadataToken == dac->ArrayTypeData_arrayTypeArg.metadataToken, 3400Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.vmAssembly == dac->ArrayTypeData_arrayTypeArg.vmAssembly, 3402Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.vmTypeHandle == dac->ArrayTypeData_arrayTypeArg.vmTypeHandle, 3407Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.elementType == dac->UnaryTypeData_unaryTypeArg.elementType, 3409Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.metadataToken == dac->UnaryTypeData_unaryTypeArg.metadataToken, 3411Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.vmAssembly == dac->UnaryTypeData_unaryTypeArg.vmAssembly, 3413Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.vmTypeHandle == dac->UnaryTypeData_unaryTypeArg.vmTypeHandle, 3417Debug.Assert(cdac->NaryTypeData_typeHandle == dac->NaryTypeData_typeHandle, 3456Debug.ValidateHResult(hr, hrLocal); 3458Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 3494Debug.ValidateHResult(hr, hrLocal); 3496Debug.Assert(*pRetVal == vmLocal, $"cDAC: {*pRetVal:x}, DAC: {vmLocal:x}"); 3548Debug.ValidateHResult(hr, hrLocal); 3550Debug.Assert(*pVmTypeHandle == vmLocal, $"cDAC: {*pVmTypeHandle:x}, DAC: {vmLocal:x}"); 3771Debug.ValidateHResult(hr, hrLocal); 3774Debug.Assert(cClassParams == cClassParamsLocal, 3780Debug.Assert(entries.Count == legacyEntries.Count, 3786Debug.Assert(entries[i].Equals(legacyEntries[i]), 3824Debug.ValidateHResult(hr, hrLocal); 3826Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 3851Debug.ValidateHResult(hr, hrLocal); 3853Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}"); 3927Debug.ValidateHResult(hr, hrLocal); 3930Debug.Assert(pFieldData->m_fldMetadataToken == fieldDataLocal.m_fldMetadataToken, 3932Debug.Assert(pFieldData->m_fFldStorageAvailable == fieldDataLocal.m_fFldStorageAvailable, 3934Debug.Assert(pFieldData->m_fFldIsStatic == fieldDataLocal.m_fFldIsStatic, 3936Debug.Assert(pFieldData->m_fFldIsRVA == fieldDataLocal.m_fFldIsRVA, 3938Debug.Assert(pFieldData->m_fFldIsTLS == fieldDataLocal.m_fFldIsTLS, 3940Debug.Assert(pFieldData->m_fFldIsPrimitive == fieldDataLocal.m_fFldIsPrimitive, 3942Debug.Assert(pFieldData->m_fFldIsCollectibleStatic == fieldDataLocal.m_fFldIsCollectibleStatic, 3944Debug.Assert(pFieldData->m_vmFieldDesc == fieldDataLocal.m_vmFieldDesc, 3947Debug.Assert(pFieldData->m_pFldStaticAddress == fieldDataLocal.m_pFldStaticAddress, 3950Debug.Assert(pFieldData->m_fldInstanceOffset == fieldDataLocal.m_fldInstanceOffset, 4025Debug.ValidateHResult(hr, hrLocal); 4031Debug.Assert(entries.Count == legacyEntries.Count, 4037Debug.Assert(entries[i].Equals(legacyEntries[i]), 4072Debug.Assert(pVmModule != null); 4080Debug.Assert(pMetadataToken != null); 4099Debug.ValidateHResult(hr, hrLocal); 4102Debug.Assert(*pMetadataToken == metadataTokenLocal, $"cDAC: {*pMetadataToken}, DAC: {metadataTokenLocal}"); 4103Debug.Assert(*pVmModule == vmModuleLocal, $"cDAC: {*pVmModule}, DAC: {vmModuleLocal}"); 4142Debug.ValidateHResult(hr, hrLocal); 4144Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 4199Debug.ValidateHResult(hr, hrLocal); 4205Debug.Assert(frames.SequenceEqual(legacyFrames), 4235Debug.ValidateHResult(hr, hrLocal); 4237Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 4292Debug.ValidateHResult(hr, hrLocal); 4297Debug.Assert(itfPtrs.SequenceEqual(legacyItfPtrs), 4330Debug.ValidateHResult(hr, hrLocal); 4331Debug.Assert(*pObjRef == objRefLocal, $"cDAC objRef: 0x{*pObjRef:x}, DAC: 0x{objRefLocal:x}"); 4334Debug.Assert(pTypedByRefType->elementType == typeLocal.elementType, 4336Debug.Assert(pTypedByRefType->metadataToken == typeLocal.metadataToken, 4338Debug.Assert(pTypedByRefType->vmAssembly == typeLocal.vmAssembly, 4371Debug.ValidateHResult(hr, hrLocal); 4374Debug.Assert(*pLength == lengthLocal, $"cDAC length: {*pLength}, DAC: {lengthLocal}"); 4375Debug.Assert(*pOffsetToStringBase == offsetLocal, $"cDAC offsetToStringBase: {*pOffsetToStringBase}, DAC: {offsetLocal}"); 4425Debug.ValidateHResult(hr, hrLocal); 4428Debug.Assert(*pIsValidArray == isValidLocal, $"cDAC isValidArray: {*pIsValidArray}, DAC: {isValidLocal}"); 4431Debug.Assert(pArrayInfo->rank == arrayInfoLocal.rank, $"cDAC rank: {pArrayInfo->rank}, DAC: {arrayInfoLocal.rank}"); 4432Debug.Assert(pArrayInfo->componentCount == arrayInfoLocal.componentCount, $"cDAC componentCount: {pArrayInfo->componentCount}, DAC: {arrayInfoLocal.componentCount}"); 4433Debug.Assert(pArrayInfo->offsetToArrayBase == arrayInfoLocal.offsetToArrayBase, $"cDAC offsetToArrayBase: {pArrayInfo->offsetToArrayBase}, DAC: {arrayInfoLocal.offsetToArrayBase}"); 4434Debug.Assert(pArrayInfo->offsetToUpperBounds == arrayInfoLocal.offsetToUpperBounds, $"cDAC offsetToUpperBounds: {pArrayInfo->offsetToUpperBounds}, DAC: {arrayInfoLocal.offsetToUpperBounds}"); 4435Debug.Assert(pArrayInfo->offsetToLowerBounds == arrayInfoLocal.offsetToLowerBounds, $"cDAC offsetToLowerBounds: {pArrayInfo->offsetToLowerBounds}, DAC: {arrayInfoLocal.offsetToLowerBounds}"); 4436Debug.Assert(pArrayInfo->elementSize == arrayInfoLocal.elementSize, $"cDAC elementSize: {pArrayInfo->elementSize}, DAC: {arrayInfoLocal.elementSize}"); 4490Debug.ValidateHResult(hr, hrLocal); 4493Debug.Assert(*pIsValidRef == isValidLocal, $"cDAC isValidRef: {*pIsValidRef}, DAC: {isValidLocal}"); 4496Debug.Assert(*pObjSize == objSizeLocal, $"cDAC objSize: {*pObjSize}, DAC: {objSizeLocal}"); 4497Debug.Assert(*pObjOffsetToVars == objOffsetLocal, $"cDAC objOffsetToVars: {*pObjOffsetToVars}, DAC: {objOffsetLocal}"); 4498Debug.Assert(pObjTypeData->elementType == typeDataLocal.elementType, 4524Debug.ValidateHResult(hr, hrLocal); 4526Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 4549Debug.ValidateHResult(hr, hrLocal); 4551Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 4567Debug.ValidateHResult(hr, hrLocal); 4569Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 4584Debug.ValidateHResult(hr, hrLocal); 4586Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 4610Debug.ValidateHResult(hr, hrLocal); 4612Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 4627Debug.ValidateHResult(hr, hrLocal); 4629Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}"); 4653Debug.Assert(threadPtr != TargetPointer.Null, "A thread should have been found"); 4671Debug.ValidateHResult(hr, hrLocal); 4674Debug.Assert(pRetVal->lockOwner == pRetValLocal.lockOwner, 4676Debug.Assert(pRetVal->acquisitionCount == pRetValLocal.acquisitionCount, 4704Debug.ValidateHResult(hr, hrLocal); 4706Debug.Assert(*pRetVal == resultLocal); 4761Debug.ValidateHResult(hr, hrLocal); 4764Debug.Assert(*pResult == resultLocal, $"GetModuleMetaDataFileInfo result mismatch - cDAC: {*pResult}, DAC: {resultLocal}"); 4767Debug.Assert(*dwTimeStamp == timeStampLocal, $"GetModuleMetaDataFileInfo timestamp mismatch - cDAC: {*dwTimeStamp}, DAC: {timeStampLocal}"); 4768Debug.Assert(*dwImageSize == imageSizeLocal, $"GetModuleMetaDataFileInfo image size mismatch - cDAC: {*dwImageSize}, DAC: {imageSizeLocal}"); 4769Debug.Assert( 4802Debug.ValidateHResult(hr, hrLocal); 4804Debug.Assert(*pResult == resultLocal); 4833Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess); 4867Debug.ValidateHResult(hr, hrLocal); 4933Debug.ValidateHResult(hr, hrLocal); 4936Debug.Assert(*fetched == fetchedLocal, 4940Debug.Assert(objects[k].address == objectsLocal[k].address, 4942Debug.Assert(objects[k].size == objectsLocal[k].size, 4944Debug.Assert(objects[k].type.token1 == objectsLocal[k].type.token1, 5026Debug.ValidateHResult(hr, hrLocal); 5033Debug.Assert(segments.Count == legacySegments.Count, 5039Debug.Assert(segments[i] == legacySegments[i], 5106Debug.ValidateHResult(hr, hrLocal); 5109Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}"); 5139Debug.ValidateHResult(hr, hrLocal); 5173Debug.ValidateHResult(hr, hrLocal); 5228Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowDivergentSuccess); 5231Debug.Assert( 5238Debug.Assert(refs[j].dwType == legacyRefs[j].dwType, 5240Debug.Assert(refs[j].vmDomain == legacyRefs[j].vmDomain, 5242Debug.Assert(refs[j].objHnd == legacyRefs[j].objHnd, 5244Debug.Assert(refs[j].i64ExtraData == legacyRefs[j].i64ExtraData, 5286Debug.ValidateHResult(hr, hrLocal); 5289Debug.Assert(pType->token1 == resultLocal.token1); 5290Debug.Assert(pType->token2 == resultLocal.token2); 5317Debug.ValidateHResult(hr, hrLocal); 5320Debug.Assert(pId->token1 == resultLocal.token1); 5321Debug.Assert(pId->token2 == resultLocal.token2); 5460Debug.ValidateHResult(hr, hrLocal); 5463Debug.Assert(*pceltFetched == fetchedLocal, $"cDAC: {*pceltFetched}, DAC: {fetchedLocal}"); 5467Debug.Assert(layout[i].token == localFieldsPtr[i].token, $"field[{i}].token cDAC: {layout[i].token:x}, DAC: {localFieldsPtr[i].token:x}"); 5468Debug.Assert(layout[i].offset == localFieldsPtr[i].offset, $"field[{i}].offset cDAC: {layout[i].offset}, DAC: {localFieldsPtr[i].offset}"); 5469Debug.Assert(layout[i].fieldType == localFieldsPtr[i].fieldType, $"field[{i}].fieldType cDAC: {layout[i].fieldType}, DAC: {localFieldsPtr[i].fieldType}"); 5470Debug.Assert(layout[i].id.token1 == localFieldsPtr[i].id.token1, $"field[{i}].id.token1 cDAC: {layout[i].id.token1:x}, DAC: {localFieldsPtr[i].id.token1:x}"); 5471Debug.Assert(layout[i].id.token2 == localFieldsPtr[i].id.token2, $"field[{i}].id.token2 cDAC: {layout[i].id.token2:x}, DAC: {localFieldsPtr[i].id.token2:x}"); 5522Debug.ValidateHResult(hr, hrLocal); 5525Debug.Assert(pLayout->parentID.token1 == resultLocal.parentID.token1, $"cDAC: {pLayout->parentID.token1:x}, DAC: {resultLocal.parentID.token1:x}"); 5526Debug.Assert(pLayout->parentID.token2 == resultLocal.parentID.token2, $"cDAC: {pLayout->parentID.token2:x}, DAC: {resultLocal.parentID.token2:x}"); 5527Debug.Assert(pLayout->objectSize == resultLocal.objectSize, $"cDAC: {pLayout->objectSize}, DAC: {resultLocal.objectSize}"); 5528Debug.Assert(pLayout->numFields == resultLocal.numFields, $"cDAC: {pLayout->numFields}, DAC: {resultLocal.numFields}"); 5529Debug.Assert(pLayout->boxOffset == resultLocal.boxOffset, $"cDAC: {pLayout->boxOffset}, DAC: {resultLocal.boxOffset}"); 5530Debug.Assert(pLayout->type == resultLocal.type, $"cDAC: {pLayout->type}, DAC: {resultLocal.type}"); 5595Debug.ValidateHResult(hr, hrLocal); 5598Debug.Assert(pLayout->componentID.token1 == resultLocal.componentID.token1, $"cDAC: {pLayout->componentID.token1:x}, DAC: {resultLocal.componentID.token1:x}"); 5599Debug.Assert(pLayout->componentID.token2 == resultLocal.componentID.token2, $"cDAC: {pLayout->componentID.token2:x}, DAC: {resultLocal.componentID.token2:x}"); 5600Debug.Assert(pLayout->componentType == resultLocal.componentType, $"cDAC: {pLayout->componentType}, DAC: {resultLocal.componentType}"); 5601Debug.Assert(pLayout->firstElementOffset == resultLocal.firstElementOffset, $"cDAC: {pLayout->firstElementOffset}, DAC: {resultLocal.firstElementOffset}"); 5602Debug.Assert(pLayout->elementSize == resultLocal.elementSize, $"cDAC: {pLayout->elementSize}, DAC: {resultLocal.elementSize}"); 5603Debug.Assert(pLayout->countOffset == resultLocal.countOffset, $"cDAC: {pLayout->countOffset}, DAC: {resultLocal.countOffset}"); 5604Debug.Assert(pLayout->rankSize == resultLocal.rankSize, $"cDAC: {pLayout->rankSize}, DAC: {resultLocal.rankSize}"); 5605Debug.Assert(pLayout->numRanks == resultLocal.numRanks, $"cDAC: {pLayout->numRanks}, DAC: {resultLocal.numRanks}"); 5606Debug.Assert(pLayout->rankOffset == resultLocal.rankOffset, $"cDAC: {pLayout->rankOffset}, DAC: {resultLocal.rankOffset}"); 5640Debug.ValidateHResult(hr, hrLocal); 5643Debug.Assert(pHeapInfo->areGCStructuresValid == resultLocal.areGCStructuresValid); 5644Debug.Assert(pHeapInfo->numHeaps == resultLocal.numHeaps); 5645Debug.Assert(pHeapInfo->pointerSize == resultLocal.pointerSize); 5646Debug.Assert(pHeapInfo->gcType == resultLocal.gcType); 5647Debug.Assert(pHeapInfo->concurrent == resultLocal.concurrent); 5676Debug.ValidateHResult(hr, hrLocal); 5678Debug.Assert(*pHasReadWriteMetadata == resultLocal, $"cDAC: {*pHasReadWriteMetadata}, DAC: {resultLocal}"); 5730Debug.ValidateHResult(hr, hrLocal); 5732Debug.Assert(*pOptimizationsDisabled == localPOptimizationsDisabled); 5787Debug.ValidateHResult(hr, hrLocal); 5789Debug.Assert(*pVmILCodeVersionNode == resultLocal, $"cDAC: {*pVmILCodeVersionNode:x}, DAC: {resultLocal:x}"); 5854Debug.ValidateHResult(hr, hrLocal); 5857Debug.Assert(pCodeInfo->pAddress == bufferLocal.pAddress, $"cDAC ILAddr: 0x{pCodeInfo->pAddress:X}, DAC ILAddr: 0x{bufferLocal.pAddress:X}"); 5858Debug.Assert(pCodeInfo->cbSize == bufferLocal.cbSize, $"cDAC ILSize: {pCodeInfo->cbSize}, DAC ILSize: {bufferLocal.cbSize}"); 5859Debug.Assert(*pLocalSigToken == sigLocal, $"cDAC LocalSig: 0x{*pLocalSigToken:X}, DAC LocalSig: 0x{sigLocal:X}"); 5896Debug.ValidateHResult(hr, hrLocal); 5898Debug.Assert(*pVmNativeCodeVersionNode == resultLocal, $"cDAC: {*pVmNativeCodeVersionNode:x}, DAC: {resultLocal:x}"); 5933Debug.ValidateHResult(hr, hrLocal); 5935Debug.Assert(*pVmILCodeVersionNode == resultLocal, $"cDAC: {*pVmILCodeVersionNode:x}, DAC: {resultLocal:x}"); 5978Debug.ValidateHResult(hr, hrLocal); 5981Debug.Assert(pData->pbIL == dataLocal.pbIL, $"cDAC: {pData->pbIL:x}, DAC: {dataLocal.pbIL:x}"); 5982Debug.Assert(pData->cInstrumentedMapEntries == dataLocal.cInstrumentedMapEntries, $"cDAC: {pData->cInstrumentedMapEntries:x}, DAC: {dataLocal.cInstrumentedMapEntries:x}"); 5983Debug.Assert(pData->rgInstrumentedMapEntries == dataLocal.rgInstrumentedMapEntries, $"cDAC: {pData->rgInstrumentedMapEntries:x}, DAC: {dataLocal.rgInstrumentedMapEntries:x}"); 6006Debug.ValidateHResult(hr, hrLocal); 6035Debug.ValidateHResult(hr, hrLocal); 6037Debug.Assert(*pResult == pResultLocal, $"cDAC: {*pResult}, DAC: {pResultLocal}"); 6092Debug.ValidateHResult(hr, hrLocal); 6095Debug.Assert(*ppFunctionAssembly == asmLocal, $"cDAC: {*ppFunctionAssembly:x}, DAC: {asmLocal:x}"); 6096Debug.Assert(*pMethodDef == methodDefLocal, $"cDAC: {*pMethodDef:x}, DAC: {methodDefLocal:x}"); 6130Debug.ValidateHResult(hr, hrLocal); 6132Debug.Assert(*ppTargetObj == targetObjLocal, $"cDAC: {*ppTargetObj:x}, DAC: {targetObjLocal:x}"); 6175Debug.ValidateHResult(hr, hrLocal); 6177Debug.Assert(*isModuleMapped == isModuleMappedLocal, $"cDAC: {*isModuleMapped}, DAC: {isModuleMappedLocal}"); 6201Debug.ValidateHResult(hr, hrLocal); 6203Debug.Assert(*pResult == resultLocal); 6237Debug.ValidateHResult(hr, hrLocal); 6239Debug.Assert(*pVmAssembly == assemblyLocal, $"cDAC: {*pVmAssembly:x}, DAC: {assemblyLocal:x}"); 6269Debug.ValidateHResult(hr, hrLocal); 6272Debug.Assert(*pDiagnosticIP == diagnosticIPLocal, $"cDAC: {*pDiagnosticIP:x}, DAC: {diagnosticIPLocal:x}"); 6273Debug.Assert(*pNextContinuation == nextLocal, $"cDAC: {*pNextContinuation:x}, DAC: {nextLocal:x}"); 6274Debug.Assert(*pState == stateLocal, $"cDAC: {*pState}, DAC: {stateLocal}"); 6360Debug.ValidateHResult(hr, hrLocal); 6365Debug.Assert(locals.Count == legacyLocals.Count, 6369Debug.Assert(locals[i].Offset == legacyLocals[i].Offset, 6371Debug.Assert(locals[i].IlVarNum == legacyLocals[i].IlVarNum, 6418Debug.ValidateHResult(hr, hrLocal); 6420Debug.Assert(*pIndex == indexLocal, $"cDAC: {*pIndex}, DAC: {indexLocal}"); 6551Debug.Assert(rts.IsArray(typeHandle, out _)); 6591Debug.Assert(modulePtr != TargetPointer.Null); 6645Debug.Assert(modulePtr != TargetPointer.Null);
Dbi\DacDbiImpl.NativeCodeInfo.cs (25)
150Debug.ValidateHResult(hr, hrLocal); 155Debug.Assert(*pFixedArgCount == dacFixedArgCount, 169Debug.Assert(cdac.Count == dac.Count, 176Debug.Assert(c.nativeOffset == d.nativeOffset, 178Debug.Assert(c.ilOffset == d.ilOffset, 180Debug.Assert(c.source == d.source, 187Debug.Assert(cdac.Count == dac.Count, 194Debug.Assert(c.startOffset == d.startOffset, 196Debug.Assert(c.endOffset == d.endOffset, 198Debug.Assert(c.callReturnValueILOffset == d.callReturnValueILOffset, 200Debug.Assert(c.varNumber == d.varNumber, 202Debug.Assert(c.loc.vlType == d.loc.vlType, 210Debug.Assert(c.loc.vlrReg == d.loc.vlrReg, 216Debug.Assert(c.loc.vlsBaseReg == d.loc.vlsBaseReg, 218Debug.Assert(c.loc.vlsOffset == d.loc.vlsOffset, 222Debug.Assert(c.loc.vlrrReg1 == d.loc.vlrrReg1, 224Debug.Assert(c.loc.vlrrReg2 == d.loc.vlrrReg2, 228Debug.Assert(c.loc.vlrsReg == d.loc.vlrsReg, 230Debug.Assert(c.loc.vlrssBaseReg == d.loc.vlrssBaseReg, 232Debug.Assert(c.loc.vlrssOffset == d.loc.vlrssOffset, 236Debug.Assert(c.loc.vlsrsBaseReg == d.loc.vlsrsBaseReg, 238Debug.Assert(c.loc.vlsrsOffset == d.loc.vlsrsOffset, 240Debug.Assert(c.loc.vlsrReg == d.loc.vlsrReg, 244Debug.Assert(c.loc.vlfReg == d.loc.vlfReg, 248Debug.Assert(c.loc.vlfvOffset == d.loc.vlfvOffset,
DebugExtensions.cs (2)
89extension(Debug) 121Debug.Assert(false, message);
Marshalling\DacComNullableByRef.cs (1)
92Debug.Fail("Exception occurred while marshalling COM interface output parameter. The native caller will receive a null pointer.");
MetaDataImportImpl.cs (112)
198Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumTypeDefs count mismatch: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 200Debug.Assert(tokens[i] == legacyTokens[i], $"EnumTypeDefs token mismatch at [{i}]: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}"); 246Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumInterfaceImpls count mismatch for 0x{td:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 248Debug.Assert(tokens[i] == legacyTokens[i], $"EnumInterfaceImpls token mismatch at [{i}] for 0x{td:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}"); 300Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumMethods count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 302Debug.Assert(tokens[i] == legacyTokens[i], $"EnumMethods token mismatch at [{i}] for 0x{cl:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}"); 348Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumFields count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 350Debug.Assert(tokens[i] == legacyTokens[i], $"EnumFields token mismatch at [{i}] for 0x{cl:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}"); 409Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumGenericParams count mismatch for 0x{tk:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}"); 411Debug.Assert(tokens[i] == legacyTokens[i], $"EnumGenericParams token mismatch at [{i}] for 0x{tk:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}"); 450Debug.ValidateHResult(hr, hrLegacy); 454Debug.Assert(*pdwTypeDefFlags == flagsLocal, $"TypeDefFlags mismatch: cDAC=0x{*pdwTypeDefFlags:X}, DAC=0x{flagsLocal:X}"); 456Debug.Assert(*ptkExtends == extendsLocal, $"Extends mismatch: cDAC=0x{*ptkExtends:X}, DAC=0x{extendsLocal:X}"); 458Debug.Assert(*pchTypeDef == pchLocal, $"Name length mismatch: cDAC={*pchTypeDef}, DAC={pchLocal}"); 463Debug.Assert(cdacName == dacName, $"TypeDef name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 501Debug.ValidateHResult(hr, hrLegacy); 505Debug.Assert(*ptkResolutionScope == scopeLocal, $"ResolutionScope mismatch: cDAC=0x{*ptkResolutionScope:X}, DAC=0x{scopeLocal:X}"); 507Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 512Debug.Assert(cdacName == dacName, $"TypeRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 568Debug.ValidateHResult(hr, hrLegacy); 572Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}"); 574Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}"); 576Debug.Assert(*pchMethod == pchLocal, $"Name length mismatch: cDAC={*pchMethod}, DAC={pchLocal}"); 581Debug.Assert(cdacName == dacName, $"Method name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 584Debug.Assert(*pulCodeRVA == rvaLocal, $"RVA mismatch: cDAC=0x{*pulCodeRVA:X}, DAC=0x{rvaLocal:X}"); 586Debug.Assert(*pdwImplFlags == implLocal, $"ImplFlags mismatch: cDAC=0x{*pdwImplFlags:X}, DAC=0x{implLocal:X}"); 590Debug.Assert(*pcbSigBlob == cbSigLocal, $"SigBlob length mismatch: cDAC={*pcbSigBlob}, DAC={cbSigLocal}"); 664Debug.ValidateHResult(hr, hrLegacy); 668Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}"); 670Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}"); 672Debug.Assert(*pchField == pchLocal, $"Name length mismatch: cDAC={*pchField}, DAC={pchLocal}"); 677Debug.Assert(cdacName == dacName, $"Field name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 680Debug.Assert(*pdwCPlusTypeFlag == cpTypeLocal, $"CPlusTypeFlag mismatch: cDAC=0x{*pdwCPlusTypeFlag:X}, DAC=0x{cpTypeLocal:X}"); 684Debug.Assert(*pcbSigBlob == cbSigLocal, $"SigBlob length mismatch: cDAC={*pcbSigBlob}, DAC={cbSigLocal}"); 688Debug.Assert(*pcchValue == cchValueLocal, $"Constant length mismatch: cDAC={*pcchValue}, DAC={cchValueLocal}"); 755Debug.ValidateHResult(hr, hrLegacy); 759Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}"); 761Debug.Assert(*ptkIface == ifaceLocal, $"Interface mismatch: cDAC=0x{*ptkIface:X}, DAC=0x{ifaceLocal:X}"); 792Debug.ValidateHResult(hr, hrLegacy); 794Debug.Assert(*ptdEnclosingClass == enclosingLocal, $"Enclosing class mismatch: cDAC=0x{*ptdEnclosingClass:X}, DAC=0x{enclosingLocal:X}"); 837Debug.ValidateHResult(hr, hrLegacy); 841Debug.Assert(*pulParamSeq == seqLocal, $"ParamSeq mismatch: cDAC={*pulParamSeq}, DAC={seqLocal}"); 843Debug.Assert(*pdwParamFlags == flagsLocal, $"ParamFlags mismatch: cDAC=0x{*pdwParamFlags:X}, DAC=0x{flagsLocal:X}"); 845Debug.Assert(*ptOwner == ownerLocal, $"Owner mismatch: cDAC=0x{*ptOwner:X}, DAC=0x{ownerLocal:X}"); 847Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 852Debug.Assert(cdacName == dacName, $"GenericParam name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 899Debug.ValidateHResult(hr, hrLegacy); 903Debug.Assert(*pulCodeRVA == rvaLocal, $"RVA mismatch: cDAC=0x{*pulCodeRVA:X}, DAC=0x{rvaLocal:X}"); 905Debug.Assert(*pdwImplFlags == implLocal, $"ImplFlags mismatch: cDAC=0x{*pdwImplFlags:X}, DAC=0x{implLocal:X}"); 939Debug.ValidateHResult(hr, hrLegacy); 945Debug.Assert(*pcbSig == cbLocal, $"Sig length mismatch: cDAC={*pcbSig}, DAC={cbLocal}"); 996Debug.ValidateHResult(hr, hrLegacy); 1002Debug.Assert(*pcbData == cbLocal, $"CustomAttribute length mismatch: cDAC={*pcbData}, DAC={cbLocal}"); 1103Debug.ValidateHResult(hr, hrLegacy); 1105Debug.Assert(*ptd == tdLocal, $"TypeDef mismatch: cDAC=0x{*ptd:X}, DAC=0x{tdLocal:X}"); 1191Debug.ValidateHResult(hr, hrLegacy); 1195Debug.Assert(*ptk == tkLocal, $"Parent mismatch: cDAC=0x{*ptk:X}, DAC=0x{tkLocal:X}"); 1197Debug.Assert(*pchMember == pchLocal, $"Name length mismatch: cDAC={*pchMember}, DAC={pchLocal}"); 1202Debug.Assert(cdacName == dacName, $"MemberRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1207Debug.Assert(*pbSig == cbSigLocal, $"SigBlob length mismatch: cDAC={*pbSig}, DAC={cbSigLocal}"); 1284Debug.ValidateHResult(hr, hrLegacy); 1288Debug.Assert(*pdwPackSize == packLocal, $"PackSize mismatch: cDAC={*pdwPackSize}, DAC={packLocal}"); 1290Debug.Assert(*pulClassSize == sizeLocal, $"ClassSize mismatch: cDAC={*pulClassSize}, DAC={sizeLocal}"); 1292Debug.Assert(*pcFieldOffset == fieldCountLocal, $"FieldOffset count mismatch: cDAC={*pcFieldOffset}, DAC={fieldCountLocal}"); 1329Debug.ValidateHResult(hr, hrLegacy); 1333Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 1338Debug.Assert(cdacName == dacName, $"ModuleRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1376Debug.ValidateHResult(hr, hrLegacy); 1382Debug.Assert(*pcbSig == cbLocal, $"Sig length mismatch: cDAC={*pcbSig}, DAC={cbLocal}"); 1452Debug.ValidateHResult(hr, hrLegacy); 1456Debug.Assert(*pchString == pchLocal, $"String length mismatch: cDAC={*pchString}, DAC={pchLocal}"); 1464Debug.Assert(cdacStr == dacStr, $"UserString content mismatch: cDAC='{cdacStr}', DAC='{dacStr}'"); 1522Debug.ValidateHResult(hr, hrLegacy); 1524Debug.Assert(*ppd == pdLocal, $"Param token mismatch: cDAC=0x{*ppd:X}, DAC=0x{pdLocal:X}"); 1602Debug.ValidateHResult(hr, hrLegacy); 1606Debug.Assert(*pmd == mdLocal, $"Method mismatch: cDAC=0x{*pmd:X}, DAC=0x{mdLocal:X}"); 1608Debug.Assert(*pulSequence == seqLocal, $"Sequence mismatch: cDAC={*pulSequence}, DAC={seqLocal}"); 1610Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}"); 1612Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 1617Debug.Assert(cdacName == dacName, $"Param name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1728Debug.ValidateHResult(hr, hrLegacy); 1732Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 1737Debug.Assert(cdacName == dacName, $"Assembly name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1740Debug.Assert(*pulHashAlgId == hashAlgLocal, $"HashAlgId mismatch: cDAC=0x{*pulHashAlgId:X}, DAC=0x{hashAlgLocal:X}"); 1742Debug.Assert(*pdwAssemblyFlags == flagsLocal, $"Flags mismatch: cDAC=0x{*pdwAssemblyFlags:X}, DAC=0x{flagsLocal:X}"); 1746Debug.Assert(*pcbPublicKey == cbPublicKeyLocal, $"PublicKey length mismatch: cDAC={*pcbPublicKey}, DAC={cbPublicKeyLocal}"); 1749Debug.Assert(pMetaData->usMajorVersion == metaLocal.usMajorVersion, $"MajorVersion mismatch: cDAC={pMetaData->usMajorVersion}, DAC={metaLocal.usMajorVersion}"); 1750Debug.Assert(pMetaData->usMinorVersion == metaLocal.usMinorVersion, $"MinorVersion mismatch: cDAC={pMetaData->usMinorVersion}, DAC={metaLocal.usMinorVersion}"); 1751Debug.Assert(pMetaData->usBuildNumber == metaLocal.usBuildNumber, $"BuildNumber mismatch: cDAC={pMetaData->usBuildNumber}, DAC={metaLocal.usBuildNumber}"); 1752Debug.Assert(pMetaData->usRevisionNumber == metaLocal.usRevisionNumber, $"RevisionNumber mismatch: cDAC={pMetaData->usRevisionNumber}, DAC={metaLocal.usRevisionNumber}"); 1839Debug.ValidateHResult(hr, hrLegacy); 1843Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}"); 1848Debug.Assert(cdacName == dacName, $"AssemblyRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1851Debug.Assert(*pdwAssemblyRefFlags == flagsLocal, $"Flags mismatch: cDAC=0x{*pdwAssemblyRefFlags:X}, DAC=0x{flagsLocal:X}"); 1855Debug.Assert(*pcbPublicKeyOrToken == cbPublicKeyLocal, $"PublicKey length mismatch: cDAC={*pcbPublicKeyOrToken}, DAC={cbPublicKeyLocal}"); 1859Debug.Assert(*pcbHashValue == cbHashLocal, $"Hash length mismatch: cDAC={*pcbHashValue}, DAC={cbHashLocal}"); 1862Debug.Assert(pMetaData->usMajorVersion == metaLocal.usMajorVersion, $"MajorVersion mismatch: cDAC={pMetaData->usMajorVersion}, DAC={metaLocal.usMajorVersion}"); 1863Debug.Assert(pMetaData->usMinorVersion == metaLocal.usMinorVersion, $"MinorVersion mismatch: cDAC={pMetaData->usMinorVersion}, DAC={metaLocal.usMinorVersion}"); 1864Debug.Assert(pMetaData->usBuildNumber == metaLocal.usBuildNumber, $"BuildNumber mismatch: cDAC={pMetaData->usBuildNumber}, DAC={metaLocal.usBuildNumber}"); 1865Debug.Assert(pMetaData->usRevisionNumber == metaLocal.usRevisionNumber, $"RevisionNumber mismatch: cDAC={pMetaData->usRevisionNumber}, DAC={metaLocal.usRevisionNumber}"); 1920Debug.ValidateHResult(hr, hrLegacy); 1927Debug.Assert(cdacName == dacName, $"ExportedType name mismatch: cDAC='{cdacName}', DAC='{dacName}'"); 1930Debug.Assert(*pchName == pchNameLocal, $"ExportedType name length mismatch: cDAC={*pchName}, DAC={pchNameLocal}"); 1932Debug.Assert(*ptkImplementation == tkImplementationLocal, $"ExportedType implementation mismatch: cDAC=0x{*ptkImplementation:X}, DAC=0x{tkImplementationLocal:X}"); 1934Debug.Assert(*ptkTypeDef == tkTypeDefLocal, $"ExportedType typeDef mismatch: cDAC=0x{*ptkTypeDef:X}, DAC=0x{tkTypeDefLocal:X}"); 1936Debug.Assert(*pdwExportedTypeFlags == dwExportedTypeFlagsLocal, $"ExportedType flags mismatch: cDAC=0x{*pdwExportedTypeFlags:X}, DAC=0x{dwExportedTypeFlagsLocal:X}"); 1970Debug.ValidateHResult(hr, hrLegacy); 1972Debug.Assert(*ptkAssembly == tkLocal, $"Assembly token mismatch: cDAC=0x{*ptkAssembly:X}, DAC=0x{tkLocal:X}"); 2026Debug.ValidateHResult(hr, hrLegacy); 2028Debug.Assert(*ptkExportedType == tkExportedTypeLocal, $"ExportedType mismatch: cDAC=0x{*ptkExportedType:X}, DAC=0x{tkExportedTypeLocal:X}"); 2071Debug.Assert(cdacLen == dacLen, $"{name} length mismatch: cDAC={cdacLen}, DAC={dacLen}"); 2076Debug.Assert(cdacSpan.SequenceEqual(dacSpan), $"{name} content mismatch (length={cdacLen})");
SOSDacImpl.cs (565)
105Debug.ValidateHResult(hr, hrLocal); 160Debug.ValidateHResult(hr, hrLocal); 163Debug.Assert(data->AppDomainPtr == dataLocal.AppDomainPtr); 164Debug.Assert(data->pHighFrequencyHeap == dataLocal.pHighFrequencyHeap); 165Debug.Assert(data->pLowFrequencyHeap == dataLocal.pLowFrequencyHeap); 166Debug.Assert(data->pStubHeap == dataLocal.pStubHeap); 167Debug.Assert(data->DomainLocalBlock == dataLocal.DomainLocalBlock); 168Debug.Assert(data->pDomainLocalModules == dataLocal.pDomainLocalModules); 169Debug.Assert(data->dwId == dataLocal.dwId); 170Debug.Assert(data->appDomainStage == dataLocal.appDomainStage); 171Debug.Assert(data->AssemblyCount == dataLocal.AssemblyCount); 172Debug.Assert(data->FailedAssemblyCount == dataLocal.FailedAssemblyCount); 208Debug.ValidateHResult(hr, hrLocal); 209Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 212Debug.Assert(values[0] == valuesLocal[0], $"cDAC: {values[0]:x}, DAC: {valuesLocal[0]:x}"); 278Debug.ValidateHResult(hr, hrLocal); 281Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 282Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name))); 309Debug.ValidateHResult(hr, hrLocal); 310Debug.Assert(appDomainStoreData->sharedDomain == dataLocal.sharedDomain, $"cDAC: {appDomainStoreData->sharedDomain:x}, DAC: {dataLocal.sharedDomain:x}"); 311Debug.Assert(appDomainStoreData->systemDomain == dataLocal.systemDomain, $"cDAC: {appDomainStoreData->systemDomain:x}, DAC: {dataLocal.systemDomain:x}"); 312Debug.Assert(appDomainStoreData->DomainCount == dataLocal.DomainCount, $"cDAC: {appDomainStoreData->DomainCount}, DAC: {dataLocal.DomainCount}"); 327Debug.ValidateHResult(hr, hrLocal); 371Debug.ValidateHResult(hr, hrLocal); 374Debug.Assert(data->AssemblyPtr == dataLocal.AssemblyPtr, $"cDAC: {data->AssemblyPtr:x}, DAC: {dataLocal.AssemblyPtr:x}"); 375Debug.Assert(data->ClassLoader == dataLocal.ClassLoader, $"cDAC: {data->ClassLoader:x}, DAC: {dataLocal.ClassLoader:x}"); 376Debug.Assert(data->ParentDomain == dataLocal.ParentDomain, $"cDAC: {data->ParentDomain:x}, DAC: {dataLocal.ParentDomain:x}"); 377Debug.Assert(data->DomainPtr == dataLocal.DomainPtr, $"cDAC: {data->DomainPtr:x}, DAC: {dataLocal.DomainPtr:x}"); 378Debug.Assert(data->AssemblySecDesc == dataLocal.AssemblySecDesc, $"cDAC: {data->AssemblySecDesc:x}, DAC: {dataLocal.AssemblySecDesc:x}"); 379Debug.Assert(data->isDynamic == dataLocal.isDynamic, $"cDAC: {data->isDynamic}, DAC: {dataLocal.isDynamic}"); 380Debug.Assert(data->ModuleCount == dataLocal.ModuleCount, $"cDAC: {data->ModuleCount}, DAC: {dataLocal.ModuleCount}"); 381Debug.Assert(data->LoadContext == dataLocal.LoadContext, $"cDAC: {data->LoadContext:x}, DAC: {dataLocal.LoadContext:x}"); 382Debug.Assert(data->isDomainNeutral == dataLocal.isDomainNeutral, $"cDAC: {data->isDomainNeutral}, DAC: {dataLocal.isDomainNeutral}"); 383Debug.Assert(data->dwLocationFlags == dataLocal.dwLocationFlags, $"cDAC: {data->dwLocationFlags:x}, DAC: {dataLocal.dwLocationFlags:x}"); 449Debug.ValidateHResult(hr, hrLocal); 452Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 459Debug.Assert(values[i] == valuesLocal![i], $"cDAC: {values[i]:x}, DAC: {valuesLocal[i]:x}"); 502Debug.ValidateHResult(hr, hrLocal); 505Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 508Debug.Assert(modules[0] == modulesLocal[0], $"cDAC: {modules[0]:x}, DAC: {modulesLocal[0]:x}"); 554Debug.ValidateHResult(hr, hrLocal); 557Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 558Debug.Assert(name == null || new ReadOnlySpan<char>(fileNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name))); 612Debug.ValidateHResult(hr, hrLocal); 615Debug.Assert(data->outerIUnknown == dataLocal.outerIUnknown, $"cDAC outerIUnknown: {data->outerIUnknown:x}, DAC: {dataLocal.outerIUnknown:x}"); 616Debug.Assert(data->managedObject == dataLocal.managedObject, $"cDAC managedObject: {data->managedObject:x}, DAC: {dataLocal.managedObject:x}"); 617Debug.Assert(data->handle == dataLocal.handle, $"cDAC handle: {data->handle:x}, DAC: {dataLocal.handle:x}"); 618Debug.Assert(data->ccwAddress == dataLocal.ccwAddress, $"cDAC ccwAddress: {data->ccwAddress:x}, DAC: {dataLocal.ccwAddress:x}"); 619Debug.Assert(data->refCount == dataLocal.refCount, $"cDAC refCount: {data->refCount}, DAC: {dataLocal.refCount}"); 620Debug.Assert(data->interfaceCount == dataLocal.interfaceCount, $"cDAC interfaceCount: {data->interfaceCount}, DAC: {dataLocal.interfaceCount}"); 621Debug.Assert(data->isNeutered == dataLocal.isNeutered, $"cDAC isNeutered: {data->isNeutered}, DAC: {dataLocal.isNeutered}"); 622Debug.Assert(data->jupiterRefCount == dataLocal.jupiterRefCount, $"cDAC jupiterRefCount: {data->jupiterRefCount}, DAC: {dataLocal.jupiterRefCount}"); 623Debug.Assert(data->isPegged == dataLocal.isPegged, $"cDAC isPegged: {data->isPegged}, DAC: {dataLocal.isPegged}"); 624Debug.Assert(data->isGlobalPegged == dataLocal.isGlobalPegged, $"cDAC isGlobalPegged: {data->isGlobalPegged}, DAC: {dataLocal.isGlobalPegged}"); 625Debug.Assert(data->hasStrongRef == dataLocal.hasStrongRef, $"cDAC hasStrongRef: {data->hasStrongRef}, DAC: {dataLocal.hasStrongRef}"); 626Debug.Assert(data->isExtendsCOMObject == dataLocal.isExtendsCOMObject, $"cDAC isExtendsCOMObject: {data->isExtendsCOMObject}, DAC: {dataLocal.isExtendsCOMObject}"); 627Debug.Assert(data->isAggregated == dataLocal.isAggregated, $"cDAC isAggregated: {data->isAggregated}, DAC: {dataLocal.isAggregated}"); 698Debug.ValidateHResult(hr, hrLocal); 701Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC count: {(pNeeded is null ? "null" : (*pNeeded).ToString())}, DAC count: {pNeededLocal}"); 706Debug.Assert(interfaces[i].methodTable == interfacesLocal![i].methodTable, $"cDAC methodTable[{i}]: {interfaces[i].methodTable:x}, DAC: {interfacesLocal[i].methodTable:x}"); 707Debug.Assert(interfaces[i].interfacePtr == interfacesLocal![i].interfacePtr, $"cDAC interfacePtr[{i}]: {interfaces[i].interfacePtr:x}, DAC: {interfacesLocal[i].interfacePtr:x}"); 708Debug.Assert(interfaces[i].comContext == interfacesLocal![i].comContext, $"cDAC comContext[{i}]: {interfaces[i].comContext:x}, DAC: {interfacesLocal[i].comContext:x}"); 754Debug.ValidateHResult(hr, hrLocal); 757Debug.Assert(new ReadOnlySpan<byte>(genericModeBlockLocal, 0, sizeOfGenericModeBlock).SequenceEqual(new Span<byte>(pGenericModeBlock, sizeOfGenericModeBlock))); 831Debug.ValidateHResult(hr, hrLocal); 834Debug.Assert(data->MethodDescPtr == dataLocal.MethodDescPtr, $"cDAC: {data->MethodDescPtr:x}, DAC: {dataLocal.MethodDescPtr:x}"); 835Debug.Assert(data->JITType == dataLocal.JITType, $"cDAC: {data->JITType}, DAC: {dataLocal.JITType}"); 836Debug.Assert(data->GCInfo == dataLocal.GCInfo, $"cDAC: {data->GCInfo:x}, DAC: {dataLocal.GCInfo:x}"); 837Debug.Assert(data->MethodStart == dataLocal.MethodStart, $"cDAC: {data->MethodStart:x}, DAC: {dataLocal.MethodStart:x}"); 838Debug.Assert(data->MethodSize == dataLocal.MethodSize, $"cDAC: {data->MethodSize}, DAC: {dataLocal.MethodSize}"); 839Debug.Assert(data->HotRegionSize == dataLocal.HotRegionSize, $"cDAC: {data->HotRegionSize}, DAC: {dataLocal.HotRegionSize}"); 840Debug.Assert(data->ColdRegionStart == dataLocal.ColdRegionStart, $"cDAC: {data->ColdRegionStart:x}, DAC: {dataLocal.ColdRegionStart:x}"); 841Debug.Assert(data->ColdRegionSize == dataLocal.ColdRegionSize, $"cDAC: {data->ColdRegionSize}, DAC: {dataLocal.ColdRegionSize}"); 859Debug.Assert(jitManager.ToTargetPointer(_target) == jitManagerInfo.ManagerAddress); 900Debug.ValidateHResult(hr, hrLocal); 905Debug.Assert(*pNeeded == neededLocal, $"cDAC count: {(*pNeeded):x}, DAC count: {neededLocal:x}"); 911Debug.Assert(codeHeaps[i].codeHeapType == legacyHeaps![i].codeHeapType, 914Debug.Assert(codeHeaps[i].LoaderHeap == legacyHeaps[i].LoaderHeap, 918Debug.Assert(codeHeaps[i].baseAddr == legacyHeaps[i].baseAddr, 920Debug.Assert(codeHeaps[i].currentAddr == legacyHeaps[i].currentAddr, 950Debug.ValidateHResult(hr, hrLocal); 953Debug.Assert(domainLocal == context, $"cDAC: {context:x}, DAC: {domainLocal:x}"); 968Debug.ValidateHResult(hr, hrLocal); 984Debug.ValidateHResult(hr, hrLocal); 999Debug.ValidateHResult(hr, hrLocal); 1039Debug.ValidateHResult(hr, hrLocal); 1042Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 1043Debug.Assert(location == null || new ReadOnlySpan<char>(locationLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(location))); 1155Debug.ValidateHResult(hr, hrLocal); 1158Debug.Assert(data->Type == dataLocal.Type, $"cDAC: {data->Type}, DAC: {dataLocal.Type}"); 1159Debug.Assert(data->sigType == dataLocal.sigType, $"cDAC: {data->sigType}, DAC: {dataLocal.sigType}"); 1160Debug.Assert(data->TokenOfType == dataLocal.TokenOfType, $"cDAC: {data->TokenOfType:x}, DAC: {dataLocal.TokenOfType:x}"); 1161Debug.Assert(data->MTOfType == dataLocal.MTOfType, $"cDAC: {data->MTOfType:x}, DAC: {dataLocal.MTOfType:x}"); 1162Debug.Assert(data->ModuleOfType == dataLocal.ModuleOfType, $"cDAC: {data->ModuleOfType:x}, DAC: {dataLocal.ModuleOfType:x}"); 1163Debug.Assert(data->mb == dataLocal.mb, $"cDAC: {data->mb:x}, DAC: {dataLocal.mb:x}"); 1164Debug.Assert(data->MTOfEnclosingClass == dataLocal.MTOfEnclosingClass, $"cDAC: {data->MTOfEnclosingClass:x}, DAC: {dataLocal.MTOfEnclosingClass:x}"); 1165Debug.Assert(data->dwOffset == dataLocal.dwOffset, $"cDAC: {data->dwOffset:x}, DAC: {dataLocal.dwOffset:x}"); 1166Debug.Assert(data->bIsThreadLocal == dataLocal.bIsThreadLocal, $"cDAC: {data->bIsThreadLocal}, DAC: {dataLocal.bIsThreadLocal}"); 1167Debug.Assert(data->bIsContextLocal == dataLocal.bIsContextLocal, $"cDAC: {data->bIsContextLocal}, DAC: {dataLocal.bIsContextLocal}"); 1168Debug.Assert(data->bIsStatic == dataLocal.bIsStatic, $"cDAC: {data->bIsStatic}, DAC: {dataLocal.bIsStatic}"); 1172Debug.Assert(data->NextField == dataLocal.NextField || data->NextField == 0, $"cDAC: {data->NextField:x}, DAC: {dataLocal.NextField:x}"); 1216Debug.ValidateHResult(hr, hrLocal); 1219Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 1220Debug.Assert(frameName == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal).SequenceEqual(new string(frameName)), 1261Debug.ValidateHResult(hr, hrLocal); 1264Debug.Assert(data->bServerMode == dataLocal.bServerMode, $"cDAC: {data->bServerMode}, DAC: {dataLocal.bServerMode}"); 1265Debug.Assert(data->bGcStructuresValid == dataLocal.bGcStructuresValid, $"cDAC: {data->bGcStructuresValid}, DAC: {dataLocal.bGcStructuresValid}"); 1266Debug.Assert(data->HeapCount == dataLocal.HeapCount, $"cDAC: {data->HeapCount}, DAC: {dataLocal.HeapCount}"); 1267Debug.Assert(data->g_max_generation == dataLocal.g_max_generation, $"cDAC: {data->g_max_generation}, DAC: {dataLocal.g_max_generation}"); 1298Debug.Assert(gcHeaps.Count == heapCount, "Expected the number of GC heaps to match the count returned by GetGCHeapCount"); 1321Debug.ValidateHResult(hr, hrLocal); 1324Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 1329Debug.Assert(heaps[i] == heapsLocal[i], $"cDAC: {heaps[i]:x}, DAC: {heapsLocal[i]:x}"); 1429Debug.ValidateHResult(hr, hrLocal); 1432Debug.Assert(details->heapAddr == detailsLocal.heapAddr, $"cDAC: {details->heapAddr:x}, DAC: {detailsLocal.heapAddr:x}"); 1433Debug.Assert(details->alloc_allocated == detailsLocal.alloc_allocated, $"cDAC: {details->alloc_allocated:x}, DAC: {detailsLocal.alloc_allocated:x}"); 1434Debug.Assert(details->mark_array == detailsLocal.mark_array, $"cDAC: {details->mark_array:x}, DAC: {detailsLocal.mark_array:x}"); 1435Debug.Assert(details->current_c_gc_state == detailsLocal.current_c_gc_state, $"cDAC: {details->current_c_gc_state:x}, DAC: {detailsLocal.current_c_gc_state:x}"); 1436Debug.Assert(details->next_sweep_obj == detailsLocal.next_sweep_obj, $"cDAC: {details->next_sweep_obj:x}, DAC: {detailsLocal.next_sweep_obj:x}"); 1437Debug.Assert(details->saved_sweep_ephemeral_seg == detailsLocal.saved_sweep_ephemeral_seg, $"cDAC: {details->saved_sweep_ephemeral_seg:x}, DAC: {detailsLocal.saved_sweep_ephemeral_seg:x}"); 1438Debug.Assert(details->saved_sweep_ephemeral_start == detailsLocal.saved_sweep_ephemeral_start, $"cDAC: {details->saved_sweep_ephemeral_start:x}, DAC: {detailsLocal.saved_sweep_ephemeral_start:x}"); 1439Debug.Assert(details->background_saved_lowest_address == detailsLocal.background_saved_lowest_address, $"cDAC: {details->background_saved_lowest_address:x}, DAC: {detailsLocal.background_saved_lowest_address:x}"); 1440Debug.Assert(details->background_saved_highest_address == detailsLocal.background_saved_highest_address, $"cDAC: {details->background_saved_highest_address:x}, DAC: {detailsLocal.background_saved_highest_address:x}"); 1445Debug.Assert(details->generation_table[i].start_segment == detailsLocal.generation_table[i].start_segment, $"cDAC gen[{i}].start_segment: {details->generation_table[i].start_segment:x}, DAC: {detailsLocal.generation_table[i].start_segment:x}"); 1446Debug.Assert(details->generation_table[i].allocation_start == detailsLocal.generation_table[i].allocation_start, $"cDAC gen[{i}].allocation_start: {details->generation_table[i].allocation_start:x}, DAC: {detailsLocal.generation_table[i].allocation_start:x}"); 1447Debug.Assert(details->generation_table[i].allocContextPtr == detailsLocal.generation_table[i].allocContextPtr, $"cDAC gen[{i}].allocContextPtr: {details->generation_table[i].allocContextPtr:x}, DAC: {detailsLocal.generation_table[i].allocContextPtr:x}"); 1448Debug.Assert(details->generation_table[i].allocContextLimit == detailsLocal.generation_table[i].allocContextLimit, $"cDAC gen[{i}].allocContextLimit: {details->generation_table[i].allocContextLimit:x}, DAC: {detailsLocal.generation_table[i].allocContextLimit:x}"); 1451Debug.Assert(details->ephemeral_heap_segment == detailsLocal.ephemeral_heap_segment, $"cDAC: {details->ephemeral_heap_segment:x}, DAC: {detailsLocal.ephemeral_heap_segment:x}"); 1456Debug.Assert(details->finalization_fill_pointers[i] == detailsLocal.finalization_fill_pointers[i], $"cDAC finalization_fill_pointers[{i}]: {details->finalization_fill_pointers[i]:x}, DAC: {detailsLocal.finalization_fill_pointers[i]:x}"); 1459Debug.Assert(details->lowest_address == detailsLocal.lowest_address, $"cDAC: {details->lowest_address:x}, DAC: {detailsLocal.lowest_address:x}"); 1460Debug.Assert(details->highest_address == detailsLocal.highest_address, $"cDAC: {details->highest_address:x}, DAC: {detailsLocal.highest_address:x}"); 1461Debug.Assert(details->card_table == detailsLocal.card_table, $"cDAC: {details->card_table:x}, DAC: {detailsLocal.card_table:x}"); 1562Debug.ValidateHResult(hr, hrLocal); 1565Debug.Assert(details->heapAddr == detailsLocal.heapAddr, $"cDAC: {details->heapAddr:x}, DAC: {detailsLocal.heapAddr:x}"); 1566Debug.Assert(details->alloc_allocated == detailsLocal.alloc_allocated, $"cDAC: {details->alloc_allocated:x}, DAC: {detailsLocal.alloc_allocated:x}"); 1567Debug.Assert(details->mark_array == detailsLocal.mark_array, $"cDAC: {details->mark_array:x}, DAC: {detailsLocal.mark_array:x}"); 1568Debug.Assert(details->current_c_gc_state == detailsLocal.current_c_gc_state, $"cDAC: {details->current_c_gc_state:x}, DAC: {detailsLocal.current_c_gc_state:x}"); 1569Debug.Assert(details->next_sweep_obj == detailsLocal.next_sweep_obj, $"cDAC: {details->next_sweep_obj:x}, DAC: {detailsLocal.next_sweep_obj:x}"); 1570Debug.Assert(details->saved_sweep_ephemeral_seg == detailsLocal.saved_sweep_ephemeral_seg, $"cDAC: {details->saved_sweep_ephemeral_seg:x}, DAC: {detailsLocal.saved_sweep_ephemeral_seg:x}"); 1571Debug.Assert(details->saved_sweep_ephemeral_start == detailsLocal.saved_sweep_ephemeral_start, $"cDAC: {details->saved_sweep_ephemeral_start:x}, DAC: {detailsLocal.saved_sweep_ephemeral_start:x}"); 1572Debug.Assert(details->background_saved_lowest_address == detailsLocal.background_saved_lowest_address, $"cDAC: {details->background_saved_lowest_address:x}, DAC: {detailsLocal.background_saved_lowest_address:x}"); 1573Debug.Assert(details->background_saved_highest_address == detailsLocal.background_saved_highest_address, $"cDAC: {details->background_saved_highest_address:x}, DAC: {detailsLocal.background_saved_highest_address:x}"); 1578Debug.Assert(details->generation_table[i].start_segment == detailsLocal.generation_table[i].start_segment, $"cDAC gen[{i}].start_segment: {details->generation_table[i].start_segment:x}, DAC: {detailsLocal.generation_table[i].start_segment:x}"); 1579Debug.Assert(details->generation_table[i].allocation_start == detailsLocal.generation_table[i].allocation_start, $"cDAC gen[{i}].allocation_start: {details->generation_table[i].allocation_start:x}, DAC: {detailsLocal.generation_table[i].allocation_start:x}"); 1580Debug.Assert(details->generation_table[i].allocContextPtr == detailsLocal.generation_table[i].allocContextPtr, $"cDAC gen[{i}].allocContextPtr: {details->generation_table[i].allocContextPtr:x}, DAC: {detailsLocal.generation_table[i].allocContextPtr:x}"); 1581Debug.Assert(details->generation_table[i].allocContextLimit == detailsLocal.generation_table[i].allocContextLimit, $"cDAC gen[{i}].allocContextLimit: {details->generation_table[i].allocContextLimit:x}, DAC: {detailsLocal.generation_table[i].allocContextLimit:x}"); 1584Debug.Assert(details->ephemeral_heap_segment == detailsLocal.ephemeral_heap_segment, $"cDAC: {details->ephemeral_heap_segment:x}, DAC: {detailsLocal.ephemeral_heap_segment:x}"); 1589Debug.Assert(details->finalization_fill_pointers[i] == detailsLocal.finalization_fill_pointers[i], $"cDAC finalization_fill_pointers[{i}]: {details->finalization_fill_pointers[i]:x}, DAC: {detailsLocal.finalization_fill_pointers[i]:x}"); 1592Debug.Assert(details->lowest_address == detailsLocal.lowest_address, $"cDAC: {details->lowest_address:x}, DAC: {detailsLocal.lowest_address:x}"); 1593Debug.Assert(details->highest_address == detailsLocal.highest_address, $"cDAC: {details->highest_address:x}, DAC: {detailsLocal.highest_address:x}"); 1594Debug.Assert(details->card_table == detailsLocal.card_table, $"cDAC: {details->card_table:x}, DAC: {detailsLocal.card_table:x}"); 1670Debug.ValidateHResult(hr, hrLocal); 1673Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}"); 1676Debug.Assert(handles[i].AppDomain == handlesLocal[i].AppDomain, $"cDAC: {handles[i].AppDomain:x}, DAC: {handlesLocal[i].AppDomain:x}"); 1677Debug.Assert(handles[i].Handle == handlesLocal[i].Handle, $"cDAC: {handles[i].Handle:x}, DAC: {handlesLocal[i].Handle:x}"); 1678Debug.Assert(handles[i].Secondary == handlesLocal[i].Secondary, $"cDAC: {handles[i].Secondary:x}, DAC: {handlesLocal[i].Secondary:x}"); 1679Debug.Assert(handles[i].Type == handlesLocal[i].Type, $"cDAC: {handles[i].Type}, DAC: {handlesLocal[i].Type}"); 1680Debug.Assert(handles[i].StrongReference == handlesLocal[i].StrongReference, $"cDAC: {handles[i].StrongReference}, DAC: {handlesLocal[i].StrongReference}"); 1681Debug.Assert(handles[i].RefCount == handlesLocal[i].RefCount, $"cDAC: {handles[i].RefCount}, DAC: {handlesLocal[i].RefCount}"); 1682Debug.Assert(handles[i].JupiterRefCount == handlesLocal[i].JupiterRefCount, $"cDAC: {handles[i].JupiterRefCount}, DAC: {handlesLocal[i].JupiterRefCount}"); 1683Debug.Assert(handles[i].IsPegged == handlesLocal[i].IsPegged, $"cDAC: {handles[i].IsPegged}, DAC: {handlesLocal[i].IsPegged}"); 1716Debug.Assert(countLocal == (uint)_handles.Length); 1777Debug.ValidateHResult(hr, hrLocal); 1780Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}"); 1783Debug.Assert(memRegions[i].Start == regionsLocal[i].Start, $"cDAC: {memRegions[i].Start:x}, DAC: {regionsLocal[i].Start:x}"); 1784Debug.Assert(memRegions[i].Size == regionsLocal[i].Size, $"cDAC: {memRegions[i].Size:x}, DAC: {regionsLocal[i].Size:x}"); 1785Debug.Assert(memRegions[i].ExtraData == regionsLocal[i].ExtraData, $"cDAC: {memRegions[i].ExtraData:x}, DAC: {regionsLocal[i].ExtraData:x}"); 1786Debug.Assert(memRegions[i].Heap == regionsLocal[i].Heap, $"cDAC: {memRegions[i].Heap}, DAC: {regionsLocal[i].Heap}"); 1822Debug.Assert(countLocal == (uint)_regions.Length); 1842Debug.ValidateHResult(hr, hrLocal); 1867Debug.ValidateHResult(hr, hrLocal); 1915Debug.ValidateHResult(hr, hrLocal); 1918Debug.Assert(data->heapAddr == dataLocal.heapAddr, $"cDAC: {data->heapAddr:x}, DAC: {dataLocal.heapAddr:x}"); 1919Debug.Assert(data->internal_root_array == dataLocal.internal_root_array, $"cDAC: {data->internal_root_array:x}, DAC: {dataLocal.internal_root_array:x}"); 1920Debug.Assert(data->internal_root_array_index == dataLocal.internal_root_array_index, $"cDAC: {data->internal_root_array_index}, DAC: {dataLocal.internal_root_array_index}"); 1921Debug.Assert(data->heap_analyze_success == dataLocal.heap_analyze_success, $"cDAC: {data->heap_analyze_success}, DAC: {dataLocal.heap_analyze_success}"); 1961Debug.ValidateHResult(hr, hrLocal); 1964Debug.Assert(data->heapAddr == dataLocal.heapAddr, $"cDAC: {data->heapAddr:x}, DAC: {dataLocal.heapAddr:x}"); 1965Debug.Assert(data->internal_root_array == dataLocal.internal_root_array, $"cDAC: {data->internal_root_array:x}, DAC: {dataLocal.internal_root_array:x}"); 1966Debug.Assert(data->internal_root_array_index == dataLocal.internal_root_array_index, $"cDAC: {data->internal_root_array_index}, DAC: {dataLocal.internal_root_array_index}"); 1967Debug.Assert(data->heap_analyze_success == dataLocal.heap_analyze_success, $"cDAC: {data->heap_analyze_success}, DAC: {dataLocal.heap_analyze_success}"); 2022Debug.ValidateHResult(hr, hrLocal); 2025Debug.Assert(data->segmentAddr == dataLocal.segmentAddr, $"segmentAddr - cDAC: {data->segmentAddr:x}, DAC: {dataLocal.segmentAddr:x}"); 2026Debug.Assert(data->allocated == dataLocal.allocated, $"allocated - cDAC: {data->allocated:x}, DAC: {dataLocal.allocated:x}"); 2027Debug.Assert(data->committed == dataLocal.committed, $"committed - cDAC: {data->committed:x}, DAC: {dataLocal.committed:x}"); 2028Debug.Assert(data->reserved == dataLocal.reserved, $"reserved - cDAC: {data->reserved:x}, DAC: {dataLocal.reserved:x}"); 2029Debug.Assert(data->used == dataLocal.used, $"used - cDAC: {data->used:x}, DAC: {dataLocal.used:x}"); 2030Debug.Assert(data->mem == dataLocal.mem, $"mem - cDAC: {data->mem:x}, DAC: {dataLocal.mem:x}"); 2031Debug.Assert(data->next == dataLocal.next, $"next - cDAC: {data->next:x}, DAC: {dataLocal.next:x}"); 2032Debug.Assert(data->gc_heap == dataLocal.gc_heap, $"gc_heap - cDAC: {data->gc_heap:x}, DAC: {dataLocal.gc_heap:x}"); 2033Debug.Assert(data->highAllocMark == dataLocal.highAllocMark, $"highAllocMark - cDAC: {data->highAllocMark:x}, DAC: {dataLocal.highAllocMark:x}"); 2034Debug.Assert(data->flags == dataLocal.flags, $"flags - cDAC: {data->flags:x}, DAC: {dataLocal.flags:x}"); 2035Debug.Assert(data->background_allocated == dataLocal.background_allocated, $"background_allocated - cDAC: {data->background_allocated:x}, DAC: {dataLocal.background_allocated:x}"); 2052Debug.ValidateHResult(hr, hrLocal); 2081Debug.ValidateHResult(hr, hrLocal); 2084Debug.Assert(*il == ilLocal, $"cDAC: {*il:x}, DAC: {ilLocal:x}"); 2119Debug.ValidateHResult(hr, hrLocal); 2122Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 2123Debug.Assert(name == null || new ReadOnlySpan<byte>(name, (int)neededLocal).SequenceEqual(nameLocal!.AsSpan(0, (int)neededLocal))); 2162Debug.ValidateHResult(hr, hrLocal); 2165Debug.Assert(managers->managerAddr == managerLocal.managerAddr); 2166Debug.Assert(managers->codeType == managerLocal.codeType); 2167Debug.Assert(managers->ptrHeapList == managerLocal.ptrHeapList); 2174Debug.ValidateHResult(hr, hrLocal); 2177Debug.Assert(*pNeeded == neededLocal); 2193Debug.Assert(IsJumpRel64(pThunk), "Expected a jump thunk"); 2237Debug.ValidateHResult(hr, hrLocal); 2240Debug.Assert(*targetIP == targetIPLocal, $"cDAC: {*targetIP:x}, DAC: {targetIPLocal:x}"); 2241Debug.Assert(*targetMD == targetMDLocal, $"cDAC: {*targetMD:x}, DAC: {targetMDLocal:x}"); 2349Debug.Assert(data->rejitDataRequested.rejitID == 0); 2455Debug.ValidateHResult(hr, hrLocal); 2458Debug.Assert(data->bHasNativeCode == dataLocal.bHasNativeCode, $"cDAC: {data->bHasNativeCode}, DAC: {dataLocal.bHasNativeCode}"); 2459Debug.Assert(data->bIsDynamic == dataLocal.bIsDynamic, $"cDAC: {data->bIsDynamic}, DAC: {dataLocal.bIsDynamic}"); 2460Debug.Assert(data->wSlotNumber == dataLocal.wSlotNumber, $"cDAC: {data->wSlotNumber}, DAC: {dataLocal.wSlotNumber}"); 2461Debug.Assert(data->NativeCodeAddr == dataLocal.NativeCodeAddr, $"cDAC: {data->NativeCodeAddr:x}, DAC: {dataLocal.NativeCodeAddr:x}"); 2462Debug.Assert(data->AddressOfNativeCodeSlot == dataLocal.AddressOfNativeCodeSlot, $"cDAC: {data->AddressOfNativeCodeSlot:x}, DAC: {dataLocal.AddressOfNativeCodeSlot:x}"); 2463Debug.Assert(data->MethodDescPtr == dataLocal.MethodDescPtr, $"cDAC: {data->MethodDescPtr:x}, DAC: {dataLocal.MethodDescPtr:x}"); 2464Debug.Assert(data->MethodTablePtr == dataLocal.MethodTablePtr, $"cDAC: {data->MethodTablePtr:x}, DAC: {dataLocal.MethodTablePtr:x}"); 2465Debug.Assert(data->ModulePtr == dataLocal.ModulePtr, $"cDAC: {data->ModulePtr:x}, DAC: {dataLocal.ModulePtr:x}"); 2466Debug.Assert(data->MDToken == dataLocal.MDToken, $"cDAC: {data->MDToken:x}, DAC: {dataLocal.MDToken:x}"); 2467Debug.Assert(data->GCInfo == dataLocal.GCInfo, $"cDAC: {data->GCInfo:x}, DAC: {dataLocal.GCInfo:x}"); 2468Debug.Assert(data->GCStressCodeCopy == dataLocal.GCStressCodeCopy, $"cDAC: {data->GCStressCodeCopy:x}, DAC: {dataLocal.GCStressCodeCopy:x}"); 2470Debug.Assert(data->managedDynamicMethodObject == 0); 2471Debug.Assert(data->requestedIP == dataLocal.requestedIP, $"cDAC: {data->requestedIP:x}, DAC: {dataLocal.requestedIP:x}"); 2472Debug.Assert(data->cJittedRejitVersions == dataLocal.cJittedRejitVersions, $"cDAC: {data->cJittedRejitVersions}, DAC: {dataLocal.cJittedRejitVersions}"); 2475Debug.Assert(data->rejitDataCurrent.rejitID == dataLocal.rejitDataCurrent.rejitID, $"cDAC: {data->rejitDataCurrent.rejitID}, DAC: {dataLocal.rejitDataCurrent.rejitID}"); 2476Debug.Assert(data->rejitDataCurrent.NativeCodeAddr == dataLocal.rejitDataCurrent.NativeCodeAddr, $"cDAC: {data->rejitDataCurrent.NativeCodeAddr:x}, DAC: {dataLocal.rejitDataCurrent.NativeCodeAddr:x}"); 2477Debug.Assert(data->rejitDataCurrent.flags == dataLocal.rejitDataCurrent.flags, $"cDAC: {data->rejitDataCurrent.flags}, DAC: {dataLocal.rejitDataCurrent.flags}"); 2480Debug.Assert(data->rejitDataRequested.rejitID == dataLocal.rejitDataRequested.rejitID, $"cDAC: {data->rejitDataRequested.rejitID}, DAC: {dataLocal.rejitDataRequested.rejitID}"); 2481Debug.Assert(data->rejitDataRequested.NativeCodeAddr == dataLocal.rejitDataRequested.NativeCodeAddr, $"cDAC: {data->rejitDataRequested.NativeCodeAddr:x}, DAC: {dataLocal.rejitDataRequested.NativeCodeAddr:x}"); 2482Debug.Assert(data->rejitDataRequested.flags == dataLocal.rejitDataRequested.flags, $"cDAC: {data->rejitDataRequested.flags}, DAC: {dataLocal.rejitDataRequested.flags}"); 2487Debug.Assert(cNeededRevertedRejitDataLocal == *pcNeededRevertedRejitData, $"cDAC: {*pcNeededRevertedRejitData}, DAC: {cNeededRevertedRejitDataLocal}"); 2490Debug.Assert(rgRevertedRejitData[i].rejitID == rgRevertedRejitDataLocal[i].rejitID, $"cDAC: {rgRevertedRejitData[i].rejitID}, DAC: {rgRevertedRejitDataLocal[i].rejitID}"); 2491Debug.Assert(rgRevertedRejitData[i].NativeCodeAddr == rgRevertedRejitDataLocal[i].NativeCodeAddr, $"cDAC: {rgRevertedRejitData[i].NativeCodeAddr:x}, DAC: {rgRevertedRejitDataLocal[i].NativeCodeAddr:x}"); 2492Debug.Assert(rgRevertedRejitData[i].flags == rgRevertedRejitDataLocal[i].flags, $"cDAC: {rgRevertedRejitData[i].flags}, DAC: {rgRevertedRejitDataLocal[i].flags}"); 2541Debug.Fail("Unknown RejitState. cDAC should be updated to understand this new state."); 2586Debug.ValidateHResult(hr, hrLocal); 2589Debug.Assert(*methodDesc == methodDescLocal, $"cDAC: {*methodDesc:x}, DAC: {methodDescLocal:x}"); 2673Debug.ValidateHResult(hr, hrLocal); 2676Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 2677Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name)), $"cDAC: {new string(name)}, DAC: {new string(nameLocal, 0, (int)neededLocal - 1)}"); 2710Debug.ValidateHResult(hr, hrLocal); 2713Debug.Assert(*ppMD == ppMDLocal); 2761Debug.ValidateHResult(hr, hrLocal); 2764Debug.Assert(*ppMD == ppMDLocal); 2844Debug.ValidateHResult(hr, hrLocal); 2847Debug.Assert(data->module == dataLocal.module); 2848Debug.Assert(data->klass == dataLocal.klass); 2849Debug.Assert(data->parentMethodTable == dataLocal.parentMethodTable); 2850Debug.Assert(data->wNumInterfaces == dataLocal.wNumInterfaces); 2851Debug.Assert(data->wNumMethods == dataLocal.wNumMethods); 2852Debug.Assert(data->wNumVtableSlots == dataLocal.wNumVtableSlots); 2853Debug.Assert(data->wNumVirtuals == dataLocal.wNumVirtuals); 2854Debug.Assert(data->cl == dataLocal.cl); 2855Debug.Assert(data->dwAttrClass == dataLocal.dwAttrClass); 2856Debug.Assert(data->bContainsGCPointers == dataLocal.bContainsGCPointers); 2857Debug.Assert(data->bIsShared == dataLocal.bIsShared); 2858Debug.Assert(data->bIsDynamic == dataLocal.bIsDynamic); 2892Debug.ValidateHResult(hr, hrLocal); 2895Debug.Assert(data->wNumInstanceFields == mtFieldDataLocal.wNumInstanceFields); 2896Debug.Assert(data->wNumStaticFields == mtFieldDataLocal.wNumStaticFields); 2897Debug.Assert(data->wNumThreadStaticFields == mtFieldDataLocal.wNumThreadStaticFields); 2898Debug.Assert(data->wContextStaticOffset == mtFieldDataLocal.wContextStaticOffset); 2899Debug.Assert(data->wContextStaticsSize == mtFieldDataLocal.wContextStaticsSize); 2927Debug.ValidateHResult(hr, hrLocal); 2929Debug.Assert(*value == valueLocal); 2993Debug.ValidateHResult(hr, hrLocal); 2996Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 2997Debug.Assert(mtName == null || new ReadOnlySpan<char>(mtNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(mtName))); 3063Debug.ValidateHResult(hr, hrLocal); 3066Debug.Assert(*value == valueLocal, $"cDAC: {*value:x}, DAC: {valueLocal:x}"); 3174Debug.ValidateHResult(hr, hrLocal); 3177Debug.Assert(data->Address == dataLocal.Address); 3178Debug.Assert(data->PEAssembly == dataLocal.PEAssembly); 3179Debug.Assert(data->Assembly == dataLocal.Assembly); 3180Debug.Assert(data->isReflection == dataLocal.isReflection); 3181Debug.Assert(data->isPEFile == dataLocal.isPEFile); 3182Debug.Assert(data->dwTransientFlags == dataLocal.dwTransientFlags); 3183Debug.Assert(data->ilBase == dataLocal.ilBase); 3184Debug.Assert(data->metadataStart == dataLocal.metadataStart); 3185Debug.Assert(data->metadataSize == dataLocal.metadataSize); 3186Debug.Assert(data->LoaderAllocator == dataLocal.LoaderAllocator); 3187Debug.Assert(data->ThunkHeap == dataLocal.ThunkHeap); 3188Debug.Assert(data->FieldDefToDescMap == dataLocal.FieldDefToDescMap); 3189Debug.Assert(data->ManifestModuleReferencesMap == dataLocal.ManifestModuleReferencesMap); 3190Debug.Assert(data->MemberRefToDescMap == dataLocal.MemberRefToDescMap); 3191Debug.Assert(data->MethodDefToDescMap == dataLocal.MethodDefToDescMap); 3192Debug.Assert(data->TypeDefToMethodTableMap == dataLocal.TypeDefToMethodTableMap); 3193Debug.Assert(data->TypeRefToMethodTableMap == dataLocal.TypeRefToMethodTableMap); 3194Debug.Assert(data->dwModuleID == dataLocal.dwModuleID); 3195Debug.Assert(data->dwBaseClassIndex == dataLocal.dwBaseClassIndex); 3196Debug.Assert(data->dwModuleIndex == dataLocal.dwModuleIndex); 3229Debug.ValidateHResult(hr, hrLocal); 3232Debug.Assert(*exceptionObject == exceptionObjectLocal); 3233Debug.Assert(*nextNestedException == nextNestedExceptionLocal); 3302Debug.ValidateHResult(hr, hrLocal); 3305Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 3306Debug.Assert(className == null || new ReadOnlySpan<char>(classNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(className))); 3401Debug.ValidateHResult(hr, hrLocal); 3404Debug.Assert(data->MethodTable == dataLocal.MethodTable); 3405Debug.Assert(data->ObjectType == dataLocal.ObjectType); 3406Debug.Assert(data->Size == dataLocal.Size); 3407Debug.Assert(data->ElementTypeHandle == dataLocal.ElementTypeHandle); 3408Debug.Assert(data->ElementType == dataLocal.ElementType); 3409Debug.Assert(data->dwRank == dataLocal.dwRank); 3410Debug.Assert(data->dwNumComponents == dataLocal.dwNumComponents); 3411Debug.Assert(data->dwComponentSize == dataLocal.dwComponentSize); 3412Debug.Assert(data->ArrayDataPtr == dataLocal.ArrayDataPtr); 3413Debug.Assert(data->ArrayBoundsPtr == dataLocal.ArrayBoundsPtr); 3414Debug.Assert(data->ArrayLowerBoundsPtr == dataLocal.ArrayLowerBoundsPtr); 3415Debug.Assert(data->RCW == dataLocal.RCW); 3416Debug.Assert(data->CCW == dataLocal.CCW); 3455Debug.ValidateHResult(hr, hrLocal); 3458Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 3461Debug.Assert(stringData == null || new ReadOnlySpan<char>(stringDataLocal, 0, new string(stringData).Length).SequenceEqual(new string(stringData))); 3504Debug.ValidateHResult(hr, hrLocal); 3507Debug.Assert(data->reason == dataLocal.reason, $"cDAC: {data->reason}, DAC: {dataLocal.reason}"); 3508Debug.Assert(data->alloc_size == dataLocal.alloc_size, $"cDAC: {data->alloc_size}, DAC: {dataLocal.alloc_size}"); 3509Debug.Assert(data->available_pagefile_mb == dataLocal.available_pagefile_mb, $"cDAC: {data->available_pagefile_mb}, DAC: {dataLocal.available_pagefile_mb}"); 3510Debug.Assert(data->gc_index == dataLocal.gc_index, $"cDAC: {data->gc_index}, DAC: {dataLocal.gc_index}"); 3511Debug.Assert(data->fgm == dataLocal.fgm, $"cDAC: {data->fgm}, DAC: {dataLocal.fgm}"); 3512Debug.Assert(data->size == dataLocal.size, $"cDAC: {data->size}, DAC: {dataLocal.size}"); 3513Debug.Assert(data->loh_p == dataLocal.loh_p, $"cDAC: {data->loh_p}, DAC: {dataLocal.loh_p}"); 3554Debug.ValidateHResult(hr, hrLocal); 3557Debug.Assert(data->reason == dataLocal.reason, $"cDAC: {data->reason}, DAC: {dataLocal.reason}"); 3558Debug.Assert(data->alloc_size == dataLocal.alloc_size, $"cDAC: {data->alloc_size}, DAC: {dataLocal.alloc_size}"); 3559Debug.Assert(data->available_pagefile_mb == dataLocal.available_pagefile_mb, $"cDAC: {data->available_pagefile_mb}, DAC: {dataLocal.available_pagefile_mb}"); 3560Debug.Assert(data->gc_index == dataLocal.gc_index, $"cDAC: {data->gc_index}, DAC: {dataLocal.gc_index}"); 3561Debug.Assert(data->fgm == dataLocal.fgm, $"cDAC: {data->fgm}, DAC: {dataLocal.fgm}"); 3562Debug.Assert(data->size == dataLocal.size, $"cDAC: {data->size}, DAC: {dataLocal.size}"); 3563Debug.Assert(data->loh_p == dataLocal.loh_p, $"cDAC: {data->loh_p}, DAC: {dataLocal.loh_p}"); 3600Debug.ValidateHResult(hr, hrLocal); 3602Debug.Assert(*peBase == peBaseLocal); 3645Debug.ValidateHResult(hr, hrLocal); 3648Debug.Assert(pNeeded == null || *pNeeded == neededLocal); 3649Debug.Assert(fileName == null || new ReadOnlySpan<char>(fileNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(fileName))); 3665Debug.ValidateHResult(hr, hrLocal); 3707Debug.ValidateHResult(hr, hrLocal); 3710Debug.Assert(data->identityPointer == dataLocal.identityPointer, $"cDAC: {data->identityPointer:x}, DAC: {dataLocal.identityPointer:x}"); 3711Debug.Assert(data->unknownPointer == dataLocal.unknownPointer, $"cDAC: {data->unknownPointer:x}, DAC: {dataLocal.unknownPointer:x}"); 3712Debug.Assert(data->managedObject == dataLocal.managedObject, $"cDAC: {data->managedObject:x}, DAC: {dataLocal.managedObject:x}"); 3713Debug.Assert(data->vtablePtr == dataLocal.vtablePtr, $"cDAC: {data->vtablePtr:x}, DAC: {dataLocal.vtablePtr:x}"); 3714Debug.Assert(data->creatorThread == dataLocal.creatorThread, $"cDAC: {data->creatorThread:x}, DAC: {dataLocal.creatorThread:x}"); 3715Debug.Assert(data->ctxCookie == dataLocal.ctxCookie, $"cDAC: {data->ctxCookie:x}, DAC: {dataLocal.ctxCookie:x}"); 3716Debug.Assert(data->refCount == dataLocal.refCount, $"cDAC: {data->refCount}, DAC: {dataLocal.refCount}"); 3717Debug.Assert(data->interfaceCount == dataLocal.interfaceCount, $"cDAC: {data->interfaceCount}, DAC: {dataLocal.interfaceCount}"); 3718Debug.Assert(data->isAggregated == dataLocal.isAggregated, $"cDAC: {data->isAggregated}, DAC: {dataLocal.isAggregated}"); 3719Debug.Assert(data->isContained == dataLocal.isContained, $"cDAC: {data->isContained}, DAC: {dataLocal.isContained}"); 3720Debug.Assert(data->isFreeThreaded == dataLocal.isFreeThreaded, $"cDAC: {data->isFreeThreaded}, DAC: {dataLocal.isFreeThreaded}"); 3721Debug.Assert(data->isDisconnected == dataLocal.isDisconnected, $"cDAC: {data->isDisconnected}, DAC: {dataLocal.isDisconnected}"); 3796Debug.ValidateHResult(hr, hrLocal); 3799Debug.Assert(numWritten == pNeededLocal, $"cDAC: {numWritten}, DAC: {pNeededLocal}"); 3804Debug.Assert(interfaces[i].methodTable == interfacesLocal![i].methodTable, $"cDAC: {interfaces[i].methodTable:x}, DAC: {interfacesLocal[i].methodTable:x}"); 3805Debug.Assert(interfaces[i].interfacePtr == interfacesLocal![i].interfacePtr, $"cDAC: {interfaces[i].interfacePtr:x}, DAC: {interfacesLocal[i].interfacePtr:x}"); 3806Debug.Assert(interfaces[i].comContext == interfacesLocal![i].comContext, $"cDAC: {interfaces[i].comContext:x}, DAC: {interfacesLocal[i].comContext:x}"); 3870Debug.ValidateHResult(hr, hrLocal); 3873Debug.Assert(pNeeded is null || *pNeeded == neededLocal); 3874Debug.Assert(buffer is null || new ReadOnlySpan<char>(bufferLocal, 0, (int)Math.Min(count, neededLocal)).SequenceEqual(new ReadOnlySpan<char>(buffer, (int)Math.Min(count, neededLocal)))); 3962Debug.ValidateHResult(hr, hrLocal); 3965Debug.Assert(lower == null || *lower == lowerLocal, $"cDAC: {*lower:x}, DAC: {lowerLocal:x}"); 3966Debug.Assert(upper == null || *upper == upperLocal, $"cDAC: {*upper:x}, DAC: {upperLocal:x}"); 3967Debug.Assert(fp == null || *fp == fpLocal, $"cDAC: {*fp:x}, DAC: {fpLocal:x}"); 4102Debug.ValidateHResult(hr, hrLocal); 4116Debug.Assert(HResults.S_OK == _legacyImpl.GetStressLogAddress(&legacyStressLog)); 4117Debug.Assert(legacyStressLog == stressLogAddress); 4170Debug.ValidateHResult(hr, hrLocal); 4173Debug.Assert(data->SyncBlockPointer == dataLocal.SyncBlockPointer, $"cDAC: {data->SyncBlockPointer:x}, DAC: {dataLocal.SyncBlockPointer:x}"); 4174Debug.Assert(data->nextSyncBlock == dataLocal.nextSyncBlock, $"cDAC: {data->nextSyncBlock:x}, DAC: {dataLocal.nextSyncBlock:x}"); 4175Debug.Assert(data->blockRCW == dataLocal.blockRCW, $"cDAC: {data->blockRCW:x}, DAC: {dataLocal.blockRCW:x}"); 4176Debug.Assert(data->blockClassFactory == dataLocal.blockClassFactory, $"cDAC: {data->blockClassFactory:x}, DAC: {dataLocal.blockClassFactory:x}"); 4177Debug.Assert(data->blockCCW == dataLocal.blockCCW, $"cDAC: {data->blockCCW:x}, DAC: {dataLocal.blockCCW:x}"); 4241Debug.ValidateHResult(hr, hrLocal); 4244Debug.Assert(data->Object == dataLocal.Object, $"cDAC: {data->Object:x}, DAC: {dataLocal.Object:x}"); 4245Debug.Assert(data->bFree == dataLocal.bFree, $"cDAC: {data->bFree}, DAC: {dataLocal.bFree}"); 4246Debug.Assert(data->SyncBlockPointer == dataLocal.SyncBlockPointer, $"cDAC: {data->SyncBlockPointer:x}, DAC: {dataLocal.SyncBlockPointer:x}"); 4247Debug.Assert(data->COMFlags == dataLocal.COMFlags, $"cDAC: {data->COMFlags}, DAC: {dataLocal.COMFlags}"); 4248Debug.Assert(data->MonitorHeld == dataLocal.MonitorHeld, $"cDAC: {data->MonitorHeld}, DAC: {dataLocal.MonitorHeld}"); 4251Debug.Assert(data->Recursion == dataLocal.Recursion, $"cDAC: {data->Recursion}, DAC: {dataLocal.Recursion}"); 4252Debug.Assert(data->HoldingThread == dataLocal.HoldingThread, $"cDAC: {data->HoldingThread:x}, DAC: {dataLocal.HoldingThread:x}"); 4254Debug.Assert(data->AdditionalThreadCount == dataLocal.AdditionalThreadCount, $"cDAC: {data->AdditionalThreadCount}, DAC: {dataLocal.AdditionalThreadCount}"); 4255Debug.Assert(data->appDomainPtr == dataLocal.appDomainPtr, $"cDAC: {data->appDomainPtr:x}, DAC: {dataLocal.appDomainPtr:x}"); 4256Debug.Assert(data->SyncBlockCount == dataLocal.SyncBlockCount, $"cDAC: {data->SyncBlockCount}, DAC: {dataLocal.SyncBlockCount}"); 4288Debug.ValidateHResult(hr, hrLocal); 4291Debug.Assert(data->allocBytes == dataLocal.allocBytes, $"cDAC: {data->allocBytes:x}, DAC: {dataLocal.allocBytes:x}"); 4292Debug.Assert(data->allocBytesLoh == dataLocal.allocBytesLoh, $"cDAC: {data->allocBytesLoh:x}, DAC: {dataLocal.allocBytesLoh:x}"); 4337Debug.ValidateHResult(hr, hrLocal); 4340Debug.Assert(data->corThreadId == dataLocal.corThreadId, $"cDAC: {data->corThreadId}, DAC: {dataLocal.corThreadId}"); 4341Debug.Assert(data->osThreadId == dataLocal.osThreadId, $"cDAC: {data->osThreadId}, DAC: {dataLocal.osThreadId}"); 4347Debug.Assert(data->state == (dataLocal.state & wrappedStateMask), $"cDAC: {data->state}, DAC: {dataLocal.state & wrappedStateMask}"); 4348Debug.Assert(data->preemptiveGCDisabled == dataLocal.preemptiveGCDisabled, $"cDAC: {data->preemptiveGCDisabled}, DAC: {dataLocal.preemptiveGCDisabled}"); 4349Debug.Assert(data->allocContextPtr == dataLocal.allocContextPtr, $"cDAC: {data->allocContextPtr:x}, DAC: {dataLocal.allocContextPtr:x}"); 4350Debug.Assert(data->allocContextLimit == dataLocal.allocContextLimit, $"cDAC: {data->allocContextLimit:x}, DAC: {dataLocal.allocContextLimit:x}"); 4351Debug.Assert(data->fiberData == dataLocal.fiberData, $"cDAC: {data->fiberData:x}, DAC: {dataLocal.fiberData:x}"); 4352Debug.Assert(data->context == dataLocal.context, $"cDAC: {data->context:x}, DAC: {dataLocal.context:x}"); 4353Debug.Assert(data->domain == dataLocal.domain, $"cDAC: {data->domain:x}, DAC: {dataLocal.domain:x}"); 4354Debug.Assert(data->lockCount == dataLocal.lockCount, $"cDAC: {data->lockCount}, DAC: {dataLocal.lockCount}"); 4355Debug.Assert(data->pFrame == dataLocal.pFrame, $"cDAC: {data->pFrame:x}, DAC: {dataLocal.pFrame:x}"); 4356Debug.Assert(data->firstNestedException == dataLocal.firstNestedException, $"cDAC: {data->firstNestedException:x}, DAC: {dataLocal.firstNestedException:x}"); 4357Debug.Assert(data->lastThrownObjectHandle == dataLocal.lastThrownObjectHandle, $"cDAC: {data->lastThrownObjectHandle:x}, DAC: {dataLocal.lastThrownObjectHandle:x}"); 4358Debug.Assert(data->nextThread == dataLocal.nextThread, $"cDAC: {data->nextThread:x}, DAC: {dataLocal.nextThread:x}"); 4383Debug.ValidateHResult(hr, hrLocal); 4386Debug.Assert(*pThread == pThreadLocal); 4401Debug.ValidateHResult(hr, hrLocal); 4417Debug.ValidateHResult(hr, hrLocal); 4456Debug.ValidateHResult(hr, hrLocal); 4459Debug.Assert(data->threadCount == dataLocal.threadCount); 4460Debug.Assert(data->firstThread == dataLocal.firstThread); 4461Debug.Assert(data->finalizerThread == dataLocal.finalizerThread); 4462Debug.Assert(data->gcThread == dataLocal.gcThread); 4463Debug.Assert(data->unstartedThreadCount == dataLocal.unstartedThreadCount); 4464Debug.Assert(data->backgroundThreadCount == dataLocal.backgroundThreadCount); 4465Debug.Assert(data->pendingThreadCount == dataLocal.pendingThreadCount); 4466Debug.Assert(data->deadThreadCount == dataLocal.deadThreadCount); 4467Debug.Assert(data->fHostConfig == dataLocal.fHostConfig); 4495Debug.ValidateHResult(hr, hrLocal); 4498Debug.Assert(*pIndex == indexLocal); 4545Debug.Assert(data->ArrayMethodTable == dataLocal.ArrayMethodTable); 4546Debug.Assert(data->StringMethodTable == dataLocal.StringMethodTable); 4547Debug.Assert(data->ObjectMethodTable == dataLocal.ObjectMethodTable); 4548Debug.Assert(data->ExceptionMethodTable == dataLocal.ExceptionMethodTable); 4549Debug.Assert(data->FreeMethodTable == dataLocal.FreeMethodTable); 4565Debug.ValidateHResult(hr, hrLocal); 4592Debug.Assert(clauseIndex < totalClauses, $"Invalid clause index {clauseIndex} of {totalClauses}"); 4596Debug.Assert(pEHInfo->clauseType == expectedEhClause.clauseType, $"cDAC: {expectedEhClause.clauseType}, DAC: {pEHInfo->clauseType}"); 4597Debug.Assert(pEHInfo->tryStartOffset == expectedEhClause.tryStartOffset, $"cDAC: {expectedEhClause.tryStartOffset:x}, DAC: {pEHInfo->tryStartOffset:x}"); 4598Debug.Assert(pEHInfo->tryEndOffset == expectedEhClause.tryEndOffset, $"cDAC: {expectedEhClause.tryEndOffset:x}, DAC: {pEHInfo->tryEndOffset:x}"); 4599Debug.Assert(pEHInfo->handlerStartOffset == expectedEhClause.handlerStartOffset, $"cDAC: {expectedEhClause.handlerStartOffset:x}, DAC: {pEHInfo->handlerStartOffset:x}"); 4600Debug.Assert(pEHInfo->handlerEndOffset == expectedEhClause.handlerEndOffset, $"cDAC: {expectedEhClause.handlerEndOffset:x}, DAC: {pEHInfo->handlerEndOffset:x}"); 4601Debug.Assert(pEHInfo->isDuplicateClause == expectedEhClause.isDuplicateClause, $"cDAC: {expectedEhClause.isDuplicateClause}, DAC: {pEHInfo->isDuplicateClause}"); 4602Debug.Assert(pEHInfo->filterOffset == expectedEhClause.filterOffset, $"cDAC: {expectedEhClause.filterOffset:x}, DAC: {pEHInfo->filterOffset:x}"); 4603Debug.Assert(pEHInfo->isCatchAllHandler == expectedEhClause.isCatchAllHandler, $"cDAC: {expectedEhClause.isCatchAllHandler}, DAC: {pEHInfo->isCatchAllHandler}"); 4604Debug.Assert(pEHInfo->moduleAddr == expectedEhClause.moduleAddr, $"cDAC: {expectedEhClause.moduleAddr:x}, DAC: {pEHInfo->moduleAddr:x}"); 4605Debug.Assert(pEHInfo->mtCatch == expectedEhClause.mtCatch, $"cDAC: {expectedEhClause.mtCatch:x}, DAC: {pEHInfo->mtCatch:x}"); 4606Debug.Assert(pEHInfo->tokCatch == expectedEhClause.tokCatch, $"cDAC: {expectedEhClause.tokCatch:x}, DAC: {pEHInfo->tokCatch:x}"); 4610Debug.Fail($"Received unexpected clause index {clauseIndex} of {totalClauses}"); 4697Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.Exact); 4723Debug.Assert(found, $"Unexpected loader heap block: address={virtualAddress:x}, size={virtualSize:x}"); 4782Debug.ValidateHResult(hr, hrLocal); 4785Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 4787Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount, 4806Debug.Assert(false, $"Unexpected module address {moduleAddr:x} at index {index}"); 4852Debug.ValidateHResult(hr, hrLocal); 4853Debug.Assert(expectedElements[default] == elements.Count(), $"cDAC: {elements.Count()} elements, DAC: {expectedElements[default]} elements"); 4870Debug.Fail($"Unexpected RCW address {rcwAddr:x} or context {ctx:x}"); 4912Debug.ValidateHResult(hr, hrLocal); 4913Debug.Assert(expectedElements[default] == (ulong)cleanupInfos.Count(), $"cDAC: {cleanupInfos.Count()} elements, DAC: {expectedElements[default]} elements"); 4958Debug.ValidateHResult(hr, hrLocal); 4961Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 4963Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount, 5021Debug.ValidateHResult(hr, hrLocal); 5024Debug.Assert(*inDCOMProxy == inDCOMProxyLocal); 5064Debug.ValidateHResult(hr, hrLocal); 5106Debug.ValidateHResult(hr, hrLocal); 5148Debug.Assert(cdacData->interestingDataPoints[i] == legacyData->interestingDataPoints[i], 5155Debug.Assert(cdacData->compactReasons[i] == legacyData->compactReasons[i], 5162Debug.Assert(cdacData->expandMechanisms[i] == legacyData->expandMechanisms[i], 5169Debug.Assert(cdacData->bitMechanisms[i] == legacyData->bitMechanisms[i], 5176Debug.Assert(cdacData->globalMechanisms[i] == legacyData->globalMechanisms[i], 5218Debug.ValidateHResult(hr, hrLocal); 5223Debug.Assert(globalMechanisms[i] == globalMechanismsLocal[i], 5263Debug.ValidateHResult(hr, hrLocal); 5266Debug.Assert(*pNeeded == neededLocal); 5269Debug.Assert(arguments[i] == argumentsLocal[i]); 5391Debug.ValidateHResult(hr, hrLocal); 5394Debug.Assert(*pcNativeCodeAddrs == legacyCount, $"cDAC count: {*pcNativeCodeAddrs}, DAC count: {legacyCount}"); 5399Debug.Assert(nativeCodeAddrs[i].nativeCodeAddr == legacyBuffer[i].nativeCodeAddr, 5401Debug.Assert(nativeCodeAddrs[i].nativeCodeVersionNodePtr == legacyBuffer[i].nativeCodeVersionNodePtr, 5403Debug.Assert(nativeCodeAddrs[i].optimizationTier == legacyBuffer[i].optimizationTier, 5447Debug.ValidateHResult(hr, hrLocal); 5450Debug.Assert((data->bCollectible == 0) == (dataLocal.bCollectible == 0), $"cDAC: {data->bCollectible}, DAC: {dataLocal.bCollectible}"); 5451Debug.Assert(data->LoaderAllocatorObjectHandle == dataLocal.LoaderAllocatorObjectHandle, $"cDAC: {data->LoaderAllocatorObjectHandle:x}, DAC: {dataLocal.LoaderAllocatorObjectHandle:x}"); 5494Debug.ValidateHResult(hr, hrLocal); 5497Debug.Assert(*pRejitId == rejitIdLocal); 5532Debug.Assert(true, "Unknown SharedRejitInfo state. cDAC should be updated to understand this new state."); 5552Debug.ValidateHResult(hr, hrLocal); 5555Debug.Assert(pRejitData->rejitID == rejitDataLocal.rejitID); 5556Debug.Assert(pRejitData->il == rejitDataLocal.il); 5557Debug.Assert(pRejitData->flags == rejitDataLocal.flags); 5558Debug.Assert(pRejitData->ilCodeVersionNodePtr == rejitDataLocal.ilCodeVersionNodePtr); 5613Debug.ValidateHResult(hr, hrLocal); 5616Debug.Assert(pILData->type == ilDataLocal.type, $"cDAC: {pILData->type}, DAC: {ilDataLocal.type}"); 5617Debug.Assert(pILData->rejitID == ilDataLocal.rejitID, $"cDAC: {pILData->rejitID}, DAC: {ilDataLocal.rejitID}"); 5618Debug.Assert(pILData->il == ilDataLocal.il, $"cDAC: {pILData->il:x}, DAC: {ilDataLocal.il:x}"); 5681Debug.ValidateHResult(hr, hrLocal); 5684Debug.Assert(*pcMethodDescs == pcMethodDescsLocal, $"cDAC: {*pcMethodDescs}, DAC: {pcMethodDescsLocal}"); 5687Debug.Assert(methodDescs[i] == methodDescsLocal[i], $"cDAC: {methodDescs[i]:x}, DAC: {methodDescsLocal[i]:x}"); 5722Debug.ValidateHResult(hr, hrLocal); 5725Debug.Assert(*pGenerations == pGenerationsLocal); 5780Debug.ValidateHResult(hr, hrLocal); 5783Debug.Assert(*pNeeded == pNeededLocal); 5789Debug.Assert(pGenDataLocal[i].start_segment == pGenerationData[i].start_segment); 5790Debug.Assert(pGenDataLocal[i].allocation_start == pGenerationData[i].allocation_start); 5791Debug.Assert(pGenDataLocal[i].allocContextPtr == pGenerationData[i].allocContextPtr); 5792Debug.Assert(pGenDataLocal[i].allocContextLimit == pGenerationData[i].allocContextLimit); 5845Debug.ValidateHResult(hr, hrLocal); 5848Debug.Assert(*pNeeded == pNeededLocal); 5854Debug.Assert(pFillPointersLocal[i] == pFinalizationFillPointers[i]); 5911Debug.ValidateHResult(hr, hrLocal); 5914Debug.Assert(*pNeeded == pNeededLocal); 5920Debug.Assert(pGenDataLocal[i].start_segment == pGenerationData[i].start_segment); 5921Debug.Assert(pGenDataLocal[i].allocation_start == pGenerationData[i].allocation_start); 5922Debug.Assert(pGenDataLocal[i].allocContextPtr == pGenerationData[i].allocContextPtr); 5923Debug.Assert(pGenDataLocal[i].allocContextLimit == pGenerationData[i].allocContextLimit); 5976Debug.ValidateHResult(hr, hrLocal); 5979Debug.Assert(*pNeeded == pNeededLocal); 5986Debug.Assert(pFillPointersLocal[i] == pFinalizationFillPointers[i]); 6019Debug.ValidateHResult(hr, hrLocal); 6022Debug.Assert(*assemblyLoadContext == assemblyLoadContextLocal); 6038Debug.Assert(version == _legacyImpl9.GetBreakingChangeVersion()); 6100Debug.ValidateHResult(hr, hrLocal); 6104Debug.Assert(*rcw == rcwLocal); 6106Debug.Assert(*pNeeded == neededLocal); 6111Debug.Assert(mowList[i] == mowListLocal![i]); 6144Debug.ValidateHResult(hr, hrLocal); 6147Debug.Assert(*isComWrappersCCW == isComWrappersCCWLocal); 6185Debug.ValidateHResult(hr, hrLocal); 6189Debug.Assert(*managedObject == managedObjectLocal); 6191Debug.Assert(*refCount == refCountLocal); 6226Debug.ValidateHResult(hr, hrLocal); 6229Debug.Assert(*isComWrappersRCW == isComWrappersRCWLocal); 6260Debug.ValidateHResult(hr, hrLocal); 6263Debug.Assert(*identity == identityLocal); 6314Debug.ValidateHResult(hr, hrLocal); 6317Debug.Assert(*isTrackedType == isTrackedTypeLocal); 6318Debug.Assert(*hasTaggedMemory == hasTaggedMemoryLocal); 6358Debug.ValidateHResult(hr, hrLocal); 6361Debug.Assert(*taggedMemory == taggedMemoryLocal); 6362Debug.Assert(*taggedMemorySizeInBytes == taggedMemorySizeInBytesLocal); 6395Debug.ValidateHResult(hr, hrLocal); 6398Debug.Assert(*allocPtr == allocPtrLocal); 6399Debug.Assert(*allocLimit == allocLimitLocal); 6418Debug.ValidateHResult(hr, hrLocal); 6421Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0, 6423Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount, 6461Debug.ValidateHResult(hr, hrLocal); 6464Debug.Assert(*pLoaderAllocator == pLoaderAllocatorLocal); 6555Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC needed: {(pNeeded != null ? *pNeeded : -1)}, DAC needed: {pNeededLocal}"); 6565Debug.Assert(cdacName == dacName, $"HeapName[{i}] - cDAC: {cdacName}, DAC: {dacName}"); 6612Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC needed: {(pNeeded != null ? *pNeeded : -1)}, DAC needed: {pNeededLocal}"); 6618Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}"); 6623Debug.Assert(pLoaderHeaps[i] == pLoaderHeapsLocal[i], $"Heap[{i}] - cDAC: {pLoaderHeaps[i]:x}, DAC: {pLoaderHeapsLocal[i]:x}"); 6624Debug.Assert(pKinds[i] == pKindsLocal[i], $"Kind[{i}] - cDAC: {pKinds[i]}, DAC: {pKindsLocal[i]}"); 6645Debug.ValidateHResult(hr, hrLocal); 6670Debug.ValidateHResult(hr, hrLocal); 6695Debug.ValidateHResult(hr, hrLocal); 6748Debug.ValidateHResult(hr, hrLocal); 6752Debug.Assert(*GCStaticsAddress == GCStaticsAddressLocal); 6754Debug.Assert(*nonGCStaticsAddress == nonGCStaticsAddressLocal); 6802Debug.ValidateHResult(hr, hrLocal); 6806Debug.Assert(*nonGCStaticsAddress == nonGCStaticsAddressLocal); 6808Debug.Assert(*GCStaticsAddress == GCStaticsAddressLocal); 6842Debug.ValidateHResult(hr, hrLocal); 6845Debug.Assert(*initializationStatus == initializationStatusLocal); 6973Debug.ValidateHResult(hr, hrLocal); 6976Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}"); 6979Debug.Assert(values[i].MethodDesc == valuesLocal[i].MethodDesc, $"cDAC: {values[i].MethodDesc:x}, DAC: {valuesLocal[i].MethodDesc:x}"); 6980Debug.Assert(values[i].DefiningMethodTable == valuesLocal[i].DefiningMethodTable, $"cDAC: {values[i].DefiningMethodTable:x}, DAC: {valuesLocal[i].DefiningMethodTable:x}"); 6981Debug.Assert(values[i].DefiningModule == valuesLocal[i].DefiningModule, $"cDAC: {values[i].DefiningModule:x}, DAC: {valuesLocal[i].DefiningModule:x}"); 6982Debug.Assert(values[i].Token == valuesLocal[i].Token, $"cDAC: {values[i].Token}, DAC: {valuesLocal[i].Token}"); 6983Debug.Assert(values[i].Entrypoint == valuesLocal[i].Entrypoint, $"cDAC: {values[i].Entrypoint:x}, DAC: {valuesLocal[i].Entrypoint:x}"); 6984Debug.Assert(values[i].Slot == valuesLocal[i].Slot, $"cDAC: {values[i].Slot}, DAC: {valuesLocal[i].Slot}"); 7023Debug.Assert(countLocal == (uint)_methods.Count); 7054Debug.ValidateHResult(hr, hrLocal); 7101Debug.ValidateHResult(hr, hrLocal); 7104Debug.Assert(pDynamicAdaptationMode == null || *pDynamicAdaptationMode == dynamicAdaptationModeLocal);
SOSDacImpl.IXCLRDataProcess.cs (28)
167Debug.ValidateHResult(hr, hrLocal); 219Debug.ValidateHResult(hr, hrLocal); 222Debug.Assert(*type == typeLocal, $"cDAC: {*type}, DAC: {typeLocal}"); 326Debug.ValidateHResult(hr, hrLocal); 329Debug.Assert(nameLen is null || *nameLen == nameLenLocal); 332Debug.Assert(new ReadOnlySpan<char>(nameBuf, (int)nameLenLocal) 337Debug.Assert(*displacement == displacementLocal); 422Debug.ValidateHResult(hr, hrLocal); 473Debug.ValidateHResult(hr, hrLocal); 539Debug.ValidateHResult(hr, hrLocal); 595Debug.ValidateHResult(hr, hrLocal); 645Debug.ValidateHResult(hr, hrLocal); 726Debug.ValidateHResult(hr, hrLocal); 992Debug.ValidateHResult(hr, hrLocal); 1038Debug.ValidateHResult(hr, hrLocal); 1080Debug.ValidateHResult(hr, hrLocal); 1254Debug.ValidateHResult(hr, hrLocal); 1257Debug.Assert(outBufferSize == sizeof(uint) && outBuffer is not null); 1260Debug.Assert(revision == legacyRevision); 1455Debug.ValidateHResult(hr, hrLocal); 1456Debug.Assert(*flags == flagsLocal); 1500Debug.ValidateHResult(hr, hrLocal); 1503Debug.Assert(flags == flagsLocal); 1567Debug.ValidateHResult(hr, hrLocal); 1633Debug.ValidateHResult(hr, hrLocal); 1666Debug.ValidateHResult(hr, hrLocal); 1735Debug.ValidateHResult(hr, hrLocal); 1759Debug.ValidateHResult(hr, hrLocal);
TypeHandleExtensions.cs (1)
76Debug.Assert(isGenericVariable);
Microsoft.Diagnostics.NETCore.Client (10)
DiagnosticsClient\DiagnosticsClientConnector.cs (1)
86Debug.Assert(portConfig.IsConnectConfig);
DiagnosticsClient\EventPipeSession.cs (1)
168Debug.Assert(_sessionId > 0);
DiagnosticsIpc\IpcHeader.cs (2)
43Debug.Assert(Magic.Length == MagicSizeInBytes); 73Debug.Assert(bufferStream.Position == bufferStream.Length);
DiagnosticsIpc\IpcSocket.cs (1)
43Debug.Fail("Token should have thrown cancellation exception.");
DiagnosticsServerRouter\DiagnosticsServerRouterFactory.cs (1)
359Debug.Assert(!string.IsNullOrEmpty(webSocketURL));
HandleableCollection.cs (1)
267Debug.Assert(Monitor.IsEntered(_items));
ReversedServer\ReversedDiagnosticsServer.cs (3)
119Debug.Fail(ex.Message); 132Debug.Fail(ex.Message); 402Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows), "Pipe stream should only be used on Windows.");
Microsoft.DiaSymReader (20)
Metadata\SymReaderMetadataAdapter.cs (1)
26Debug.Assert(metadataProvider != null);
Metadata\SymWriterMetadataAdapter.cs (7)
27Debug.Assert(metadataProvider != null); 47Debug.Assert(baseType == null); 100Debug.Assert(attributes == null); 101Debug.Assert(signature == null); 102Debug.Assert(signatureLength == null); 103Debug.Assert(relativeVirtualAddress == null); 104Debug.Assert(implAttributes == null);
Reader\SymUnmanagedReaderFactory.cs (1)
61Debug.Assert(loadException != null);
Utilities\ComStreamWrapper.cs (3)
30Debug.Assert(stream != null); 31Debug.Assert(stream.CanSeek); 54Debug.Assert(count > 0);
Utilities\InteropUtilities.cs (3)
29Debug.Assert(nameStr != null); 78Debug.Assert(dst <= dstEndPtr); 92Debug.Assert(buffer[buffer.Length - 1] == 0);
Writer\SymUnmanagedWriterFactory.cs (1)
51Debug.Assert(loadException != null);
Writer\SymUnmanagedWriterImpl.cs (4)
31Debug.Assert(pdbStream != null); 32Debug.Assert(symWriter != null); 33Debug.Assert(symWriterModuleName != null); 368Debug.Assert(value != null);
Microsoft.DotNet.ApiCompatibility (6)
Mapping\TypeMapper.cs (1)
40Debug.Assert(ContainingType.ShouldDiffMembers);
Rules\CannotChangeGenericConstraints.cs (1)
80Debug.Assert(leftTypeParameters.Length == rightTypeParameters.Length);
Rules\CannotChangeParameterName.cs (1)
31Debug.Assert(leftMethod.Parameters.Length == rightMethod.Parameters.Length);
Rules\RuleRunner.cs (2)
63Debug.Assert(mm.ContainingType.Left != null); 64Debug.Assert(mm.ContainingType.Right[rightIndex] != null);
Runner\ApiCompatRunner.cs (1)
126Debug.Assert(assemblySymbols.Count == metadataInformation.Count);
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.Cli.Telemetry (5)
Implementation\PersistentStorageTelemetryUploader.cs (1)
117Debug.Fail(e.ToString());
PersistentStorageLogExporter.cs (2)
73Debug.Fail(e.ToString()); 118Debug.Fail(e.ToString());
PersistentStorageTraceExporter.cs (2)
76Debug.Fail(e.ToString()); 126Debug.Fail(e.ToString());
Microsoft.DotNet.Cli.Utils (5)
BufferScope.cs (1)
100Debug.Assert(capacity > _span.Length);
Command.cs (1)
71Debug.Assert(sw is not null);
MSBuildForwardingAppWithoutLogging.cs (1)
128Debug.Assert(_forwardingApp != null, "Can't get ProcessStartInfo when not executing out-of-proc");
UILanguageOverride.cs (1)
131Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Uuid.cs (1)
32Debug.Assert(hashResult.Length >= 16);
Microsoft.DotNet.HotReload.Watch (38)
AppModels\BlazorWebAssemblyAppModel.cs (1)
24Debug.Assert(browserRefreshServer != null);
AppModels\BlazorWebAssemblyHostedAppModel.cs (1)
26Debug.Assert(browserRefreshServer != null);
Aspire\AspireServiceFactory.cs (2)
136Debug.Assert(writeResult); 172Debug.Assert(_sessions.ContainsKey(sessionId) == isRestart);
Browser\BrowserLauncher.cs (1)
80Debug.Assert(server != null);
Build\EvaluationResult.cs (3)
167Debug.Assert(buildResult.IsSuccess); 170Debug.Assert(projectInstance != null); 173Debug.Assert(
Build\ProjectBuildManager.cs (1)
40Debug.Assert(requests is not []);
Context\EnvironmentOptions.cs (1)
86Debug.Assert(Path.GetFileName(path) == $"dotnet{PathUtilities.ExecutableExtension}");
FileWatcher\FileWatcher.cs (2)
72Debug.Assert(containingDirectories || !includeSubdirectories); 122Debug.Assert(fileNames.IsEmpty);
FileWatcher\PollingDirectoryWatcher.cs (3)
89Debug.Assert(_currentSnapshot.Count == 0); 96Debug.Assert(_changesBuilder.Count == 0); 97Debug.Assert(_snapshotBuilder.Count == 0);
HotReload\HotReloadDotNetWatcher.cs (7)
288Debug.Assert(mainRunningProject != null); 642Debug.Assert(!dirUrl.EndsWith('/')); 643Debug.Assert(!pattern.BaseUrl.EndsWith('/')); 991Debug.Assert(projects.Any()); 1074Debug.Assert(frameworkSelector != null); 1096Debug.Assert(deviceSelector != null); 1097Debug.Assert(projectGraph != null);
HotReload\ProjectUpdatesBuilder.cs (2)
197Debug.Assert(projectsWithPath.All(p => string.Equals(p.GetTargetFramework(), projectsWithPath[0].GetTargetFramework(), StringComparison.OrdinalIgnoreCase))); 206Debug.Assert(project.FilePath != null);
HotReload\RunningProjectsManager.cs (3)
107Debug.Assert(processTask.IsCompleted && processTask.Result == int.MinValue); 175Debug.Assert(disposables.Items is []); 303Debug.Assert(runningProject.Clients.IsManagedAgentSupported);
src\sdk\src\Dotnet.Watch\AspireService\Models\RunSessionRequest.cs (1)
68Debug.Assert(LaunchConfigurations.Length == 1, $"Unexpected number of launch configurations {LaunchConfigurations.Length}");
src\sdk\src\Dotnet.Watch\HotReloadClient\HotReloadClients.cs (6)
136Debug.Assert(IsManagedAgentSupported); 162Debug.Assert(IsManagedAgentSupported); 179Debug.Assert(browserRefreshServer != null); 184Debug.Assert(IsManagedAgentSupported); 208Debug.Assert(IsManagedAgentSupported); 209Debug.Assert(!useRefreshServerToApplyStaticAssets);
src\sdk\src\Dotnet.Watch\HotReloadClient\Web\StaticWebAssetUpdateBuilder.cs (1)
107Debug.Assert(staticWebAssetRelativeUrl != null);
UI\IReporter.cs (3)
297Debug.Assert(format is null == level is LogLevel.None); 306Debug.Assert(actualArity == expectedArity, $"Arguments of format string '{format}' do not match the specified type: {typeof(TArgs)} (actual arity: {actualArity}, expected arity: {expectedArity})"); 314Debug.Assert(Format != null);
Microsoft.DotNet.HotReload.WebAssembly.Browser (5)
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (5)
122Debug.Assert(Capabilities.Length > 0); 123Debug.Assert(_applyUpdate != null); 234Debug.Assert(updatedType >> 24 == 0x02); 255Debug.Assert(_applyUpdate != null); 316Debug.Assert(!string.IsNullOrEmpty(environment), $"{nameof(environment)} must be set");
Microsoft.DotNet.NativeWrapper (1)
NETCoreSdkResolverNativeWrapper.cs (1)
20Debug.Assert((errorCode == 0) == (result.ResolvedSdkDirectory != null));
Microsoft.DotNet.PackageValidation (2)
ApiCompatRunnerExtensions.cs (2)
25Debug.Assert(leftContentItems.Count > 0); 26Debug.Assert(rightContentItems.Count > 0);
Microsoft.DotNet.ProjectTools (17)
LaunchSettings\LaunchSettings.cs (1)
32Debug.Assert(buildPathContainer != null);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\FileLevelDirectiveHelpers.cs (7)
105Debug.Assert(previousWhiteSpaceSpan.IsEmpty); 134Debug.Assert(!(parts.Length > 2)); 355Debug.Assert(secondPart.Length == 0, 749Debug.Assert(ItemType is null); 926Debug.Assert(NamedDirectiveComparer.Instance.Equals(existingDirective, directive)); 927Debug.Assert(existingDirective is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package); 928Debug.Assert(directive is CSharpDirective.Sdk or CSharpDirective.Property or CSharpDirective.Package);
src\sdk\src\Cli\Microsoft.DotNet.FileBasedPrograms\VirtualProjectBuilder.cs (9)
70Debug.Assert(ExternalHelpers.IsPathFullyQualified(entryPointFileFullPath)); 402Debug.Assert(compileItem.Length == 1); 537Debug.Assert(refDirective.ResolvedPath is not null); 599Debug.Assert(userSecretsId == null || !isVirtualProject); 628Debug.Assert(!string.IsNullOrWhiteSpace(artifactsPath)); 629Debug.Assert(entryPointFilePath is not null); 922Debug.Assert(processedDirectives + directives.OfType<CSharpDirective.Shebang>().Count() == directives.Length); 926Debug.Assert(entryPointFilePath is not null); 957Debug.Assert(firstSdkName == defaultSdkName && firstSdkVersion == null);
Microsoft.DotNet.SdkResolver (1)
VSSettings.cs (1)
85Debug.Assert(_settingsFilePath != null);
Microsoft.DotNet.StrongName (1)
Utils.cs (1)
286Debug.Assert(segment.Count > 0);
Microsoft.DotNet.XliffTasks (1)
Release.cs (1)
13Debug.Assert(condition);
Microsoft.Extensions.AI (24)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\AnonymousDelegatingChatClient.cs (2)
120Debug.Assert(_getStreamingResponseFunc is not null, "Expected non-null streaming delegate."); 184Debug.Assert(_getResponseFunc is not null, "Expected non-null non-streaming delegate.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\ChatClientStructuredOutputExtensions.cs (1)
153Debug.Assert(responseFormat.Schema is not null, "ForJsonSchema should always populate Schema");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\FunctionInvokingChatClient.cs (6)
427Debug.Assert(responseMessages is not null, "Expected to only be here if we have response messages."); 609Debug.Assert(functionCallContents is { Count: > 0 }, "Expected to have function call contents to check for approval requiring functions."); 610Debug.Assert(approvalRequiredFunctions is { Length: > 0 }, "Expected to have approval requiring functions to check against function call contents."); 1170Debug.Assert(functionCallContents.Count > 0, "Expected at least one function call."); 1670Debug.Assert(functionCallContents is not null, "functionCallContents must not be null here, since we have already encountered approval requiring functionCallContents"); 1776Debug.Assert(allFunctionCallContentIndices is not null, "We have already encountered function call contents that require approval.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\OpenTelemetryChatClient.cs (3)
57Debug.Assert(innerClient is not null, "Should have been validated by the base ctor"); 225Debug.Assert(stopwatch is not null, "stopwatch should have been initialized when recordChunkHistograms is true"); 253Debug.Assert(stopwatch is not null, "stopwatch should have been initialized when activity is not null");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatCompletion\OpenTelemetryImageGenerator.cs (1)
49Debug.Assert(innerGenerator is not null, "Should have been validated by the base ctor");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatReduction\SummarizingChatReducer.cs (1)
126Debug.Assert(indexOfFirstMessageToKeep > 0, "Expected positive index for first message to keep.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatRouting\FailoverChatClientAttempt.cs (4)
40Debug.Assert(duration >= TimeSpan.Zero, "Expected a non-negative duration."); 41Debug.Assert( 44Debug.Assert( 47Debug.Assert(
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\ChatRouting\OrderedFailoverChatClient.cs (1)
98Debug.Assert(exception is not null, "A nonterminal update always reports a failed invocation.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Embeddings\CachingEmbeddingGenerator.cs (1)
110Debug.Assert(results.All(e => e is not null), "Expected all values to be non-null");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Embeddings\OpenTelemetryEmbeddingGenerator.cs (1)
52Debug.Assert(innerGenerator is not null, "Should have been validated by the base ctor.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\Files\OpenTelemetryHostedFileClient.cs (1)
70Debug.Assert(innerClient is not null, "Should have been validated by the base ctor");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\SpeechToText\OpenTelemetrySpeechToTextClient.cs (1)
51Debug.Assert(innerClient is not null, "Should have been validated by the base ctor");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI\TextToSpeech\OpenTelemetryTextToSpeechClient.cs (1)
50Debug.Assert(innerClient is not null, "Should have been validated by the base ctor");
Microsoft.Extensions.AI.Abstractions (16)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\ChatCompletion\ChatResponseExtensions.cs (4)
304Debug.Assert(contents[i] is TextReasoningContent { ProtectedData: null }, "Expected all but the last to have a null ProtectedData"); 326Debug.Assert(end - start > 1, "Expected multiple contents to merge"); 424Debug.Assert(end - start > 1, "Expected multiple contents to merge"); 521Debug.Assert(nextSlot == contents.Count, "Expected final count to equal list length.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Contents\DataContent.cs (5)
281Debug.Assert(_data is not null, "Expected _data to be initialized."); 290Debug.Assert(wrote, "Expected to successfully write the data URI."); 344Debug.Assert(_dataUri is not null, "Expected dataUri to be initialized."); 348Debug.Assert(_data is not null, "Expected data to be initialized."); 362Debug.Assert(pos >= 0, "Expected comma to be present in the URI.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Functions\AIFunctionFactory.cs (4)
618Debug.Assert(target is null, "Expected target to be null when we have a non-null target type"); 619Debug.Assert(!FunctionDescriptor.Method.IsStatic, "Expected an instance method"); 985Debug.Assert(typeInfo.Type != typeof(string), "string parameters should not enter this branch."); 1213Debug.Assert(specializedType.IsGenericType && specializedType.GetGenericTypeDefinition() == genericMethodDefinition.DeclaringType, "generic member definition doesn't match type.");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Utilities\AIJsonUtilities.Schema.Create.cs (2)
296Debug.Assert(refUri is "#" || refUri.StartsWith("#/", StringComparison.Ordinal), $"Expected {nameof(refUri)} to be either # or start with #/, got {refUri}"); 418Debug.Assert(kind is JsonValueKind.True, $"Invalid schema type: {kind}");
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Abstractions\Utilities\AIJsonUtilities.Schema.Transform.cs (1)
199Debug.Assert(path != null, "Path should not be null when TransformSchemaNode is provided.");
Microsoft.Extensions.AI.Evaluation.Safety (2)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.Evaluation.Safety\ContentSafetyChatClient.cs (2)
148Debug.Fail(ErrorMessage); 156Debug.Fail(ErrorMessage);
Microsoft.Extensions.AI.OpenAI (2)
..\..\..\..\src\Libraries\Microsoft.Extensions.AI.OpenAI\OpenAIResponsesChatClient.cs (2)
340Debug.Assert(_getResponseStreamingAsync is not null, $"Unable to find {nameof(_getResponseStreamingAsync)} method"); 353Debug.Assert(_createResponseStreamingAsync is not null, $"Unable to find {nameof(_createResponseStreamingAsync)} method");
Microsoft.Extensions.Caching.Hybrid (32)
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\BufferChunk.cs (10)
31Debug.Assert(array is not null, "expected valid array input"); 41Debug.Assert(!ReturnToPool, "do not return right-sized arrays"); 42Debug.Assert(Length == array.Length, "array length not respected"); 47Debug.Assert(array is not null, "expected valid array input"); 48Debug.Assert(length >= 0, "expected valid length"); 52Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected"); 53Debug.Assert(Length == length, "length not respected"); 84Debug.Assert(OversizedArray is null && !ReturnToPool, "expected clean slate after recycle"); 98Debug.Assert(copy.Length == Length, "same length expected"); 99Debug.Assert(!copy.ReturnToPool, "do not return to pool");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\DefaultHybridCache.CacheItem.cs (1)
65Debug.Assert(newCount >= 0, "over-release detected");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\DefaultHybridCache.L2.cs (3)
84Debug.Assert(buffer.OversizedArray is not null, "array should be non-null"); 137Debug.Assert(HasBackendCache, "shouldn't be here without L2"); 172Debug.WriteLine(ex.Message);
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\DefaultHybridCache.Stampede.cs (1)
99Debug.Assert(existingType != newType, "should be different types");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\DefaultHybridCache.StampedeStateT.cs (8)
49Debug.Assert(_underlying is null, "should not already have factory field"); 50Debug.Assert(underlying is not null, "factory argument should be meaningful"); 67Debug.Assert(_underlying is null, "should not already have factory field"); 68Debug.Assert(underlying is not null, "factory argument should be meaningful"); 106Debug.Assert(ReferenceEquals(first, stampede.Task), "should not be cancelled"); 126Debug.Assert(_result is not null, "result should be assigned"); 441Debug.Assert(value.OversizedArray is not null, "expected buffer"); 469Debug.Assert((Key.Flags & FlagsDisableL1AndL2Write) == FlagsDisableL1AndL2Write, "Only expected if L1+L2 disabled");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\HybridCacheEventSource.cs (3)
53Debug.WriteLine($"{nameof(HybridCacheEventSource)} counters reset!"); 230Debug.Assert(IsEnabled(), $"Missing check to {nameof(HybridCacheEventSource)}.{nameof(Log)}.{nameof(IsEnabled)} from {caller}"); 231Debug.WriteLine($"{nameof(HybridCacheEventSource)}: {caller}"); // also log all event calls, for visibility
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\InbuiltTypeSerializer.cs (1)
59Debug.Assert(actual == length, "encoding length mismatch");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\RecyclableArrayBufferWriter.cs (4)
120Debug.Assert(_buffer.Length > _index, "should have some space"); 127Debug.Assert(_buffer.Length > _index, "should have some space"); 181Debug.Assert(needed > currentLength, "should need to grow"); 201Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint, "should be space");
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\TagSet.cs (1)
35Debug.Assert(tags is { Length: > 1 }, "should be non-trivial array");
Microsoft.Extensions.Caching.Hybrid.Tests (1)
..\..\..\..\test\Libraries\Microsoft.Extensions.Caching.Hybrid.Tests\TestEventListener.cs (1)
105Debug.WriteLine($"{name}={value}");
Microsoft.Extensions.Caching.Memory (2)
CacheEntry.CacheEntryTokens.cs (1)
116Debug.Assert(entry._tokens != null);
CacheEntry.cs (1)
203Debug.Assert(_current.Value == this, "Entries disposed in invalid order");
Microsoft.Extensions.Caching.StackExchangeRedis (9)
RedisCache.cs (9)
217Debug.Assert(cache is not null); 281Debug.Assert(_cache is not null); 304Debug.Assert(_cache is not null); 321Debug.Assert(_cache is not null); 348Debug.Assert(_cache is not null); 435Debug.Assert(cache is not null); 490Debug.Assert(cache is not null); 696Debug.WriteLine(ex); 754Debug.Assert(cache is not null);
Microsoft.Extensions.Configuration (5)
ConfigurationProvider.cs (2)
76Debug.Assert(ConfigurationPath.KeyDelimiter == ":"); 98Debug.Assert(ConfigurationPath.KeyDelimiter == ":");
ReferenceCountedProviders.cs (3)
48Debug.Assert(_refCount > 0); 53Debug.Assert(_refCount > 0); 63Debug.Assert(_refCount > 0);
Microsoft.Extensions.Configuration.Binder (9)
BindingPoint.cs (2)
60Debug.Assert(!IsReadOnly); 61Debug.Assert(!_valueSet);
ConfigurationBinder.cs (7)
472Debug.Assert(bindingPoint.Value is not null); 507Debug.Assert(section is not null); 726Debug.Assert(source is not null); 727Debug.Assert(addMethod is not null); 748Debug.Assert(dictionaryType.IsGenericType && 944Debug.Assert(source is not null); 945Debug.Assert(addMethod is not null);
Microsoft.Extensions.Configuration.Binder.SourceGeneration (72)
ConfigurationBindingGenerator.Parser.cs (11)
84Debug.Assert(invocation is not null); 87Debug.Assert(targetMethod.IsExtensionMethod); 140Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 196Debug.Assert(spec is ArraySpec or UnsupportedTypeSpec); 371Debug.Assert(spec is DictionarySpec or UnsupportedTypeSpec or null); 376Debug.Assert(spec is EnumerableSpec or UnsupportedTypeSpec or null); 442Debug.Assert(!shouldTryCast || !type.IsValueType, "Should not test cast for value types."); 538Debug.Assert(!shouldTryCast || !type.IsValueType, "Should not test cast for value types."); 614Debug.Assert(IsCollection(type)); 709Debug.Assert(initExceptionMessage is not null); 771Debug.Assert(ctor is not null);
Emitter\ConfigurationBinder.cs (2)
143Debug.Assert(interceptorInfo is not null); 154Debug.Assert(!type.IsValueType);
Emitter\CoreBindingHelpers.cs (25)
27Debug.Assert(_emitBlankLineBeforeNextStatement); 55Debug.Assert(_typeIndex.HasBindableMembers(objectType)); 78Debug.Assert(keys is not null); 108Debug.Assert(effectiveType is UnsupportedTypeSpec || _typeIndex.CanBindTo(type.TypeRef)); 150Debug.Fail($"Complex should not be included for GetCore gen: {complexType.TypeRef.FullyQualifiedName}"); 231Debug.Assert(_typeIndex.HasBindableMembers(effectiveType)); 255Debug.Assert(_typeIndex.HasBindableMembers(type)); 299Debug.Fail($"Unsupported spec for bind core gen: {effectiveType.GetType()}"); 323Debug.Assert(type.InstantiationStrategy is ObjectInstantiationStrategy.ParameterizedConstructor); 324Debug.Assert(_typeIndex.CanInstantiate(type)); 325Debug.Assert( 458Debug.Assert(emitAsConfigWithChildren); 663Debug.Fail($"Invalid string parsable kind: {typeKind}"); 878Debug.Assert(_typeIndex.HasBindableMembers(type)); 1109Debug.Assert(complexType is ArraySpec || complexType is EnumerableSpec); 1145Debug.Assert(canSet); 1258Debug.Assert(!type.IsValueType); 1317Debug.Assert(ShouldEmitBoundThroughConstructorParameter(type)); 1325Debug.Assert(!type.IsValueType); 1356Debug.Assert(typeKind is not StringParsableTypeKind.None); 1420Debug.Assert(objectType is not null); 1432Debug.Assert(strategy is ObjectInstantiationStrategy.ParameterizedConstructor); 1442Debug.Assert(!memberAccessExpr.Contains('.')); 1462Debug.Assert(castExpr is not null || collectionWithCtorInitType.InstantiationConcreteType is CollectionInstantiationConcreteType.Self); 1480Debug.Fail($"Invalid initialization kind: {initKind}");
Emitter\Helpers.cs (3)
154Debug.Assert(interceptsCalls || 184Debug.Assert(_emittedExtsTargetType is null); 194Debug.Assert(_emittedExtsTargetType is not null);
Parser\BinderInvocation.cs (1)
25Debug.Assert(IsCandidateSyntaxNode(context.Node));
Parser\ConfigurationBinder.cs (2)
258Debug.Assert((MethodsToGen.ConfigBinder_Any & overload) is not 0); 270Debug.Assert((MethodsToGen.ConfigBinder_Get & overload) is not 0 ||
Parser\OptionsBuilderConfigurationExtensions.cs (4)
30Debug.Assert(typeSymbol?.IsValueType is not true); 49Debug.Assert(paramCount >= 2); 76Debug.Assert(paramCount >= 2); 89Debug.Assert((MethodsToGen.OptionsBuilderExt_Any & overload) is not 0);
Parser\OptionsConfigurationServiceCollectionExtensions.cs (3)
68Debug.Assert(paramCount is 4); 74Debug.Assert(typeSymbol?.IsValueType is not true); 92Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0);
Specs\BindingHelperInfo.cs (1)
205Debug.Assert(registeredForBindCore);
Specs\InterceptorInfo.cs (7)
33Debug.Assert((MethodsToGen.ConfigBinder_Bind & interceptor) is 0); 46Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & interceptor) is not 0); 67Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is not 0); 93Debug.Assert((MethodsToGen.ConfigBinder_Bind & overload) is 0); 105Debug.Assert((MethodsToGen.ServiceCollectionExt_Any & overload) is not 0); 173Debug.Assert(BinderInvocation.IsBindingOperation(invocation)); 202Debug.Assert(ConfigurationBindingGenerator.InterceptorVersion == 1);
Specs\Members\MemberSpec.cs (1)
14Debug.Assert(member is IPropertySymbol or IParameterSymbol);
Specs\TypeIndex.cs (3)
82Debug.Assert(castType is not CollectionPopulationCastType.NotApplicable); 115Debug.Assert(type.StringParsableTypeKind is not StringParsableTypeKind.AssignFromSectionValue); 130Debug.Assert(displayString.Length > 0);
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Configuration.EnvironmentVariables (6)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
91Debug.Assert(_paths.Count > 0);
Microsoft.Extensions.DataIngestion (6)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion\Chunkers\ValueStringBuilder.cs (6)
43Debug.Assert(value >= 0); 44Debug.Assert(value <= _chars.Length); 54Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.DataIngestion.Markdig (2)
..\..\..\..\src\Libraries\Microsoft.Extensions.DataIngestion.Markdig\MarkdownParser.cs (2)
200Debug.Assert(containerInline != null, "ContainerInline should not be null here."); 201Debug.Assert(containerInline!.FirstChild != null, "FirstChild should not be null here.");
Microsoft.Extensions.DependencyInjection (20)
DependencyInjectionEventSource.cs (1)
286Debug.Assert(instance != null, "descriptor.ImplementationInstance != null");
ServiceLookup\CallSiteFactory.cs (13)
72Debug.Assert(implementationType != null); 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 174Debug.Fail("_descriptorLookup didn't contain requested serviceDescriptor"); 415Debug.Assert(keyedSlotAssignment is not null); 508Debug.Assert(callSite != null); 542Debug.Assert(implementationType != null, "descriptor.ImplementationType != null"); 566Debug.Assert(site != null); 664Debug.Assert(bestResolvedParameters is not null); 706Debug.Assert(parameterCallSites != null); 740Debug.Assert(callSite is not null); 904Debug.Assert(_item != null); 915Debug.Assert(_items == null); 965Debug.Assert(_items == null);
ServiceLookup\CallSiteRuntimeResolver.cs (1)
203Debug.Assert(ServiceProvider.IsDynamicCodeSupported || !elementType.IsValueType, "When dynamic code isn't supported, building the IEnumerableCallSite will throw if elementType is a ValueType.");
ServiceLookup\DynamicServiceProviderEngine.cs (1)
44Debug.Fail($"We should never get exceptions from the background compilation.{Environment.NewLine}{ex}");
ServiceLookup\Expressions\ExpressionResolverBuilder.cs (2)
118Debug.Assert(ServiceProvider.IsDynamicCodeSupported || !elementType.IsValueType, "When dynamic code isn't supported, building the IEnumerableCallSite will throw if elementType is a ValueType."); 127Debug.Assert(ServiceProvider.IsDynamicCodeSupported || !elementType.IsValueType, "When dynamic code isn't supported, building the IEnumerableCallSite will throw if elementType is a ValueType.");
ServiceLookup\IEnumerableCallSite.cs (1)
18Debug.Assert(ServiceProvider.IsDynamicCodeSupported || !itemType.IsValueType, "When dynamic code isn't supported, an IEnumerableCallSite should not be created with a ValueType.");
ServiceProvider.cs (1)
232System.Diagnostics.Debug.Assert(result is null || CallSiteFactory.IsService(serviceIdentifier));
Microsoft.Extensions.DependencyInjection.Abstractions (11)
ActivatorUtilities.cs (8)
135Debug.Assert(!constructor.IsPreferred); 592Debug.Assert(false); 622Debug.Assert(parameterMap != null); 675Debug.Assert(parameterMap != null); 928Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 929Debug.Assert(FixedArgumentThreshold == 4); 985Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 986Debug.Assert(FixedArgumentThreshold == 4);
ServiceDescriptor.cs (3)
324Debug.Assert(typeArguments.Length == 2); 343Debug.Assert(typeArguments.Length == 3); 349Debug.Fail("ImplementationType, ImplementationInstance, ImplementationFactory or KeyedImplementationFactory must be non null");
Microsoft.Extensions.DependencyModel (14)
DependencyContextJsonReader.cs (1)
81Debug.Assert(rented.Length >= utf8Bom.Length);
DependencyContextLoader.cs (1)
93Debug.Assert(_fileSystem.File.Exists(location));
DependencyContextWriter.cs (7)
159Debug.Assert(compilationLibrary.Serviceable == runtimeLibrary.Serviceable); 160Debug.Assert(compilationLibrary.Version == runtimeLibrary.Version); 161Debug.Assert(compilationLibrary.Hash == runtimeLibrary.Hash); 162Debug.Assert(compilationLibrary.Type == runtimeLibrary.Type); 163Debug.Assert(compilationLibrary.Path == runtimeLibrary.Path); 164Debug.Assert(compilationLibrary.HashPath == runtimeLibrary.HashPath); 165Debug.Assert(compilationLibrary.RuntimeStoreManifestName == null);
Resolution\AppBaseCompilationAssemblyResolver.cs (1)
85Debug.Assert(sharedDirectory != null);
Utf8JsonReaderExtensions.cs (4)
91Debug.Assert(reader.IsTokenTypeProperty()); 101Debug.Assert(!reader.IsTokenTypeProperty()); 107Debug.Assert(reader.IsTokenTypeProperty()); 122Debug.Assert(reader.IsTokenTypeProperty());
Microsoft.Extensions.Diagnostics (17)
Metrics\DebugConsoleMetricListener.cs (2)
44Debug.Assert(userState == this); 63Debug.Assert(state == this);
Metrics\DefaultMeterFactory.cs (1)
28Debug.Assert(options.Name is not null);
Metrics\ListenerSubscription.cs (1)
55Debug.Fail("InstrumentPublished called for an instrument we're already listening to.");
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
Tracing\DefaultActivitySourceFactory.cs (9)
50Debug.Assert(options is not null); 51Debug.Assert(options.Name is not null); 52Debug.Assert(ReferenceEquals(options.Scope, this)); 107Debug.Assert(Monitor.IsEntered(_cachedSources)); 278Debug.Assert(_sample is not null); 290Debug.Assert(_sampleUsingParentId is not null); 299Debug.Assert(_activityStarted is not null); 309Debug.Assert(_activityStopped is not null); 319Debug.Assert(_exceptionRecorder is not null);
Microsoft.Extensions.Diagnostics.Abstractions (1)
Tracing\ActivityListenerBuilder.cs (1)
27Debug.Assert(name is not null);
Microsoft.Extensions.DotNetDeltaApplier (6)
src\sdk\src\Dotnet.Watch\HotReloadAgent.Host\StartupHook.cs (1)
72Debug.Assert(listener != null);
src\sdk\src\Dotnet.Watch\HotReloadAgent\HotReloadAgent.cs (5)
122Debug.Assert(Capabilities.Length > 0); 123Debug.Assert(_applyUpdate != null); 234Debug.Assert(updatedType >> 24 == 0x02); 255Debug.Assert(_applyUpdate != null); 316Debug.Assert(!string.IsNullOrEmpty(environment), $"{nameof(environment)} must be set");
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\EmbeddedFilesManifest.cs (1)
72Debug.Assert(path.Length > 0);
Microsoft.Extensions.FileProviders.Physical (6)
Internal\FileSystemInfoHelper.cs (1)
51Debug.Assert(fileInfo.Exists);
PhysicalFileProvider.cs (1)
147Debug.Assert(!_fileWatcherInitialized);
PhysicalFilesWatcher.cs (2)
836Debug.Assert(state != null); 948Debug.Assert(target.StartsWith(existingAncestor, StringComparison.OrdinalIgnoreCase));
PollingFileChangeToken.cs (1)
80Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
PollingWildCardChangeToken.cs (1)
77Debug.Assert(_tokenSource == null, "We expect CancellationTokenSource to be initialized exactly once.");
Microsoft.Extensions.Hosting (4)
HostApplicationBuilder.cs (1)
122Debug.Assert(empty, "should only be called with empty: true");
Internal\ConsoleLifetime.netcoreapp.cs (1)
30Debug.Assert(context.Signal == PosixSignal.SIGINT || context.Signal == PosixSignal.SIGQUIT || context.Signal == PosixSignal.SIGTERM);
Internal\Host.cs (1)
341Debug.Assert(_hostedServices != null, "Hosted services are resolved when host is started.");
Internal\ServiceFactoryAdapter.cs (1)
36Debug.Assert(_factoryResolver != null && _contextResolver != null);
Microsoft.Extensions.Hosting.Systemd (1)
SystemdLifetime.netcoreapp.cs (1)
23Debug.Assert(context.Signal == PosixSignal.SIGTERM);
Microsoft.Extensions.Hosting.WindowsServices (3)
WindowsServiceLifetimeHostBuilderExtensions.cs (3)
110Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 116Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 137Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Microsoft.Extensions.Http (9)
ActiveHandlerTrackingEntry.cs (3)
61Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); 78Debug.Assert(_callback != null); 79Debug.Assert(_timer != null);
DefaultHttpClientFactory.cs (3)
200Debug.Assert(removed, "Entry not found. We should always be able to remove the entry"); 201Debug.Assert(object.ReferenceEquals(active, found!.Value), "Different entry found. The entry should not have been replaced"); 279Debug.Assert(entry != null, "Entry was null, we should always get an entry back from TryDequeue");
DependencyInjection\DefaultHttpClientBuilder.cs (1)
15Debug.Assert(tracker != null);
DependencyInjection\HttpClientBuilderExtensions.cs (1)
789Debug.Assert(registry != null);
src\runtime\src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
36Debug.Assert(pathAndQuery is not null);
Microsoft.Extensions.Identity.Core (5)
DefaultPersonalDataProtector.cs (1)
36Debug.Assert(data != null);
Rfc6238AuthenticationService.cs (4)
40Debug.Assert(res); 53Debug.Assert(res); 54Debug.Assert(written == hash.Length); 69Debug.Assert(offset + 4 < hash.Length);
Microsoft.Extensions.Logging (5)
LoggerFactoryScopeProvider.cs (2)
139Debug.Assert(activity != null); 140Debug.Assert(activityTrackingOption != ActivityTrackingOptions.None);
LoggerInformation.cs (2)
50Debug.Assert(logger != null || externalScopeProvider != null, "Logger can't be null when there isn't an ExternalScopeProvider"); 67Debug.Assert(Logger != null);
src\runtime\src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Abstractions (6)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobLoggerProvider.cs (1)
81System.Diagnostics.Debug.Assert(tryGetBuffer);
Microsoft.Extensions.Logging.Configuration (1)
src\runtime\src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Console (23)
ConsoleLoggerProcessor.cs (2)
122Debug.Assert(FullMode == ConsoleLoggerQueueFullMode.Wait); 128Debug.Assert(_messageQueue.Count < MaxQueueLength);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\runtime\src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (5)
44Debug.Assert(initialCapacity > 0); 45Debug.Assert(_buffer.ActiveLength == 0); 56Debug.Assert(sizeHint > 0); 64Debug.Assert(sizeHint > 0); 78Debug.Assert(_stream is not null);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.Debug (2)
DebugLogger.cs (1)
59System.Diagnostics.Debug.Assert(exception != null);
DebugLogger.debug.cs (1)
15System.Diagnostics.Debug.WriteLine(message, category: name);
Microsoft.Extensions.Logging.EventSource (17)
LoggingEventSource.cs (17)
163Debug.Assert(LoggerName != null); 164Debug.Assert(ActivityTraceId != null); 165Debug.Assert(ActivitySpanId != null); 166Debug.Assert(ActivityTraceFlags != null); 216Debug.Assert(LoggerName != null); 217Debug.Assert(Exception != null); 218Debug.Assert(ActivityTraceId != null); 219Debug.Assert(ActivitySpanId != null); 220Debug.Assert(ActivityTraceFlags != null); 281Debug.Assert(LoggerName != null); 282Debug.Assert(ExceptionJson != null); 283Debug.Assert(ArgumentsJson != null); 284Debug.Assert(ActivityTraceId != null); 285Debug.Assert(ActivitySpanId != null); 286Debug.Assert(ActivityTraceFlags != null); 576Debug.Assert(str != null); 580Debug.Assert(pinnedString == rePinnedString);
Microsoft.Extensions.Logging.Generators (11)
LoggerMessageGenerator.Parser.cs (3)
102Debug.Assert(logMethodSymbol != null, "log method is present."); 182Debug.Fail("Unexpected number of arguments in attribute constructor."); 896Debug.Assert(searchedBrace is '{' or '}');
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.Extensions.Logging.MSBuild (1)
MSBuildLogger.cs (1)
104Debug.Assert(originalFormat is not null, "Original format should not be null at this point - either state or scope should have provided it.");
Microsoft.Extensions.ObjectPool (1)
LeakTrackingObjectPool.cs (1)
78Debug.Fail($"{typeof(T).Name} was leaked. Created at: {Environment.NewLine}{_stack}");
Microsoft.Extensions.Options.DataAnnotations (4)
DataAnnotationValidateOptions.Async.cs (2)
66Debug.Assert(errors is not null && errors.Count > 0); 91Debug.Assert(options is not null);
DataAnnotationValidateOptions.cs (2)
74Debug.Assert(errors is not null && errors.Count > 0); 83Debug.Assert(options is not null);
Microsoft.Extensions.Primitives (4)
CompositeChangeToken.cs (2)
133Debug.Assert(state != null); 158Debug.Assert(disposables != null);
StringSegment.cs (1)
108Debug.Assert(Buffer is not null);
StringValues.cs (1)
192Debug.Assert(value is string[]);
Microsoft.Extensions.ServiceDiscovery (4)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\Http\HttpServiceEndpointResolver.cs (1)
258Debug.Assert(_onDisposed is not null);
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\ServiceEndpointResolver.cs (1)
250Debug.Assert(_onDisposed is not null);
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery\ServiceEndpointWatcher.cs (2)
201Debug.Assert(error is null || newCacheState is CacheStatus.Invalid); 228Debug.Assert(newEndpoints is not null);
Microsoft.Extensions.ServiceDiscovery.Dns (10)
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\DnsDataReader.cs (1)
25Debug.Assert(_position == 0);
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\DnsDataWriter.cs (1)
50Debug.Assert(label.Length <= 63, "Label length must not exceed 63 bytes.");
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\DnsResolver.cs (7)
284Debug.Assert(record.Type == QueryType.CNAME, "Only CNAME records should be processed here."); 293Debug.Assert(gotArray, "Failed to get array segment"); 294Debug.Assert(segment.Array == messageBytes.Array, "record data backed by different array than the original message"); 309Debug.Assert(record.Type is QueryType.A or QueryType.AAAA, "Only CNAME records should be processed here."); 354Debug.Fail("Should be unreachable"); 398Debug.Assert(response.Answers.Count > 0); 493Debug.Assert(cts.Token.IsCancellationRequested);
..\..\..\..\src\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns\Resolver\DnsResolver.Telemetry.cs (1)
98Debug.Assert(answersArray is not null);
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
..\..\..\..\test\Libraries\Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing\Fuzzers\DnsResponseFuzzer.cs (1)
42Debug.Assert(task.IsCompleted, "Task should be completed synchronously");
Microsoft.Extensions.TimeProvider.Testing (1)
..\..\..\..\src\Libraries\Microsoft.Extensions.TimeProvider.Testing\FakeTimeProvider.cs (1)
172Debug.Assert(TimestampFrequency == TimeSpan.TicksPerSecond, "Assuming frequency equals ticks per second");
Microsoft.Extensions.Validation.ValidationsGenerator (5)
src\aspnetcore\src\Shared\Diagnostics\AnalyzerDebug.cs (4)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b); 16/// <inheritdoc cref="Debug.Assert(bool, string)"/> 19=> Debug.Assert(b, message);
src\aspnetcore\src\Shared\RoslynUtils\WellKnownTypes.cs (1)
47Debug.Assert(name == typeIdName, $"Enum name ({typeIdName}) and type name ({name}) must match at {i}");
Microsoft.Extensions.VectorData.Abstractions (5)
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.Abstractions\ProviderServices\CollectionModel.cs (1)
105Debug.Assert(typeof(TRecord) == _recordType, "Type mismatch between record type and model type.");
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.Abstractions\ProviderServices\CollectionModelBuilder.cs (2)
185Debug.Assert(clrProperty is not null || definitionProperty is not null, "Either a CLR property or a definition property must be provided."); 522Debug.Assert(propertyModel.Type is not null, "propertyModel.Type must be non-null");
..\..\..\..\src\Libraries\Microsoft.Extensions.VectorData.Abstractions\ProviderServices\PropertyModel.cs (2)
146Debug.Assert(_getter is not null, "Property accessors have not been configured."); 155Debug.Assert(_setter is not null, "Property accessors have not been configured.");
Microsoft.Gen.Logging (1)
TemplateProcessor.cs (1)
142Debug.Assert(searchedBrace is '{' or '}', "Searched brace must be { or }");
Microsoft.Interop.ComInterfaceGenerator (15)
Analyzers\ComInterfaceGeneratorDiagnosticsAnalyzer.cs (1)
146Debug.Assert(contextResults.Length > 0);
ComInterfaceContext.cs (1)
78Debug.Assert(baseContext.HasValue);
ComInterfaceGenerator.cs (2)
819Debug.Assert(genCtx.MemberKind.IsPropertyOrIndexerAccessor()); 987Debug.Assert(shadow.MethodInfo.AssociatedAttributes.Array.IsEmpty);
ComMethodInfo.cs (2)
146Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary }); 438Debug.Assert(propertyDeclaringSyntax is not PropertyDeclarationSyntax { Initializer: not null },
GeneratedComInterfaceAttributeData.cs (2)
57Debug.Assert(found); 63Debug.Assert(attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
IncrementalMethodStubGenerationContext.cs (1)
79Debug.Assert(IsPropertyAccessorName(accessorName));
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (1)
75Debug.Assert(info.MarshallingAttributeInfo is ManagedHResultExceptionMarshallingInfo);
Marshallers\ObjectUnwrapperResolver.cs (1)
36Debug.Assert(info.MarshallingAttributeInfo is ObjectUnwrapperInfo);
VirtualMethodPointerStubGenerator.cs (3)
86Debug.Assert(methodStub.TypeKeyOwner.Syntax is NameSyntax); 148Debug.Assert(methodStub.MemberKind.IsPropertyOrIndexerAccessor()); 235Debug.Assert(methodStub.MemberKind is StubMemberKind.Method);
VtableIndexStubGenerator.cs (1)
292Debug.Assert(virtualMethodIndexAttr is not null);
Microsoft.Interop.JavaScript.JSImportGenerator (3)
JSExportGenerator.cs (1)
163Debug.Assert(jsExportAttr is not null);
JSGeneratorFactory.cs (1)
19Debug.Assert(context != null);
JSImportGenerator.cs (1)
152Debug.Assert(jsImportAttr is not null);
Microsoft.Interop.LibraryImportGenerator (3)
LibraryImportGenerator.cs (3)
258Debug.Assert(generatedDllImportAttr is not null); 389Debug.Assert(!options.GenerateForwarders, "GenerateForwarders should have already been handled to use a forwarder stub"); 461Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
208Debug.Assert(generatedDllImportAttr is not null); 395Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.SourceGeneration (16)
ArrayMarshallingInfoProvider.cs (1)
83Debug.WriteLine("Default marshallers for arrays should be a valid shape.");
BoundGenerators.cs (3)
39Debug.Assert(managedExceptionInfo == null); 51Debug.Assert(managedReturnMarshaller == defaultBoundGenerator); 56Debug.Assert(nativeReturnMarshaller == defaultBoundGenerator);
DiagnosticOr.cs (3)
74Debug.Assert(value is not null); 83Debug.Assert(value is not null); 84Debug.Assert(diagnostics is not null);
ManualTypeMarshallingHelper.cs (1)
179Debug.WriteLine($"{attr} has {attr.ConstructorArguments.Length} constructor arguments - expected 3");
Marshalling\BoolMarshaller.cs (1)
31Debug.Assert(info.ManagedType is SpecialTypeInfo { SpecialType: SpecialType.System_Boolean });
Marshalling\ByValueContentsMarshalKindValidator.cs (1)
38Debug.Assert(support == ByValueMarshalKindSupport.Supported || diagnostic is not null);
Marshalling\ByValueMarshalKindSupportDescriptor.cs (1)
82Debug.Assert(marshalKind is ByValueContentsMarshalKind.Default);
Marshalling\CharMarshaller.cs (1)
38Debug.Assert(info.ManagedType is SpecialTypeInfo {SpecialType: SpecialType.System_Char });
MarshalUsingAttributeParser.cs (1)
30Debug.Assert(attributeData.AttributeClass!.ToDisplayString() == TypeNames.MarshalUsingAttribute);
MethodSignatureElementInfoProvider.cs (1)
19Debug.Assert(method.AssociatedSymbol is not IPropertySymbol,
NativeMarshallingAttributeParser.cs (1)
24Debug.Assert(attributeData.AttributeClass!.ToDisplayString() == TypeNames.NativeMarshallingAttribute);
UnmanagedToManagedStubGenerator.cs (1)
109Debug.Assert(statements.CleanupCalleeAllocated.IsEmpty);
Microsoft.JSInterop (4)
DotNetObjectReferenceOfT.cs (1)
51Debug.Assert(_objectId != 0, "Accessing ObjectId without tracking is always incorrect.");
Infrastructure\DotNetDispatcher.cs (1)
227Debug.Assert(count == receivedBytes);
JSRuntime.cs (1)
368Debug.Assert(dotNetObjectReference.ObjectId != 0);
src\aspnetcore\src\Components\Shared\src\ArrayBuilder.cs (1)
182Debug.Assert(newCapacity > _items.Length);
Microsoft.Maui (11)
Fonts\FileSystemEmbeddedFontLoader.cs (1)
46 Debug.Assert(_rootPath != null || _getRootPath != null, $"The ctor should have set either {nameof(_rootPath)} or {nameof(_getRootPath)}.");
Hosting\ImageSources\ImageSourceToImageSourceServiceTypeMapping.cs (1)
34 Debug.Assert(typeof(IImageSource).IsAssignableFrom(type));
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (1)
32 Debug.Assert(typeof(IElement).IsAssignableFrom(type));
HotReload\HotReloadHelper.cs (5)
97 Debug.WriteLine("You are using trying to HotReload a view that requires Parameters. Please call `HotReloadHelper.Register(this, params);` in the constructor;"); 103 Debug.WriteLine($"Error Hotreloading type: {newViewType}"); 104 Debug.WriteLine(ex); 142 Debug.WriteLine($"Error calling {method.Name} on type: {newViewType}"); 143 Debug.WriteLine(ex);
Layouts\GridLayoutManager.cs (2)
615 Debug.Assert(starCount > 0, "The caller of ResolveStars has already checked that there are star values to resolve."); 895 Debug.Assert(starCount > 0, "Assume that the caller has already checked for the existence of star rows/columns before using this.");
VisualDiagnostics\RectangleAdorner.cs (1)
36 Debug.Fail($"Invalid density {density}");
Microsoft.Maui.Controls (5)
BindingExpression.cs (1)
162 Debug.Assert(part != null, "There should always be at least the self part in the expression.");
Internals\ImageParser.cs (4)
53 global::System.Diagnostics.Debug.Assert(_stream.Position == _currentPosition); 101 Debug.Assert(toRead <= buffer.Length); 130 Debug.Assert(_currentBlockSize == bytesRead); 180 Debug.Assert(transparencyIndex < _colorTable.Length);
Microsoft.Maui.Controls.Build.Tasks (1)
XamlTask.cs (1)
54 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
Microsoft.Maui.Controls.Foldable (4)
TwoPaneView.cs (1)
258 System.Diagnostics.Debug.Write("TwoPaneView.DualScreenService_OnFeatureChanged - " + e, "JWM");
TwoPaneViewLayoutGuide.cs (3)
149 System.Diagnostics.Debug.Write($"TwoPaneViewLayoutGuide.GetContainerArea {width},{height}", "JWM"); 198 System.Diagnostics.Debug.Write($"TwoPaneViewLayoutGuide.UpdateLayouts containerArea {containerArea}", "JWM"); 345 System.Diagnostics.Debug.Write($"TwoPaneViewLayoutGuide.IsInMultipleRegions:{isInMultipleRegions} layoutBounds:{layoutBounds} == ", "JWM");
Microsoft.Maui.Controls.Xaml (14)
XamlLoader.cs (3)
74 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); 116 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); 157 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value);
XamlParser.cs (11)
54 Debug.Assert(reader.NodeType == XmlNodeType.Element); 67 Debug.Assert(reader.Name == elementName); //make sure we close the right element 84 Debug.WriteLine($"Unexpected empty element '<{reader.Name} />'", (IXmlLineInfo)reader); 130 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); 139 Debug.Assert(reader.NodeType == XmlNodeType.Element); 151 Debug.Assert(reader.Name == name); 188 Debug.WriteLine("Unhandled node {0} {1} {2}", reader.NodeType, reader.Name, reader.Value); 206 Debug.Assert(reader.NodeType == XmlNodeType.Element); 254 Debug.WriteLine("Unhandled attribute {0}", name); 279 Debug.WriteLine("Unhandled attribute {0}", name); 355 Debug.WriteLine($"Failed to parse Assembly Attribute: {ex.ToString()}");
Microsoft.Maui.Essentials (10)
TextToSpeech\TextToSpeech.shared.cs (10)
6using Debug = System.Diagnostics.Debug; 118 Debug.WriteLine($"p = {p}"); 119 Debug.WriteLine($"p.Length = {p.Length}"); 120 Debug.WriteLine($"positionbegin = {positionbegin}"); 121 Debug.WriteLine($"positionend = {positionend}"); 122 Debug.WriteLine($"position = {position}"); 128 Debug.WriteLine($"------------------------------"); 129 Debug.WriteLine($"positionbegin = {positionbegin}"); 130 Debug.WriteLine($"positionend = {positionend}"); 131 Debug.WriteLine($"position = {position}");
Microsoft.Maui.Graphics (8)
Color.cs (1)
761 Debug.Assert(charsWritten == value.Length);
Insets.cs (1)
105 System.Diagnostics.Debug.WriteLine(exc);
InsetsF.cs (1)
105 System.Diagnostics.Debug.WriteLine(exc);
PathBuilder.cs (4)
209 System.Diagnostics.Debug.WriteLine("=== An error occurred parsing the path. ===", exc); 210 System.Diagnostics.Debug.WriteLine(pathAsString); 355 System.Diagnostics.Debug.WriteLine("Don't know how to handle the path command: " + command); 448 System.Diagnostics.Debug.WriteLine("Don't know how to handle the path command: " + command);
Text\AttributedTextExtensions.cs (1)
185 System.Diagnostics.Debug.WriteLine("Length should not be less then 0");
Microsoft.Maui.Graphics.Skia (5)
SkiaCanvas.cs (5)
272 System.Diagnostics.Debug.WriteLine(exc); 309 System.Diagnostics.Debug.WriteLine(exc); 334 System.Diagnostics.Debug.WriteLine(exc); 366 System.Diagnostics.Debug.WriteLine(exc); 688 System.Diagnostics.Debug.WriteLine("SkiaCanvas.DrawText not yet implemented.");
Microsoft.Maui.Graphics.Text.Markdig (1)
Renderer\SimpleCssParser.cs (1)
31 System.Diagnostics.Debug.WriteLine(exc.Message);
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
src\Graphics\src\Graphics\Platforms\Windows\GraphicsExtensions.cs (1)
256 System.Diagnostics.Debug.WriteLine("Unable to convert the path to a Win2D Path: {0}: {1}", definition, exc);
src\Graphics\src\Graphics\Platforms\Windows\PlatformCanvas.cs (1)
300 System.Diagnostics.Debug.WriteLine(exc);
Microsoft.Maui.Maps (3)
Primitives\Distance.cs (3)
29 Debug.WriteLine("Negative values for distance not supported"); 39 Debug.WriteLine("Negative values for distance not supported"); 49 Debug.WriteLine("Negative values for distance not supported");
Microsoft.ML.AutoML.Samples (1)
Sweepable\SearchSpaceExample.cs (1)
37Debug.Assert(myParameterSearchSpace.GetHashCode() == myParameterSearchSpace2.GetHashCode());
Microsoft.ML.Core (11)
Utilities\ArrayUtils.cs (8)
51Debug.Assert(0 <= min && min <= lim && lim <= input.Length); 58Debug.Assert(minCur <= mid && mid < limCur); 65Debug.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 66Debug.Assert(minCur == min || input[minCur - 1] < value); 67Debug.Assert(limCur == lim || input[limCur] >= value); 69Debug.Assert(min <= minCur && minCur == limCur && limCur <= lim); 70Debug.Assert(minCur == min || input[minCur - 1] < value); 71Debug.Assert(limCur == lim || input[limCur] >= value);
Utilities\Contracts.cs (3)
24using Debug = System.Diagnostics.Debug; 783Debug.Fail(msg, ctx.ContextDescription); 785Debug.Fail(msg);
Microsoft.ML.CpuMath (3)
src\Microsoft.ML.Core\Utilities\Contracts.cs (3)
24using Debug = System.Diagnostics.Debug; 783Debug.Fail(msg, ctx.ContextDescription); 785Debug.Fail(msg);
Microsoft.ML.Data (1)
Utilities\StreamUtils.cs (1)
213Debug.Assert(minimumBytes <= buffer.Length);
Microsoft.ML.DataView (48)
Contracts.cs (1)
26Debug.Fail("Format string arg mismatch: " + ex.Message);
DataViewRowId.cs (2)
84Debug.Assert(0 < r && r < 64); 91Debug.Assert(0 < r && r < 64);
DataViewSchema.cs (9)
195Debug.Assert(schema != null); 196Debug.Assert(getters != null); 198Debug.Assert(schema.Count == getters.Length); 228Debug.Assert(_getters[column.Index] != null); 249Debug.Assert(0 <= index && index < Schema.Count); 363Debug.Assert(!string.IsNullOrEmpty(name)); 364Debug.Assert(type != null); 365Debug.Assert(getter != null); 456Debug.Assert(_columns[i].Index == i);
DataViewType.cs (7)
114Debug.Assert(!(other is TextDataViewType)); 276Debug.Assert(other == null || !(other is NumberDataViewType) || other.RawType != RawType); 312Debug.Assert(!(other is RowIdDataViewType)); 351Debug.Assert(!(other is BooleanDataViewType)); 390Debug.Assert(!(other is DateTimeDataViewType)); 426Debug.Assert(!(other is DateTimeOffsetDataViewType)); 462Debug.Assert(!(other is TimeSpanDataViewType));
KeyDataViewType.cs (1)
114Debug.Fail("Invalid type");
src\Microsoft.ML.Core\Utilities\ArrayUtils.cs (8)
51Debug.Assert(0 <= min && min <= lim && lim <= input.Length); 58Debug.Assert(minCur <= mid && mid < limCur); 65Debug.Assert(min <= minCur && minCur <= limCur && limCur <= lim); 66Debug.Assert(minCur == min || input[minCur - 1] < value); 67Debug.Assert(limCur == lim || input[limCur] >= value); 69Debug.Assert(min <= minCur && minCur == limCur && limCur <= lim); 70Debug.Assert(minCur == min || input[minCur - 1] < value); 71Debug.Assert(limCur == lim || input[limCur] >= value);
Utils.cs (1)
34Debug.Assert(meth.ReturnType == typeof(TRet));
VBuffer.cs (19)
89Debug.Assert(_count <= Length); 161Debug.Assert(res >= 0 && cur < length); 203Debug.Assert(destination.IsDense); 236Debug.Assert(destination.IsDense); 245Debug.Assert(copyMin <= copyLim); 308Debug.Assert(slot >= iv); 311Debug.Assert(iv == slot); 473Debug.Assert(0 <= count && count <= ArrayUtils.Size(values)); 474Debug.Assert(count <= length); 475Debug.Assert(count == length || count <= ArrayUtils.Size(indices)); 493Debug.Assert(slotCur < slot && slot < length); 496Debug.Assert(slotCur == slot); 499Debug.Assert(slotCur < length); 507Debug.Assert(0 <= count && count <= ArrayUtils.Size(values)); 508Debug.Assert(count <= length); 509Debug.Assert(count == length || count <= ArrayUtils.Size(indices)); 522Debug.Assert(slotCur < slot && slot < length); 525Debug.Assert(slotCur == slot); 528Debug.Assert(slotCur < length);
Microsoft.ML.ImageAnalytics (6)
MLImage.cs (6)
105Debug.Assert(image.Info.BitsPerPixel == 32); 106Debug.Assert(image.RowBytes * image.Height == width * height * 4); 126Debug.Assert(_image is not null); 163Debug.Assert(_image.Info.BytesPerPixel == 4); 223Debug.Assert(_image.Info.BitsPerPixel == 32); 279Debug.Assert(_image.Info.ColorType != SKColorType.Bgra8888 && _image.Info.ColorType != SKColorType.Rgba8888);
Microsoft.ML.InternalCodeAnalyzer (5)
ContractsCheckNameofFixProvider.cs (2)
18using Debug = System.Diagnostics.Debug; 50Debug.Assert(nameArg.Parent.Parent.IsKind(SyntaxKind.InvocationExpression));
INamedTypeSymbolExtensions.cs (1)
23Debug.Assert(factAttribute is object);
NameFixProvider.cs (2)
27using Debug = System.Diagnostics.Debug; 94Debug.Assert(!Enum.IsDefined(typeof(NameType), desiredName));
Microsoft.ML.TestFramework (2)
GlobalBase.cs (2)
24System.Diagnostics.Debug.WriteLine("*** Setting test assertion handler"); 63System.Diagnostics.Debug.WriteLine("*** Restoring test assertion handler");
Microsoft.ML.TestFrameworkCommon (1)
src\Common\tests\RetryHelper.cs (1)
62Debug.WriteLine(diagnostic);
Microsoft.ML.Tokenizers (115)
Model\BertTokenizer.cs (1)
32Debug.Assert(options is not null);
Model\BPETokenizer.cs (4)
810Debug.Assert(UnknownToken is not null); 1369Debug.Assert(mappingBuffer is not null); 1489Debug.Assert(mappingBuffer is not null); 1571Debug.Assert(mappingBuffer is not null);
Model\CodeGenTokenizer.cs (3)
478Debug.Assert(mappingBuffer is not null); 1162Debug.Assert(mappingBuffer is not null); 1226Debug.Assert(mappingBuffer is not null);
Model\EnglishRobertaTokenizer.cs (6)
917Debug.Assert(index + tokens[i].Value.Length <= indexMapping.Length); 959Debug.Assert(token[0] < charToString.Length); 967Debug.Assert(c < charToString.Length); 977Debug.Assert(pairs.Count != 0, "Pairs should not be empty."); 1150Debug.Assert(rank < _symbols.Count); 1248Debug.Assert(stream is not null);
Model\SentencePieceBaseModel.cs (9)
266Debug.Assert(bytesPoolArray is not null); 301Debug.Assert(sb[suffixIndex] == SentencePieceNormalizer.DummyPrefix); 302Debug.Assert(sb.Length > suffixIndex); 321Debug.Assert(bytesCount >= 1); 322Debug.Assert(bytesPoolArray is not null); 539Debug.Assert(bytesPoolArray is not null); 598Debug.Assert(destination[suffixIndex] == ' '); 659Debug.Assert(bytesCount >= 1); 660Debug.Assert(bytesPoolArray is not null);
Model\SentencePieceBpeModel.cs (10)
107Debug.Assert(SpecialTokensRegex is not null); 359Debug.Assert(SpecialTokensRegex is not null); 360Debug.Assert(maxTokens > 0); 637Debug.Assert(SpecialTokensRegex is not null); 638Debug.Assert(maxTokens > 0); 895Debug.Assert(SpecialTokensRegex is not null); 896Debug.Assert(maxTokens > 0); 897Debug.Assert(text.Length > 0); 1131Debug.Assert(text.Length > 0); 1132Debug.Assert(symbols.Length >= text.Length);
Model\SentencePieceUnigramModel.cs (32)
80Debug.Assert(modelProto.TrainerSpec.UnkId >= 0); 81Debug.Assert(modelProto.TrainerSpec.BosId >= 0); 82Debug.Assert(modelProto.TrainerSpec.EosId >= 0); 171Debug.Assert(pieces is not null); 448Debug.Assert(res); 449Debug.Assert(bytesConsumed == utf8Bytes.Length); 450Debug.Assert(charsWritten == expectedCount); 478Debug.Assert(res); 492Debug.Assert(SpecialTokensRegex is not null); 569Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) * 3 <= buffer.Length * sizeof(int)); 577Debug.Assert(normalizationSpan.Length >= (byteCount << 1)); 706Debug.Assert(codepointLength > 0); 748Debug.Assert(normalized.Length > 0); 753Debug.Assert(bestPathEndsAt.Length >= size + 1); 901Debug.Assert(normalizedString is not null); 928Debug.Assert(SpecialTokensRegex is not null); 929Debug.Assert(maxTokenCount > 0); 1014Debug.Assert(unknownTokensCount > 0); 1015Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1018Debug.Assert(unknownTokensCount == 1 || unknownTokensTracking![0].IdsIndex > unknownTokensTracking![1].IdsIndex); 1031Debug.Assert(ids[IdsIndex] == UnknownId); 1113Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1130Debug.Assert(ByteFallback || (unknownTokensCount == 0 && unknownTokensTracking is null)); 1134Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1147Debug.Assert(normalizedString is null); 1160Debug.Assert(unknownTokensCount > 0 && unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1171Debug.Assert(j < unknownTokensCount); 1202Debug.Assert(unknownTokensTracking is not null && unknownTokensTracking.Length >= unknownTokensCount); 1309Debug.Assert(SpecialTokensRegex is not null); 1310Debug.Assert(maxTokenCount > 0); 1583Debug.Assert(SpecialTokensRegex is not null); 1584Debug.Assert(maxTokenCount > 0);
Model\TiktokenTokenizer.cs (14)
136Debug.Assert(_cache is not null); 137Debug.Assert(_decoder is not null); 301Debug.Assert(!text.IsEmpty); 328Debug.Assert(encodedLength < indexMappingSpan.Length); 338Debug.Assert(encodedTokens.Length > 0); 420Debug.Assert(maxTokenCount > 0); 445Debug.Assert(encodedLength < indexMappingSpan.Length); 586Debug.Assert(maxTokens > 0); 610Debug.Assert(encodedLength < indexMappingSpan.Length); 712Debug.Assert(maxTokens > 0); 736Debug.Assert(encodedLength < indexMappingSpan.Length); 908Debug.Assert(incompleteCharsWritten == 0); 909Debug.Assert(hangingIdsCount == 0); 910Debug.Assert(utf8BytesIncompleteIndex == 0);
Model\WordPieceTokenizer.cs (5)
37Debug.Assert(vocab is not null); 38Debug.Assert(vocabReverse is not null); 315Debug.Assert(!text.IsEmpty); 351Debug.Assert(_vocabReverse.ContainsKey(id)); 448Debug.Assert(maxTokenCount > 0);
Normalizer\BertNormalizer.cs (1)
86Debug.Assert(length > 0);
Normalizer\LowerCaseNormalizer.cs (1)
48Debug.Assert(length == original.Length);
Normalizer\SentencePieceNormalizer.cs (6)
62Debug.Assert(trieBlob is not null); 274Debug.Assert(bufferIndex < span.Length - 1); 307Debug.Assert(bufferIndex < span.Length); 323Debug.Assert(!input.IsEmpty); 367Debug.Assert(_normalized is not null); 432Debug.Assert(p > 0);
Normalizer\UpperCaseNormalizer.cs (1)
48Debug.Assert(length == original.Length);
PreTokenizer\CompositePreTokenizer.cs (2)
94Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers."); 172Debug.Assert(preTokenizerIndex < preTokenizers.Count, "Index out of range for pre-tokenizers.");
Utils\Helpers.cs (11)
32Debug.Assert(span.Length <= newSize); 69Debug.Assert(!text.IsEmpty); 70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 71Debug.Assert(indexMapping.Length >= destination.Length); 123Debug.Assert(!text.IsEmpty); 124Debug.Assert(destination.Length >= 4); 161Debug.Assert(!text.IsEmpty); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 163Debug.Assert(indexMapping.Length >= destination.Length); 237Debug.Assert(utf16Chars.Length >= GetUtf16LengthFromUtf8Bytes(utf8Bytes)); 321Debug.Assert(input.Length > 0);
Utils\Helpers.netcoreapp.cs (3)
45Debug.Assert(success); 46Debug.Assert(bytes.Length == bytesWritten); 81Debug.Assert(textIndex < text.Length);
Utils\ValueStringBuilder.cs (6)
40Debug.Assert(value >= 0); 41Debug.Assert(value <= _chars.Length); 51Debug.Assert(capacity >= 0); 87Debug.Assert(index < _pos); 394Debug.Assert(additionalCapacityBeyondPos > 0); 395Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
Microsoft.ML.Tokenizers.Data.Tests (1)
src\Common\tests\RetryHelper.cs (1)
62Debug.WriteLine(diagnostic);
Microsoft.ML.Tokenizers.Tests (15)
src\Common\tests\RetryHelper.cs (1)
62Debug.WriteLine(diagnostic);
src\Microsoft.ML.Tokenizers\Utils\Helpers.cs (11)
32Debug.Assert(span.Length <= newSize); 69Debug.Assert(!text.IsEmpty); 70Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 71Debug.Assert(indexMapping.Length >= destination.Length); 123Debug.Assert(!text.IsEmpty); 124Debug.Assert(destination.Length >= 4); 161Debug.Assert(!text.IsEmpty); 162Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 163Debug.Assert(indexMapping.Length >= destination.Length); 237Debug.Assert(utf16Chars.Length >= GetUtf16LengthFromUtf8Bytes(utf8Bytes)); 321Debug.Assert(input.Length > 0);
src\Microsoft.ML.Tokenizers\Utils\Helpers.netcoreapp.cs (3)
45Debug.Assert(success); 46Debug.Assert(bytes.Length == bytesWritten); 81Debug.Assert(textIndex < text.Length);
Microsoft.ML.TorchSharp (7)
NasBert\Modules\MultiHeadAttention.cs (4)
243Debug.Assert(k.IsNotNull() && v.IsNotNull()); 248Debug.Assert(keyPaddingMaskPad.IsNull() || 265Debug.Assert(attentionWeights.size().SequenceEqual(new[] { batchSize * _numHeads, tgtLen, srcLen })); 294Debug.Assert(attention.size().SequenceEqual(new[] { batchSize * _numHeads, tgtLen, _headDim }));
Roberta\QATrainer.cs (1)
441Debug.Assert(robertaModel is not null);
Utils\MethodTable.cs (2)
145Debug.Assert(HasComponentSize); 157Debug.Assert(HasComponentSize);
Microsoft.ML.Transforms (1)
Expression\CodeGen.cs (1)
1405System.Diagnostics.Debug.WriteLine("Generated code '{0}' times for '{1}'", local.GenCount, local);
Microsoft.NET.Build.Containers (13)
AuthHandshakeMessageHandler.cs (3)
179Debug.Assert(bearerAuthInfo is not null); 201Debug.Assert(bearerAuthInfo is not null); 202Debug.Assert(validatedBearerRealm is not null);
Layer.cs (2)
142Debug.Assert(bytesWritten == uncompressedHash.Length); 150Debug.Assert(bW == hash.Length);
LocalDaemons\ContainerArchive.cs (1)
98Debug.Assert(multiArchImage.Images is not null);
LocalDaemons\ContainerRuntimes.cs (1)
275Debug.Assert(image.Images is not null);
Registry\DefaultBlobOperations.cs (1)
49Debug.Assert(configDoc is not null);
Registry\Registry.cs (2)
520Debug.Assert(content.Headers.TryAddWithoutValidation("Content-Range", $"{chunkStart}-{chunkStart + bytesRead - 1}")); 663Debug.Assert(destination.Tags.Length > 0);
Resources\Resource.cs (2)
35Debug.Assert(resource != null, $"Resource with name {name} was not found"); 49Debug.Assert(resource != null, $"Resource with name {name} was not found");
Telemetry.cs (1)
53System.Diagnostics.Debug.Assert(runtime != null, "Unknown local registry type");
Microsoft.NET.Build.Tasks (6)
ProjectContext.cs (3)
65Debug.Assert(lockFile != null); 66Debug.Assert(lockFileTarget != null); 69Debug.Assert(platformLibrary != null ||
ResolvePackageAssets.cs (3)
566Debug.Assert(!task.DisablePackageAssetsCache); 807Debug.Assert((_bufferedMetadata.Count % 2) == 0); 1518Debug.Assert(added);
Microsoft.NET.HostModel (46)
Bundle\Bundler.cs (5)
177Debug.Assert(false); 345Debug.Assert(endOfHost == hostLength, $"Host file size on disk does not match bytes written to the bundle. Expected {hostLength}, but got {endOfHost}. This may indicate that the host file is not a valid native binary or that it is not a single-file apphost."); 373Debug.Assert(bundleStream.Position - endOfHost <= bundledFilesSize, $"Not enough space allocated for bundled files. Allocated {bundledFilesSize}, but written {bundleStream.Position - endOfHost}"); 384Debug.Assert((long)endOfBundle == endOfBundledFiles + bundleManifestLength, $"Bundle manifest is unexpected size. Expected {bundleManifestLength}, but got {(long)endOfBundle - endOfBundledFiles}"); 391Debug.Assert(machFileReader is not null, "MachO file reader should not be null if the target is macOS.");
Bundle\FileEntry.cs (1)
56Debug.Assert(writer.BaseStream.Position - start == GetFileEntryLength(BundleMajorVersion, RelativePath),
Bundle\Manifest.cs (3)
143Debug.Assert(id.Length == BundleIdLength); 176Debug.Assert(writer.BaseStream.Position - startOffset == GetManifestLength(BundleMajorVersion, Files.Select(static f => f.RelativePath)), 188Debug.Assert(dummyBundleId.Length == BundleIdLength);
ComHost\ClsidMap.cs (1)
239Debug.Fail("Unknown attribute constructor kind");
HostModelUtils.cs (2)
82Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.OSX)); 83Debug.Assert(IsCodesignAvailable());
MachO\BinaryFormat\Blobs\BlobParser.cs (1)
34Debug.Assert(!Enum.IsDefined(typeof(BlobMagic), magic), "Blob magic is known but not handled.");
MachO\BinaryFormat\Blobs\CodeDirectoryBlob.cs (3)
76Debug.Assert(pageSize is MachObjectFile.DefaultCodeDirectoryPageSize or MachObjectFile.Arm64CodeDirectoryPageSize); 136Debug.Assert(hasher.HashSize / 8 == hashType.GetHashSize()); 308Debug.Assert(sizeof(uint) * 2 + CodeDirectoryHeader.Size == _cdHeader.IdentifierOffset);
MachO\BinaryFormat\Blobs\SimpleBlob.cs (1)
51Debug.Assert(bytesWritten == Size, "The number of bytes written does not match the expected size of the blob.");
MachO\BinaryFormat\Blobs\SuperBlob.cs (1)
132Debug.Assert(size == sizeof(uint) + sizeof(uint) + sizeof(uint)
MachO\MachObjectFile.cs (15)
148Debug.Assert(!machObject._codeSignatureLoadCommand.Command.IsDefault); 227Debug.Assert(_codeSignatureBlob is null); 266Debug.Assert(newLength != null); 437Debug.Assert(header.SizeOfCommands == commandsPtr - sizeof(MachHeader)); 475Debug.Assert(_codeSignatureLoadCommand.Command.GetDataOffset(_header) % CodeSignatureAlignment == 0); 476Debug.Assert(_codeSignatureLoadCommand.Command.GetDataOffset(_header) + _codeSignatureLoadCommand.Command.GetFileSize(_header) == GetFileSize()); 491Debug.Assert(!_linkEditSegment64.Command.IsDefault); 492Debug.Assert(!_symtabCommand.Command.IsDefault); 496Debug.Assert(linkEditFileSize <= linkEditVMSize); 499Debug.Assert(_symtabCommand.Command.GetStringTableOffset(_header) + _symtabCommand.Command.GetStringTableSize(_header) <= _codeSignatureLoadCommand.Command.GetDataOffset(_header)); 500Debug.Assert(_symtabCommand.Command.GetStringTableOffset(_header) + _symtabCommand.Command.GetStringTableSize(_header) <= GetSignatureStart()); 503Debug.Assert(_codeSignatureBlob is not null); 504Debug.Assert(_codeSignatureLoadCommand.Command.GetDataOffset(_header) % CodeSignatureAlignment == 0); 505Debug.Assert(csStart >= linkEditStart); 506Debug.Assert(csEnd <= linkEditStart + linkEditFileSize);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.cs (1)
195Debug.Assert(dataBuilder.CountBytes == 0);
src\runtime\src\coreclr\tools\Common\Compiler\Win32Resources\ResourceData.UpdateResourceDataModel.cs (4)
30Debug.Assert(type is string); 50Debug.Assert(name is string); 71Debug.Assert(type is string); 86Debug.Assert(name is string);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
Win32Resources\ObjectDataBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 114Debug.Assert(_numReservations > 0); 169Debug.Assert(_numReservations == 0); 179Debug.Assert((align == 2) || (align == 4) || (align == 8) || (align == 16));
Microsoft.Net.Http.Headers (3)
HeaderUtilities.cs (2)
266Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug."); 320Debug.Assert(false, $"Index '{nameof(current)}' not advanced, this is a bug.");
SetCookieHeaderValue.cs (1)
269Debug.Assert(formatted);
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
src\sdk\src\StaticWebAssetsSdk\Tasks\Data\StaticWebAsset.cs (1)
1769Debug.Assert(all != null);
Microsoft.NET.Sdk.Publish.Tasks (21)
MsDeploy\CommonUtility.cs (2)
413Debug.Assert(_isMSDeployInstalled || _strErrorMessage != null); 520Debug.Assert(MSWebDeploymentAssembly.DynamicAssembly != null && MSWebDeploymentAssembly.DynamicAssembly.Assembly != null);
MsDeploy\DynamicAssembly.cs (5)
56Debug.Assert(type != null); 71Debug.Assert(ret != null); 80Debug.Assert(ret != null); 126Debug.Assert(false, "DynamicAssembly.CreateObject Failed to get the constructorInfoObject"); 132Debug.Assert(createdObject != null);
MsDeploy\VsMSDeployObject.cs (6)
229Diagnostics.Debug.Assert(Utility.IsDeploymentWellKnownProvider(provider)); 247Diagnostics.Debug.Assert(taskItem != null); 261Diagnostics.Debug.Assert(Utility.IsDeploymentWellKnownProvider(m_provider)); 320Diagnostics.Debug.Assert(m_NameValueDictionary != null); 421Diagnostics.Debug.Assert(string.IsNullOrEmpty(value), "Not yet implement"); 426Diagnostics.Debug.Assert(false, "Not yet implement");
Tasks\MsDeploy\ImportParameterFile.cs (3)
45Debug.Assert(element != null); 65Debug.Assert(element != null); 120Debug.Assert(element != null && parentItem != null);
Tasks\MsDeploy\MSDeploy.cs (2)
661System.Diagnostics.Debug.Assert(false, "msdeploy.exe doesn't support parameterValidation entry in the command line for declareParameter yet."); 813System.Diagnostics.Debug.Assert(false, "msdeploy.exe doesn't support parameterValidation entry in the command line for declareParameter yet.");
Tasks\MsDeploy\VsMsdeploy.cs (1)
1084Diagnostics.Debug.Fail("Exception on ICancelableTask.Cancel being invoked:" + ex.Message);
Tasks\Xdt\TaskTransformationLogger.cs (2)
84Debug.Fail("Unknown MessageType"); 195Debug.Assert(IndentLevel > 0);
Microsoft.NET.Sdk.Razor.Tasks (2)
ReferenceResolver.cs (1)
97Debug.Assert(classification != Classification.Unknown);
src\sdk\src\RazorSdk\Tool\ServerProtocol\ServerConnection.cs (1)
274Debug.Assert(response != null);
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
Data\StaticWebAsset.cs (1)
1769Debug.Assert(all != null);
Microsoft.Private.Windows.Core (71)
src\winforms\src\Microsoft.Private.Windows.Polyfills\System\IO\PathExtensions.cs (1)
55Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths");
System\Collections\Generic\ArrayBuilder.cs (4)
55Debug.Assert(_count == _items.Length); 58Debug.Assert(_items.Length > 0); 68Debug.Assert(_count == _maxCount); 69Debug.Assert(_count == _items.Length);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
803Debug.WriteLine($"Failed to binary format: {ex.Message}"); 804Debug.Assert(ex is ArgumentException or SerializationException, "Unexpected write exception.");
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (1)
100Debug.Assert(s_knownTypes.Count == 60);
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
15Debug.Assert(!string.IsNullOrWhiteSpace(assemblyName)); 16Debug.Assert(!string.IsNullOrWhiteSpace(fullTypeName));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
51Debug.Fail(ex.Message); 289Debug.Assert(record.RecordType is SerializationRecordType.MemberPrimitiveTyped);
System\Private\Windows\Ole\BinaryFormatUtilities.cs (3)
35Debug.Assert(data is not null); 52Debug.Fail($"Unexpected exception writing binary formatted data. {ex.Message}"); 92Debug.Assert(request.TypedRequest || typeof(T) == typeof(object), "Untyped requests should always be asking for object");
System\Private\Windows\Ole\ClipboardCore.cs (1)
283Debug.Assert(proxyDataObject.IsNull);
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (8)
389Debug.Assert(e is NotSupportedException, e.Message); 423Debug.WriteLineIf(hr == HRESULT.CLIPBRD_E_BAD_DATA, "CLIPBRD_E_BAD_DATA returned when trying to get clipboard data."); 424Debug.WriteLineIf(hr == HRESULT.DV_E_TYMED, "DV_E_TYMED returned when trying to get clipboard data."); 426Debug.WriteLineIf(hr == HRESULT.E_UNEXPECTED, "E_UNEXPECTED returned when trying to get clipboard data."); 427Debug.WriteLineIf(hr == HRESULT.COR_E_SERIALIZATION, 453Debug.WriteLine(ex.ToString()); 610Debug.Fail("All mapped formats must be either restricted or not restricted."); 675Debug.Assert(!nativeDataObject.IsNull, "You must have an innerData on all DataObjects");
System\Private\Windows\Ole\DataStore.cs (1)
49Debug.Assert(mappedFormat != format);
System\Private\Windows\Ole\FormatEnumerator.cs (1)
37Debug.WriteLine("IDataObject.GetFormats returned null.");
System\Private\Windows\Ole\TypeBinder.cs (4)
55Debug.Assert(request.TypedRequest || request.Resolver is null, "Untyped methods should not provide a resolver."); 56Debug.Assert(request.TypedRequest || rootType == typeof(object), "Untyped requests should always be asking for object"); 70Debug.Assert(CoreAppContextSwitches.ClipboardDragDropEnableUnsafeBinaryFormatterSerialization); 71Debug.Assert(FeatureSwitches.EnableUnsafeBinaryFormatterSerialization);
System\SpanHelpers.cs (1)
15Debug.Assert(!destination.IsEmpty);
System\SpanReader.cs (3)
260Debug.Assert((uint)count <= (uint)_unread.Length); 267Debug.Assert((uint)length <= (uint)span.Length); 278Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\SpanWriter.cs (2)
92Debug.Assert((uint)count <= (uint)_unwritten.Length); 99Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (6)
51Debug.Assert(value >= 0); 52Debug.Assert(value <= _chars.Length); 62Debug.Assert(capacity >= 0); 99Debug.Assert(index < _pos); 321Debug.Assert(additionalCapacityBeyondPos > 0); 322Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\TypeExtensions.cs (2)
29Debug.Assert(type is not null); 280Debug.Fail(e.Message);
System\Value.cs (3)
55Debug.Assert(type.IsArray); 68Debug.Fail($"Unexpected type {type.Name}."); 670Debug.Assert(Unsafe.SizeOf<T>() <= sizeof(ulong));
System\Value.PackedDateTimeOffset.cs (1)
57Debug.Assert(hours is >= 0 and <= 28);
Windows\Win32\Foundation\HRESULT.cs (3)
38Debug.Assert(IsNtStatus); 54Debug.WriteLine(ex); 58public void AssertSuccess() => Debug.Assert(Succeeded, $"Result failed: {this}");
Windows\Win32\Graphics\Gdi\ARGB.cs (2)
25Debug.Assert(BitConverter.IsLittleEndian); 35Debug.Assert(BitConverter.IsLittleEndian);
Windows\Win32\Graphics\Gdi\RegionScope.cs (1)
45Debug.Assert(result != -1, "GetClipRgn failed");
Windows\Win32\Graphics\GdiPlus\GdiPlusInitialization.cs (1)
15Debug.Assert(s_initToken == 0, "GdiplusInitialization: Initialize should not be called more than once!");
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (4)
19Debug.Assert(status != Status.Ok, "Throwing an exception for an 'Ok' return code"); 62Debug.Fail("We should be special casing FontFamilyNotFound so we can provide the font name"); 66Debug.Fail("We should be special casing FontStyleNotFound so we can provide the font name"); 70Debug.Fail("We should be special casing NotTrueTypeFont so we can provide the font name");
Windows\Win32\PInvokeCore.GetSysColorBrush.cs (1)
27Debug.Assert(systemColor.IsSystemColor);
Windows\Win32\PInvokeCore.GetWindowText.cs (2)
31Debug.Fail($"GetWindowTextLength failed. Error: {new Win32Exception(error).Message}"); 50Debug.Fail($"GetWindowText failed. Error: {new Win32Exception().Message}");
Windows\Win32\System\Com\AgileComPointer.cs (2)
89Debug.Assert(count >= 0); 197Debug.Assert(hr.Succeeded);
Windows\Win32\System\Com\ComHelpers.cs (4)
113Debug.WriteLine($"Did not find IUnknown for {@object.GetType().Name}. {ex.Message}"); 191Debug.Fail("How did we fail to query for IUnknown?"); 229Debug.WriteLine($"{nameof(TryGetObjectForIUnknown)}: Failed to get object for {typeof(TObject).Name}. {ex.Message}"); 237Debug.WriteLineIf(count > 0, $"{nameof(TryGetObjectForIUnknown)}: Count for {typeof(TObject).Name} is {count} after release.");
Windows\Win32\System\Com\GlobalInterfaceTable.cs (1)
66Debug.WriteLineIf(hr.Failed, $"{nameof(GlobalInterfaceTable)}: Failed to revoke interface.");
Windows\Win32\System\Com\IDispatch.cs (1)
60Debug.WriteLine($"""
Windows\Win32\System\Com\Lifetime.cs (1)
27Debug.Assert(lifetime->_refCount > 0);
Microsoft.SourceLink.AzureDevOpsServer.Git (5)
src\sourcelink\src\Common\AzureDevOps\AzureDevOpsUrlParser.cs (1)
224Debug.Assert(type is "_git" or "_ssh" or null);
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.AzureRepos.Git (5)
src\sourcelink\src\Common\AzureDevOps\AzureDevOpsUrlParser.cs (1)
224Debug.Assert(type is "_git" or "_ssh" or null);
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.Bitbucket.Git (5)
GetSourceLinkUrl.cs (1)
85Debug.Assert(i >= -1);
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.Common (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.Gitea (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.Gitee (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.GitHub (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.GitLab (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.GitWeb (4)
src\sourcelink\src\Common\Utilities\NullableAttributes.cs (4)
105/// <inheritdoc cref="Debug.Assert(bool)"/> 108=> Debug.Assert(b); 110/// <inheritdoc cref="Debug.Assert(bool, string)"/> 113=> Debug.Assert(b, message);
Microsoft.SourceLink.Tools.Package (1)
SourceLinkMap.cs (1)
221Debug.Assert(mappedUri.Suffix.Length == 0);
Microsoft.TemplateEngine.Cli (2)
CliTemplateParameter.cs (1)
177Debug.Fail($"Unexpected Option type: {option.GetType()}");
Commands\create\InstantiateCommandArgs.cs (1)
57Debug.Assert(parseResult.CommandResult.Command is NewCommand);
Microsoft.TemplateEngine.Core (3)
Expressions\Cpp\CppStyleEvaluatorDefinition.cs (2)
269Debug.Assert( 524Debug.Assert(parents.Count == 0, "Unbalanced condition");
Operations\Conditional.cs (1)
320Debug.Assert(true, "Unknown token index: " + token);
Microsoft.TestPlatform.AdapterUtilities (4)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.TestPlatform.Build (5)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Tasks\VSTestTask2.cs (1)
72Debug.WriteLine($"VSTESTTASK2: Received output {singleLine}, importance {messageImportance}");
Microsoft.TestPlatform.CommunicationUtilities (5)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Serialization\StjSafe.cs (1)
27Debug.Assert(
Microsoft.TestPlatform.CoreUtilities (5)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Tracing\EqtTrace.cs (1)
825Debug.Fail(message);
Microsoft.TestPlatform.CrossPlatEngine (5)
Client\MTP\MtpServerConnection.cs (1)
201Debug.Assert(_stream != null, "Stream must be set before the read loop starts.");
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.TestPlatform.Extensions.BlameDataCollector (4)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.TestPlatform.Filter.Source (2)
FilterExpression.cs (2)
131Debug.Fail("ProcessOperator called for Unexpected operator."); 373Debug.Assert(result.Count == 1, "Result stack should have one element at the end.");
Microsoft.TestPlatform.PlatformAbstractions (10)
common\Tracing\PlatformEqtTrace.cs (6)
201Debug.Fail("Should never get here!"); 273Debug.Fail("Should never get here!"); 309Debug.WriteLine("Ignore exception: " + e); 407Debug.Fail("Could not get process name from command line, will try to use the slow way."); 417Debug.Fail("Could not get process name: " + e); 432Debug.Fail("Could not get process id: " + e);
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.TestPlatform.TestHostRuntimeProvider (4)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.TestPlatform.Utilities (4)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.VisualBasic.Core (344)
Microsoft\VisualBasic\Collection.vb (17)
58Debug.Assert(m_KeyedNodesHash.ContainsKey(Key), "We got an argumentexception from a hashtable add, but it wasn't a duplicate key.") 78Debug.Assert(BeforeNode IsNot Nothing) 93Debug.Assert(AfterNode IsNot Nothing) 156Debug.Assert(node IsNot Nothing) 162Debug.Assert(node.m_Key IsNot Nothing, "How can that be? We just found it by its key.") 170Debug.Assert(node Is Nothing) 178Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing") 197Debug.Assert(node IsNot Nothing, "Should have thrown rather than returning Nothing") 213Debug.Assert(node IsNot Nothing) 337Debug.Assert(CultureInfo IsNot Nothing) 385Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we remove a non-existent node ?") 448Debug.Assert(NodeToInsertBefore IsNot Nothing, "FastList.InsertBefore: NodeToInsertBefore may not be nothing") 456Debug.Assert(NodeToInsertAfter IsNot Nothing, "FastList.InsertAfter: NodeToInsertAfter may not be nothing") 514Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we delete a non-existent node ?") 518Debug.Assert(NodeToBeDeleted Is m_StartOfList, "How can any node besides the first node not have a previous node ?") 571Debug.Assert(NewOrRemovedNode IsNot Nothing, "AdjustIndexes: Node shouldn't be Nothing") 681Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (34)
150Debug.Assert(GetTypeCode(Result.GetType()) = tc, "Widest type is invalid") 160Debug.Assert(TypeCode.Empty = 0, "wrong value!") 161Debug.Assert(TypeCode.Object = 1, "wrong value!") 162Debug.Assert(TypeCode.Boolean = 3, "yte is wrong value!") 163Debug.Assert(TypeCode.Char = 4, "wrong value!") 164Debug.Assert(TypeCode.SByte = 5, "wrong value!") 165Debug.Assert(TypeCode.Byte = 6, "wrong value!") 166Debug.Assert(TypeCode.Int16 = 7, "wrong value!") 167Debug.Assert(TypeCode.UInt16 = 8, "wrong value!") 168Debug.Assert(TypeCode.Int32 = 9, "wrong value!") 169Debug.Assert(TypeCode.UInt32 = 10, "wrong value!") 170Debug.Assert(TypeCode.Int64 = 11, "wrong value!") 171Debug.Assert(TypeCode.UInt64 = 12, "wrong value!") 172Debug.Assert(TypeCode.Single = 13, "wrong value!") 173Debug.Assert(TypeCode.Double = 14, "wrong value!") 174Debug.Assert(TypeCode.Decimal = 15, "wrong value!") 175Debug.Assert(TypeCode.DateTime = 16, "wrong value!") 176Debug.Assert(TypeCode.String = 18, "wrong value!") 185Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 204Debug.Assert(IsIntrinsicType(targetTypeCode) AndAlso IsIntrinsicType(sourceTypeCode), "expected intrinsics here") 213Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 250Debug.Assert(False, "all conversions from interface should have been handled by now") 331Debug.Assert(Not IsInterface(sourceType), 362Debug.Assert(IsInterface(targetInterface), "Non-Interface type unexpected!!!") 363Debug.Assert(IsArrayType(sourceArrayType), "Non-Array type unexpected!!!") 478Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.") 590Debug.Assert(types.Count > 0, "unexpected empty set") 597Debug.Assert(candidate Is maxEncompassing OrElse Not Encompasses(maxEncompassing, candidate), 616Debug.Assert(types.Count > 0, "unexpected empty set") 624Debug.Assert(candidate Is maxEncompassed OrElse Not Encompasses(candidate, maxEncompassed), 839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state") 848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state") 944Debug.Assert(ClassifyPredefinedConversion(targetType, sourceType) = ConversionClass.None, 979Debug.Assert(operatorSet.Count > 0, "expected operators")
Microsoft\VisualBasic\CompilerServices\Conversions.vb (8)
2419Debug.Assert(iconv.GetTypeCode = GetTypeCode(TargetType), "expected types to match") 2439Debug.Fail("shouldn't reach here") 2457Debug.Assert(IsIntrinsicType(Expression.GetType) OrElse IsEnum(Expression.GetType), "this function converts between intrinsic types only") 2482Debug.Fail("Expected intrinsic type only, not: " & TargetType.Name) 2517Debug.Assert(Not SourceType.IsByRef, "never expected to see byref source type") 2548Debug.Assert(ClassifyPredefinedConversion(TargetType, SourceType) = ConversionClass.None OrElse 2612Debug.Assert(Result = ConversionClass.Widening OrElse Result = ConversionClass.Narrowing, 2643Debug.Assert(
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (6)
293Debug.Assert(OperatingSystem.IsWindows()) 599Debug.Assert(False, ex.Message) 851Debug.Assert(False) 1212Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 1229Debug.Assert(False, "How can a property get here ?") 1234Debug.Assert(False, "How did we get here ?")
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (31)
78Debug.Assert(Options <> CompareOptions.Ordinal, "Char expansion check unexpected during binary compare") 455Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 456Debug.Assert(Not MatchBothCharsOfExpandedCharInRight OrElse Not UseUnexpandedCharForRight, "Conflicting compare options") 493Debug.Assert(LeftEnd < LeftLength AndAlso RightEnd < RightLength, "Comparing chars beyond end of string") 517Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 537Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text") 563Debug.Assert(PatternIndex <= PatternLength AndAlso 567Debug.Assert(RangeList Is Nothing OrElse ValidatePatternWithoutMatching, "Unexpected options to MatchRange") 784Debug.Assert(Not ValidatePatternWithoutMatching, "Unexpected string matching when validating pattern string") 912Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 916Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 924Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 928Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type") 942Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 946Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type") 958Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 962Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 971Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 975Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type") 1165Debug.Assert(False, "Unexpected pattern kind") 1190Debug.Assert(PatternIndex <= PatternLength AndAlso 1229Debug.Assert(PatternGroups IsNot Nothing AndAlso 1281Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.NONE, "Unexpected pattern end") 1310Debug.Assert(False, "Unexpected pattern kind") 1356Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.STAR, "Unexpected start of pattern groups list") 1498Debug.Assert(SourceIndex <= PGCurrent.MaxSourceIndex, "Pattern matching lost") 1524Debug.Assert(PatternGroups(PGPrevMismatchIndex).PatType <> PatternType.NONE, "Bad previous mismatch index") 1605Debug.Assert(PG.PatType = PatternType.EXCLIST OrElse PG.PatType = PatternType.INCLIST, "Unexpected pattern group") 1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected") 1617Debug.Assert(Range.Start >= 0, "NULL Range start unexpected") 1729Debug.Assert(Options <> CompareOptions.Ordinal, "This method should not be invoked in Option compare binary mode")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (27)
522Debug.Assert(False, "the resolution should have thrown an exception") 720Debug.Assert(False, "the resolution should have thrown an exception - should never reach here") 1096Debug.Assert(False, "the resolution should have thrown an exception") 1182Debug.Assert(baseReference IsNot Nothing, "Nothing unexpected") 1183Debug.Assert(arguments IsNot Nothing, "Nothing unexpected") 1184Debug.Assert(argumentNames IsNot Nothing, "Nothing unexpected") 1185Debug.Assert(typeArguments IsNot Nothing, "Nothing unexpected") 1217Debug.Assert(False, "If ReportErrors is True, GetMembers should have thrown above") 1244Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.") 1255Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.") 1259Debug.Assert(propInfo.GetSetMethod Is Nothing OrElse HasIsExternalInitModifier(propInfo.GetSetMethod), "expected error condition") 1263Debug.Assert(propInfo.GetGetMethod Is Nothing, "expected error condition") 1293Debug.Assert(baseReference IsNot Nothing, "expected a base reference") 1294Debug.Assert(methodName IsNot Nothing, "expected method name") 1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members") 1296Debug.Assert(arguments IsNot Nothing AndAlso 1353Debug.Assert(failure = OverloadResolution.ResolutionFailure.None OrElse Not reportErrors, 1357Debug.Assert(resolutionResult Is Nothing, "resolution failed so should have no result") 1361Debug.Assert(resolutionResult IsNot Nothing, "resolution didn't fail, so should have result") 1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1415Debug.Assert(resolutionResult.IsMethod, "must be a method") 1429Debug.Assert(GetCallTarget(resolutionResult, lookupFlags).Name.StartsWith("set_"), "expected set accessor") 1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 1483Debug.Assert(False, "not a method or property??") 1493Debug.Assert(targetProcedure IsNot Nothing AndAlso arguments IsNot Nothing, "expected arguments") 1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value") 1515Debug.Assert(GetCallTarget(targetProcedure, lookupFlags).Name.StartsWith("set_"), "expected set accessor")
Microsoft\VisualBasic\CompilerServices\ObjectType.vb (2)
330Diagnostics.Debug.Assert(Not FromType Is ToType, "IsWideningConversion invalid for like types") 1080Diagnostics.Debug.Assert(Int16Result <= 0, "Invalid result")
Microsoft\VisualBasic\CompilerServices\Operators.Resolution.vb (5)
116Debug.Assert((IsBinaryOperator(op) AndAlso arguments.Length = 2) OrElse 137Debug.Assert(arguments.Length > 1, "unary op on Nothing unexpected here") 138Debug.Assert(arguments(1) IsNot Nothing, "binary op on Nothing operands unexpected here") 193Debug.Assert(operatorMethod IsNot Nothing, "Operator can't be nothing at this point") 209Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
Microsoft\VisualBasic\CompilerServices\Operators.vb (13)
56Debug.Assert(left Is Nothing OrElse right Is Nothing OrElse left.GetType.GetTypeCode = right.GetType.GetTypeCode, 148Debug.Assert(comparison = CompareClass.Less OrElse 167Debug.Assert(comparison = CompareClass.Less OrElse 186Debug.Assert(comparison = CompareClass.Less OrElse 205Debug.Assert(comparison = CompareClass.Less OrElse 224Debug.Assert(comparison = CompareClass.Less OrElse 243Debug.Assert(comparison = CompareClass.Less OrElse 262Debug.Assert(comparison = CompareClass.Less OrElse 281Debug.Assert(comparison = CompareClass.Less OrElse 300Debug.Assert(comparison = CompareClass.Less OrElse 319Debug.Assert(comparison = CompareClass.Less OrElse 338Debug.Assert(comparison = CompareClass.Less OrElse 357Debug.Assert(comparison = CompareClass.Less OrElse
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (50)
98Debug.Assert(IsNumericType(leftType) AndAlso Not IsEnum(leftType) AndAlso 105Debug.Assert(GetTypeCode(leftType) <> GetTypeCode(rightType), 414Debug.Assert(False, "Unexpected comparison type!!!") 424Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 654Debug.Assert((baseReference IsNot Nothing AndAlso baseReference.IsWindowsRuntimeObject) OrElse 686Debug.Assert(False, "unexpected code path") 728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!") 783Debug.Assert(propertyBlock.GetSetMethod Is Nothing OrElse 790Debug.Assert(setMethod IsNot Nothing, "must have set here") 813Debug.Assert(False, "what is this? just ignore it.") 822Debug.Assert(candidateSignature IsNot Nothing, "must have signature if we have a method") 876Debug.Assert(Not collectOnlyOperators, "didn't expect operator with paramarray") 1040Debug.Assert(Not IsGenericParameter(argumentType), "Generic parameter unexpected!!!") 1116Debug.Assert(Not parameterType.IsByRef, "didn't expect byref parameter type here") 1117Debug.Assert(IsRawGeneric(targetProcedure), "Type inference for instantiated generic unexpected!!!") 1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length, 1219Debug.Assert(IsParamArray(parameter), "expected ParamArray parameter") 1319Debug.Assert(targetProcedure.IsMethod, "we shouldn't be inferring type arguments for non-methods") 1348Debug.Assert(parameter IsNot Nothing AndAlso parameterType IsNot Nothing) 1426Debug.Assert(Not (errors Is Nothing AndAlso 1449Debug.Assert(arguments.Length <= parameters.Length OrElse 1486Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1527Debug.Assert(arguments.Length - argIndex <= 1, 1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match") 1715Debug.Assert(targetProcedure.ArgumentsValidated, 1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse 1720Debug.Assert(arguments.Length <= parameters.Length OrElse 1747Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1775Debug.Assert(arguments.Length - argIndex = 1, 1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 1822Debug.Assert(Not matchedParameters(paramIndex), "named argument match collision") 1834Debug.Assert(parameters(index).IsOptional, 1857Debug.Assert(arguments.Length <= parameters.Length OrElse 1890Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex, 1915Debug.Assert(arguments.Length - argIndex <= 1, 1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this. 2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match") 2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match") 2113Debug.Assert(candidate.ArgumentMatchingDone = False, "Argument matching being done multiple times!!!") 2217Debug.Assert(False, "Unexpected comparison type!!!") 2296Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce), 2357Debug.Assert(candidateCount = 1, "Surprising overload candidate remains.") 2462Debug.Assert(errors IsNot Nothing, "expected error table") 2477Debug.Assert(errors IsNot Nothing, "expected error table") 2490Debug.Assert(errors IsNot Nothing, "expected error table") 2499Debug.Assert(errors IsNot Nothing, "expected error table") 2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail") 2565Debug.Assert(candidateReportCount > 0, "expected at least one candidate")
Microsoft\VisualBasic\CompilerServices\StructUtils.vb (1)
96Debug.Assert(PackSize = 1, "PackSize is not actually set to anything other than 1 in the current library. " _
Microsoft\VisualBasic\CompilerServices\Symbols.vb (28)
181Debug.Assert(IsUserDefinedOperator(method), "expected operator here") 431Debug.Assert(Not IsInterface(implementor), "interfaces can't implement, so why call this?") 432Debug.Assert(IsInterface([interface]), "expected interface, not " & [interface].FullName) 447Debug.Assert((Not derived.IsByRef) AndAlso (Not derived.IsPointer)) 448Debug.Assert((Not base.IsByRef) AndAlso (Not base.IsPointer)) 517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type") 523Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter") 530Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter") 542Debug.Assert(genericMethodDef IsNot Nothing AndAlso IsRawGeneric(genericMethodDef), "Uninstantiated generic expected!!!") 563Debug.Assert(referringType.DeclaringMethod.IsGenericMethodDefinition, "Unexpected generic method instantiation!!!") 626Debug.Assert(method1 IsNot Nothing AndAlso IsRawGeneric(method1), "Generic method def expected!!!") 627Debug.Assert(method2 IsNot Nothing AndAlso IsRawGeneric(method2), "Generic method def expected!!!") 666Debug.Assert(False, "unexpected membertype") 678Debug.Assert(type.HasElementType, "expected type with element type") 708Debug.Assert(parameters IsNot Nothing, "expected parameter array") 938Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 999Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object") 1146Debug.Assert(Me.IsArray, "expected array when getting array value") 1147Debug.Assert(indices IsNot Nothing, "expected valid indices") 1195Debug.Assert(Me.IsArray, "expected array when setting array value") 1196Debug.Assert(arguments IsNot Nothing, "expected valid indices") 1258Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase") 1260Debug.Assert(Not targetProcedure.IsGeneric OrElse 1390Debug.Assert(rawMethod IsNot Nothing) 1478Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments") 1479Debug.Assert(Me.IsMethod, "binding to a non-method") 1491Debug.Assert(Me.IsMethod, "casting a non-method to a method") 1496Debug.Assert(Me.IsProperty, "casting a non-property to a property")
Microsoft\VisualBasic\CompilerServices\Utils.LateBinder.vb (1)
360Debug.Assert(typ IsNot Nothing AndAlso Not typ.IsArray, "Error in array type processing")
Microsoft\VisualBasic\CompilerServices\Utils.vb (2)
261Debug.Assert(Not (TypeOf member1 Is MethodBase) OrElse 323Debug.Assert(typeParam.IsGenericParameter)
Microsoft\VisualBasic\CompilerServices\VB6BinaryFile.vb (1)
184Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6File.vb (13)
672Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1026Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1037Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1049Diagnostics.Debug.Assert(ByteLength <= lengthToWrite) 1057Diagnostics.Debug.Assert(m_Encoding.GetByteCount(s) = lengthToWrite) 1070Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1090Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1108Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1852Debug.Assert(m_Encoding.GetByteCount(sTemp) = ByteLength) 1859Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 1867Debug.Assert(m_Encoding.GetByteCount(sTemp) = FixedStringLength) 1877Debug.Assert(ByteLength <= FixedStringLength) 1891Debug.Assert(ByteLength = m_Encoding.GetByteCount(sTemp) AndAlso ByteLength <= FixedStringLength)
Microsoft\VisualBasic\CompilerServices\VB6InputFile.vb (1)
60Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6OutputFile.vb (2)
86Diagnostics.Debug.Assert(Not m_Encoding Is Nothing) 108Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VB6RandomFile.vb (1)
417Diagnostics.Debug.Assert(Not m_Encoding Is Nothing)
Microsoft\VisualBasic\CompilerServices\VBBinder.vb (8)
1060Diagnostics.Debug.Assert(AmbiguousCount > 0) 1240Debug.Assert(Not SelectedMatch Is Nothing, "Should have already thrown an exception") 1967Diagnostics.Debug.Assert(False, "Should never be reached") 1976Debug.Assert((invokeAttr And BindingFlags.CreateInstance) = 0, "CreateInstance not supported") 1978Debug.Assert(Not name Is Nothing, "Invalid argument") 2248Debug.Assert((Not m_objType Is Nothing) AndAlso (Not m_BindToName Is Nothing)) 2286Debug.Assert(Not Member Is Nothing, "How can this be Nothing ?") 2299Debug.Assert(False, "How can a property get here ?")
Microsoft\VisualBasic\ErrObject.vb (2)
175Diagnostics.Debug.Assert((Not m_HelpContextIsSet) OrElse (Not m_HelpFileIsSet), "Why is this getting called?") 369Diagnostics.Debug.Assert(e IsNot Nothing, "Exception shouldn't be Nothing")
Microsoft\VisualBasic\FileIO\FileSystem.vb (44)
685Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(directory), 722Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(file), 863Debug.Assert(StrCollection IsNot Nothing, "StrCollection is NULL") 895Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 936Debug.Assert(TargetDirectoryFullPath.Length > SourceDirectoryFullPath.Length, "Target path should be longer") 964Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source") 966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target") 987Debug.Assert(IO.Directory.Exists(targetDirectoryPath), "Should be able to create Target Directory") 1013Debug.Assert([Enum].IsDefined(Operation), "Invalid Operation") 1014Debug.Assert(Exceptions IsNot Nothing, "Null exception list") 1015Debug.Assert(SourceDirectoryNode IsNot Nothing, "Null source node") 1032Debug.Assert(IO.Directory.Exists(SourceDirectoryNode.TargetPath), "TargetPath should have existed or exception should be thrown") 1095Debug.Assert([Enum].IsDefined(operation), "Invalid Operation") 1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath) 1268Debug.Assert(Text <> "", "Empty text") 1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1330Debug.Assert(Not (TypeOf ex Is ArgumentException Or TypeOf ex Is ArgumentOutOfRangeException Or 1382Debug.Assert(Results IsNot Nothing, "Results is NULL") 1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path) 1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path) 1451Debug.Assert(NewName <> "", "Null NewName") 1452Debug.Assert(ArgumentName <> "", "Null argument name") 1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path") 1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1") 1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1, 1517Debug.Assert(Not (TypeOf ex Is ArgumentException OrElse 1600Debug.Assert([Enum].IsDefined(Operation)) 1601Debug.Assert([Enum].IsDefined(TargetType)) 1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath") 1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath") 1604Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path") 1668Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???") 2096Debug.Assert(IO.Directory.Exists(DirectoryPath), "Directory does not exist") 2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath") 2157Debug.Assert(Encoding IsNot Nothing, "Null Decoder") 2158Debug.Assert(Text <> "", "Empty Text") 2179Debug.Assert(ByteBuffer IsNot Nothing, "Null ByteBuffer") 2180Debug.Assert(Count > 0, Count.ToString(CultureInfo.InvariantCulture)) 2181Debug.Assert(m_Decoder IsNot Nothing, "Null Decoder") 2182Debug.Assert(m_Preamble IsNot Nothing, "Null Preamble") 2211Debug.Assert(CharCount = ExpectedCharCount, "Should read all characters") 2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (26)
364Debug.Fail("The TextFieldType is not supported") 656Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 657Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 662Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default") 688Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 689Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range") 717Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 718Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader") 719Debug.Assert(m_Position = 0, "Non-zero position") 739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for") 811Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer") 812Debug.Assert(Cursor >= 0 And Cursor <= m_CharsRead, "The cursor is out of range") 1007Debug.Assert(m_FieldWidths IsNot Nothing, "No field widths") 1070Debug.Assert(Line IsNot Nothing, "We are parsing a Nothing") 1073Debug.Assert(Length > 0, "A blank line shouldn't be parsed") 1076Debug.Assert(Line(0) <> vbCr And Line(0) <> vbLf, "A blank line shouldn't be parsed") 1098Debug.Assert(Line IsNot Nothing, "No Line sent") 1128Debug.Assert(m_FieldWidths(i) > 0, "Bad field width, this should have been caught on input") 1150Debug.Assert(Widths IsNot Nothing, "There are no field widths") 1197Debug.Fail("Delimiter element is empty. This should have been caught on input") 1229Debug.Fail("Unknown TextFieldType") 1281Debug.Assert((m_DelimitersCopy Is Nothing And m_Delimiters Is Nothing) Or (m_DelimitersCopy IsNot Nothing And m_Delimiters IsNot Nothing), "Delimiters and copy are not both Nothing or both not Nothing") 1299Debug.Assert((m_FieldWidthsCopy Is Nothing And m_FieldWidths Is Nothing) Or (m_FieldWidthsCopy IsNot Nothing And m_FieldWidths IsNot Nothing), "FieldWidths and copy are not both Nothing or both not Nothing") 1316Debug.Fail("Unknown TextFieldType") 1414Debug.Assert(m_Delimiters IsNot Nothing, "No delimiters set!")
Microsoft\VisualBasic\FileSystem.vb (12)
56Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 95Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 106Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 114Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 132Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 162Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 199Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 214Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 300Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 315Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 344Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly, 375Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (5)
69Debug.Assert(Not mAtBeginning) 80Debug.Assert(mNext Is Nothing) 119Debug.Fail("Node shouldn't be nothing") 130Debug.Assert(Node IsNot mCurrent, "If we just inserted Node, then it couldn't be the current node because it's not in the list yet") 157Debug.Fail("Unexpected adjustment type in enumerator")
Microsoft\VisualBasic\Strings.vb (4)
703System.Diagnostics.Debug.Assert(Expression <> "", "Expression is empty") 704System.Diagnostics.Debug.Assert(Find <> "", "Find is empty") 705System.Diagnostics.Debug.Assert(Count > 0, "Number of replacements is 0 or less") 706System.Diagnostics.Debug.Assert([Compare] = CompareMethod.Text Or [Compare] = CompareMethod.Binary, "Unknown compare.")
Microsoft.VisualStudio.TestPlatform.Common (7)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
src\vstest\src\Microsoft.TestPlatform.Filter.Source\FilterExpression.cs (2)
131Debug.Fail("ProcessOperator called for Unexpected operator."); 373Debug.Assert(result.Count == 1, "Result stack should have one element at the end.");
Utilities\AssemblyResolver.cs (1)
87Debug.Fail("AssemblyResolver.OnResolve: args.Name is null or empty.");
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (8)
NullableHelpers.cs (2)
36=> Debug.Assert(b); 41=> Debug.Assert(b, message);
ObjectModel\TestResult.cs (1)
386Debug.Fail("'m_testRun' is null");
ObjectModel\TestRun.cs (2)
178Debug.Fail("'RunConfiguration' is null"); 184Debug.Fail("'RunConfiguration.RunDeploymentRootDirectory' is null or empty");
TrxLogger.cs (1)
308Debug.Fail("TrxLogger.TestMessageHandler: The test message level is unrecognized: {0}", e.Level.ToString());
Utility\Converter.cs (1)
163Debug.Fail("Unexpected Outcome.");
Utility\TrxFileHelper.cs (1)
89Debug.Fail($"After replacing invalid chars in file '{fileName}' there's nothing left...");
Microsoft.VisualStudio.TestPlatform.ObjectModel (6)
Nuget.Frameworks\FrameworkReducer.cs (4)
359Debug.Assert(allPclFrameworks.All(f => !f.IsPCL), "a PCL returned a PCL as its profile framework"); 390Debug.Assert(!sub.IsPCL, "a PCL returned a PCL as its profile framework"); 444Debug.Fail("Unable to get portable frameworks from: " + pcl.ToString()); 478Debug.Assert(considering.IsPCL && current.IsPCL, "This method should be used only to compare PCLs");
Nuget.Frameworks\NuGetFrameworkFactory.cs (1)
46Debug.Assert(folderName.IndexOf(";", StringComparison.Ordinal) < 0, "invalid folder name, this appears to contain multiple frameworks");
TestProperty\TestProperty.cs (1)
236System.Diagnostics.Debug.WriteLine("The test property type " + typeName + " of property " + Id + "is not supported.");
Microsoft.Web.XmlTransform (34)
XmlAttributePreservationDict.cs (3)
36Debug.Assert(elementStartTag.StartsWith("<", StringComparison.Ordinal) && elementStartTag.EndsWith(">", StringComparison.Ordinal), "Expected string containing exactly a single tag"); 49Debug.Fail("Couldn't get leading whitespace for attribute"); 58Debug.Fail("Couldn't get trailing whitespace for tag");
XmlAttributePreservationProvider.cs (3)
25Debug.Assert((char)reader.Peek() == '<'); 46Debug.Fail("Failed to get preservation info"); 72Debug.Fail("cal dispose please");
XmlAttributePreservingWriter.cs (8)
34Debug.Assert(IsOnlyWhitespace(whitespace)); 51Debug.Assert(IsOnlyWhitespace(whitespace)); 133Debug.Assert(state == State.Writing); 139Debug.Assert(state == State.ReadingAttribute); 145Debug.Assert(state == State.Writing || state == State.Buffering); 151Debug.Assert(state == State.WritingComment); 244Debug.Assert(writeBuffer == null); 251Debug.Assert(writeBuffer != null);
XmlAttributeTransform.cs (1)
75Debug.Assert(arguments.Count == 1, "Should only call warnIfEmpty==true with one argument");
XmlElementContext.cs (1)
51Debug.Fail("No ServiceProvider");
XmlFileInfoDocument.cs (1)
464Debug.Fail("call dispose please");
XmlFormatter.cs (4)
66Debug.Assert(indents.Count > 0, "Expected at least one previous indent"); 132Debug.Fail(String.Format(CultureInfo.InvariantCulture, "Unexpected element type '{0}' while formatting document", node.NodeType.ToString())); 348Debug.Fail("Popped too many indents"); 412Debug.Assert(indents.Count > 0, "Expected at least one previous indent");
XmlLocator.cs (4)
131Debug.Assert(min <= max); 146Debug.Assert(this.parentPath == null && this.context == null && this.argumentString == null, 173Debug.Assert(this.parentPath == null && this.context == null && this.argumentString == null, 231Debug.Fail("There should be no XPathAxis enum value that isn't handled in this switch statement");
XmlTransform.cs (2)
189Debug.Assert(this.context == null && this.argumentString == null, "Don't call Execute recursively"); 190Debug.Assert(this.logger == null, "Logger wasn't released from previous execution");
XmlTransformation.cs (4)
93Debug.Assert(documentServiceContainer == null); 127Debug.Fail("The XPath for elements returned something that wasn't an element?"); 169Debug.Assert(this.xmlTarget == null, "This method should not be called recursively"); 383Debug.Fail("call dispose please");
XmlTransformationLogger.cs (1)
66Debug.Assert(currentReferenceNode == null || value == null, "CurrentReferenceNode is being overwritten");
XmlTransforms.cs (2)
23Debug.Assert(applyTransformToAllTargets == false); 502Debug.Assert(!fTokenizeParameter || parameters != null);
Microsoft.Win32.Registry (10)
Microsoft\Win32\Registry.cs (1)
88Debug.Assert(key != null, "An exception should be thrown if failed!");
Microsoft\Win32\RegistryKey.cs (9)
258Debug.Fail("Unexpected code path in RegistryKey::CreateSubKey"); 407Debug.Assert(errorCode == 0, $"RegDeleteValue failed. Here's your error code: {errorCode}"); 423Debug.Assert(index >= 0 && index < s_hkeyNames.Length, "index is out of range!"); 424Debug.Assert((((int)nKey) & 0xFFFFFFF0) == 0x80000000, "Invalid hkey value!"); 660Debug.Assert(IsSystemKey()); 720Debug.Fail("unexpected code path"); 1078Debug.Assert((uint)dataLength <= span.Length, $"Expected {dataLength} <= {span.Length}"); 1412Debug.Assert(name != null, "[FixupName]name!=null"); 1432Debug.Assert(path != null);
Microsoft.Win32.SystemEvents (10)
Microsoft\Win32\SystemEvents.cs (10)
644Debug.Fail("Unrecognized message passed to UserPreferenceCategory"); 656Debug.Fail("Failed to install console handler."); 682Debug.WriteLine("Unable to register broadcast window class: {0}", Marshal.GetLastPInvokeError()); 705Debug.Assert(s_threadCallbackList != null, "Invoking marshaled callbacks before there are any"); 734Debug.Fail("SystemEvents marshaled callback failed:" + t); 759Debug.Assert(s_windowThread == null || thread != Interop.Kernel32.GetCurrentThreadId(), "Don't call MarshaledInvoke on the system events thread"); 775Debug.Assert(s_threadCallbackMessage != 0, "threadCallbackList initialized but threadCallbackMessage not?"); 990Debug.Assert(args != null && args.Length == 2); 1128Debug.Fail("Exception occurred while freeing memory: " + e.ToString()); 1231Debug.Fail("Unexpected thread exception in system events window thread proc", e.ToString());
Mono.Cecil (2)
Mono.Cecil.PE\TextMap.cs (2)
71 Debug.Assert (start == AlignUp (start, (uint) align)); 73 Debug.Assert (start == GetStart (segment));
MSBuild (12)
CommandLine\CommandLineSwitches.cs (6)
455Debug.Assert(s_parameterlessSwitchesMap.Length == (int)ParameterlessSwitch.NumberOfParameterlessSwitches, 457Debug.Assert(s_parameterizedSwitchesMap.Length == (int)ParameterizedSwitch.NumberOfParameterizedSwitches, 462Debug.Assert(i == (int)(s_parameterlessSwitchesMap[i].parameterlessSwitch), 466Debug.Assert(!string.IsNullOrEmpty(s_parameterlessSwitchesMap[i].resourceId), "All parameterless switches should be cross-checked against the help message strings"); 472Debug.Assert(i == (int)(s_parameterizedSwitchesMap[i].parameterizedSwitch), 481Debug.Assert(!string.IsNullOrEmpty(s_parameterizedSwitchesMap[i].resourceId), "All parameterized switches should be cross-checked against the help message strings except from project switch");
src\msbuild\src\Shared\ResourceUtilities.cs (3)
302Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 309Debug.Fail("The resource string \"" + resourceName + "\" was not found."); 316Debug.Fail("The resource string \"" + resourceName + "\" was not found.");
src\msbuild\src\Shared\TaskEngineAssemblyResolver.cs (1)
84Debug.Assert(false, "There is no handler to remove.");
XMake.cs (2)
3472Debug.WriteLine("An error has happened, throwing an exception"); 3779Debug.Assert((parameterSections.Length >= 1) && (parameterSections.Length <= 2),
netstandard (1)
netstandard.cs (1)
648[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
NuGet.Build.Tasks (4)
GetRestoreSettingsTask.cs (4)
141Debug.Assert(Path.IsPathFullyQualified(ProjectUniqueName)); 142Debug.Assert(Path.IsPathFullyQualified(MSBuildStartupDirectory)); 143Debug.Assert(string.IsNullOrEmpty(RestoreRootConfigDirectory) || Path.IsPathFullyQualified(RestoreRootConfigDirectory)); 144Debug.Assert(string.IsNullOrEmpty(RestoreSolutionDirectory) || Path.IsPathFullyQualified(RestoreSolutionDirectory));
NuGet.CommandLine.XPlat (3)
Commands\Package\Update\PackageUpdateCommandRunner.cs (1)
648Debug.Assert(package.identity.VersionRange != null);
Utility\MSBuildAPIUtility.cs (1)
422Debug.Assert(directoryBuildPropsRootElement.ContainingProject.FullPath != project.FullPath);
Utility\TableParser.cs (1)
34Debug.Assert(columnHeaders.Length == valueSelectors.Length);
NuGet.Commands (14)
RestoreCommand\ContentFiles\ContentFileUtils.cs (3)
115Debug.Assert(file.StartsWith(ContentFilesFolderName, StringComparison.OrdinalIgnoreCase), 140Debug.Assert(filesEntry.Include != null, "invalid contentFiles entry"); 306Debug.Fail("Unable to get relative path: " + path);
RestoreCommand\RestoreCommand.cs (1)
2460Debug.Fail("RestoreRequest.ExternalProjects contains references, but does not contain the top level references. Add the project we are restoring for.");
RestoreCommand\RestoreRunner.cs (1)
393Debug.Assert(File.Exists(input) || Directory.Exists(input));
RestoreCommand\Utility\IncludeFlagUtils.cs (1)
191Debug.Assert(match != null, "The graph contains a dependency that the node does not list");
RestoreCommand\Utility\LockFileUtils.cs (2)
981Debug.Assert(!string.IsNullOrEmpty(fileName)); 983Debug.Assert(firstItem.Path.IndexOf('/', StringComparison.Ordinal) > 0);
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.Common (1)
Telemetry\TelemetryActivity.cs (1)
46Debug.Fail("Looking at all references to the static Create methods, I don't think this code path is possible.");
NuGet.Configuration (7)
Settings\VirtualSettingSection.cs (1)
96Debug.Assert(!currentSetting.IsAbstract());
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.DependencyResolver.Core (2)
Remote\RemoteDependencyWalker.cs (2)
108Debug.Assert(rootNode.Item != null, "FindLibraryCached should return an unresolved item instead of null"); 227Debug.Assert(newNode.Item != null, "FindLibraryCached should return an unresolved item instead of null");
NuGet.Frameworks (4)
FrameworkReducer.cs (4)
359Debug.Assert(allPclFrameworks.All(f => !f.IsPCL), "a PCL returned a PCL as its profile framework"); 390Debug.Assert(!sub.IsPCL, "a PCL returned a PCL as its profile framework"); 444Debug.Fail("Unable to get portable frameworks from: " + pcl.ToString()); 478Debug.Assert(considering.IsPCL && current.IsPCL, "This method should be used only to compare PCLs");
NuGet.LibraryModel (6)
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.PackageManagement (15)
IDE\PackageRestoreManager.cs (3)
136Debug.Assert(projectNames != null); 262Debug.Assert(p.Value != null); 558Debug.Assert(packageRestoreData.ProjectNames != null);
NuGetPackageManager.cs (1)
3888Debug.Assert(resolutionContext.GatherCache != null);
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
Utility\PackagesConfigLockFileUtility.cs (2)
243Debug.Assert(toUninstall.NuGetProjectActionType == NuGetProjectActionType.Uninstall); 266Debug.Assert(toInstall.NuGetProjectActionType == NuGetProjectActionType.Install);
Utility\StreamUtility.cs (1)
36Debug.Assert(otherStream.CanSeek);
Utility\XElementExtensions.cs (2)
173Debug.Assert(newlyAddedElement.Name == targetChild.Name); 206Debug.Assert(left.Name == right.Name);
NuGet.Packaging (78)
ContentModel\PatternTable.cs (1)
58Debug.Assert(MemoryMarshal.TryGetString(name, out _, out _, out _));
PackageCreation\Authoring\PackageBuilder.cs (1)
1151Debug.Assert(tags != null);
PackageExtraction\PackagePathHelper.cs (1)
69Debug.Assert(
Signing\Archive\ReadOnlyBufferedStream.cs (1)
198Debug.Assert(bytesToCopy >= 0);
Signing\Archive\SignedPackageArchiveIOUtility.cs (1)
768Debug.Assert(ValidZipDate_YearMin <= dateTime.Year && dateTime.Year <= ValidZipDate_YearMax);
Signing\DerEncoding\DerEncoder.cs (59)
33Debug.Assert(length >= 0); 90Debug.Assert(remainder < 0x80); 153Debug.Assert(offset >= 0); 154Debug.Assert(count > 0); 155Debug.Assert(bigEndianBytes.Length > 0); 156Debug.Assert(bigEndianBytes.Length >= count - offset); 171Debug.Assert(start >= offset); 233Debug.Assert(data != null); 234Debug.Assert(unusedBits >= 0); 235Debug.Assert(unusedBits <= 7); 236Debug.Assert(unusedBits == 0 || data!.Length > 0); 284Debug.Assert(bigEndianBytes != null, "bigEndianBytes != null"); 285Debug.Assert(namedBitsCount > 0, "namedBitsCount > 0"); 369Debug.Assert(semanticBytes <= bigEndianBytes.Length); 399Debug.Assert(data != null); 517Debug.Assert(chars != null); 531Debug.Assert(chars != null); 532Debug.Assert(offset >= 0); 533Debug.Assert(offset <= chars!.Length); 534Debug.Assert(count >= 0); 535Debug.Assert(count <= chars.Length - offset); 566Debug.Assert(items != null); 588Debug.Assert(items != null); 589Debug.Assert(contextId >= 0 && contextId <= 30); 614Debug.Assert(items != null); 638Debug.Assert(items != null); 661Debug.Assert(chars != null); 679Debug.Assert(chars != null); 680Debug.Assert(offset >= 0); 681Debug.Assert(offset <= chars!.Length); 682Debug.Assert(count >= 0); 683Debug.Assert(count <= chars.Length - offset); 705Debug.Assert(chars != null); 719Debug.Assert(chars != null); 720Debug.Assert(offset >= 0); 721Debug.Assert(offset <= chars!.Length); 722Debug.Assert(count >= 0); 723Debug.Assert(count <= chars.Length); 724Debug.Assert(offset + count <= chars.Length); 726Debug.Assert(IsValidPrintableString(chars, offset, count)); 755Debug.Assert(chars != null); 769Debug.Assert(chars != null); 770Debug.Assert(offset >= 0); 771Debug.Assert(offset <= chars!.Length); 772Debug.Assert(count >= 0); 773Debug.Assert(count <= chars.Length); 774Debug.Assert(offset + count <= chars.Length); 805Debug.Assert(utcTime.Kind == DateTimeKind.Utc); 855Debug.Assert(utcTime.Kind == DateTimeKind.Utc); 951Debug.Assert(segments != null); 952Debug.Assert(segments!.Length == 3); 956Debug.Assert(segment != null); 968Debug.Assert(startIndex < oidValue.Length); 977Debug.Assert(endIndex > startIndex); 1106Debug.Assert(x != null && y != null, "Comparing one more more null values"); 1107Debug.Assert(x!.Length == 3, $"x.Length is {x.Length} when it should be 3"); 1108Debug.Assert(y!.Length == 3, $"y.Length is {y.Length} when it should be 3"); 1139Debug.Assert(x[0].Length == 1, $"x[0].Length is {x[0].Length} when it should be 1"); 1140Debug.Assert(y[0].Length == 1, $"y[0].Length is {y[0].Length} when it should be 1");
Signing\DerEncoding\DerSequenceReader.cs (7)
44Debug.Assert(startAtPayload, "This overload is only for bypassing the sequence tag"); 45Debug.Assert(data != null, "Data is null"); 46Debug.Assert(offset >= 0, "Offset is negative"); 75Debug.Assert(_end - contentLength >= _position); 191Debug.Assert(_end - totalLength >= _position); 483Debug.Assert( 580Debug.Assert(end <= data.Length);
Signing\Verification\SignatureTrustAndValidityVerificationProvider.cs (1)
88Debug.Assert(isRepositoryCountersignatureVerificationRequested != (settings.RepositoryCountersignatureVerificationBehavior == SignatureVerificationBehavior.Never));
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.ProjectModel (9)
LockFile\LockFileTargetLibrary.cs (1)
57System.Diagnostics.Debug.Assert(!_isFrozen, "Attempting to set a property on a frozen instance.");
PackageSpecReferenceDependencyProvider.cs (2)
65Debug.Assert( 74Debug.Assert(
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.Protocol (15)
HttpSource\HttpHandlerResourceV3Provider.cs (1)
45Debug.Assert(source.PackageSource.IsHttp, "HTTP handler requested for a non-http source.");
HttpSource\HttpSourceResourceProvider.cs (1)
53Debug.Assert(source.PackageSource.IsHttp, "HTTP source requested for a non-http source.");
HttpSourceCacheContext.cs (1)
22Debug.Assert(
LegacyFeed\V2FeedPackageInfo.cs (1)
310Debug.Fail("Unknown dependency format: " + set);
LegacyFeed\V2FeedQueryBuilder.cs (2)
252Debug.Fail("Unhandled value of SearchFilterType"); 280Debug.Fail("Unhandled value of SearchFilterType");
Plugins\OutboundRequestContext`1.cs (1)
260Debug.WriteLine($"Request {_request.RequestId} timed out.");
SearchFilter.cs (1)
32Debug.Assert(
SourceCacheContext.cs (1)
84Debug.Assert(difference >= TimeSpan.Zero, "Invalid cache time");
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
NuGet.Resolver (6)
CombinationSolver.cs (3)
163Debug.Fail("Evaluated past the end of the array."); 236Debug.Fail("MoveBackward called with invalid value for i."); 320Debug.Assert(i == pfc);
PackageResolverContext.cs (1)
77Debug.Assert(PreferredVersions.GroupBy(p => p.Id, StringComparer.OrdinalIgnoreCase)
ResolverComparer.cs (1)
55Debug.Assert(string.Equals(x.Id, y.Id, StringComparison.OrdinalIgnoreCase));
ResolverPackage.cs (1)
40Debug.Assert(!Absent || (version == null && dependencies == null), "Invalid absent package");
NuGet.Versioning (6)
src\nuget-client\build\Shared\EqualityUtility.cs (6)
26Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 27Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 52Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 53Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string."); 94Debug.Assert(orderComparer != null || typeof(TKey) != typeof(string), "Argument " + "orderComparer" + " must be provided if " + "TKey" + " is a string."); 95Debug.Assert(sequenceComparer != null || typeof(TSource) != typeof(string), "Argument " + "sequenceComparer" + " must be provided if " + "TSource" + " is a string.");
PresentationBuildTasks (214)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (4)
185Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 186Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 300Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 301Debug.Assert(targetOutputs[CompileTargetName].Length == 1);
MS\Internal\MarkupCompiler\MarkupCompiler.cs (29)
259Debug.Assert(!cu.Pass2); 281Debug.Assert(!cu.Pass2); 292Debug.Assert(!cu.Pass2 || _pendingLocalFiles == null); 293Debug.Assert(_pendingLocalFiles == null || _pendingLocalFiles.Count == 0); 570Debug.Assert(_codeContexts.Count == 0); 945Debug.Assert(_ccRoot.StyleConnectorFn.Statements.Count > 0); 947Debug.Assert(ccsConnector != null); 1816Debug.Assert(desc != null); 1888Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2015Debug.Assert(_ccRoot != null && _ccRoot.SubClass.Length > 0); 2088Debug.Assert(CompilerInfo != null && CompilerInfo.IsCodeDomProviderTypeValid); 2290Debug.Assert(genericName.Length > 0 || t.IsGenericTypeDefinition); 2294Debug.Assert(genericName.Length == 0 && typeArgsList != null); 2380Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length); 2447Debug.Assert(_typeArgsList == null || (baseClass.IsGenericType && baseClass.IsGenericTypeDefinition)); 2448Debug.Assert(_typeArgsList != null || !baseClass.IsGenericType); 2515Debug.Assert(!string.IsNullOrEmpty(baseName)); 2521Debug.Assert(_ccRoot == null); 2522Debug.Assert(_codeContexts == null || _codeContexts.Count == 0, "mismatched CodeContexts"); 2545Debug.Assert(HasLocalReference, "if we have a local event, there should be a local mapping PI for it"); 3024Debug.Assert(_codeContexts.Count == 0, "mismatched codecontext"); 3026Debug.Assert(_ccRoot != null); 3075Debug.Assert(cc != null); 3079Debug.Assert(_ccRoot == (cc as CodeContextRoot)); 3080Debug.Assert(_ccRoot.CodeClass != null); 3104Debug.Assert(_ccRoot.HookupFn == null); 3157Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot)); 3158Debug.Assert(_ccRoot.ElementType == null || 3182Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot));
MS\Internal\MarkupCompiler\ParserExtension.cs (5)
40Debug.Assert(bamlWriter != null, "Need a BamlRecordWriter for compiling to Baml"); 149Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 344Debug.Assert(_name == null && _nameField == null, "Name has already been set"); 787Debug.Assert(_name == null && _nameField == null, "Name definition has already been set"); 901Debug.Assert(bamlMemStream != null);
MS\Internal\MarkupCompiler\PathInternal.cs (1)
40Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
MS\Internal\MarkupCompiler\VersionHelper.cs (2)
61Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 199Debug.Assert(revision < ushort.MaxValue);
MS\Internal\Tasks\CompilerLocalReference.cs (3)
176Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty."); 177Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 238Debug.Assert(!String.IsNullOrEmpty(_localCacheFile), "_localCacheFile must not be empty.");
MS\Internal\Tasks\CompilerState.cs (7)
90Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "StateFilePath must not be empty."); 91Debug.Assert(mcPass1 != null, "A valid instance of MarkupCompilePass1 must be passed to method SaveCacheInformation."); 92Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 151Debug.Assert(!String.IsNullOrEmpty(_stateFilePath), "_stateFilePath must be not be empty."); 152Debug.Assert(_cacheInfoList.Length == (int)CompilerStateType.MaxCount, "The Cache string array should be already allocated."); 260Debug.Assert(src[str.Length] == '\0', "src[str.Length] == '\\0'"); 261Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (1)
346Debug.Assert(enumPrefix != null && enumNames != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (10)
61Debug.Assert(null != xamlTypeMapper); 149Debug.Assert(cmp > 0); 1004Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1041Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1078Debug.Assert( 1091Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1271Debug.Assert(ownerTypeName != null); 1272Debug.Assert(attributeName != null); 1457Debug.Assert(GetHashTableData(stringValue) == null, 1492Debug.Assert(targetType != null && memberName != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordHelper.cs (1)
130Debug.Fail("Unhandled case in DoesRecordTypeHaveDebugExtension");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (27)
687Debug.Fail("Assembly, Type and Attribute records are not cached, so don't ask for one."); 712Debug.Fail("Unknown RecordType"); 765Debug.Assert(null == _writeCache[(int)record.RecordType]); 855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 864Debug.Fail("Must override RecordType"); 902Debug.Assert( value <= 3 && value >= 0 ); 1090Debug.Assert(RecordSize < 0); 1500Debug.Assert(_valuePositionPosition != -1, 1683Debug.Assert(_valuePositionPosition != -1, 2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2386Debug.Assert(value <= ExtensionIdMask); 2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3197set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3284set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3433Debug.Assert(_contentSizePosition != -1, 3478set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4542Debug.Assert( SerializerTypeId != 0 ); 4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (21)
133Debug.Assert(null != DocumentStartRecord); 404Debug.Assert(_deferElementDepth == 0); 405Debug.Assert(_deferComplexPropertyDepth == 0); 406Debug.Assert(_staticResourceElementDepth == 0); 407Debug.Assert(_dynamicResourceElementDepth == 0); 408Debug.Assert(_staticResourceRecordList == null); 426Debug.Assert(_staticResourceElementDepth == 0); 463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 875Debug.Assert(_deferElementDepth == 2); 1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1081Debug.Assert(typeValue != null); 1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1634Debug.Assert(keyIndex == _deferKeys.Count, 1657Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1665Debug.Assert(valueDeferRecord.Record != null && 1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlVersionHeader.cs (2)
102Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 107Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\KnownTypes.cs (3)
4755Debug.Assert(asmFramework != null, "asmFramework must not be null"); 4756Debug.Assert(asmCore != null, "asmCore must not be null"); 4757Debug.Assert(asmBase != null, "asmBase must not be null");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (3)
1181Debug.Assert(sb.Length > 0); 1182Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1539Debug.Assert(null != info, "No property or method info for field Name");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleModeStack.cs (2)
46Debug.Assert(Depth >= 0, $"StyleModeStack's depth was {Depth}, should be >= 0"); 63Debug.Assert(Depth >= 0, $"StyleMode::Pop() with depth of {Depth}, should be >= 0");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (3)
504Debug.Assert(_inEventSetter); 1216Debug.Assert(!xamlClrEventNode.IsTemplateEvent && _inEventSetter); 1289Debug.Assert (mode != StyleMode.Base || xamlPropertyNode.PropName != XamlStyleSerializer.TargetTypePropertyName,
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (3)
562Debug.Assert(_setterOrTriggerValueNode != null); 1331Debug.Assert(_styleModeStack.Mode == StyleMode.VisualTree); 1341Debug.Assert(!xamlClrEventNode.IsStyleSetterEvent);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TreeBuilder.cs (1)
82Debug.Assert (false, "Parse Fragment was not overidden");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (5)
523Debug.Fail("Unknown Xaml Token."); 996Debug.Assert(null != assemblyName, "assembly name returned from GetBaseElement is null"); 997Debug.Assert(null != typeFullName, "Type name returned from GetBaseElement is null"); 1139Debug.Assert(SkipActionDepthCount == -1); 1245Debug.Assert(null == _bamlWriter || null == value, "XamlParser already had a bamlWriter");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (53)
115Debug.Assert(xamlParser != null, "Cannot have null xaml parser"); 116Debug.Assert(parserContext != null, "Cannot have null parser context"); 117Debug.Assert(xmlReader != null, "Cannot have null xmlReader"); 327Debug.Assert(null != xamlNode, "null returned from the collection"); 356Debug.Assert(null != XmlReader); 395Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing."); 428Debug.Assert(null != xamlNode, "null returned from the collection"); 1174Debug.Assert(null != typeFullName, "type name not set"); 1175Debug.Assert(null != dynamicObjectName, "dynamicObject name not set"); 1176Debug.Assert(null != assemblyName, "assembly name not set"); 1503Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName) 1827Debug.Assert(null == dynamicObject,"DynamicObject should be null for code"); 1995Debug.Assert(!endTagHasBeenRead, "Read past end tag on end tag"); 2066Debug.Assert(!endTagHasBeenRead); 2216Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2225Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2234Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2243Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2252Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2261Debug.Assert (attributeFound || !IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2754Debug.Assert(unknownTagName != null || null != parentType); 3177Debug.Assert(null != assemblyName, "property without an AssemblyName"); 3178Debug.Assert(null != declaringTypeFullName, "property without a type name"); 3179Debug.Assert(null != dynamicObjectName, "property without a field Name"); 3699Debug.Assert(typeAndSerializer == null || 3753Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex || 4132Debug.Assert(null != assemblyName, "property without an AssemblyName"); 4133Debug.Assert(null != typeFullName, "property without a type name"); 4134Debug.Assert(null != dynamicObjectName, "property without a field Name"); 4813Debug.Assert( collectionTypeID >= 0 5051Debug.Assert( xmlNodeType == XmlNodeType.Text || 5084Debug.Assert( isWhitespace, 5132Debug.Assert (parentNodeType == ElementContextType.Unknown, 5262Debug.Assert(null != XmlReader, "XmlReader is not yet set"); 5308Debug.Fail("XmlReader doesn't support LineNumber"); 5339Debug.Fail("XmlReader doesn't support LinePosition"); 5491Debug.Assert(currentPos > 0 && currentPos < s.Length - 1); 5566Debug.Assert(null != text, "String passed to CollapseText cannot be null"); 5567Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty"); 5827Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5847Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count), 5874Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion."); 5933Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count."); 6001Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd, 6064Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6083Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6107Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode, 6123Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null, 6152Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart, 6344Debug.Fail($"State machine checking for TypeConverter syntax has encountered an unexpected XamlNode type {tokenType}"); 6428Debug.Assert(null != textFlowData, "No data for TextFlow"); 6450Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node"); 6571Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (18)
935Debug.Assert(null != localName, "null localName"); 936Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1906Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2304Debug.Assert(memberName != null); 2307Debug.Assert(memberInfo != null); 2322Debug.Assert(targetType != null); 2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2399Debug.Assert(null != localName,"null value passed for localName"); 2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2438Debug.Assert(null != localName,"null value passed for localName"); 2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2591Debug.Assert(localName != null,"Null localName"); 3150Debug.Fail("Should initialize cache prior to compiling"); 3421Debug.Fail("Should initialize cache prior to compiling"); 3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3744Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 4006Debug.Assert(_dpLookupHashtable != null,
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (1)
708Debug.Assert(prefix != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (2)
171Debug.Assert(!Char.IsWhiteSpace(currentChar),"Token started on Whitespace"); 313Debug.Assert(null != numberFormat);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (2)
128Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 149Debug.Assert(type is not null, "Type passed to IsPublicType is null");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (2)
101Debug.Assert(null != memberInfo, "Null passed for memberInfo to GetConverterType"); 110Debug.Assert(type is not null, "Null passed for type to GetConverterType");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
34Debug.Assert( baseReader is not null);
src\wpf\src\Microsoft.DotNet.Wpf\src\WindowsBase\MS\Internal\IO\Packaging\CompoundFile\ContainerUtilities.cs (1)
83Debug.Assert(length >= 0, "The length cannot be negative. Caller must verify this");
PresentationCore (2224)
MS\Internal\AppModel\CookieHandler.cs (1)
108Debug.Assert(size > 0);
MS\Internal\DpiUtil\DpiUtil+ProcessDpiAwarenessHelper.cs (1)
101Debug.Assert(windowThreadProcessId != 0, "GetWindowThreadProcessId failed");
MS\Internal\FontCache\FamilyCollection.cs (1)
647Debug.Assert(i == FamilyCount);
MS\Internal\FontCache\FontCacheUtil.cs (1)
39Debug.Assert(stream.Position == 0);
MS\Internal\FontCache\FontResourceCache.cs (3)
59Debug.Assert(uri.IsAbsoluteUri && uri.Scheme == PackUriHelper.UriSchemePack && BaseUriHelper.IsPackApplicationUri(uri)); 72Debug.Assert(escapedPath.EndsWith(FakeFileName, StringComparison.OrdinalIgnoreCase)); 140Debug.Assert(!folderResourceMap.ContainsKey(resourceFullName));
MS\Internal\FontCache\FontSource.cs (3)
73Debug.Assert(_isInternalCompositeFont || String.IsNullOrEmpty(_fontUri.Fragment)); 370Debug.Assert(memoryFontSize <= fileReadBufferSize); 455Debug.Assert(_memoryHandle.IsAllocated);
MS\Internal\FontFace\CompositeFontInfo.cs (3)
203Debug.Assert(IsFamilyMapRangesValid(familyMapRanges)); 211Debug.Assert(begin < end && end <= _familyMaps.Count); 239Debug.Assert(count == FirstFamilyMapRange);
MS\Internal\FontFace\PhysicalFontFamily.cs (4)
119Debug.Assert(bestMatch != null); 203Debug.Assert(bestStyleTypeface != null); 331Debug.Assert(advance <= unicodeString.Length); 337Debug.Assert(advance + sizeofChar <= unicodeString.Length);
MS\Internal\FontFace\TypefaceCollection.cs (2)
81Debug.Assert((_family != null && _familyTypefaceCollection == null)|| (_familyTypefaceCollection != null && _family == null)); 132Debug.Assert((typefaceCollection._family != null && typefaceCollection._familyTypefaceCollection == null)
MS\Internal\Generic\Span.cs (2)
137Debug.Assert(fc <= first); 468Debug.Assert(
MS\Internal\Ink\Bezier.cs (2)
110Debug.Assert(to - from >= 4); 351Debug.Assert(data.Node(to) - data.Node(from) > data.Node(j) - data.Node(from));
MS\Internal\Ink\CuspData.cs (1)
279Debug.Assert(bReverse);
MS\Internal\Ink\EllipticalNodeOperations.cs (12)
23System.Diagnostics.Debug.Assert((nodeShape != null) && nodeShape.IsEllipse); 37Debug.Assert(_nodeShapeToCircle.HasInverse, "About to invert a non-invertible transform"); 49Debug.Assert(_nodeShapeToCircle.HasInverse, "Just rotated an invertible transform and produced a non-invertible one"); 65Debug.Assert(_nodeShapeToCircle.HasInverse, "Just scaled an invertible transform and produced a non-invertible one"); 170System.Diagnostics.Debug.Assert(!node.IsEmpty); 573System.Diagnostics.Debug.Assert(result.IsEmpty); 611System.Diagnostics.Debug.Assert(!DoubleUtil.AreClose(beginRadius, endRadius)); 643System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 652System.Diagnostics.Debug.Assert(!DoubleUtil.IsBetweenZeroAndOne(x)); 654System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 670System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 682System.Diagnostics.Debug.Assert(!double.IsNaN(findex));
MS\Internal\Ink\ErasingStroke.cs (6)
29System.Diagnostics.Debug.Assert(erasingShape != null); 55System.Diagnostics.Debug.Assert((path != null) && (IEnumerablePointHelper.GetCount(path) != 0)); 96System.Diagnostics.Debug.Assert(iterator != null); 135System.Diagnostics.Debug.Assert(iterator != null); 136System.Diagnostics.Debug.Assert(intersections != null); 258System.Diagnostics.Debug.Assert(path.Length > 1);
MS\Internal\Ink\ExtendedPropertyCollection.cs (2)
172System.Diagnostics.Debug.Assert(propertyToRemove != null); 309System.Diagnostics.Debug.Assert(!this.Contains(extendedProperty.Id), "ExtendedProperty already belongs to the collection");
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (11)
44Debug.Assert(NativeRecognizer.RecognizerHandleSingleton != null); 346Debug.Assert(recContext != null && !recContext.IsInvalid); 393Debug.Assert(recContext != null && !recContext.IsInvalid); 482Debug.Assert(stylusPoints != null); 483Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 617Debug.Assert(ApplicationGestureHelper.IsDefined(gesture)); 666Debug.Assert(!(bestResultColumnCount != 0 && pRecoLattice->pLatticeColumns == IntPtr.Zero), "Invalid results!"); 680Debug.Assert(0 < recoColumn.cLatticeElements, "Invalid results!"); 687Debug.Assert((RECO_TYPE)(recoElement.type) == RECO_TYPE.RECO_TYPE_WCHAR, "The Application gesture has to be WCHAR type" ); 704Debug.Assert(pProps->cbPropertyValue == sizeof(uint) / sizeof(byte)); 716Debug.Assert(ApplicationGestureHelper.IsDefined(gesture));
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (4)
210Debug.Assert(outputBufferIndex < outputBuffer.Length); 219Debug.Assert(outputBufferIndex < outputBuffer.Length); 271Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1); 332Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1);
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (3)
309Debug.Assert(strm != null); 424System.Diagnostics.Debug.Assert(guid == Guid.Empty); 941Debug.Fail("Missing case statement!");
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (16)
282System.Diagnostics.Debug.Fail("Corrupt Matrix in the ExtendedPropertyCollection!"); 331System.Diagnostics.Debug.Assert(penTip == PenTip.Rectangle); 420Debug.Assert(DrawingAttributes.MaxHeight == DrawingAttributes.MaxWidth && 449System.Diagnostics.Debug.Assert(compressionAlgorithm == 0); 450System.Diagnostics.Debug.Assert(fTag); 452Debug.Assert(stream != null); 478Debug.Assert(bw != null); 484Debug.Assert(bw != null); 498System.Diagnostics.Debug.Assert(da.Color != (Color)DrawingAttributes.GetDefaultDrawingAttributeValue(KnownIds.Color), "Color was put in the EPC for the default value!"); 504Debug.Assert(bw != null); 517Debug.Assert(bw != null); 535Debug.Assert(bw != null); 599System.Diagnostics.Debug.Assert(da.StylusTip != StylusTip.Ellipse, "StylusTip was put in the EPC for the default value!"); 604Debug.Assert(bw != null); 658Debug.Assert(bw != null); 669Debug.Assert(bw != null);
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (5)
217Debug.Assert(intReader != null); 218Debug.Assert(shortReader != null); 230Debug.Assert(shortReader != null); 528Debug.Assert(outputBufferIndex < outputBuffer.Length); 545Debug.Assert(outputBufferIndex < outputBuffer.Length);
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (9)
80Debug.Assert(input != null); 81Debug.Assert(input.Length >= 2); 82Debug.Assert(startIndex == 1); 83Debug.Assert(outputBuffer != null); 84Debug.Assert(outputBuffer.Length != 0); 96Debug.Assert(outputBufferIndex < outputBuffer.Length); 111Debug.Assert(outputBufferIndex < outputBuffer.Length); 173Debug.Assert(nDataLen > 0 && nDataLen - 1 <= Int32.MaxValue); 177Debug.Assert(nDataLen <= Int32.MaxValue);
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (8)
90System.Diagnostics.Debug.Assert(inkData.Length > isfBase64PrefixLength); 235Debug.Assert(inkdata != null); 293Debug.Assert(inputStream != null); 2087Debug.Assert(data != null); 2466Debug.Assert(sizeOfHeaderInBytes == bytesWritten); 2505Debug.Assert(sizes[i] == bytesWritten); 2659System.Diagnostics.Debug.WriteLine(message); 2704System.Diagnostics.Debug.Assert(strokes != null);
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (4)
27Debug.Assert(input != null); 28Debug.Assert(input.Length > 1); 29Debug.Assert(inputIndex < input.Length); 30Debug.Assert(inputIndex >= 0);
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (3)
64Debug.Assert(input != null); 65Debug.Assert(inputIndex < input.Length); 99Debug.Assert(input != null); //already validated at the AlgoModule level
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (2)
291System.Diagnostics.Debug.Fail("ExtendedProperties for points are not supported"); 959Debug.Assert(stream != null);
MS\Internal\Ink\Lasso.cs (19)
48System.Diagnostics.Debug.Assert(_points != null); 62System.Diagnostics.Debug.Assert(_points != null); 76System.Diagnostics.Debug.Assert(_points != null); 77System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 89System.Diagnostics.Debug.Assert(null != points); 103System.Diagnostics.Debug.Assert(_points != null); 119System.Diagnostics.Debug.Assert(_points != null); 170System.Diagnostics.Debug.Assert(lassoSegment.Y != 0); 185System.Diagnostics.Debug.Assert(_points != null); 186System.Diagnostics.Debug.Assert(iterator != null); 334System.Diagnostics.Debug.Assert(!crossing.IsEmpty && crossing.StartNode.IsValid && crossing.EndNode.IsValid); 337System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 344System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 421System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(si.InBegin, StrokeFIndices.BeforeFirst)); 556System.Diagnostics.Debug.Assert(!newFIndices.IsEmpty); 557System.Diagnostics.Debug.Assert(strokeNode.IsValid); 600System.Diagnostics.Debug.Assert(obj is LassoCrossing); 705System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 812System.Diagnostics.Debug.Assert(hitEnd != hitBegin && orgBegin != orgEnd);
MS\Internal\Ink\Renderer.cs (8)
37Debug.Assert(renderer != null); 424System.Diagnostics.Debug.Assert(sender == _strokes); 474System.Diagnostics.Debug.Assert(_strokes.IndexOf(sender as Stroke) != -1); 525System.Diagnostics.Debug.Assert(_strokes != null); 531Debug.Assert(visual is not null); 625System.Diagnostics.Debug.Assert(stroke != null); 634System.Diagnostics.Debug.Assert(stroke != null); 646System.Diagnostics.Debug.Assert(drawingAttributes != null);
MS\Internal\Ink\StrokeFIndices.cs (1)
179System.Diagnostics.Debug.Assert(!double.IsNaN(_beginFIndex) && !double.IsNaN(_endFIndex) && DoubleUtil.LessThan(_beginFIndex, _endFIndex));
MS\Internal\Ink\StrokeIntersection.cs (6)
184System.Diagnostics.Debug.Assert(intersections != null); 185System.Diagnostics.Debug.Assert(intersections.Length > 0); 190System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty); 216System.Diagnostics.Debug.Assert(intersections != null); 217System.Diagnostics.Debug.Assert(intersections.Length > 0); 222System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty);
MS\Internal\Ink\StrokeNode.cs (20)
35System.Diagnostics.Debug.Assert(operations != null); 36System.Diagnostics.Debug.Assert((!nodeData.IsEmpty) && (index >= 0)); 259Debug.Fail("StrokeNodeOperations.GetPointsAtStartOfSegment failed to find the D position"); 285Debug.Assert(!endNodeRect.Contains(point)); 372Debug.Fail("StrokeNodeOperations.GetPointsAtEndOfSegment failed to find the B position"); 639Debug.Fail("Couldn't find all 4 indexes in StrokeNodeOperations.GetPointsAtMiddleSegment"); 897System.Diagnostics.Debug.Assert(!double.IsNaN(cutAt.BeginFIndex) && !double.IsNaN(cutAt.EndFIndex)); 915System.Diagnostics.Debug.Assert(IsValid && (_index >= 0)); 922System.Diagnostics.Debug.Assert(fragment.BeginFIndex >= 0 && fragment.BeginFIndex <= 1); 927System.Diagnostics.Debug.Assert(fragment.EndFIndex >= 0 && fragment.EndFIndex <= 1); 946System.Diagnostics.Debug.Assert(IsValid); 958System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.BeginFIndex, 0f)); 960System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.BeginFIndex, 1f)); 974System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.EndFIndex, 0f)); 976System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.EndFIndex, 1f)); 1000System.Diagnostics.Debug.Assert(IsValid); 1018System.Diagnostics.Debug.Assert(IsValid); 1036System.Diagnostics.Debug.Assert(IsValid); 1040System.Diagnostics.Debug.Assert(findex == 0); 1044System.Diagnostics.Debug.Assert((findex >= _index - 1) && (findex <= _index));
MS\Internal\Ink\StrokeNodeData.cs (2)
44System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); 55Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure));
MS\Internal\Ink\StrokeNodeOperations.cs (19)
41System.Diagnostics.Debug.Assert(nodeShape != null); 72System.Diagnostics.Debug.Assert((boundingBox.X <= 0) && (boundingBox.Y <= 0)); 118System.Diagnostics.Debug.Assert(!node.IsEmpty); 316System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 367System.Diagnostics.Debug.Assert(count > 0); 393System.Diagnostics.Debug.Assert(count > 0); 415System.Diagnostics.Debug.Assert(count > 0); 476System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 617System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 631System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 768System.Diagnostics.Debug.Assert(DoubleUtil.IsBetweenZeroAndOne(findex)); 956System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 981System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 1013System.Diagnostics.Debug.Assert(!quad.IsEmpty); 1083System.Diagnostics.Debug.Assert(i < count); 1123System.Diagnostics.Debug.Assert(count > 0); 1145System.Diagnostics.Debug.Assert(count > 0); 1218System.Diagnostics.Debug.Assert(!DoubleUtil.IsZero(pressureFactor)); 1289System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1);
MS\Internal\Ink\StrokeNodeOperations2.cs (3)
39System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 77System.Diagnostics.Debug.Assert(!quad.IsEmpty); 503System.Diagnostics.Debug.Assert((!DoubleUtil.IsZero(shortest.X)) || (!DoubleUtil.IsZero(shortest.Y)));
MS\Internal\Ink\StrokeRenderer.cs (28)
36Debug.Assert(iterator != null); 37Debug.Assert(drawingAttributes != null); 70System.Diagnostics.Debug.Assert(strokeNode.IsValid); 152Debug.Assert(index == iterator.Count - 1); 210Debug.Assert(iterator != null && drawingAttributes != null); 347Debug.Assert(!prevStrokeNode.GetConnectingQuad().IsEmpty, "prevStrokeNode.GetConnectingQuad() is Empty!"); 453Debug.Assert(!strokeNode.GetConnectingQuad().IsEmpty, "strokeNode.GetConnectingQuad was empty, this is unexpected"); 482Debug.Assert(pathFigureDCSide.Count == 0); 624Debug.Assert(!strokeNode.IsValid); 646Debug.Assert(pathFigureDCSide.Count == 0); 672Debug.Assert(pathFigureABSide.Count == 0); 707Debug.Assert(pathFigureDCSide.Count == 0); 753Debug.Assert(pointBuffer1 != null); 754Debug.Assert(pointBuffer2 != null); 755Debug.Assert(pointBuffer3 != null); 756Debug.Assert(context != null); 829Debug.Assert(percentIntersect >= 0.0 && percentIntersect <= 100.0d); 865Debug.Assert(context != null); 866Debug.Assert(points != null); 867Debug.Assert(points.Count > 0); 893Debug.Assert(context != null); 894Debug.Assert(abPoints != null && dcPoints != null); 895Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 915Debug.Assert(context != null); 916Debug.Assert(abPoints != null && dcPoints != null); 917Debug.Assert(polyLinePoints != null); 946Debug.Assert(i + 2 < points.Count); 1096System.Diagnostics.Debug.Assert(da.IsHighlighter = true);
MS\Internal\Ink\StylusShape.cs (4)
156System.Diagnostics.Debug.Assert(value.HasInverse); 226System.Diagnostics.Debug.Assert(vertices.Length == 4); 251System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 269System.Diagnostics.Debug.Assert(m_tip == StylusTip.Ellipse);
MS\Internal\IO\Packaging\ByteRangeDownloader.cs (3)
73Debug.Assert(fileMutex != null, "FileMutex must be a valid mutex"); 74Debug.Assert(tempStream != null, "ByteRangeDownloader requires a stream to write to"); 190Debug.Assert(byteRanges.GetLength(0) == 1, "We don't support a request with multiple byte ranges");
MS\Internal\IO\Packaging\NetStream.cs (10)
714Debug.Assert(_fullStreamLength >= 0, "We assume _fullStreamLength is correct for Http cases - only Ftp can return bogus values"); 801Debug.Assert(offset >= 0); 802Debug.Assert(length >= 0); 827Debug.Assert(value >= 0); 840Debug.Assert(value >= 0); 886Debug.Assert(_offset <= b._offset); 887Debug.Assert(Mergeable(b)); 935Debug.Assert(block.Length > 0); 1035Debug.Assert(block.Length > 0); 1148Debug.Assert(_fullDownloadComplete, "Do not call this unless full download is complete.");
MS\Internal\IO\Packaging\PseudoWebRequest.cs (3)
44Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 45Debug.Assert(packageUri != null, "packageUri cannot be null"); 46Debug.Assert(partUri != null, "partUri cannot be null");
MS\Internal\IO\Packaging\ResponseStream.cs (4)
46Debug.Assert(container != null, "Logic error: use other constructor for full package request streams"); 47Debug.Assert(owningStream != null, "Logic error: use other constructor for full package request streams"); 70Debug.Assert(s != null, "Logic error: base stream cannot be null"); 71Debug.Assert(response != null, "Logic error: response cannot be null");
MS\Internal\LoadedOrUnloadedOperation.cs (1)
21Debug.Assert(callback != null && target != null);
MS\Internal\Media\VisualTreeUtils.cs (7)
113Debug.Assert(element == null); 172Debug.Fail("How did a ray hit a Visual3D not parented to a Viewport3DVisual?"); 177Debug.Fail(String.Format("Unhandled HitTestResult type '{0}'", result.GetType().Name)); 235Debug.Assert((visual == null) != (visual3D == null), 256Debug.Assert(castSucceeded && ((visual == null) != (visual3D == null)), 263Debug.Assert(!castSucceeded && visual == null && visual3D == null, 281Debug.Fail(String.Format(
MS\Internal\Media3D\GeneralTransform2DTo3DTo2D.cs (1)
470Debug.Assert(uv.Length == p.Length, "vertices and texture coordinate sizes should match");
MS\Internal\Media3D\GeneralTransform3DTo2DTo3D.cs (1)
27Debug.Assert(transform3DTo2D != null && transform2DTo3D != null);
MS\Internal\Media3D\M3DUtil.cs (4)
40Debug.Assert(!bounds.IsEmpty, 144Debug.Assert(matrix.IsAffine); 322Debug.Assert(!matrix.IsAffine); 384Debug.Assert(camera != null, "Caller is responsible for ensuring camera is not null.");
MS\Internal\PartialArray.cs (1)
22Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length);
MS\Internal\Shaping\GlyphInfoList.cs (1)
51Debug.Assert(_glyphs.Offset + _glyphs.Length == cch, "Invalid glyph length!");
MS\Internal\Shaping\OpenTypeCommon.cs (11)
227Debug.Assert(TableTag==OpenTypeTags.GSUB || TableTag==OpenTypeTags.GPOS); 228Debug.Assert(FirstGlyph<AfterLastGlyph); 229Debug.Assert(AfterLastGlyph<=GlyphInfo.Length); 594Debug.Fail("Unknown OpenType layout table!"); 730Debug.Assert(featureDescription.Parameter != 0); 780Debug.Assert( FlagToSet==GlyphFlags.NotChanged || 924Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1075Debug.Fail("Ext.Lookup processed earlier!"); 1160Debug.Fail("Ext.Lookup processed earlier!"); 1173Debug.Fail("Unknown OpenType layout table!"); 1695Debug.Assert(Index < SubTableCount());
MS\Internal\Shaping\OpenTypeLayoutCache.cs (16)
73Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 313Debug.Assert(totalSize <= maxCacheSize); 317Debug.Assert(totalSize <= maxCacheSize); 384Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 404Debug.Assert(false); 537Debug.Assert(lastLookup >= 0); // There are lookups, so there was an index 564Debug.Assert(cacheSize > 0); // We've calcucalted them at least ones, and 565Debug.Assert(glyphCount > 0); // if there is no records, we already should've exited 631Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 636Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 669Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 674Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 686Debug.Assert((pList - pCache) * sizeof(ushort) == cacheSize); // We exactly filled up the cache 687Debug.Assert((pGlyphs - pCache) * sizeof(ushort) == (4 + glyphCount * 2) * sizeof(ushort)); // Glyphs ended where lists start. 833Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1051Debug.Assert(recordCount > 0); // Otherwise, we would go into (glyph > maxGlyphLookup);
MS\Internal\Shaping\ShaperBuffers.cs (2)
98Debug.Assert(_charMap.Length == charCount); 109Debug.Assert(_glyphInfoList.Length == glyphCount);
MS\Internal\Shaping\TypefaceMap.cs (9)
158Debug.Assert(ichItem == unicodeString.Length); 173Debug.Assert(index >= 0); 217Debug.Fail("Invalid font face spans"); 390Debug.Assert(index >= 0, "Invalid scaled shapeable typeface index spans"); 574Debug.Assert(cchMap <= unicodeString.Length - ich); 811Debug.Assert(cchNextValid > 0 && cchNextValid <= unicodeString.Length - ich); 829Debug.Assert(cchNextValid == 0); 839Debug.Assert(recursionDepth > 0 || advance == unicodeString.Length); 1051Debug.Assert(cch > 0);
MS\Internal\Shaping\UshortList2.cs (4)
134Debug.Fail("Not supported"); 140Debug.Fail("Not supported"); 146Debug.Fail("Not supported"); 151Debug.Fail("Not supported");
MS\Internal\Span.cs (2)
104Debug.Assert(cp >= 0); 156Debug.Assert(spanIndex > 0);
MS\Internal\SynchronizedInputHelper.cs (3)
185Debug.Assert(mbArgs != null); 233Debug.Assert(mbArgs != null); 283Debug.Assert(false);
MS\Internal\Text\TextInterface\FontCollectionLoader.cs (1)
23Debug.Fail("Assertion failed");
MS\Internal\TextFormatting\Bidi.cs (30)
684Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter), 687Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals")); 710Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, 735Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class"); 846Debug.Assert(startOfNeutrals == PositionInvalid, 891Debug.Assert(startOfDelayed != PositionInvalid, 936Debug.Assert(startOfNeutrals == PositionInvalid, 941Debug.Assert(startOfDelayed != PositionInvalid, 1041Debug.Assert(startOfNeutrals != PositionInvalid, 1080Debug.Assert(startOfNeutrals != PositionInvalid, 1113Debug.Assert(startOfNeutrals == PositionInvalid, 1131Debug.Assert(startOfNeutrals == PositionInvalid, 1144Debug.Assert(startOfDelayed != PositionInvalid, 1158Debug.Assert(startOfNeutrals == PositionInvalid, 1163Debug.Assert(startOfDelayed != PositionInvalid, 1174Debug.Assert(startOfNeutrals != PositionInvalid, 1183Debug.Assert(startOfNeutrals == PositionInvalid, 1201Debug.Assert(startOfDelayed != PositionInvalid, 1205Debug.Assert(lastClass == DirectionClass.EuropeanTerminator, 1212Debug.Assert(startOfNeutrals == PositionInvalid, 1217Debug.Assert(startOfDelayed != PositionInvalid, 1266Debug.Assert(startOfNeutrals != PositionInvalid, 1280Debug.Assert(startOfNeutrals == PositionInvalid, 1285Debug.Assert(startOfDelayed != PositionInvalid, 1317Debug.Assert(startOfNeutrals == PositionInvalid, 1344Debug.Assert(startOfNeutrals == PositionInvalid, 1389Debug.Assert(startOfNeutrals == PositionInvalid, 1425Debug.Assert(startOfDelayed != PositionInvalid, 1567Debug.Assert(startOfNeutrals == PositionInvalid, 2454Debug.Assert(runLengthResolved == runLength,
MS\Internal\TextFormatting\FormatSettings.cs (3)
208Debug.Assert(offsetToFirstCp == 0); 216Debug.Assert(offsetToFirstCp == 0); 229Debug.Assert(offsetToFirstCp == 0);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (6)
48Debug.Assert(symbols != null); 71Debug.Assert(shapeables != null && shapeables.Count > 0); 85Debug.Assert(current != null); 197Debug.Assert(_glyphs != null); 220Debug.Assert(_glyphs != null); 363Debug.Assert(glyphAdvances.Length <= glyphIndices.Length);
MS\Internal\TextFormatting\FullTextLine.cs (18)
194Debug.Assert(_metrics._formatter != null); 452Debug.Assert(_collapsingSymbol == null && symbol != null); 474Debug.Assert(lineLength > 0); 685Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0); 739Debug.Assert(_fullText != null); 744Debug.Assert(_metrics._height > 0); 820Debug.Assert(HasCollapsed); 1220Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1409Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1461Debug.Assert(_collapsingSymbol != null); 1556Debug.Assert(false); 1714Debug.Assert(boundsList != null); 2078Debug.Assert(textRun != null); 2082Debug.Assert(cchAcc > 0); 2095Debug.Assert(cchAcc > 0); 2099Debug.Assert(cchLeft == 0); 2441Debug.Assert(_ploline != IntPtr.Zero); 2494Debug.Assert(_ploline != IntPtr.Zero);
MS\Internal\TextFormatting\FullTextState.cs (2)
287Debug.Assert(lsccp > 0, "Zero-length text line!"); 297Debug.Assert(!TextStore.IsMarker(plsrun));
MS\Internal\TextFormatting\LineServicesCallbacks.cs (24)
161Debug.Assert(TextStore.IsContent(plsrun), "Unrecognizable run!"); 162Debug.Assert(lsrun.RunProp != null, "invalid lsrun!"); 205Debug.Assert(lsrun.RunProp != null); 486Debug.Assert(Draw.CurrentLine.FullTextState != null); 494Debug.Assert(lsrun.Shapeable != null && stringLength > 0); 593Debug.Assert(markerStore != null, "No marker store, yet autonumbering is specified!"); 663Debug.Assert( 694Debug.Assert(ulInfo.dvpFirstUnderlineSize >= 0); 727Debug.Assert( 743Debug.Assert(stInfo.dvpLowerStrikethroughSize >= 0); 1237Debug.Fail("Not supported TextDecorationUnit"); 1264Debug.Fail("Not supported TextDecorationUnit"); 1603Debug.Assert(lsrunFirst.Shapeable != null); 1604Debug.Assert(cchText > 0); // LineServices should not pass in zero character count; 1763Debug.Assert(TextStore.IsContent(plsrun) && lsruns[i] != null); 1799Debug.Assert(TextStore.IsContent(plsrun) && lsrun.Shapeable != null); 2315Debug.Fail("Unsupported installed object!"); 2361Debug.Assert(textObject != null); 2421Debug.Assert(false); 2444Debug.Assert(lsrun.Type == Plsrun.InlineObject); 2456Debug.Assert(textObject != null); 2457Debug.Assert(textFlow != LsTFlow.lstflowWS || runDirection != 0); 2605Debug.Assert(fGeometryProvided == 0, "Line enumeration doesn't need geometry information"); 3156Debug.Assert(lsrun.Shapeable != null);
MS\Internal\TextFormatting\LineServicesRun.cs (2)
233Debug.Assert(_shapeable != null); 906Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null);
MS\Internal\TextFormatting\SimpleTextLine.cs (1)
564Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0);
MS\Internal\TextFormatting\TextFormatterImp.cs (2)
528Debug.Assert(context.Owner == null); 553Debug.Assert(context != null);
MS\Internal\TextFormatting\TextMarkerSource.cs (6)
48Debug.Assert(markerStyle != TextMarkerStyle.None); 96Debug.Assert(autoNumberingIndex > 0); 127Debug.Fail("Invalid marker style"); 135Debug.Assert(_characterArray != null); 267Debug.Assert(number >= 0); 399Debug.Assert(number >= 0 && number <= 9);
MS\Internal\TextFormatting\TextMetrics.cs (1)
152Debug.Assert(_cchLength > 0);
MS\Internal\TextFormatting\TextRunCacheImp.cs (2)
172Debug.Assert(textRun != null && runLength > 0, "Invalid run!"); 245Debug.Assert(
MS\Internal\TextFormatting\TextStore.cs (16)
256Debug.Assert(stringLength > 0 && runInfo.Length > 0); 314Debug.Assert( 490Debug.Assert(textEffects != null && textEffects.Count != 0); 629Debug.Assert(runInfo.StringLength > 0 && runInfo.Length > 0); 833Debug.Assert(runInfo.StringLength >= stringLength); 858Debug.Assert(cch <= runInfo.StringLength); 1407Debug.Assert(ichRun < ichEnd); 1435Debug.Assert(ichRun == cchUniform); 1533Debug.Assert(runInfo.OffsetToFirstChar + offsetToFirstChar + lsrunLength <= runInfo.CharacterBuffer.Count); 1553Debug.Assert(offsetToFirstChar == 0); 1599Debug.Assert(uniformBidiLevel == (Pap.RightToLeft ? 1 : 0)); 1628Debug.Assert(lsrunLength > 0); 1695Debug.Assert(false); 1708Debug.Assert(cch > 0 && cch <= stringLength - ich); 1947Debug.Assert(i < _plsrunVector.Count); 2368Debug.Assert(metrics != null);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (2)
31Debug.Assert(capacity >= 0); 41Debug.Assert(realValues != null);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
27Debug.Assert(capacity >= 0); 36Debug.Assert(pointValues != null);
MS\Internal\UIElementHelper.cs (3)
16Debug.Assert(o != null, "UIElementHelper.IsHitTestVisible called with null argument"); 31Debug.Assert(o != null, "UIElementHelper.IsVisible called with null argument"); 46Debug.Assert(o != null, "UIElementHelper.PredictFocus called with null argument");
MS\Win32\UnsafeNativeMethodsTablet.cs (3)
90Debug.Assert(handle != IntPtr.Zero); 130Debug.Assert(handle != IntPtr.Zero); 142System.Diagnostics.Debug.Assert(_recognizerHandle == null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (26)
96Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbFrom) % 4 == 0); 97Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbTo) % 4 == 0); 98Debug.Assert(cbData % 4 == 0); 99Debug.Assert(cbData >= 0); 523Debug.Assert(!handle.IsNull); 553Debug.Assert(!handle.IsNull); 911Debug.Assert(channel != null); 931Debug.Assert(channel != null); 933Debug.Assert(_debugOnly_Channel == channel); 949Debug.Assert(_debugOnly_Channel == channel); 1071Debug.Assert(_others == null, "There shouldn't be anything stored in the others array."); 1126Debug.Assert(_others.Count > 0); 1151Debug.Assert(index == 0); 1385Debug.Assert(index <= 1); 1463Debug.Assert(index == 0); 1501Debug.Assert(channel != null); 1526Debug.Assert(sourceChannel != null); 1531Debug.Assert(found); 1538Debug.Assert(!(_map.Get(targetChannel, out duplicate))); 1564Debug.Assert(channel != null); 1569Debug.Assert(found); 1632Debug.Assert(channel != null); 1637Debug.Assert(found); 1905Debug.Assert(!hCompositionNode.IsNull); 1931Debug.Assert(!hCompositionNode.IsNull); 2109Debug.Assert(!hCompositionNode.IsNull);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
34Debug.Assert(listener.TryGetTarget(out _));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\CharacterBuffer.cs (2)
244Debug.Assert(characterOffset >= 0 && characterOffset < _characterArray.Length, "Invalid character index"); 344Debug.Assert(characterOffset >= 0 && characterOffset < _string.Length, "Invalid character index");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
22Debug.Assert(buffer != null); 35Debug.Assert(buffer != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (2)
129Debug.Assert(_count > 0); 182Debug.Assert(_count != 0);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
35Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
266Debug.Assert(target is not null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Media\TypeConverterHelper.cs (1)
69Debug.Assert(inputString is Uri);
System\IO\Packaging\PackWebRequest.cs (2)
66Debug.Assert(uri != null, "PackWebRequest uri cannot be null"); 67Debug.Assert(packageUri != null, "packageUri cannot be null");
System\IO\Packaging\PackWebResponse.cs (1)
611Debug.Fail("Cannot return full-container stream from cached container object");
System\Windows\Automation\Peers\AutomationPeer.cs (1)
1628Debug.Assert(caller._children != null, "iteration over a null family");
System\Windows\ClassHandlersStore.cs (4)
35Debug.Assert(index != -1, "There should exist a set of handlers for the given routedEvent"); 74Debug.Assert(index != -1, "There should exist a set of handlers for the given index"); 85Debug.Assert(GetHandlersIndex(routedEvent) == -1, "There should not exist a set of handlers for the given routedEvent"); 105Debug.Assert(baseClassListeners != null, "Update only when there are base class listeners to be updated");
System\Windows\Diagnostics\VisualDiagnostics.cs (1)
288System.Diagnostics.Debug.WriteLine(SR.Format(SR.ReentrantVisualTreeChangeWarning, nameof(VisualTreeChanged)));
System\Windows\DragDrop.cs (2)
565Debug.Assert(dragSource != null, "Invalid dragSource"); 566Debug.Assert(dataObject != null, "Invalid dataObject");
System\Windows\DragEventArgs.cs (3)
44Debug.Fail("Invalid dragDropKeyStates"); 49Debug.Fail("Invalid allowedEffects"); 54Debug.Fail("Invalid target");
System\Windows\Duration.cs (1)
38Debug.Assert(durationType == DurationType.Automatic || durationType == DurationType.Forever);
System\Windows\DurationConverter.cs (1)
118Debug.Assert(duration == Duration.Automatic); // Only other legal duration type
System\Windows\EventHandlersStore.cs (2)
249Debug.Assert(key != null, "Search key cannot be null"); 267Debug.Assert(key != null, "Search key cannot be null");
System\Windows\FontStretch.cs (2)
25Debug.Assert(1 <= stretch && stretch <= 9); 54Debug.Assert(1 <= RealStretch && RealStretch <= 9);
System\Windows\FontStyle.cs (3)
22Debug.Assert(0 <= style && style <= 2); 117Debug.Assert(0 <= _style && _style <= 2); 136Debug.Assert(_style == 2);
System\Windows\FontWeight.cs (1)
23Debug.Assert(1 <= weight && weight <= 999);
System\Windows\FreezableCollection.cs (3)
158Debug.Assert(_collection.Count == 0); 980Debug.Assert(list != null, "list may not be null."); 1078Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Generated\TextDecorationCollection.cs (3)
86Debug.Assert(_collection.Count == 0); 745Debug.Assert(list != null, "list may not be null."); 844Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\GiveFeedbackEventArgs.cs (1)
40Debug.Fail("Invalid effects");
System\Windows\GlobalEventManager.cs (3)
23Debug.Assert(GetRoutedEventFromName(name, ownerType, false) == null, 56Debug.Assert( 61Debug.Assert(routedEvent.IsLegalHandler(handler),
System\Windows\Ink\DrawingAttributes.cs (13)
40System.Diagnostics.Debug.Assert(extendedProperties != null); 51System.Diagnostics.Debug.Assert(_extendedProperties != null); 70Debug.Assert(Colors.Black == (Color)GetDefaultDrawingAttributeValue(KnownIds.Color)); 94Debug.Assert(StylusTip.Ellipse == (StylusTip)GetDefaultDrawingAttributeValue(KnownIds.StylusTip)); 100Debug.Assert(StylusTip.Rectangle == (StylusTip)GetExtendedPropertyBackedProperty(KnownIds.StylusTip)); 123Debug.Assert(Matrix.Identity == (Matrix)GetDefaultDrawingAttributeValue(KnownIds.StylusTipTransform)); 152Debug.Assert(DrawingAttributes.DefaultHeight == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusHeight)); 179Debug.Assert(DrawingAttributes.DefaultWidth == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusWidth)); 268Debug.Assert(!(bool)GetDefaultDrawingAttributeValue(KnownIds.IsHighlighter)); 273Debug.Assert((bool)GetExtendedPropertyBackedProperty(KnownIds.IsHighlighter)); 763System.Diagnostics.Debug.Assert(null != DrawingAttributes.GetDefaultDrawingAttributeValue(guid)); 785System.Diagnostics.Debug.Assert(sender != null); 786System.Diagnostics.Debug.Assert(args != null);
System\Windows\Ink\IncrementalHitTester.cs (20)
49System.Diagnostics.Debug.Assert(_strokes != null); 72System.Diagnostics.Debug.Assert(_strokes != null); 118System.Diagnostics.Debug.Assert(strokes != null); 161System.Diagnostics.Debug.Assert((_strokes != null) && (_strokeInfos != null) && (_strokes == sender)); 204Debug.Fail("Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 212Debug.Fail("Benign assert. IncrementalHitTester's _strokeInfos cache is out of sync, rebuilding."); 261Debug.Assert(_strokeInfos.Count == _strokes.Count); 264Debug.Assert(_strokeInfos[x].Stroke == _strokes[x]); 309System.Diagnostics.Debug.Assert((percentageWithinLasso >= 0) && (percentageWithinLasso <= 100)); 320System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points)!= 0)); 457System.Diagnostics.Debug.Assert(eventArgs != null); 498System.Diagnostics.Debug.Assert(eraserShape != null); 511System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points) != 0)); 512System.Diagnostics.Debug.Assert(_erasingStroke != null); 557System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 562System.Diagnostics.Debug.Assert(eventArgs.HitStroke != null); 573System.Diagnostics.Debug.Assert(eventArgs != null); 671System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0); 712System.Diagnostics.Debug.Assert(stroke != null); 819System.Diagnostics.Debug.Assert(stylusPoints != null && index >= 0 && index < stylusPoints.Count);
System\Windows\Ink\Stroke.cs (21)
113Debug.Assert(_cachedGeometry == null || _cachedGeometry.IsFrozen); 250Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 303Debug.Assert(stylusPointsCount > stylusPointsIndex); 321Debug.Assert(bezierLength >= prevUnbezierLength); 714System.Diagnostics.Debug.Assert(cutAt != null); 715System.Diagnostics.Debug.Assert(cutAt.Length != 0); 746System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 756System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(fragment.BeginFIndex, fragment.EndFIndex)); 776System.Diagnostics.Debug.Assert(cutAt != null); 777System.Diagnostics.Debug.Assert(cutAt.Length != 0); 802System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast) || 820System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(beginFIndex, fragment.BeginFIndex)); 849Debug.Assert(sourceStylusPoints != null); 862System.Diagnostics.Debug.Assert(pointCount >= 1); 872System.Diagnostics.Debug.Assert(sourceStylusPoints.Count > i + beginIndex); 876System.Diagnostics.Debug.Assert(stylusPoints.Count == pointCount); 1002System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[0])); 1013System.Diagnostics.Debug.Assert(x == 0); 1016System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[x]) && fragments[x].EndFIndex > current); 1146Debug.Assert(ienum != null); 1165Debug.Assert(ienum != null);
System\Windows\Ink\Stroke2.cs (10)
483System.Diagnostics.Debug.Assert(_cachedGeometry != null && _cachedGeometry.IsFrozen); 515System.Diagnostics.Debug.Assert(!_drawAsHollow); 544System.Diagnostics.Debug.Assert(geometry != null); 553System.Diagnostics.Debug.Assert(!newBounds.IsEmpty); 563System.Diagnostics.Debug.Assert(shape != null); 564System.Diagnostics.Debug.Assert(path != null); 583System.Diagnostics.Debug.Assert(lasso != null); 606System.Diagnostics.Debug.Assert(cutAt != null); 630System.Diagnostics.Debug.Assert(cutAt != null); 668System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetX) && DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetY));
System\Windows\Ink\StrokeCollection.cs (5)
113Debug.Assert(stream != null); 114Debug.Assert(stream.CanRead); 533Debug.Assert(stroke != null && IndexOf(stroke) == -1); 641Debug.Assert(e.Removed.Count > 0); 708Debug.Assert(startingIndex >= 0);
System\Windows\Ink\StrokeCollection2.cs (2)
452System.Diagnostics.Debug.Assert(original != null && toReplace != null); 453System.Diagnostics.Debug.Assert(index >= 0 && index < this.Count);
System\Windows\Input\AccessKeyManager.cs (2)
240Debug.Assert(target != null, "Targets should only be UIElements"); 602Debug.Assert(element is IInputElement, "Element in AccessKeyManager store was not of type IInputElement");
System\Windows\Input\Command\CommandBinding.cs (2)
180Debug.Assert(Executed != null, nameof(Executed) + " != null"); 188Debug.Assert(PreviewExecuted != null, nameof(PreviewExecuted) + " != null");
System\Windows\Input\InputLanguageSource.cs (1)
190Debug.Assert(_ipp == null, "_EnsureInputProcesoorProfile has been called.");
System\Windows\Input\InputMethod.cs (6)
550Debug.Assert(value != InputMethodState.DoNotCare); 611Debug.Assert(value != InputMethodState.DoNotCare); 645Debug.Assert(value != InputMethodState.DoNotCare); 714Debug.Fail("Unknown Speech Mode"); 814Debug.Assert((value & ImeConversionModeValues.DoNotCare) == 0); 1065Debug.Assert((value & ImeSentenceModeValues.DoNotCare) == 0);
System\Windows\Input\InputMethodStateTypeInfo.cs (1)
91Debug.Fail("The guid does not match.");
System\Windows\Input\InputProcessorProfiles.cs (5)
35Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Initialize called on MTA thread!"); 37Debug.Assert(_ipp == null, "Initialize called twice"); 55Debug.Assert(_ipp != null, "Uninitialize called without initializing"); 131Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is already set."); 146Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "Cookie is not set.");
System\Windows\Input\InputProcessorProfilesLoader.cs (1)
56Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "Load called on MTA thread!");
System\Windows\Input\Manipulation.cs (1)
40Debug.Assert(element != null, "element should be non-null.");
System\Windows\Input\ManipulationDevice.cs (7)
74Debug.Assert(element != null, "element should be non-null."); 103Debug.Assert(element != null, "element should be non-null."); 145Debug.Assert(manipulator != null); 163Debug.Assert(manipulator != null); 347Debug.Assert(!deltaEventArgs.IsInertial); 413Debug.Assert(!completedEventArgs.IsInertial); 442Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationLogic.cs (3)
221Debug.Assert(_lastManipulationBeforeInertia != null); 298Debug.Assert(_generatedEvent == null, "There is already a generated event waiting to be pushed."); 625Debug.Assert(_containerLayoutUpdated != null);
System\Windows\Input\MouseDevice.cs (1)
1454Debug.Assert(_mouseOver == null, "_mouseOver should be null because we have called ChangeMouseOver(null) already.");
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (4)
499Debug.Assert(si!=null); // should never get here unless we are transitioning a stroke. 583Debug.Assert(_waitingForRenderComplete, "We were expecting to be waiting for a RenderComplete to call our OnRenderComplete, we might never reset and get flashing strokes from here on out"); 935Debug.Assert(si.StrokeHV.Clip == null); 937Debug.Assert(_renderCompleteStrokeInfo == null);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (2)
166Debug.Assert(__inkingDispatcher != null); // We should have a valid ref here 251Debug.WriteLine(String.Format("Dispatcher.CriticalInvokeShutdown() Failed. Error={0}", e.NativeErrorCode));
System\Windows\Input\Stylus\Common\MultiTouchSystemGestureLogic.cs (2)
68Debug.Assert(_firstStylusDeviceId != null && _firstStylusDeviceId != stylusInputReport.StylusDeviceId); 69Debug.Assert(_secondStylusDeviceId == null);
System\Windows\Input\Stylus\Common\RawStylusInput.cs (1)
34System.Diagnostics.Debug.Assert(tabletToElementTransform.IsFrozen);
System\Windows\Input\Stylus\Common\StylusLogic.cs (3)
403Debug.Assert(_transformToDeviceMatrices[hwndSource.CompositionTarget.CurrentDpiScale].HasInverse); 721Debug.Assert(GetFlickAction(flickData) == FlickAction.Scroll); // Make sure scroll action is set in flickdata. 767Debug.Fail("Unknown Flick Action encountered");
System\Windows\Input\Stylus\Common\StylusPlugInCollection.cs (4)
55System.Diagnostics.Debug.Assert(this.Count > 0); // If active must have more than one plugin already 564System.Diagnostics.Debug.Assert(_element.IsEnabled == (bool)e.NewValue); 570System.Diagnostics.Debug.Assert(_element.IsVisible == (bool)e.NewValue); 576System.Diagnostics.Debug.Assert(_element.IsHitTestVisible == (bool)e.NewValue);
System\Windows\Input\Stylus\Common\StylusPoint.cs (2)
248Debug.Assert(value != null && 504Debug.Assert(StylusPointDescription.AreCompatible(stylusPoint1.Description, stylusPoint2.Description));
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (6)
144Debug.Assert(0 == rawPacketData.Length % lengthPerPoint, "Invalid assumption about packet length, there shouldn't be any remainder"); 363Debug.Assert(count <= this.Count); 532Debug.Assert(additionalData.Length == countToCopy); 558Debug.Assert(this.Count != 0, "Why are we serializing an empty StylusPointCollection???"); 608Debug.Assert( this.Description.ButtonCount > 0 ? 643Debug.Assert(e.Cancel, "This event should always be cancelled");
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (4)
297Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 302Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 338Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 343Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 &&
System\Windows\Input\Stylus\Common\StylusPointPropertyInfo.cs (1)
114Debug.Assert(( stylusPointPropertyInfo1.Id != StylusPointPropertyIds.X &&
System\Windows\Input\Stylus\Common\TabletDeviceBase.cs (1)
257Debug.Assert(properties != null);
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (2)
803Debug.Assert(transformToElement != null); 1117Debug.Assert(transformToElement != null);
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (1)
159System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Pointer\PointerTabletDeviceInfo.cs (3)
257Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X || !seenX, 259Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y || !seenY, 261Debug.Assert(properties[StylusPointDescription.RequiredPressureIndex /*1*/].Id == StylusPointPropertyIds.NormalPressure /*2*/,
System\Windows\Input\Stylus\Wisp\PenContext.cs (9)
102Debug.Assert(!_contexts._inputSource.CheckAccess()); 105Debug.Assert(_pimcContext != null); 133Debug.Assert(_statusPropertyIndex != -1); // We should always see this. 149Debug.Assert(propertyInfos[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 150Debug.Assert(propertyInfos[StylusPointDescription.RequiredYIndex /*0*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 151Debug.Assert(pressureIndex == -1 || pressureIndex == StylusPointDescription.RequiredPressureIndex /*2*/, 322System.Diagnostics.Debug.Assert(stylusPointerId != 0); 425Debug.Assert(numPackets != 0); 426Debug.Assert(data != null);
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
466System.Diagnostics.Debug.Assert(!inputReport.StylusDevice.CheckAccess()); 485System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenThreadPool.cs (1)
143Debug.Fail("Retry limit reached when acquiring PenThread");
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (11)
151Debug.WriteLine("WorkerOperationGetTabletsInfo.OnDoWork failed due to: {0}{1}", Environment.NewLine, e.ToString()); 207Debug.WriteLine("WorkerOperationCreateContext.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 314Debug.WriteLine("WorkerOperationRefreshCursorInfo.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 356Debug.WriteLine("WorkerOperationGetTabletInfo.OnDoWork failed due to {0}{1}", Environment.NewLine, e.ToString()); 396Debug.WriteLine("WorkerOperationWorkerGetUpdatedSizes.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString()); 514Debug.Assert(penContext != null); 541Debug.Assert(penContext != null); 932Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0"); 933Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1"); 1035Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero); 1089Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (13)
98Debug.Assert(systemGesture != SystemGesture.None); // We should ever see this as input. 832Debug.Assert((actions & ~(RawMouseActions.Button3Press | RawMouseActions.Button3Release | 1736Debug.Assert(ShouldPromoteToMouse(stylusDevice) && stylusDevice.TouchDevice.PromotingToOther); 2514Debug.Assert(stylusDevice.InAir); 2528Debug.Assert(stylusDevice.InAir); 2799System.Diagnostics.Debug.Assert(stylusDevice != null); 2828System.Diagnostics.Debug.Assert(stylusDevice != null); 2895System.Diagnostics.Debug.Assert(stylusDevice != null); 3041Debug.Assert(__stylusDeviceMap.ContainsKey(stylusDevice.Id)); 3051Debug.Assert(Dispatcher.CheckAccess()); 3237Debug.Assert(Dispatcher.CheckAccess()); 3285Debug.Assert(Dispatcher.CheckAccess()); 3304Debug.Assert(!_inputEnabled, "StylusLogic has been enabled unexpectly.");
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (3)
1342Debug.Assert(transformToElement != null); 1398Debug.Assert(report.TabletDeviceId == _tabletDevice.Id); 1399Debug.Assert((report.Actions & RawStylusActions.None) == 0);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
176Debug.Assert(_stylusDeviceCollection != null); 218Debug.Assert(CheckAccess());
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (7)
161System.Diagnostics.Debug.WriteLine("TabletDeviceCollection: GetRawInputDeviceInfo failed!"); 168System.Diagnostics.Debug.WriteLine("TabletDeviceCollection: GetRawInputDeviceList failed!"); 267Debug.Fail("Error acquiring PenThread in UpdateTabletsImpl()"); 415Debug.Fail("Error acquiring PenThread in HandleTabletAdded()"); 539Debug.Assert(index <= Count); 540Debug.Assert(tabletDevice.Type != (TabletDeviceType)(-1)); // make sure not the mouse tablet device! 559System.Diagnostics.Debug.Assert(index < Count && Count > 0);
System\Windows\Input\TextComposition.cs (1)
305Debug.Assert((_resultText.Length == 1) && Char.IsControl(_resultText[0]));
System\Windows\Input\TextCompositionManager.cs (2)
737Debug.Assert(_altNumpadEntryMode); 857Debug.Assert(destination.Length == 2, "Invalid buffer length");
System\Windows\Input\TextServicesCompartment.cs (2)
86Debug.Assert(_cookie == UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is already set."); 107Debug.Assert(_cookie != UnsafeNativeMethods.TF_INVALID_COOKIE, "cookie is not set.");
System\Windows\Input\TextServicesContext.cs (1)
46Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "SetDispatcherThreaad on MTA thread");
System\Windows\Input\TouchDevice.cs (4)
601Debug.Assert(oldCapture != null, "oldCapture should be non-null."); 610Debug.Assert(captured != null, "captured should be non-null."); 848Debug.Assert(newDirectlyOver != _directlyOver, "ChangeDirectlyOver called when newDirectlyOver is the same as _directlyOver."); 930Debug.Assert(element != null);
System\Windows\InterOp\D3DImage.cs (8)
581Debug.Assert(timeout != Duration.Automatic); 622Debug.Assert(e.OldValue != e.NewValue); 659Debug.Assert(_isDirty); 660Debug.Assert(_isWaitingForPresent); 661Debug.Assert(_lockCount == 0); 682Debug.Assert(_duceResource.IsOnChannel(channel)); 764Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 838Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\InterOp\HwndAppCommandInputProvider.cs (1)
29Debug.Assert(null != _source);
System\Windows\InterOp\HwndKeyboardInputProvider.cs (12)
52Debug.Assert( null != _source ); 144System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: AcquireFocus failed!"); 171System.Diagnostics.Debug.WriteLine("HwndKeyboardInputProvider: GetMessageTime failed!"); 202System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetTickCount failed!"); 560System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetKeyState failed!"); 594System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: MapVirtualKey failed!"); 647System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: MapVirtualKey failed!"); 699Debug.Assert( null != _source ); 732Debug.Assert( null != _source ); 804Debug.Assert( null != _source ); 822System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetKeyboardState failed!"); 837System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageExtraInfo failed!");
System\Windows\InterOp\HwndMouseInputProvider.cs (24)
49System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Dispose: GetCapture failed!"); 60System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Dispose: GetCapture failed!"); 103System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: SetCursor failed!"); 119Debug.Assert(_source is not null); 132System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: SetCapture or GetCapture failed!"); 157System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ScreenToClient failed!"); 194System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ReleaseCapture failed!"); 305System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetIntermediatePoints failed!"); 346System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageTime failed!"); 477System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: ScreenToClient failed!"); 674System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCapture failed!"); 779System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCapture failed!"); 915System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessagePos failed!"); 928System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: WindowFromPoint failed!"); 958System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetClientRect or ScreenToClient failed!"); 1139System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: TrackMouseEvent failed!"); 1157System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: TrackMouseEvent failed!"); 1178Debug.Assert(_source is not null); 1223Debug.Assert(_source is not null); 1300System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetCursorPos failed!"); 1309System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: WindowFromPoint failed!"); 1318System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: Spurious mouse event received!"); 1393System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetWindowStyle or GetClientRect failed!"); 1408System.Diagnostics.Debug.WriteLine("HwndMouseInputProvider: GetMessageExtraInfo failed!");
System\Windows\InterOp\HwndSource.cs (6)
738Debug.Assert(_weakMenuModeMessageHandler == null); 762Debug.Assert(_weakMenuModeMessageHandler != null); 1018Debug.Assert(_hwndTarget!= null, "HwndTarget is null"); 1019Debug.Assert(!_hwndTarget.IsDisposed, "HwndTarget is disposed"); 1523Debug.Assert(_adjustSizingForNonClientArea); 2263Debug.Assert(null!=ikis, "ChildSinkWithFocus called when none had focus");
System\Windows\InterOp\HwndTarget.cs (11)
473Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 507Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 595Debug.Assert(mode == RenderingMode.Software || mode == RenderingMode.Default); 721Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 722Debug.Assert(!_compositionTarget.IsOnChannel(outOfBandChannel)); 741Debug.Assert(resourceCreated); 1341Debug.Assert(_restoreDT == sourceDT); 2375Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 2576Debug.Assert(hwndTarget != null); 2593Debug.Assert(hwndTarget != null); 2596Debug.Assert(_hwndTargetCount >= 0);
System\Windows\Media\Animation\Animatable.cs (3)
62Debug.Assert(animatedPropertiesMap.Count > 0); 84Debug.Assert(animatedPropertiesMap.Count > 0); 298Debug.Assert(reference is WeakReference);
System\Windows\Media\Animation\AnimationClockResource.cs (6)
63Debug.Assert(sender as System.Windows.Threading.DispatcherObject != null); 64Debug.Assert(((System.Windows.Threading.DispatcherObject)sender).Dispatcher != null); 65Debug.Assert(_animationClock != null); 117Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 158Debug.Assert(_duceResource.IsOnChannel(channel)); 174Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\AnimationLayer.cs (19)
16Debug.Assert(ownerStorage != null); 27Debug.Assert( 34Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue, 81Debug.Assert(handoffBehavior == HandoffBehavior.Compose, 83Debug.Assert(defaultDestinationValue == DependencyProperty.UnsetValue, 103Debug.Assert(_animationClocks != null); 118Debug.Assert(animationClocks != null); 119Debug.Assert(animationClocks.Count > 0); 120Debug.Assert(!animationClocks.Contains(null)); 121Debug.Assert(_animationClocks == null); 135Debug.Assert(_hasStickySnapshotValue, 145Debug.Assert(_animationClocks != null 153Debug.Assert(index >= 0, 185Debug.Assert(newAnimationClocks != null); 186Debug.Assert(newAnimationClocks.Count > 0); 187Debug.Assert(!newAnimationClocks.Contains(null)); 220Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 240Debug.Assert(_snapshotValue != DependencyProperty.UnsetValue); 261Debug.Assert(count > 0);
System\Windows\Media\Animation\AnimationStorage.cs (41)
46Debug.Assert( _animationClocks == null 49Debug.Assert( _propertyTriggerLayers == null 78Debug.Assert(animationClock != null); 79Debug.Assert(_dependencyObject.Target != null); 80Debug.Assert(_currentTimeInvalidatedHandler != null); 106Debug.Assert(animationClock != null); 107Debug.Assert(_currentTimeInvalidatedHandler != null); 119Debug.Assert(_dependencyObject == null); 120Debug.Assert(_dependencyProperty == null); 144Debug.Assert(_propertyTriggerLayers != null); 145Debug.Assert(_propertyTriggerLayers.ContainsValue(layer)); 149Debug.Assert(index >= 0); 244Debug.Assert(animatedPropertyMap.Count > 0); 245Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue); 501Debug.Assert( _animationClocks != null 509Debug.Assert(index > -1, 538Debug.Assert(_hasStickySnapshotValue, 550Debug.Assert(_animationClocks.Count > 0); 588Debug.Assert(animationClocks != null, 590Debug.Assert(animationClocks.Count > 0, 592Debug.Assert(!animationClocks.Contains(null), 594Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 649Debug.Assert(animationClocks[i] != null); 657Debug.Assert(handoffBehavior == HandoffBehavior.Compose); 658Debug.Assert(storage != null); 659Debug.Assert(storage._animationClocks != null); 703Debug.Assert(animationClocks != null); 704Debug.Assert(!animationClocks.Contains(null)); 706Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 776Debug.Assert(animation == null || IsAnimationValid(dp, animation)); 777Debug.Assert(IsPropertyAnimatable(d, dp)); 779Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior), 848Debug.Assert(storage._animationClocks != null && storage._animationClocks.Count > 0, 895Debug.Assert(storage != null, 916Debug.Assert(storage._snapshotValue != DependencyProperty.UnsetValue); 928Debug.Assert(currentPropertyValue != DependencyProperty.UnsetValue); 938Debug.Assert(count > 0); 970Debug.Assert(clocksCount > 0); 971Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 1082Debug.Assert( AnimatedPropertyMapField.GetValue(d)[dp.GlobalIndex] == DependencyProperty.UnsetValue 1144Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (145)
51Debug.Assert(timeline != null); 161Debug.Assert(!IsTimeManager); 190Debug.Assert(!IsTimeManager); 208Debug.Assert(!IsTimeManager); 230Debug.Assert(!IsTimeManager); 268Debug.Assert(!IsTimeManager); 281Debug.Assert(!IsTimeManager); 299Debug.Assert(!IsTimeManager); 326Debug.Assert(!IsTimeManager); 354Debug.Assert(!IsTimeManager); 486Debug.Assert(!IsTimeManager); 572Debug.Assert(!clock.IsTimeManager); 622Debug.Assert(!current.IsTimeManager); // We should not yet be connected to the TimeManager 700Debug.Assert(!IsTimeManager); 775Debug.Assert(!IsTimeManager); 782Debug.Assert(!(IsInteractivelyPaused && PendingInteractivePause)); 783Debug.Assert(!(!IsInteractivelyPaused && PendingInteractiveResume)); 820Debug.Assert(!IsTimeManager); 827Debug.Assert( !(IsInteractivelyPaused && PendingInteractivePause)); 828Debug.Assert( !(!IsInteractivelyPaused && PendingInteractiveResume)); 855Debug.Assert(IsRoot); 877Debug.Assert(IsRoot); 948Debug.Assert(IsRoot); 959Debug.Assert(IsRoot); 990Debug.Assert(IsRoot); 1071Debug.Assert(!IsTimeManager); 1107Debug.Assert(!IsTimeManager); 1129Debug.Assert(!IsTimeManager); 1148Debug.Assert(!IsTimeManager); 1224Debug.Assert(!IsTimeManager); 1372Debug.Assert(!IsTimeManager); 1392Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic."); 1409Debug.Assert(!IsTimeManager); 1410Debug.Assert(_parent != null && !_parent.IsTimeManager); 1782Debug.Assert(IsRoot); // root clocks only; non-roots have constant begin time 1783Debug.Assert(_rootData != null); 1788Debug.Assert(!RootBeginPending); // we can have either a begin or a seek, not both 1859Debug.Assert(_beginTime.HasValue); 1910Debug.Assert(IsRoot); 1916Debug.Assert(_rootData.DesiredFrameRate > 0); 1936Debug.Assert(!IsTimeManager); 1937Debug.Assert(!IsInteractivelyStopped); 1938Debug.Assert(_parent._currentClockState != ClockState.Stopped); 1939Debug.Assert(_currentClockState != ClockState.Stopped); 1940Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 1941Debug.Assert(_beginTime.HasValue); 1943Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill 1958Debug.Assert(_currentClockState != ClockState.Active); 2166Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2167Debug.Assert(_currentClockState == ClockState.Active 2185Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups."); 2186Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow."); 2187Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value."); 2188Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration 2189Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value."); 2250Debug.Assert(!IsTimeManager); 2251Debug.Assert(!IsInteractivelyStopped); 2252Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2253Debug.Assert(_beginTime.HasValue); 2302Debug.Assert(!IsTimeManager); 2303Debug.Assert(!IsInteractivelyStopped); 2304Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2305Debug.Assert(_currentClockState == ClockState.Active); // Must be active at this point 2332Debug.Assert(!IsTimeManager); 2333Debug.Assert(!IsInteractivelyStopped); 2334Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2335Debug.Assert(_currentClockState != ClockState.Stopped); 2336Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2340Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0"); 2347Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0"); 2348Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0"); 2411Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value."); 2425Debug.Assert(!IsTimeManager); 2439Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic."); 2467Debug.Assert(!IsTimeManager); 2468Debug.Assert(!IsInteractivelyStopped || IsRoot); 2472Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic."); 2473Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic."); 2495Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2496Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration."); 2508Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan."); 2509Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan."); 2518Debug.Assert(_beginTime.HasValue); // _currentIterationBeginTime.HasValue implies _beginTime.HasValue 2547Debug.Assert(repeatBehavior == RepeatBehavior.Forever); // Only other valid enum value 2641Debug.Assert(!IsTimeManager); 2642Debug.Assert(!IsInteractivelyStopped || IsRoot); 2649Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value."); 2654Debug.Assert(_beginTime.HasValue); 2683Debug.Assert(IsRoot); 2726Debug.Assert(_beginTime == null); 2727Debug.Assert(_currentClockState == ClockState.Stopped); 2751Debug.Assert(!IsInteractivelyPaused); // Enforce invariant: cannot be pausePending when already paused 2752Debug.Assert(!PendingInteractiveResume); // Enforce invariant: cannot be both pause and resumePending 2769Debug.Assert(IsInteractivelyPaused); 2770Debug.Assert(!PendingInteractivePause); 2798Debug.Assert(endOfActivePeriod.HasValue); 2873Debug.Assert(!IsTimeManager); 2898Debug.Assert(parentTime.HasValue); // If parent isn't stopped, it must have valid time and speed 2899Debug.Assert(parentSpeed.HasValue); 2925Debug.Assert(parentTime.HasValue); // Cannot be true unless parent is stopped 2946Debug.Assert(_beginTime.HasValue); 2947Debug.Assert(parentTime.HasValue); 2992Debug.Assert(!IsTimeManager); 2993Debug.Assert(!IsInteractivelyStopped); 2994Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2995Debug.Assert(_beginTime.HasValue); 3067Debug.Assert(!IsTimeManager); 3068Debug.Assert(!IsInteractivelyStopped || IsRoot); 3072Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized."); 3150Debug.Assert(!IsTimeManager); 3151Debug.Assert(_parent != null); 3152Debug.Assert(_parent.CurrentState != ClockState.Stopped); 3155Debug.Assert(HasSeekOccuredAfterLastTick || 3159Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3160Debug.Assert(CanSlip || _timeline is ParallelTimeline && ((ParallelTimeline)_timeline).SlipBehavior == SlipBehavior.Slip); 3162Debug.Assert(_syncData != null); 3163Debug.Assert(!_syncData.IsInSyncPeriod); 3166Debug.Assert(!_timeline.AutoReverse); 3167Debug.Assert(_timeline.AccelerationRatio == 0); 3168Debug.Assert(_timeline.DecelerationRatio == 0); 3215Debug.Assert(syncClockDuration == Duration.Automatic); 3283Debug.Assert(!IsTimeManager); 3284Debug.Assert(_parent != null); 3285Debug.Assert(_syncData != null); 3286Debug.Assert(_syncData.IsInSyncPeriod); 3289Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3293Debug.Assert(!parentIntervalCollection.IsEmpty); // The parent isn't Stopped, so it must have a TIC 3297Debug.Assert(parentIntervalCollection.IsEmptyOfRealPoints || parentIntervalCollection.FirstNodeTime <= currentParentTimePT); 3298Debug.Assert(currentParentSpeed >= 0); 3386Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking."); 3428Debug.Assert(!IsTimeManager); 3509Debug.Assert(_rootData.DesiredFrameRate > 0); 3537Debug.Assert(!IsTimeManager); 3560Debug.Assert(!IsTimeManager); 3561Debug.Assert(_parent == null); 3562Debug.Assert(_timeManager == null); 3653Debug.Assert(factor != 0); // Divide by zero 3737Debug.Assert(IsRoot); // This should only be called on root-child clocks 3773Debug.Assert(!IsTimeManager); 3852Debug.Assert(!IsTimeManager); 3970Debug.Assert(syncClock != null); 3971Debug.Assert(syncClock.GetCanSlip()); 3972Debug.Assert(syncClock.IsRoot || syncClock._timeline.BeginTime.HasValue); // Only roots may later validate their _beginTime 4061Debug.Assert(_syncClockBeginTime.HasValue); // This should never be queried on a root without beginTime 4163Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\Animation\ClockController.cs (1)
31Debug.Assert(owner != null, "ClockController must have a non-null owner.");
System\Windows\Media\Animation\ClockGroup.cs (19)
50Debug.Assert(!IsTimeManager); 63Debug.Assert(!IsTimeManager); 76Debug.Assert(IsTimeManager); 94Debug.Assert(timelineGroup != null); 183Debug.Assert(IsTimeManager); 211Debug.Assert(IsTimeManager); 248Debug.Assert(IsTimeManager); 294Debug.Assert(group != null); // We should only have this flag set for ClockGroups 308Debug.Assert(_children != null); 407Debug.Assert(!IsTimeManager, "Cannot associate a root with multiple timing trees"); 408Debug.Assert(this._timeManager == null, "Cannot use a timeline already in the timing tree as a root"); 409Debug.Assert(timeManager.TimeManagerClock == this, "Cannot associate more than one root per timing tree"); 410Debug.Assert(this._parent == null && _children == null, "Cannot use a timeline connected to other timelines as a root"); 432Debug.Assert(IsRoot); 457Debug.Assert(IsTimeManager, "Invalid call to RootActivate for a non-root Clock"); 458Debug.Assert(_timeManager != null); // RootActivate should be called by our own TimeManager 473Debug.Assert(IsTimeManager, "Invalid call to RootCleanChildren for a non-root Clock"); 496Debug.Assert(IsTimeManager, "Invalid call to RootHasChildren for a non-root Clock"); 507Debug.Assert(IsTimeManager, "Invalid call to RootDeactivate for a non-root Clock");
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
163Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 256Debug.Assert(!_isValid);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameBooleanAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ByteAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameByteAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameCharAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ColorAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameColorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ColorIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameDecimalAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameDoubleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\DoubleIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int16Animation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt16Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int32Animation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt32Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int64Animation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameInt64Animaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameMatrixAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\MatrixIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameObjectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFramePoint3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Point3DIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\PointAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFramePointAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\PointIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameQuaternionAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\QuaternionIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\RectAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameRectAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\RectIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameRotation3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SingleAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameSingleAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SizeAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameSizeAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\SizeIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 531Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 538Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 588Debug.Assert(!_areKeyTimesValid, "KeyFrameStringAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 732Debug.Assert(index < keyFrameCount, 808Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\TimelineCollection.cs (3)
85Debug.Assert(_collection.Count == 0); 744Debug.Assert(list != null, "list may not be null."); 843Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Animation\Generated\TimelineGroup.cs (1)
171Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameVector3DAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\Vector3DIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\VectorAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameVectorAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\IndependentAnimationStorage.cs (14)
62Debug.Assert(d != null); 66Debug.Assert(d.Dispatcher != null); 69Debug.Assert(d.CheckAccess()); 91Debug.Assert(_duceResource.IsOnChannel(channel)); 107Debug.Assert(d != null); 110Debug.Assert(d.Dispatcher != null); 113Debug.Assert(d.CheckAccess()); 178Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 210Debug.Assert(d != null); 214Debug.Assert(_duceResource.IsOnAnyChannel); 230Debug.Assert(d != null); 231Debug.Assert(dp != null); 232Debug.Assert(d is Animatable ? ((Animatable)d).HasAnimatedProperties : true); 242Debug.Assert(storage._duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\KeySpline.cs (3)
253Debug.Assert(_isDirty); 305Debug.Assert(_isSpecified); 327Debug.Assert(_isSpecified);
System\Windows\Media\Animation\MatrixAnimationUsingPath.cs (2)
242Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Assert(!_isValid);
System\Windows\Media\Animation\PointAnimationUsingPath.cs (2)
134Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 207Debug.Assert(!_isValid);
System\Windows\Media\Animation\RepeatBehavior.cs (4)
67Debug.Assert(behaviorType == RepeatBehaviorType.Forever); 185Debug.Fail("Unhandled RepeatBehaviorType"); 230Debug.Fail("Unhandled RepeatBehaviorType"); 296Debug.Fail("Unhandled RepeatBehaviorType.");
System\Windows\Media\Animation\RepeatBehaviorConverter.cs (1)
142Debug.Fail("Unknown type of RepeatBehavior passed to RepeatBehaviorConverter.");
System\Windows\Media\Animation\TimeIntervalCollection.cs (83)
105Debug.Assert(_minimumCapacity >= 2); 132Debug.Assert(IsEmpty); // We should start with a new or Clear()-ed collection first 139Debug.Assert(!_nodeIsInterval[0]); 188Debug.Assert(_count == 0); // The boolean constructor already did the job for us 250Debug.Assert(_count > 0); 296Debug.Assert(IsSingleInterval); 298Debug.Assert(0 < _count && _count <= 2); 307Debug.Assert(beginTime <= _nodeTime[1]); 411Debug.Assert(_nodeTime[index] < time); 543Debug.Assert(fromIndex <= toIndex); 554Debug.Assert(toIndex >= 0); // Since fromIndex!=toIndex, toIndex must be >= 0 561Debug.Assert(fromIndex + 1 < toIndex); 617Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 681Debug.Assert(!tic1.IsEmptyOfRealPoints); // We shouldn't reach here if either TIC is empty 682Debug.Assert(!tic2.IsEmptyOfRealPoints); 710Debug.Assert(!intersectionFound); // If an intersection was already found, we should not reach this far 720Debug.Assert(tic2.CurrentNodeIsPoint || tic2.CurrentNodeIsInterval); 738Debug.Assert(!tic1.CurrentIsAtLastNode); // Thus tic1._current can be safely advanced now 744Debug.Assert(tic1.CurrentNodeTime >= tic2.CurrentNodeTime); 747Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 748Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 780Debug.Assert(tic1.NextNodeTime == tic2.NextNodeTime); 788Debug.Assert(tic1.CurrentIsAtLastNode && tic2.CurrentIsAtLastNode); 796Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 797Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 808Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 856Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 875Debug.Assert(beginTime <= CurrentNodeTime); // The PTIC is clipped by the active period, and we are a subset of the active period 876Debug.Assert(CurrentIsAtLastNode || beginTime < NextNodeTime); 983Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1031Debug.Assert(projection.IsEmpty); // Make sure the projection was properly cleared first 1032Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1033Debug.Assert(beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1035Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the postfill zone. So we cannot be empty. 1036Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || beginTime == endTime); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1037Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1154Debug.Assert(projection.IsEmpty); 1155Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1156Debug.Assert(!endTime.HasValue || beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1158Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the active zone. So we cannot be empty. 1159Debug.Assert(!endTime.HasValue || endTime >= _nodeTime[0]); // EndTime must come at or after our first node (it can be infinite) 1160Debug.Assert(_nodeTime[_count - 1] >= beginTime); // Our last node must come at least at begin time (since we must intersect the active period) 1161Debug.Assert(endTime.HasValue || fillDuration == TimeSpan.Zero); // Either endTime is finite, or it's infinite hence we cannot have any fill zone 1162Debug.Assert(!period.HasTimeSpan || period.TimeSpan > TimeSpan.Zero || (endTime.HasValue && beginTime == endTime)); // Check the consistency of degenerate case where simple duration is zero; expiration time should equal beginTime 1163Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1237Debug.Assert(!IsEmptyOfRealPoints); 1238Debug.Assert(projection.IsEmpty); 1277Debug.Assert(_current > 0); // The only way _current could stay at zero is if the collection begins at (or past) the end of active period 1282Debug.Assert(endTime.HasValue && CurrentNodeTime >= endTime.Value); 1307Debug.Assert(!IsEmptyOfRealPoints); // The entire projection process assumes we are not empty (have an intersection with the active zone). 1308Debug.Assert(periodInTicks > 0); // We do not handle the degenerate case here. 1312Debug.Assert(CurrentNodeTime >= TimeSpan.Zero); // Verify that we are already clipped 1329Debug.Assert(CurrentNodeIsPoint); 1349Debug.Assert(CurrentNodeIsPoint); // We should only call this method when we project a legitimate point 1350Debug.Assert(!CurrentNodeIsInterval); 1421Debug.Assert(timeBeforeNextPeriod > 0); 1494Debug.Assert(intervalLength > 0); 1577Debug.Assert(index == -1 || _nodeTime[index] < point); 1608Debug.Assert(from < to); // Our code should never call MergeInterval for a point or reversed interval 1624Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1662Debug.Assert(_nodeTime[fromIndex] == from); 1693Debug.Assert(_nodeTime[toIndex] == to); 1694Debug.Assert(fromIndex < toIndex); 1725Debug.Assert(_count + netIncreaseInNodes >= 2); // We should never shrink past size 2 1773Debug.Assert(_nodeIsPoint == null); 1774Debug.Assert(_nodeIsInterval == null); 1782Debug.Assert(_nodeIsPoint != null); 1783Debug.Assert(_nodeIsInterval != null); 1814Debug.Assert(periodInTicks > 0); 1815Debug.Assert(accelRatio + decelRatio > 0); 2129Debug.Assert(_count > 0); // Count cannot be negative 2155Debug.Assert(right == _count - 1); 2185Debug.Assert(_current <= _count); 2200Debug.Assert(_current < _count); 2205Debug.Assert(_current < _count); 2214Debug.Assert(_current < _count); 2219Debug.Assert(_current < _count); 2228Debug.Assert(_current < _count); 2233Debug.Assert(_current < _count); 2242Debug.Assert(_current + 1 < _count); 2251Debug.Assert(_current + 1 < _count); 2260Debug.Assert(_current + 1 < _count); 2275Debug.Assert(_invertCollection != mode); // Make sure we aren't redundantly setting the mode
System\Windows\Media\Animation\Timeline.cs (1)
922Debug.Assert(sourceStore.Count > 0);
System\Windows\Media\Animation\TimelineClockCollection.cs (2)
417Debug.Assert(owner != null, "ClockCollection must have a non-null owner."); 426Debug.Fail("Parameterless constructor is illegal for ClockCollection.");
System\Windows\Media\Animation\TimeManager.cs (1)
575Debug.Fail("Unrecognized TimeState enumeration value");
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
54Debug.Assert(_valid); 72Debug.Assert(_valid);
System\Windows\Media\BitmapCacheBrush.cs (11)
177Debug.Assert(InternalTarget == AutoWrapVisual, 196Debug.Assert(!_pendingLayout); 254Debug.Assert(element != null); 274Debug.Assert(_pendingLayout); 278Debug.Assert(element != null); 289Debug.Assert(_DispatcherLayoutResult != null); 290Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 292Debug.Assert(abortStatus); 304Debug.Assert(_pendingLayout); 307Debug.Assert(element != null); 345Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\BoundsDrawingContextWalker.cs (4)
501Debug.Assert(_pushTypeStack != null); 502Debug.Assert(_pushTypeStack.Count > 0); 511Debug.Assert(_transformStack != null); 512Debug.Assert(_transformStack.Count > 0);
System\Windows\Media\ByteStreamGeometryContext.cs (8)
312Debug.Assert(sizeof(MIL_PATHGEOMETRY) <= _currOffset); 313Debug.Assert(_currentPathGeometryData.Size == (uint)_currOffset); 417Debug.Assert(_chunkList.Count != 0); 542Debug.Assert(_currentPathFigureDataOffset + sizeof(MIL_PATHFIGURE) <= _currOffset); 582Debug.Assert(_currentPolySegmentDataOffset + sizeof(MIL_SEGMENT_POLY) <= _currOffset); 665Debug.Assert(points != null); 666Debug.Assert(count > 0); 715Debug.Assert((_currentPolySegmentDataOffset != -1) &&
System\Windows\Media\ColorContext.cs (2)
149Debug.Assert(_profileUri is null); 587Debug.Assert(stm != null);
System\Windows\Media\ColorTransformHelper.cs (2)
71Debug.Assert(success); 73Debug.Assert(success);
System\Windows\Media\CombinedGeometry.cs (1)
188Debug.Assert(false);
System\Windows\Media\CompositionTarget.cs (6)
48Debug.Assert(channel != null); 49Debug.Assert(!_contentRoot.IsOnChannel(channel)); 51Debug.Assert(outOfBandChannel != null); 52Debug.Assert(!_contentRoot.IsOnChannel(outOfBandChannel)); 63Debug.Assert(resourceCreated); 440Debug.Assert(_cachedRenderContext == null);
System\Windows\Media\Drawing.cs (1)
72Debug.Assert(ctx != null);
System\Windows\Media\DrawingContextDrawingContextWalker.cs (1)
25Debug.Assert (drawingContext != null);
System\Windows\Media\DrawingContextWalker.cs (2)
30Debug.Assert(false); 40Debug.Assert(false);
System\Windows\Media\DrawingDrawingContext.cs (3)
1288Debug.Assert(geometry != null); 1376Debug.Assert(newDrawing != null); 1382Debug.Assert(_currentDrawingGroup == null);
System\Windows\Media\DrawingGroup.cs (3)
80Debug.Assert(_open); 81Debug.Assert(rootDrawingGroupChildren != null); 160Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\DrawingGroupDrawingContext.cs (2)
20Debug.Assert(null != drawingGroup); 38Debug.Assert(null != _drawingGroup);
System\Windows\Media\DrawingVisual.cs (4)
50Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 135Debug.Assert(_proxy.IsOnChannel(channel)); 205Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 206Debug.Assert(_proxy.IsOnChannel(channel));
System\Windows\Media\DrawingVisualDrawingContext.cs (2)
22Debug.Assert(null != ownerVisual); 38Debug.Assert(null != _ownerVisual);
System\Windows\Media\Effects\Generated\BitmapEffectCollection.cs (3)
88Debug.Assert(_collection.Count == 0); 747Debug.Assert(list != null, "list may not be null."); 846Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Effects\Generated\BitmapEffectGroup.cs (1)
194Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Effects\Generated\BitmapEffectInput.cs (1)
227Debug.Assert(s_Input == null || s_Input.IsFrozen,
System\Windows\Media\Effects\Generated\BlurEffect.cs (2)
163Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 212Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\DropShadowEffect.cs (2)
229Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 301Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ImplicitInputBrush.cs (2)
100Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 180Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\PixelShader.cs (1)
166Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ShaderEffect.cs (3)
99Debug.Assert(!channel.IsOutOfBandChannel); 100Debug.Assert(!targetResource.GetHandle(channel).IsNull); 187Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\PixelShader.cs (3)
81Debug.Assert(newUri.IsAbsoluteUri); 151Debug.Assert(len == lengthRead); 174Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\ShaderEffect.cs (8)
394Debug.Assert(false); 534Debug.Assert(!channel.IsOutOfBandChannel); 535Debug.Assert(!targetResource.GetHandle(channel).IsNull); 548Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 702Debug.Assert(sizeof(DUCE.ResourceHandle) == sizeof(Int32)); 708Debug.Assert(!hBrush.IsNull || ss._brush == null, "If brush isn't null, hBrush better not be"); 781Debug.Assert(_duceResource.IsOnChannel(channel)); 931Debug.Assert(false);
System\Windows\Media\EventProxy.cs (2)
29Debug.Assert(((IntPtr)pEPD.m_handle) != IntPtr.Zero, "If this asserts fires: Why is it firing? It might be legal in future."); 104Debug.Assert(((IntPtr)epd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\FactoryMaker.cs (2)
100Debug.Assert(s_pFactory != IntPtr.Zero); 116Debug.Assert(s_pImagingFactory != IntPtr.Zero);
System\Windows\Media\FamilyMap.cs (1)
350Debug.Assert(first <= last);
System\Windows\Media\FontFamilyConverter.cs (3)
163Debug.Assert(name != null); 168Debug.Assert(name != null); 173Debug.Assert(name != null);
System\Windows\Media\FormattedText.cs (6)
982Debug.Assert(_nextLine == null); 1002Debug.Assert(_totalHeight + _currentLine.Height <= _that._maxTextHeight); 1086Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1); 1102Debug.Assert(_that._trimming == TextTrimming.WordEllipsis); 1705Debug.Assert(_defaultParaProps.Indent == 0.0, "FormattedText was assumed to always have 0 indent. This assumption has changed and thus the calculation of Width and Overhangs should be revised."); 1706Debug.Assert(_defaultParaProps.TextMarkerProperties == null, "FormattedText was assumed to always have no TextMarkerProperties. This assumption has changed and thus the calculation of Width and Overhangs should be revised.");
System\Windows\Media\Generated\BitmapCache.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\BitmapCacheBrush.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 148Debug.Assert(element != null); 151Debug.Assert(target._DispatcherLayoutResult != null); 152Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 154Debug.Assert(abortStatus); 172Debug.Assert(!channel.IsOutOfBandChannel); 173Debug.Assert(!targetResource.GetHandle(channel).IsNull); 307Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 398Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Brush.cs (6)
114Debug.Assert(!channel.IsOutOfBandChannel); 115Debug.Assert(!targetResource.GetHandle(channel).IsNull); 162Debug.Assert(!channel.IsOutOfBandChannel); 163Debug.Assert(!targetResource.GetHandle(channel).IsNull); 438Debug.Assert(s_Transform == null || s_Transform.IsFrozen, 442Debug.Assert(s_RelativeTransform == null || s_RelativeTransform.IsFrozen,
System\Windows\Media\Generated\CombinedGeometry.cs (8)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 159Debug.Assert(!channel.IsOutOfBandChannel); 160Debug.Assert(!targetResource.GetHandle(channel).IsNull); 252Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 320Debug.Assert(_duceResource.IsOnChannel(channel)); 441Debug.Assert(s_Geometry1 == null || s_Geometry1.IsFrozen, 445Debug.Assert(s_Geometry2 == null || s_Geometry2.IsFrozen,
System\Windows\Media\Generated\DashStyle.cs (3)
152Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 222Debug.Assert(_duceResource.IsOnChannel(channel)); 336Debug.Assert(s_Dashes == null || s_Dashes.IsFrozen,
System\Windows\Media\Generated\DoubleCollection.cs (2)
772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingBrush.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 273Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\DrawingContextWalker.cs (24)
39Debug.Assert(false); 59Debug.Assert(false); 81Debug.Assert(false); 105Debug.Assert(false); 137Debug.Assert(false); 175Debug.Assert(false); 209Debug.Assert(false); 249Debug.Assert(false); 271Debug.Assert(false); 289Debug.Assert(false); 309Debug.Assert(false); 324Debug.Assert(false); 351Debug.Assert(false); 369Debug.Assert(false); 381Debug.Assert(false); 393Debug.Assert(false); 407Debug.Assert(false); 423Debug.Assert(false); 435Debug.Assert(false); 447Debug.Assert(false); 458Debug.Assert(false); 475Debug.Assert(false); 490Debug.Assert(false); 499Debug.Assert(false);
System\Windows\Media\Generated\DrawingGroup.cs (19)
124Debug.Assert(!channel.IsOutOfBandChannel); 125Debug.Assert(!targetResource.GetHandle(channel).IsNull); 137Debug.Assert(resource != null); 148Debug.Assert(resource != null); 195Debug.Assert(!channel.IsOutOfBandChannel); 196Debug.Assert(!targetResource.GetHandle(channel).IsNull); 250Debug.Assert(!channel.IsOutOfBandChannel); 251Debug.Assert(!targetResource.GetHandle(channel).IsNull); 298Debug.Assert(!channel.IsOutOfBandChannel); 299Debug.Assert(!targetResource.GetHandle(channel).IsNull); 346Debug.Assert(!channel.IsOutOfBandChannel); 347Debug.Assert(!targetResource.GetHandle(channel).IsNull); 557Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 669Debug.Assert(_duceResource.IsOnChannel(channel)); 725Debug.Assert(!channel.IsOutOfBandChannel); 726Debug.Assert(!thisResource.GetHandle(channel).IsNull); 750Debug.Assert(!channel.IsOutOfBandChannel); 751Debug.Assert(!thisResource.GetHandle(channel).IsNull); 858Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\DrawingImage.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\EllipseGeometry.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeneralTransformCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeneralTransformGroup.cs (1)
188Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\Geometry.cs (3)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 355Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Generated\GeometryCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GeometryDrawing.cs (8)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 152Debug.Assert(!channel.IsOutOfBandChannel); 153Debug.Assert(!targetResource.GetHandle(channel).IsNull); 200Debug.Assert(!channel.IsOutOfBandChannel); 201Debug.Assert(!targetResource.GetHandle(channel).IsNull); 293Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 350Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeometryGroup.cs (11)
131Debug.Assert(!channel.IsOutOfBandChannel); 132Debug.Assert(!targetResource.GetHandle(channel).IsNull); 144Debug.Assert(resource != null); 155Debug.Assert(resource != null); 232Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 319Debug.Assert(_duceResource.IsOnChannel(channel)); 369Debug.Assert(!channel.IsOutOfBandChannel); 370Debug.Assert(!thisResource.GetHandle(channel).IsNull); 394Debug.Assert(!channel.IsOutOfBandChannel); 395Debug.Assert(!thisResource.GetHandle(channel).IsNull); 488Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\GlyphRunDrawing.cs (6)
85Debug.Assert(!channel.IsOutOfBandChannel); 86Debug.Assert(!targetResource.GetHandle(channel).IsNull); 133Debug.Assert(!channel.IsOutOfBandChannel); 134Debug.Assert(!targetResource.GetHandle(channel).IsNull); 211Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 263Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GradientBrush.cs (1)
285Debug.Assert(s_GradientStops == null || s_GradientStops.IsFrozen,
System\Windows\Media\Generated\GradientStopCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 857Debug.Assert(list != null, "list may not be null."); 956Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\GuidelineSet.cs (4)
178Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 255Debug.Assert(_duceResource.IsOnChannel(channel)); 361Debug.Assert(s_GuidelinesX == null || s_GuidelinesX.IsFrozen, 365Debug.Assert(s_GuidelinesY == null || s_GuidelinesY.IsFrozen,
System\Windows\Media\Generated\ImageBrush.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 167Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 273Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageDrawing.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 189Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 244Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Int32Collection.cs (2)
772Debug.Assert(list != null, "list may not be null."); 871Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\LinearGradientBrush.cs (1)
172Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LineGeometry.cs (2)
148Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\MatrixTransform.cs (2)
126Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 173Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\PathFigure.cs (1)
263Debug.Assert(s_Segments == null || s_Segments.IsFrozen,
System\Windows\Media\Generated\PathFigureCollection.cs (3)
96Debug.Assert(_collection.Count == 0); 844Debug.Assert(list != null, "list may not be null."); 943Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PathGeometry.cs (2)
176Debug.Assert(_duceResource.IsOnChannel(channel)); 286Debug.Assert(s_Figures == null || s_Figures.IsFrozen,
System\Windows\Media\Generated\PathSegmentCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\Pen.cs (7)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 194Debug.Assert(!channel.IsOutOfBandChannel); 195Debug.Assert(!targetResource.GetHandle(channel).IsNull); 362Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 429Debug.Assert(_duceResource.IsOnChannel(channel)); 562Debug.Assert(s_DashStyle == null || s_DashStyle.IsFrozen,
System\Windows\Media\Generated\PointCollection.cs (2)
774Debug.Assert(list != null, "list may not be null."); 873Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\PolyBezierSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyLineSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\PolyQuadraticBezierSegment.cs (1)
201Debug.Assert(s_Points == null || s_Points.IsFrozen,
System\Windows\Media\Generated\RadialGradientBrush.cs (1)
216Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RectangleGeometry.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 247Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RenderData.cs (14)
513Debug.Assert(_duceResource.IsOnChannel(channel)); 525Debug.Assert(cbExtraData <= (uint)Int32.MaxValue); 537Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 541Debug.Assert((_buffer != null) || (_curOffset == 0)); 544Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1086Debug.Assert(false); 1106Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 1110Debug.Assert((_buffer != null) || (_curOffset == 0)); 1113Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1426Debug.Assert(false); 1446Debug.Assert((_curOffset > 0) || (_dependentResources.Count == 0)); 1450Debug.Assert((_buffer != null) || (_curOffset == 0)); 1453Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1778Debug.Assert(false);
System\Windows\Media\Generated\RenderDataDrawingContext.cs (25)
64Debug.Assert(sizeof(MILCMD_DRAW_LINE) == 40); 125Debug.Assert(sizeof(MILCMD_DRAW_LINE_ANIMATE) == 48); 180Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE) == 40); 242Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE_ANIMATE) == 48); 309Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE) == 56); 393Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE_ANIMATE) == 72); 462Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE) == 40); 548Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE_ANIMATE) == 56); 603Debug.Assert(sizeof(MILCMD_DRAW_GEOMETRY) == 16); 654Debug.Assert(sizeof(MILCMD_DRAW_IMAGE) == 40); 711Debug.Assert(sizeof(MILCMD_DRAW_IMAGE_ANIMATE) == 40); 758Debug.Assert(sizeof(MILCMD_DRAW_GLYPH_RUN) == 8); 801Debug.Assert(sizeof(MILCMD_DRAW_DRAWING) == 8); 850Debug.Assert(sizeof(MILCMD_DRAW_VIDEO) == 40); 905Debug.Assert(sizeof(MILCMD_DRAW_VIDEO_ANIMATE) == 40); 944Debug.Assert(sizeof(MILCMD_PUSH_CLIP) == 8); 984Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_MASK) == 24); 1026Debug.Assert(sizeof(MILCMD_PUSH_OPACITY) == 8); 1074Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_ANIMATE) == 16); 1113Debug.Assert(sizeof(MILCMD_PUSH_TRANSFORM) == 8); 1194Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_SET) == 8); 1233Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y1) == 8); 1279Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y2) == 16); 1323Debug.Assert(sizeof(MILCMD_PUSH_EFFECT) == 8); 1367Debug.Assert(sizeof(MILCMD_POP) == 1);
System\Windows\Media\Generated\RotateTransform.cs (2)
170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 229Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ScaleTransform.cs (2)
192Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 257Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SkewTransform.cs (2)
192Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 257Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SolidColorBrush.cs (2)
126Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 212Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\TextEffectCollection.cs (3)
95Debug.Assert(_collection.Count == 0); 754Debug.Assert(list != null, "list may not be null."); 853Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformCollection.cs (2)
789Debug.Assert(list != null, "list may not be null."); 888Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\TransformGroup.cs (11)
124Debug.Assert(!channel.IsOutOfBandChannel); 125Debug.Assert(!targetResource.GetHandle(channel).IsNull); 137Debug.Assert(resource != null); 148Debug.Assert(resource != null); 210Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 280Debug.Assert(_duceResource.IsOnChannel(channel)); 329Debug.Assert(!channel.IsOutOfBandChannel); 330Debug.Assert(!thisResource.GetHandle(channel).IsNull); 354Debug.Assert(!channel.IsOutOfBandChannel); 355Debug.Assert(!thisResource.GetHandle(channel).IsNull); 443Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media\Generated\TranslateTransform.cs (2)
148Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 201Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VectorCollection.cs (2)
774Debug.Assert(list != null, "list may not be null."); 873Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media\Generated\VideoDrawing.cs (4)
85Debug.Assert(!channel.IsOutOfBandChannel); 86Debug.Assert(!targetResource.GetHandle(channel).IsNull); 170Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 225Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VisualBrush.cs (8)
86Debug.Assert(element != null); 89Debug.Assert(target._DispatcherLayoutResult != null); 90Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 92Debug.Assert(abortStatus); 110Debug.Assert(!channel.IsOutOfBandChannel); 111Debug.Assert(!targetResource.GetHandle(channel).IsNull); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 304Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Geometry.cs (5)
180Debug.Assert(pWorldMatrix != null); 286Debug.Assert(pbPathData != (byte*)0); 404Debug.Assert(pbPathData != (byte*)0); 603Debug.Assert(pbPathData != (byte*)0); 686Debug.Assert(pbPathData != (byte*)0);
System\Windows\Media\GeometryDrawing.cs (1)
55Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GeometryGroup.cs (1)
48Debug.Assert(pg.CanFreeze);
System\Windows\Media\GeometryHitTestParameters.cs (1)
90Debug.Assert(_hitGeometryInternal.Transform.Value == _hitGeometryCache.Transform.Value,
System\Windows\Media\GlyphRun.cs (6)
602Debug.Assert(clusterMap[currentClusterStart] < lastGlyphInCluster); 1306Debug.Assert(!IsSideways); 1565Debug.Assert(!IsSideways); 1846Debug.Assert(_glyphTypeface != null); 2348Debug.Assert(!IsInitializing); 2359Debug.Assert(!IsInitialized);
System\Windows\Media\GlyphRunDrawing.cs (1)
51Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GlyphsSerializer.cs (5)
89Debug.Assert(_clusters[characterIndex] > glyphClusterStart); 100Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 106Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 154Debug.Assert(_glyphStringBuider.Length == 0); 306Debug.Assert(caretStopStringLength == sb.ToString().Length);
System\Windows\Media\GlyphTypeface.cs (2)
1383Debug.Assert(charBufferRange.Length > 0); 1458Debug.Assert(glyphIndices != null || glyphMetrics != null);
System\Windows\Media\GuidelineCollection.cs (2)
48Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 57Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\HitTestWithGeometryDrawingContextWalker.cs (8)
29Debug.Assert(geometry != null); 329Debug.Assert(_modifierStack != null); 330Debug.Assert(_modifierStack.Count > 0); 340Debug.Assert((_modifierStack.Count > 0) || (_currentTransform == null)); 348Debug.Assert((_modifierStack.Count > 0) || (_currentClip == null)); 352Debug.Assert(currentModifier == null); 378Debug.Assert(_intersectionDetail != IntersectionDetail.FullyContains); 383Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (7)
333Debug.Assert(_pointStack != null); 334Debug.Assert(_pointStack.Count > 0); 370Debug.Assert(_noOpLayerDepth >= 1); 407Debug.Assert(!_currentLayerIsNoOp); 408Debug.Assert(_noOpLayerDepth == 0); 418Debug.Assert(_currentLayerIsNoOp); 419Debug.Assert(_noOpLayerDepth == 0);
System\Windows\Media\HostVisual.cs (10)
134Debug.Assert(target != null); 135Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 187Debug.Assert(_target != null); 188Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 210Debug.Assert(!targetsHandle.IsNull); 246Debug.Assert(IsOnChannel(channel)); 259Debug.Assert(_target._contentRoot.IsOnChannel(channel)); 260Debug.Assert(_target.OutOfBandChannel == MediaContext.CurrentMediaContext.OutOfBandChannel); 262Debug.Assert(!created); 322Debug.Assert(channelDispatcher == this.Dispatcher, "HostVisual connecting on a second thread");
System\Windows\Media\ImageSourceConverter.cs (1)
214Debug.Assert(rawData != null, "rawData is null.");
System\Windows\Media\Imaging\BitmapCodecInfo.cs (9)
34Debug.Assert(codecInfoHandle != null); 85Debug.Assert(length >= 0); 128Debug.Assert(length >= 0); 171Debug.Assert(length >= 0); 214Debug.Assert(length >= 0); 257Debug.Assert(length >= 0); 300Debug.Assert(length >= 0); 343Debug.Assert(length >= 0); 386Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
939Debug.Assert(_syncObject != null); 1021Debug.Assert((uri.Scheme == Uri.UriSchemeHttp) || (uri.Scheme == Uri.UriSchemeHttps)); 1022Debug.Assert(stream.CanSeek); 1174Debug.Assert(decoder != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
396Debug.Assert(false);
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
361Debug.Assert(_supportsGlobalThumbnail); 393Debug.Assert(_supportsGlobalMetadata);
System\Windows\Media\Imaging\BitmapFrame.cs (2)
49Debug.Assert((stream == null), "Both stream and uri are non-null"); 70Debug.Assert((stream != null), "Both stream and uri are null");
System\Windows\Media\Imaging\BitmapFrameDecode.cs (7)
35Debug.Assert(decoder != null); 125Debug.Assert(decoder != null); 427Debug.Assert(_decoder != null); 681Debug.Assert(_decoder is LateBoundBitmapDecoder); 682Debug.Assert(!IsDownloading); 687Debug.Assert(_decoder.InternalDecoder != null); 692Debug.Assert(_syncObject != null);
System\Windows\Media\Imaging\BitmapFrameEncode.cs (2)
33Debug.Assert(source != null); 162Debug.Assert(sourceBitmapFrameEncode._source != null);
System\Windows\Media\Imaging\BitmapImage.cs (5)
222Debug.Assert(_decoder != null); 368Debug.Assert(decoder.SyncObject != null); 374Debug.Assert(!_decoder.IsDownloading); 443Debug.Assert(oldWidth > 0 && oldHeight > 0); 470Debug.Assert(false);
System\Windows\Media\Imaging\BitmapMetadata.cs (4)
483Debug.Assert(blockWriter != null); 484Debug.Assert(blockWriter.MetadataBlocks != null); 911Debug.Assert(length >= 0); 953Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (1)
162Debug.Assert(metadataHandle != null && !metadataHandle.IsInvalid);
System\Windows\Media\Imaging\BitmapPalette.cs (7)
148Debug.Assert(source != null); 151Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid); 185Debug.Assert(palette != null); 253Debug.Assert(palette != null && !palette.IsInvalid); 266Debug.Assert(_palette != null && !_palette.IsInvalid); 295Debug.Assert(_palette != null && !_palette.IsInvalid); 321Debug.Assert(cActualColors == numColors);
System\Windows\Media\Imaging\BitmapPalettes.cs (1)
286Debug.Assert(key < c_maxPalettes);
System\Windows\Media\Imaging\BitmapSizeOptions.cs (4)
200Debug.Assert(_preservesAspectRatio); 207Debug.Assert(_preservesAspectRatio); 214Debug.Assert(!_preservesAspectRatio); 255Debug.Assert(false);
System\Windows\Media\Imaging\BitmapSource.cs (5)
546Debug.Assert(_syncObject != null); 753Debug.Assert(_isSourceCached); 932Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 964Debug.Assert(_duceResource.IsOnChannel(channel)); 1150Debug.Assert(destFmt == colorConvertedBitmap.Format);
System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
86Debug.Assert(wicBitmap != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapVisualManager.cs (3)
77Debug.Assert ((sizeX > 0) && (sizeY > 0)); 78Debug.Assert ((dpiX > 0) && (dpiY > 0)); 93Debug.Assert (renderTargetBitmap != null, "Render Target is null");
System\Windows\Media\Imaging\Generated\ColorConvertedBitmap.cs (1)
359Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\CroppedBitmap.cs (1)
301Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\FormatConvertedBitmap.cs (1)
359Debug.Assert(s_Source == null || s_Source.IsFrozen,
System\Windows\Media\Imaging\Generated\TransformedBitmap.cs (2)
320Debug.Assert(s_Source == null || s_Source.IsFrozen, 324Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media\Imaging\InteropBitmapSource.cs (4)
46Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 77Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 124Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 370Debug.Assert(_sizeOptions.Rotation == Rotation.Rotate0);
System\Windows\Media\Imaging\LateBoundBitmapDecoder.cs (1)
295Debug.Assert(newStream.CanSeek);
System\Windows\Media\Imaging\RenderTargetBitmap.cs (2)
244Debug.Assert(renderTargetBitmap != null && !renderTargetBitmap.IsInvalid); 250Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid);
System\Windows\Media\Imaging\TransformedBitmap.cs (1)
133Debug.Assert(DoubleUtil.IsZero(m.M11) && DoubleUtil.IsZero(m.M22));
System\Windows\Media\Imaging\WriteableBitmap.cs (12)
210Debug.Assert(locked); 577Debug.Assert(_pBackBufferLock == null); 624Debug.Assert(!_isWaitingForCommit); 799Debug.Assert(!(backwardsCompat && (sourceRect.X < 0 || sourceRect.Y < 0 || sourceRect.Width < 0 || sourceRect.Height < 0))); 836Debug.Assert(!(backwardsCompat && sourceBufferStride < 1)); 841Debug.Assert(!backwardsCompat); 1163Debug.Assert(_duceResource.IsOnChannel(channel)); 1206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 1269Debug.Assert(_isWaitingForCommit); // How else are we here? 1272Debug.Assert(_lockCount == 0); // How else are we here? 1273Debug.Assert(_hasDirtyRects); // How else are we here? 1283Debug.Assert(_duceResource.IsOnChannel(channel)); // How else are we here?
System\Windows\Media\LinearGradientBrush.cs (1)
121Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\MatrixStack.cs (4)
158Debug.Assert(!IsEmpty); 170Debug.Assert(!IsEmpty); 186Debug.Assert(_size == 0); // The stack must be empty before this is called. 187Debug.Assert(_highWaterMark <= _items.Length);
System\Windows\Media\MediaContext.cs (34)
188Debug.Assert(dispatcher.Reserved0 == null); 344Debug.Assert(CheckAccess()); 603Debug.Assert(InterlockIsEnabled, 700Debug.Assert(_interlockState == InterlockState.WaitingForResponse, 777Debug.Assert(!InterlockIsWaiting, 842Debug.Assert(InterlockIsWaiting, 1077Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported"); 1336Debug.Assert(_interlockState == InterlockState.Disabled, 1345Debug.Assert(Channel != null); 1366Debug.Assert(dispatcher != null, "Dispatcher required"); 1371Debug.Assert(dispatcher.Reserved0 == cm); 1394Debug.Assert(CheckAccess()); 1403Debug.Assert(CheckAccess()); 1434Debug.Assert(_timeManager != null); 1463Debug.Assert(dispatcher != null); 1464Debug.Assert(iv != null); 1476Debug.Assert(!_isDisposed); 1477Debug.Assert(iv != null); 1504Debug.Assert(dispatcher != null); 1505Debug.Assert(iv != null); 1516Debug.Assert(iv != null); 1566Debug.Assert(callback != null); 1571Debug.Assert(arg != null); 1610Debug.Assert(op != null); 1648Debug.Assert(CheckAccess()); 1769Debug.Assert(CheckAccess()); 1770Debug.Assert( 2008Debug.Assert(CheckAccess()); 2010Debug.Assert(!_isDisposed); 2011Debug.Assert(_registeredICompositionTargets != null); 2114Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel"); 2118Debug.Assert(!InterlockIsWaiting, 2184Debug.Assert(InterlockIsEnabled, 2508Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\MediaContextNotificationWindow.cs (1)
132Debug.Assert(_ownerMediaContext != null);
System\Windows\Media\mediaeventshelper.cs (3)
84Debug.Assert((sender != null), "Sender is null"); 85Debug.Assert((sender.Dispatcher != null), "Dispatcher is null"); 251Debug.Assert((cb == size), "Invalid event packet");
System\Windows\Media\MediaPlayer.cs (1)
553Debug.Assert(_duceResource._duceResource.IsOnChannel(channel));
System\Windows\Media\MediaPlayerState.cs (2)
876Debug.Assert(absoluteUri.IsAbsoluteUri); 976Debug.Assert(_nativeMedia != null && !_nativeMedia.IsInvalid);
System\Windows\Media\MediaSystem.cs (2)
126Debug.Assert(s_refCount > 0); 271Debug.Assert(reference != null, "The reference object can not be null.");
System\Windows\Media\MILUtilities.cs (10)
83Debug.Assert(pD3DMatrix[2] == 0.0f || Single.IsNaN(pD3DMatrix[2])); 84Debug.Assert(pD3DMatrix[3] == 0.0f || Single.IsNaN(pD3DMatrix[3])); 92Debug.Assert(pD3DMatrix[6] == 0.0f || Single.IsNaN(pD3DMatrix[6])); 93Debug.Assert(pD3DMatrix[7] == 0.0f || Single.IsNaN(pD3DMatrix[7])); 99Debug.Assert(pD3DMatrix[8] == 0.0f || Single.IsNaN(pD3DMatrix[8])); 100Debug.Assert(pD3DMatrix[9] == 0.0f || Single.IsNaN(pD3DMatrix[9])); 101Debug.Assert(pD3DMatrix[10] == 1.0f || Single.IsNaN(pD3DMatrix[10])); 102Debug.Assert(pD3DMatrix[11] == 0.0f || Single.IsNaN(pD3DMatrix[11])); 110Debug.Assert(pD3DMatrix[14] == 0.0f || Single.IsNaN(pD3DMatrix[14])); 111Debug.Assert(pD3DMatrix[15] == 1.0f || Single.IsNaN(pD3DMatrix[15]));
System\Windows\Media\PathGeometry.cs (30)
113Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 134Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 154Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 155Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT)); 164Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 165Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 179Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 180Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 196Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 197Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 212Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 213Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 233Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 234Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 238Debug.Assert(pSegmentPoly->Count <= Int32.MaxValue); 245Debug.Assert(pathData.SerializedData.Length >= 249Debug.Assert(pathData.Size >= 343Debug.Assert(result != null); 362Debug.Assert(figureCollection != null); 479Debug.Assert(sameSegCount == 1); 510Debug.Assert(sameSegCount == 1); 569Debug.Assert(pbPathData != (byte*)0); 613Debug.Assert(pPathData1 != (byte*)0); 617Debug.Assert(pPathData2 != (byte*)0); 750Debug.Assert(!pathData.IsEmpty()); 766Debug.Assert(pbPathData != (byte*)0); 822Debug.Assert(pbPathData1 != (byte*)0); 826Debug.Assert(pbPathData2 != (byte*)0); 855Debug.Assert(detail != IntersectionDetail.NotCalculated); 977Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\PathStreamGeometryContext.cs (21)
65Debug.Assert(_figures == null, "It is illegal to call SetFigureCount multiple times or after BeginFigure."); 66Debug.Assert(figureCount > 0); 74Debug.Assert(_figures != null, "It is illegal to call SetSegmentCount before BeginFigure."); 75Debug.Assert(_currentFigure != null, "It is illegal to call SetSegmentCount before BeginFigure."); 76Debug.Assert(_segments == null, "It is illegal to call SetSegmentCount multiple times per BeginFigure or after a *To method."); 77Debug.Assert(segmentCount > 0); 88Debug.Assert(_currentFigure != null); 103Debug.Assert(_currentFigure == null || _figures != null); 230Debug.Assert(_figures != null); 231Debug.Assert(_currentFigure != null); 288Debug.Assert(false); 300Debug.Assert(_currentSegmentPoints == null); 310Debug.Assert(points != null); 327Debug.Assert(_figures != null); 328Debug.Assert(_currentFigure != null); 330Debug.Assert(count != 0); 356Debug.Assert(_currentFigure != null); 360Debug.Assert(count > 0); 407Debug.Assert(count % 3 == 0); 428Debug.Assert(count % 2 == 0); 439Debug.Assert(false);
System\Windows\Media\Pen.cs (7)
83Debug.Assert((MIL_PEN_CAP)PenLineCap.Flat == MIL_PEN_CAP.MilPenCapFlat); 84Debug.Assert((MIL_PEN_CAP)PenLineCap.Square == MIL_PEN_CAP.MilPenCapSquare); 85Debug.Assert((MIL_PEN_CAP)PenLineCap.Round == MIL_PEN_CAP.MilPenCapRound); 86Debug.Assert((MIL_PEN_CAP)PenLineCap.Triangle == MIL_PEN_CAP.MilPenCapTriangle); 93Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Miter == MIL_PEN_JOIN.MilPenJoinMiter); 94Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Bevel == MIL_PEN_JOIN.MilPenJoinBevel); 95Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Round == MIL_PEN_JOIN.MilPenJoinRound);
System\Windows\Media\PixelFormat.cs (7)
53Debug.Assert(mask != null); 150Debug.Assert(Unsafe.SizeOf<Guid>() == 16); 337Debug.Assert(pixelFormatInfo != IntPtr.Zero); 348Debug.Assert(channelCount >= 1); 359Debug.Assert(cbBytes > 0); 368Debug.Assert(cbBytes == channelMask.Length); 436Debug.Assert(pixelFormatInfo != IntPtr.Zero);
System\Windows\Media\RadialGradientBrush.cs (1)
62Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\RenderCapability.cs (3)
35Debug.Assert(mediaContext != null); 162Debug.Assert(mediaContext != null); 173Debug.Assert(mediaContext != null);
System\Windows\Media\RenderContext.cs (1)
81Debug.Assert(channel != null);
System\Windows\Media\RenderData.cs (17)
75Debug.Assert(cbRecordSize >= 0); 78Debug.Assert((_curOffset % 8) == 0); 79Debug.Assert((cbRecordSize % 8) == 0); 80Debug.Assert((sizeof(RecordHeader) % 8) == 0); 98Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 101Debug.Assert(_buffer.Length > 0); 126Debug.Assert(ctx != null); 228Debug.Assert(!this.IsFrozen); 268Debug.Assert(_dependentResources[i] as Freezable == null); 357Debug.Assert(_duceResource.IsOnChannel(channel)); 384Debug.Assert(_duceResource.IsOnChannel(channel)); 436Debug.Assert(_duceResource.IsOnChannel(channel)); 451Debug.Assert(cbRequiredSize >= 0); 461Debug.Assert(_buffer.Length < cbRequiredSize); 471Debug.Assert(newSize >= cbRequiredSize); 497Debug.Assert(index <= (uint)Int32.MaxValue); 504Debug.Assert(_dependentResources.Count >= index);
System\Windows\Media\StreamAsIStream.cs (2)
53Debug.Assert(((IntPtr)pSD.m_handle) != IntPtr.Zero, "If this asserts fires: why is it firing. It might be legal in future."); 509Debug.Assert(((IntPtr)sd.m_handle) != IntPtr.Zero, "Stream is disposed.");
System\Windows\Media\StreamGeometry.cs (5)
91Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 115Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 135Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 373Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 441Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\textformatting\TextCharacters.cs (3)
191Debug.Assert(characterBufferReference.CharacterBuffer == _characterBufferReference.CharacterBuffer); 192Debug.Assert(offsetToFirstChar >= 0 && offsetToFirstChar < _length); 282Debug.Assert(shapeables != null);
System\Windows\Media\Typeface.cs (1)
512Debug.Assert(i > 0);
System\Windows\Media\UniqueEventHelper.cs (4)
38Debug.Assert(sender != null, "Sender is null"); 41Debug.Assert(handler != null, "Event handler is null"); 69Debug.Assert(sender != null, "Sender is null"); 72Debug.Assert(handler != null, "Event handler is null");
System\Windows\Media\VideoDrawing.cs (1)
40Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\Visual.cs (30)
156Debug.Fail("TYPE_VISUAL or TYPE_VIEWPORT3DVISUAL expected."); 560Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 638Debug.Assert(IsOnChannel(channel)); 639Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 840Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 866Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 891Debug.Assert(cyclicBrushToChannelsMap != null); 892Debug.Assert(cyclicBrushToChannelsMap.ContainsKey(cyclicBrush)); 893Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 913Debug.Assert(channelsToCyclicBrushMap != null); 914Debug.Assert(channelsToCyclicBrushMap.ContainsKey(channel)); 915Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 1290Debug.Assert(CheckFlagsAnd(VisualFlags.ReentrancyFlag)); // Exit must be matched with Enter. See Enter comments. 1943Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint), 1974Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix), 2069Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 2200Debug.Assert(bitmapEffectState != null); 2239Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2297Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2361Debug.Assert(resultCallback != null); 2422Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3033Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value."); 3195Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen); 3264Debug.Assert(bitmapEffectState != null); 3278Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node"); 3953Debug.Assert(_parent != null, "If oldParent is null, current parent should != null."); 4465Debug.Assert(ancestor != null); 4582Debug.Assert((group == null) || (group.Children.Count > 0)); 4657Debug.Assert(ancestor != null); 5216Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
System\Windows\Media\VisualBrush.cs (10)
178Debug.Assert(!_pendingLayout); 221Debug.Assert(element != null); 243Debug.Assert(_pendingLayout); 247Debug.Assert(element != null); 258Debug.Assert(_DispatcherLayoutResult != null); 259Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 261Debug.Assert(abortStatus); 273Debug.Assert(_pendingLayout); 276Debug.Assert(element != null); 314Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\VisualCollection.cs (19)
70Debug.Assert(_owner != null); 76Debug.Assert(_owner != null); 82Debug.Assert(_owner != null); 89Debug.Assert(_owner != null); 253Debug.Assert(_items != null); 260Debug.Assert(value == 0, "There shouldn't be a case where value != 0."); 261Debug.Assert(_size == 0, "Size must be 0 here."); 378Debug.Assert(value != null); 379Debug.Assert(_items[index] == null); 380Debug.Assert(value._parent == null); 381Debug.Assert(!value.IsRootElement); 396Debug.Assert(_items[index] != null); 452Debug.Assert(_items[addedPosition] == null); 531Debug.Assert(visual._parent != null); 643Debug.Assert(_items[i]._parent == _owner); 805Debug.Assert(visual._parent != null); 806Debug.Assert(destination == null || destination._parent == visual._parent); 807Debug.Assert(newIndex >= 0 && newIndex <= _size, "New index is invalid"); 952Debug.Assert(_index == -2);
System\Windows\Media\VisualProxy.cs (7)
151Debug.Assert(count == 0); 173Debug.Assert(count == 1); 289Debug.Assert(index != PROXY_NOT_FOUND); 344Debug.Assert(index >= 0 && index < Count); 387Debug.Assert(index >= 0 && index < Count); 466Debug.Assert(index >= 0 && index < Count); 567Debug.Assert(delta % 2 == 0 && newLength >= 2);
System\Windows\Media\VisualTarget.cs (5)
45Debug.Assert(!_connected); 70Debug.Assert(channel != null); 71Debug.Assert(outOfBandChannel != null); 93Debug.Assert(!resourceCreated); 183Debug.Assert(_connected);
System\Windows\Media\VisualTreeHelper.cs (1)
159Debug.Assert(reference == null);
System\Windows\Media3D\GeneralTransform2DTo3D.cs (1)
23Debug.Assert(child != null, "Going from 2D to 3D containingVisual3D.Visual should not be null");
System\Windows\Media3D\Generated\AmbientLight.cs (2)
105Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 170Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\AxisAngleRotation3D.cs (2)
150Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 203Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Camera.cs (3)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 338Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\DiffuseMaterial.cs (5)
116Debug.Assert(!channel.IsOutOfBandChannel); 117Debug.Assert(!targetResource.GetHandle(channel).IsNull); 209Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 258Debug.Assert(_duceResource.IsOnChannel(channel)); 373Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\DirectionalLight.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 195Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\EmissiveMaterial.cs (5)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 187Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 235Debug.Assert(_duceResource.IsOnChannel(channel)); 345Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\GeneralTransform3DCollection.cs (3)
93Debug.Assert(_collection.Count == 0); 752Debug.Assert(list != null, "list may not be null."); 851Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\GeneralTransform3DGroup.cs (1)
186Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\GeometryModel3D.cs (8)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 152Debug.Assert(!channel.IsOutOfBandChannel); 153Debug.Assert(!targetResource.GetHandle(channel).IsNull); 202Debug.Assert(!channel.IsOutOfBandChannel); 203Debug.Assert(!targetResource.GetHandle(channel).IsNull); 295Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 367Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MaterialCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\MaterialGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 278Debug.Assert(_duceResource.IsOnChannel(channel)); 327Debug.Assert(!channel.IsOutOfBandChannel); 328Debug.Assert(!thisResource.GetHandle(channel).IsNull); 352Debug.Assert(!channel.IsOutOfBandChannel); 353Debug.Assert(!thisResource.GetHandle(channel).IsNull); 441Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\MatrixCamera.cs (2)
146Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 205Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MatrixTransform3D.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 164Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MeshGeometry3D.cs (6)
206Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 308Debug.Assert(_duceResource.IsOnChannel(channel)); 430Debug.Assert(s_Positions == null || s_Positions.IsFrozen, 434Debug.Assert(s_Normals == null || s_Normals.IsFrozen, 438Debug.Assert(s_TextureCoordinates == null || s_TextureCoordinates.IsFrozen, 442Debug.Assert(s_TriangleIndices == null || s_TriangleIndices.IsFrozen,
System\Windows\Media3D\Generated\Model3D.cs (3)
102Debug.Assert(!channel.IsOutOfBandChannel); 103Debug.Assert(!targetResource.GetHandle(channel).IsNull); 338Debug.Assert(s_Transform == null || s_Transform.IsFrozen,
System\Windows\Media3D\Generated\Model3DCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Model3DGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 294Debug.Assert(_duceResource.IsOnChannel(channel)); 344Debug.Assert(!channel.IsOutOfBandChannel); 345Debug.Assert(!thisResource.GetHandle(channel).IsNull); 369Debug.Assert(!channel.IsOutOfBandChannel); 370Debug.Assert(!thisResource.GetHandle(channel).IsNull); 458Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\OrthographicCamera.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PerspectiveCamera.cs (2)
124Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 219Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Point3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 872Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\PointLight.cs (2)
105Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 200Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\QuaternionRotation3D.cs (2)
127Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 174Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\RotateTransform3D.cs (5)
131Debug.Assert(!channel.IsOutOfBandChannel); 132Debug.Assert(!targetResource.GetHandle(channel).IsNull); 243Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 310Debug.Assert(_duceResource.IsOnChannel(channel)); 420Debug.Assert(s_Rotation == null || s_Rotation.IsFrozen,
System\Windows\Media3D\Generated\ScaleTransform3D.cs (2)
252Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 329Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpecularMaterial.cs (5)
109Debug.Assert(!channel.IsOutOfBandChannel); 110Debug.Assert(!targetResource.GetHandle(channel).IsNull); 209Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 258Debug.Assert(_duceResource.IsOnChannel(channel)); 373Debug.Assert(s_Brush == null || s_Brush.IsFrozen,
System\Windows\Media3D\Generated\SpotLight.cs (2)
168Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 281Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Transform3DCollection.cs (2)
787Debug.Assert(list != null, "list may not be null."); 886Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Generated\Transform3DGroup.cs (11)
122Debug.Assert(!channel.IsOutOfBandChannel); 123Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(resource != null); 146Debug.Assert(resource != null); 208Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 278Debug.Assert(_duceResource.IsOnChannel(channel)); 327Debug.Assert(!channel.IsOutOfBandChannel); 328Debug.Assert(!thisResource.GetHandle(channel).IsNull); 352Debug.Assert(!channel.IsOutOfBandChannel); 353Debug.Assert(!thisResource.GetHandle(channel).IsNull); 441Debug.Assert(s_Children == null || s_Children.IsFrozen,
System\Windows\Media3D\Generated\TranslateTransform3D.cs (2)
177Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 236Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Vector3DCollection.cs (2)
773Debug.Assert(list != null, "list may not be null."); 872Debug.Assert(_index == -2, "expected -2, got " + _index + "\n");
System\Windows\Media3D\Geometry3D.cs (1)
77Debug.Assert(facesToHit != FaceType.None,
System\Windows\Media3D\HitTestParameters3D.cs (4)
60Debug.Assert(!HasModelTransformMatrix, 109Debug.Assert(HasWorldTransformMatrix, 142Debug.Assert(HasModelTransformMatrix, 182Debug.Assert(HasHitTestProjectionMatrix,
System\Windows\Media3D\Matrix3D.cs (11)
1030Debug.Assert(IsDistinguishedIdentity); 1042Debug.Assert(IsDistinguishedIdentity); 1058Debug.Assert(IsDistinguishedIdentity); 1184Debug.Assert(!IsDistinguishedIdentity); 1185Debug.Assert(IsAffine); 1201Debug.Assert(!IsDistinguishedIdentity); 1202Debug.Assert(IsAffine); 1213Debug.Assert(!(det < Determinant || det > Determinant), 1300Debug.Assert(!(det < Determinant || det > Determinant), 1395Debug.Assert( 1413Debug.Assert(IsDistinguishedIdentity == value,
System\Windows\Media3D\MeshGeometry3D.cs (7)
165Debug.Assert(hitTestableFaces != FaceType.None, 407Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 412Debug.Assert(dist > 0, "Distance is negative: " + dist); 493Debug.Assert(!double.IsInfinity(pz / pw) && !double.IsNaN(pz / pw), 529Debug.Assert(_cachedBounds.IsEmpty, 574Debug.Fail("Cached bounds are invalid. Caller needs to check for IsEmpty and call UpdateCachedBounds."); 578Debug.Fail("Cached bounds are invalid. We missed a call to SetCachedBoundsDirty.");
System\Windows\Media3D\Quaternion.cs (1)
518Debug.Assert(!(cosOmega < -1.0) && !(cosOmega > 1.0),
System\Windows\Media3D\Rect3D.cs (1)
41Debug.Assert(size.IsEmpty == IsEmpty);
System\Windows\Media3D\Viewport2DVisual3D.cs (9)
327Debug.Assert((newValue == null || newValue.InheritanceContext == null), 336Debug.Assert((newValue == null || newValue.InheritanceContext == null), 343Debug.Assert((newValue == null || newValue.InheritanceContext == null), 577Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 605Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 633Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 759Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 768Debug.Assert( (viewport2DVisual3D.InternalBitmapCacheBrush.InternalTarget == null 788Debug.Assert((viewport2DVisual3D.Visual == null || viewport2DVisual3D.Visual.InheritanceContext == null),
System\Windows\Media3D\Viewport3DVisual.cs (11)
250Debug.Assert(!e.IsASubPropertyChange, 328Debug.Assert(child != null); 329Debug.Assert(child.InternalVisualParent == null); 376Debug.Assert(child != null); 377Debug.Assert(child.InternalVisualParent == this); 625Debug.Fail("Cached bbox subgraph is incorrect!"); 636Debug.Assert( 656Debug.Assert( 710Debug.Assert(IsOnChannel(channel)); 758Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected), 799Debug.Assert(IsOnChannel(channel));
System\Windows\Media3D\Visual3D.cs (23)
236Debug.Assert(child != null); 237Debug.Assert(child.InternalVisualParent == null); 284Debug.Assert(child != null); 285Debug.Assert(child.InternalVisualParent == this); 457Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null."); 949Debug.Assert(InternalVisualParent == newParent); 957Debug.Assert(InternalVisualParent == newParent); 1057Debug.Assert(boundsAreEqual, errorString); 1079Debug.Assert(model != null); 1211Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0, 1259Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 1260Debug.Assert(IsOnChannel(channel)); 1451Debug.Assert(IsOnChannel(channel)); 1452Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 1582Debug.Assert(child.InheritanceContext == this, 1649Debug.Assert(ancestor != null); 1791Debug.Assert(ancestor != null); 1828Debug.Assert(_2DParent.GetValue(this) == null, 1836Debug.Assert(parent2D == null || parent2D is Viewport3DVisual, 2040Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender), 2042Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot), 2054Debug.Assert((viewport == null) == (e.InternalVisualParent == null), 2092Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
System\Windows\Media3D\Visual3DCollection.cs (7)
480Debug.Assert(InternalGetItem(i).ParentIndex == i - 1, 504Debug.Assert(InternalGetItem(i).ParentIndex == i + 1, 538Debug.Assert(_owner != null, "How did an Visual3DCollection get constructed without an owner?"); 546Debug.Assert(!duplicates.ContainsKey(visual), "How did the visual get re-inserted?"); 549Debug.Assert(visual.InternalVisualParent == _owner, "Why isn't our child's parent pointer the same as the collection owner?"); 550Debug.Assert(visual.ParentIndex == i, 600Debug.Assert(list != null, "list may not be null.");
System\Windows\Navigation\BaseUriHelper.cs (2)
162Debug.Assert(uri is not null && uri.IsAbsoluteUri && string.Equals(uri.Scheme, PackUriHelper.UriSchemePack, StringComparison.OrdinalIgnoreCase) && IsPackApplicationUri(uri)); 179Debug.Assert(string.Equals(partName, uri.GetComponents(UriComponents.Path, UriFormat.UriEscaped), StringComparison.OrdinalIgnoreCase));
System\Windows\Nrbf\SerializationRecordExtensions.cs (1)
25Debug.Fail(ex.Message);
System\Windows\PresentationSource.cs (1)
520Debug.Assert(uie is UIElement3D or UIElement);
System\Windows\QueryContinueDragEventArgs.cs (1)
33Debug.Fail("Invalid dragDropKeyStates");
System\Windows\ReverseInheritProperty.cs (1)
201Debug.Assert(originChangedAction != null);
System\Windows\UIElement.cs (9)
254Debug.Assert(MeasureRequest == null, "can't be clean and still have MeasureRequest"); 287Debug.Assert(ArrangeRequest == null, "can't be clean and still have MeasureRequest"); 1878Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 1914Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 3104Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3189Debug.Assert(_proxy.IsOnChannel(channel)); 3256Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 3257Debug.Assert(_proxy.IsOnChannel(channel)); 4131Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
System\Windows\UIElement3D.cs (1)
1327Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
PresentationFramework (2272)
MS\Internal\Annotations\Anchoring\AttachedAnnotation.cs (8)
63Debug.Assert(manager != null, "LocatorManager can not be null"); 64Debug.Assert(annotation != null, "Annotation can not be null"); 65Debug.Assert(anchor != null, "Anchor can not be null"); 66Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 233Debug.Assert(attachedAnchor != null, "AttachedAnchor can not be null"); 234Debug.Assert(attachmentLevel > AttachmentLevel.Unresolved && attachmentLevel <= AttachmentLevel.Incomplete, 249Debug.Assert(_selectionProcessor != null, SR.Format(SR.NoProcessorForSelectionType, attachedAnchor.GetType())); 259Debug.Assert(_attachmentLevel != AttachmentLevel.Full, "Should only set fully resolved anchor if attachment level is not full.");
MS\Internal\Annotations\Anchoring\DataIdProcessor.cs (2)
385Debug.Assert(node != null, "DependencyObject can not be null"); 406Debug.Assert(d != null, "DependencyObject can not be null");
MS\Internal\Annotations\Anchoring\FixedPageProcessor.cs (1)
318Debug.Assert(page >= 0, "page can not be negative");
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (3)
111Debug.Assert(numOfPages >= 0, "start page number is bigger than the end page number"); 289Debug.Assert(tv != null); 603Debug.Assert((start != null) && (end != null), "null start/end TextPointer on a non empty page");
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
307Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved."); 357Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 634Debug.Assert(startNode != null, "startNode can not be null"); 746Debug.Assert(node != null, "node can not be null"); 813Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 818Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor 840Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type"); 844Debug.Assert(processor != null, "SubtreeProcessor can not be null"); 879Debug.Assert(locator != null, "locator can not be null"); 880Debug.Assert(startNode != null, "startNode can not be null"); 916Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range"); 1089Debug.Assert(locator != null, "locator can not be null"); 1090Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Anchoring\PathNode.cs (5)
209Debug.Assert(node != null, "node can not be null"); 263Debug.Assert(node != null, "node can not be null"); 302Debug.Assert(path != null, "path can not be null"); 303Debug.Assert(branch != null, "branch can not be null"); 307Debug.Assert(path.Node.Equals(branch.Node), "path.Node is not equal to branch.Node");
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
384Debug.Assert(target != null); 454Debug.Assert(startNode != null);
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
222Debug.Assert(textView != null);
MS\Internal\Annotations\AnnotationMap.cs (1)
77Debug.Assert(list != null, $"there should be an attached annotation list for the annotationId: {annotationId}");
MS\Internal\Annotations\Component\AdornerPresentationContext.cs (1)
425Debug.Assert((adorners != null) && (adorner != null), "null adorners list or adorner");
MS\Internal\Annotations\Component\AnnotationComponentManager.cs (9)
52Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 69Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 136Debug.Assert(attachedAnnotation != null, "AttachedAnnotation should not be null"); 139Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 159Debug.Assert(annotatedElement != null, "the annotatedElement should inherit from UIElement"); 202Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 203Debug.Assert(previousAttachedAnchor != null, "previousAttachedAnchor should not be null"); 263Debug.Assert(attachedAnnotation != null, "attachedAnnotation should not be null"); 264Debug.Assert(component != null, "component should not be null");
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (21)
72Debug.Assert(start != null, "start pointer is null"); 73Debug.Assert(end != null, "end pointer is null"); 74Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start"); 110Debug.Assert(highlightRange != null, "null range data"); 340Debug.Assert(highlightRange != null, " null highlight range"); 342Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments"); 353Debug.Assert(highlightSegment != null, "null highlight segment"); 377Debug.Assert(rangeEnumerator.Current.IsNull || !next || 512Debug.Fail("Mismatched segment data"); 635Debug.Assert(start != null, "start pointer is null"); 636Debug.Assert(end != null, "end pointer is null"); 637Debug.Assert(owners != null, "null owners list"); 638Debug.Assert(owners.Count > 0, "empty owners list"); 640Debug.Assert(owners[i] != null, "null owner"); 791Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points"); 865Debug.Assert(res.Count == 2, "unexpected resulting segment count after split"); 918Debug.Assert(textViews != null, "geometry text view not found"); 937Debug.Assert((view != null) && (parentView != null), "null text view"); 979Debug.Assert(!_segment.IsNull, "null TextSegment"); 1098Debug.Assert(TopOwner != null, "invalid TopOwner"); 1100Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
363Debug.Assert(anchor != null, "undefined anchor"); 364Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry"); 368Debug.Assert(geometry != null, "unexpected geometry type"); 369Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count"); 433Debug.Assert(_uiParent != null, "No selection container"); 475Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer"); 624Debug.Assert(componentsRegister != null, "The selection is not registered"); 647Debug.Assert(anchor != null, "wrong attachedAnchor"); 880Debug.Assert(selection != null, "Unexpected sender of Changed event"); 890Debug.Assert(components != null, "No SN registered for this selection"); 898Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component"); 919Debug.Assert(sender != null, "undefined sender"); 946Debug.Assert(pos != null, "null text pointer"); 960Debug.Assert((components != null) && (components.Count > 0), "invalid component registry"); 987Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null"); 988Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null"); 1001Debug.Assert(component != null, "component is null"); 1002Debug.Assert(_components != null, "_components are null"); 1036Debug.Assert(component != null, "component is null"); 1037Debug.Assert(_components != null, "_components are null"); 1092Debug.Assert(first != null, "first component is null"); 1093Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null"); 1094Debug.Assert(second != null, "second component is null"); 1095Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null"); 1100Debug.Assert(firstAnchor != null, " first TextAnchor is null"); 1101Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Annotations\Storage\StoreAnnotationsMap.cs (2)
42Debug.Assert(authorChanged != null && anchorChanged != null && cargoChanged != null, 68Debug.Assert(FindAnnotation(annotation.Id) == null, "annotation not found");
MS\Internal\AppModel\IconHelper.cs (1)
332Debug.Assert(nBytesCount > 0, "The N-Byte has to be greater than 0!");
MS\Internal\AppModel\Journaling.cs (16)
92Debug.Assert(_contentId == 0 || _contentId == value, 120Debug.Assert(value.JEGroupState == this); 121Debug.Assert(_groupExitEntry == null || _groupExitEntry.ContentId == value.ContentId); 216Debug.Assert(this.KeepAliveRoot == contentObject); // set by ctor; shouldn't change 223Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 224Debug.Assert(this.KeepAliveRoot != null); 372Debug.Assert(endingPF.ParentPageFunctionId == Guid.Empty, 407Debug.Assert(pageFunction != null && pageFunction.KeepAlive); 452Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 457Debug.Assert(pf != null); 489Debug.Assert(!pageFunction.KeepAlive); 555Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 562Debug.Assert(ns != null, "Fragment navigation won't work when the INavigator doesn't have a NavigationService."); 568Debug.Assert(pageFunction != null); 649Debug.Assert(contentObject.GetType().AssemblyQualifiedName == this._typeName, 780Debug.Assert(_markupUri != null, "_markupUri in JournalEntryPageFunctionUri should be set.");
MS\Internal\AppModel\JournalNavigationScope.cs (6)
273Debug.Assert(journal != null); 302Debug.Fail("Tried to navigate to a null JournalEntry."); 307Debug.Fail("Tried to navigate to a non-navigable journal entry."); 312Debug.Assert(navigationService != null, "NavigationService cannot be null for journal navigations"); 414Debug.Assert(_journal == null && value != null, 449Debug.Assert(sender == _journal);
MS\Internal\AppModel\ReturnEventSaver.cs (1)
108Debug.Assert(caller != null, "Caller should not be null");
MS\Internal\Commands\CommandHelpers.cs (3)
95Debug.Assert(controlType != null); 96Debug.Assert(command != null); 97Debug.Assert(executedRoutedEventHandler != null);
MS\Internal\Controls\ActiveXContainer.cs (3)
58Debug.Assert(_host != null, "gotta have the avalon activex host"); 204Debug.Assert(_siteUIActive == null, "Object did not call OnUIDeactivate"); 215Debug.Assert(this.ActiveXHost == site, "deactivating when not active...");
MS\Internal\Controls\ActiveXSite.cs (2)
213Debug.Fail(t.ToString()); 356Debug.Fail(t.ToString());
MS\Internal\Controls\CustomCategoryAttribute.cs (1)
17Debug.Assert("Content".Equals(name, StringComparison.Ordinal)
MS\Internal\Controls\InkCanvasFeedbackAdorner.cs (1)
146Debug.Assert(_frameSize != new Size(0, 0));
MS\Internal\Controls\InkCanvasInnerCanvas.cs (2)
31Debug.Assert(inkCanvas != null); 277Debug.Assert(Children.Contains(hitElement), "The hit element should be a child of InnerCanvas.");
MS\Internal\Controls\InkCanvasSelectionAdorner.cs (1)
28Debug.Assert(adornedElement is InkCanvasInnerCanvas,
MS\Internal\Controls\ModelTreeEnumerator.cs (6)
137Debug.Assert(contentControl != null, "contentControl should be non-null."); 157Debug.Assert(headeredContentControl != null, "headeredContentControl should be non-null."); 158Debug.Assert(header != null, "Header should be non-null. If Header was null, the base ContentControl enumerator should have been used."); 217Debug.Assert(headeredItemsControl != null, "headeredItemsControl should be non-null."); 218Debug.Assert(items != null, "items should be non-null."); 219Debug.Assert(header != null, "header should be non-null. If Header was null, the base ItemsControl enumerator should have been used.");
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (14)
78Debug.Assert(annotation != null); 120Debug.Assert((token & AllValues) != 0); 608Debug.Assert(false); 623Debug.Assert(cargo != null); 647Debug.Assert(false); 695Debug.Assert(false); 721Debug.Fail("The annotation data does match with the current content control in StickyNote"); 804Debug.Assert(snc.IsExpanded); 812Debug.Assert(snc.IsExpanded); 1249Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1263Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1366Debug.Assert(((IAnnotationComponent)this).AnnotatedElement != null, "undefined annotated element"); 1393Debug.Assert(adornerTransform != null, "transform to AnnotatedElement is null"); 1559Debug.Assert(_attachedAnnotation != null, "This property should never be acccessed from outside of CAF");
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (4)
200Debug.Assert(node != null && !IsEmpty); 227Debug.Assert(node != null); 372Debug.Assert(node != null && !IsEmpty); 394Debug.Assert(node != null, "Try to load data from an invalid node");
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (2)
58Debug.Assert(!helper.IsLocked(flag)); 68Debug.Assert(_helper.IsLocked(_flag));
MS\Internal\Controls\TemplatedAdorner.cs (3)
40Debug.Assert(adornedElement != null, "adornedElement should not be null"); 41Debug.Assert(adornerTemplate != null, "adornerTemplate should not be null"); 135Debug.Assert(_child != null, "_child should not be null");
MS\Internal\Controls\WebBrowserEvent.cs (7)
31Debug.Assert(parent != null, "WebBrowser control required for hooking webbrowser events"); 41Debug.Assert(url == null || url is string, "invalid url type"); 42Debug.Assert(targetFrameName == null || targetFrameName is string, "invalid targetFrameName type"); 43Debug.Assert(headers == null || headers is string, "invalid headers type"); 157Debug.Assert(url == null || url is string, "invalid url type"); 174Debug.Assert(psi != null, "The Document does not implement IPersistStreamInit"); 211Debug.Assert(url == null || url is string, "invalid url type");
MS\Internal\Data\BindingWorker.cs (1)
29Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
513Debug.Assert(subgroup != null); 534Debug.Assert(subgroup != null);
MS\Internal\Data\CollectionViewGroupRoot.cs (2)
151Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(item, ProtectedItems[index]), "RemoveSpecialItem finds inconsistent data"); 636Debug.Fail("Failed to find item in expected subgroup after Move");
MS\Internal\Data\CompositeCollectionView.cs (4)
407Debug.Assert(startingIndex >= 0, "Source composite collection failed to supply an index"); 451Debug.Assert(args.Action == NotifyCollectionChangedAction.Remove); 1652Debug.Fail("CurrentItem is not consistent with CurrentPosition"); 1657Debug.Fail("CurrentItem is not consistent with CurrentPosition");
MS\Internal\Data\DataExtensionMethods.cs (1)
33Debug.Fail("Unsupported list passed to Search");
MS\Internal\Data\DefaultValueConverter.cs (1)
471Debug.Assert(sourceType != targetType);
MS\Internal\Data\DisplayMemberTemplateSelector.cs (1)
24Debug.Assert(!(String.IsNullOrEmpty(displayMemberPath) && String.IsNullOrEmpty(stringFormat)));
MS\Internal\Data\IndexedEnumerable.cs (2)
393Debug.Fail("EnsureCacheCurrent: _enumerator.Current failed with InvalidOperationException"); 395Debug.Assert(System.Windows.Controls.ItemsControl.EqualsEx(_cachedItem, current), "EnsureCacheCurrent: _cachedItem out of sync with _enumerator.Current");
MS\Internal\Data\LiveShapingBlock.cs (1)
87Debug.Assert(index < size, "FindPosition called with item not in its block");
MS\Internal\Data\LiveShapingList.cs (1)
258Debug.Assert(sdc.Count >= _compInfos.Length, "SortDescriptions don't match LivePropertyInfos");
MS\Internal\Data\PropertyPathWorker.cs (3)
606Debug.Assert(0 <= k && k < _arySVS.Length && _arySVS[k].collectionView == collectionView, "bad parameters to UpdateSourceValueState"); 1139Debug.Assert(_dependencySourcesChanged, "Cached accessor didn't change sources"); 1279Debug.Assert(sb.Length == 0,
MS\Internal\Data\RBNode.cs (4)
418Debug.Assert(successor != null && successor.Size < MaxSize, "InsertAt: successor should have room"); 439Debug.Assert(succsucc.Size == MaxSize, "InsertAt: outer nodes should be full"); 517Debug.Assert(index >= node.LeftSize + node.Size, "InsertNode: index should fall between nodes"); 570Debug.Assert(!deleteHere || node.Size == 0, "DeleteNode: Deleted node should be empty");
MS\Internal\Data\StaticPropertyChangedEventManager.cs (6)
83Debug.Fail("Should never get here"); 91Debug.Fail("Should never get here"); 153Debug.Assert(handler != null && type != null && propertyName != null, 178Debug.Assert(handler != null && type != null && propertyName != null, 399Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear"); 487Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty");
MS\Internal\Data\ValueChangedEventManager.cs (3)
187Debug.Assert(_toRemove.Count == 0, "to-remove list should be empty"); 295Debug.Assert(listener != null && source != null && pd != null, 303Debug.Assert(listener != null && source != null && pd != null,
MS\Internal\Data\ViewManager.cs (1)
236Debug.Assert(cvs != null, "Required CVS key is missing");
MS\Internal\Data\XDeferredAxisSource.cs (1)
77Debug.Assert(aryMembers.Length == 1, "XLinq changed XDeferredAxis to have more than one indexer");
MS\Internal\Data\XmlBindingWorker.cs (2)
33Debug.Assert(_xpath != null); 441Debug.Assert(ContextNode != null);
MS\Internal\DataStreams.cs (3)
131Debug.Fail($"Unexpected exception writing binary formatted data. {ex.Message}"); 260Debug.Fail($"Unexpected exception reading binary formatted data. {ex.Message}"); 304Debug.Assert(state != null);
MS\Internal\Documents\Application\DocumentApplicationJournalEntry.cs (1)
69Debug.Assert(docViewer != null, "PUIDocumentApplicationDocumentViewer not found.");
MS\Internal\Documents\ColumnResult.cs (1)
172Debug.Assert(_paragraphs != null && _paragraphs.Count > 0);
MS\Internal\Documents\ContentElementCollection.cs (5)
35Debug.Assert(owner != null); 170Debug.Assert(Items[item.Index] == item); 306Debug.Assert(collection != null); 698Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 708Debug.Assert(BelongsToOwner(Items[i + 1]));
MS\Internal\Documents\HostedElements.cs (6)
69Debug.Assert(_currentTextSegment == 0); 86Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0 && 97Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0); 175Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 179Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement); 185Debug.Fail("Invalid state in HostedElements.cs");
MS\Internal\Documents\PageCache.cs (1)
735Debug.Assert(changes != null, "Attempt to fire PageCacheChangedEvent with null change set.");
MS\Internal\Documents\RowCache.cs (1)
1062Debug.Fail("Requested to update a non-existent row.");
MS\Internal\Documents\TableColumnCollectionInternal.cs (8)
43Debug.Assert(Items[index] == null); 62Debug.Assert(BelongsToOwner(Items[i])); 109Debug.Assert(BelongsToOwner(Items[i])); 134Debug.Assert(item != null && item.Index == -1); 135Debug.Assert(Items[index] == null); 171Debug.Assert(item != null); 286Debug.Assert(BelongsToOwner(Items[i])); 294Debug.Assert(BelongsToOwner(Items[i + count]));
MS\Internal\Documents\TableTextElementCollectionInternal.cs (9)
67Debug.Assert(BelongsToOwner(Items[i])); 236Debug.Assert(BelongsToOwner(Items[i])); 256Debug.Assert(item != null && item.Index == -1); 257Debug.Assert(Items[index] == null); 285Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 299Debug.Assert(BelongsToOwner(Items[i + 1])); 341Debug.Fail("Garbage in logical tree."); 368Debug.Assert(BelongsToOwner(Items[i])); 385Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item);
MS\Internal\Documents\TextBoxView.cs (1)
1174System.Diagnostics.Debug.Assert(_host != null && _host.TextContainer != null && _host.TextContainer.Highlights != null,
MS\Internal\Documents\TextParagraphView.cs (11)
148Debug.Assert(lines != null && lines.Count > 0); 154Debug.Assert(false); 266Debug.Assert(lines != null && lines.Count > 0); 270Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 322Debug.Assert(lines != null && lines.Count > 0, "Line array is empty."); 326Debug.Assert(lineIndex < lines.Count); 412Debug.Assert(dcp >= lines[lineIndex].StartPositionCP); 413Debug.Assert(dcp < lines[lineIndex].EndPositionCP || 525Debug.Assert(lines != null && lines.Count > 0); 562Debug.Assert(lines != null && lines.Count > 0); 689Debug.Assert(lines != null && lines.Count > 0);
MS\Internal\Documents\UndoManager.cs (3)
110Debug.Assert(((UndoManager)undoManager)._scope == null); 145Debug.Assert(((UndoManager)undoManager)._scope == scope); 275Debug.Assert(false);
MS\Internal\Globalization\BamlResourceSerializer.cs (3)
51Debug.Assert(output != null, "The output stream given is null"); 52Debug.Assert(tree != null && tree.Root != null, "The tree to be serialized is null."); 73Debug.Assert(elementNode != null);
MS\Internal\Globalization\BamlTreeMap.cs (3)
38Debug.Assert(tree != null, "Baml Tree is empty"); 39Debug.Assert(localizer != null, "BamlLocalizer is null"); 559Debug.Assert(node.NodeType == BamlNodeType.StartElement);
MS\Internal\Globalization\BamlTreeNode.cs (4)
38Debug.Assert(root != null, "Baml tree root is null!"); 39Debug.Assert(size > 0, "Baml tree size is less than 1"); 568Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit); 702Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit);
MS\Internal\Globalization\BamlTreeUpdater.cs (3)
22Debug.Assert(tree != null && tree.Root != null, "Empty Tree!"); 23Debug.Assert(treeMap != null, "Empty map!"); 24Debug.Assert(dictionary != null, "Empty dictionary");
MS\Internal\Globalization\LocalizableResourceBuilder.cs (2)
445Debug.Assert(inheritableAttribute != null); 515Debug.Fail("Can't process localizability attribute on nodes other than Element, Property and LiteralContent.");
MS\Internal\Globalization\LocalizationComments.cs (1)
346Debug.Assert(enumPrefix != null && enumNames != null);
MS\Internal\Helper.cs (7)
399Debug.Assert( fe != null ); 591Debug.Assert(targetDependencyObject != null, "DependencyProperties can only be set on DependencyObjects"); 637Debug.Assert(targetMember is PropertyInfo || targetMember is MethodInfo, 650Debug.Assert(parameterInfos.Length == 2, "The signature of a static settor must contain two parameters"); 834Debug.Assert(item != null); 1248Debug.Assert(virtualizingElement != null, "Must have a virtualizingElement to clear"); 1326Debug.Assert(VisualTreeHelper.IsAncestorOf(pathEndElement, pathStartElement), "pathEndElement should be an ancestor of pathStartElement");
MS\Internal\Ink\ClipboardProcessor.cs (6)
78Debug.Assert(dataObject != null && _preferredClipboardData!= null); 124Debug.Assert(inkCanvasSelection.SelectedStrokes.Count == orderedStrokes.Count); 168Debug.Assert(false , "CopySelectData: InkCanvas should have a selection!"); 182Debug.Assert(dataObject != null && _preferredClipboardData!= null); 252Debug.Assert(_preferredClipboardData != null); 261Debug.Assert(value != null);
MS\Internal\Ink\EditingCoordinator.cs (22)
72Debug.Assert(ActiveEditingBehavior == SelectionEditor, 165Debug.Assert(currentBehavior is StylusEditingBehavior, 187Debug.Assert(currentBehavior is StylusEditingBehavior, 243Debug.Assert(behavior != null); 301Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior."); 347Debug.Assert(behavior == ActiveEditingBehavior); 357Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior, 368Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior, 437Debug.Assert((_capturedStylus != null && _capturedMouse == null) 595Debug.Assert(newEditingBehavior != null); 768Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null, 851Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing, 920Debug.Assert(inputDevice != null, "A null device is passed in."); 921Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null."); 922Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet."); 967Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse"); 1003Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly."); 1045Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time."); 1178Debug.Fail("Unknown behavior"); 1215Debug.Fail("Unknown behavior"); 1223Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke"); 1224Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Ink\EraserBehavior.cs (8)
78Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 96Debug.Assert(_cachedEraseMode != mode); 140Debug.Fail("Unknown InkCanvasEditingMode!"); 149Debug.Assert(newEraseMode == InkCanvasEditingMode.EraseByPoint 173Debug.Assert(_cachedPointEraserCursor != null, "_cachedPointEraserCursor shouldn't be null."); 341Debug.Assert(null != e.HitStroke); 379Debug.Assert(null != e.HitStroke, "e.HitStroke cannot be null"); 395Debug.Assert(eraseResult != null, "eraseResult cannot be null");
MS\Internal\Ink\InkCanvasSelection.cs (11)
129Debug.Assert( _inkCanvas.EditingCoordinator.UserIsEditing); 130Debug.Assert(activeSelectionHitResult != InkCanvasSelectionHitResult.None, "activeSelectionHitResult cannot be InkCanvasSelectionHitResult.None."); 140Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == null, 155Debug.Assert(VisualTreeHelper.GetParent(_inkCanvas.FeedbackAdorner) 173Debug.Assert(VisualTreeHelper.GetParent(feedbackAdorner) == adornerLayer, 195Debug.Assert(strokes != null && elements != null); 480Debug.Fail("The updatedElement has to be the same type as the originalElement."); 600Debug.Fail("An unexpected single selected Element"); 755Debug.Assert( SelectedElements.Count != 0, 873Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Visible, 880Debug.Assert(_inkCanvas.SelectionAdorner.Visibility == Visibility.Collapsed,
MS\Internal\Ink\InkCollectionBehavior.cs (3)
104Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 162Debug.Fail("Unknown InkCanvasEditingMode!"); 290Debug.Assert(_strokeDrawingAttributes != null, "_strokeDrawingAttributes can not be null, did we not see a down?");
MS\Internal\Ink\LassoHelper.cs (1)
164System.Diagnostics.Debug.Assert((0 <= percentIntersect) && (100 >= percentIntersect));
MS\Internal\Ink\LassoSelectionBehavior.cs (11)
68Debug.Assert(EditingCoordinator.IsInMidStroke, "SwitchToMode should only be called in a mid-stroke"); 96Debug.Fail("Cannot switch from Select to Select in mid-stroke"); 109Debug.Fail("Unknown InkCanvasEditingMode!"); 121Debug.Assert(stylusPoints.Count != 0, "An empty stylusPoints has been passed in."); 272Debug.Assert(tappedElement == null); 278Debug.Assert(tappedStroke == null); 367System.Diagnostics.Debug.Assert(null != _lassoHelper); 384Debug.Assert(canvas != null); 385Debug.Assert(childElement != null); 387Debug.Assert(canvas.CheckAccess()); 585Debug.Assert(!_disableLasso && _lassoHelper == null, "StartLasso is called unexpectedly.");
MS\Internal\Ink\PenCursorManager.cs (2)
58Debug.Assert(DoubleUtil.IsZero(tranform.OffsetX) && DoubleUtil.IsZero(tranform.OffsetY), "The EraserShape cannot be translated."); 59Debug.Assert(tranform.HasInverse, "The transform has to be invertable.");
MS\Internal\Ink\SelectionEditingBehavior.cs (3)
64Debug.Assert(_hitResult != InkCanvasSelectionHitResult.None); 321Debug.Assert(false); 375Debug.Assert(!EditingCoordinator.UserIsEditing, "Unexpect UserIsEditng state." );
MS\Internal\Ink\StrokeCollectionDefaultValueFactory.cs (1)
37Debug.Assert(property.PropertyType == typeof(StrokeCollection),
MS\Internal\IO\Packaging\ByteStream.cs (3)
37Debug.Assert(stream != null); 43Debug.Assert(_access == FileAccess.Read); 112Debug.Assert(_length > 0);
MS\Internal\IO\Packaging\ManagedFilter.cs (2)
62System.Diagnostics.Debug.Assert(_propType == PropSpecType.Name, "ManagedPropSpec.PropName - PropName only meaningful if PropType is type string"); 83System.Diagnostics.Debug.Assert(_propType == PropSpecType.Id, "ManagedPropSpec.PropId - PropId only meaningful if PropType is numeric");
MS\Internal\IO\Packaging\PackageFilter.cs (7)
451Debug.Assert(false); 460Debug.Assert(false); 550Debug.Assert(contentType != null && contentType.ToString().Length > 0); 576Debug.Assert(dottedExtensionName != null); 604Debug.Assert(pathWithGaps != null && stopGaps != null); 613Debug.Assert(stopGaps.Length > nextStopGapToUse); 621Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (8)
272Debug.Assert(bufferCharacterCount >= 0); 338Debug.Assert(_fixedPageContentExtractor != null); 373Debug.Assert(_contextStack.Count == 0); 379Debug.Assert(_topLevelReader != null); 386Debug.Assert(false); 489Debug.Assert(topOfStack.HasIndexableContent); 751Debug.Assert(_xamlReader != null); 773Debug.Assert(string.Equals(_xamlReader.LocalName, _fixedPageName, StringComparison.Ordinal));
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (1)
34Debug.Assert(_pageNode != null);
MS\Internal\IO\Packaging\XmlGlyphRunInfo.cs (1)
38Debug.Assert(_glyphsNode != null
MS\Internal\LayoutDump.cs (5)
464Debug.Assert(dpv != null, "Dump function has to match element type."); 480Debug.Assert(text != null, "Dump function has to match element type."); 513Debug.Assert(fdsv != null, "Dump function has to match element type."); 539Debug.Assert(fdView != null, "Dump function has to match element type."); 579Debug.Assert(flowDocumentPage != null, "Dump function has to match page type.");
MS\Internal\Navigation\JournalEntryStack.cs (1)
117Debug.Assert(_current != null, "If we are returning true, our current cannot be null");
MS\Internal\PtsHost\BaseParaClient.cs (2)
64Debug.Assert(_paraHandle == IntPtr.Zero || _paraHandle == pfspara); 100Debug.Assert(oldParaClient._visual != null);
MS\Internal\PtsHost\BaseParagraph.cs (1)
178Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\CellParaClient.cs (4)
78Debug.Assert(calculatedColumns != null 355Debug.Assert(tableParaClient != null); 358Debug.Assert( calculatedColumns != null 372Debug.Assert(0 <= durCellWidth);
MS\Internal\PtsHost\CellParagraph.cs (6)
64Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 70Debug.Assert(Cell.Table != null); 136Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 139Debug.Assert(Cell.Table != null); 165Debug.Assert(Cell.Index != -1 && Cell.ColumnIndex != -1, 168Debug.Assert(Cell.Table != null);
MS\Internal\PtsHost\ColumnPropertiesGroup.cs (1)
38internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } }
MS\Internal\PtsHost\ContainerParagraph.cs (12)
216Debug.Assert(_ur.ChangeType == PTS.FSKCHANGE.fskchInside); // Inconsistent UpdateRecord data 283Debug.Assert(_ur == null); // UpdateRecord has been already created. 346Debug.Assert(StructuralCache.CurrentFormatContext.FinitePage || _ur != null); // For bottomless case UpdateRecord needs to be created in UpdGetFirstChangeInSegment. 351Debug.Assert(_ur == null); 464Debug.Assert(iArea == 0); 625Debug.Assert(iArea == 0); 704Debug.Assert(pmcsclientOut == IntPtr.Zero); 749Debug.Assert(iArea == 0); 828Debug.Assert(pmcsclientOut == IntPtr.Zero); 882Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 1023Debug.Assert(textPointer is TextPointer); 1149Debug.Assert(ur.Next.FirstPara == null || ur.Next.FirstPara.Next == null);
MS\Internal\PtsHost\DtrList.cs (1)
310Debug.Assert(_dtrs.Length > 0);
MS\Internal\PtsHost\ErrorHandler.cs (2)
26System.Diagnostics.Debug.Fail(message); 40System.Diagnostics.Debug.Fail(message);
MS\Internal\PtsHost\FigureParaClient.cs (4)
398Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 419Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 433Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 603Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FigureParagraph.cs (2)
301Debug.Fail("Tight wrap is not currently supported."); 424Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FloaterBaseParagraph.cs (1)
112Debug.Fail("Tight wrap is not currently supported.");
MS\Internal\PtsHost\FloaterParaClient.cs (4)
405Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 426Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 440Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 612Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FloaterParagraph.cs (5)
246Debug.Assert(pmcsclientOut == IntPtr.Zero); 496Debug.Assert(pmcsclientOut == IntPtr.Zero); 515Debug.Assert(pmcsclientOut == IntPtr.Zero); 598Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 808Debug.Fail("Unknown type of anchor.");
MS\Internal\PtsHost\FlowDocumentPage.cs (8)
313Debug.Assert(child != null); 456Debug.Assert(pageDetails.u.complex.cSections == 1); // Only one section is supported right now. 472Debug.Assert(sectionDetails.u.withpagenotes.cEndnoteColumns == 0); // Footnotes are not supported yet. 474Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 475Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 512Debug.Assert(false); // Complex columns are not supported yet. 917Debug.Assert(e != null); 920Debug.Assert(_structuralCache.TextContainer is not null);
MS\Internal\PtsHost\Line.cs (6)
58Debug.Assert(_line != null, "Line has been already disposed."); 344Debug.Assert(!double.IsNaN(_trackWidth), "Track width must be set for measure pass."); 403Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 659Debug.Assert(dcp >= 0 && (dcp + cch <= _line.Length)); 679Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0); 1005Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position.");
MS\Internal\PtsHost\LineBase.cs (2)
135Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 257Debug.Assert(element != null, "Element should be here.");
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (1)
340Debug.Assert(number >= 0 && number <= 9);
MS\Internal\PtsHost\PageVisual.cs (2)
66Debug.Assert(vc.Count <= 1); 72Debug.Assert(vc.Count <= 1);
MS\Internal\PtsHost\Pts.cs (4)
56Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 91Debug.Assert(ptsContext != null, "Null argument 'ptsContext' - required for return value validation."); 158Debug.Assert(false); 208Debug.Fail("Unknown WrapDirection value.");
MS\Internal\PtsHost\PtsHelper.cs (3)
587Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 588Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 897Debug.Assert(cColumns > 0, "At least one column is required.");
MS\Internal\PtsHost\PtsHost.cs (24)
383Debug.Assert(cnms == 1); // Only one section is supported right now. 569Debug.Fail("PTS.GetSegmentDefinedColumnSpanAreaInfo is not implemented."); 581Debug.Fail("PTS.GetHeightDefinedColumnSpanAreaInfo is not implemented."); 869Debug.Fail("PTS.GetNumberEndnoteColumns is not implemented."); 881Debug.Fail("PTS.GetEndnoteColumnInfo is not implemented."); 892Debug.Fail("PTS.GetFootnoteSeparators is not implemented."); 901Debug.Fail("PTS.FFootnoteBeneathText is not implemented."); 910Debug.Fail("PTS.GetNumberFootnoteColumns is not implemented."); 922Debug.Fail("PTS.GetFootnoteColumnInfo is not implemented."); 931Debug.Fail("PTS.GetFootnoteSegment is not implemented."); 945Debug.Fail("PTS.GetFootnotePresentationAndRejectionOrder is not implemented."); 954Debug.Fail("PTS.FAllowFootnoteSeparation is not implemented."); 1252Debug.Fail("PTS.GetFootnotes is not implemented."); 1271Debug.Fail("PTS.FormatDropCap is not implemented."); 1289Debug.Fail("PTS.GetDropCapPolygons is not implemented."); 1297Debug.Fail("PTS.DestroyDropCap is not implemented."); 1705Debug.Fail("PTS.SnapGridVertical is not implemented."); 1806Debug.Fail("PTS.UpdGetDropCapChange is not implemented."); 1907Debug.Fail("PTS.GetOptimalLineDcpCache is not implemented."); 2548Debug.Assert(false); 2933Debug.Fail("PTS.ObjGetFootnoteInfo is not implemented."); 2943Debug.Assert(false); 3163Debug.Assert(false); 3242Debug.Assert(false);
MS\Internal\PtsHost\PtsPage.cs (13)
156Debug.Assert(!canUpdate || _section.CanUpdate); 165Debug.Assert(breakRecord == null || !_section.StructuralCache.DestroyStructure, "Cannot format from dirty break record unless StructuralCache.DestroyStructure is not set."); 913Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 914Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 961Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 962Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1041Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 1124Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1125Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1327Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1328Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1388Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1389Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\RowParagraph.cs (3)
192Debug.Assert(cCells == Row.FormatCellCount); 256Debug.Assert (_spannedCells[j] != null); 275Debug.Assert(Row.Index - cell.RowIndex + 1 == cell.RowSpan);
MS\Internal\PtsHost\SubpageParaClient.cs (3)
334Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 355Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 369Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual);
MS\Internal\PtsHost\SubpageParagraph.cs (4)
178Debug.Assert(fSuppressTopSpace == 1, "Top space should be always suppressed at the top of broken paragraph."); 426Debug.Assert(pmcsclientOut == IntPtr.Zero); 581Debug.Assert(pmcsclientOut == IntPtr.Zero); 626Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\TableParaClient.cs (24)
58Debug.Assert( Table != null 317Debug.Assert( TableParagraph.Table != null 360Debug.Assert( TableParagraph.Table != null 431Debug.Assert(TableParagraph.Table != null 600Debug.Assert( TableParagraph.Table != null 819Debug.Assert( TableParagraph.Table != null 890Debug.Assert( TableParagraph.Table != null 944Debug.Assert( TableParagraph.Table != null 1025Debug.Assert( TableParagraph.Table != null 1119Debug.Assert( TableParagraph.Table != null 1147Debug.Assert(false); 1169Debug.Assert(Table != null); 1195Debug.Assert(Table != null); 1377Debug.Assert(TableParagraph == (TableParagraph)(PtsContext.HandleToObject(tableObjDetails.fsnmTable))); 1407Debug.Assert(tableDetails.cRows == cRowsActual); 1456Debug.Assert(tableRowDetails.cCells == cCellsActual); 1585Debug.Assert( cellParaClient.Visual != null 1714Debug.Assert( cellParaClient.Visual != null 1972Debug.Fail("Unsupported unit type"); 2040Debug.Assert(_calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Auto || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Star || _calculatedColumns[i].UserWidth.GridUnitType == GridUnitType.Pixel, "Unexpected GridUnitType"); 2043Debug.Assert(0 <= _calculatedColumns[i].DurMinWidth && 0 <= _calculatedColumns[i].DurMaxWidth); 2098Debug.Assert(0 < iP || DoubleUtil.IsZero(iP)); 2368Debug.Assert(_calculatedColumns[i].UserWidth.IsAbsolute); 2392Debug.Assert(_calculatedColumns[i].DurMinWidth <= _calculatedColumns[i].DurMaxWidth);
MS\Internal\PtsHost\TableParagraph.cs (3)
302Debug.Assert(Table.RowGroups.Count > 0); 318Debug.Assert(currentRowGroup.Rows[nextRowIndex].Index != -1, 335Debug.Assert(Rows[0].Index != -1,
MS\Internal\PtsHost\TextFormatterHost.cs (6)
39Debug.Assert(Context != null, "TextFormatter host is not initialized."); 40Debug.Assert(textSourceCharacterIndex >= 0, "Character index must be non-negative."); 52Debug.Assert(Context != null, "TextFormatter host is not initialized."); 53Debug.Assert(textSourceCharacterIndexLimit >= 0, "Character index must be non-negative."); 66Debug.Assert(Context != null, "TextFormatter host is not initialized."); 67Debug.Assert(textSourceCharacterIndex>= 0, "Character index must be non-negative.");
MS\Internal\PtsHost\TextParaClient.cs (42)
130Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 131Debug.Fail("Should not get here. ParaCache is not currently used."); 157Debug.Assert(!((TextParagraph) Paragraph).HasFiguresFloatersOrInlineObjects()); 228Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 229Debug.Fail("Should not get here. ParaCache is not currently used."); 250Debug.Assert(Paragraph.Element as ContentElement != e); 317Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 318Debug.Fail("Should not get here. ParaCache is not currently used."); 370Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 371Debug.Fail("Should not get here. ParaCache is not currently used."); 712Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 713Debug.Fail("Should not get here. ParaCache is not currently used."); 793Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 794Debug.Fail("Should not get here. ParaCache is not currently used."); 825Debug.Assert(position is TextPointer); 856Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 857Debug.Fail("Should not get here. ParaCache is not currently used."); 875Debug.Assert(position is TextPointer); 906Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 907Debug.Fail("Should not get here. ParaCache is not currently used."); 1063Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1064Debug.Fail("Should not get here. ParaCache is not currently used."); 1365Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1366Debug.Fail("Should not get here. ParaCache is not currently used."); 1385Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 1465Debug.Assert(insertionIndex >= 0 && insertionIndex <= lineVisuals.Count); 2617Debug.Assert(index > 0); 2747Debug.Assert(index == 0); 2748Debug.Assert(elIndex == 0); 2762Debug.Assert(index > 0); 2786Debug.Assert(elIndex == arrayLineElement.Length - 1); 2787Debug.Assert(index == arrayLineDesc.Length - 1); 2907Debug.Assert(index > 0); 2955Debug.Assert(backspaceCaretPosition != null); 3004Debug.Assert(index == 0); 3005Debug.Assert(elIndex == 0); 3019Debug.Assert(index > 0); 3366Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 3484Debug.Assert(_lineIndexFirstVisual == lineIndexFirstVisible); 3513Debug.Assert(visualChildren.Count == (lineIndexFirstInvisible - lineIndexFirstVisible)); 3923Debug.Assert(localEnd > localStart); 4123Debug.Assert(localEnd > localStart);
MS\Internal\PtsHost\TextParagraph.cs (1)
137Debug.Assert(iArea == 0);
MS\Internal\PtsHost\TextParaLineResult.cs (4)
52Debug.Assert(false); 68Debug.Assert(false); 81Debug.Assert(false); 97Debug.Assert(false);
MS\Internal\PtsHost\UpdateRecord.cs (1)
38Debug.Assert(Next != null); // This is the last UR, cannot merge with next.
MS\Internal\PtsTable\CalculatedColumn.cs (1)
48Debug.Assert(0 <= durMinWidth && durMinWidth <= durMaxWidth);
MS\Internal\PtsTable\RowSpanVector.cs (10)
76Debug.Assert(cell != null 84Debug.Assert( start < _entries[i].Cell.ColumnIndex 90Debug.Assert(_index < _size); 91Debug.Assert(_index == 0 || _entries[_index - 1].Start < start); 92Debug.Assert(start < _entries[_index].Start); 138Debug.Assert(0 <= _index && _index < _size); 146Debug.Assert(0 <= _index && _index < _size); 178Debug.Assert(_entries[i].Cell != null); 179Debug.Assert(i >= j); 248Debug.Assert( _entries.Length > 0
MS\Internal\SystemDataHelper.cs (1)
83Debug.Fail("Could not find Null field or property for SqlNullable type");
MS\Internal\Text\ComplexLine.cs (12)
63Debug.Assert(run != null, "TextRun has not been created."); 64Debug.Assert(run.Length > 0, "TextRun has to have positive length."); 76Debug.Assert(dcp >= 0); 151Debug.Assert(runs != null, "Cannot retrieve runs collection."); 174Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width."); 226Debug.Assert(runs != null, "Cannot retrieve runs collection."); 330Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters."); 377Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge."); 382Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances."); 468Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge."); 473Debug.Assert(element != null, "Element should be here."); 518Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
MS\Internal\Text\DynamicPropertyReader.cs (5)
37Debug.Assert(element != null); 49Debug.Assert(element != null); 67Debug.Assert(element != null); 226Debug.Assert(element != null); 251Debug.Assert(!position.IsNull);
MS\Internal\Text\Line.cs (7)
105Debug.Assert(_line != null, "Rendering line that has not been measured yet."); 112Debug.Assert(line.HasCollapsed, "Line has not been collapsed"); 305Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 309Debug.Assert(collapsedRanges.Count == 1, "Multiple collapsed ranges are not supported."); 341Debug.Assert(collapsedLine.HasCollapsed, "Line has not been collapsed"); 472Debug.Assert(runBounds.Count == 1, "Expecting exactly one TextRunBounds for a single text position."); 495Debug.Assert(paraProperties.TextTrimming != TextTrimming.None, "Text trimming must be enabled.");
MS\Internal\Text\LineMetrics.cs (2)
111get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _width; } 126get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _start; }
MS\Internal\Text\SimpleLine.cs (3)
33Debug.Assert(dcp >= 0, "Character index must be non-negative."); 70Debug.Assert(dcp >= 0, "Character index must be non-negative."); 121Debug.Assert(content != null);
MS\Internal\Text\TextLineResult.cs (4)
51Debug.Assert(false); 63Debug.Assert(false); 74Debug.Assert(false); 86Debug.Assert(false);
MS\Internal\Text\TextProperties.cs (1)
254Debug.Assert(element != null);
MS\Internal\Text\TypographyProperties.cs (3)
102Debug.Assert((uint)PropertyId.PropertyCount <= 32); 775Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id"); 791Debug.Assert((uint)propertyId < (uint)PropertyId.PropertyCount, "Invalid typography property id");
MS\Internal\WeakHashtable.cs (1)
53Debug.Assert(!key.GetType().IsValueType, "WeakHashtable doesn't support value-type keys. Use WeakObjectHashtable instead.");
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
159System.Diagnostics.Debug.Assert(_CanUnloadNow == null || _CanUnloadNow() == 0); // S_OK
MS\Win32\UxThemeWrapper.cs (1)
397Debug.Assert(themeState.IsActive, "Queried ThemeColor while UxTheme is not active.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
26Debug.Assert(CurrentFrame is not null); 27Debug.Assert(CurrentFrame.Depth == Depth); 84Debug.Assert(iteratorFrame is not null); 110Debug.Assert(CurrentFrame.Depth == Depth); 123Debug.Assert(CurrentFrame.Depth == Depth);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
40Debug.Assert(_depth != -1, "Context Frame is uninitialized");
System\Windows\Annotations\AnnotationHelper.cs (1)
624Debug.Assert((textSegments != null) && (textSegments.Count > 0), "Invalid selection TextSegments");
System\Windows\Annotations\Storage\XmlStreamStore.cs (2)
833Debug.Assert(knownNamespace != null, "null knownNamespace"); 852Debug.Assert(name != null, "null compatible namespace");
System\Windows\Application.cs (7)
107Debug.Assert(_appInstance == null, "_appInstance must be null here."); 517Debug.Assert(stream != null, "stream should not be null."); 518Debug.Assert(pc != null, "pc should not be null."); 701Debug.Assert(stream == null || sooPart != null, "When stream is not null, sooPart cannot be null either"); 1527Debug.Assert(CheckAccess(), "This should only be called on the Application thread"); 1588Debug.Assert(CheckAccess(), "DoShutdown can only be called on the Dispatcer thread"); 2007Debug.Assert(!uri.IsAbsoluteUri || BaseUriHelper.IsPackApplicationUri(uri));
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (1)
198Debug.Assert(false);
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
685Debug.Assert((int)owningButton.GetValue(Grid.RowProperty) > 0);
System\Windows\Automation\Peers\ItemAutomationPeer.cs (1)
690System.Diagnostics.Debug.Assert(Object.Equals(item, Item), "ItemPeer reuse for an unequal item is not supported");
System\Windows\Automation\Peers\ItemsControlAutomationPeer.cs (1)
610Debug.Fail("it must not add already present Item");
System\Windows\BroadcastEventHelper.cs (9)
19Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 40Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 44Debug.Assert(loadedPending.Length == 3); 67Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 88Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 92Debug.Assert(unloadedPending.Length == 3); 165Debug.Assert(loadedPending != null && loadedPending.Length == 3, 202Debug.Assert(unloadedPending != null && unloadedPending.Length == 3, 506Debug.Assert( fo.IsFE );
System\Windows\Controls\AVElementHelper.cs (1)
52Debug.Assert((element != null), "Element is null");
System\Windows\Controls\Calendar.cs (14)
208Debug.Assert(c != null); 264Debug.Assert(c != null); 325Debug.Assert(c != null); 382Debug.Assert(c != null); 413Debug.Assert(false); 540Debug.Assert(c != null); 626Debug.Assert(c != null); 916Debug.Assert(false); 935Debug.Assert(false); 975Debug.Assert(false); 1008Debug.Assert(false); 1077Debug.Assert(false); 1179Debug.Assert(this.DisplayMode == CalendarMode.Year); 1192Debug.Assert(this.DisplayMode == CalendarMode.Decade);
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
112Debug.Assert(dayInterval != 0); 327Debug.Assert(day != null);
System\Windows\Controls\ColumnDefinition.cs (14)
91Debug.Assert(_items != null); 113Debug.Assert(_items != null); 153Debug.Assert( _items[i] != null 171Debug.Assert(_items[item.Index] == item); 186Debug.Assert(_items[value.Index] == value); 322Debug.Assert( _items[i] != null 331Debug.Assert( _items[i + count] != null 631Debug.Assert(value != null && value.Index == -1); 632Debug.Assert(_items[index] == null); 649Debug.Assert(value != null); 682Debug.Assert( _items[i] != null 700Debug.Assert( _items[value.Index] == value 713Debug.Assert( _items[i + 1] != null 742Debug.Assert(value >= _size);
System\Windows\Controls\ComboBox.cs (5)
621Debug.Assert(_editableTextBoxSite == sender); 1192Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true"); 1551Debug.Assert((increment > 0 && startIndex <= stopIndex) || (increment < 0 && startIndex >= stopIndex), "Infinite loop detected"); 1707Debug.Assert(!comboBox.CheckAccess() || Mouse.Captured != comboBox, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown"); 1755Debug.Assert(!CheckAccess() || Mouse.Captured != this, "On the dispatcher thread, ComboBox should not have capture after closing the dropdown");
System\Windows\Controls\ContainerTracking.cs (2)
89Debug.Assert(IsInList(root), "This container should be in the tracking list."); 100Debug.Assert(!IsInList(root), "This container shouldn't be in our tracking list");
System\Windows\Controls\ContentPresenter.cs (3)
1018Debug.Assert(tc.CanConvertTo(typeof(UIElement))); 1088Debug.Assert(!(content is String) && !(content is UIElement)); // these are handled by different templates 1127Debug.Assert(!(tc != null && tc.CanConvertTo(typeof(UIElement)))); // this is handled by a different template
System\Windows\Controls\ContextMenu.cs (1)
480Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\DataGrid.cs (17)
1633Debug.Assert(info != null, "info is null."); 1634Debug.Assert(column != null, "column is null."); 1745Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection."); 3530Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows."); 3531Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place."); 5229Debug.Assert(!IsUpdatingSelectedCells); 5235Debug.Assert(IsUpdatingSelectedCells); 5316Debug.Fail("Unknown SelectionUnit encountered."); 6360Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid."); 7080Debug.Assert(sortColumn != null, "column should not be null"); 7238Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7249Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7269Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time"); 7383Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7391Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7402Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time"); 7822Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
105Debug.Assert(
System\Windows\Controls\DataGridCell.cs (5)
89Debug.Assert(_owner == null || _owner == ownerRow, "_owner should be null before PrepareCell is called or the same value as the ownerRow."); 137Debug.Assert(_owner == ownerRow, "_owner should be the same as the DataGridRow that is clearing the cell."); 570Debug.Assert(!IsEditing, "Should not call BeginEdit when IsEditing is true."); 583Debug.Assert(IsEditing, "Should not call CancelEdit when IsEditing is false."); 594Debug.Assert(IsEditing, "Should not call CommitEdit when IsEditing is false.");
System\Windows\Controls\DataGridCellInfo.cs (9)
53Debug.Assert(item != null, "item should not be null."); 54Debug.Assert(column != null, "column should not be null."); 55Debug.Assert(owner != null, "owner should not be null."); 64Debug.Assert(info != null, "item should not be null."); 65Debug.Assert(column != null, "column should not be null."); 66Debug.Assert(owner != null, "owner should not be null."); 78Debug.Assert(item == DependencyProperty.UnsetValue, "This should only be used to make an Unset CellInfo."); 104Debug.Assert(owner != null, "owner should not be null."); 116Debug.Assert(owner != null, "owner should not be null.");
System\Windows\Controls\DataGridCellsPanel.cs (18)
166Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point."); 627Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 642Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 672Debug.Assert(container != null, "Null container was generated"); 708Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 769Debug.Fail("We should have found a child"); 1064Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count"); 1139Debug.Assert(startIndex >= 0); 1140Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 1322Debug.Assert( 1328Debug.Assert( 1407Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible"); 1441Debug.Assert(child != null, "child cannot be null."); 1456Debug.Assert(cell.Column != null, "column cannot be null."); 1561Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count"); 1602Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list"); 1961Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null"); 2079Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumn.cs (3)
591Debug.Assert(Width.IsStar); 892Debug.Assert(d is DataGridColumn, "d should be a DataGridColumn"); 1144Debug.Assert(itemProperty != null && itemProperty.PropertyType != null, "itemProperty and/or its PropertyType member cannot be null");
System\Windows\Controls\DataGridColumnCollection.cs (18)
20Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid"); 226Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated"); 324Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated"); 357Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged"); 358Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid"); 409Debug.Assert( 412Debug.Assert(!IsUpdatingDisplayIndex, "We don't add new columns as part of a display index update operation"); 469Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call."); 542Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex)); 553Debug.Assert( 556Debug.Assert(!IsUpdatingDisplayIndex, "We don't remove columns as part of a display index update operation"); 561Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated"); 597Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection"); 686Debug.Assert(removedDisplayIndex >= 0); 725Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size"); 728Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column"); 729Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices"); 896Debug.Assert(
System\Windows\Controls\DataGridColumnHeaderCollection.cs (2)
42Debug.Assert(e.Property == DataGridColumn.HeaderProperty, "We only want to know about the header property changing"); 43Debug.Assert(_columns.Contains(column));
System\Windows\Controls\DataGridHelper.cs (2)
236Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers."); 300Debug.Assert((cell is DataGridCell) || (cell is DataGridColumnHeader), "provideColumn should be one of the cell or header containers.");
System\Windows\Controls\DataGridHyperlinkColumn.cs (1)
283Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DataGridLengthConverter.cs (1)
254Debug.Assert(
System\Windows\Controls\DataGridRow.cs (3)
222Debug.Assert(stateCode != DATAGRIDROW_stateNullCode); 435Debug.Assert(_owner == null || _owner == owningDataGrid, "_owner should be null before PrepareRow is called or the same as the owningDataGrid."); 476Debug.Assert(_owner == owningDataGrid, "_owner should be the same as the DataGrid that is clearing the row.");
System\Windows\Controls\DataGridTextColumn.cs (1)
268Debug.Assert(e.RoutedEvent == Keyboard.PreviewKeyDownEvent, "We should only reach here on the PreviewKeyDown event because the TextBox within is expected to handle the preview event and hence trump the successive KeyDown event.");
System\Windows\Controls\DatePicker.cs (11)
205Debug.Assert(dp != null); 251Debug.Assert(dp != null); 316Debug.Assert(dp != null); 334Debug.Assert(dp != null); 361Debug.Assert(dp != null); 433Debug.Assert(dp != null); 529Debug.Assert(dp != null); 581Debug.Assert(dp != null); 946Debug.Assert(c != null); 947Debug.Assert(args != null); 969Debug.Assert(e.AddedItems.Count < 2);
System\Windows\Controls\DateTimeHelper.cs (1)
178Debug.Assert(DateTime.Compare(start, end) < 1);
System\Windows\Controls\DefinitionBase.cs (6)
315Debug.Assert(value >= -1 && _parentIndex != value); 700Debug.Assert(sharedSizeGroup != null); 716Debug.Assert(_registry.Contains(key)); 733Debug.Assert(sharedSizeScope != null && sharedSizeGroupId != null); 746Debug.Assert(!_registry.Contains(member)); 830Debug.Assert( _userSize.GridUnitType == GridUnitType.Auto
System\Windows\Controls\Frame.cs (22)
437Debug.Assert(_ownJournalScope != null); 441Debug.Fail("UsesOwnJournal->Automatic transition should be blocked by CoerceJournalOwnership()."); 449Debug.Assert(_ownJournalScope == null); 491Debug.Assert(_journalOwnership == (JournalOwnership)GetValue(JournalOwnershipProperty)); 613Debug.Assert(sender == this && _ownJournalScope != null); 619Debug.Assert(sender == this && _ownJournalScope != null); 626Debug.Assert(sender == this && _ownJournalScope != null); 632Debug.Assert(sender == this && _ownJournalScope != null); 639Debug.Assert(sender == this && _ownJournalScope != null); 658Debug.Assert(sender == this && _ownJournalScope != null); 663Debug.Assert(sender == this && _ownJournalScope != null); 670Debug.Assert(sender == this && _ownJournalScope != null); 733Debug.Assert(d as Frame != null && ((Frame)d).NavigationService != null); 806Debug.Assert(canGoFwd == (bool)GetValue(CanGoForwardProperty)); 821Debug.Assert(canGoBack == (bool)GetValue(CanGoBackProperty)); 980Debug.Assert(backStack == GetValue(BackStackProperty)); 992Debug.Assert(fwdStack == GetValue(ForwardStackProperty)); 1154Debug.Assert(GetValue(BackStackProperty) == _ownJournalScope.BackStack); 1198Debug.Assert(JournalEntry.GetType().IsSerializable); 1226Debug.Assert(_journalOwnership == JournalOwnership.OwnsJournal); 1316Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal); 1346Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal);
System\Windows\Controls\Grid.cs (22)
466Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 722Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 968Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 969Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1067Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1114Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1162Debug.Assert(false); 1427Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1454Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1482Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1515Debug.Assert( minSize <= preferredSize 1546Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1555Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1563Debug.Assert(_IsZero(sizeToDistribute)); 1583Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1594Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1603Debug.Assert(_IsZero(sizeToDistribute)); 1624Debug.Assert( !double.IsInfinity(totalRemainingSize) 2133Debug.Assert(!definitions[i].IsShared || !definitions[i].UserSize.IsStar); 2207Debug.Assert(nonStarIndex == starDefinitionsCount); 2423Debug.Assert(!def.IsShared, "*-defs cannot be shared"); 3922Debug.Assert(grid != null);
System\Windows\Controls\GridSplitter.cs (4)
420Debug.Assert(_decorator != null); 443Debug.Assert(_decorator != null); 634Debug.Assert(_resizeData == null, "_resizeData is not null, DragCompleted was not called"); 868Debug.Assert(_resizeData != null, "_resizeData should not be null when calling MoveSplitter");
System\Windows\Controls\GridViewColumn.cs (1)
424Debug.Fail("Invalid value for ActualWidth.");
System\Windows\Controls\GridViewColumnCollection.cs (3)
140Debug.Assert(!IsImmutable, "IsImmutable is true before BlockWrite"); 149Debug.Assert(IsImmutable, "IsImmutable is flase before UnblockWrite"); 240Debug.Assert(oldIndex != newIndex, "oldIndex==newIndex when perform move action.");
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
44Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove, 46Debug.Assert(changedItem != null, "changedItem can't be null"); 47Debug.Assert(index >= 0, "index must >= 0"); 48Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 59Debug.Assert(newItem != null, "newItem can't be null"); 60Debug.Assert(oldItem != null, "oldItem can't be null"); 61Debug.Assert(index >= 0, "index must >= 0"); 62Debug.Assert(actualIndex >= 0, "actualIndex must >= 0"); 73Debug.Assert(changedItem != null, "changedItem can't be null"); 74Debug.Assert(index >= 0, "index must >= 0"); 75Debug.Assert(oldIndex >= 0, "oldIndex must >= 0"); 76Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewColumnHeader.cs (4)
289Debug.Fail("Method ShouldSerializeProperty is called on an internally generated GridViewColumnHeader."); 420Debug.Assert(flag != Flags.None && ignoreFlag != Flags.None, "Invalid parameter dp."); 752Debug.Assert(stream != null, "stream is null"); 776Debug.Assert(gripperCursor != null, "gripper cursor is null");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (16)
300Debug.Assert(_paddingHeader != null, "padding header is null"); 310Debug.Assert(_indicator != null, "_indicator is null"); 311Debug.Assert(_floatingHeader != null, "_floatingHeader is null"); 384Debug.Assert(_paddingHeader != null, "padding header is null"); 453Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null"); 636Debug.Assert(column != null); 854Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex"); 934Debug.Fail("Head is container for itself, but parent is neither GridViewHeaderRowPresenter nor null."); 983Debug.Assert(header != null || index != -1); 1044Debug.Assert(header != null); 1050Debug.Assert(header != null); 1162Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader"); 1175Debug.Assert(srcHeader != null, "srcHeader is null"); 1176Debug.Assert(_floatingHeader != null, "floating header is null"); 1342Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index"); 1529Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\GridViewRowPresenter.cs (3)
282Debug.Assert(column != null); 574Debug.Assert(column != null, "column shouldn't be null"); 654Debug.Assert(cell is TextBlock, "cells are either TextBlocks or ContentPresenters");
System\Windows\Controls\InkCanvas.cs (18)
575Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty, 1041Debug.Assert(e != null, "EventArg can not be null"); 1260Debug.Assert(e != null, "EventArg can not be null"); 1317Debug.Assert(e != null, "EventArg can not be null"); 1371Debug.Assert(e != null, "EventArg can not be null"); 1405Debug.Assert(e != null, "EventArg can not be null"); 1436Debug.Assert(e != null, "EventArg can not be null"); 1472Debug.Assert(e != null, "EventArg can not be null"); 1548Debug.Assert(e != null, "EventArg can not be null"); 1578Debug.Assert(e != null, "EventArg can not be null"); 1612Debug.Assert(e != null, "EventArg can not be null"); 1642Debug.Assert(e != null, "EventArg can not be null"); 2268System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s)); 2339Debug.Assert(strokes != null 2566System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes)); 2666Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!"); 2705Debug.Assert(inkCanvas != null); 2778Debug.Assert(inkCanvas != null);
System\Windows\Controls\InkPresenter.cs (5)
449Debug.Assert(newStrokes != null, "Cannot set a null to InkPresenter"); 470System.Diagnostics.Debug.Assert(sender == this.Strokes); 478Debug.Assert(addedStrokes != null, "The added StrokeCollection cannot be null."); 520System.Diagnostics.Debug.Assert(stroke != null); 529System.Diagnostics.Debug.Assert(stroke != null);
System\Windows\Controls\ItemCollection.cs (17)
708Debug.Assert(_deferLevel == 0 || _collectionView == null || _deferInnerRefresh != null); 711Debug.Assert(_deferLevel != 0 || _deferInnerRefresh == null); 1547Debug.Assert(!_isInitializing); 1555Debug.Assert(_isInitializing); 1902Debug.Assert(sender == _collectionView); 1908Debug.Assert(sender == _collectionView); 1935Debug.Assert(_collectionView != null); 1946Debug.Assert(_collectionView == null || _deferInnerRefresh != null); 2171Debug.Assert(e.NewStartingIndex >= 0); 2182Debug.Assert(e.OldStartingIndex >= 0); 2190Debug.Assert(e.OldStartingIndex >= 0); 2200Debug.Assert(e.OldStartingIndex >= 0); 2280Debug.Assert(IsShapingActive, "Shaping storage not available"); 2317Debug.Assert(!value, "Shaping storage not available"); 2349Debug.Assert(IsShapingActive, "Shaping storage not available"); 2382Debug.Assert(IsShapingActive, "Shaping storage not available"); 2415Debug.Assert(IsShapingActive, "Shaping storage not available");
System\Windows\Controls\ItemContainerGenerator.cs (9)
279Debug.Fail("Unexpected reentrant call to ICG.Remove"); 325Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice"); 930Debug.Assert(item == null || ItemsControl.EqualsEx(item, target), 2205Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1), 2271Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2336Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)"); 2369Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index"); 2444Debug.Fail("unexpected reentrant call to OnItemAdded"); 2634Debug.Fail("unexpected reentrant call to OnItemMoved");
System\Windows\Controls\ItemsControl.cs (4)
2590Debug.Assert(ScrollHost != null, "This operation to adjust the offset along an edge is only possible when there is a ScrollHost available"); 2751Debug.Assert(direction == FocusNavigationDirection.Up || direction == FocusNavigationDirection.Down, "Can only get the first item on a page using North or South"); 3065Debug.Assert(element != viewPort && element.IsArrangeValid && parent != null, "GetElementViewportPosition called in unsupported situation"); 3131Debug.Assert(direction == FocusNavigationDirection.Up ||
System\Windows\Controls\ListBox.cs (1)
615Debug.Assert(_autoScrollTimer == null, "IsMouseCaptured went from true to true");
System\Windows\Controls\MenuItem.cs (6)
1740Debug.Assert(IsSelected, "When IsSubmenuOpen = true, IsSelected should be true as well"); 1919Debug.Assert(IsHighlighted, "MenuItem got Key.Enter but was not highlighted -- focus did not follow highlight?"); 2176Debug.Assert(Role == MenuItemRole.TopLevelHeader || Role == MenuItemRole.TopLevelItem, "MenuItem was not top-level"); 2216Debug.Assert(!parentMenu.OpenOnMouseEnter || parentMenu.IsMenuMode, "OpenOnMouseEnter can only be true when IsMenuMode is true"); 2562Debug.Assert(timer != null, "timer should not be null."); 2563Debug.Assert(!timer.IsEnabled, "timer should not be running.");
System\Windows\Controls\MultipleCopiesCollection.cs (9)
28Debug.Assert(item != null, "item should not be null."); 29Debug.Assert(count >= 0, "count should not be negative."); 49Debug.Assert( 56Debug.Assert( 63Debug.Assert( 70Debug.Assert( 115Debug.Assert(RepeatCount == newCount, "We should have properly updated the RepeatCount"); 198Debug.Assert((index >= 0) && (index < RepeatCount), "Index out of range"); 284Debug.Assert(_item != null, "_item should be non-null.");
System\Windows\Controls\Page.cs (2)
725Debug.Assert( p != null, "DependencyObject must be of type Page." ); 770Debug.Assert(_currentIws != null, "_currentIws cannot be null here. Caller should always verify it");
System\Windows\Controls\Panel.cs (9)
568Debug.Assert(_itemContainerGenerator == null, "Attempted to connect to a generator when Panel._itemContainerGenerator is non-null."); 591Debug.Assert(_itemContainerGenerator != null, "Attempted to disconnect from a generator when Panel._itemContainerGenerator is null."); 612Debug.Assert(IsItemsHost, "Should be invoked only on an ItemsHost panel"); 672Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an ItemsChanged from a generator."); 711Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Add action from a generator."); 740Debug.Assert(itemCount == containerCount, "Panel expects Replace to affect only realized containers"); 741Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Replace action from a generator."); 751Debug.Assert(e != null && !isNewlyRealized, "Panel expects Replace to affect only realized containers"); 770Debug.Assert(_itemContainerGenerator != null, "Encountered a null _itemContainerGenerator while receiving an Move action from a generator.");
System\Windows\Controls\PasswordTextContainer.cs (4)
897Debug.WriteLine($"{_positionList.Count} entries."); 905Debug.Write($"({position.DebugId}) {position.Offset}/{((position.LogicalDirection == LogicalDirection.Forward) ? "f " : "b ")}"); 909Debug.Write("-/- "); 913Debug.WriteLine("");
System\Windows\Controls\PasswordTextNavigator.cs (9)
27Debug.Assert(offset >= 0 && offset <= container.SymbolCount, "Bad PasswordTextPointer offset!"); 51Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 296Debug.Assert(false); 422Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 463Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 469Debug.Fail("Bad distance!"); 489Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 507Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 508Debug.Fail("No scoping element!");
System\Windows\Controls\PopupControlService.cs (3)
416Debug.Assert(_currentToolTip == null); 1606Debug.Assert(hwndSource != null && rootElement != null, "expect non-null hwndSource and rootElement"); 1608Debug.Assert(((int)pt.X == (int)Math.Round(pt2.X)) && ((int)pt.Y == (int)Math.Round(pt2.Y)), "got incorrect mouse point");
System\Windows\Controls\Primitives\BulletDecorator.cs (2)
148Debug.Assert(child1 != null, "First child should be non-null."); 149Debug.Assert(child2 != null, "Second child should be non-null.");
System\Windows\Controls\Primitives\CalendarItem.cs (9)
211Debug.Assert(false); 376Debug.Assert(mode != CalendarMode.Month); 448Debug.Assert(false); 530Debug.Assert(e != null); 548Debug.Assert(b != null); 905Debug.Assert(this.Owner.DisplayMode == CalendarMode.Year); 1030Debug.Assert(childButton != null); 1220Debug.Assert(childButton != null); 1267Debug.Assert(childButton != null);
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
345Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeader.cs (6)
102Debug.Assert(column != null, "This header must have been generated with for a particular column"); 103Debug.Assert(column.Header == item, "The data item for a ColumnHeader is the Header property of a column"); 316Debug.Assert(header != null, "Header should not be null"); 456Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 466Debug.Assert(Column != null, "column can't be null if we got a notification for this property change"); 549Debug.Assert(Column != null, "column can't be null if we got a notification for this property change");
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
226Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column."); 262Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource"); 692Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 739Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 753Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null"); 754Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 772Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 786Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null"); 787Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null"); 804Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null"); 914Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\DataGridRowHeader.cs (1)
488Debug.Assert(stateCode != DATAGRIDROWHEADER_stateNullCode);
System\Windows\Controls\Primitives\DatePickerTextBox.cs (3)
151Debug.Assert( 164Debug.Assert(e.NewValue is bool); 191Debug.Assert(datePickerTextBox != null, "The source is not an instance of a DatePickerTextBox!");
System\Windows\Controls\Primitives\MenuBase.cs (5)
234Debug.Assert(menu.HasPushedMenuMode); 798Debug.Assert(CheckAccess(), "IsMenuMode requires context access"); 888Debug.Assert(_pushedMenuMode == null); 890Debug.Assert(_pushedMenuMode != null); 899Debug.Assert(_pushedMenuMode != null);
System\Windows\Controls\Primitives\Popup.cs (12)
176Debug.Assert(popup != null, "Popup must be non-null"); 177Debug.Assert(placementTarget != null, "Placement target must be non-null."); 207Debug.Assert(popup != null, "Popup must be non-null"); 208Debug.Assert(placementTarget != null, "Placement target must be non-null."); 884Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty"); 1108Debug.Assert( Mouse.Captured == _popupRoot, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot"); 1400Debug.Assert(popup != null, "popup should be non-null."); 1401Debug.Assert(child != null, "child should be non-null."); 1424Debug.Assert(child != null, "child should be non-null"); 1932Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread."); 2497Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement)); 3290Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\ResizeGrip.cs (1)
64Debug.Assert(rg != null, "DependencyObject must be of type ResizeGrip.");
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (2)
790Debug.Assert(IsScrollClient); 825Debug.Assert(IsScrollClient);
System\Windows\Controls\Primitives\Selector.cs (22)
580Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 1034Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl"); 1422Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect"); 1496Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty"); 1523Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1551Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1594Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 1676Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2039Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true"); 2171Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2270Debug.Assert(_owner.CheckAccess()); 2271Debug.Assert(!_active, SR.SelectionChangeActive); 2283Debug.Assert(_owner.CheckAccess()); 2284Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()"); 2318Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1"); 2492Debug.Assert(_owner.CheckAccess()); 2493Debug.Assert(_active, SR.SelectionChangeNotActive); 2494Debug.Assert(info != null, "parameter info should not be null"); 2549Debug.Assert(_owner.CheckAccess()); 2550Debug.Assert(_active, SR.SelectionChangeNotActive); 2551Debug.Assert(info != null, "info should not be null"); 2587Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\Primitives\Thumb.cs (1)
243Debug.Fail("Got MouseLeftButtonDown event while dragging!");
System\Windows\Controls\Primitives\ToolBarOverflowPanel.cs (1)
93Debug.Assert(childrenIndex == childrenCount, "ToolBarOverflowPanel.Children count mismatch after transferring children from GeneratedItemsCollection.");
System\Windows\Controls\Primitives\ToolBarPanel.cs (4)
141Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 188Debug.Assert(children[childrenIndex] == child, "InternalChildren is out of sync with _generatedItemsCollection."); 453Debug.Assert(itemCount == containerCount, "ToolBarPanel expects Replace to affect only realized containers"); 463Debug.Assert(e != null && !isNewlyRealized, "ToolBarPanel expects Replace to affect only realized containers");
System\Windows\Controls\Primitives\Track.cs (7)
130Debug.Assert(_visualChildren[itemIndex] == oldValue, "Attempt to add a 4th item into _visualChildren"); 380Debug.Assert(_visualChildren == null || _visualChildren[1] == null, "Child[1] should be null if Child[0] == null)"); 381Debug.Assert(_visualChildren == null || _visualChildren[2] == null, "Child[2] should be null if Child[0] == null)"); 386Debug.Assert(_visualChildren[2] == null, "Child[2] should be null if Child[1] == null)"); 582Debug.Assert(decreaseButtonLength >= 0.0 && decreaseButtonLength <= remainingTrackLength, "decreaseButtonLength is outside bounds"); 583Debug.Assert(increaseButtonLength >= 0.0 && increaseButtonLength <= remainingTrackLength, "increaseButtonLength is outside bounds"); 597Debug.Assert(DoubleUtil.GreaterThanOrClose(offset, 0.0), "Invalid offest (negative value).");
System\Windows\Controls\RowDefinition.cs (14)
86Debug.Assert(_items != null); 108Debug.Assert(_items != null); 148Debug.Assert( _items[i] != null 166Debug.Assert(_items[item.Index] == item); 181Debug.Assert(_items[value.Index] == value); 317Debug.Assert( _items[i] != null 326Debug.Assert( _items[i + count] != null 626Debug.Assert(value != null && value.Index == -1); 627Debug.Assert(_items[index] == null); 644Debug.Assert(value != null); 677Debug.Assert( _items[i] != null 695Debug.Assert( _items[value.Index] == value 708Debug.Assert( _items[i + 1] != null 737Debug.Assert(value >= _size);
System\Windows\Controls\ScrollViewer.cs (4)
1317Debug.Assert(!MeasureDirty); 1723Debug.Assert(_panningInfo != null); 1857Debug.Assert(_panningInfo != null); 2386Debug.Assert(DoubleUtil.GreaterThanOrClose(_xSize, 0.0) && DoubleUtil.GreaterThanOrClose(_ySize, 0.0), "Negative size for scrolling viewport. Bad IScrollInfo implementation.");
System\Windows\Controls\SelectedCellsChangedEventArgs.cs (2)
47Debug.Assert(_addedCells.IsReadOnly, "_addedCells should have ended up as read-only."); 48Debug.Assert(_removedCells.IsReadOnly, "_removedCells should have ended up as read-only.");
System\Windows\Controls\SelectedDatesCollection.cs (3)
409Debug.Assert(false); 427Debug.Assert(!_isAddingRange); 433Debug.Assert(_isAddingRange);
System\Windows\Controls\SoundPlayerAction.cs (2)
141Debug.Assert(m_player.IsLoadCompleted); 219Debug.Assert(m_player.IsLoadCompleted);
System\Windows\Controls\Stack.cs (2)
803Debug.Assert(measureElement.IsScrolling); 828Debug.Assert(logicalOffset == 0 || (logicalOffset > 0 && logicalOffset < children.Count));
System\Windows\Controls\TextBlock.cs (27)
1407Debug.Assert(lineCount == LineCount); 1520Debug.Assert(lineCount == LineCount); 1672Debug.Assert(lineCount == LineCount); 1776Debug.Assert(lineCount == LineCount); 1781Debug.Assert(lineIndex < lineCount); 1792Debug.Assert(lineCount == LineCount); 1794Debug.Assert(lineIndex < lineCount); 1820Debug.Assert(lineBounds.Count > 0); 1945Debug.Assert(_complexContent != null, "Inline objects are supported only in complex content."); 1975Debug.Assert(((InlineObject)inlineObjects[index]).Element == inlineObject.Element, "InlineObject cache is out of sync."); 2041Debug.Assert(lineCount == LineCount); 2185Debug.Assert(lineCount == LineCount); 2456Debug.Assert(lineIndex > 0); 2459Debug.Assert(dcp >= 0); 2474Debug.Assert(lineIndex < lineCount - 1); 2584Debug.Assert(lineIndex > 0); 2587Debug.Assert(dcp >= 0); 2944Debug.Assert(sender == _complexContent.TextContainer, "Received text change for foreign TextContainer."); 3396Debug.Assert(IsLayoutDataValid); 3397Debug.Assert(CheckFlags(Flags.RequiresAlignment)); 3415Debug.Assert(lineCount == LineCount); 3426Debug.Assert(DoubleUtil.AreClose(lineHeight, lineMetrics.Height), "Line height is out of sync."); 3589Debug.Assert(lineCount == LineCount); 3626Debug.Assert(e != null); 3629Debug.Assert(_complexContent.TextContainer is TextContainer); 3900Debug.Assert(owner != null); 3901Debug.Assert(textContainer != null);
System\Windows\Controls\TextSearch.cs (5)
293Debug.Assert(!String.IsNullOrEmpty(matchedText), "matchedText cannot be null or empty"); 294Debug.Assert(!String.IsNullOrEmpty(newText), "newText cannot be null or empty"); 295Debug.Assert(matchedText.StartsWith(newText, ignoreCase, cultureInfo), "matchedText should start with newText"); 767Debug.Assert(_attachedTo != null); 782Debug.Assert(_attachedTo != null);
System\Windows\Controls\ToolTip.cs (1)
499Debug.Assert(_parentPopup == null, "_parentPopup should be null");
System\Windows\Controls\VirtualizedCellInfoCollection.cs (30)
23Debug.Assert(owner != null, "owner must not be null."); 36Debug.Assert(owner != null, "owner must not be null."); 86Debug.Assert(IsValidCell(cell), "The cell should be valid."); 87Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items."); 470Debug.Assert(left >= 0, "left must be positive."); 471Debug.Assert(top >= 0, "top must be positive."); 472Debug.Assert(width >= 0, "width must be positive."); 473Debug.Assert(height >= 0, "height must be positive."); 490Debug.Assert(value >= 0, "Value must be positive."); 504Debug.Assert(value >= 0, "Value must be positive."); 518Debug.Assert(value >= _left, "Right must be greater than or equal to Left."); 532Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top."); 546Debug.Assert(value >= 0, "Value must be positive."); 560Debug.Assert(value >= 0, "Value must be positive."); 786Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true."); 818Debug.Assert(left <= right, "left should be less than or equal to right."); 819Debug.Assert(top <= bottom, "top should be less than or equal to bottom."); 829Debug.Assert(rowCount > 0, "rowCount should be greater than 0."); 830Debug.Assert(columnCount > 0, "columnCount should be greater than 0."); 974Debug.Assert(rowIndex >= 0); 1002Debug.Assert(rowIndex >= 0); 1041Debug.Assert(rowIndex >= 0); 1057Debug.Assert(oldIndex >= 0); 1058Debug.Assert(newIndex >= 0); 1147Debug.Assert(columnIndex >= 0); 1190Debug.Assert(columnIndex >= 0); 1229Debug.Assert(columnIndex >= 0); 1248Debug.Assert(oldIndex >= 0); 1249Debug.Assert(newIndex >= 0); 1633Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (78)
401Debug.Assert(!IsPixelBased && IsScrolling && 478Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 606Debug.Assert(IsScrolling, "setting offset on non-scrolling panel"); 797Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation."); 829Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element"); 855Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent"); 886Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport"); 1141Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling"); 1698Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode"); 2388Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most"); 3695Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1); 3849Debug.Assert(info != null, "Expected state from previous measure not found"); 3957Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing"); 4352Debug.Assert(retryCount >=0, "retry MeasureCaches too often"); 4509Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration, 4705Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 4961Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport"); 5019Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner"); 5020Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here."); 5648Debug.Assert(itemIndex < items.Count, "index out of range"); 5748Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing"); 6082Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6098Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 6166Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size"); 6378Debug.Assert(parentItemStorageProvider != null || container != null, 6421Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode"); 6457Debug.Fail("SetInset should only be called for a container"); 6561Debug.Fail($"Unexpected container type: {((container == null) ? "null" : container.GetType().Name)}"); 6602Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here."); 6812Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child"); 7250Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7342Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize."); 7437Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode"); 7443Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7589Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode"); 7595Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false."); 7878Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7879Debug.Assert(item != null, "An item must be available."); 7903Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7904Debug.Assert(item != null, "An item must be available."); 7947Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 7948Debug.Assert(item != null, "An item must be available."); 8005Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available."); 8006Debug.Assert(item != null, "An item must be available."); 8728Debug.Assert(container != null, "Null container was generated"); 8773Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'"); 8898Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container"); 8919Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated"); 8941Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 8951Debug.Assert(child != null, "Null child was generated"); 8952Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace"); 8981Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0."); 9022Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing"); 9023Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost"); 9168Debug.Assert(InRecyclingMode, "This method only applies to recycling mode"); 9187Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling"); 9188Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it"); 9201Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers"); 9207Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!"); 9219Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match"); 9223Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match"); 9253Debug.Fail("We should have found a child"); 9324Debug.Assert(_cleanupDelay != null); 9345Debug.Assert(_cleanupOperation != null); 9369Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization"); 9436Debug.Assert(startIndex >= 0 && count > 0); 9437Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling"); 9583Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 9710Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9711Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 9715Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 9716Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10434Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel."); 10559Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10560Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 10564Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode."); 10565Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode."); 12209Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Controls\WebBrowser.cs (2)
537Debug.Assert(clsid.ToString("D") == CLSID.WebBrowser); 575Debug.Assert(_axIWebBrowser2 != null);
System\Windows\Data\BindingBase.cs (1)
69Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids");
System\Windows\Data\BindingExpression.cs (1)
2117Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\BindingExpressionBase.cs (3)
117Debug.Assert((int)Feature.LastFeatureId <= 32, "UncommonValueTable supports only 32 Ids"); 1683Debug.Assert(RootBindingExpression == this, "Only call this with a root binding"); 2494Debug.Assert((_flags & PrivateFlags.iPropagationMask) != PrivateFlags.iPropDefault,
System\Windows\Data\BindingGroup.cs (3)
1314Debug.Assert(_bindingExpressions.Count == 0, "Unexpected Reset event"); 1318Debug.Fail("Unexpected change event"); 1758Debug.Assert(bindingExpression != null, "do not ask for source value from a [Multi,Priority]Binding");
System\Windows\Data\BindingListCollectionView.cs (5)
582Debug.Assert(_newItemIndex != -2 && newItem == _newItem, "AddNew did not raise expected events"); 609Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 727Debug.Assert(true); 1906Debug.Assert(_newItem == InternalList[index], "unexpected item while committing AddNew"); 1965Debug.Assert(item == InternalList[index], "unexpected item while committing AddNew");
System\Windows\Data\CollectionView.cs (1)
1806Debug.Assert(changeLog != null && changeLog.Count > 0, "don't defer when there's no work");
System\Windows\Data\ListCollectionView.cs (6)
768Debug.Assert(_newItemIndex != -2 && System.Windows.Controls.ItemsControl.EqualsEx(newItem, _newItem), "AddNew did not raise expected events"); 787Debug.Assert(_newItemIndex == -2 && _newItem == NoNewItem, "unexpected call to BeginAddNew"); 1685Debug.Fail("Cannot update collection view from outside UIContext without index in event args"); 2434Debug.Assert(view != null, "lazyGetCollectionView should not return null"); 3113Debug.Assert(list.VerifyLiveSorting(lsi), "live sorting failed"); 3123Debug.Assert(list.VerifyLiveSorting(null), "live sorting not resotred");
System\Windows\Data\MultiBinding.cs (2)
109Debug.Fail("Unexpected BindingMode value"); 132Debug.Fail("Unexpected UpdateSourceTrigger value");
System\Windows\Data\MultiBindingExpression.cs (2)
176Debug.Assert(ParentMultiBinding.Converter != null || !String.IsNullOrEmpty(EffectiveStringFormat), 868Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\ObjectDataProvider.cs (4)
158Debug.Assert((_objectInstance == null) ? (_objectType == null) : (_objectType == _objectInstance.GetType())); 342Debug.Assert(_mode != SourceMode.FromType); 435Debug.Assert(_objectType != null); 505Debug.Assert(_objectType != null);
System\Windows\Data\PriorityBindingExpression.cs (2)
186Debug.Assert(MutableBindingExpressions.Count == 0, "expect to encounter empty BindingExpression collection when attaching MultiBinding"); 440Debug.Assert(NeedsValidation, "check NeedsValidation before calling this");
System\Windows\Data\RelativeSource.cs (3)
170Debug.Assert(_mode == RelativeSourceMode.FindAncestor); 208Debug.Assert((!IsUninitialized) || (_mode == RelativeSourceMode.FindAncestor)); 272Debug.Assert(IsUninitialized);
System\Windows\Data\XmlDataProvider.cs (2)
279Debug.Assert(_domSetDocument == null, "Should not be possible to be using Source and user-set Doc at the same time."); 760Debug.Assert(doc != null);
System\Windows\DataTrigger.cs (1)
187Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1,
System\Windows\DescendentsWalker.cs (1)
93Debug.Assert( false, "Tree walk priority should be Visual first or Logical first - but this instance of DescendentsWalker has an invalid priority setting that's neither of the two." );
System\Windows\Diagnostics\ResourceDictionaryDiagnostics.cs (5)
375Debug.Assert(result.Dictionary == null || result.Dictionary == rd, 416Debug.Assert(Object.Equals(result.Requester, requester), "Reverting a request for the wrong requester"); 425Debug.Assert(result.Dictionary != null, "simple lookup resolved incorrectly"); 452Debug.Assert(cachedDict == result.Dictionary, "conflicting dictionaries for a StaticResource reference"); 460Debug.Assert(cachedDict != null, "no dictionary found for StaticResource reference");
System\Windows\Documents\AdornerLayer.cs (5)
419Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 454Debug.Assert(adornerInfos != null, "No adorners found for element in AdornerLayer._zOrderMap"); 532Debug.Assert(adornerInfo != null, "Adorner should not be null"); 637Debug.Assert(adorner != null); 709Debug.Assert(element != null);
System\Windows\Documents\ChildDocumentBlock.cs (4)
46Debug.Assert(childContainer != null); 53Debug.Assert(docRef != null); 71Debug.Assert(newBlock != null); 123Debug.Assert(ChildContainer.Highlights.GetLayer(typeof(TextSelection)) == null);
System\Windows\Documents\ColumnResizeAdorner.cs (2)
32Debug.Assert(scope != null); 132Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!");
System\Windows\Documents\CompositionAdorner.cs (4)
55Debug.Assert(textView != null && textView.RenderScope != null); 362Debug.Assert(_adornerLayer == null, "Attempt to overwrite existing AdornerLayer!"); 581Debug.Assert(start.CompareTo(startLinePointer) <= 0, "The start pointer is positioned after the composition start line pointer!"); 604Debug.Assert(endLinePointer.CompareTo(textSegment.End) == 0, "The end line pointer is positioned after the composition text range end pointer!");
System\Windows\Documents\DocumentSequence.cs (9)
251Debug.Assert(innerDP != null); 272Debug.Assert(innerDP != null); 552Debug.Assert(docRef != null); 559Debug.Assert(paginator != null); 567Debug.Assert(paginator != null); 1051Debug.Assert(documentSequence != null); 1052Debug.Assert(documentPaginator != null); 1053Debug.Assert(documentPage != null); 1161Debug.Assert(false);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (2)
51Debug.Fail("This method is not implemented and not expected to be called."); 74Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (13)
28Debug.Assert(parent != null); 29Debug.Assert(parent is FixedDocumentSequence); 216Debug.Assert(_start != null); 229Debug.Assert(_end != null); 380Debug.Assert(docRef != null); 434Debug.Fail("should never be here"); 496Debug.Assert(_parent != null); 644Debug.Assert(sender != null); 645Debug.Assert(args != null); 646Debug.Assert(args.Ranges != null); 695Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 989Debug.Assert(parentTextPointer != null); 1012Debug.Assert(parentChangePosition != null);
System\Windows\Documents\DocumentSequenceTextPointer.cs (12)
29Debug.Assert(childBlock != null); 30Debug.Assert(childPosition != null); 48Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 443Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 472Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 492Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 559Debug.Assert(_childTp != null); 887Debug.Assert(direction == LogicalDirection.Backward); 932Debug.Assert(tp != null); 944Debug.Assert(thisTp.ChildBlock.ChildContainer == tp.ChildBlock.ChildContainer); 988Debug.Assert(xGapAwareCompareTo(tp1, tp2) <= 0); 1082Debug.Fail("invalid TextPointerContext");
System\Windows\Documents\FixedDocument.cs (11)
338Debug.Assert(page != null); 654Debug.Assert(IsValidPageIndex(index)); 700Debug.Assert(fp != null); 1030Debug.Assert(sender != null); 1031Debug.Assert(args != null); 1032Debug.Assert(args.Ranges != null); 1035Debug.Assert(args.Ranges.Count > 0 && args.Ranges[0].Start.CompareTo(args.Ranges[0].End) < 0); 1103Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1119Debug.Assert(!highlightTransitionPosition.IsNull, "Highlight start not followed by highlight end!"); 1161Debug.Assert(pageNo >= 0 && pageNo<PageCount); 1350Debug.Assert(panel != null && page != null);
System\Windows\Documents\FixedElement.cs (3)
132Debug.Assert((object)_start == (object)_end); 190Debug.Assert(_object == null && e._type == ElementType.Object); 257Debug.Assert(false);
System\Windows\Documents\FixedFindEngine.cs (13)
34Debug.Assert(start != null); 35Debug.Assert(end != null); 36Debug.Assert( ((start is DocumentSequenceTextPointer) && (end is DocumentSequenceTextPointer)) || 38Debug.Assert(findPattern != null); 47Debug.Assert(paginator != null); 84Debug.Assert(firstSearchPageStart != null); 85Debug.Assert(firstSearchPageEnd != null); 119Debug.Assert(fixedDoc != null); 305Debug.Assert(endAsFTP != null); 325Debug.Assert(startAsFTP != null); 336Debug.Assert(doc != null); 337Debug.Assert(translatedPageNo >= 0 && translatedPageNo < doc.PageCount); 362Debug.Assert(pageStream != null);
System\Windows\Documents\FixedFlowMap.cs (2)
129Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 161Debug.Assert(flowOld.Type == FlowNodeType.Virtual || flowNew != null);
System\Windows\Documents\FixedHighlight.cs (3)
37Debug.Assert(element != null && beginOffset >= 0 && endOffset >= 0); 137Debug.Assert(_gBeginOffset >= 0); 138Debug.Assert(_gEndOffset <= chrct);
System\Windows\Documents\FixedNode.cs (5)
78Debug.Assert(childLevels >= 1); 94Debug.Assert(childPath != null); 132Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 339Debug.Assert(level < _path.Length); 350Debug.Assert(_path.Length >= 2);
System\Windows\Documents\FixedPage.cs (5)
605Debug.Assert(dpo != null, "GetLinkUri shouldn't be called for non-DependencyObjects."); 856Debug.Assert(e != null); 892Debug.Assert(currentLevelIndex >= 0 && currentLevelIndex <= ((Canvas)element).Children.Count); 1023Debug.Assert(currentChildrens != null); 1165Debug.Assert(pageStructure != null);
System\Windows\Documents\FixedPageStructure.cs (13)
34Debug.Assert(pageIndex >= 0); 98Debug.Assert(lineResult != null); 110Debug.Assert(_lineResults != null); 148Debug.Assert(_lineResults != null); 202Debug.Assert(flowStart != null && flowStart.Type != FlowNodeType.Virtual); 203Debug.Assert(flowEnd != null && flowEnd.Type != FlowNodeType.Virtual); 212Debug.Assert(!rect.IsEmpty); 466Debug.Assert(false); 530Debug.Assert(glyphs!= null); 546Debug.Assert(false); 617Debug.Assert(false); 634Debug.Assert(false); 672Debug.Assert(_fixedSOMPageConstructor != null);
System\Windows\Documents\FixedSOMContainer.cs (7)
33Debug.Assert(compared != null); 34Debug.Assert(This != null); 42Debug.Assert(compareHor != SpatialComparison.None); 43Debug.Assert(compareVer != SpatialComparison.None); 98Debug.Assert(false); 105Debug.Assert(false); 219Debug.Assert(container != null);
System\Windows\Documents\FixedSOMFixedBlock.cs (1)
158Debug.Assert(SemanticBoxes[i] is FixedSOMTextRun || SemanticBoxes[i] is FixedSOMImage);
System\Windows\Documents\FixedSOMGroup.cs (5)
35Debug.Assert(compared != null); 46Debug.Assert(compareHor != SpatialComparison.None); 47Debug.Assert(compareVer != SpatialComparison.None); 97Debug.Assert(false); 104Debug.Assert(false);
System\Windows\Documents\FixedSOMImage.cs (1)
67Debug.Assert(path.Fill is ImageBrush);
System\Windows\Documents\FixedSOMLineCollection.cs (2)
53Debug.Assert(point1.X == point2.X); 59Debug.Assert(point1.Y == point2.Y);
System\Windows\Documents\FixedSOMPageConstructor.cs (12)
53Debug.Assert(stroke || fill, "should not be a nop"); 192Debug.Fail("It should not be called"); 221Debug.Assert(fixedPage != null); 237Debug.Assert(_fixedPage != null); 242Debug.Assert(obj != null); 370Debug.Assert(obj is Image || obj is Path); 399Debug.Assert(glyphs != null); 573Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 628Debug.Assert(textRunRect.Height != 0 && fixedBlock.LineHeight != 0); 1006Debug.Assert(false); 1133Debug.Assert(currentPageElement != null); 1143Debug.Assert(nextPageElement != null);
System\Windows\Documents\FixedSOMSemanticBox.cs (3)
90Debug.Assert(o != null); 100Debug.Assert(compareHor != SpatialComparison.None && compareVer != SpatialComparison.None); 296Debug.Assert(false);
System\Windows\Documents\FixedSOMTable.cs (2)
163Debug.Assert(row != null); 179Debug.Assert(row != null);
System\Windows\Documents\FixedSOMTextRun.cs (1)
38Debug.Assert(otherRun != null);
System\Windows\Documents\FixedTextBuilder.cs (24)
180Debug.Assert(!_IsBoundaryPage(pageIndex)); 197Debug.Assert(page != null); 198Debug.Assert(page.IsInitialized); 367Debug.Assert(fn.Type == FlowNodeType.Start); 457Debug.Assert(pStart.CompareTo(pEnd) < 0); 496Debug.Assert(fixes.Length == 1); 572Debug.Assert(flowNode.Type == FlowNodeType.Run); 576Debug.Assert(flowNode.Type == FlowNodeType.Run); 577Debug.Assert(fixes != null); 790Debug.Assert(pathPrefix != null); 813Debug.Assert(prevRun != null); 814Debug.Assert(currentRun != null); 988Debug.Assert(pathPrefix == null); 989Debug.Assert(level1Index >= 0); 999Debug.Assert(newPathPrefix != null); 1005Debug.Assert(pathPrefix == null && newPathPrefix == null); 1069Debug.Assert(false); 1272Debug.Assert(false); 1295Debug.Assert(e is Image); 1392Debug.Assert(elem is FixedPage || elem is Canvas); 1542Debug.Assert(false); 1656Debug.Assert(run.EndIndex - run.StartIndex == run.Text.Length); 1732Debug.Assert(uiElement != null); 1753Debug.Assert(newLineResult != null);
System\Windows\Documents\FixedTextContainer.cs (8)
33Debug.Assert(parent != null && parent is FixedDocument); 185Debug.Assert(_start != null); 198Debug.Assert(_end != null); 376Debug.Assert(res); 392Debug.Assert(highlights != null); 510Debug.Assert(_fixedTextBuilder != null); 519Debug.Assert(_containerElement != null); 601Debug.Assert(start.CompareTo(end) <= 0);
System\Windows\Documents\FixedTextPointer.cs (5)
377Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 380Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 410Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 421Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 671Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FixedTextView.cs (12)
112Debug.Assert(pos != null); 160Debug.Assert(ftp != null); 234Debug.Assert(startPosition != null && this.Contains(startPosition)); 235Debug.Assert(endPosition != null && this.Contains(endPosition)); 401Debug.Assert(pos != null); 459Debug.Assert(false); 850 Debug.Assert(itp != null); 948Debug.Assert(hitGlyphs != null); 1000Debug.Assert(charStart - charCount == 1); 1011Debug.Assert(charEnd - charCount == 1); 1118Debug.Assert(symbolType == TextPointerContext.Text || symbolType == TextPointerContext.EmbeddedElement); 1189Debug.Assert(!textPointer.IsFrozen, "Can't reposition a frozen pointer!");
System\Windows\Documents\FlowNode.cs (2)
50Debug.Assert( (type != FlowNodeType.Run) || ((int)cookie != 0)); 95Debug.Assert(_fp != fn._fp || (_fp == fn._fp) && (_scopeId == fn._scopeId));
System\Windows\Documents\FlowPosition.cs (12)
37Debug.Assert(!FlowNode.IsNull(node)); 126Debug.Assert(flow != null); 173Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 181Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 198Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 239Debug.Assert(type == FlowNodeType.Object || type == FlowNodeType.Noop || type == FlowNodeType.Start || type == FlowNodeType.End); 370Debug.Assert(this._OverlapAwareCompare(pEnd) < 0); 423Debug.Assert(dir == LogicalDirection.Backward); 581Debug.Assert(dir == LogicalDirection.Backward); 631Debug.Assert(dir == LogicalDirection.Backward); 721Debug.Assert(flow != null); 749Debug.Assert(this._flowNode.Equals(flow._flowNode));
System\Windows\Documents\Glyphs.cs (4)
62Debug.Assert(_glyphRunProperties != null); 226Debug.Assert(glyphRunProperties.glyphIndices != null); 250Debug.Assert(0 <= nibble && nibble <= 15); 330Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\HighlightVisual.cs (4)
165Debug.Assert(highlights != null); 236Debug.Assert(bg != null); 242Debug.Assert(highlightGeometry != null); 260Debug.Assert(highlightGeometry != null);
System\Windows\Documents\Hyperlink.cs (1)
560Debug.Assert(targetUri != null);
System\Windows\Documents\ImmComposition.cs (3)
284Debug.Assert(oldSource == null || newSource == null, 292Debug.Assert((oldSource == null) || (oldSource == _source)); 312Debug.Assert(newSource == _source);
System\Windows\Documents\NullTextContainer.cs (3)
178Debug.Assert(_start != null); 191Debug.Assert(_end != null); 251Debug.Fail("Unexpected call to NullTextContainer.set_TextView!");
System\Windows\Documents\NullTextNavigator.cs (14)
44Debug.Assert(position is NullTextPointer || position is NullTextPointer); 60Debug.Assert(position is NullTextPointer || position is NullTextPointer); 193Debug.Assert(distance == 0); 222Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 232Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 244Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 246Debug.Assert(distance == 0, "Single possible position in this empty container"); 256Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 266Debug.Assert(!_isFrozen, "Can't reposition a frozen pointer!"); 268Debug.Fail("No scoping element!"); 276Debug.Fail("NullTextPointer does not expect layout dependent method calls!"); 285Debug.Fail("NullTextPointer does not expect layout dependent method calls!"); 310Debug.Assert(false); // must never call this 318Debug.Assert(false); // must never call this
System\Windows\Documents\PageContentAsyncResult.cs (2)
50Debug.Assert(source == null || source.IsAbsoluteUri); 89get { Debug.Assert(false); return null; }
System\Windows\Documents\RtfToXamlLexer.cs (1)
421Debug.Assert(false);
System\Windows\Documents\RtfToXamlReader.cs (39)
2710Debug.Assert(HasBorder); 5140Debug.Assert(dnRow != null); // Need row 5141Debug.Assert(dnRow != null && !dnRow.IsPending); // Row props attached when row is closed 5142Debug.Assert(dnRow != null && dnRow.FormatState.RowFormat != null); 5571Debug.Assert(Type == DocumentNodeType.dnTable); 5904Debug.Assert(value >= 0); 5905Debug.Assert(!IsPending); 5966Debug.Assert(value == null || !value.IsPending); 6235Debug.Assert(nUnfilledRowIndex != 0); 6327Debug.Assert(nStart + nChild < Count); 6413Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6424Debug.Assert(nStart + nChild < Count); 6442Debug.Assert(nAt + dn.ChildCount <= nEnd); 6443Debug.Assert(!dn.IsTerminated); 6452Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6474Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6485Debug.Assert(nStart + nChild < Count); 6503Debug.Assert(nAt + dn.ChildCount <= nEnd); 6504Debug.Assert(!dn.IsTerminated); 6516Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6541Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6542Debug.Assert(index + nChildCount < Count); 6571Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6613Debug.Assert(EntryAt(i).ClosedParent != null); 6616Debug.Assert(nAt + dn.ChildCount < Count); 6620Debug.Assert(dnPa.IsPending || (nAt > dnPa.Index && nAt <= dnPa.Index + dnPa.ChildCount)); 6638Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTable); 6641Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTableBody); 6644Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnRow); 6647Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnList); 6914Debug.Assert(false); 7091Debug.Assert(_fMain); 7138Debug.Assert(dnPa.LastChildIndex >= nAt + nExcise - 1); 8215Debug.Assert(dn.ChildCount == 0); 8243Debug.Assert(dn.ChildCount == 0); 9878Debug.Assert(nInsertAt >= 0 && nChildren > 0 && nInsertAt + nChildren - 1 < dna.Count); 10972Debug.Assert(dna.Count > 0 && dna.EntryAt(dna.Count - 1).Type == DocumentNodeType.dnParagraph); 11187Debug.Assert(!dnPara.IsTerminated); 11407Debug.Assert(!dnTop.IsTerminated);
System\Windows\Documents\RubberbandSelector.cs (2)
311Debug.Assert(range.first != null && range.second != null); 466Debug.Assert(end >= begin);
System\Windows\Documents\SpellerStatusTable.cs (1)
736Debug.WriteLine($"{i}: {run.Position.TextContainer.Start.GetOffsetToPosition(run.Position)} {runType}");
System\Windows\Documents\Table.cs (2)
412Debug.Assert(table != null); 464Debug.Assert(_currentChildType != ChildrenTypes.BeforeFirst);
System\Windows\Documents\TableCell.cs (1)
386Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableColumn.cs (1)
164Debug.Assert (value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRow.cs (5)
184Debug.Assert(rowSpanVector != null); 211Debug.Assert(i <= firstAvailableIndex); 231Debug.Assert(_spannedCells != null); 241Debug.Assert(_cells.Count <= _formatCellCount); 297Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRowGroup.cs (1)
235Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TextServicesHost.cs (7)
61Debug.Assert(Thread.CurrentThread.GetApartmentState() == ApartmentState.STA, "OnRegisterTextStore must be called on STA thread"); 247Debug.Assert(_registeredtextstorecount > 0, "Overrelease TextStore!"); 265Debug.Assert(CheckAccess(), "OnDispatcherShutdownFinished called on bad thread!"); 266Debug.Assert(!_isDispatcherShutdownFinished, "Was this dispather finished???"); 294Debug.Assert(CheckAccess(), "RegisterTextStore called on bad thread!"); 299Debug.Assert(!_isDispatcherShutdownFinished, "Was this dispather finished?"); 300Debug.Assert(_registeredtextstorecount == 0, "TextStore was registered without ThreadMgr?");
System\Windows\Documents\TextStore.cs (1)
4797Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Documents\TextTreeDumper.cs (21)
49Debug.WriteLine($"<{tree}/>"); 62Debug.WriteLine($"<{tree}/>"); 79Debug.Write($"<{GetFlatPrefix(node)}{node.DebugId}"); 83Debug.Write(">"); 85Debug.WriteLine($"</{GetFlatPrefix(node)}{node.DebugId}>"); 89Debug.WriteLine("/>"); 96Debug.WriteLine($"Offset: {position.GetSymbolOffset()} {position}"); 117Debug.Write("<"); 118Debug.Write(node); 122Debug.WriteLine("/>"); 126Debug.WriteLine(">"); 132Debug.Write($"{indent}C "); 138Debug.Write($"{indent}L "); 144Debug.Write($"{indent}R "); 152Debug.WriteLine($"{indent}</RootNode>"); 156Debug.WriteLine($"{indent}</TextElementNode>"); 160Debug.WriteLine($"{indent}</UnknownNode>"); 170Debug.Write($"<{GetFlatPrefix(node)}{node.DebugId}"); 174Debug.Write(">"); 176Debug.Write($"</{GetFlatPrefix(node)}{node.DebugId}>"); 180Debug.Write("/>");
System\Windows\Documents\XamlToRtfWriter.cs (3)
230Debug.Assert(openLists.Count > 0); 404Debug.Assert(openLists.Count > 0); 435Debug.Assert(openLists.Count > 0);
System\Windows\EventTrigger.cs (1)
305Debug.Assert( eventTrigger._routedEventHandler == null && eventTrigger._source == null);
System\Windows\FrameworkContentElement.cs (7)
627Debug.Assert(entry.Value == DependencyProperty.UnsetValue); 1461Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1462Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1463Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 1476Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1477Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1478Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20);
System\Windows\FrameworkContextData.cs (1)
62Debug.Assert((walkerEntry.Data == data) && (walkerEntry.Walker == walker),
System\Windows\FrameworkElement.cs (19)
1166Debug.Assert(startNode.IsValid || unlinkedParent != null, 1377Debug.Assert(fo.IsValid, 1466Debug.Assert(target != null, "Don't call FindTemplateResource with a null target object"); 1472Debug.Assert(fo.IsValid, "Don't call FindTemplateResource with a target object that is neither a FrameworkElement nor a FrameworkContentElement"); 1910Debug.Assert(entry.Value == DependencyProperty.UnsetValue,"FrameworkElement.GetRawValue should never fall through with a value != DependencyProperty.UnsetValue. We're supposed to return as soon as we found something."); 1922Debug.Assert( IsTemplatedParentAnFE ); 2334Debug.Assert( foTemplatedParent.IsFE ); 2341Debug.Assert(templatedParentTemplate != null , 2529Debug.Assert(fceParent == null, "Nearest framework parent via the visual tree has to be an FE. It cannot be an FCE"); 2599Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2600Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2601Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2614Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2615Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2616Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2973Debug.Assert(fe != null || fce != null); 3015Debug.Assert( feTemplatedParent != null ); 4083Debug.Assert(sourceTransform != null); 4092Debug.Assert(_transform != null);
System\Windows\FrameworkElementFactory.cs (5)
681Debug.Assert( treeNodeFO.IsValid || (treeNodeVisual3D != null), 714Debug.Assert( _frameworkTemplate != null ); 790Debug.Assert( _frameworkTemplate != null ); 1172Debug.Assert(_frameworkTemplate != null, "ContentPresenter is an FE and can only have a FrameworkTemplate"); 1215Debug.Assert(_frameworkTemplate != null, "GridViewRowPresenter is an FE and can only have a FrameworkTemplate");
System\Windows\FrameworkTemplate.cs (7)
57Debug.Assert(templatedParent != null, 432Debug.Assert(!_sealed, "call this method before template is sealed"); 757Debug.Assert(fo.TemplatedParent == templatedParent); 825Debug.Fail("We do not have support for DynamicResource within unshared template content"); 954Debug.Assert(templateReader != null, "PlayXaml returned null"); 1047Debug.Fail("Unknown enum value"); 1126Debug.Assert(!(rootElement is FrameworkElement) ||
System\Windows\Generated\FrameworkContentElement.cs (1)
1159Debug.Assert(value == true,
System\Windows\Generated\FrameworkElement.cs (1)
1196Debug.Assert(value == true,
System\Windows\Input\Command\CommandConverter.cs (2)
806System.Diagnostics.Debug.Assert( propertyInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" ); 809System.Diagnostics.Debug.Assert( fieldInfo == null, "KnownCommand isn't known to CommandConverter.GetKnownCommand" );
System\Windows\Input\KeyboardNavigation.cs (20)
494Debug.Assert(adornedElement != null, "adornedElement should not be null"); 495Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 511Debug.Assert(adornedElement != null, "adornedElement should not be null"); 512Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null"); 513Debug.Assert(contentHostParent != null, "contentHostParent should not be null"); 514Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual"); 515Debug.Assert(focusVisualStyle != null, "focusVisual should not be null"); 977Debug.Assert(currentElement != null, "currentElement should not be null"); 1337Debug.Assert(container != null, "container cannot be null"); 1788Debug.Assert(e != null, "e should not be null"); 1789Debug.Assert(container != null, "container should not be null"); 1867Debug.Assert(e != null, "e cannot be null"); 2081Debug.Assert(container != null, "container should not be null"); 2117Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group"); 2256Debug.Assert(e != null || container != null, "e or container should not be null"); 2635Debug.Assert(sourceElement != null, "sourceElement must not be null"); 2882Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null"); 2887Debug.Assert(container != null, "container cannot be null"); 3099Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1)); 3100Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\ActiveXHost.cs (26)
214Debug.Assert(args.Key.Length > 0, "got an empty access key"); 406Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 411Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 416Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 421Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition"); 425Debug.Fail("bad state"); 457Debug.Fail("how did we ever get into the open state?"); 462Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition"); 467Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition"); 472Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition"); 477Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition"); 481Debug.Fail("bad state"); 505Debug.Assert(hr == NativeMethods.S_OK, $"DoVerb call failed for verb 0x{verb:X}"); 548Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from"); 553Debug.Assert(_axInstance == null, "_axInstance must be null"); 556Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object..."); 571Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 605Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from"); 630Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 647Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from"); 674Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 689Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from"); 702Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from"); 706Debug.Assert(NativeMethods.Succeeded(hr), "Failed in IOleInPlaceObject.UiDeactivate"); 938Debug.Assert(_axInstance != null, "The native control is null"); 985Debug.Fail(e.ToString());
System\Windows\Interop\HwndHost.cs (1)
972Debug.Assert(hwnd != null);
System\Windows\Interop\WindowInteropHelper.cs (2)
70Debug.Assert(_window != null, "Cannot be null since we verify in the constructor"); 75Debug.Assert(_window != null, "Cannot be null since we verify in the constructor");
System\Windows\Localization.cs (1)
115Debug.Assert(property == AttributesProperty);
System\Windows\LogicalTreeHelper.cs (1)
405Debug.Assert(parentFE != null || parentFCE != null, "Either parentFE or parentFCE should be non-null");
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (1)
66Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (5)
1532Debug.Assert(dataByteSize == 1); 1672Debug.Assert(ownerType != null); 1960Debug.Assert(sr != null); 2113Debug.Assert(_context.CurrentFrame.XamlType != null, "BAML Xmlns record is only legal between ElementStart and ElementEnd"); 2584Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
182Debug.Assert(wpfMember.DependencyProperty != null);
System\Windows\Markup\Baml2006\SharedStream.cs (1)
288System.Diagnostics.Debug.Assert(_baseStream != null, "Stream has already been disposed");
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (2)
133Debug.Assert(bamlType != null); 163Debug.Assert(bamlMember != null);
System\Windows\Markup\Baml2006\WpfXamlMember.cs (1)
128Debug.Assert(!IsAttachable && !IsEvent);
System\Windows\Markup\BamlMapTable.cs (21)
61Debug.Assert(null != xamlTypeMapper); 149Debug.Assert(cmp > 0); 255Debug.Assert(type.IsEnum); 260Debug.Assert(ReflectionHelper.IsNullableType(type)); 537Debug.Assert(propType.IsEnum); 548Debug.Assert(ReflectionHelper.IsNullableType(propType)); 606Debug.Assert(-id <= _knownStrings.Length); 611Debug.Assert(id < StringIdMap.Count); 803Debug.Assert(attributeId >= 0, "Known Property Id must be a DependencyProperty."); 842Debug.Assert(memberId < 0); 1004Debug.Assert(assemblyFullName.Length != 0, "empty assembly"); 1078Debug.Assert( 1091Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1102Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || record.AssemblyFullName == AssemblyIdMap[record.AssemblyId].AssemblyFullName); 1256Debug.Assert(TypeIdMap.Count == record.TypeId || record.TypeFullName == TypeIdMap[record.TypeId].TypeFullName); 1271Debug.Assert(ownerTypeName != null); 1272Debug.Assert(attributeName != null); 1457Debug.Assert(GetHashTableData(stringValue) == null, 1492Debug.Assert(targetType != null && memberName != null); 1635Debug.Assert(AttributeIdMap.Count == record.AttributeId || record.Name == AttributeIdMap[record.AttributeId].Name); 1649Debug.Assert(StringIdMap.Count == record.StringId || record.Value == StringIdMap[record.StringId].Value);
System\Windows\Markup\BamlReader.cs (2)
1393Debug.Assert(dictKey != null, "Bad Key record"); 1426Debug.Assert(keyStartRecord != null, "Bad Key Element Start record");
System\Windows\Markup\BamlRecordHelper.cs (1)
130Debug.Fail("Unhandled case in DoesRecordTypeHaveDebugExtension");
System\Windows\Markup\BamlRecordReader.cs (46)
91Debug.Assert(null != bamlStream); 92Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 117Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 226Debug.Assert(!XamlReaderStream.IsWriteComplete, 326Debug.Assert(bamlRecord.RecordType == BamlRecordType.LinePosition); 509Debug.Assert( stackDepth == ReaderContextStack.Count ); 525Debug.Assert(bamlConnectionIdRecord.ConnectionId > 0); 537Debug.Assert(0 == ReaderContextStack.Count); // if not zero we missed an EndElement 621Debug.Assert(false); 710Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType); 792Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType || 997Debug.Assert(_rootElement != null); 1047Debug.Assert(null == ParentContext); 1200Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack"); 1214Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr ); 1215Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP ); 1267Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams); 1297Debug.Assert(parent is DependencyObject); 1416Debug.Assert(param is String); 1459Debug.Assert(paramString != null); 1497Debug.Assert(param != null && paramList == null, "Must have a single param"); 1511Debug.Assert(param == null && paramList != null, "Must have a paramList"); 1885Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 1958Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup"); 2095Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter); 2226Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor"); 2522Debug.Assert(o is DependencyObject); 2696Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace, 2738Debug.Assert(element is DependencyObject); 2971Debug.Assert(!holder.ReadOnly); // this is being checked in XamlReaderHelper, just assert 2996Debug.Assert(arrayExt != null); 3115Debug.Assert (holder.Collection == null); 3434Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null, 3619Debug.Assert(null != CurrentContext && 3679Debug.Assert(false); 3688Debug.Assert(currentTarget is DependencyObject); 3702Debug.Assert(false); // We do not expect to be here after all checks done in propertyType identification above 3764Debug.Assert(genericType != null); 3807Debug.Assert(memberInfo is MethodInfo); 3823Debug.Assert(null != CurrentContext && 3872Debug.Assert(null != CurrentContext && 4225Debug.Assert(!context.CreateUsingTypeConverter, 4875Debug.Assert(contentProperty != null); 4980Debug.Fail("The only remaining option is attached property, which is not allowed in xaml for content properties"); 5723Debug.Assert(_attributeInfo != null); 5818Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (29)
687Debug.Fail("Assembly, Type and Attribute records are not cached, so don't ask for one."); 712Debug.Fail("Unknown RecordType"); 765Debug.Assert(null == _writeCache[(int)record.RecordType]); 855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); } 864Debug.Fail("Must override RecordType"); 902Debug.Assert( value <= 3 && value >= 0 ); 1090Debug.Assert(RecordSize < 0); 1500Debug.Assert(_valuePositionPosition != -1, 1683Debug.Assert(_valuePositionPosition != -1, 2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 2386Debug.Assert(value <= ExtensionIdMask); 2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 2716Debug.Assert(!ValueObjectSet); 2795Debug.Assert (false, "Unknown custom serializer"); 2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); } 3197set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3284set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3433Debug.Assert(_contentSizePosition != -1, 3478set { Debug.Assert(value == -1, "Wrong size set for element record"); } 3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); } 3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was"); 4542Debug.Assert( SerializerTypeId != 0 ); 4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo) 4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlRecordWriter.cs (22)
115Debug.Assert(null != DocumentStartRecord); 133Debug.Assert(null != DocumentStartRecord); 404Debug.Assert(_deferElementDepth == 0); 405Debug.Assert(_deferComplexPropertyDepth == 0); 406Debug.Assert(_staticResourceElementDepth == 0); 407Debug.Assert(_dynamicResourceElementDepth == 0); 408Debug.Assert(_staticResourceRecordList == null); 426Debug.Assert(_staticResourceElementDepth == 0); 463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section"); 782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list"); 864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section"); 875Debug.Assert(_deferElementDepth == 2); 1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1081Debug.Assert(typeValue != null); 1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary"); 1634Debug.Assert(keyIndex == _deferKeys.Count, 1657Debug.Assert(_deferElementDepth > 0 && CollectingValues, 1665Debug.Assert(valueDeferRecord.Record != null && 1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\BamlVersionHeader.cs (3)
71Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize, 102Debug.Assert(length == BamlVersionHeader.BinarySerializationSize, 107Debug.Assert((posEnd-posStart) == BamlVersionHeader.BinarySerializationSize,
System\Windows\Markup\BamlWriter.cs (6)
116Debug.Assert(null != assemblyName,"assembly name returned from GetBaseElement is null"); 117Debug.Assert(null != typeFullName,"Type name returned from GetBaseElement is null"); 384Debug.Assert(typeValue != null); 1273Debug.Assert(stackNode != null); 1281Debug.Assert(stackNode != null); 1289Debug.Assert(stackNode != null);
System\Windows\Markup\Localizer\BamlLocalizableResource.cs (1)
56Debug.Assert(other != null);
System\Windows\Markup\MarkupExtensionParser.cs (3)
1181Debug.Assert(sb.Length > 0); 1182Debug.Assert(!Char.IsWhiteSpace(sb[0])); 1539Debug.Assert(null != info, "No property or method info for field Name");
System\Windows\Markup\ParserContext.cs (1)
759Debug.Assert(canDecrement);
System\Windows\Markup\Primitives\ElementMarkupObject.cs (8)
40Debug.Assert(instance != null); 716Debug.Assert(obj != null); 740Debug.Assert(descriptor != null); 789Debug.Assert(DO != null); 931Debug.Assert(typeSerializer != null, "typeSerializer for Enum was null"); 991Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context), 1001Debug.WriteLine("ElementMarkupObject.Items is not implemented"); 1016Debug.Assert(serializer != null && serializer.CanConvertToString(_object.Instance, _object.Context),
System\Windows\Markup\Primitives\ExtensionSimplifierMarkupObject.cs (3)
302Debug.Fail("No items where found and IsComposite return true"); 313Debug.Assert(typeSerializer != null, "Could not retrieve typeSerializer for Type"); 348Debug.Assert(!propertyWritten, "An argument was returned after a property was set. All arguments must be returned first and in order");
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (2)
23Debug.Assert(factory != null); 194Debug.Fail("Unexpected property value type");
System\Windows\Markup\Primitives\MarkupWriter.cs (9)
254Debug.Assert( (object)key != null); 438Debug.Assert(item != null && _writer != null); 503Debug.Assert(!noOtherPropertiesAllowed || property.IsKey, 523Debug.Assert(first, "Problem with MarkupObject implemenation: Items returning a ValueAsString can have no other properties"); 539Debug.Assert(dependencyProperty != null, "Problem with MarkupObject implementation: If PropertyDescriptor is null one of the following needs to be true; IsKey, IsValueAsString, IsConstructorArgument, or DependencyProperty is not null"); 686Debug.Assert(!property.IsValueAsString, "Problem with MarkupObject implementation: String values cannnot be composite"); 828Debug.Assert(property.PropertyDescriptor != null); 1032Debug.Assert(property.Value != null); 1361Debug.Assert( ((bool)_xmlnsSpacePreserve) == _containingScope.XmlnsSpacePreserve ,
System\Windows\Markup\StyleModeStack.cs (2)
46Debug.Assert(Depth >= 0, $"StyleModeStack's depth was {Depth}, should be >= 0"); 63Debug.Assert(Depth >= 0, $"StyleMode::Pop() with depth of {Depth}, should be >= 0");
System\Windows\Markup\WpfXamlLoader.cs (2)
316System.Diagnostics.Debug.Assert(count == 0, "Mismatch StartMember/EndMember"); 383System.Diagnostics.Debug.Assert(xamlReader.Value is string, "XmlAttributeProperties.XmlSpaceProperty has the type string.");
System\Windows\Markup\XamlFigureLengthSerializer.cs (1)
237Debug.Assert( unit == FigureUnitType.Pixel
System\Windows\Markup\XamlGridLengthSerializer.cs (1)
237Debug.Assert( unit == GridUnitType.Pixel
System\Windows\Markup\XamlReader.cs (1)
1112Debug.Assert(parent == null || root == parent);
System\Windows\Markup\XamlStream.cs (14)
74Debug.Assert(!WriteComplete,"Write called after close"); 76Debug.Assert(null != buffer,"Null buffer past to the Writer"); 88Debug.Assert(null != writeBuffer,"Null writeBuffer returned"); 108Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer"); 113Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer"); 179Debug.Assert(!WriteComplete,"UpdateReaderLength called after close"); 224Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 244Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer"); 249Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer"); 372Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer"); 377Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer"); 378Debug.Assert(!reader, "Allocating a buffer on Read"); 783Debug.Fail("Close called on ReaderStream"); 791Debug.Fail("Flush called on ReaderStream");
System\Windows\Markup\XamlTypeMapper.cs (33)
543Debug.WriteLine($"Reflected for type converter on {propType.Name}.{propName}"); 816Debug.Assert(null != attribInfo, "null attribInfo"); 817Debug.Assert(null != currentParentType, "null currentParentType"); 856Debug.Assert(propertyOwnerType != null); 885Debug.Assert(attachedPropertyInfo.IsPublic || 935Debug.Assert(null != localName, "null localName"); 936Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1587Debug.Assert(null != eventName, "null eventName"); 1588Debug.Assert(null != owner, "null owner"); 1632Debug.Assert(null != localName, "null localName"); 1633Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1670Debug.Assert(null != baseType, "baseType not set"); 1763Debug.Assert(null != localName, "null localName"); 1764Debug.Assert(null != xmlNamespace, "null xmlNamespace"); 1906Debug.Assert(typeInfo != null, "Must have cached type info at this point"); 2123Debug.Assert( propertyMember is DependencyProperty); 2304Debug.Assert(memberName != null); 2307Debug.Assert(memberInfo != null); 2322Debug.Assert(targetType != null); 2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2399Debug.Assert(null != localName,"null value passed for localName"); 2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace"); 2438Debug.Assert(null != localName,"null value passed for localName"); 2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace"); 2591Debug.Assert(localName != null,"Null localName"); 3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType"); 3471Debug.Assert(null != type, "Null passed for type to GetTypeConverter"); 3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType"); 3559Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter"); 3678Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched"); 3744Debug.Assert(null != type, "null value for type passed to GetWhitespace"); 3756Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute"); 4006Debug.Assert(_dpLookupHashtable != null,
System\Windows\Markup\XmlnsDictionary.cs (1)
708Debug.Assert(prefix != null);
System\Windows\Media\Animation\BeginStoryboard.cs (3)
176Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 185Debug.Assert( frameworkTemplate != null ); 195Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\ControllableStoryboardAction.cs (4)
59Debug.Assert( fe != null || fce != null, "Caller of internal function failed to verify that we have a FE or FCE - we have neither." ); 60Debug.Assert( targetStyle != null || frameworkTemplate != null, 70Debug.Assert( frameworkTemplate != null ); 79Debug.Assert( fe != null, "Invoke needs an object as starting point");
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (2)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 305Debug.Fail("Unknown animation type.");
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (7)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 342Debug.Assert(maxKeyFrameIndex >= 0, "maxKeyFrameIndex is less than zero which means we don't actually have any key frames."); 623Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrameValue"); 630Debug.Assert(_areKeyTimesValid, "The key frames must be resolved and sorted before calling GetResolvedKeyFrame"); 680Debug.Assert(!_areKeyTimesValid, "KeyFrameThicknessAnimaton.ResolveKeyTimes() shouldn't be called if the key times are already valid."); 824Debug.Assert(index < keyFrameCount, 900Debug.Assert(_keyFrames != null && _keyFrames.Count > 2,
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\PauseStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\RemoveStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\ResumeStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SeekStoryboard.cs (1)
91Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SetStoryboardSpeedRatio.cs (1)
49Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\SkipStoryboardToFill.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\StopStoryboard.cs (1)
25Debug.Assert( containingFE != null || containingFCE != null,
System\Windows\Media\Animation\Storyboard.cs (9)
264Debug.Assert( nameScope == null ); 574Debug.Assert( mappedObject == null || mappedObject is AnimationClock || mappedObject is List<AnimationClock>, 615Debug.Assert( value is AnimationClock || value is List<AnimationClock> , 689Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a null object." ); 744Debug.Assert( i > 0, "The caller should not have set the PropertyPath context to a non DependencyObject." ); 809Debug.Assert(path.Length > 1, "This method shouldn't even be called for a simple property path."); 859Debug.Assert(targetPropertyValue is Freezable, "We shouldn't be trying to clone a type we don't understand. PropertyCloningRequired() has improperly flagged the current value as 'need to clone'."); 979Debug.Assert(cacheEntry.Source != DependencyProperty.UnsetValue, 2092Debug.Assert( target != null && clone != null && property != null && original != null,
System\Windows\MultiTrigger.cs (1)
127Debug.Assert( TriggerConditions[i].SourceChildIndex == 0,
System\Windows\Navigation\Journal.cs (13)
248Debug.Assert(ValidateIndexes()); 258Debug.Assert(ValidateIndexes()); 271Debug.Assert(journalEntry.ContentId != 0); 272Debug.Assert(!(journalEntry.IsAlive() && journalEntry.JEGroupState.JournalDataStreams != null), 302Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 321Debug.Assert(ValidateIndexes()); 415Debug.Assert(IsNavigable(target), "target must be navigable"); 416Debug.Assert(ValidateIndexes()); 464Debug.Assert(je.GetType().IsSerializable); 478Debug.Assert(index < TotalCount && index >= 0, "Invalid index passed to RemoveEntryInternal"); 479Debug.Assert(_uncommittedCurrentIndex == _currentEntryIndex, 483Debug.Assert(theEntry != null, "Journal list state is messed up"); 563Debug.Assert(ValidateIndexes());
System\Windows\Navigation\JournalEntry.cs (3)
261Debug.Assert(!_jeGroupState.JournalDataStreams.HasAnyData, 277Debug.Assert(_jeGroupState.JournalDataStreams == null); 294Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
System\Windows\Navigation\NavigationService.cs (46)
80Debug.Assert(_navigateQueueItem == null || !_navigateQueueItem.IsPosted); 89Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs"); 102Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject"); 250Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree"); 256Debug.Assert(IsConsistent(navInfo)); 288Debug.Assert(navMode != NavigationMode.Refresh); // because of !IsSameUri() above 309Debug.Assert(_navStatus == NavigationStatus.Navigating); 454Debug.Assert(!(_bp is Visual)); 587Debug.Assert(_parentNavigationService == newParent); 624Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist"); 684Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement"); 857Debug.Assert(_navigateQueueItem == null && _navStatus == NavigationStatus.Navigated); 881Debug.Assert(finishingChildPageFunction == null || 900Debug.Assert(finishingChildPageFunction._Return == null); 931Debug.Assert(pfReturnInfo == null); 937Debug.Assert(pf.ParentPageFunctionId != Guid.Empty); 976Debug.Assert(IsConsistent(navInfo)); 1001Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1005Debug.Assert(_navigateQueueItem == null); 1114Debug.Assert(bpu == null || 1144Debug.Assert(navMode == NavigationMode.Refresh, 1162Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1179Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 1182Debug.Assert(_contentId != 0); 1186Debug.Assert(_journalEntryGroupState == null || 1906Debug.Assert(PendingNavigationList.Count == 0, 2016Debug.Assert(this.Application != null && 2067Debug.Assert(navigateInfo.IsConsistent); 2068Debug.Assert(source == null || 2118Debug.Assert(PendingNavigationList.Count == 0, 2128Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now."); 2208Debug.Assert(_navStatus == NavigationStatus.Navigated); 2542Debug.Assert(sender == _bp); 3022Debug.Assert(IsConsistent(navigateInfo)); 3049Debug.Assert(navigationMode == NavigationMode.New || 3054Debug.Assert(destinationJournalEntry == null 3133Debug.Assert(_contentId != 0 && 3627Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction() 3656Debug.Assert(_navigateQueueItem == null, 3731Debug.Assert(parentPF._Return == null); 3833Debug.Assert(parentEntryIndex < journal.CurrentIndex); 3838Debug.Fail("Could not find the finishing PageFunction in the journal."); 3895Debug.Fail($"Unhandled scenario: PageFunction returning to {parentEntry.GetType().Name}"); 4338Debug.Assert(_postedOp == null); 4426Debug.Assert(child != null); 4449Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\Navigation\NavigationWindow.cs (10)
211Debug.Assert(_navigationService == null && _JNS == null); 303Debug.Assert(_JNS != null); 996Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1003Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1011Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1018Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1026Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1033Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1040Debug.Assert(nw != null, "sender must be of type NavigationWindow."); 1052Debug.Assert(nw != null, "sender must be of type NavigationWindow.");
System\Windows\Navigation\PageFunction.cs (2)
268Debug.Assert((returnEventArgs == null) || (ra != null)); 272Debug.Assert(eh != null);
System\Windows\PropertyPath.cs (1)
431Debug.Assert(aryIPI.Length > 0);
System\Windows\ResourceDictionary.cs (16)
190Debug.Assert(classicResourceUri != null); 204Debug.Assert(genericResourceUri != null); 543Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1013Debug.Assert(!IsInitialized, "Dictionary should not be initialized when EndInit is called"); 1074Debug.Assert(_numDefer > 0, "The stream was closed before all deferred content was loaded."); 1145Debug.Assert(deferrableContent.Stream != null); 1146Debug.Assert(deferrableContent.SchemaContext != null); 1147Debug.Assert(deferrableContent.ObjectWriterFactory != null); 1148Debug.Assert(deferrableContent.ServiceProvider != null); 1149Debug.Assert(deferrableContent.RootObject != null); 1328Debug.Assert(staticResources != null && staticResources.Count > 0); 1347Debug.Assert(keyValue != null, "Didn't find the ResourceKey property or x:PositionalParameters directive"); 1351Debug.Fail("StaticResources[] entry is not a StaticResource not OptimizedStaticResource"); 1366Debug.Assert(obj is DeferredResourceReference); 1778Debug.Assert(resourceKey != null, "ResourceKey cannot be null"); 2324Debug.Assert(IsThemeDictionary || _ownerApps != null || IsReadOnly, "This must be an App/Theme/Style/Template ResourceDictionary");
System\Windows\ResourceDictionaryCollection.cs (1)
14Debug.Assert(owner != null, "ResourceDictionaryCollection's owner cannot be null");
System\Windows\ResourceReferenceExpression.cs (2)
103Debug.Assert(_targetObject == d, "TargetObject that this expression is attached to must be the same as the one on which its value is being queried"); 547Debug.Assert(!_resource.IsFrozen);
System\Windows\ResourcesChangeInfo.cs (1)
233Debug.Assert(_oldDictionaries != null || _newDictionaries != null || _key != null, "Must have a dictionary or a key that has changed");
System\Windows\Shapes\Shape.cs (5)
628Debug.Assert(mode != Stretch.None); 650Debug.Assert(mode == Stretch.UniformToFill); 682Debug.Assert(geometry != null); 722Debug.Assert(geometry != null); 733Debug.Assert(_renderedGeometry != null);
System\Windows\Shell\JumpList.cs (12)
445Debug.Assert(_initializing == false); 676Debug.Assert(removedList != null); 677Debug.Assert(shellObject != null); 751Debug.Assert(false); 757Debug.Assert(shellObjects != null); 794Debug.Assert(jumpItems.Count != 0); 795Debug.Assert(cdl != null); 850Debug.Assert(jumpItems.Count != linksOnlyList.Count); 856Debug.Assert(HRESULT.DESTS_E_NO_MATCHING_ASSOC_HANDLER != hr); 872Debug.Assert(jumpTask != null); 985Debug.Assert(jumpPath != null); 1055Debug.Assert(false);
System\Windows\Shell\ThumbButtonInfo.cs (1)
277Debug.Assert(command != null);
System\Windows\StaticResourceExtension.cs (1)
241Debug.Assert(ambientList != null, "IAmbientProvider.GetAllAmbientValues no longer returns List<>, please copy the list");
System\Windows\Style.cs (3)
341Debug.Assert(resourceKey != null, "Argument cannot be null"); 620Debug.Assert(setterBase != null, "Setter collection must contain non-null instances of SetterBase"); 649Debug.Assert(setterBase is EventSetter,
System\Windows\StyleHelper.cs (99)
54Debug.Assert(fe != null || fce != null); 93Debug.Assert(fe != null || fce != null); 157Debug.Assert((fe != null && fce == null)|| (fe == null && fce != null)); 347Debug.Assert(frameworkTemplate != null ); 364Debug.Assert( !frameworkTemplate.HasXamlNodeContent ); 368Debug.Assert(frameworkTemplate != null); 403Debug.Assert( frameworkTemplate != null ); 704Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now"); 762Debug.Assert(childIndex >= 0); 1122Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point."); 1276Debug.Assert( childIndex != 0 ); // This should go to the other AddDelegateToFireTrigger overload 1334Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1366Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1367Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1368Debug.Assert(newStyle != null || newFrameworkTemplate != null ); 1430Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1431Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1432Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1491Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!"); 1492Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!"); 1595Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now."); 1622Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time."); 1666Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1684Debug.Assert(dataField == ThemeStyleDataField); 1766Debug.Assert(frameworkTemplate != null ); 1807Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1855Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement, 1883Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree, 1891Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means"); 1903Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion, 1908Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1943Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion, 1945Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot, 1966Debug.Assert( null == VisualTreeHelper.GetParent(child), 2040Debug.Assert(frameworkTemplate != null ); 2054Debug.Assert( feWalkNode != null || fceWalkNode != null, 2127Debug.Assert(feContainer != null || fceContainer != null, 2146Debug.Assert(templatedChildren.Count > 0, 2175Debug.Assert(feContainer != null || fceContainer != null); 2210Debug.Assert(oldFrameworkTemplate != null ); 2259Debug.Assert( oldFrameworkTemplate != null ); 2387Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2442Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement, 2473Debug.Assert( feTemplatedParent != null ); 2476Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner"); 2497Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 2509Debug.Assert( frameworkTemplate != null ); 2521Debug.Assert(action.ContainingTrigger is EventTrigger, 2612Debug.Assert(child.IsValid, "child should either be an FE or an FCE"); 2878Debug.Assert(dataField == ThemeStyleDataField); 2964Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set"); 3017Debug.Assert(frameworkTemplate != null ); 3031Debug.Assert(frameworkTemplate != null ); 3066Debug.Assert(!StyleHelper.IsSetOnContainer(conditions[j].Property, ref containerDependents, true), 3142Debug.Assert(fe != null || fce != null); 3224Debug.Assert(fe != null || fce != null); 3296Debug.Assert(feContainer != null); 3305Debug.Assert(feContainer != null); 3345Debug.Assert(feContainer != null); 3368Debug.Assert(feContainer != null); 3396Debug.Assert(feContainer != null); 3440Debug.Assert(fe != null || fce != null); 3441Debug.Assert(container == fe || container == fce); 3481Debug.Assert(fe != null || fce != null); 3482Debug.Assert(container == fe || container == fce); 3483Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate, 3485Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate, 3487Debug.Assert( (oldTemplate == null || newTemplate == null ) || 3895Debug.Assert(sourceType == ValueLookupType.Simple || 3925Debug.Assert(sourceType == ValueLookupType.Trigger || 3979Debug.Assert(sourceType == ValueLookupType.Simple || 4079Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created"); 4189Debug.Assert(child.FE != null || child.FCE != null); 4208Debug.Assert(dp != null, "dp must not be null"); 4298Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4340Debug.Assert(candidateTrigger is List<TriggerBase>, 4369Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4440Debug.Assert( triggerBase is MultiDataTrigger, 4476Debug.Assert( triggerBase is MultiTrigger, 4540Debug.Assert( ft != null ); 4819Debug.Assert(!(action.ContainingTrigger is EventTrigger), 4835Debug.Assert( trigger.Property == changedProperty, 4842Debug.Assert( frameworkTemplate != null, 4850Debug.Assert( conditions != null && conditions.Length == 1, 4880Debug.Assert( conditions != null && conditions.Length == 1, 4913Debug.Assert( frameworkTemplate != null, 4924Debug.Assert(evaluationNode != null, 4986Debug.Assert( evaluationBinding != null, 5051Debug.Assert( existing is List<TriggerBase>, 5097Debug.Assert( existing is List<TriggerBase>, 5270Debug.Assert(candidateTrigger is List<TriggerBase>, 5302Debug.Assert(frameworkTemplate != null ); 5309Debug.Assert(frameworkTemplate != null); 5333Debug.Assert(frameworkTemplate != null); 5378Debug.Assert(frameworkTemplate != null ); 5383Debug.Assert(frameworkTemplate != null); 5436Debug.Assert( 5546Debug.Assert(routedEvent != null); 5800Debug.Fail("GetHashCode for value types will use reflection to generate the hashcode. Write a better hash code generation algorithm if this struct is to be used in a hashtable, or remove this assert if it's decided that reflection is OK.");
System\Windows\SystemResourceKey.cs (1)
1956Debug.Assert(((SystemResourceKeyID.InternalSystemColorsStart < id) && (id < SystemResourceKeyID.InternalSystemColorsEnd)) ||
System\Windows\SystemResources.cs (9)
350Debug.Assert(typeKey != null || resourceKey != null, "typeKey or resourceKey should be non-null"); 1088Debug.Assert(_hwndNotify != null); 1089Debug.Assert(_hwndNotifyHook != null); 1090Debug.Assert(callerName.Equals(nameof(EnsureResourceChangeListener), StringComparison.InvariantCulture)); 1118Debug.Assert(!_hwndNotify.ContainsKey(hwndDpiInfo)); 1119Debug.Assert(hwndDpiInfo.DpiAwarenessContextValue == dpiContextValue); 1156Debug.Assert(dpiContextValue == DpiAwarenessContextValue.Unaware || dpiContextValue == DpiAwarenessContextValue.SystemAware); 1547Debug.Assert(hwndDpiInfo != null); 1800Debug.Assert(_inflatedList != null);
System\Windows\SystemThemeKey.cs (1)
26Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart &&
System\Windows\TemplateContent.cs (12)
39Debug.Assert(_xamlType == null); 232Debug.Assert(TemplateLoadData.Reader != null); 320Debug.Assert(childIndex == lastIndex); 577Debug.Assert(iReader != null, "Template's Reader is not a Indexing Reader"); 608Debug.Assert(sharedValue != null); 748Debug.Assert(xamlReader.NodeType == Xaml.XamlNodeType.StartObject); 749Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 771Debug.Assert(resource != null); 794Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartMember); 889Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartObject); 1147Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.EndMember); 1226Debug.Assert(templateChildName != null);
System\Windows\TemplateNameScope.cs (4)
50Debug.Assert(templatedParent == null || (templatedParent is FrameworkElement || templatedParent is FrameworkContentElement), 161Debug.Assert(_affectedChildren.Count == childIndex); 198Debug.Fail("Should never be trying to unregister via this interface for templates"); 211Debug.Assert(fo.IsFE);
System\Windows\ThemeDictionaryExtension.cs (2)
187Debug.Assert(dictionary != null, "dictionary should not be null"); 188Debug.Assert(assemblyName != null, "assemblyName should not be null");
System\Windows\TreeChangeInfo.cs (2)
52Debug.Assert(d != null, "Must have non-null current node"); 111Debug.Assert(!inheritableProperties.Contains(dp), "EffectiveValues cache must not contains duplicate entries for the same DP");
System\Windows\TreeWalkHelper.cs (14)
39Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE."); 40Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from."); 241Debug.Assert(fe != null || fce != null, "Must have non-null current node"); 264Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone"); 281Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates"); 316Debug.Assert(d != null, "Must have non-null current node"); 319Debug.Assert(fMetadata.IsInherited, "This must be an inherited dependency property"); 322Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false"); 453Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE."); 522Debug.Assert(d != null, "Must have non-null current node"); 684Debug.Assert(d != null, "Must have non-null current node"); 747Debug.Assert(d != null, "Must have non-null current node"); 909Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE."); 941Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Trigger.cs (2)
232Debug.Assert( TriggerConditions != null && TriggerConditions.Length == 1, 235Debug.Assert( TriggerConditions[0].SourceChildIndex == 0,
System\Windows\TriggerActionCollection.cs (1)
279Debug.Assert (Owner == null);
System\Windows\TriggerBase.cs (1)
366Debug.Assert( false,
System\Windows\TriggerCollection.cs (1)
104Debug.Assert (Owner == null);
System\Windows\Window.cs (57)
336Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows"); 714Debug.Assert(false); 1359Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when _showingAsDialog is true"); 2288Debug.Assert( _swh != null ); 2297Debug.Assert( _swh != null ); 3010Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function"); 3237Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here"); 3570Debug.Assert(w != null, "Target must be of type Window."); 3593Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3616Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 3753Debug.Assert(!IsSourceWindowNull, "_swh should not be null here"); 3870Debug.Assert(hMonitor != IntPtr.Zero); 3903Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative")); 3904Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative")); 3914Debug.Assert(!IsSourceWindowNull, "_swh should not be null here"); 4043Debug.Fail("Invalid value for ResizeMode"); 4418Debug.Assert(_showingAsDialog, "_showingAsDialog must be true when DoDialogHide is called"); 4456Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point"); 4497Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone"); 5055Debug.Assert(w != null, "DependencyObject must be of type Window."); 5081Debug.Assert(w != null, "DependencyObject must be of type Window."); 5100Debug.Assert(w != null, "DependencyObject must be of type Window."); 5160Debug.Assert(w != null, "DependencyObject must be of type Window."); 5287Debug.Assert(w != null, "DependencyObject must be of type Window."); 5307Debug.Assert(w != null, "DependencyObject must be of type Window."); 5568Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here"); 5627Debug.Assert(w != null, "DependencyObject must be of type Window."); 5638Debug.Assert(w != null, "DependencyObject must be of type Window."); 5698Debug.Assert(w != null, "d must be typeof Window"); 5721Debug.Assert(w != null, "d must be typeof Window"); 5760Debug.Assert(w != null, "d must be typeof Window"); 5798Debug.Assert(w != null, "d must be typeof Window"); 5819Debug.Assert(w != null, "d must be typeof Window"); 5860Debug.Assert(w != null, "d must be typeof Window"); 5954Debug.Fail($"specifiedRestoreBounds can't be {specifiedRestoreBounds}"); 6090Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6165Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6222Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function"); 6244Debug.Assert( w != null, "DependencyObject must be of type Window." ); 6276Debug.Assert(w != null, "DependencyObject must be of type Window."); 6463Debug.Assert(0 != (int)_overlaySize.Width); 6464Debug.Assert(0 != (int)_overlaySize.Height); 6507Debug.Assert(null != _taskbarList); 6533Debug.Assert(false); 6552Debug.Assert(null != _taskbarList); 6566Debug.Assert(0 <= taskbarInfo.ProgressValue && taskbarInfo.ProgressValue <= 1); 6574Debug.Assert(null != _taskbarList); 6599Debug.Assert(null != _taskbarList); 6670Debug.Assert(null != _taskbarList); 6698Debug.Assert(null != _taskbarList); 7129Debug.Assert( _swh != null ); 7347Debug.Assert( sourceWindow != null ); 7430Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true here"); 7521Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" ); 7531Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" ); 7556Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here"); 7575Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here");
System\Windows\WindowCollection.cs (1)
39Debug.Assert(count >= 0, "count must not be less than zero");
PresentationFramework.Aero (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Aero2 (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.AeroLite (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Classic (22)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
231Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1."); 232Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1."); 233Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1."); 295Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1."); 296Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1."); 297Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1."); 299Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined."); 311Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1."); 312Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1."); 337Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1."); 338Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1."); 339Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1."); 346Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1."); 347Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1."); 348Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive)."); 1154Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1"); 1167Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1"); 1180Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Luna (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationFramework.Royale (4)
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\DataGridHeaderBorder.cs (3)
329Debug.Assert(_freezableCache.Count == size, "The cache size does not match the requested amount."); 356Debug.Assert((freezable == null) || freezable.IsFrozen, "Cached Freezables should have been frozen."); 366Debug.Assert(freezable.IsFrozen, "Cached Freezables should be frozen.");
src\wpf\src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
27Debug.Assert(_platformCulture != null);
PresentationUI (5)
MS\Internal\Documents\Application\DocumentProperties.cs (1)
220System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentApplicationDocumentViewer.cs (1)
48System.Diagnostics.Debug.Assert(
MS\Internal\Documents\DocumentSignatureManager.cs (1)
822System.Diagnostics.Debug.Assert(
MS\Internal\Documents\RightsManagementManager.cs (1)
69System.Diagnostics.Debug.Assert(
MS\Internal\Documents\SignatureSummaryDialog.cs (1)
758Debug.Assert(item._displayImage != null, "Signature icon is null");
ReachFramework (123)
AlphaFlattener\BrushProxy.cs (55)
163Debug.Assert(pen != null, "pen expected"); 164Debug.Assert(brush != null, "brush expected"); 187Debug.Assert(_brush.BrushList == null, "Simple brush expected"); 269Debug.Assert(pen != null, "pen expected"); 270Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 302Debug.Assert(pen != null, "pen expected"); 303Debug.Assert(pen.Brush != null, "pen expected to have a brush"); 540Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list"); 668Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive"); 675Debug.Fail("IsOpaque(" + _brush.GetType() + ") not handled"); 735Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible"); 771Debug.Fail("IsTransparent not handled " + _brush.GetType()); 1075Debug.Fail("Unexpected brush type"); 1191Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1223Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1248Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled"); 1314Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null"); 1383Debug.Assert(!_bounds.IsEmpty); 1391Debug.Assert(_brushList != null && _bounds.IsEmpty); 1730Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1731Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1933Debug.Fail("Unhandled GradientBrush type"); 1986Debug.Assert(g.GradientStops != null); 2041Debug.Assert(g.GradientStops.Count > 0); 2130Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected"); 2131Debug.Assert(!b._opacityOnly, "OpacityMask not expected"); 2143Debug.Assert(first, "prefix only"); 2371Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush"); 2648Debug.Assert(brush != null, "null brush"); 2691Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush"); 2699Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy"); 2885Debug.Fail("Unhandled GradientBrush type"); 2910Debug.Fail("Unandled Brush type"); 2940Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops"); 2981Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush"); 3059Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush"); 3199Debug.Fail("Unhandled ImageBrush.ImageSource type"); 3254Debug.Assert(brushB.Brush != null, "null brush not expected"); 3341Debug.Fail("Brush type not expected"); 3366Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized"); 3494Debug.Fail("Unexpected brush type"); 3614Debug.Fail("Single brush expected"); 3639Debug.Assert( 3706Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 3780Debug.Assert(false); // Optimization is needed before reaching here 3786Debug.Assert(false); // Optimization is needed before reaching here 3791Debug.Assert(steps > 0); 3831Debug.Assert((i >= 0) && (i < steps)); 3845Debug.Assert(false); 3942Debug.Assert(di >= 0); 4044Debug.Assert(_left <= left); 4045Debug.Assert(_right >= right); 4175Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid"); 4271Debug.Assert(_left <= left); 4272Debug.Assert(_right >= right);
AlphaFlattener\DrawingContext.cs (13)
251Debug.Assert(b != null, "LinearGradientBrush expected"); 374Debug.Assert(b != null, "RadialGradientBrush expected"); 476Debug.Assert(one != null); 495Debug.Assert(one.BrushList.Count == 2, "Only two brushes allowed here"); 548Debug.WriteLine("FillGeometry not implemented " + one + " " + two); 597Debug.Assert(brush != null, "brush expected"); 598Debug.Assert(shape != null, "shape expected"); 599Debug.Assert(!_costing, "in costing mode DrawImage"); 682Debug.Fail("Opacity invalid at BrushProxyDecomposer"); 687Debug.Fail("Opacity invalid at BrushProxyDecomposer"); 692Debug.Assert(brushTrans.IsIdentity, "brushTrans not supported"); 721Debug.Assert(pen == null, "no pen"); 929Debug.Assert(!_costing, "in costing mode DrawyGlyphs");
AlphaFlattener\Flattener.cs (2)
86Debug.Assert(Utility.IsValid(opacity) && Utility.IsValid(tree.Opacity), "Invalid opacity encountered, should've been normalized in conversion to Primitive"); 1171Debug.Fail("Wrong Primitive type");
AlphaFlattener\ImageProxy.cs (4)
55Debug.Assert(image != null); 127Debug.Assert( 169Debug.Assert(opacityBrush.ViewportUnits == BrushMappingMode.Absolute, "TileBrush must have absolute viewport by this point"); 297Debug.Assert(!opacityOnly, "Opaque image OpacityMask should not be blended with brush");
AlphaFlattener\MetroDevice.cs (2)
447Debug.Assert(ticket != null); 491Debug.Assert(ticketXMLString == null);
AlphaFlattener\Optimizer.cs (2)
72Debug.Assert(GetPrimitiveIntersectAction() == PrimitiveIntersectAction.ClipToCluster); 83Debug.Assert(geometry != null, "No geometry available for primitive");
AlphaFlattener\Primitive.cs (10)
260Debug.Assert(Utility.NormalizeOpacity(value) == value, "Opacity should be normalized during tree walking"); 675Debug.Assert(Brush == null, "no brush expected"); 749Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1311Debug.Assert((Brush != null) || (Pen != null), "empty primitive"); 1381Debug.Assert(tb.ViewboxUnits == BrushMappingMode.Absolute, "Absolute Viewbox expected"); 1856Debug.Fail("Image over Brush?"); 2027Debug.Fail("GetShapeGeometry on Canvas"); 2033Debug.Fail("Exclude on Canvas"); 2038Debug.Fail("BlendBrush on Canvas"); 2045Debug.Fail("BlendOverImage on Canvas");
AlphaFlattener\PrimitiveRenderer.cs (1)
61Debug.Assert(_brush == null, "no brush");
AlphaFlattener\SegmentTree.cs (1)
53Debug.Assert(count >= 2);
AlphaFlattener\Utility.cs (7)
960Debug.Fail("Unsupported PathSegment"); 1383Debug.Assert( 1597Debug.Fail("Unhandled TileBrush type"); 1668Debug.Assert(IsValidViewbox(viewbox, brush.Stretch != Stretch.None) && 1731Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1732Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 2366Debug.Assert(!rect.IsEmpty);
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
32Debug.Assert(this._dictionary.Count <= this._maxEntries);
Packaging\XpsManager.cs (2)
1407Debug.Assert(package != null, "package cannot be null"); 1452Debug.Assert(package != null, "package cannot be null");
PrintConfig\PrintSchemaShim.cs (1)
658Debug.Fail("PrintTicketScope enum is out of range");
PrintConfig\PTProvider.cs (1)
592Debug.Assert(resultLength >= 0);
Serialization\DrawingContextFlattener.cs (9)
80Debug.Assert(Utility.IsValid(opacity), "Invalid opacity should clip subtree"); 90Debug.Assert(!BrushProxy.IsEmpty(opacityMask), "empty opacity mask should not result in Push"); 137Debug.Assert(_fullTransform.Count == _fullClip.Count); 359Debug.Assert(visual != null); 473Debug.Assert(rHalfChord2 >= rFuzz2); // Otherewise we have no guarantee that the radius is not 0, 570Debug.Assert(cPieces > 0); 640Debug.Assert(rDot >= -rRadSquared * .1); // angle < 90 degrees 641Debug.Assert(rDot <= rRadSquared * 1.1); // as dot product of 2 radius vectors 885Debug.Assert(context != null);
Serialization\Manager\MetroSerializationManager.cs (1)
846Debug.Assert(propertyInfo.PropertyType == dependencyProperty.PropertyType,
Serialization\VisualSerializer.cs (8)
256Debug.Assert(!BrushProxy.IsEmpty(brush), "Should not be serializing empty brush"); 386Debug.Assert(pos >= 0, "Missing offset"); 820Debug.Fail("Brush not supported"); 1434Debug.Assert(forFill || forStroke, "Either forFill or forStoke should be true"); 1677Debug.Assert(_nameAttr.Length > 0, "Empty _nameAttr"); 2006Debug.Assert(Utility.IsScaleTranslate(bitmapToDrawingTransform)); 2346Debug.Assert(nameAttr == null || nameAttr.Length > 0, "Bad name attribute"); 2381Debug.Assert(_nameAttr == null, "Empty");
Serialization\VisualTreeFlattener.cs (3)
345Debug.Assert(treeWalkProgress != null); 360Debug.Assert(treeWalkProgress != null); 631Debug.Assert(_visualDepth >= 0, "StartVisual/EndVisual mismatch");
RepoTasks (3)
src\aspnetcore\src\Shared\CertificateGeneration\CertificateManager.cs (1)
765Debug.Assert(pemEnvelope != null);
src\aspnetcore\src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
91Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\aspnetcore\src\Shared\CertificateGeneration\UnixCertificateManager.cs (1)
354Debug.Assert(IsCommandAvailable(OpenSslCommand), "How did we trust without the openssl command?");
Roslyn.Diagnostics.Analyzers (563)
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\b310f676f7308b7f\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 160Debug.Assert(cfg.Parent != null); 161Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 162Debug.Assert(parentAnalysisData != null); 319Debug.Assert(lambdaOrLocalFunctionCfg != null); 329Debug.Assert(anonymousFunctionCfg != null); 338Debug.Assert(localFunction.IsLocalFunction()); 346Debug.Assert(localFunctionCfg != null); 362Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 503Debug.Assert(localFunction.IsLocalFunction()); 504Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 594Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\roslyn\src\Compilers\Core\Portable\Collections\BitVector.cs (3)
34Debug.Assert(requiredWords == 0 || requiredWords <= bits.Length); 92Debug.Assert(_capacity == 0 || WordsForCapacity(_capacity) <= _bits.Length); 190Debug.Assert(numTrailingBits <= BitsPerWord);
src\roslyn\src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (13)
69Debug.Assert(instance.IsEmpty); 100Debug.Assert(valueSet.Count >= 1); 116Debug.Assert(valueSet.Count >= 1); 149Debug.Assert(valueSet.Count >= 1); 161Debug.Assert(valueSet.Count >= 1); 211Debug.Assert(this.Count >= 1); 234Debug.Assert(this.Count >= 1); 263Debug.Assert(this.Count >= 1); 274Debug.Assert(this.Count >= 1); 280Debug.Assert(_value is V, "Item must be a a V"); 309Debug.Assert(this.Count >= 1); 315Debug.Assert(_value is V, "_value must be a V"); 343Debug.Assert(_count >= 1);
src\roslyn\src\Compilers\Core\Portable\Collections\SmallDictionary.cs (2)
315Debug.Assert(unbalanced != currentNode); 321Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
52Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 65Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 76Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 89Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 106Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 112Debug.Assert(PathUtilities.GetPathKind(path) == kind); 177Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 178Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 203Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 253Debug.Assert(PathUtilities.IsAbsolute(path)); 297Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 315Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 399Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 417Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 440Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
410Debug.Assert(!IsUnixLikePlatform); 428Debug.Assert(IsAbsolute(root)); 884Debug.Assert(parts[toSkip - 1] == string.Empty);
src\roslyn\src\Compilers\Core\Portable\FileSystem\RelativePathResolver.cs (4)
29Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute)); 30Debug.Assert(baseDirectory == null || PathUtilities.GetPathKind(baseDirectory) == PathKind.Absolute); 49Debug.Assert(fullPath != null); 50Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\roslyn\src\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHash128.cs (6)
259Debug.Assert(length >= 1 && length <= 3); 284Debug.Assert(length >= 4 && length <= 8); 310Debug.Assert(length >= 9 && length <= 16); 336Debug.Assert(length >= 17 && length <= 128); 362Debug.Assert(length >= 129 && length <= 240); 395Debug.Assert(length > 240);
src\roslyn\src\Compilers\Core\Portable\Hashing\XxHashShared.cs (45)
122Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 125Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 128Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 129Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 130Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 131Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 132Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 133Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 134Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 135Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 136Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 137Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 138Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 139Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 140Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 141Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 142Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 143Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 156Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 157Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 158Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 159Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 213Debug.Assert(length > 240); 229Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 230Debug.Assert(stripesSoFar < stripesPerBlock); 251Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 281Debug.Assert(sourceIndex < source.Length); 287Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 291Debug.Assert(stripesToEnd <= stripes); 310Debug.Assert(sourceIndex < source.Length); // at least some bytes left 332Debug.Assert(sourceIndex < source.Length); 333Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 334Debug.Assert(state.BufferedCount == 0); 371Debug.Assert(state.BufferedCount > 0); 787Debug.Assert(shift >= 0 && shift < 64);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\BitArithmeticUtilities.cs (3)
53Debug.Assert(CountBits(alignment) == 1); 66Debug.Assert(position >= 0 && alignment > 0); 67Debug.Assert(CountBits(alignment) == 1);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 87Debug.Assert(tail != null); 98Debug.Assert(this != Empty); 108Debug.Assert(this != Empty);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\Debug.cs (8)
17/// <inheritdoc cref="Debug.Assert(bool)"/> 19public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 21/// <inheritdoc cref="Debug.Assert(bool, string)"/> 24=> Debug.Assert(condition, message); 26/// <inheritdoc cref="Debug.Assert(bool, string)"/> 32Debug.Fail(message.ToStringAndClear()); 43/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG 74Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (2)
151Debug.Assert(e.InnerException is object); 153Debug.Assert(false, "Unreachable");
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\roslyn\src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
32Debug.Assert(number >= 0);
src\roslyn\src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
373Debug.Assert(value.GetType().IsPrimitive);
src\roslyn\src\Compilers\Core\Portable\Syntax\SyntaxTreeExtensions.cs (1)
85Debug.Assert(false, message);
src\roslyn\src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\roslyn\src\Dependencies\Collections\Extensions\IEnumerableExtensions.cs (2)
714Debug.Assert(data.All(d => d.Count() == count)); 1083Debug.Assert(local.Length == size);
src\roslyn\src\Dependencies\Collections\Extensions\ImmutableArrayExtensions.cs (16)
83Debug.Assert(items != null); 455Debug.Assert(self.Length == other.Length); 475Debug.Assert(self.Length == other.Length); 506Debug.Assert(!array.IsDefault); 507Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 526Debug.Assert(i > 0); 542Debug.Assert(i > 0); 545Debug.Assert(builder == null); 558Debug.Assert(!all); 559Debug.Assert(!none); 568Debug.Assert(none); 841Debug.Assert(builder.Count > 1); 885Debug.Assert(members.Length > 0); 900Debug.Assert(count < members.Length); 912Debug.Assert(builder.Count == count); 1190Debug.Assert(!array.IsDefault);
src\roslyn\src\Dependencies\Collections\Internal\ArraySortHelper.cs (44)
67Debug.Assert(comparer != null, "Check the arguments in the caller!"); 86Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 112Debug.Assert(i != j); 125Debug.Assert(i != j); 134Debug.Assert(comparer != null); 147Debug.Assert(keys.Length > 0); 148Debug.Assert(depthLimit >= 0); 149Debug.Assert(comparer != null); 192Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 193Debug.Assert(comparer != null); 237Debug.Assert(comparer != null); 238Debug.Assert(keys.Length > 0); 255Debug.Assert(comparer != null); 343Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 415Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 427Debug.Assert(keys.Length > 0); 428Debug.Assert(depthLimit >= 0); 474Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 537Debug.Assert(keys.Length > 0); 693Debug.Assert(comparer != null); 694Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 695Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 696Debug.Assert(i != j); 713Debug.Assert(i != j); 726Debug.Assert(comparer != null); 727Debug.Assert(keys.Length == values.Length); 737Debug.Assert(keys.Length > 0); 738Debug.Assert(values.Length == keys.Length); 739Debug.Assert(depthLimit >= 0); 740Debug.Assert(comparer != null); 783Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 784Debug.Assert(comparer != null); 828Debug.Assert(comparer != null); 829Debug.Assert(keys.Length > 0); 846Debug.Assert(comparer != null); 873Debug.Assert(comparer != null); 946Debug.Assert(i != j); 964Debug.Assert(i != j); 977Debug.Assert(keys.Length > 0); 978Debug.Assert(values.Length == keys.Length); 979Debug.Assert(depthLimit >= 0); 1022Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1081Debug.Assert(keys.Length > 0); 1235Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\roslyn\src\Dependencies\Collections\Internal\BitHelper.cs (2)
34Debug.Assert(bitPosition >= 0); 48Debug.Assert(bitPosition >= 0);
src\roslyn\src\Dependencies\Collections\Internal\HashHelpers.cs (3)
91Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 113Debug.Assert(divisor <= int.MaxValue); 119Debug.Assert(highbits == value % divisor);
src\roslyn\src\Dependencies\Collections\Internal\SegmentedArrayHelper.cs (1)
156Debug.Assert(segmentSize == 1 || (segmentSize & (segmentSize - 1)) == 0, "Expected size of 1, or a power of 2");
src\roslyn\src\Dependencies\Collections\Internal\ThrowHelper.cs (2)
293Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 331Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\roslyn\src\Dependencies\Collections\OneOrMany.cs (1)
200Debug.Assert(HasOneItem == other.HasOneItem);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
24Debug.Assert(dictionary is not null);
src\roslyn\src\Dependencies\Collections\Segmented\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
120Debug.Assert(other is not ValueBuilder);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedArray.cs (6)
114Debug.Assert(length > 0); 115Debug.Assert(sourceIndex >= 0); 116Debug.Assert(destinationIndex >= 0); 117Debug.Assert((uint)(sourceIndex + length) <= array.Length); 118Debug.Assert((uint)(destinationIndex + length) <= array.Length); 491Debug.Assert(offset == (_secondOffset & SegmentedArrayHelper.GetOffsetMask<T>()), "Aligned views must start at the same segment offset");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count); 169Debug.Assert(_count == 0); 260Debug.Assert(modified); 267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 302Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty"); 447Debug.Assert(comparer is not null); 518Debug.Assert(_buckets.Length > 0); 521Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 574Debug.Assert(comparer is not null); 616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 648Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 649Debug.Assert(newSize >= _entries.Length); 707Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 784Debug.Assert(_entries.Length > 0, "entries should be non-empty"); 788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count); 204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty"); 205Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized"); 258Debug.Assert(comparer is not null); 296Debug.Assert(entries.Length > 0, "entries should be non-empty"); 302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 901Debug.Assert(_entries.Length > 0, "_entries should be non-empty"); 902Debug.Assert(newSize >= _entries.Length); 1023Debug.Assert(_buckets.Length > 0); 1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty"); 1063Debug.Assert(comparer is not null); 1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first"); 1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedList`1.cs (2)
270Debug.Assert(_size == _items.Length); 520Debug.Assert(_items.Length < capacity);
src\roslyn\src\Dependencies\Collections\TemporaryArray`1.cs (2)
173Debug.Assert(_count == InlineCapacity); 336Debug.Assert(_builder is null);
src\roslyn\src\Dependencies\Contracts\ErrorReporting\FatalError.cs (1)
51Debug.Assert(s_handler == null, "Handler already set");
src\roslyn\src\Dependencies\Contracts\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
src\roslyn\src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
521Debug.Assert(builder.Count == 0); 676Debug.Assert(start >= 0 && length >= 0); 677Debug.Assert(start + length <= items.Count); 704Debug.Assert(start >= 0 && length >= 0); 705Debug.Assert(start + length <= items.Length); 719Debug.Assert(start >= 0 && length >= 0); 720Debug.Assert(start + length <= items.Length); 744Debug.Assert(limit <= Count);
src\roslyn\src\Dependencies\PooledObjects\ObjectPool`1.cs (5)
95Debug.Assert(size >= 1); 112Debug.Assert(size >= 1); 250Debug.Assert(obj != null, "freeing null?"); 252Debug.Assert(_firstItem != obj, "freeing twice?"); 263Debug.Assert(value != obj, "freeing twice?");
src\roslyn\src\Dependencies\PooledObjects\PooledDictionary.cs (1)
71Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledHashSet.cs (1)
60Debug.Assert(instance.Count == 0);
src\roslyn\src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
34Debug.Assert(pool != null); 108Debug.Assert(builder.Builder.Length == 0);
src\roslyn\src\Dependencies\Threading\AsyncBatchingWorkQueue`2.cs (1)
271Debug.Assert(_entireQueueCancellationTokenSource.IsCancellationRequested);
src\roslyn\src\Dependencies\Threading\ParallelExtensions.NetFramework.cs (11)
111Debug.Assert(source != null); 112Debug.Assert(scheduler != null); 113Debug.Assert(body != null); 276Debug.Assert(source != null); 277Debug.Assert(scheduler != null); 278Debug.Assert(body != null); 488Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 495Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 528Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 540Debug.Assert(!Cancellation.IsCancellationRequested); 556Debug.Assert(taskSet, "Complete should only be called once.");
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.AssemblyMetricData.cs (3)
60Debug.Assert(child.Symbol.Kind == SymbolKind.Namespace); 61Debug.Assert(!child.Children.IsEmpty); 62Debug.Assert(child.Children.All(grandChild => grandChild.Symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\CodeAnalysisMetricData.cs (2)
35Debug.Assert( 43Debug.Assert(depthOfInheritance.HasValue == (symbol.Kind == SymbolKind.Assembly || symbol.Kind == SymbolKind.Namespace || symbol.Kind == SymbolKind.NamedType));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\CodeMetrics\MetricsHelper.cs (1)
26Debug.Assert(childrenCount != 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IMethodSymbolExtensions.cs (2)
495Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked)); 507Debug.Assert(SymbolEqualityComparer.Default.Equals(method.ContainingType.OriginalDefinition, systemThreadingInterlocked));
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Extensions\IOperationExtensions.cs (7)
210Debug.Assert(isInsideAnonymousObjectInitializer == 288Debug.Assert(success); 289Debug.Assert(cfg != null); 320Debug.Assert(operation.Kind is OperationKind.None or OperationKind.Attribute, $"Unexpected root operation kind: {operation.Kind}"); 333Debug.Assert(operation is IAnonymousFunctionOperation anonymousFunction && anonymousFunction.Symbol.OriginalDefinition.ReturnTypeAndParametersAreSame(lambdaOrLocalFunction.OriginalDefinition) || 495Debug.Assert(parameterIndex >= 0); 496Debug.Assert(parameterIndex < arguments.Length);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\AggregateCategorizedAnalyzerConfigOptions.cs (1)
46Debug.Assert(ReferenceEquals(this, Empty) || !_perTreeOptions.IsEmpty);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildItemOptionNames.cs (1)
38Debug.Assert(typeof(MSBuildItemOptionNames).GetFields().Single(f => f.Name == itemOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\MSBuildPropertyOptionNames.cs (1)
32Debug.Assert(typeof(MSBuildPropertyOptionNames).GetFields().Single(f => f.Name == propertyOptionName) != null);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\Options\SymbolNamesWithValueOption.cs (3)
66Debug.Assert(!names.IsEmpty || !symbols.IsEmpty || !wildcardNamesBySymbolKind.IsEmpty); 144Debug.Assert(parts.SymbolName[^1] == WildcardChar); 145Debug.Assert(parts.SymbolName.Length >= 2);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledConcurrentDictionary.cs (2)
72Debug.Assert(instance.IsEmpty); 82Debug.Assert(added);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledDictionary.cs (1)
61Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\PooledObjects\PooledSortedSet.cs (1)
69Debug.Assert(instance.Count == 0);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\RulesetToEditorconfigConverter.cs (2)
102Debug.Assert(rulesetNode.Name == RuleSetNodeName); 131Debug.Assert(rulesetNode.Name == RuleSetNodeName);
src\roslyn\src\RoslynAnalyzers\Utilities\Compiler\SmallDictionary.cs (2)
428Debug.Assert(unbalanced != currentNode); 434Debug.Assert(n.HashCode != hashCode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
185Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
193Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 215Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 223Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 261Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 269Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 313Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 322Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\ImmutableIntervalTree`1.cs (1)
79Debug.Assert(values.IsSorted(Comparer<T>.Create((t1, t2) => localIntrospector.GetSpan(t1).Start - localIntrospector.GetSpan(t2).Start)));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
102Debug.Assert(rightBalance == 1); 115Debug.Assert(leftBalance == -1);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSeparatedSyntaxNodeList.cs (4)
45Debug.Assert(NodesAndTokens[i].IsNode); 46Debug.Assert(NodesAndTokens[i].Node is EmbeddedSyntaxNode<TSyntaxKind, TSyntaxNode>); 51Debug.Assert(!NodesAndTokens[i].IsNode); 68Debug.Assert(nodeOrToken.IsNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxToken.cs (4)
36Debug.Assert(!leadingTrivia.IsDefault); 37Debug.Assert(!virtualChars.IsDefault); 38Debug.Assert(!trailingTrivia.IsDefault); 39Debug.Assert(!diagnostics.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (12)
80Debug.Assert(expectedValueText == actualValueText); 86Debug.Assert(currentVC.Span.Start >= token.SpanStart, "First span has to start after the start of the string token"); 90Debug.Assert(currentVC.Span.Start == token.SpanStart + 1 || 99Debug.Assert(currentVC.Span.End <= nextVC.Span.Start, "Virtual character spans have to be ordered."); 108Debug.Assert(currentVC.Span.End == nextVC.Span.Start, "Virtual character spans have to be touching."); 118Debug.Assert(lastVC.Span.End == token.Span.End - "\"".Length, "Last span has to end right before the end of the string token."); 122Debug.Assert(lastVC.Span.End == token.Span.End - "\"u8".Length, "Last span has to end right before the end of the string token."); 135Debug.Assert(!token.ContainsDiagnostics); 139Debug.Assert(startDelimiter == ""); 140Debug.Assert(endDelimiter == ""); 147Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics."); 153Debug.Assert(false, "This should not be reachable as long as the compiler added no diagnostics.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (4)
100Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 101Debug.Assert(_span.End == virtualChars._span.Start); 111Debug.Assert(chars1._leafCharacters == chars2._leafCharacters); 175Debug.Assert(chars1._tokenStart == chars2._tokenStart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
43Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (2)
119Debug.Fail("Unhandled declaration pattern context"); 153Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\StringExtensions.cs (3)
79Debug.Assert(tabSize > 0); 80Debug.Assert(endPosition >= 0 && endPosition <= textSnippet.Length); 254Debug.Assert(builder.KeyComparer == StringComparer.Ordinal || builder.KeyComparer == StringComparer.OrdinalIgnoreCase);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
33Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SyntaxNodeExtensions.cs (2)
248Debug.Fail("Could not find common ancestor."); 271Debug.Fail("Could not find common ancestor.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
59Debug.Assert(unreachableBlocksToVisit.Count == 0); 216Debug.Assert(branch.Destination == null); 221Debug.Assert(branch.Destination == null); 227Debug.Assert(branch.Destination != null); 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 262Debug.Assert(enclosing.NestedRegions[0] == region); 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 325Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 337Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 375Debug.Assert(startAt > 0); 376Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 391Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\LValueFlowCaptureProvider.cs (1)
76Debug.Assert(kind == FlowCaptureKind.LValueAndRValueCapture || !rvalueFlowCaptureIds.Contains(captureId), "Flow capture used as both an r-value and an l-value, but with incorrect flow capture kind");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
53Debug.Assert(_currentContainingSymbol == null); 54Debug.Assert(_currentAnalysisData == null); 55Debug.Assert(_currentRootOperation == null); 56Debug.Assert(_pendingWritesMap == null); 109Debug.Assert(symbol != null); 161Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 197Debug.Assert(symbolOpt != null); 207Debug.Assert(symbolOpt == null); 210Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 346Debug.Assert(localFunction.IsLocalFunction()); 499Debug.Assert(operation.Type.IsDelegateType());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (10)
65Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 92Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 107Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 130Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 178Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 195Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 209Debug.Assert(!context.IsFormattingDisabled(new TextSpan(context.TokenStream.GetToken(pairIndex + 1).SpanStart, 0))); 461Debug.Assert(!context.IsFormattingDisabled(pairIndex)); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
63Debug.Assert(this.TokenCount > 0); 85Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 388Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 389Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 390Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 413Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 414Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 415Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 433Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 445Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 493Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 517Debug.Assert(token.FullSpan.IsEmpty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
750Debug.Assert(!_firstLineBlank); 856Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
84Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
161Debug.Assert(spanToCheck.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
21Debug.Assert(nameSpan.Length > 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\Serialization\NamingStylePreferences.cs (1)
411Debug.Assert(s_serializationVersion == 5, "After increasing the serialization version, add an upgrade path here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
69Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 71Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 72Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
59Debug.Assert(IsSupportedOptionType(Type));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
22Debug.Assert(option.IsPerLanguage == language is not null); 30Debug.Assert(option.IsPerLanguage); 42Debug.Assert(!option.IsPerLanguage);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\PerLanguageOption2.cs (2)
60Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 61Debug.Assert(!Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (5)
92Debug.Assert(BitConverter.IsLittleEndian); 185Debug.Assert(value == null || !value.GetType().GetTypeInfo().IsEnum, "Enum should not be written with WriteValue. Write them as ints instead."); 195Debug.Assert(!typeInfo.IsEnum, "Enums should not be written with WriteObject. Write them out as integers instead."); 470Debug.Assert(id >= 0); 542Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\TextEncodingKind.cs (5)
62Debug.Assert(HasPreamble(Encoding.Unicode)); 67Debug.Assert(HasPreamble(Encoding.BigEndianUnicode)); 72Debug.Assert(HasPreamble(Encoding.UTF32)); 77Debug.Assert(HasPreamble(Encoding.UTF32)); 82Debug.Assert(HasPreamble(Encoding.UTF8));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
40Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
19Debug.Assert(symbol.IsAnonymousType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
198Debug.Assert(reader.Position == symbolKey.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
17Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 129Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 262Debug.Assert(method != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
36Debug.Assert(symbol.IsGlobalNamespace); 94Debug.Assert(metadataName == string.Empty); 98Debug.Assert(metadataName == string.Empty);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyReader.cs (8)
65Debug.Assert(Data[Position] == c); 87Debug.Assert(char.IsNumber(Data[Position])); 102Debug.Assert(start != Position); 116Debug.Assert(val is 0 or 1); 202Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null); 288Debug.Assert(_skipString == false); 293Debug.Assert(_skipString == true); 547Debug.Assert((SymbolKeyType)Data[Position] != SymbolKeyType.Null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
109Debug.Assert(_nestingCount == 0); 255Debug.Assert(location.Kind is LocationKind.None or 307Debug.Assert(!array.IsDefault);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsTupleType);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (18)
262Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 264Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 286Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 288Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 298Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 300Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 308Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 310Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 320Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 322Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 573Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 574Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 628Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 630Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1072Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1073Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1157Debug.Assert(parameter1.HasExplicitDefaultValue, "Expected all unspecified parameter to have default values"); 1158Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\Base64Utilities.cs (4)
98Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 127Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 175Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 316Debug.Assert((consumed % 4) == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BKTree.Builder.cs (4)
163Debug.Assert(spilledEdges.Count == (edgeCount - CompactEdgeAllocationSize)); 173Debug.Assert(currentEdgeIndex == edges.Capacity); 174Debug.Assert(currentEdgeIndex == edges.Count); 278Debug.Assert(currentNode.SpilloverEdges.Count == (currentNode.EdgeCount - CompactEdgeAllocationSize));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\EditDistance.cs (8)
182Debug.Assert(source.Length <= target.Length); 219Debug.Assert(minimumEditCount >= 0); 485Debug.Assert(offset >= 0); 577Debug.Assert(v1 >= 0); 578Debug.Assert(v2 >= 0); 579Debug.Assert(v3 >= 0); 580Debug.Assert(v4 >= 0); 598Debug.Assert(min >= 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\LightweightOverloadResolution.cs (3)
114Debug.Assert(foundParameterIndex < parameters.Length); 239Debug.Assert(parameterIndex >= 0); 240Debug.Assert(parameterIndex < method.Parameters.Length);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
203Debug.Assert(!this.IsLocked); 212Debug.Assert(this.IsOwnedByMe);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (4)
34Debug.Assert(span.Start >= start, "Bad generator."); 86Debug.Assert(current < length); 108Debug.Assert(current < length); 127Debug.Assert(char.IsUpper(identifier[current - 1]));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
155Debug.Assert(similarityWeight <= _threshold);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Compilation\CompilationExtensions.cs (1)
342Debug.Assert(type is null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\IMethodSymbolExtensions.cs (2)
53Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 58Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions_Accessibility.cs (7)
92Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 179Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 217Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 254Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 379Debug.Assert(current.IsDefinition); 413Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 439Debug.Assert(current.IsDefinition);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ISymbolExtensions.RequiresUnsafeModifierVisitor.cs (1)
26Debug.Fail("Unhandled symbol kind in RequiresUnsafeModifierVisitor: " + node.Kind);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\ITypeSymbolExtensions.cs (1)
540Debug.Assert(isTypeParameter2);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.cs (1)
166Debug.Assert(_assemblyComparer == null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
78Debug.Assert(!x.IsDefault && !y.IsDefault); 114Debug.Assert(x.Kind == y.Kind && x.Kind == k); 332Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 619Debug.Assert( 623Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeFixes\FixAllContextHelper.cs (1)
60Debug.Fail("FixAllScope.ContainingMember and FixAllScope.ContainingType are not supported in CodeStyle layer");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
342Debug.Assert(desiredGroupIndex >= 0); 343Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
42Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\DocumentExtensions.cs (1)
206Debug.Assert(false, message + ". " + diagnostics);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
34Debug.Assert(diagnostic != null); 88Debug.Assert(analyzerConfigPath != null); 89Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\SemanticModelReuse\AbstractSemanticModelReuseLanguageService.cs (4)
102Debug.Fail("Previous container didn't map back to a normal accessor container."); 111Debug.Fail("Accessor count shouldn't have changed as there were no top level edits."); 132Debug.Fail("Member count shouldn't have changed as there were no top level edits."); 139Debug.Fail("Child at indicated index should be a node as there were no top level edits.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (3)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel); 227Debug.Assert(replacedParent.GetAnnotatedNodesAndTokens(annotation).Count() == 1); 246Debug.Assert(newRoot.GetAnnotatedNodesAndTokens(marker).Count() == 1);
SymbolDeclaredEventMustBeGeneratedForSourceSymbols.cs (1)
97Debug.Assert(symbolDeclaredEvent.GetParameters().HasExactly(1));
Roslyn.Diagnostics.CSharp.Analyzers (76)
src\50a3a051b0fef0d6\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
242Debug.Assert(IsDiscardDeclaration(variable));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (17)
59Debug.Assert(!token.ContainsDiagnostics); 235Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 241Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 311Debug.Assert(tokenText[index] == '\\'); 325Debug.Assert(tokenText[index] == '\\'); 360Debug.Assert(tokenText[index] == '\\'); 370Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 383Debug.Assert(tokenText[index] == '\\'); 394Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 403Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 414Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 427Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 448Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 457Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 471Debug.Assert(character == 'x'); 477Debug.Fail("This should not be reachable as long as the compiler added no diagnostics."); 504Debug.Assert(IsHexDigit(c));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ITypeSymbolExtensions.cs (1)
44Debug.Assert(typeSymbol.GetParameters().IsDefaultOrEmpty, "If GetParameters extension handles record, we can remove the handling here.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\ParenthesizedExpressionSyntaxExtensions.cs (1)
827Debug.Fail("Unhandled pattern type");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SyntaxKindExtensions.cs (1)
73Debug.Fail($"Unhandled compound assignment kind: {syntaxKind}");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.Analyzer.cs (2)
155Debug.Assert(trivia.Kind() == SyntaxKind.WhitespaceTrivia); 156Debug.Assert(trivia.Width() == trivia.FullWidth());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
48Debug.Assert(trivia.ToString() == trivia.ToFullString()); 138Debug.Assert(trivia.ToString() == trivia.ToFullString()); 323Debug.Assert(trivia.HasStructure);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.ComplexTrivia.cs (1)
74Debug.Assert(this.SecondTokenIsFirstTokenOnLine);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (11)
34Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 42Debug.Assert(this.TreeInfo.GetTextBetween(default, token).All(IsCSharpWhitespace)); 54Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 62Debug.Assert(this.TreeInfo.GetTextBetween(token, default).All(IsCSharpWhitespace)); 74Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 82Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 133Debug.Assert(result.Tab >= 0); 134Debug.Assert(result.LineBreaks >= 0); 158Debug.Assert(Options.UseTabs); 171Debug.Assert((indentation / Options.TabSize) == result.Tab); 172Debug.Assert((indentation % Options.TabSize) == result.Space);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\FormattingHelpers.cs (3)
556Debug.Assert(previousToken != default); 557Debug.Assert(currentToken != default); 558Debug.Assert(previousToken.FullSpan.End == currentToken.FullSpan.Start);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
93Debug.Assert(_options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents) != _options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SpacingFormattingRule.cs (1)
365System.Diagnostics.Debug.Assert(false, "Invalid BinaryOperatorSpacingOptions");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
326Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
125Debug.Assert(oldNode.Kind() == newNode.Kind());
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (3)
865Debug.Assert(memberDeclaration.Kind() == SyntaxKind.IncompleteMember); 875Debug.Fail("Unexpected node type " + node.Kind()); 912Debug.Assert(topLevel || methodLevel);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
820Debug.Assert(rewrittenBitwiseNotExpression.Kind() == SyntaxKind.BitwiseNotExpression); 1308Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1364Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1393Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1573Debug.Assert(!rewrittenType.IsReferenceType && !IsIntrinsicOrEnum(rewrittenType));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (12)
73Debug.Assert(expression != null); 106Debug.Assert(speculativeSemanticModel != null || 128Debug.Assert(semanticModel.ParentModel != null); 129Debug.Assert(!semanticModel.ParentModel.IsSpeculativeSemanticModel); 181Debug.Assert(nodeToSpeculate is ExpressionSyntax); 212Debug.Assert(originalParams.Count == replacedParams.Count); 277Debug.Assert(originalIdentifierNodes.Any()); 278Debug.Assert(originalIdentifierNodes.Count() == replacedIdentifierNodes.Count()); 297Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 298Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 372Debug.Assert(newExpression.WhenTrue == previousReplacedNode); 378Debug.Assert(newExpression.WhenFalse == previousReplacedNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
61Debug.Assert(node.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpUseImplicitTypeHelper.cs (1)
95Debug.Assert(!typeName.StripRefIfNeeded().IsVar, "'var' special case should have prevented analysis of this variable.");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
240Debug.Assert(method.ExplicitInterfaceImplementations.Any() || method.IsOverride);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
130Debug.Assert(!endOfLine.IsKind(SyntaxKind.None));
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
132Debug.Assert(oldUsings.Count == newUsings.Count);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
77Debug.Assert(_seenContextNode);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (2)
1235Debug.Assert(propertyDeclaration?.Type != null, "Property type should never be null"); 1782Debug.Assert(expressionOpt != null);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
205Debug.Assert(block.Statements.Count == 0); 240Debug.Assert(IsExpressionBody(body));
rzc (15)
ConcurrentLruCache.cs (1)
158Debug.Assert(_capacity > 0);
DefaultRequestDispatcher.cs (7)
64Debug.Assert(_listenTask != null); 115Debug.Assert(_listenTask != null); 134Debug.Assert(_connections.Count == 0); 163Debug.Assert(_listenTask == null); 164Debug.Assert(_timeoutTask == null); 173Debug.Assert(_listenTask != null); 226Debug.Assert(_listenTask != null);
Json\ObjectReaders_TagHelpers.cs (1)
168Debug.Assert(reader.IsString);
Json\ObjectWriters_TagHelpers.cs (3)
55Debug.Fail($"Documentation objects should only be of type {nameof(DocumentationDescriptor)}, string, or null."); 79Debug.Assert(value.Index is null); 204Debug.Fail($"Unsupported metadata kind '{value.Kind}'.");
MetadataCache.cs (2)
56Debug.Assert(Path.IsPathRooted(fullPath)); 75Debug.Assert(timestamp.Kind == DateTimeKind.Utc);
ServerProtocol\ServerConnection.cs (1)
274Debug.Assert(response != null);
Shared (25)
..\..\..\..\src\Shared\ServerSentEvents\ArrayBuffer.cs (10)
41Debug.Assert(initialSize > 0 || usePool); 53Debug.Assert(buffer.Length > 0); 78Debug.Assert(_usePool); 79Debug.Assert(_bytes is not null); 106Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 118Debug.Assert(byteCount <= AvailableLength); 134Debug.Assert(AvailableLength < byteCount); 138Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 150Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
..\..\..\..\src\Shared\ServerSentEvents\Helpers.cs (4)
35Debug.Assert(buffer.Length >= MaxDecimalDigits); 38Debug.Assert(success); 53Debug.Assert(value.Length <= buffer.Length); 67Debug.Assert(maxByteCount <= buffer.Length);
..\..\..\..\src\Shared\ServerSentEvents\SseFormatter.cs (4)
104Debug.Assert(bufferWriter.WrittenCount is 0); 108Debug.Assert(!eventType.AsSpan().ContainsLineBreaks()); 120Debug.Assert(!eventId.AsSpan().ContainsLineBreaks()); 129Debug.Assert(retry >= TimeSpan.Zero);
..\..\..\..\src\Shared\ServerSentEvents\SseParser_1.cs (7)
282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}"); 283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}"); 284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 286Debug.Assert(searchLength >= 0, $"{searchLength}"); 287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}"); 292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline"); 548Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
Stress.ApiService (3)
Program.cs (3)
384Debug.Assert(activity is not null); 388Debug.Assert(innerActivity is not null); 407Debug.Assert(innerActivity2 is not null);
System (1)
src\runtime\src\libraries\shims\System\ref\System.cs (1)
484[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.CodeDom (6)
Microsoft\CSharp\CSharpCodeGenerator.cs (1)
2398Debug.Assert(names.Length > 0);
Microsoft\VisualBasic\VBCodeGenerator.cs (2)
2322Debug.Assert(names.Length > 0); 2586Debug.Assert(_statementDepth >= 0, "statementDepth >= 0");
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
247Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
System\CodeDom\Compiler\CompilerInfo.cs (1)
49Debug.Assert(_providerOptions != null, "Created CompilerInfo w/ null _providerOptions");
System\CodeDom\Compiler\ExposedTabStringIndentedTextWriter.cs (1)
13Debug.Assert(tabString != null, "CodeGeneratorOptions can never have a null TabString");
System.Collections (103)
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Generic\LinkedList.cs (4)
389Debug.Assert(head == null && count == 0, "LinkedList must be empty when this method is called!"); 399Debug.Assert(node.list == this, "Deleting the node from another list!"); 400Debug.Assert(head != null, "This method shouldn't be called on empty list!"); 403Debug.Assert(count == 1 && head == node, "this should only be true for a list with only one node");
System\Collections\Generic\OrderedDictionary.cs (34)
375Debug.Assert(modified); 401Debug.Assert(0 <= keyIndex && keyIndex < _count); 403Debug.Assert(_entries is not null); 408Debug.Assert(index < 0, "Expected index to be unspecied when overwriting an existing key."); 417Debug.Assert(behavior is InsertionBehavior.IgnoreInsertion, $"Unknown behavior: {behavior}"); 418Debug.Assert(index < 0, "Expected index to be unspecied when ignoring a duplicate key."); 429Debug.Assert(index <= _count); 439Debug.Assert(entries is not null); 469Debug.Assert(0 <= keyIndex && keyIndex < _count); 509Debug.Assert(collection is not null); 532Debug.Assert(_entries is not null); 596Debug.Assert(_entries is not null, "count must be positive, which means we must have entries"); 616Debug.Assert(key is not null, "Key nullness should have been validated by caller."); 633Debug.Assert(entries is not null, "expected entries to be is not null"); 668Debug.Assert(comparer is not null); 750Debug.Assert(_entries is not null); 778Debug.Assert(entries is not null); 800Debug.Assert(_entries is not null); 821Debug.Assert(_entries is not null); 835Debug.Assert(_comparer is not null); 936Debug.Assert(_entries is not null); 964Debug.Assert(entries is not null); 1014Debug.Assert(shiftAmount is 1 or -1); 1017Debug.Assert(entries is not null); 1081Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType, "Value types never rehash."); 1082Debug.Assert(newSize >= _count, "The requested size must accommodate all of the current elements."); 1107Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1109Debug.Assert(_comparer is not null); 1110Debug.Assert(_comparer is not NonRandomizedStringEqualityComparer); 1142Debug.Assert(buckets is not null); 1177Debug.Assert(_entries is not null); 1438Debug.Assert(dictionary._entries is not null); 1517Debug.Assert(entries is not null); 1706Debug.Assert(entries is not null);
System\Collections\Generic\PriorityQueue.cs (10)
57Debug.Assert(Log2Arity > 0 && Math.Pow(2, Log2Arity) == Arity); 626Debug.Assert(_nodes.Length < minCapacity); 721Debug.Assert(_comparer is null); 722Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 753Debug.Assert(_comparer is not null); 754Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 787Debug.Assert(_comparer is null); 788Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 835Debug.Assert(_comparer is not null); 836Debug.Assert(0 <= nodeIndex && nodeIndex < _size);
System\Collections\Generic\SortedList.cs (1)
158Debug.Assert(count == this.keys.Length);
System\Collections\Generic\SortedSet.cs (35)
96Debug.Assert(sortedSet.root != null); 355Debug.Assert(parent != null); 424Debug.Assert(parent.IsBlack); 448Debug.Assert(Node.IsNonNullBlack(sibling)); 609Debug.Assert(parent != null); 610Debug.Assert(grandParent != null); 659Debug.Assert(match != null); 664Debug.Assert(match.Right == null); 669Debug.Assert(parentOfSuccessor != null); 670Debug.Assert(successor.Left == null); 671Debug.Assert((successor.Right == null && successor.IsRed) || (successor.Right!.IsRed && successor.IsBlack)); 798Debug.Assert(set1 != null); 1136Debug.Assert(other != null); 1137Debug.Assert(HasEqualComparer(other)); 1142Debug.Assert(result); 1148Debug.Assert(other != null); 1149Debug.Assert(count >= 0 && count <= other.Length); 1165Debug.Assert(result); 1628Debug.Assert(count == GetCount()); 1662Debug.Assert(IsNonNullRed(sibling.Left) || IsNonNullRed(sibling.Right)); 1664Debug.Assert(HasChildren(current, sibling)); 1678Debug.Assert(node != null); 1679Debug.Assert(node == Left ^ node == Right); 1688Debug.Assert(Left != null); 1689Debug.Assert(Right != null); 1706Debug.Assert(removeRed.IsRed); 1711Debug.Assert(removeRed.IsRed); 1715Debug.Assert(Right!.Left!.IsRed); 1718Debug.Assert(Left!.Right!.IsRed); 1721Debug.Fail($"{nameof(rotation)}: {rotation} is not a defined {nameof(TreeRotation)} value."); 1783Debug.Assert(IsRed); 1784Debug.Assert(Left!.Is2Node); 1785Debug.Assert(Right!.Is2Node); 1801Debug.Assert(HasChild(child)); 1821Debug.Assert(child1 != child2);
System\Collections\Generic\SortedSet.TreeSubSet.cs (8)
62Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 72Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 87Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max)); 285Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 302Debug.Assert(this.versionUpToDate() && root == _underlying.FindRange(_min, _max)); 315Debug.Assert(_underlying != null); 335Debug.Assert(_underlying != null); 359Debug.Assert(versionUpToDate() && root == _underlying.FindRange(_min, _max));
System\Collections\Generic\Stack.cs (5)
111Debug.Assert(array != _array); 287Debug.Assert(_size == _array.Length); 315Debug.Assert(_array.Length < capacity); 348Debug.Assert(_size == 0); 380Debug.Assert(index < _stack.Count);
System.Collections.Concurrent (67)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Concurrent\BlockingCollection.cs (15)
212Debug.Assert(boundedCapacity > 0 || boundedCapacity == NON_BOUNDED); 226Debug.Assert(boundedCapacity > 0); 257Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 287Debug.Assert(tryAddReturnValue, "TryAdd() was expected to return true."); 458Debug.Assert((observedAdders + 1) <= (~COMPLETE_ADDING_ON_MASK), "The number of concurrent adders thread exceeded the maximum limit."); 492Debug.Assert((_currentAdders & ~COMPLETE_ADDING_ON_MASK) > 0); 711Debug.Assert(_boundedCapacity != NON_BOUNDED); 767Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 809Debug.Assert(tryAddAnyReturnValue >= 0 && tryAddAnyReturnValue < collections.Length, 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1033Debug.Assert(result); 1050Debug.Assert(collections != null); 1097Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite); 1168Debug.Assert(returnValue >= 0 && returnValue < collections.Length, 1397Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count));
System\Collections\Concurrent\ConcurrentBag.cs (22)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 298Debug.Assert(copied == count); 315Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 386Debug.Assert(copied == count); 515Debug.Assert(count >= 0); 599Debug.Assert(_locals != null); 611Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 638Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 718Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 733Debug.Assert(_tailIndex == tail, "No other thread should be changing _tailIndex"); 744Debug.Assert(_headIndex - _tailIndex <= 0); 838Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 855Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 930Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 1021Debug.Assert(Monitor.IsEntered(this)); 1022Debug.Assert(_frozen); 1023Debug.Assert(array != null); 1024Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1028Debug.Assert( 1033Debug.Assert(arrayIndex <= array.Length - count); 1054Debug.Assert(Monitor.IsEntered(this)); 1058Debug.Assert(count >= 0, $"Expected _addTakeCount ({addTakeCount}) >= _stealCount ({stealCount}).");
System\Collections\Concurrent\PartitionerStatic.cs (27)
418Debug.Assert(_currentChunkSize == null); 423Debug.Assert(_currentChunkSize != null); 437Debug.Assert(_localOffset.Value == _currentChunkSize.Value - 1 || _currentChunkSize.Value == 0); 458Debug.Assert(requestedChunkSize > 0 && requestedChunkSize <= _maxChunkSize); 462Debug.Assert(_currentChunkSize.Value <= requestedChunkSize && _currentChunkSize.Value > 0); 694Debug.Assert(_useSingleChunking, "Expected _useSingleChecking to be true"); 695Debug.Assert(requestedChunkSize == 1, $"Got requested chunk size of {requestedChunkSize} when single-chunking was on"); 696Debug.Assert(actualNumElementsGrabbed == 0, $"Expected actualNumElementsGrabbed == 0, instead it is {actualNumElementsGrabbed}"); 697Debug.Assert(destArray.Length == 1, $"Expected destArray to be of length 1, instead its length is {destArray.Length}"); 743Debug.Assert(requestedChunkSize > 0); 744Debug.Assert(!_useSingleChunking, "Did not expect to be in single-chunking mode"); 782Debug.Assert(_sharedIndex != null); //already been allocated in MoveNext() before calling GrabNextChunk 913Debug.Assert(requestedChunkSize > 0); 950Debug.Assert(_localList != null); 951Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1084Debug.Assert(requestedChunkSize > 0); 1088Debug.Assert(_sharedIndex != null); 1130Debug.Assert(_sharedIndex != null); 1221Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1305Debug.Assert(_localOffset!.Value >= 0 && _localOffset.Value < _currentChunkSize.Value); 1488Debug.Assert(list != null); 1514Debug.Assert(startIndex >= 0 && endIndex <= list.Count - 1); 1528Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1546Debug.Assert(array != null); 1571Debug.Assert(startIndex >= 0 && endIndex <= array.Length - 1); 1585Debug.Assert(_offset >= _startIndex && _offset <= _endIndex); 1659Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System.Collections.Immutable (185)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Frozen\FrozenDictionary.AlternateLookup.cs (4)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternateKey, TKey>, "Must have already been verified"); 84Debug.Assert(dictionary is not null); 85Debug.Assert(dictionary.Comparer is IAlternateEqualityComparer<TAlternateKey, TKey>); 86Debug.Assert(alternateLookupDelegate is not null);
System\Collections\Frozen\FrozenDictionary.cs (6)
152Debug.Assert(newDictionary is not null); 153Debug.Assert(newDictionary.Comparer.Equals(comparer)); 161Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 223Debug.Assert(minLength >= 0 && maxLength >= minLength); 392Debug.Assert(keys.Length == values.Length); 682Debug.Assert(keys.Length == values.Length);
System\Collections\Frozen\FrozenHashTable.cs (8)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 118Debug.Assert(count == hashtableHashcodes.Length); 154Debug.Assert(hashCodes.Length != 0); 155Debug.Assert(!hashCodesAreUnique || new HashSet<int>(hashCodes.ToArray()).Count == hashCodes.Length); 179Debug.Assert(uniqueCodesCount != 0); 224Debug.Assert(maxPrimeIndexExclusive != 0); 318Debug.Assert(count > 0);
System\Collections\Frozen\FrozenSet.AlternateLookup.cs (4)
68Debug.Assert(Comparer is IAlternateEqualityComparer<TAlternate, T>, "Must have already been verified"); 84Debug.Assert(set is not null); 85Debug.Assert(set.Comparer is IAlternateEqualityComparer<TAlternate, T>); 86Debug.Assert(alternateLookupDelegate is not null);
System\Collections\Frozen\FrozenSet.cs (4)
90Debug.Assert(newSet is not null); 91Debug.Assert(newSet.Comparer.Equals(comparer)); 97Debug.Assert(source.Count > 0, "Empty sources should have been filtered out by caller"); 154Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\FrozenSetInternalBase.cs (7)
33Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 60Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 87Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 103Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 131Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 147Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used."); 192Debug.Assert(_thisSet.Count != 0, "EmptyFrozenSet should have been used.");
System\Collections\Frozen\Int32\Int32FrozenDictionary.cs (2)
23Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default)); 24Debug.Assert(source.Count != 0);
System\Collections\Frozen\Int32\Int32FrozenSet.cs (2)
21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<int>.Default));
System\Collections\Frozen\ItemsFrozenSet.cs (1)
19Debug.Assert(source.Count != 0);
System\Collections\Frozen\KeysAndValuesFrozenDictionary.cs (1)
20Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallFrozenDictionary.cs (1)
26Debug.Assert(source.Count != 0);
System\Collections\Frozen\SmallValueTypeComparableFrozenDictionary.cs (4)
27Debug.Assert(default(TKey) is not null); 28Debug.Assert(typeof(TKey).IsValueType); 30Debug.Assert(source.Count != 0); 31Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeComparableFrozenSet.cs (5)
25Debug.Assert(default(T) is IComparable<T>); 26Debug.Assert(default(T) is not null); 27Debug.Assert(typeof(T).IsValueType); 29Debug.Assert(source.Count != 0); 30Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenDictionary.cs (4)
20Debug.Assert(default(TKey) is not null); 21Debug.Assert(typeof(TKey).IsValueType); 23Debug.Assert(source.Count != 0); 24Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\SmallValueTypeDefaultComparerFrozenSet.cs (4)
18Debug.Assert(default(T) is not null); 19Debug.Assert(typeof(T).IsValueType); 21Debug.Assert(source.Count != 0); 22Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Frozen\String\Hashing.cs (1)
81Debug.Assert(Ascii.IsValid(s));
System\Collections\Frozen\String\KeyAnalyzer.cs (2)
32Debug.Assert(!uniqueStrings.IsEmpty); 204Debug.Assert(Ascii.IsValid(s));
System\Collections\Frozen\String\LengthBuckets.cs (2)
19Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 20Debug.Assert(minLength >= 0 && maxLength >= minLength);
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\LengthBucketsFrozenDictionary.cs (2)
23Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 35Debug.Assert(keys.Length != 0 && keys.Length == values.Length);
System\Collections\Frozen\String\LengthBucketsFrozenSet.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\LengthBucketsFrozenSet.cs (2)
21Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase); 32Debug.Assert(items.Length != 0);
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.AlternateLookup.cs (1)
22Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\String\OrdinalStringFrozenDictionary.cs (2)
30Debug.Assert(keys.Length != 0 && keys.Length == values.Length); 31Debug.Assert(comparer == EqualityComparer<string>.Default || comparer == StringComparer.Ordinal || comparer == StringComparer.OrdinalIgnoreCase);
System\Collections\Frozen\String\OrdinalStringFrozenSet.AlternateLookup.cs (1)
21Debug.Assert(typeof(TAlternateKey) == typeof(ReadOnlySpan<char>));
System\Collections\Frozen\ValueTypeDefaultComparerFrozenDictionary.cs (2)
18Debug.Assert(typeof(TKey).IsValueType); 19Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<TKey>.Default));
System\Collections\Frozen\ValueTypeDefaultComparerFrozenSet.cs (2)
15Debug.Assert(typeof(T).IsValueType); 16Debug.Assert(ReferenceEquals(source.Comparer, EqualityComparer<T>.Default));
System\Collections\Immutable\ImmutableArray_1.Builder.cs (1)
1088Debug.Assert(lastIndexRemoved < indexToRemove);
System\Collections\Immutable\ImmutableArray_1.cs (4)
1496Debug.Assert(indexToRemove > lastIndexRemoved); // We require that the input be a sorted set. 1510Debug.Assert(array != null); 1511Debug.Assert(!IsEmpty); 1512Debug.Assert(!items.IsEmpty);
System\Collections\Immutable\ImmutableExtensions.Minimal.cs (3)
101Debug.Assert(sequence != null); 102Debug.Assert(array != null); 103Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length);
System\Collections\Immutable\ImmutableHashSet_1.cs (2)
428Debug.Assert(result != null); 626Debug.Assert(result == OperationResult.SizeChanged);
System\Collections\Immutable\ImmutableList_1.Enumerator.cs (2)
201Debug.Assert(_stack != null); 275Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableList_1.Node.cs (31)
71Debug.Assert(this.IsEmpty); 86Debug.Assert(!frozen || (left._frozen && right._frozen)); 95Debug.Assert(!this.IsEmpty); 108Debug.Assert(!(_left == null ^ _right == null)); 153Debug.Assert(_left != null && _right != null); 183Debug.Assert(_left != null && _right != null); 401Debug.Assert(_left != null && _right != null); 488Debug.Assert(result != null); 501Debug.Assert(!this.IsEmpty); 1288Debug.Assert(!this.IsEmpty); 1289Debug.Assert(!_right!.IsEmpty); 1300Debug.Assert(!this.IsEmpty); 1301Debug.Assert(!_left!.IsEmpty); 1312Debug.Assert(!this.IsEmpty); 1313Debug.Assert(!_right!.IsEmpty); 1314Debug.Assert(!_right!._left!.IsEmpty); 1330Debug.Assert(!this.IsEmpty); 1331Debug.Assert(!_left!.IsEmpty); 1332Debug.Assert(!_left._right!.IsEmpty); 1352Debug.Assert(!this.IsEmpty); 1393Debug.Assert(!this.IsEmpty); 1394Debug.Assert(this.IsLeftHeavy); 1405Debug.Assert(!this.IsEmpty); 1406Debug.Assert(this.IsRightHeavy); 1422Debug.Assert(tree._left != null && tree._right != null); 1428Debug.Assert(tree._left != null); 1434Debug.Assert(tree._right != null); 1455Debug.Assert(!this.IsEmpty); 1480Debug.Assert(!this.IsEmpty); 1504Debug.Assert(!this.IsEmpty); 1544Debug.Assert(!this.IsEmpty);
System\Collections\Immutable\ImmutableQueue_1.cs (7)
52Debug.Assert(forwards != null); 53Debug.Assert(backwards != null); 64Debug.Assert(s_EmptyField.IsEmpty); 78Debug.Assert(!_forwards.IsEmpty || _backwards.IsEmpty); 90Debug.Assert(s_EmptyField.IsEmpty); 100Debug.Assert(s_EmptyField.IsEmpty); 116Debug.Assert(_backwardsReversed != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.cs (1)
833Debug.Assert(this.IsEmpty);
System\Collections\Immutable\ImmutableSortedDictionary_2.Enumerator.cs (1)
210Debug.Assert(_stack != null);
System\Collections\Immutable\ImmutableSortedDictionary_2.Node.cs (13)
65Debug.Assert(this.IsEmpty); 82Debug.Assert(!frozen || (left._frozen && right._frozen)); 91Debug.Assert(!this.IsEmpty); 452Debug.Assert(!tree.IsEmpty); 471Debug.Assert(!tree.IsEmpty); 490Debug.Assert(!tree.IsEmpty); 509Debug.Assert(!tree.IsEmpty); 528Debug.Assert(!tree.IsEmpty); 543Debug.Assert(!tree.IsEmpty); 553Debug.Assert(!tree.IsEmpty); 565Debug.Assert(!tree.IsEmpty); 690Debug.Assert(_right != null && _left != null); 757Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableSortedSet_1.cs (6)
235Debug.Assert(newSet != null); 359Debug.Assert(result != null); 1121Debug.Assert(eHasMore); 1139Debug.Assert(eHasMore); 1212Debug.Assert(list.Count > 0); 1264Debug.Assert(list.Count > 0);
System\Collections\Immutable\ImmutableSortedSet_1.Node.cs (18)
70Debug.Assert(this.IsEmpty); 85Debug.Assert(!frozen || (left._frozen && right._frozen)); 207Debug.Assert(_left != null && _right != null); 237Debug.Assert(_left != null && _right != null); 396Debug.Assert(_left != null && _right != null); 476Debug.Assert(_left != null && _right != null); 531Debug.Assert(_left != null && _right != null); 584Debug.Assert(!tree.IsEmpty); 603Debug.Assert(!tree.IsEmpty); 622Debug.Assert(!tree.IsEmpty); 641Debug.Assert(!tree.IsEmpty); 660Debug.Assert(!tree.IsEmpty); 675Debug.Assert(!tree.IsEmpty); 685Debug.Assert(!tree.IsEmpty); 697Debug.Assert(!tree.IsEmpty); 724Debug.Assert(start >= 0); 725Debug.Assert(length >= 0); 748Debug.Assert(_left != null && _right != null);
System\Collections\Immutable\ImmutableStack_1.cs (6)
54Debug.Assert(tail != null); 67Debug.Assert(s_EmptyField.IsEmpty); 77Debug.Assert(s_EmptyField.IsEmpty); 166Debug.Assert(_tail != null); 240Debug.Assert(r != null); 241Debug.Assert(r.IsEmpty == IsEmpty);
System\Collections\Immutable\SortedInt32KeyNode.cs (11)
83Debug.Assert(!frozen || (left._frozen && right._frozen)); 265Debug.Assert(!tree.IsEmpty); 284Debug.Assert(!tree.IsEmpty); 303Debug.Assert(!tree.IsEmpty); 322Debug.Assert(!tree.IsEmpty); 341Debug.Assert(!tree.IsEmpty); 356Debug.Assert(!tree.IsEmpty); 366Debug.Assert(!tree.IsEmpty); 378Debug.Assert(!tree.IsEmpty); 471Debug.Assert(_right != null && _left != null); 538Debug.Assert(_right != null && _left != null);
System.Collections.NonGeneric (1)
System\Collections\SortedList.cs (1)
219Debug.Assert(_size == 0, "Size is not zero");
System.Collections.Specialized (14)
System\Collections\Specialized\HybridDictionary.cs (3)
101Debug.Assert(hashtable != null); 121Debug.Assert(list != null); 242Debug.Assert(hashtable != null);
System\Collections\Specialized\ListDictionary.cs (1)
256Debug.Assert(last != null);
System\Collections\Specialized\NameValueCollection.cs (2)
118Debug.Assert(list != null); 123Debug.Assert(list != null);
System\Collections\Specialized\OrderedDictionary.cs (8)
59Debug.Assert(dictionary != null); 465Debug.Assert(_arrayEnumerator.Current != null); 485Debug.Assert(_arrayEnumerator.Current != null); 497Debug.Assert(_arrayEnumerator.Current != null); 509Debug.Assert(_arrayEnumerator.Current != null); 563Debug.Assert(o != null); 584Debug.Assert(_objectsTable is not null); 590Debug.Assert(o != null);
System.CommandLine.StaticCompletions (1)
CompletionsCommandParser.cs (1)
25Debug.Assert(providers.Select(provider => provider.ArgumentName).SequenceEqual(ShellNames.All));
System.ComponentModel.Annotations (14)
System\ComponentModel\DataAnnotations\EnumDataTypeAttribute.cs (1)
69Debug.Assert(valueType == value.GetType(), "The valueType should equal the Type of the value");
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
119Debug.Assert(value != null);
System\ComponentModel\DataAnnotations\UIHintAttribute.cs (2)
146Debug.Assert(leftParams != null, "leftParams shouldn't be null"); 147Debug.Assert(rightParams != null, "rightParams shouldn't be null");
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (4)
76Debug.Assert(!populateErrorMessageResourceAccessor, "Use the default constructor instead"); 106Debug.Assert(_defaultErrorMessage is null && _errorMessageResourceName is null && _errorMessage is null && _errorMessageResourceType is null); 271Debug.Assert(_errorMessageResourceType != null); 272Debug.Assert(!string.IsNullOrEmpty(_errorMessageResourceName));
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
120Debug.Assert(type != null); 271Debug.Assert(propertyType != null);
System\ComponentModel\DataAnnotations\Validator.cs (4)
648Debug.Assert(instance != null); 947Debug.Assert(validationContext != null); 1017Debug.Assert(instance != null); 1221Debug.Assert(validationContext != null);
System.ComponentModel.Composition (53)
Microsoft\Internal\Collections\CollectionServices.cs (1)
147Debug.Assert(value != null);
Microsoft\Internal\GenerationServices.cs (11)
71Debug.Assert(ilGenerator != null); 171Debug.Assert(ilGenerator != null); 190Debug.Assert(ilGenerator != null); 207Debug.Assert(ilGenerator != null); 218Debug.Assert(ilGenerator != null); 280Debug.Assert(ilGenerator != null); 294Debug.Assert(ilGenerator != null); 301Debug.Assert(ilGenerator != null); 308Debug.Assert(ilGenerator != null); 315Debug.Assert(ilGenerator != null); 322Debug.Assert(ilGenerator != null);
Microsoft\Internal\ReflectionServices.cs (5)
23Debug.Assert(member.DeclaringType != null); 34Debug.Assert(field.DeclaringType != null); 40Debug.Assert(method.DeclaringType != null); 134Debug.Assert(baseType != null); 158Debug.Assert(baseType != null);
System\ComponentModel\Composition\AttributedModelServices.cs (3)
144Debug.Assert(part != null); 186Debug.Assert(part != null); 218Debug.Assert(part != null);
System\ComponentModel\Composition\Hosting\AggregateCatalog.cs (1)
170Debug.Assert(_catalogs != null);
System\ComponentModel\Composition\Hosting\AggregateExportProvider.cs (2)
130Debug.Assert(_readOnlyProviders != null); 181Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\AssemblyCatalog.cs (1)
470Debug.Assert(_assembly != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.cs (2)
116Debug.Assert(_catalog != null); 720Debug.Assert(_importEngine != null);
System\ComponentModel\Composition\Hosting\CatalogExportProvider.ScopeFactoryExport.cs (1)
55Debug.Assert(childContainer.CatalogExportProvider != null);
System\ComponentModel\Composition\Hosting\ComposablePartCatalogChangeEventArgs.cs (2)
63Debug.Assert(_addedDefinitions != null); 80Debug.Assert(_removedDefinitions != null);
System\ComponentModel\Composition\Hosting\CompositionBatch.cs (2)
77Debug.Assert(_readOnlyPartsToAdd != null); 94Debug.Assert(_readOnlyPartsToRemove != null);
System\ComponentModel\Composition\Hosting\CompositionContainer.cs (1)
287Debug.Assert(_providers != null);
System\ComponentModel\Composition\Hosting\CompositionScopeDefinition.cs (2)
151Debug.Assert(_catalog != null); 183Debug.Assert(_catalog != null);
System\ComponentModel\Composition\Hosting\DirectoryCatalog.cs (3)
396Debug.Assert(_fullPath != null); 411Debug.Assert(_loadedFiles != null); 424Debug.Assert(_path != null);
System\ComponentModel\Composition\Hosting\ExportProvider.cs (1)
105Debug.Assert(exports != null);
System\ComponentModel\Composition\Hosting\ExportsChangeEventArgs.cs (2)
66Debug.Assert(_addedExports != null); 83Debug.Assert(_removedExports != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependenciesTraversal.cs (1)
66Debug.Assert(_exportersIndex != null);
System\ComponentModel\Composition\Hosting\FilteredCatalog.DependentsTraversal.cs (1)
70Debug.Assert(_importersIndex != null);
System\ComponentModel\Composition\Hosting\ImportSourceImportDefinitionHelpers.cs (1)
58Debug.Assert(reply != null);
System\ComponentModel\Composition\MetadataViewProvider.cs (1)
47Debug.Assert(implementationAttribute != null);
System\ComponentModel\Composition\Primitives\ComposablePartCatalog.cs (1)
116Debug.Assert(exports != null || _EmptyExportsList != null);
System\ComponentModel\Composition\Primitives\ContractBasedImportDefinition.cs (1)
215Debug.Assert(_requiredMetadata != null);
System\ComponentModel\Composition\Primitives\Export.cs (1)
173Debug.Assert(Definition.Metadata != null);
System\ComponentModel\Composition\Primitives\ExportDefinition.cs (1)
119Debug.Assert(_metadata != null);
System\ComponentModel\Composition\Primitives\ImportDefinition.cs (2)
133Debug.Assert(_contractName != null); 163Debug.Assert(_metadata != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionComposablePart.cs (2)
354Debug.Assert(member != null); 479Debug.Assert(import != null);
System\ComponentModel\Composition\ReflectionModel\ReflectionModelServices.cs (1)
85Debug.Assert(reflectionParameterImportDefinition.ImportingLazyParameter != null);
System.ComponentModel.EventBasedAsync (1)
System\ComponentModel\BackgroundWorker.cs (1)
167Debug.Assert(_asyncOperation != null, "_asyncOperation not initialized");
System.ComponentModel.TypeConverter (137)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\ComponentModel\AmbientValueAttribute.cs (1)
33Debug.Assert(IDesignerHost.IsSupported, "Runtime instantiation of this attribute is not allowed with trimming.");
System\ComponentModel\BindingList.cs (1)
519Debug.Assert(_itemTypeProperties != null);
System\ComponentModel\CultureInfoConverter.cs (4)
184Debug.Assert(invariantIndex >= 0 && invariantIndex < installedCultures.Length); 195Debug.Assert(array[0] == null); 232Debug.Assert(cultureConverter != null); 551Debug.Assert(result.Count == Count);
System\ComponentModel\DecimalConverter.cs (1)
49Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Design\DesigntimeLicenseContext.cs (1)
52Debug.Assert(fileName != null && fileName.Length > 0, "Cannot get local path, fileName is not valid");
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (3)
94Debug.Assert(_stream.Position != 0, "Expected the first byte to be read first"); 97Debug.Assert(_readFirstByte); 175Debug.Assert(binaryWriterIdentifier == BinaryWriterMagic, $"Expected the first byte to be {BinaryWriterMagic}");
System\ComponentModel\Design\PropertyTabAttribute.cs (1)
102Debug.Assert(_tabClassNames != null);
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (3)
49Debug.Assert(source.Member != null); 62Debug.Assert(source.Member != null); 151Debug.Assert(o is RelationshipEntry, "This is only called indirectly from a dictionary only containing RelationshipEntry structs.");
System\ComponentModel\EventDescriptorCollection.cs (3)
349Debug.Assert(foundCount == eventCount, "We did not completely fill our event array"); 421Debug.Assert(count == 0 || array != null, "if array is null, count should be 0"); 422Debug.Assert(array == null || count <= array.Length, "Trying to enumerate more than the array contains");
System\ComponentModel\ExtendedPropertyDescriptor.cs (5)
25Debug.Assert(extenderInfo != null, "ExtendedPropertyDescriptor must have extenderInfo"); 26Debug.Assert(provider != null, "ExtendedPropertyDescriptor must have provider"); 47Debug.Assert(extender != null, "The original PropertyDescriptor must be non-null"); 51Debug.Assert(attr != null, "The original PropertyDescriptor does not have an ExtenderProvidedPropertyAttribute"); 56Debug.Assert(reflectDesc != null, "The original PropertyDescriptor has an invalid ExtenderProperty");
System\ComponentModel\ExtenderProvidedPropertyAttribute.cs (4)
69Debug.Assert(other.Provider == null); 70Debug.Assert(other.ReceiverType == null); 71Debug.Assert(Provider == null); 72Debug.Assert(ReceiverType == null);
System\ComponentModel\GuidConverter.cs (1)
61Debug.Assert(ctor != null, "Expected constructor to exist.");
System\ComponentModel\Int128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\InterlockedBitVector32.cs (1)
43Debug.Assert(previous != unchecked((int)0x80000000));
System\ComponentModel\LicenseManager.cs (3)
196Debug.Assert(providerType != null, "Type cannot ever be null"); 205Debug.Assert(type != null, "IsValid Type cannot ever be null"); 216Debug.Assert(type != null, "IsValid Type cannot ever be null");
System\ComponentModel\LicFileLicenseProvider.cs (2)
52Debug.Assert(context != null, "No context provided!"); 84Debug.WriteLine($"Looking for license in: {licenseFile}");
System\ComponentModel\MaskedTextProvider.cs (15)
635Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 647Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range."); 1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value."); 1946Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars."); 1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range."); 2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2038Debug.Assert(charDescriptor != null, "Null character descriptor."); 2051Debug.Assert(!IsLiteralPosition(charDex), "Setting char in literal position."); 2084Debug.Assert(AssignedEditPositionCount <= EditPositionCount, "Invalid count of assigned chars."); 2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range."); 2324Debug.Fail("Invalid mask language character."); 2420Debug.Assert(input != null, "null input."); 2421Debug.Assert(position >= 0, "Position out of range.");
System\ComponentModel\NullableConverter.cs (1)
111Debug.Assert(ci != null, "Couldn't find constructor");
System\ComponentModel\PropertyDescriptorCollection.cs (1)
367Debug.Assert(foundCount == propCount, "We did not completely fill our property array");
System\ComponentModel\ReflectEventDescriptor.cs (10)
89Debug.Assert(type.IsSubclassOf(typeof(Delegate)), $"Not a valid ReflectEvent: {componentClass.FullName}. {name} {type.FullName}"); 99Debug.Assert(eventInfo.ReflectedType!.IsAssignableFrom(componentClass), "eventInfo.ReflectedType is used below, but only componentClass is annotated with DynamicallyAccessedMembers. Ensure ReflectedType is in componentClass's hierarchy."); 236Debug.Assert(_componentClass != null, "Must have a component class for FilterAttributes"); 243Debug.Assert(_removeMethod != null, $"Null remove method for {Name}"); 246Debug.Assert(_addMethod != null, $"Null remove method for {Name}"); 262Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 263Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy"); 368Debug.Fail($"Missing event accessors for {_componentClass.FullName}. {Name}"); 383Debug.Assert(currentReflectType != null, "currentReflectType cannot be null"); 384Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
System\ComponentModel\ReflectPropertyDescriptor.cs (11)
88Debug.WriteLine($"Creating ReflectPropertyDescriptor for {componentClass?.FullName}.{name}"); 94Debug.WriteLine($"type == null, name == {name}"); 99Debug.WriteLine($"componentClass == null, name == {name}"); 107Debug.Fail($"Property '{name}' on component {componentClass?.FullName} failed to init."); 108Debug.Fail(t.ToString()); 751Debug.Assert(_componentClass != null, "Must have a component class for FillAttributes"); 903Debug.WriteLine($"[{Name}]: GetValue({component?.GetType().Name ?? "(null)"})"); 907Debug.WriteLine($"[{Name}]: ---> returning: null"); 911Debug.Assert(component != null, "GetValue must be given a component"); 943Debug.WriteLine("[" + Name + "]: ---> returning: null"); 1080Debug.WriteLine($"[{Name}]: SetValue({component?.GetType().Name ?? "(null)"}, {value?.GetType().Name ?? "(null)"})");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (17)
224Debug.Assert(table != null, "COMPAT: Editor table should not be null"); // don't throw; RTM didn't so we can't do it either. 245Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 611Debug.Assert(eppa != null, $"Extender property {prop.Name} has no provider attribute. We will skip it."); 766Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 771Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 782Debug.Assert(idx < extenderCount, "There are more extenders than we expect"); 787Debug.Assert(idx == extenderCount, "Wrong number of extenders"); 821Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 827Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 908Debug.Assert(objectType != null, "Should have arg-checked before coming in here"); 921Debug.Assert(td != null); 929Debug.Assert(td != null); 1032Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us."); 1185Debug.Fail("Hey, assumption holds true. Rip this assert."); 1205Debug.Assert(dbgEvent != null, $"Holes in event array for type {type}"); 1399Debug.Assert(Array.TrueForAll(properties, dbgProp => dbgProp is not null), $"Holes in property array for type {type}"); 1585Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
System\ComponentModel\ReflectTypeDescriptionProvider.ReflectedTypeData.cs (2)
232Debug.Assert(_converter != null, "There is no intrinsic setup in the hashtable for the Object type"); 376Debug.Fail($"Editor {editor.GetType().FullName} is not an instance of {editorBaseType.FullName} but it is in that base types table.");
System\ComponentModel\TypeDescriptor.cs (36)
690Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 716Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 855Debug.Assert(converter != null, "Unexpected null TypeConverter."); 865Debug.Assert(converter != null, "Unexpected null TypeConverter."); 907Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 929Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 945Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 967Debug.Fail("COMPAT: Returning null, but you should not pass null here"); 1105Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1132Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1191Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1342Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1369Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1448Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here"); 1658Debug.Assert(type != null, "Caller should validate"); 1746Debug.Assert(instance != null, "Caller should validate"); 1845Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain."); 1885Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes"); 1938Debug.Fail("unknown pipeline type"); 1975Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache"); 2033Debug.Assert(suffix != null, "Name collision with non-extender property."); 2065Debug.Fail("unknown pipeline type"); 2136Debug.Fail("unknown pipeline type"); 2277Debug.Fail("unknown pipeline type"); 2317Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2400Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2462Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2521Debug.Fail("COMPAT: Returning, but you should not pass null here"); 2925Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member"); 3096Debug.Assert(attrs != null, "Someone should have handled this"); 3107Debug.Assert(className != null, "Someone should have handled this"); 3127Debug.Assert(converter != null, "Someone should have handled this"); 3169Debug.Assert(events != null, "Someone should have handled this"); 3181Debug.Assert(events != null, "Someone should have handled this"); 3193Debug.Assert(properties != null, "Someone should have handled this"); 3207Debug.Assert(properties != null, "Someone should have handled this");
System\ComponentModel\UInt128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System\ComponentModel\UriTypeConverter.cs (1)
74Debug.Assert(ctor != null, "Couldn't find constructor");
System\ComponentModel\VersionConverter.cs (1)
75Debug.Assert(ctor != null, "Couldn't find constructor");
System\Drawing\ColorConverter.cs (1)
125Debug.Assert(member != null, "Could not convert color to member. Did someone change method name / signature and not update ColorConverter?");
System\Timers\TimersDescriptionAttribute.cs (1)
36Debug.Fail($"Unexpected resource {id}");
System.Composition.Hosting (11)
System\Composition\Hosting\CompositionHost.cs (1)
27Debug.Assert(rootLifetimeContext != null);
System\Composition\Hosting\Core\CompositionDependency.cs (1)
142Debug.Assert(IsError, "Should be in error state.");
System\Composition\Hosting\Core\CompositionOperation.cs (1)
74Debug.Assert(sharingLock != null, "Expected a sharing lock to be passed.");
System\Composition\Hosting\Core\CycleBreakingExportDescriptor.cs (2)
45Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString()); 49Debug.WriteLine("[System.Composition] Activating via cycle-breaking proxy.");
System\Composition\Hosting\Core\CycleBreakingMetadataDictionary.cs (1)
25Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\ExportDescriptorRegistry.cs (1)
51Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\ExportDescriptorRegistryUpdate.cs (2)
64Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString()); 102Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Core\LifetimeContext.cs (1)
96Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System\Composition\Hosting\Providers\Metadata\MetadataViewProvider.cs (1)
88Debug.WriteLine(SR.Diagnostic_ThrowingException, ex.ToString());
System.Composition.Runtime (2)
System\Composition\Runtime\Util\Formatters.cs (2)
24Debug.Assert(closedGenericType != null); 25Debug.Assert(closedGenericType.IsConstructedGenericType);
System.Configuration.ConfigurationManager (122)
src\runtime\src\libraries\Common\src\System\Security\IdentityHelper.cs (2)
79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 119Debug.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
System\Configuration\ApplicationSettingsBase.cs (1)
694Debug.Assert(provider != null, "Could not determine provider from which settings were loaded");
System\Configuration\BaseConfigurationRecord.cs (33)
450Debug.Assert(inputsPerConfigKey.Count > 0, "We won't get here unless we have inputs."); 542Debug.Assert(!_parent.IsInitDelayed, "!_parent.IsInitDelayed"); 648Debug.Assert(!sectionRecord.HasIndirectLocationInputs, 773Debug.Assert(requestIsHere || !checkPermission, "requestIsHere || !checkPermission"); 776Debug.Assert(getRuntimeObject, "getRuntimeObject == true"); 777Debug.Assert(requestIsHere, "requestIsHere == true"); 793Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors"); 940Debug.Assert(factoryRecord != null, "factoryRecord != null"); 953Debug.Assert(factoryRecord != null, "factoryRecord != null"); 959Debug.Assert(!checkPermission || (factoryRecord != null), 1012Debug.Assert(success || getLkg, "success || getLkg"); 1016Debug.Assert(getLkg, "getLkg == true"); 1045Debug.Assert(!requestIsHere, "!requestIsHere"); 1085Debug.Assert(getLkg, "getLkg == true"); 1158Debug.Assert(!factoryRecord.HasErrors, "!factoryRecord.HasErrors"); 1161Debug.Assert(sectionRecord.HasInput, "sectionRecord.HasInput"); 1169Debug.Assert(!(IsLocationConfig && getLkg), 1179Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors"); 1219Debug.Assert(IsLocationConfig, 1272Debug.Assert((locationInputs != null) || (indirectLocationInputs != null), 1293Debug.Assert(getLkg, "getLkg == true"); 1608Debug.Assert(_protectedConfig != null, 1670Debug.Assert(tConfigRecord._parent.IsRootConfig, 1724Debug.Assert(!rootFactoryRecord.HasErrors, "!rootFactoryRecord.HasErrors"); 2167Debug.Assert(UrlPath.IsSubpath(_parent.ConfigPath, input.SectionXmlInfo.TargetConfigPath)); 2245Debug.Assert(FindFactoryRecord(configKey, true) != null); 2261Debug.Assert(mode != OverrideMode.Inherit); // Remember that the default is never Inherit 2276Debug.Assert(mode != OverrideMode.Inherit); 2618Debug.Assert(!positionedAtNextElement, "!positionedAtNextElement"); 3664Debug.Assert(factoryRecord.HasErrors, 3746Debug.Assert(x.SectionXmlInfo.ConfigKey == y.SectionXmlInfo.ConfigKey); 3774Debug.Assert(StringUtil.EqualsIgnoreCase(yTargetConfigPath, xTargetConfigPath)); 3792Debug.Fail("It's not possible for two location input to come from the same config file and point to the same target");
System\Configuration\ClientConfigurationHost.cs (3)
231Debug.Fail("unexpected config name: " + configName); 251Debug.Fail("unexpected config name: " + configName); 418Debug.Fail("unrecognized configPath " + configPath);
System\Configuration\ClientSettingsStore.cs (2)
70Debug.Assert(settingsGroup != null, "Failed to declare settings group"); 246Debug.Fail("Did not expect to get called here");
System\Configuration\ConfigPathUtility.cs (5)
60Debug.Assert(string.IsNullOrEmpty(parentConfigPath) || IsValid(parentConfigPath), 62Debug.Assert(string.IsNullOrEmpty(childConfigPath) || IsValid(childConfigPath), 76Debug.Assert(IsValid(configPath), "IsValid(configPath)"); 86Debug.Assert(string.IsNullOrEmpty(configPath) || IsValid(configPath), 96Debug.Assert(index != configPath.Length - 1);
System\Configuration\ConfigurationElement.cs (11)
182Debug.Assert(Properties.Contains(propertyName), "Properties.Contains(propertyName)"); 732Debug.Assert(type != null, "type != null"); 762Debug.Assert(propertyInformation != null, "propertyInformation != null"); 785Debug.Assert((type != null) && (validator != null)); 786Debug.Assert(typeof(ConfigurationElement).IsAssignableFrom(type)); 796Debug.Assert(!s_perTypeValidators.ContainsKey(type)); 810Debug.Assert(root != null); 821Debug.Assert(elem != null); 1710Debug.Assert(prop != null, "prop != null"); 1711Debug.Assert(reader != null, "reader != null"); 1741Debug.Fail("Unknown exception type thrown");
System\Configuration\ConfigurationProperty.cs (2)
70Debug.Assert(info != null, "info != null"); 146Debug.Assert(propertyAttribute != null, "attribProperty != null");
System\Configuration\ConfigurationValidatorAttribute.cs (2)
43Debug.Fail("Declaring type must not be null."); 54Debug.Assert(_declaringType == declaringType,
System\Configuration\ConfigXmlReader.cs (1)
32Debug.Assert(!_lineNumberIsConstant || (_lineOffset > 0),
System\Configuration\ContextInformation.cs (1)
16Debug.Assert(configRecord != null, "configRecord != null");
System\Configuration\ErrorsHelper.cs (2)
23Debug.Assert(e != null, "e != null"); 53Debug.Assert(errors.Count != 0, "errors.Count != 0");
System\Configuration\InfiniteIntConverter.cs (1)
21Debug.Assert(data is string, "data is string");
System\Configuration\Internal\InternalConfigRoot.cs (2)
184Debug.Assert(!_hierarchyLock.IsWriterLockHeld, "!_hierarchyLock.IsWriterLockHeld"); 207Debug.Assert(!_hierarchyLock.IsReaderLockHeld, "!_hierarchyLock.IsReaderLockHeld");
System\Configuration\LocalFileSettingsProvider.cs (1)
358Debug.Assert(groupName != null, "SettingsContext did not have a GroupName!");
System\Configuration\MgmtConfigurationRecord.cs (28)
338Debug.Assert(sectionRecord != null); 342Debug.Assert(input.HasResult, "input.HasResult"); 349Debug.Assert(IsLocationConfig, "Indirect location inputs exist only in location config record"); 351Debug.Assert(input != null); 352Debug.Assert(input.HasResult, "input.HasResult"); 381Debug.Assert(!current.IsRootConfig, "An immediate parent result should have been found"); 965Debug.Assert(filename.Length > 0, "The caller should make sure that filename is not empty"); 1397Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared"); 1398Debug.Assert(!IsImplicitSection(factoryRecord.ConfigKey), 1427Debug.Assert(!IsImplicitSection(sectionRecord.ConfigKey), 1429Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared"); 1799Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs, 1821Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs, 1984Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2080Debug.Assert(IsLocationConfig, "IsLocationConfig"); 2209Debug.Assert((reader.NodeType == XmlNodeType.Element) && (reader.Name == ConfigurationTag), 2270Debug.Assert( 2345Debug.Assert( 2350Debug.Assert(!l.SectionUpdates.HasUnretrievedSections(), 2410Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2469Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section"); 2551Debug.Assert(groupUpdate.UpdatedXml == null, "groupUpdate.UpdatedXml == null"); 2552Debug.Assert(!declarationUpdatesChild.HasUnretrievedSections(), 2638Debug.Assert(locationPathApplies, nameof(locationPathApplies)); 2707Debug.Assert(LocationSubPath == null); 2731Debug.Assert(allowOverrideAttribute == null, 2983Debug.Assert(update.SectionRecord.HasFileInput, "update.SectionRecord.HasFileInput"); 3024Debug.Assert(hasFile, "hasFile");
System\Configuration\OverrideModeSetting.cs (5)
114Debug.Assert((x._mode & ApiDefinedAny) != 0); 192Debug.Assert(useLegacy || ((_mode & ApiDefinedNewMode) != 0)); 204Debug.Assert(useLegacy || ((_mode & XmlDefinedNewMode) != 0)); 249Debug.Fail("Missing xml keyword for OverrideMode enum value"); 299Debug.Fail("Unrecognized OverrideMode");
System\Configuration\SchemeSettingInternal.cs (1)
15Debug.Assert(name != null, "'name' must not be null.");
System\Configuration\SectionInformation.cs (1)
210Debug.Fail("Unexpected value for OverrideMode");
System\Configuration\SectionRecord.cs (1)
168Debug.Assert(sectionInput != null);
System\Configuration\SectionUpdates.cs (1)
37Debug.Assert(string.IsNullOrEmpty(_name), "FindSectionUpdates assumes search is from root record");
System\Configuration\SettingsPropertyValue.cs (1)
274Debug.Fail("Should not have gotten here with Binary formatting");
System\Configuration\UpdateConfigHost.cs (1)
33Debug.Assert(!string.IsNullOrEmpty(oldStreamname));
System\Configuration\ValidatorUtils.cs (1)
69Debug.Assert(resolution > 0, "resolution > 0");
System\Configuration\XmlUtil.cs (8)
109Debug.Assert(trueLinePosition > 0, "trueLinePosition > 0"); 364Debug.Assert(Reader.NodeType == XmlNodeType.Element, "Reader.NodeType == XmlNodeType.Element"); 397Debug.Assert(Reader.Depth == depth, "We should be at the same depth as the opening Element"); 452Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType == XmlNodeType.Element"); 507Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType== XmlNodeType.Element"); 722Debug.Assert(utilWriter.TrackPosition, 831Debug.Assert(Reader.NodeType == XmlNodeType.Element, 866Debug.Assert(Reader.NodeType == XmlNodeType.Element, "_reader.NodeType == NodeType.Element");
System\Diagnostics\ListenerElementsCollection.cs (3)
57Debug.Assert((listenerElement != null), "adding elements other than ListenerElement to ListenerElementsCollection?"); 184Debug.Assert(_allowReferences, "_allowReferences must be true if type name is null"); 310Debug.Assert(_allowReferences, "_allowReferences must be true if type name is null");
System\Diagnostics\TraceUtils.cs (2)
112Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!"); 127Debug.Assert(tiexc.InnerException != null, "ill-formed TargetInvocationException!");
System.Console (49)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
70Debug.Assert(passwd.Name != null);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
107Debug.Assert(passwd.HomeDirectory != null);
System\Console.cs (3)
199Debug.Assert(!Monitor.IsEntered(s_syncObject)); 579Debug.Assert(s_sigQuitRegistration is null); 1041Debug.Assert(ctx.Signal == PosixSignal.SIGINT || ctx.Signal == PosixSignal.SIGQUIT);
System\ConsolePal.Unix.ConsoleStream.cs (2)
27Debug.Assert(handle != null, "Expected non-null console handle"); 28Debug.Assert(!handle.IsInvalid, "Expected valid console handle");
System\ConsolePal.Unix.cs (12)
264Debug.Assert(left >= 0); 441Debug.Assert(!Console.IsInputRedirected); 484Debug.Assert(!string.IsNullOrEmpty(TerminalFormatStrings.CursorPositionReport)); 521Debug.Assert(readBytesPos > 0 && readBytesPos <= readBytes.Length); 522Debug.Assert(escPos == 0 && bracketPos > escPos && semiPos > bracketPos && rPos > semiPos); 523Debug.Assert(readBytes[escPos] == Esc); 524Debug.Assert(readBytes[bracketPos] == '['); 525Debug.Assert(readBytes[semiPos] == ';'); 526Debug.Assert(readBytes[rPos] == 'R'); 613Debug.Assert(foundByteDstPos < foundByteDst.Length, "Should only be called when there's room for at least one byte."); 951Debug.Assert(result <= buffer.Length); 959Debug.Assert(handle is not null);
System\IO\ConsoleStream.cs (1)
18Debug.Assert(access == FileAccess.Read || access == FileAccess.Write);
System\IO\KeyParser.cs (3)
21Debug.Assert(length > 0); 371Debug.Assert(single != 'b' && single != '\t' && single != '\n' && single != '\r'); 384Debug.Assert(single == default || char.IsBetween(single, (char)28, (char)31));
System\IO\StdInReader.cs (7)
37Debug.Assert(!Console.IsInputRedirected); // stdin is a terminal. 75Debug.Assert(_endIndex > 0); 91Debug.Assert(result >= 0 && result <= bufferSize); // may be 0 if hits EOL 130Debug.Assert(!buffer.IsEmpty); 151Debug.Assert(_tmpKeys.Count == 0); 152Debug.Assert(consumeKeys || _availableKeys.Count == 0); 340Debug.Assert(_availableKeys.Count == 0);
System\IO\SyncTextReader.cs (1)
20Debug.Assert(reader != null);
System\IO\SyncTextReader.Unix.cs (1)
18Debug.Assert(inner != null);
System\TerminalFormatStrings.cs (1)
91Debug.WriteLineIf(db.GetString(TermInfo.WellKnownStrings.CursorPositionReport) != CursorPositionReport,
System\TermInfo.cs (5)
180Debug.Assert(char.IsAsciiDigit(format[pos])); 191Debug.Assert(char.IsAsciiDigit(format[pos])); 199Debug.Assert(format[pos + 2] == '\''); 290Debug.Assert(format[pos] == 'e' || format[pos] == ';'); 353Debug.Assert(arg is string || arg is int);
System\TermInfo.Database.cs (3)
110Debug.Assert(index >= 0); 135Debug.Assert(name != null); 147Debug.Assert(index >= 0);
System.Data.Common (1046)
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (3)
37Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 240Debug.Assert(e != null, "Unexpected null exception!"); 260Debug.Assert(e != null, "Unexpected null exception!");
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (12)
414Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex"); 428Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 429Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 494Debug.Assert(parsetableContainsKey, $"{nameof(ParseInternal)} code vs. regex mismatch keyname <{keyname}>"); 495Debug.Assert(value1 == value2, $"{nameof(ParseInternal)} code vs. regex mismatch keyvalue <{value1}> <{value2}>"); 520Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>"); 524Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}"); 530Debug.Fail("ParseInternal code threw exception vs regex mismatch"); 537Debug.Assert(null != connectionString, "null connectionstring"); 559Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 560Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 641Debug.Assert(expanded, "password/pwd was not removed");
src\runtime\src\libraries\Common\src\System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
System\Data\Common\AdapterUtil.Common.cs (21)
27Debug.Assert(e != null, "TraceException: null Exception"); 36Debug.Assert(IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 73Debug.Fail("valid AcceptRejectRule " + value.ToString()); 88Debug.Fail("valid CatalogLocation " + value.ToString()); 103Debug.Fail("valid ConflictOption " + value.ToString()); 121Debug.Fail("valid DataRowState " + value.ToString()); 136Debug.Fail("valid KeyRestrictionBehavior " + value.ToString()); 152Debug.Fail("valid LoadOption " + value.ToString()); 168Debug.Fail("valid MissingMappingAction " + value.ToString()); 185Debug.Fail("valid MissingSchemaAction " + value.ToString()); 201Debug.Fail("valid Rule " + value.ToString()); 216Debug.Fail("valid SchemaType " + value.ToString()); 234Debug.Fail("valid StatementType " + value.ToString()); 251Debug.Fail("valid UpdateStatus " + value.ToString()); 460Debug.Fail("shouldn't be here"); 495Debug.Fail("shouldn't be here"); 498Debug.Fail("isRowUpdatingCommand should have been true"); 592Debug.Fail("should be here"); 628Debug.Fail("isRowUpdatingCommand should have been true"); 728Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState"); 753Debug.Assert(0 == (rowStates & dataRow.RowState), "flagged RowState");
System\Data\Common\BigIntegerStorage.cs (3)
44Debug.Assert(0 <= recordNo, "Invalid record"); 45Debug.Assert(null != value, "null value"); 129Debug.Assert(null != value, "null value");
System\Data\Common\BooleanStorage.cs (3)
95Debug.Assert(0 <= recordNo, "Invalid record"); 96Debug.Assert(null != value, "null value"); 149System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ByteStorage.cs (3)
167Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\CharStorage.cs (3)
94Debug.Assert(0 <= recordNo, "Invalid record"); 95System.Diagnostics.Debug.Assert(null != value, "null value"); 148System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DataAdapter.cs (2)
37Debug.Assert(readerHandler.FieldCount > 0, "Scenario expects non-empty results but no fields reported by reader"); 449Debug.Assert(null != dataTables[i], "null DataTable Fill");
System\Data\Common\DataColumnMapping.cs (3)
91Debug.Assert(null != columns, "GetDataColumnBySchemaAction: unexpected null DataColumnCollection"); 97Debug.Assert(null != dataColumn, "GetDataColumnBySchemaAction: unexpected null dataColumn"); 117Debug.Assert(dataTable != null, "Should not call with a null DataTable");
System\Data\Common\DataColumnMappingCollection.cs (2)
350Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 381Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DataRecordInternal.cs (2)
21Debug.Assert(null != schemaInfo, "invalid attempt to instantiate DataRecordInternal with null schema information"); 22Debug.Assert(null != values, "invalid attempt to instantiate DataRecordInternal with null value[]");
System\Data\Common\DataStorage.cs (14)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified"); 239Debug.Fail("not a String or SqlString column"); 297Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified"); 357Debug.Fail("shouldn't be here"); 381Debug.Assert(storageType != StorageType.Empty); 465Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType"); 478Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 505Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable"); 506Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking"); 507Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking"); 508Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable"); 513Debug.Assert(dataType != null, "Type should not be null"); 524Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType"); 595Debug.Assert(null != type, "null type");
System\Data\Common\DataTableMappingCollection.cs (1)
287Debug.Assert((null != _items) && (0 <= index) && (index < Count), "RemoveIndex, invalid");
System\Data\Common\DateTimeOffsetStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DateTimeStorage.cs (3)
106System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 107System.Diagnostics.Debug.Assert(null != value, "null value"); 156System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DBCommandBuilder.cs (13)
201Debug.Assert(_isMutatedName[iMutatedName], $"{_baseParameterNames[iMutatedName]} expected to be a mutated name"); 608Debug.Fail("Rowcount expected to be 1"); 799Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 820Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 911Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name"); 1135Debug.Assert(!string.IsNullOrEmpty(sourceColumn), "empty source column"); 1167Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1168Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1216Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?"); 1217Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?"); 1402Debug.Assert(null != p, "null CreateParameter"); 1552Debug.Fail("how did we get here?"); 1617Debug.Fail("how did we get here?");
System\Data\Common\DbConnectionOptions.cs (2)
158Debug.Assert(!_useOdbcRules, "ExpandKeyword not ready for Odbc"); 167Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower");
System\Data\Common\DbConnectionStringBuilder.cs (5)
150Debug.Assert(keyword != null); 254Debug.Assert(null != values[i], $"null value {keylist.Current}"); 447Debug.Assert(reflected != null); 476Debug.Assert(keyword != null); 561Debug.Assert(property != null);
System\Data\Common\DbDataAdapter.cs (25)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType"); 937Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error"); 966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows"); 967Debug.Assert(null != tableMapping, "Update: bad DataTableMapping"); 1038Debug.Fail("InvalidDataRowState"); 1366Debug.Assert(rowUpdatedEvent.Rows != null); 1451Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1462Debug.Assert(null != connection, "unexpected null connection"); 1497Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1498Debug.Assert(null != dataCommand, "null dataCommand"); 1499Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent"); 1560Debug.Fail("unexpected StatementType"); 1585Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception"); 1597Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent"); 1619Debug.Assert(null != batchCommands, "null batchCommands?"); 1638Debug.Assert(null != row, "null dataRow?"); 1654Debug.Assert(null != batchCommands, "null batchCommands?"); 1670Debug.Assert(null != row, "null dataRow?"); 1706Debug.Assert(null != batchCommands, "null batchCommands?"); 1713Debug.Assert(null != row, "null dataRow?"); 1724Debug.Assert(null != dataRow, "null dataRow"); 1771Debug.Assert(null != command, "GetConnection3: null command"); 1772Debug.Assert(!string.IsNullOrEmpty(method), "missing method name"); 1783Debug.Assert(null != command, "GetConnection4: null command"); 1824Debug.Assert(null != connection, "QuietOpen: null connection");
System\Data\Common\DbDataReaderExtensions.cs (1)
80Debug.Assert(row != null);
System\Data\Common\DbDataSource.cs (2)
103Debug.Assert(wrappedCommand.Connection is not null); 362Debug.Assert(wrappedBatch.Connection is not null);
System\Data\Common\DbEnumerator.cs (1)
60Debug.Assert(null != _schemaInfo && null != _descriptors, "unable to build schema information!");
System\Data\Common\DBSchemaRow.cs (3)
33Debug.Assert(null != dataRows, "GetSchemaRows: unexpected null dataRows"); 70Debug.Assert(null != _schemaTable.ColumnName, "no column ColumnName"); 84Debug.Assert(null != _schemaTable.Size, "no column Size");
System\Data\Common\DecimalStorage.cs (3)
172System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 173System.Diagnostics.Debug.Assert(null != value, "null value"); 217System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\DoubleStorage.cs (3)
167System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 168System.Diagnostics.Debug.Assert(null != value, "null value"); 221System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\FieldNameLookup.cs (1)
31Debug.Assert(null != fieldNames[i]);
System\Data\Common\Int16Storage.cs (3)
184System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 185System.Diagnostics.Debug.Assert(null != value, "null value"); 235System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int32Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\Int64Storage.cs (3)
175System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 176System.Diagnostics.Debug.Assert(null != value, "null value"); 226System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\ObjectStorage.cs (3)
235Debug.Assert(null != value, "null value"); 424Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 508Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\SByteStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 223System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SingleStorage.cs (3)
168System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 169System.Diagnostics.Debug.Assert(null != value, "null value"); 222System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\SQLConvert.cs (16)
14Debug.Assert(value != null, "null argument in ConvertToSqlByte"); 32Debug.Assert(value != null, "null argument in ConvertToSqlInt16"); 51Debug.Assert(value != null, "null argument in ConvertToSqlInt32"); 74Debug.Assert(value != null, "null argument in ConvertToSqlInt64"); 99Debug.Assert(value != null, "null argument in ConvertToSqlDouble"); 132Debug.Assert(value != null, "null argument in ConvertToSqlDecimal"); 162Debug.Assert(value != null, "null argument in ConvertToSqlSingle"); 193Debug.Assert(value != null, "null argument in ConvertToSqlMoney"); 223Debug.Assert(value != null, "null argument in ConvertToSqlDateTime"); 241Debug.Assert(value != null, "null argument in ConvertToSqlBoolean"); 259Debug.Assert(value != null, "null argument in ConvertToSqlGuid"); 277Debug.Assert(value != null, "null argument in ConvertToSqlBinary"); 295Debug.Assert(value != null, "null argument in ConvertToSqlString"); 313Debug.Assert(value != null, "null argument in ConvertToSqlChars"); 329Debug.Assert(value != null, "null argument in ConvertToSqlBytes"); 561Debug.Assert(value is string || type == typeof(string), "invalid call to ChangeTypeForXML");
System\Data\Common\SQLTypes\SQLBinaryStorage.cs (3)
59Debug.Assert(null != value, "null value"); 118Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 119Debug.Assert((value.GetType() == typeof(SqlBinary)), "wrong input type");
System\Data\Common\SQLTypes\SQlBooleanStorage.cs (3)
93Debug.Assert(null != value, "null value"); 152Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 153Debug.Assert((value.GetType() == typeof(SqlBoolean)), "wrong input type");
System\Data\Common\SQLTypes\SQLBytesStorage.cs (2)
116Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 117Debug.Assert((value.GetType() == typeof(SqlBytes)), "wrong input type");
System\Data\Common\SQLTypes\SQLByteStorage.cs (3)
168Debug.Assert(null != value, "null value"); 228Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 229Debug.Assert((value.GetType() == typeof(SqlByte)), "wrong input type");
System\Data\Common\SQLTypes\SQLCharsStorage.cs (2)
119Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 120Debug.Assert((value.GetType() == typeof(SqlChars)), "wrong input type");
System\Data\Common\SQLTypes\SQLDateTimeStorage.cs (3)
95Debug.Assert(null != value, "null value"); 154Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 155Debug.Assert((value.GetType() == typeof(SqlDateTime)), "wrong input type");
System\Data\Common\SQLTypes\SQLDecimalStorage.cs (3)
167Debug.Assert(null != value, "null value"); 226Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 227Debug.Assert((value.GetType() == typeof(SqlDecimal)), "wrong input type");
System\Data\Common\SQLTypes\SQLDoubleStorage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlDouble)), "wrong input type");
System\Data\Common\SQLTypes\SQLGuidStorage.cs (3)
60Debug.Assert(null != value, "null value"); 119Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 120Debug.Assert((value.GetType() == typeof(SqlGuid)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt16Storage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlInt16)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt32Storage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlInt32)), "wrong input type");
System\Data\Common\SQLTypes\SQLInt64Storage.cs (3)
169Debug.Assert(null != value, "null value"); 228Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 229Debug.Assert((value.GetType() == typeof(SqlInt64)), "wrong input type");
System\Data\Common\SQLTypes\SQLMoneyStorage.cs (3)
168Debug.Assert(null != value, "null value"); 227Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 228Debug.Assert((value.GetType() == typeof(SqlMoney)), "wrong input type");
System\Data\Common\SQLTypes\SQLSingleStorage.cs (3)
166Debug.Assert(null != value, "null value"); 225Debug.Assert(!DataStorage.IsObjectNull(value), "we should have null here"); 226Debug.Assert((value.GetType() == typeof(SqlSingle)), "wrong input type");
System\Data\Common\SQLTypes\SQLStringStorage.cs (3)
115Debug.Assert(null != value, "null value"); 180Debug.Assert(!DataStorage.IsObjectNull(value), "we shouldn't have null here"); 181Debug.Assert((value.GetType() == typeof(SqlString)), "wrong input type");
System\Data\Common\SqlUDTStorage.cs (2)
191Debug.Assert(xmlReader is DataTextReader, "Invalid DataTextReader is being passed to customer"); 228Debug.Assert(xmlWriter is DataTextWriter, "Invalid DataTextWriter is being passed to customer");
System\Data\Common\StringStorage.cs (3)
102Debug.Assert(recordNo != -1, "Invalid (-1) parameter: 'recordNo'"); 103Debug.Assert(null != value, "null value"); 169Debug.Assert(null != value, "null value");
System\Data\Common\TimeSpanStorage.cs (3)
163System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 164System.Diagnostics.Debug.Assert(null != value, "null value"); 241System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt16Storage.cs (3)
183System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 184System.Diagnostics.Debug.Assert(null != value, "null value"); 234System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt32Storage.cs (3)
182System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 183System.Diagnostics.Debug.Assert(null != value, "null value"); 233System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\Common\UInt64Storage.cs (3)
173System.Diagnostics.Debug.Assert(0 <= recordNo, "Invalid record"); 174System.Diagnostics.Debug.Assert(null != value, "null value"); 224System.Diagnostics.Debug.Assert(null != value, "null value");
System\Data\ConstraintCollection.cs (5)
32Debug.Assert(table != null); 284Debug.Assert(constraint != null, "Attempt to add null constraint to constraint array"); 564Debug.Assert(a1 != null && a2 != null, "Invalid Arguments"); 667Debug.Assert(name != null); 795Debug.Assert(constr._parentTableName != null);
System\Data\ConstraintEnumerator.cs (3)
46Debug.Assert(_constraints.Current is Constraint, "ConstraintEnumerator, contains object which is not constraint"); 60Debug.Assert(_currentObject != null, "GetObject should never be called w/ null currentObject."); 78Debug.Assert(CurrentObject != null, "GetObject should never be called w/ null currentObject.");
System\Data\DataColumn.cs (42)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName)); 456Debug.Assert(value != null); 647Debug.Assert(_defaultValue != null, "It should not have been set to null."); 859Debug.Assert(null != _storage, "no storage"); 868Debug.Assert(null != _storage, "no storage"); 877Debug.Assert(null != _storage, "no storage"); 888Debug.Assert(_simpleType.CanHaveMaxLength(), "expected simpleType to be string"); 1028Debug.Assert(2 <= _sortIndex.RefCount, "bad sortIndex refcount"); 1096Debug.Assert(table != null || !Unique); 1131Debug.Assert(null != _storage, "null storage"); 1139Debug.Assert(null != _storage, "no storage"); 1140Debug.Assert(null != value, "setting null, expecting dbnull"); 1142Debug.Assert(null != _table, "storage with no DataTable on column"); 1169Debug.Assert(null != _storage, "no storage"); 1178Debug.Assert(null != value, "setting null, expecting dbnull"); 1179Debug.Assert(null != _table, "storage with no DataTable on column"); 1180Debug.Assert(null != _storage, "no storage"); 1196Debug.Assert(null != _storage, "no storage"); 1235Debug.Assert(oldConstraint != null, "Should have found a column to remove from the collection."); 1250Debug.Assert(_table.Constraints.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection"); 1369Debug.Assert(IsStringType, "not a String or SqlString column"); 1389Debug.Assert(IsStringType, "not a String or SqlString column"); 1444Debug.Assert(null != _storage, "no storage"); 1464Debug.Assert(null != _storage, "null storage"); 1495Debug.Assert(null != _storage, "null storage"); 1501Debug.Assert(null != _storage, "null storage"); 1507Debug.Assert(null != _storage, "null storage"); 1584Debug.Assert(null != _storage, "no storage"); 1594Debug.Assert(null != _storage, "no storage"); 1629Debug.Assert(null != _storage, "no storage"); 1641Debug.Assert(rels != null, "Invalid ParentRelations"); 1645Debug.Assert(key.HasValue, "Invalid child key (null)"); 1653Debug.Assert(rels != null, "Invalid ChildRelations"); 1657Debug.Assert(key.HasValue, "Invalid parent key (null)"); 1754Debug.Assert(s != null, "Caller is responsible for missing element/attribute case"); 1769Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1777Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull"); 1788Debug.Assert(null != _storage, "no storage"); 1802Debug.Assert(!_dependentColumns.Contains(expressionColumn), "duplicate column - expected to be unique"); 1818Debug.Assert(_table != null); 1827Debug.Assert(null != col, "null datacolumn in expression dependencies"); 1956Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataColumnCollection.cs (3)
548Debug.Assert(col.Computed, "invalid (non an expression) column in the expression dependent columns"); 821Debug.Assert(name != null); 858Debug.Assert(name != null, "Must specify a name");
System\Data\DataError.cs (4)
40Debug.Assert(column != null, "Invalid (null) argument"); 41Debug.Assert(column.Table != null, "Invalid (loose) column"); 88Debug.Assert(column._errors >= 0, "missing error counts"); 98Debug.Assert(_errorList[i]._column._errors >= 0, "missing error counts");
System\Data\DataException.cs (1)
313Debug.Assert(null != e, "TraceException: null Exception");
System\Data\DataKey.cs (2)
147Debug.Fail("don't put DataKey into a Hashtable"); 153Debug.Fail("need to directly call Equals(DataKey)");
System\Data\DataRelation.cs (5)
415Debug.Assert(DataSet == null || !_nested, "this relation supposed to be not in dataset or not nested"); 485Debug.Assert(ChildTable != null, "On a DataSet, but not on Table. Bad state"); 595Debug.Assert(_parentKeyConstraint == null || value == null, "ParentKeyConstraint should not have been set already."); 626Debug.Assert(_childKeyConstraint == null || value == null, "ChildKeyConstraint should not have been set already."); 716Debug.Assert(destination != null);
System\Data\DataRelationCollection.cs (2)
399Debug.Assert(name != null); 628Debug.Assert(relation != null);
System\Data\DataRow.cs (15)
340Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 341Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 357Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 512Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?"); 513Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?"); 530Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?"); 608Debug.Assert(-1 != _tempRecord, "missing temp record"); 609Debug.Assert(0 == _countColumnChange, "unexpected column change count"); 610Debug.Assert(null == _lastChangedColumn, "unexpected last column change"); 626Debug.Assert(-1 == _tempRecord, "unexpected temp record"); 1033Debug.Assert(0 != (DataViewRowState.Added & viewState), "not DataViewRowState.Added"); 1038Debug.Assert(_action == DataRowAction.Rollback || 0 != (DataViewRowState.Deleted & viewState), "not DataViewRowState.Deleted"); 1047Debug.Assert(0 != (DataViewRowState.ModifiedOriginal & viewState), "not DataViewRowState.ModifiedOriginal"); 1352Debug.Assert(relation != null, "The relation should not be null here."); 1447Debug.Assert(valueFromStorage.Equals(column.DataExpression.Evaluate(this, version)),
System\Data\DataRowComparer.cs (5)
96Debug.Assert(!ReferenceEquals(a, b)); 97Debug.Assert(a != null); 98Debug.Assert(b != null); 99Debug.Assert(a.Length == b.Length); 186Debug.Assert(row.Table != null);
System\Data\DataSet.cs (11)
328Debug.Assert(info != null); 878Debug.Assert(null != _culture, "DataSet.Locale: null culture"); 1318Debug.Assert(value && !_rowChanges[index], "setting twice or to false"); 1350Debug.Assert(0 <= bitMatrix[i].HasChanges, "negative change count"); 1362Debug.Assert(bitMatrix[i].HasChanges <= table.Rows.Count, "to many changes"); 1397Debug.Assert(DataRowState.Added == rowState || 2275Debug.Assert(root.NamespaceURI != null, "root.NamespaceURI should not ne null, it should be empty string"); 2511Debug.Assert(reader.NodeType != XmlNodeType.Whitespace, "Should not be on Whitespace node"); 3005Debug.Assert(dataSet != null); 3023Debug.Assert(dataSet != null); 3075Debug.Assert(table != null);
System\Data\DataSetUtil.cs (2)
63Debug.Fail("valid DataRowState " + value.ToString()); 78Debug.Fail("valid LoadOption " + value.ToString());
System\Data\DataTable.cs (75)
279Debug.Assert(ds.RemotingFormat == SerializationFormat.Xml, "RemotingFormat must be SerializationFormat.Xml"); 329Debug.Assert(ds.Tables.Count == 1, "There should be exactly 1 table here"); 455Debug.Assert(Columns.Count == 0, "There is column in Table"); 524Debug.Assert(DataSet != null); 554Debug.Assert(fk != null); 625Debug.Assert(con.Equals("F")); 868Debug.Assert(bitStates != null); 869Debug.Assert(bitStates.Length > bitIndex); 899Debug.Assert(Rows.Count > rowIndex); 900Debug.Assert(rowErrors != null); 901Debug.Assert(colErrors != null); 930Debug.Assert(Rows.Count > rowIndex); 931Debug.Assert(rowErrors != null); 932Debug.Assert(colErrors != null); 945Debug.Assert(columnsInError.Length == columnErrors.Length); 1409Debug.Assert(null != _culture, "null culture"); 1480Debug.Assert(null != culture, "SetLocaleValue: no locale"); 1569Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken"); 1572Debug.Assert(null != nRel[i], "null relation"); 1573Debug.Assert(null != _nestedParentRelations[i], "null relation"); 1574Debug.Assert(nRel[i] == _nestedParentRelations[i], "unequal relations"); 1636Debug.Assert(2 <= primayKeyConstraint.ConstraintIndex.RefCount, "bad primaryKey index RefCount"); 1730Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection"); 2098Debug.Assert(value != null, "Value should not be null ??"); 2099Debug.Assert(value.ColumnMapping == MappingType.SimpleContent, "should be text node here"); 2143Debug.Assert(ndx != null); 2163Debug.Assert(action == DataRowAction.Delete, "Unexpected SetNewRecord action in merge function."); 2250Debug.Assert(saveIdxRecord == ((saveRowState == DataRowState.Added) ? targetRow._newRecord : targetRow._oldRecord), "oops, you change index record without noticing it"); 2400Debug.Assert(clone != null, "The table passed in has to be newly created empty DataTable."); 2842Debug.Assert(null == _rowDiffId, "wasn't previously cleared"); 3131Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(int), "Invalid DataRowState type"); 3373Debug.Assert(key.HasValue); 3556Debug.Assert(e != null, "e should not be null"); 3566Debug.Assert(e != null, "e should not be null"); 3622Debug.Assert((null != e) && ((null != _onRowChangedDelegate) || IsTypedDataTable), "OnRowChanged arguments"); 3635Debug.Assert((null != e) && ((null != _onRowChangingDelegate) || IsTypedDataTable), "OnRowChanging arguments"); 3648Debug.Assert((null != e) && ((null != _onRowDeletingDelegate) || IsTypedDataTable), "OnRowDeleting arguments"); 3661Debug.Assert((null != e) && ((null != _onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments"); 3764Debug.Assert(record != -1, "Record number must be given"); 3790Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same"); 3791Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes"); 4065Debug.Assert(null != _indexes, "unexpected null indexes"); 4284Debug.Assert(row != null, "Row can't be null."); 4299Debug.Assert(fireEvent, "SetNewRecord is called with wrong parameter"); 4305Debug.Assert(!row._inChangingEvent, "How can this row be in an infinite loop?"); 4556Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4568Debug.Assert(0 == _shadowCount, "unexpected count"); 4574Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count"); 4583Debug.Assert(0 < _indexes.Count, "unexpected"); 4606Debug.Assert(null == _loadIndex, "loadIndex should already be null"); 4695Debug.Assert(2 <= _loadIndex.RefCount, "bad loadIndex.RefCount"); 4702Debug.Assert(row != null, "Row can't be null for index record"); 4758Debug.Assert(_loadIndexwithCurrentDeleted != null, "loadIndexwithCurrentDeleted should not be null"); 4769Debug.Assert(_loadIndexwithOriginalAdded != null, "loadIndexwithOriginalAdded should not be null"); 4775Debug.Assert(2 <= indextoUse!.RefCount, "bad indextoUse.RefCount"); 4810Debug.Assert(row != null, "Row can't be null for index record"); 4883Debug.Assert(parentKey != null, "AddForeignKey: Invalid parameter.. related primary key is null"); 5036Debug.Assert(result.Max >= result.Min); 5165Debug.Fail("LoadOption.Upsert with deleted row, should not be here"); 5201Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler"); 5537Debug.Assert(tableList != null, "tableList shouldnot be null"); 6592Debug.Assert(DataSet != null); 6827Debug.Assert(_targetTable == null, "do not reuse this section"); 6828Debug.Assert(table != null); 6829Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6831Debug.Assert(t_usedTables == null || !t_usedTables.Contains(table), 6850Debug.Assert(t_usedTables != null && t_usedTables.Contains(_targetTable), "missing Prepare before Cleanup"); 6869Debug.Assert(t_usedTables != null, message); 6880Debug.Assert(_targetDS == null, "do not reuse this section"); 6881Debug.Assert(ds != null); 6893Debug.Assert(!RowDiffIdUsageSection.t_usedTables.Contains(table), "Nested call with same table can cause data corruption!"); 6896Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared"); 6908Debug.Assert(RowDiffIdUsageSection.t_usedTables != null, "missing Prepare before Cleanup"); 7073Debug.Assert(column._table != null); 7074Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataTableCollection.cs (2)
618Debug.Assert(_list.Count == tableList.Count, "Both lists should have equal numbers of tables"); 737Debug.Assert(name != null);
System\Data\DataTableExtensions.cs (1)
218Debug.Assert(null != table, "null DataTable");
System\Data\DataView.cs (24)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch"); 360Debug.Assert(null != predicate, "null predicate"); 367Debug.Assert(DataRowVersion.Default != version, "not expecting Default"); 368Debug.Assert(DataRowVersion.Proposed != version, "not expecting Proposed"); 549Debug.Assert(null == _addNewRow, "AddNew addNewRow is not null"); 784Debug.Assert(null != _addNewRow, "null addNewRow"); 808Debug.Assert(flag, "didn't remove addNewRow"); 1099Debug.Assert(property != null, "property is null"); 1291Debug.Assert(null != row, "MaintainDataView.ItemAdded with null DataRow"); 1298Debug.Assert(flag, "row actually removed"); 1305Debug.Assert(0 <= index, "ItemAdded was actually deleted"); 1316Debug.Fail("ItemAdded DataRow already in view"); 1320Debug.Assert(null != row, "MaintainDataView.ItemDeleted with null DataRow"); 1321Debug.Assert(row != _addNewRow, "addNewRow being deleted"); 1333Debug.Fail("ItemDeleted DataRow not in view tracking"); 1338Debug.Fail("ItemDeleted DataRow not in view"); 1342Debug.Assert(null == row, "MaintainDataView.Reset with non-null DataRow"); 1351Debug.Fail("unexpected"); 1376Debug.Assert(((ListChangedType.ItemChanged == e.ListChangedType) && ((e.NewIndex == e.OldIndex) || (-1 == e.OldIndex))) || 1380Debug.Assert(0 <= e.NewIndex, "negative NewIndex"); 1471Debug.Assert(null != drv, "didn't contain addNewRow"); 1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count"); 1535Debug.Assert((0 == (DataViewRowState.ModifiedCurrent & newRowStates)) || 1552Debug.Assert(null == _comparison, "RelatedView should not have a comparison function");
System\Data\DataViewListener.cs (2)
96Debug.Assert(null == _table, "DataViewListener already registered table"); 152Debug.Assert(null == _index, "DataviewListener already registered index");
System\Data\EnumerableRowCollection.cs (3)
76Debug.Assert(!isDataViewable || table != null, "isDataViewable bug table is null"); 104Debug.Assert(null != enumerableRows, "null enumerableRows"); 280Debug.Assert(pred != null);
System\Data\EnumerableRowCollectionExtensions.cs (1)
153Debug.Assert(source != null);
System\Data\Filter\AggregateNode.cs (3)
44Debug.Assert(columnName != null, "Invalid parameter column name (null)."); 117Debug.Assert(_column != null, $"Failed to bind column {_columnName}"); 207Debug.Assert(DataRowVersion.Original == version, "wrong version");
System\Data\Filter\BinaryNode.cs (5)
144Debug.Assert(IsConstant()); 1110Debug.Assert((!DataStorage.IsObjectNull(vLeft)) && (!DataStorage.IsObjectNull(vRight)), "Impossible."); 1265Debug.Fail("Invalid (unmapped) precedence " + code.ToString()); 1589Debug.Fail("Unexpected LIKE kind"); 1675Debug.Assert(patchars[length - 1] == '*' || patchars[length - 1] == '%', "Invalid LIKE pattern formed.. ");
System\Data\Filter\ConstNode.cs (1)
62Debug.Fail("NYI");
System\Data\Filter\DataExpression.cs (2)
94Debug.Assert(_parsed, "Invalid calling order: Bind() before Parse()"); 220Debug.Assert(_dependency != null, "GetDependencies: null, we should have created an empty list");
System\Data\Filter\ExpressionParser.cs (34)
294Debug.Assert(_text[_start] == '\'' && _text[_pos - 1] == '\'', "The expression contains an invalid string constant"); 295Debug.Assert(_pos - _start > 1, "The expression contains an invalid string constant"); 301Debug.Assert(_text[_start] == '#' && _text[_pos - 1] == '#', "The expression contains invalid date constant."); 302Debug.Assert(_pos - _start > 2, "The expression contains invalid date constant '{0}'."); 308Debug.Fail("unhandled token"); 322Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 393Debug.Assert(_topOperator > 1, "melformed operator stack."); 403Debug.Assert(opInfo._priority == Operators.PriParen, "melformed operator stack."); 415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('"); 549Debug.Assert(_topNode == 1 || _topNode == 0, "Invalid Node Stack"); 562Debug.Assert(_token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('"); 618Debug.Assert(_topNode > 0, "NodePop(): Corrupted node stack"); 620Debug.Assert(null != node, "null NodePop"); 640Debug.Assert(null != node, "null NodePush"); 658Debug.Assert(pri > Operators.PriStart && pri <= Operators.PriMax, "Invalid priority value"); 664Debug.Assert(_topOperator > 0, "Empty operator stack!!"); 670Debug.Assert(opInfo._priority >= pri, "Invalid prioriry value"); 710Debug.Assert(opInfo._op == Operators.Plus || 719Debug.Assert(nodeLeft != null, "Invalid left operand"); 720Debug.Assert(nodeRight != null, "Invalid right operand"); 751Debug.Assert(nodeLeft == null, "Invalid left operand"); 752Debug.Assert(nodeRight != null, "Invalid right operand"); 763Debug.Fail("Unhandled operator type"); 766Debug.Assert(expr != null, "Failed to create expression"); 992Debug.Assert(_pos != 0, "We have at least one digit in the buffer, ScanNumeric()"); 993Debug.Assert(IsDigit(text[_pos - 1]), "We have at least one digit in the buffer, ScanNumeric(), not a digit"); 1053Debug.Assert(chEnd != '\0', "Invalid bracket value"); 1054Debug.Assert(esc != '\0', "Invalid escape value"); 1072Debug.Assert(text[_pos] == chEnd, "Invalid bracket value"); 1111Debug.Assert(_token == Tokens.Name, "Exprecing an identifier."); 1112Debug.Assert(_pos > _start, "Exprecing an identifier."); 1115Debug.Assert(name != null, "Make sure the arguments for Compare method are OK"); 1125Debug.Assert(s_reservedwords[i]._word != null, "Make sure the arguments for Compare method are OK"); 1145Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
System\Data\Filter\FilterException.cs (1)
97Debug.Fail(err);
System\Data\Filter\FunctionNode.cs (23)
123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info."); 127Debug.Assert(_argumentCount == s_funcs[_info]._argumentCount || s_funcs[_info]._isVariantArgumentList, "Invalid argument argumentCount."); 198Debug.Assert(_info > -1, "All function nodes should be bound at this point."); // default info is -1, it means if not bounded, it should be -1, not 0!! 258Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!! 321Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 332Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 344Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 348Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 352Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 356Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 360Debug.Assert(_argumentCount == 2, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 362Debug.Assert(argumentValues[0] is string, $"Invalid argument type for {s_funcs[_info]._name}"); 363Debug.Assert(argumentValues[1] is string, $"Invalid argument type for {s_funcs[_info]._name}"); 377Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}"); 396Debug.Assert(_argumentCount == 2, "Invalid argument argumentCount: "); 404Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 405Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}"); 423Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}"); 424Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid first argument {argumentValues[0].GetType().FullName} in {s_funcs[_info]._name}"); 425Debug.Assert(argumentValues[1] is int, $"Invalid second argument {argumentValues[1].GetType().FullName} in {s_funcs[_info]._name}"); 426Debug.Assert(argumentValues[2] is int, $"Invalid third argument {argumentValues[2].GetType().FullName} in {s_funcs[_info]._name}"); 465Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}"); 466Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
System\Data\Filter\LookupNode.cs (2)
58Debug.Assert(_relation != null, "Invalid relation: no parent table."); 59Debug.Assert(_columnName != null, "All Lookup expressions have columnName set.");
System\Data\Filter\NameNode.cs (1)
61Debug.Assert(_column != null, $"Failed to bind column {_name}");
System\Data\Filter\UnaryNode.cs (1)
118Debug.Fail("Missing a type conversion");
System\Data\Filter\ZeroOpNode.cs (2)
21Debug.Assert(op == Operators.True || op == Operators.False || op == Operators.Null, "Invalid zero-op"); 40Debug.Assert(_op == Operators.True || _op == Operators.False || _op == Operators.Null, "Invalid zero-op");
System\Data\ForeignKeyConstraint.cs (10)
260Debug.Assert(row.Table.DataSet != null); 352Debug.Fail("Unknown Rule value"); 360Debug.Assert(row.Table.DataSet != null); 405Debug.Assert(Table?.DataSet != null && row.Table.DataSet != null); 490Debug.Fail("Unknown Rule value"); 498Debug.Assert(Table?.DataSet != null); 507Debug.Assert(Table?.DataSet != null, $"Relation {ConstraintName} isn't part of a DataSet, so this check shouldn't be happening."); 520Debug.Assert(Table?.DataSet != null, $"ForeignKeyConstraint {ConstraintName} isn't part of a DataSet, so this check shouldn't be happening."); 554Debug.Fail("attempt to cascade unknown action: " + action.ToString()); 759Debug.Assert(Table == RelatedTable, "We call this clone just if we have the same datatable as parent and child ");
System\Data\LinqDataView.cs (3)
39Debug.Assert(table != null, "null DataTable"); 111Debug.Assert(base.Sort != null); 112Debug.Assert(!(!string.IsNullOrEmpty(base.Sort) && base.SortComparison != null),
System\Data\Merger.cs (7)
45Debug.Assert(_dataSet != null); 231Debug.Assert(_dataSet != null); 266Debug.Assert(MissingSchemaAction.Ignore == _missingSchemaAction, "MergeSchema failed"); 466Debug.Assert(_dataSet != null); 518Debug.Assert(_dataSet != null); 519Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction || 597Debug.Assert(MissingSchemaAction.Error == _missingSchemaAction, $"Unexpected value of MissingSchemaAction parameter : {_missingSchemaAction}");
System\Data\ProviderBase\DataReaderContainer.cs (6)
30Debug.Assert(null != dataReader, "null dataReader"); 53Debug.Assert(null != fieldName, "null GetName"); 81Debug.Assert(null != dataReader, "null dbDataReader"); 98Debug.Assert(0 <= fieldCount, "negative FieldCount"); 107Debug.Assert(null != fieldType, "null FieldType"); 139Debug.Assert(0 <= fieldCount, "negative FieldCount");
System\Data\ProviderBase\SchemaMapping.cs (27)
64Debug.Assert(null != adapter, nameof(adapter)); 65Debug.Assert(null != dataReader, nameof(dataReader)); 66Debug.Assert(0 < dataReader.FieldCount, "FieldCount"); 67Debug.Assert(null != dataset || null != datatable, "SchemaMapping - null dataSet"); 68Debug.Assert(SchemaType.Mapped == schemaType || SchemaType.Source == schemaType, "SetupSchema - invalid schemaType"); 284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length"); 299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length"); 310Debug.Assert(_readerDataValues != null); 363Debug.Assert(0 == _mappedMode, "incorrect mappedMode"); 364Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null == _mappedDataValues), "incorrect MappedValues"); 367Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 371Debug.Assert((null == _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 375Debug.Assert((null != _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 379Debug.Assert((null != _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues"); 420Debug.Fail("unexpected LoadOption"); 472Debug.Assert(null != _dataSet, "if chapters, then Fill(DataSet,...) not Fill(DataTable,...)"); 523Debug.Assert(rgcol != null, "invalid call to ResizeArray"); 524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray"); 566Debug.Assert(_dataTable != null); 567Debug.Assert(_fieldNames != null); 568Debug.Assert(_tableMapping != null); 762Debug.Assert(_dataTable != null); 763Debug.Assert(_schemaTable != null); 764Debug.Assert(_fieldNames != null); 765Debug.Assert(_tableMapping != null); 769Debug.Assert(null != schemaRows, "SchemaSetup - null DbSchemaRow[]"); 770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
System\Data\RbTree.cs (30)
321Debug.Assert(_inUseNodeCount - 1 == SubTreeSize(root), "count mismatch"); 371Debug.Assert(page._slots[slotId]._leftId == NIL, "node not cleared"); 372Debug.Assert(page._slots[slotId]._rightId == NIL, "node not cleared"); 373Debug.Assert(page._slots[slotId]._parentId == NIL, "node not cleared"); 374Debug.Assert(page._slots[slotId]._nextId == NIL, "node not cleared"); 377Debug.Assert(page._slots[slotId]._nodeColor == NodeColor.red, "node not cleared"); 550Debug.Assert(NIL != x_id, "nil left"); 551Debug.Assert(NIL != z_id, "nil right"); 580Debug.Assert(-1 == position, "KEY_SEARCH_AND_INDEX with bad position"); 591Debug.Assert((NIL == Left(z_id)) || (0 > Compare(root_id, Left(z_id), z_id)), "Left is not left"); 598Debug.Assert((NIL == Right(z_id)) || (0 < Compare(root_id, Right(z_id), z_id)), "Right is not right"); 841Debug.Assert(_accessMethod == TreeAccessMethod.INDEX_ONLY, "not expecting anything else"); 1229Debug.Assert((NIL == Left(x_id)) || (0 > Compare(root_id, Left(x_id), x_id)), "Search duplicate Left is not left"); 1236Debug.Assert((NIL == Right(x_id)) || (0 < Compare(root_id, Right(x_id), x_id)), "Search duplicate Right is not right"); 1259Debug.Assert((NIL == Left(x_id)) || (0 > Compare(NIL, Left(x_id), x_id)), "Search Left is not left"); 1266Debug.Assert((NIL == Right(x_id)) || (0 < Compare(NIL, Right(x_id), x_id)), "Search Right is not right"); 1347Debug.Assert(NIL != node, "GetIndexByNode(NIL)"); 1513Debug.Assert(NIL == Next(x_id), "has unexpected satellite tree"); 1698Debug.Assert(nodeId != NIL, " in SetParent nodeId == NIL"); 1709Debug.Assert(nodeId != NIL, " in SetColor nodeId == NIL"); 1740Debug.Assert(nodeId != NIL && 1786Debug.Assert(myCorrectSize == size, "VerifySize"); 1907Debug.Assert(null != tree, "null tree"); 1908Debug.Assert((NIL == _nodeID && NIL == _mainTreeNodeID) || (NIL != _nodeID), "MainTreeNodeID is not NIL"); 1912Debug.Assert(NIL != tree.Next(_mainTreeNodeID), "MainTreeNodeID should have a Next"); 1918Debug.Assert(tree.root == node, "MainTreeNodeID parent change doesn't align"); 1922Debug.Assert(NIL == tree.Next(_nodeID), "NodeID should not have a Next"); 1935Debug.Assert(NIL == tree.Next(node), "duplicate node should not have a next"); 1939Debug.Assert((NIL == _mainTreeNodeID && tree.root == node) || 1989Debug.Assert((_slotMap[segmentPos] & freeSlot) == 0, "Slot position segment[segmentPos ]: [freeSlot] is in use. Expected to be empty");
System\Data\RecordManager.cs (9)
115Debug.Assert(record >= 0 && record < _recordCapacity, "NewRecord: Invalid record"); 121Debug.Assert(-1 <= record && record < _recordCapacity, "invalid record"); 185Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 190Debug.Assert(record >= 0 && record < _rows.Length, "Invalid record number"); 212Debug.Assert(src != null, "Can not Merge record without a table"); 270Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 272Debug.Assert((null == r) || 281Debug.Assert((record < _lastFreeRecord) && (-1 == _freeRecordList.IndexOf(record)), "accessing free record"); 282Debug.Assert((null == _rows[record]) || (row == _rows[record]), "record of a different row");
System\Data\RelatedView.cs (2)
27Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table"); 37Debug.Assert(Table == _childKey.Table, "Key.Table Must be equal to Current Table");
System\Data\Select.cs (20)
60Debug.Assert(_candidateColumns != null); 183Debug.Assert(_candidateColumns != null); 237Debug.Assert(_candidateColumns != null); 316Debug.Assert(_candidateColumns != null); 465Debug.Assert(_candidateColumns != null); 470Debug.Assert(_matchedCandidates > 0 && _matchedCandidates <= lenId, "BuildLinearExpression : Invalid Index"); 474Debug.Assert(canColumn != null && canColumn.expr != null, "BuildLinearExpression : Must be a matched candidate"); 505Debug.Assert(_candidateColumns != null); 553Debug.Assert(!needSorting, "What are we doing here if no real reuse of this index ?"); 697default: Debug.Assert(true, "Unsupported Binary Search Operator!"); break; 704Debug.Assert(_index != null && _candidateColumns != null); 729Debug.Assert(candidateColumn != null, "How come this is not a candidate column"); 730Debug.Assert(candidateColumn.expr != null, "How come there is no associated expression"); 740Debug.Assert(_index != null); 759Debug.Assert(_index != null); 777Debug.Assert(_index != null); 783Debug.Assert(_matchedCandidates <= _index._indexFields.Length, "GetBinaryFilteredRecords : Invalid Index"); 790Debug.Assert(lo <= hi, "GetBinaryFilteredRecords : Invalid Search Results"); 796Debug.Assert(_index != null); 825Debug.Assert(_index != null);
System\Data\Selection.cs (27)
19Debug.Assert(column != null, "null column"); 113Debug.Assert(indexFields != null); 114Debug.Assert(null != table, "null table"); 175Debug.Assert(recordIndex >= 0 && recordIndex < _recordCount, "recordIndex out of range"); 233Debug.Assert(0 <= _refCount, "AddRef on disposed index"); 234Debug.Assert(null != _records, "null records"); 298Debug.Assert(_records.CheckUnique(_records.root) != HasDuplicates, "CheckUnique difference"); 326Debug.Assert(null != row1, "record1 no datarow"); 327Debug.Assert(null != row2, "record2 no datarow"); 350Debug.Assert(0 == CompareDataRows(record1, record2), "duplicate record not a duplicate by user function"); 357Debug.Assert(0 == c, "duplicate record not a duplicate"); 362Debug.Assert(null != row1, "record1 no datarow"); 363Debug.Assert(null != row2, "record2 no datarow"); 448Debug.Assert(null != _comparison, "missing comparison"); 475Debug.Assert(record == row._newRecord, "newRecord has change during GetIndex"); 479Debug.Assert(record == row._oldRecord, "oldRecord has change during GetIndex"); 859Debug.Assert(DoListChanged, "supposed to check DoListChanged before calling to delay create ListChangedEventArgs"); 870Debug.Assert(-1 <= record, "bad record#"); 942Debug.Assert((-1 == oldRecord) || (-1 == newRecord) || 1073Debug.Assert(null != listener, "null listener"); 1074Debug.Assert(!Index.ContainsReference(_listeners, listener), "already contains reference"); 1086Debug.Assert(null != listener, "null listener"); 1089Debug.Assert(0 <= index, "listeners don't contain listener"); 1104Debug.Assert(null != action, "no action"); 1105Debug.Assert(0 <= _listenerReaderCount, "negative _listEventCount"); 1147Debug.Assert((-1 == nullIndex) || (null == _listeners[nullIndex]), "non-null listener"); 1148Debug.Assert(0 == _listenerReaderCount, "0 < _listenerReaderCount");
System\Data\SortExpressionBuilder.cs (6)
52Debug.Assert(keySelector != null); 53Debug.Assert(compare != null); 64Debug.Assert(_currentSelector != null); 65Debug.Assert(_currentComparer != null); 97Debug.Assert(a != null && b != null && a.Count == Count); 119Debug.Assert(_selectors.Count == _comparers.Count);
System\Data\SQLTypes\SQLBinary.cs (3)
42Debug.Assert(!copy); 374Debug.Assert(length >= 0); 379Debug.Assert(rgbValue.Length >= length);
System\Data\SQLTypes\SQLBoolean.cs (1)
131Debug.Assert(x.m_value == x_Null);
System\Data\SQLTypes\SQLBytes.cs (5)
460Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 467Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 468Debug.Assert(FStream() || (_rgbBuf != null && _lCurLen <= _rgbBuf.Length)); 469Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 478Debug.Assert(FStream());
System\Data\SQLTypes\SQLChars.cs (6)
425Debug.Assert(_state >= SqlBytesCharsState.Null && _state <= SqlBytesCharsState.Stream); 432Debug.Assert((_lCurLen >= 0 && _lCurLen <= x_lMaxLen) || FStream()); 433Debug.Assert(FStream() || (_rgchBuf != null && _lCurLen <= _rgchBuf.Length)); 434Debug.Assert(!FStream() || (_lCurLen == x_lNull)); 436Debug.Assert(_rgchWorkBuf == null || _rgchWorkBuf.Length == 1); 450Debug.Assert(FStream());
System\Data\SQLTypes\SQLDateTime.cs (2)
133Debug.Assert(timeticks == MaxTime + 1); 254Debug.Assert(time == MaxTime + 1);
System\Data\SQLTypes\SQLDecimal.cs (49)
409Debug.Assert((precision == MaxPrecision + 1) || VerifyPrecision(precision), "Calcualted precision too low?"); 410Debug.Assert((precision == 1) || !VerifyPrecision((byte)(precision - 1)), "Calculated precision too high?"); 421Debug.Assert(precision == bActualPrecision, $"CalculatePrecision={precision}, BActualPrec={bActualPrecision}. Results must be equal!"); 433Debug.Assert(precision > 0, "Precision cannot be less than 1"); 434Debug.Assert(precision <= MaxPrecision, "Precision > MaxPrecision"); 720Debug.Assert(ulLen <= s_NUMERIC_MAX_PRECISION, "ulLen <= NUMERIC_MAX_PRECISION", ""); 786Debug.Assert(rglData.Length >= 4); 834Debug.Assert(!IsNull); 840Debug.Assert(!IsNull); 1259Debug.Assert(ResInteger <= MaxPrecision); 1263Debug.Assert(ResScale <= MaxScale); 1272Debug.Assert(ResPrec - ResInteger >= 0); 1322Debug.Assert(dwlAccum < s_ulInt32Base); 1522Debug.Assert(dwlAccum < s_ulInt32Base * 2); 1525Debug.Assert(dwlAccum < s_ulInt32Base); // can never final accum > 1 more UI4 1541Debug.Assert(s_NUMERIC_MAX_PRECISION == ResPrec); 1816Debug.Assert(_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid"); 1817Debug.Assert(_bScale <= _bPrec, "m_bScale <= m_bPrec", "In AssertValid"); 1818Debug.Assert(_bScale >= 0, "m_bScale >= 0", "In AssertValid"); 1819Debug.Assert(_bPrec > 0, "m_bPrec > 0", "In AssertValid"); 1821Debug.Assert(CLenFromPrec(_bPrec) >= _bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid"); 1822Debug.Assert(_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid"); 1829Debug.Assert(_bLen == 1, "m_bLen == 1", "In AssertValid"); 1834Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid"); 1866Debug.Assert(rgulData.Length == s_cNumeMax, "rgulData.Length == x_cNumeMax", "Invalid array length"); 1919Debug.Assert(bPrec <= MaxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", 1940Debug.Assert(rglData.Length == 4, "rglData.Length == 4", $"Wrong array length: {rglData.Length}"); 2103Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27); 2146Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_lInt32Base", ""); 2175Debug.Assert(dwlAccum < s_ulInt32Base); 2192Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_dwlBaseUI4", "Integer overflow"); 2244Debug.Assert(dwlAccum < dwlDivisor); 2246Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 2273Debug.Assert(dwlAccum < s_ulInt32Base); 2287Debug.Assert(!IsNull, "!IsNull", "In AdjustScale"); 2471Debug.Assert(rgulS.Length >= ciulS, "rgulS.Length >= ciulS", "Invalid array length"); 2472Debug.Assert(rgulD.Length >= ciulS, "rgulD.Length >= ciulS", "Invalid array length"); 2511Debug.Assert(iulX > s_uiZero); 2544Debug.Assert(rgulU.Length == s_cNumeMax); 2551Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!"); 2552Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero"); 2553Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array"); 2610Debug.Assert(ciulU > 0, "ciulU > 0", "In method MpDiv"); 2611Debug.Assert(ciulD > 0, "ciulD > 0", "In method MpDiv"); 2612Debug.Assert(rgulU.Length == s_cNumeMax); 2613Debug.Assert(rgulD.Length == s_cNumeMax); 3025Debug.Assert(uiDigit < 10); 3032Debug.Assert(rguiData.Length == 4); 3041Debug.Assert(_bPrec >= 1);
System\Data\SQLTypes\SQLGuid.cs (4)
118Debug.Assert(!x.IsNull); 119Debug.Assert(!y.IsNull); 124Debug.Assert(xWrote); 128Debug.Assert(yWrote);
System\Data\SQLTypes\SQLInt64.cs (2)
164Debug.Assert(lHigh2 == 0); 171Debug.Assert(lHigh1 == 0);
System\Data\SQLTypes\SQLMoney.cs (1)
83Debug.Assert(snum.Scale == s_iMoneyScale);
System\Data\SQLTypes\SQLString.cs (7)
263Debug.Assert(!IsNull); 368Debug.Assert(!x.IsNull && !y.IsNull, 376Debug.Assert(x.FBinarySort() || (x.m_cmpInfo != null && y.m_cmpInfo != null), 442Debug.Fail("Invalid ecExpectedResult"); 728Debug.Assert(cbX % 2 == 0); 729Debug.Assert(cbY % 2 == 0); 775Debug.Assert(!x.IsNull && !y.IsNull);
System\Data\SQLTypes\SqlXml.cs (3)
89Debug.Assert(_createSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 120Debug.Assert(CreateSqlReaderMethodInfo != null, "MethodInfo reference for XmlReader.CreateSqlReader should not be null."); 283Debug.Assert(_stream != null, "stream can not be null");
System\Data\TypeLimiter.cs (5)
25Debug.Assert(scope != null); 200Debug.Assert(allowedTypes != null); 213Debug.Fail("Scope was popped out of order."); 223Debug.Assert(type != null); 265Debug.Assert(type != null);
System\Data\UniqueConstraint.cs (3)
139Debug.Assert(null != _constraintIndex, "null UniqueConstraint index"); 148Debug.Assert(DataKey.ColumnsEqual(_key.ColumnsReference, sortIndexColumns), "UniqueConstraint index columns do not match the key sort index"); 189Debug.Assert(constraints.Table._primaryKey == this, "If the primary key and this are 'Equal', they should also be '=='");
System\Data\XDRSchema.cs (8)
40Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node"); 74Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) || 133Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS), $"Invalid node type {node.LocalName}"); 184Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) || 275Debug.Assert((s_mapNameTypeXdr[i - 1].CompareTo(s_mapNameTypeXdr[i].name)) < 0, "incorrect sorting"); 285Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found"); 290Debug.Assert(s_mapNameTypeXdr[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found"); 345Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
System\Data\XmlDataLoader.cs (5)
692Debug.Assert(table != null, "Table to be loaded is null on LoadTopMostTable() entry"); 693Debug.Assert(_topMostNode != null, "topMostNode is null on LoadTopMostTable() entry"); 694Debug.Assert(!_isDiffgram, "Diffgram mode is on while we have topMostNode table. This is bad."); 709Debug.Assert(entryDepth >= 0, "Wrong entry Depth for top most element."); 877Debug.Assert(table != null, "Table to be loaded is null on LoadTable() entry");
System\Data\XMLDiffLoader.cs (2)
33Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy"); 70Debug.Assert(reader.LocalName == Keywords.MSD_ERRORS && reader.NamespaceURI == Keywords.DFFNS, "something fishy");
System\Data\xmlsaver.cs (15)
799Debug.Assert(nodeApp != null, "Need to create <application..> node first."); 1018Debug.Assert(ds == null || dt == null); 1019Debug.Assert(_dsElement != null); 1243Debug.Assert(_prefixes != null); 1425Debug.Assert(_prefixes != null); 1426Debug.Assert(_dc != null); 1431Debug.Assert(col.ColumnMapping != MappingType.SimpleContent, "Illegal state"); 1729Debug.Assert(_prefixes != null); 1730Debug.Assert(_dc != null); 1731Debug.Assert(_dsElement != null); 2805Debug.Assert(_ds != null || _dt != null); 2849Debug.Assert(_ds != null || _dt != null); 2942Debug.Assert(_xmlw != null); 3108Debug.Assert(value != null, "Value can not be null"); 3324Debug.Assert(!(xr is DataTextReader), "XmlReader is DataTextReader");
System\Data\XMLSchema.cs (20)
329Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 360Debug.Assert(dc != null, "HandleColumnExpression is supposed to be called for DataColumn"); 400Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties"); 414Debug.Assert(table != null, "ref table should have been already created"); 847Debug.Assert(schemaSet.Count == 1, "there should be one schema"); 919Debug.Assert(child == table, "table not the same"); 1068Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1086Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1098Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1109Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType"); 1115Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction"); 1152Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction"); 1158Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent"); 1533Debug.Assert((node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements"); 1544Debug.Assert((instanceName != null) && (instanceName.Length != 0), "instanceName cannot be null or empty. There's an error in the XSD compiler"); 1785Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1851Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1899Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}"); 1909Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found"); 1914Debug.Assert(s_mapNameTypeXsd[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found");
System\Data\XmlToDatasetMap.cs (10)
107Debug.Assert(dataSet != null, "DataSet can't be null"); 108Debug.Assert(nameTable != null, "NameTable can't be null"); 116Debug.Assert(dataSet != null, "DataSet can't be null"); 117Debug.Assert(nameTable != null, "NameTable can't be null"); 125Debug.Assert(dataTable != null, "DataTable can't be null"); 126Debug.Assert(nameTable != null, "NameTable can't be null"); 134Debug.Assert(dataTable != null, "DataTable can't be null"); 135Debug.Assert(nameTable != null, "NameTable can't be null"); 438Debug.Assert(node != null, "Argument validation"); 506Debug.Assert(col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase), "column name should start with xml");
System\Xml\DataPointer.cs (23)
52Debug.Assert(rowElem != null); 53Debug.Assert(rowElem.Row != null); 71Debug.Assert(rowElem.Row != null); 85Debug.Assert(_node == _doc || _node.OwnerDocument == _doc); 96Debug.Assert(node == _doc || node.OwnerDocument == _doc); 107Debug.Assert(node == _doc || node.OwnerDocument == _doc); 414Debug.Assert(name != null); 472Debug.Assert(name != null); 705Debug.Assert(_column == null); 710Debug.Assert(_column == null); 715Debug.Assert(_column == null); 732Debug.Assert(_column == null); 737Debug.Assert(_column == null); 742Debug.Assert(_column == null); 756Debug.Assert(_column == null); 780Debug.Assert(_column == null); 801Debug.Assert(_column == null); 822Debug.Assert(_column == null); 843Debug.Assert(rowElem != null); 846Debug.Assert(row != null); 849Debug.Assert(state == ElementState.Defoliated, "Region is accessed using column, but it's state is FOLIATED"); 853Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 856Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true);
System\Xml\DataSetMappper.cs (10)
32Debug.Assert(_dataSet == null); 89Debug.Assert(elem != null); 103Debug.Assert(rowElem.Row != null); 117Debug.Assert(a.Prefix != null && a.Prefix.Length == 0); 118Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 122Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 126Debug.Assert(a.NamespaceURI == (object)strReservedXmlns); 151Debug.Assert(rowElem != null); 153Debug.Assert((node is XmlBoundElement) ? ((XmlBoundElement)node).Row == null : true); 241Debug.Assert(rowElem.Row != null);
System\Xml\RegionIterator.cs (18)
25Debug.Assert(rowElement != null && rowElement.Row != null); 39Debug.Assert(oldState != ElementState.None); 48Debug.Assert(CurrentNode != null); 50Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 72Debug.Assert(oldState != ElementState.None); 80Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 83Debug.Assert(CurrentNode != null); 98Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 105Debug.Assert(nextNode.NextSibling != null); 109Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 113Debug.Assert(CurrentNode != null); 122Debug.Assert(CurrentNode != null); 123Debug.Assert(CurrentNode.NodeType == XmlNodeType.Element); 130Debug.Fail("Reading the initial text value for sub-regions."); 138Debug.Assert(oldState != ElementState.None); 145Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true); 151Debug.Assert(!XmlDataDocument.Helpers.IsTextLikeNode(n)); 155Debug.Assert((oldState == ElementState.Defoliated) ? (_rowElement.ElementState == ElementState.Defoliated) : true);
System\Xml\TreeIterator.cs (2)
18Debug.Assert(nodeTop != null); 72Debug.Assert(nextNode.NextSibling != null);
System\Xml\XmlBoundElement.cs (4)
227Debug.Assert(element is XmlBoundElement); 267Debug.Assert(dp.NodeType == XmlNodeType.Element); 307Debug.Assert(dp.NodeType == XmlNodeType.Element); 380Debug.Assert(((IXmlDataVirtualNode)dp).IsOnColumn(null));
System\Xml\XmlDataDocument.cs (142)
56Debug.Assert(!_pointers.ContainsValue(pointer)); 66Debug.Assert(temp != null); 86Debug.Fail("Pointer not present"); 102Debug.Assert(_dataSet == null); 103Debug.Assert(ds != null); 193Debug.Assert(_ignoreXmlEvents); 208Debug.Assert(DocumentElement == null || !fLoadFromDataSet); 241Debug.Assert(!_fDataRowCreatedSpecial); 242Debug.Assert(!_fBoundToDataSet && !_fBoundToDocument); 249Debug.Assert(_fDataRowCreatedSpecial); 267Debug.Assert(_dataSet != null); 344Debug.Assert(!_fBoundToDataSet && !_fBoundToDocument); 346Debug.Assert(_fBoundToDataSet ? _fBoundToDocument : (!_fBoundToDocument)); 360Debug.Assert(!_fDataRowCreatedSpecial); 374Debug.Assert(be != null); 402Debug.Assert(rowElem.Row != null); 435Debug.Assert(_mapper.GetColumnSchemaForNode(rowElem, node) != null); 444Debug.Assert((node is XmlBoundElement) && (((XmlBoundElement)node).Row != null)); 490Debug.Assert(_ignoreXmlEvents); 492Debug.Assert(GetRowFromElement(DocumentElement) != null); 500Debug.Assert(docElem.LastChild == docElem.FirstChild); 518Debug.Assert(!_mapper.IsMapped()); 519Debug.Assert(!_fBoundToDocument); 520Debug.Assert(!_fBoundToDataSet); 532Debug.Assert(!_fDataRowCreatedSpecial); 533Debug.Assert(_mapper.IsMapped()); 534Debug.Assert(_fBoundToDataSet && _fBoundToDocument); 538Debug.Assert(fAssociateDataRowOld == _fAssociateDataRow); 564Debug.Assert(fIsChildConnected == IsConnected(childElem)); 565Debug.Assert(IsRowLive(r) ? IsConnected(childElem) : !IsConnected(childElem)); 575Debug.Assert(newState == ElementState.WeakFoliation || newState == ElementState.StrongFoliation); 588Debug.Assert(rowElemState == ElementState.StrongFoliation || rowElemState == ElementState.WeakFoliation); 608Debug.Assert(node.Row != null); 654Debug.Assert(node.Row != null); 655Debug.Assert(node.Row.RowState != DataRowState.Deleted); 707Debug.Assert(col.ColumnMapping == MappingType.SimpleContent); 826Debug.Assert(c == row.Table.XmlText); 830Debug.Assert(cTextCols == 0 || cTextCols == 1); 832Debug.Assert(row.Table.XmlText == null); 880Debug.Assert(be != null); 896Debug.Assert(pointer != null); 956Debug.Assert(!DataSet.EnforceConstraints); 968Debug.Assert(newNode != null); 986Debug.Assert(_ignoreDataSetEvents); 987Debug.Assert(_ignoreXmlEvents); 988Debug.Assert(!IsFoliationEnabled); 1029Debug.Assert(clone.FirstChild == null); 1095Debug.Fail("Found entity reference"); 1191Debug.Assert(reader is XmlTextReader); 1217Debug.Assert(DocumentElement != null); 1254Debug.Assert(r.Element == null); 1268Debug.Fail("We should not get rows in this state"); 1271Debug.Fail("Unknown row state"); 1289Debug.Assert(node != null); 1299Debug.Assert(r == null); 1307Debug.Assert(be.Row != null); 1326Debug.Assert(row.RowState == DataRowState.Detached); 1337Debug.Assert(row.RowState == DataRowState.Detached); 1348Debug.Assert(row.Element == null); 1350Debug.Assert(row.RowState == DataRowState.Detached); 1357Debug.Assert(row.Element == null); 1370Debug.Assert(tb != null); 1380Debug.Assert(_ignoreXmlEvents); 1383Debug.Assert(rowElement != null); 1389Debug.Assert(rowElement != null); 1435Debug.Assert((pointer != null) && !((IXmlDataVirtualNode)pointer).IsOnColumn(col)); 1517Debug.Assert(e != null); 1576Debug.Assert(relation.ChildTable == row.Table); 1585Debug.Assert(args.Row.RowState != DataRowState.Deleted); 1603Debug.Assert(be != null); 1620Debug.Assert(row != null); 1621Debug.Assert(rowElement != null); 1649Debug.Assert(_ignoreXmlEvents); 1693Debug.Assert(pointer != null); 1722Debug.Assert(child.Element == childElement && childElement.Row == child); 1724Debug.Assert(_ignoreXmlEvents); 1754Debug.Assert(colInParent != null); 1768Debug.Assert(fChildElementConnected == IsConnected(childElement)); 1769Debug.Assert(IsRowLive(child) ? IsConnected(childElement) : !IsConnected(childElement)); 1792Debug.Assert(!DataSet.EnforceConstraints); 1828Debug.Assert(!DataSet.EnforceConstraints); 1841Debug.Assert(oldParent == null); 1882Debug.Assert(!DataSet.EnforceConstraints); 1891Debug.Assert(args.NewParent == null); 1955Debug.Assert(!IsRowLive(row)); 1964Debug.Assert(!IsRowLive(be.Row)); 1996Debug.Assert(rowElement != null); 2086Debug.Fail("This should have been handled above, irrespective of ignoreDataSetEvents value (true or false)"); 2207Debug.Assert(!(args.Action == CollectionChangeAction.Add || args.Action == CollectionChangeAction.Remove) || !rel!.Nested); 2255Debug.Assert(child.ParentNode != prevSibling.ParentNode); 2257Debug.Assert(prevSibling.ParentNode != null); 2258Debug.Assert(!IsFoliationEnabled); 2259Debug.Assert(IgnoreXmlEvents); 2261Debug.Assert(prevSibling != DocumentElement); 2265Debug.Assert(child.ParentNode == null); 2272Debug.Assert(parent != null); 2273Debug.Assert(parent.NodeType != XmlNodeType.Attribute); // We need to get the grand-parent region 2274Debug.Assert(parent != DocumentElement); // We cannot promote children of the DocumentElement 2284Debug.Assert(iter.CurrentNode is XmlBoundElement && ((XmlBoundElement)(iter.CurrentNode)).Row != null); 2294Debug.Assert(parent != null); 2377Debug.Assert(col.ColumnMapping != MappingType.Hidden); 2387Debug.Assert(xmlText != null); 2388Debug.Assert(!row.Table.DataSet!.EnforceConstraints); 2394Debug.Assert(oVal != null && !(oVal is DBNull)); 2417Debug.Assert(row != null); 2433Debug.Fail("We should not get any exceptions because we always handle data-type conversion"); 2446Debug.Fail("We should not get any exceptions because DataSet.EnforceConstraints should be always off"); 2454Debug.Assert(rowElement != null); 2455Debug.Assert(rowElement.Row != null); 2456Debug.Assert(!DataSet.EnforceConstraints); 2459Debug.Assert(row != null); 2503Debug.Assert(c.Table == row.Table); 2692Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2696Debug.Assert(subRowElem != null); 2711Debug.Assert(!IsRowLive(be.Row!)); 2721Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2743Debug.Assert(rowElem.Row != null); 2754Debug.Assert(!row.Table.DataSet!.EnforceConstraints); 2762Debug.Fail("We should not get any exceptions here"); 2778Debug.Assert(!row.Table.DataSet!.EnforceConstraints); 2790Debug.Fail("We should not get any exceptions here"); 2796Debug.Fail("Handle your case above"); 2799Debug.Assert(IsRowLive(rowElem.Row)); 2805Debug.Assert(rowElem.Row != null); 2816Debug.Assert(!row.Table.DataSet!.EnforceConstraints); 2823Debug.Fail("We should not get any exceptions here"); 2846Debug.Fail("Handle your case above"); 2850Debug.Assert(!IsRowLive(rowElem.Row)); 2860Debug.Assert(row != null); 2876Debug.Assert(row != null); 2878Debug.Assert(row.RowState == DataRowState.Detached || row.RowState == DataRowState.Deleted); 2887Debug.Assert(childRowElem.Row != null); 2903Debug.Assert(parentRowElem.Row != null); 2943Debug.Assert(node.OwnerDocument == this || node == this); 2961Debug.Assert(be.IsFoliated); 2983Debug.Assert(IsRowLive(rowElement.Row)); 2988Debug.Assert(rowElement!.Row != null); 2989Debug.Assert(IsRowLive(rowElement.Row)); 3006Debug.Assert(!IsRowLive(rowElement.Row)); 3011Debug.Assert(rowElement!.Row != null); 3012Debug.Assert(!IsRowLive(rowElement.Row)); 3078Debug.Assert(tableList[readPos] != null, "Temp Array is not supposed to reach to null");
System\Xml\XPathNodePointer.cs (33)
51Debug.Assert(XmlDataDocument.Helpers.IsTextNode(node.NodeType)); 87Debug.Assert(xnt != -1); 107Debug.Assert(owner != null); 438Debug.Assert(rowElem != null); 439Debug.Assert(rowElem.Row != null); 455Debug.Assert(rowElem.Row != null); 479Debug.Assert(node == _doc || node.OwnerDocument == _doc); 488Debug.Assert(node == _doc || node.OwnerDocument == _doc); 608Debug.Assert(_node.Attributes != null); 690Debug.Assert(xntInt != -1); 713Debug.Assert(xntInt != -1); 733Debug.Assert(_column.ColumnMapping != MappingType.Attribute && _column.ColumnMapping != MappingType.Hidden); 1017Debug.Assert(_parentOfNS != null); 1105Debug.Assert(other.NodeType != XPathNodeType.Namespace); 1120Debug.Assert(NodeType != XPathNodeType.Namespace); 1141Debug.Assert(_fOnValue != other._fOnValue); 1149Debug.Assert(Row == other.Row); //in the same row 1164Debug.Assert(curNode1 != null); 1165Debug.Assert(curNode2 != null); 1222Debug.Fail("Logically, we shouldn't reach here."); 1283Debug.Assert(_column != null); 1468Debug.Assert(curAttr.NamespaceURI == StrReservedXmlns); 1470Debug.Assert(attrs != null); 1572Debug.Assert(_parentOfNS != null); 1577Debug.Assert(_column.Namespace == StrReservedXmlns); 1581Debug.Assert(be != null); 1583Debug.Assert(curRow != null); 1606Debug.Assert(attr != null); 1654Debug.Assert(rowElem != null); 1657Debug.Assert(row != null); 1661Debug.Assert(!Convert.IsDBNull(row[_column, rowVersion])); 1664Debug.Assert((_column.ColumnMapping == MappingType.SimpleContent) ? _fOnValue : true); 1667Debug.Assert(!_fOnValue);
System.Data.Odbc (263)
Common\System\Data\Common\AdapterUtil.Odbc.cs (8)
96Debug.Fail("valid CommandType " + value.ToString()); 113Debug.Fail("valid DataRowVersion " + value.ToString()); 133Debug.Fail("valid IsolationLevel " + value.ToString()); 148Debug.Fail("valid KeyRestrictionBehavior " + value.ToString()); 165Debug.Fail("valid ParameterDirection " + value.ToString()); 182Debug.Fail("valid UpdateRowSource " + value.ToString()); 391Debug.Assert(null != value, "null value on conversion failure"); 392Debug.Assert(null != inner, "null inner on conversion failure");
Common\System\Data\Common\DbConnectionOptions.cs (1)
439Debug.Assert(!_useOdbcRules, "ExpandKeyword not ready for Odbc");
Common\System\Data\Common\DBConnectionString.cs (19)
67Debug.Assert(null != connectionOptions, "null connectionOptions"); 176Debug.Fail("empty restriction"); 286Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this"); 287Debug.Assert(null == entry || !entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry"); 299Debug.Assert(combinedSet != null, "The combined connection string should not be null"); 309Debug.Assert(!combinedSet._restrictionValues.Except(componentSet._restrictionValues).Any(), "Combined set allows values not allowed by component set"); 318Debug.Fail($"Unknown behavior for combined set: {combinedSet._behavior}"); 328Debug.Assert(!combinedSet._restrictionValues.Intersect(componentSet._restrictionValues).Any(), "Combined values allows values prevented by component set"); 335Debug.Assert(!componentSet._restrictionValues.Except(combinedSet._restrictionValues).Any(), "Combined values does not prevent all of the values prevented by the component set"); 339Debug.Fail($"Unknown behavior for combined set: {combinedSet._behavior}"); 344Debug.Fail($"Unknown behavior for component set: {componentSet._behavior}"); 357Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this"); 358Debug.Assert(!entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry"); 387Debug.Fail("invalid KeyRestrictionBehavior"); 442Debug.Assert(null != a && 0 < a.Length, "empty a"); 443Debug.Assert(null != b && 0 < b.Length, "empty b"); 537Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i - 1]), "empty restriction"); 538Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i]), "empty restriction"); 539Debug.Assert(0 >= StringComparer.Ordinal.Compare(restrictionValues[i - 1], restrictionValues[i]));
Common\System\Data\Common\DbConnectionStringCommon.cs (2)
157Debug.Assert(null != value, "ConvertToBoolean(null)"); 196Debug.Assert(null != value, "ConvertToIntegratedSecurity(null)");
Common\System\Data\ProviderBase\DbBuffer.cs (38)
61Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 89Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 115Debug.Assert(0 == offset % 4, "invalid alignment"); 147Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 148Debug.Assert(null != destination, "null destination"); 149Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 180Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 181Debug.Assert(null != destination, "null destination"); 182Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 213Debug.Assert(0 == offset % 2, "invalid alignment"); 239Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 240Debug.Assert(null != destination, "null destination"); 241Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 265Debug.Assert(0 == offset % 4, "invalid alignment"); 291Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 292Debug.Assert(null != destination, "null destination"); 293Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 317Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 343Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 385Debug.Assert(null != structure, "null structure"); 388Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 412Debug.Assert(0 == offset % 4, "invalid alignment"); 436Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 437Debug.Assert(null != source, "null source"); 438Debug.Assert(startIndex + length <= source.Length, "source too small"); 462Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 463Debug.Assert(null != source, "null source"); 464Debug.Assert(startIndex + length <= source.Length, "source too small"); 493Debug.Assert(0 == offset % 2, "invalid alignment"); 517Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 518Debug.Assert(null != source, "null source"); 519Debug.Assert(startIndex + length <= source.Length, "source too small"); 543Debug.Assert(0 == offset % 4, "invalid alignment"); 567Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment"); 568Debug.Assert(null != source, "null source"); 569Debug.Assert(startIndex + length <= source.Length, "source too small"); 593Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 617Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
Common\System\Data\ProviderBase\DbConnectionFactory.cs (1)
15Debug.Assert(null != owningConnection, "null owningConnection?");
Common\System\Data\ProviderBase\DbConnectionInternal.cs (3)
24Debug.Assert(1 == activateCount, "activated multiple times?"); 68Debug.Assert(null != owningObject, "null owningObject"); 69Debug.Assert(null != connectionFactory, "null connectionFactory");
Common\System\Data\ProviderBase\DbConnectionPool.cs (19)
139Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup"); 300Debug.Assert(obj != null, "null connection is not expected"); 330Debug.Assert(obj != null, "null connection is not expected"); 333Debug.Assert(!obj.IsEmancipated, "pooled object not in pool"); 334Debug.Assert(obj.CanBePooled, "pooled object is not poolable"); 363Debug.Assert(obj != null, "null connection is not expected"); 368Debug.Assert(obj != null, "null connection is not expected"); 417Debug.Assert(oldConnectionPool._state == State.ShuttingDown, "Old connections pool should be shutting down"); 457Debug.Assert(timerIsNotDisposed, "ErrorCallback timer has been disposed"); 488Debug.Assert(_state == State.Running || _state == State.ShuttingDown); 530Debug.Assert(!destroyObject); 543Debug.Assert(returnToGeneralPool || destroyObject); 556Debug.Assert(removed, "attempt to DestroyObject not in list"); 645Debug.Assert(connection != null, "connection should never be null in success case"); 789Debug.Assert(2 == CREATION_HANDLE, "creation handle changed value"); 907Debug.Assert(obj != null, "null connection is not expected"); 912Debug.Assert(obj != null, "null connection is not expected"); 1012Debug.Assert(null != obj, "why are we adding a null object to the pool?"); 1022Debug.Assert(null != obj, "null obj?");
src\runtime\src\libraries\Common\src\System\Data\Common\AdapterUtil.cs (3)
37Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 240Debug.Assert(e != null, "Unexpected null exception!"); 260Debug.Assert(e != null, "Unexpected null exception!");
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (12)
414Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex"); 428Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 429Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 494Debug.Assert(parsetableContainsKey, $"{nameof(ParseInternal)} code vs. regex mismatch keyname <{keyname}>"); 495Debug.Assert(value1 == value2, $"{nameof(ParseInternal)} code vs. regex mismatch keyvalue <{value1}> <{value2}>"); 520Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>"); 524Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}"); 530Debug.Fail("ParseInternal code threw exception vs regex mismatch"); 537Debug.Assert(null != connectionString, "null connectionstring"); 559Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 560Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 641Debug.Assert(expanded, "password/pwd was not removed");
src\runtime\src\libraries\Common\src\System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionClosed.cs (1)
100Debug.Assert(retry.Task.Status == TaskStatus.RanToCompletion, "retry task must be completed successfully");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (17)
64Debug.Assert(key != null, "key cannot be null"); 83Debug.Assert(null != owningConnection, "null owningConnection?"); 84Debug.Assert(null != poolGroup, "null poolGroup?"); 97Debug.Assert(null != pool, "null pool?"); 119Debug.Assert(key != null, "key cannot be null"); 134Debug.Assert(Monitor.IsEntered(s_pendingOpenNonPooled), $"Expected {nameof(s_pendingOpenNonPooled)} lock to be held."); 142Debug.Assert(null != owningObject, "null owningObject?"); 143Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 161Debug.Assert(null != connectionOptions, "prevent expansion of connectionString"); 164Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 234Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered"); 237Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?"); 238Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?"); 309Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered"); 333Debug.Assert(null != pool, "null pool?"); 352Debug.Assert(null != poolGroup, "null poolGroup?"); 367Debug.Assert(connectionPoolGroup != null, "connectionPoolGroup may not be null.");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionInternal.cs (5)
110Debug.Assert(_pooledCount <= 1 && _pooledCount >= -1, "Pooled count for object is invalid"); 221Debug.Assert(Pool != null); 258Debug.Assert(outerConnection != null, "outerConnection may not be null."); 261Debug.Assert(metaDataFactory != null, "metaDataFactory may not be null."); 378Debug.Assert(!IsEmancipated, "pooled object not in pool");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionPoolGroup.cs (4)
48Debug.Assert(null != connectionOptions, "null connection options"); 181Debug.Assert(addResult, "No other pool with current identity should exist at this point"); 187Debug.Assert(PoolGroupStateDisabled == _state, "state should be disabled"); 197Debug.Assert(PoolGroupStateActive == _state, "state should be active since a pool exists and lock holds");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbMetaDataFactory.cs (3)
115Debug.Assert(requestedCollectionRow != null); 315Debug.Assert(dataSourceInfoTable.TableName == DbMetaDataCollectionNames.DataSourceInformation); 390Debug.Assert(_metaDataCollectionsDataSet != null);
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbReferenceCollection.cs (8)
23Debug.Assert(!HasTarget, "Entry already has a valid target"); 24Debug.Assert(tag != 0, "Bad tag"); 25Debug.Assert(target != null, "Invalid target"); 88Debug.Assert(null != value && 0 != tag, "AddItem with null value or 0 tag"); 99Debug.Assert(_items[i].HasTarget, "missing expected target"); 121Debug.Assert(_items[i].HasTarget, "missing expected target"); 204Debug.Assert(!_items[index].HasTarget, "Unexpected target after notifying"); 234Debug.Assert(null != value, "RemoveItem with null");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\TimeoutTimer.cs (5)
47Debug.Assert(timeout != null); // Need a valid timeouttimer if no error 58Debug.Assert(0 <= milliseconds); 68Debug.Assert(timeout != null); // Need a valid timeouttimer if no error 81Debug.Assert(0 <= seconds || InfiniteTimeout == seconds); // no need to support negative seconds at present 162Debug.Assert(0 <= milliseconds); // This property guarantees no negative return values
System\Data\Odbc\Odbc32.cs (6)
45Debug.Fail("valid CommandType " + value.ToString()); 50Debug.Fail("invalid CommandType " + value.ToString()); 67Debug.Fail("valid IsolationLevel " + value.ToString()); 72Debug.Fail("invalid IsolationLevel " + value.ToString()); 155Debug.Fail("Unknown enumerator passed to RetcodeToString method"); 722Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE");
System\Data\Odbc\OdbcCommand.cs (3)
250Debug.Assert(null == _cmdWrapper, "has CMDWrapper when setting connection"); 407Debug.Assert(null != _connection, "GetStatementHandle without connection?"); 789Debug.Fail("ExecuteReaderObjectcalled with unsupported ODBC API method.");
System\Data\Odbc\OdbcCommandBuilder.cs (2)
229Debug.Fail("Unexpected Parametertype while DeriveParameters"); 293Debug.Assert(adapter is OdbcDataAdapter, "!OdbcDataAdapter");
System\Data\Odbc\OdbcConnection.cs (15)
43Debug.Assert(null == _connectionHandle, "reopening a connection?"); 158Debug.Assert(null != this.PoolGroup, "PoolGroup must never be null when accessing ProviderInfo"); 267Debug.Assert((escapeCharString.Length <= 1), "Can't handle multichar quotes"); 280Debug.Assert((quoteCharString.Length <= 1), "Can't handle multichar quotes"); 518Debug.Assert(retcode != ODBC32.SQLRETURN.INVALID_HANDLE, "retcode must never be ODBC32.RetCode.INVALID_HANDLE"); 552Debug.Assert(null == e, "success exception"); 555Debug.Assert(null != e, "failure without exception"); 724Debug.Fail("Can't flag unknown Attribute"); 743Debug.Fail("Can't flag unknown Attribute"); 760Debug.Fail("Can't flag unknown Attribute"); 769Debug.Fail("Can't flag unknown Attribute"); 780Debug.Assert((short)odbcFunction != 0, "SQL_API_ALL_FUNCTIONS is not supported"); 788Debug.Fail("GetFunctions called and ConnectionHandle is null (connection is disposed?)"); 839Debug.Fail("Testing that sqltype is currently not supported"); 876Debug.Fail("Testing that sqltype is currently not supported");
System\Data\Odbc\OdbcConnectionFactory.cs (4)
39Debug.Assert(!string.IsNullOrEmpty(connectionString), "empty connectionString"); 58Debug.Assert(internalConnection != null, "internalConnection may not be null."); 61Debug.Assert(odbcOuterConnection != null, "outer connection may not be null."); 68Debug.Assert(XMLStream != null, "XMLstream may not be null.");
System\Data\Odbc\OdbcConnectionHandle.cs (3)
58Debug.Assert(HandleState.Connected <= _handleState, "AutoCommitOff while in wrong state?"); 189Debug.Assert(HandleState.Allocated == _handleState, "SQLDriverConnect while in wrong state?"); 221Debug.Assert(HandleState.Allocated == _handleState, "not expected HandleState.Allocated");
System\Data\Odbc\OdbcConnectionHelper.cs (11)
124Debug.Assert(null != value, "null poolGroup"); 199Debug.Assert(DbConnectionClosedConnecting.SingletonInstance == _innerConnection, "not connecting"); 207Debug.Assert(null != userConnectionOptions, "null UserConnectionOptions"); 217Debug.Assert(null != _innerConnection, "null InnerConnection"); 218Debug.Assert(null != to, "to null InnerConnection"); 238Debug.Fail("unexpected state switch"); 248Debug.Assert(null != _innerConnection, "null InnerConnection"); 249Debug.Assert(null != from, "from null InnerConnection"); 250Debug.Assert(null != to, "to null InnerConnection"); 257Debug.Assert(null != _innerConnection, "null InnerConnection"); 258Debug.Assert(null != to, "to null InnerConnection");
System\Data\Odbc\OdbcConnectionPoolProviderInfo.cs (1)
86Debug.Assert(_quoteChar != null, "QuoteChar getter called but no quote char was set");
System\Data\Odbc\OdbcConnectionStringbuilder.cs (3)
80Debug.Fail("unexpected keyword"); 204Debug.Fail("unexpected keyword"); 239Debug.Fail("unexpected keyword");
System\Data\Odbc\OdbcDataReader.cs (26)
61Debug.Assert(command != null, "Command null on OdbcDataReader ctor"); 75Debug.Fail("object is disposed"); 359Debug.Assert(null != Connection, "null cmd connection"); 966Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 1009Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value"); 1023Debug.Assert(cbMissing == -1 && lengthOrIndicator <= cbMaxData); 1148Debug.Assert((cachedObj != null), "internalGetString should always return non-null or raise exception"); 1153Debug.Assert((cachedObj != null), "internalGetBytes should always return non-null or raise exception"); 1339Debug.Assert(bufferIndex >= 0, "Negative buffer index"); 1340Debug.Assert(bytesOrCharsLength >= 0, "Negative number of bytes or chars to read"); 1343Debug.Assert(buffer == null || bytesOrCharsLength <= (buffer.Length - bufferIndex), "Not enough space in user's buffer"); 1409Debug.Assert((cbTotal > 0), "GetData returned negative value, which is not SQL_NO_TOTAL"); 1486Debug.Assert(flag, "internalGetBytes - unexpected invalid result inside if-block"); 1645Debug.Fail("Non-V3 driver. Must not call GetDescFieldStr"); 1725Debug.Assert(null != StatementHandle, "Statement handle is null in DateReader"); 1728Debug.Assert(_dataCache == null || !Convert.IsDBNull(_dataCache[i]), "Cannot call GetData without checking for cache first!"); 1733Debug.Assert(cb <= Buffer.Length - 2, "GetData needs to Reallocate. Perf bug"); 1911Debug.Assert(!disposing || !allresults, "both disposing & allresults are true"); 1989Debug.Assert(!disposing, "errors while disposing"); 2308Debug.Assert(_metadata != null); 2324Debug.Assert(buffer.Length >= 264, "Native buffer to small (_buffer.Length < 264)"); 2472Debug.Assert(_metadata != null); 2505Debug.Assert(buffer.Length >= 544, "Native buffer to small (_buffer.Length < 544)"); 2851Debug.Assert(str.Length > 1, "Illegal string, only one char that is a quote"); 2852Debug.Assert(str[str.Length - 1] == quoteChar, "Missing quote at end of string that begins with quote"); 2891Debug.Assert(quotePrefix != null && quoteSuffix != null);
System\Data\Odbc\OdbcHandle.cs (5)
30Debug.Assert(null == parentHandle, "did not expect a parent handle"); 36Debug.Assert(null != parentHandle, "expected a parent handle"); // safehandle can't be null 43Debug.Fail("unexpected handleType"); 80Debug.Assert((ODBC32.SQL_ATTR.APP_PARAM_DESC == attribute) || (ODBC32.SQL_ATTR.APP_ROW_DESC == attribute), "invalid attribute"); 160Debug.Assert(ADP.PtrZero == handle, "unknown handle type");
System\Data\Odbc\OdbcMetaDataFactory.cs (2)
82Debug.Assert(restrictionCollectionName != null); 503Debug.Assert(allRestrictions.Length >= restrictionsCount);
System\Data\Odbc\OdbcParameter.cs (12)
336Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 399else { Debug.Fail("not expecting this"); } 410Debug.Assert((0 <= cch) && (cch < 0x3fffffff), $"GetColumnSize: cch = {cch} out of range, _internalShouldSerializeSize = {_internalShouldSerializeSize}, _internalSize = {_internalSize}"); 455Debug.Assert((0 <= cch) && (cch < 0x3fffffff), $"GetValueSize: cch = {cch} out of range, _internalShouldSerializeSize = {_internalShouldSerializeSize}, _internalSize = {_internalSize}"); 475Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary"); 504else { Debug.Fail("not expecting this"); } 529Debug.Assert((0 <= ccb) && (ccb < 0x3fffffff), $"GetParameterSize: out of range {ccb}"); 622Debug.Assert(command.Connection != null); 792Debug.Assert(command.Connection != null); 978Debug.Assert(ODBC32.SQL_C.NUMERIC == _typemap._sql_c, "unexpected"); 1032Debug.Assert(null != _typemap, "GetParameterValue: null _typemap"); 1108Debug.Fail("Unexpected Direction Property on Parameter");
System\Data\Odbc\OdbcParameterCollectionHelper.cs (2)
258Debug.Assert((null != items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 267Debug.Assert((null != items) && (0 <= index) && (index < Count), "Replace Index invalid");
System\Data\Odbc\OdbcReferenceCollection.cs (3)
32Debug.Fail("shouldn't be here"); 42Debug.Fail("shouldn't be here"); 46Debug.Fail("shouldn't be here");
System\Data\Odbc\OdbcUtils.cs (14)
37Debug.Assert((cb > 0), "Character count negative "); 38Debug.Assert((Length >= cb), "Native buffer too small "); 45Debug.Assert((cb > 0), "Character count negative "); 46Debug.Assert((Length >= cb), "Native buffer too small "); 143Debug.Fail("UnknownSQLCType"); 168Debug.Assert(value is string || value is char[], "Only string or char[] can be marshaled to WCHAR"); 180Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 193Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 207Debug.Assert((valueOffset <= length), "Offset out of Range"); 222Debug.Assert(length < (base.Length - valueOffset), "attempting to extend parameter buffer!"); 315Debug.Fail("UnknownSQLCType"); 456Debug.Assert((_sqlstatement[curidx] == '['), "GetTokenFromQuote: character at starting position must be same as quotechar"); 472Debug.Assert(_quote != ' ', "ODBC driver doesn't support quoted identifiers -- GetTokenFromQuote should not be used in this case"); 473Debug.Assert((_sqlstatement[curidx] == _quote), "GetTokenFromQuote: character at starting position must be same as quotechar");
System.Data.OleDb (502)
ColumnBinding.cs (123)
56Debug.Assert(null != rowbinding, "null rowbinding"); 57Debug.Assert(null != bindings, "null bindings"); 58Debug.Assert(ODB.SizeOf_tagDBBINDING <= offset, $"invalid offset {offset}"); 76Debug.Assert(0 <= _offsetStatus, "negative _offsetStatus"); 77Debug.Assert(0 <= _offsetLength, "negative _offsetLength"); 78Debug.Assert(0 <= _offsetValue, "negative _offsetValue"); 160Debug.Assert(null != _dataReader, "null DataReader"); 166Debug.Assert((null != _parameter) && (null != parameter), "null parameter"); 192Debug.Assert(0 <= value, "negative LengthValue"); 198Debug.Assert(null != _parameter, "null parameter"); 238Debug.Fail("unexpected StatusValue"); 383Debug.Fail("should have bound as WSTR"); 386Debug.Fail("should have bound as NUMERIC"); 389Debug.Fail("UDT binding should not have been encountered"); 392Debug.Fail("should have bound as BYREF|WSTR"); 416Debug.Fail("should have bound as WSTR"); 419Debug.Fail("should have bound as BYREF|WSTR"); 587Debug.Fail("unknown DBTYPE"); 591Debug.Fail("Should have bound as WSTR"); 594Debug.Fail("UDT binding should not have been encountered"); 597Debug.Fail("not allowed to set HCHAPTER"); 600Debug.Fail("should have bound as NUMERIC"); 603Debug.Fail("should have bound as BYREF|WSTR"); 611Debug.Assert((NativeDBType.BOOL == DbType), "Value_BOOL"); 612Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_BOOL"); 618Debug.Assert((NativeDBType.BOOL == DbType), "Value_BOOL"); 626Debug.Assert((NativeDBType.BSTR == DbType), "Value_BSTR"); 627Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_BSTR"); 652Debug.Assert((null != value), "Value_BSTR null"); 653Debug.Assert((NativeDBType.BSTR == DbType), "Value_BSTR"); 661Debug.Assert(((NativeDBType.BYREF | NativeDBType.BYTES) == DbType), "Value_ByRefBYTES"); 662Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_ByRefBYTES"); 688Debug.Assert(null != value, "Value_ByRefBYTES null"); 689Debug.Assert((NativeDBType.BYREF | NativeDBType.BYTES) == DbType, "Value_ByRefBYTES"); 709Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR"); 710Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_ByRefWSTR"); 736Debug.Assert(null != value, "Value_ByRefWSTR null"); 737Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR"); 755Debug.Assert(null != value, "Value_ByRefWSTR null"); 756Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR"); 775Debug.Assert(NativeDBType.BYTES == DbType, "Value_BYTES"); 776Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_BYTES"); 784Debug.Assert(null != value, "Value_BYTES null"); 797Debug.Assert(NativeDBType.CY == DbType, "Value_CY"); 798Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_CY"); 803Debug.Assert(NativeDBType.CY == DbType, "Value_CY"); 811Debug.Assert(NativeDBType.DATE == DbType, "Value_DATE"); 812Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DATE"); 817Debug.Assert(NativeDBType.DATE == DbType, "Value_DATE"); 825Debug.Assert(NativeDBType.DBDATE == DbType, "Value_DBDATE"); 826Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBDATE"); 831Debug.Assert(NativeDBType.DBDATE == DbType, "Value_DATE"); 839Debug.Assert(NativeDBType.DBTIME == DbType, "Value_DBTIME"); 840Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBTIME"); 845Debug.Assert(NativeDBType.DBTIME == DbType, "Value_DBTIME"); 853Debug.Assert(NativeDBType.DBTIMESTAMP == DbType, "Value_DBTIMESTAMP"); 854Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBTIMESTAMP"); 859Debug.Assert(NativeDBType.DBTIMESTAMP == DbType, "Value_DBTIMESTAMP"); 867Debug.Assert(NativeDBType.DECIMAL == DbType, "Value_DECIMAL"); 868Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DECIMAL"); 880Debug.Assert(NativeDBType.DECIMAL == DbType, "Value_DECIMAL"); 900Debug.Assert(NativeDBType.ERROR == DbType, "Value_ERROR"); 901Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_ERROR"); 906Debug.Assert(NativeDBType.ERROR == DbType, "Value_ERROR"); 914Debug.Assert(NativeDBType.FILETIME == DbType, "Value_FILETIME"); 915Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_FILETIME"); 921Debug.Assert(NativeDBType.FILETIME == DbType, "Value_FILETIME"); 930Debug.Assert(NativeDBType.GUID == DbType, "Value_GUID"); 931Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_GUID"); 936Debug.Assert(NativeDBType.GUID == DbType, "Value_GUID"); 945Debug.Assert(NativeDBType.HCHAPTER == DbType, "Value_HCHAPTER"); 946Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_HCHAPTER"); 953Debug.Assert(NativeDBType.I1 == DbType, "Value_I1"); 954Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I1"); 960Debug.Assert(NativeDBType.I1 == DbType, "Value_I1"); 968Debug.Assert(NativeDBType.I2 == DbType, "Value_I2"); 969Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I2"); 974Debug.Assert(NativeDBType.I2 == DbType, "Value_I2"); 982Debug.Assert(NativeDBType.I4 == DbType, "Value_I4"); 983Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I4"); 988Debug.Assert(NativeDBType.I4 == DbType, "Value_I4"); 996Debug.Assert(NativeDBType.I8 == DbType, "Value_I8"); 997Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I8"); 1002Debug.Assert(NativeDBType.I8 == DbType, "Value_I8"); 1010Debug.Assert(NativeDBType.IDISPATCH == DbType, "Value_IDISPATCH"); 1011Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_IDISPATCH"); 1034Debug.Assert(NativeDBType.IDISPATCH == DbType, "Value_IDISPATCH"); 1057Debug.Assert(NativeDBType.IUNKNOWN == DbType, "Value_IUNKNOWN"); 1058Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_IUNKNOWN"); 1081Debug.Assert(NativeDBType.IUNKNOWN == DbType, "Value_IUNKNOWN"); 1090Debug.Assert(NativeDBType.NUMERIC == DbType, "Value_NUMERIC"); 1091Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_NUMERIC"); 1096Debug.Assert(NativeDBType.NUMERIC == DbType, "Value_NUMERIC"); 1111Debug.Assert(NativeDBType.R4 == DbType, "Value_R4"); 1112Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_R4"); 1118Debug.Assert(NativeDBType.R4 == DbType, "Value_R4"); 1126Debug.Assert(NativeDBType.R8 == DbType, "Value_R8"); 1127Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_R8"); 1133Debug.Assert(NativeDBType.R8 == DbType, "Value_I4"); 1141Debug.Assert(NativeDBType.UI1 == DbType, "Value_UI1"); 1142Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI1"); 1147Debug.Assert(NativeDBType.UI1 == DbType, "Value_UI1"); 1155Debug.Assert(NativeDBType.UI2 == DbType, "Value_UI2"); 1156Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI2"); 1161Debug.Assert(NativeDBType.UI2 == DbType, "Value_UI2"); 1169Debug.Assert(NativeDBType.UI4 == DbType, "Value_UI4"); 1170Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI4"); 1175Debug.Assert(NativeDBType.UI4 == DbType, "Value_UI4"); 1183Debug.Assert(NativeDBType.UI8 == DbType, "Value_UI8"); 1184Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI8"); 1189Debug.Assert(NativeDBType.UI8 == DbType, "Value_UI8"); 1197Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR"); 1198Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_WSTR"); 1199Debug.Assert(2 < ColumnBindingMaxLen, "Value_WSTR"); 1205Debug.Assert(null != value, "Value_BYTES null"); 1206Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR"); 1220Debug.Assert(null != value, "Value_BYTES null"); 1221Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR"); 1234Debug.Assert((NativeDBType.VARIANT == DbType) || (NativeDBType.PROPVARIANT == DbType), "Value_VARIANT"); 1235Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_VARIANT"); 1240Debug.Assert((NativeDBType.VARIANT == DbType) || (NativeDBType.PROPVARIANT == DbType), "Value_VARIANT"); 1671Debug.Fail("CheckStatusValue: unhandled data with ok status"); 1674Debug.Fail("CheckStatusValue: unhandled data with truncated status");
DbBindings.cs (15)
70Debug.Assert((0 <= value) && (value < _count), "bad binding index"); 77Debug.Assert(null != _columnBindings, "null ColumnBindings"); 83Debug.Assert(null != _parameters, "null Parameters"); 180Debug.Assert(0 <= value, "invalid MaxLen"); 245Debug.Assert(null == _rowBinding, "row binding already allocated"); 246Debug.Assert(null == _columnBindings, "column bindings already allocated"); 252Debug.Assert(null != columnBindings, "null column bindings"); 257Debug.Assert(columnBindings.Length == _dbcolumns.Length, "length mismatch"); 268Debug.Assert(index < binding.Index, "invaild index"); 315Debug.Assert(null != collection, "null parameter collection"); 316Debug.Assert(null != _parameters, "null parameters"); 325Debug.Assert(null != binding, "null column binding"); 326Debug.Assert(binding.Parameter() == _parameters[i], "parameter mismatch"); 363Debug.Assert(null != _rowBinding, "no row binding"); 364Debug.Assert(null != _columnBindings, "no column bindings");
DbConnectionOptions.cs (13)
488Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower"); 767Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex"); 781Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index"); 782Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index"); 844Debug.Assert(parsetable.Contains(keyname), $"ParseInternal code vs. regex mismatch keyname <{keyname}>"); 845Debug.Assert(value1 == value2, $"ParseInternal code vs. regex mismatch keyvalue <{value1}> <{value2}>"); 871Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>"); 875Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}"); 881Debug.Fail("ParseInternal code threw exception vs regex mismatch"); 887Debug.Assert(null != connectionString, "null connectionstring"); 910Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname"); 911Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue"); 985Debug.Assert(expanded, "password/pwd was not removed");
DbConnectionStringCommon.cs (2)
22Debug.Assert(null != items[i], "null item"); 134Debug.Assert(null != value, "ConvertToBoolean(null)");
DbPropSet.cs (6)
47Debug.Assert(null != properties, "null IDBProperties"); 65Debug.Assert(null != properties, "null IRowsetInfo"); 83Debug.Assert(null != properties, "null ICommandProperties"); 226Debug.Assert(Guid.Empty != propertySet, "invalid propertySet"); 227Debug.Assert((null != properties) && (0 < properties.Length), "invalid properties"); 264Debug.Assert(null != properties[i], $"null tagDBPROP {i.ToString(CultureInfo.InvariantCulture)}");
OleDb_Util.cs (5)
48Debug.Fail("CommandParameterStatus: unexpected E_CANTCREATE"); 57Debug.Fail("CommandParameterStatus: unexpected E_PERMISSIONDENIED"); 61Debug.Fail("CommandParameterStatus: unexpected E_INTEGRITYVIOLATION"); 65Debug.Fail("CommandParameterStatus: unexpected E_SCHEMAVIOLATION"); 69Debug.Fail("CommandParameterStatus: unexpected E_BADSTATUS");
OleDbCommand.cs (19)
357Debug.Assert(null != _icommandText, "IAccessor: null ICommandText"); 364Debug.Assert(null != _icommandText, "ICommandProperties: null ICommandText"); 371Debug.Assert(null != _icommandText, "ICommandPrepare: null ICommandText"); 378Debug.Assert(null != _icommandText, "ICommandWithParameters: null ICommandText"); 389Debug.Assert(System.Data.CommandType.Text == CommandType || System.Data.CommandType.StoredProcedure == CommandType, "CreateAccessor: incorrect CommandType"); 390Debug.Assert(null == _dbBindings, "CreateAccessor: already has dbBindings"); 391Debug.Assert(HasParameters(), "CreateAccessor: unexpected, no parameter collection"); 519Debug.Assert(null != _connection, "no connection, CloseInternal"); 534Debug.Assert(_dbBindings == bindings, "bindings with two owners"); 564Debug.Assert(null != _connection, "no connection, CloseInternalParameters"); 690Debug.Fail("ExecuteReaderInternal: unknown result type"); 713Debug.Assert(null != dataReader, "ExecuteReader should never return a null DataReader"); 859Debug.Assert(0 == (CommandBehavior.SingleRow & this.commandBehavior), "SingleRow implies SingleResult"); 891Debug.Assert(_executeQuery, "ExecuteNonQuery should always use ExecuteCommandTextForSingleResult"); 932Debug.Assert(null != e, "missing inner exception"); 1114Debug.Assert(null != _connection, "ExpandStoredProcedureToText: null Connection"); 1131Debug.Assert(null != _connection, "InitializeCommand: null OleDbConnection"); 1276Debug.Assert(_connection != null); 1282Debug.Assert(!_isPrepared, "null command isPrepared");
OleDbCommandBuilder.cs (1)
392Debug.Assert(adapter is OleDbDataAdapter, "!OleDbDataAdapter");
OleDbConnection.cs (12)
187Debug.Assert(null != this.PoolGroup, "PoolGroup must never be null when accessing ProviderInfo"); 242Debug.Fail($"Unknown 'Connection Status' value {connectionStatus.ToString("G", CultureInfo.InvariantCulture)}"); 263Debug.Assert(null != GetOpenConnection(), "ICommandText closed"); 269Debug.Assert(null != GetOpenConnection(), "IDBProperties closed"); 275Debug.Assert(null != GetOpenConnection(), "IOpenRowset closed"); 281Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SqlSupport"); 287Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SupportMultipleResults"); 293Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SupportIRow"); 299Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString QuotedIdentifierCase"); 477Debug.Assert(null != GetOpenConnection(), "GetSchemaRowset closed"); 546Debug.Assert(1 == propSet.PropertySetCount, "too many PropertySets"); 549Debug.Assert(1 == dbprops.Length, "too many Properties");
OleDbConnectionFactory.cs (4)
44Debug.Assert(!ADP.IsEmpty(connectionString), "null connectionString"); 51Debug.Assert(internalConnection != null, "internalConnection may not be null."); 56Debug.Assert(oleDbOuterConnection != null, "outer connection may not be null."); 97Debug.Assert(XMLStream != null, "XMLstream may not be null.");
OleDbConnectionInternal.cs (20)
69Debug.Assert((null != constr) && !constr.IsEmpty, "empty connectionstring"); 86Debug.Assert(!_datasrcwrp.IsInvalid, "bad DataSource"); 107Debug.Assert(null != e, "CreateSessionError"); 110Debug.Assert(!_sessionwrp.IsInvalid, "bad Session"); 190Debug.Assert(null != _datasrcwrp, "IDBProperties: null datasource"); 197Debug.Assert(null != _datasrcwrp, "IOpenRowset: null datasource"); 198Debug.Assert(null != _sessionwrp, "IOpenRowset: null session"); 205Debug.Assert(null != _datasrcwrp, "IDBInfo: null datasource"); 212Debug.Assert(null != _datasrcwrp, "IDBSchemaRowset: null datasource"); 213Debug.Assert(null != _sessionwrp, "IDBSchemaRowset: null session"); 220Debug.Assert(null != _datasrcwrp, "ITransactionJoin: null datasource"); 221Debug.Assert(null != _sessionwrp, "ITransactionJoin: null session"); 228Debug.Assert(null != _datasrcwrp, "IDBCreateCommand: null datasource"); 229Debug.Assert(null != _sessionwrp, "IDBCreateCommand: null session"); 234Debug.Assert((0 <= hr) || (null == icommandText), "CreateICommandText: error with ICommandText"); 267Debug.Assert(null != _datasrcwrp, "ITransactionLocal: null datasource"); 268Debug.Assert(null != _sessionwrp, "ITransactionLocal: null session"); 314Debug.Assert(null == LocalTransaction, "why was Deactivate not called first"); 742Debug.Assert(null != wrapper, "GetObjectPool: null dataInitialize"); 781Debug.Assert(null != head, "unexcpted Transaction state");
OleDbConnectionString.cs (3)
145Debug.Assert(!ADP.IsEmpty(this[KEY.Provider]), "no Provider"); 254Debug.Assert(!ADP.IsEmpty(udlfilename), "empty filename didn't fail"); 258Debug.Assert(udlfilename == ADP.GetFullPath(udlfilename), "only cache full path filenames");
OleDbConnectionStringBuilder.cs (3)
121Debug.Fail("unexpected keyword"); 316Debug.Fail("unexpected keyword"); 360Debug.Fail("unexpected keyword");
OleDbDataAdapter.cs (4)
188Debug.Assert(null != data, "FillFromADODB: null data object"); 189Debug.Assert(null != adodb, "FillFromADODB: null ADODB"); 190Debug.Assert(!(adodb is DataTable), "call Fill( (DataTable) value)"); 191Debug.Assert(!(adodb is DataSet), "call Fill( (DataSet) value)");
OleDbDataReader.cs (66)
119Debug.Assert(_singleRow, "SingleRow not already set"); 175Debug.Assert((_singleRow && !_isClosed && !_isRead && (null == _irow) && (null == _irowset)) || 240Debug.Fail("object is disposed"); 251Debug.Fail("object is disposed"); 283Debug.Assert(null == _metadata, "BuildMetaInfo: already built, by _metadata"); 300Debug.Assert(null != _bindings, "unexpected dbBindings"); 321Debug.Assert(null == _dbSchemaTable, "BuildSchemaTable: schema table already exists"); 322Debug.Assert(null != metadata, "BuildSchemaTable: no _metadata"); 453Debug.Assert(null == _dbSchemaTable, "non-null SchemaTable"); 454Debug.Assert(null == _metadata, "non-null metadata"); 455Debug.Assert(null != handle, "unexpected null rowset"); 463Debug.Fail("bad IRow - IColumnsInfo not available"); 467Debug.Assert(handle is UnsafeNativeMethods.IRowset, "bad IRowset - IColumnsInfo not available"); 496Debug.Assert(0 < columnCount, "BuildSchemaTableInfoTable - no column"); 551Debug.Assert(ODB.DBKIND_PGUID_NAME != dbColumnInfo.columnid.eKind, "OLE DB providers never return pGuid-style bindings."); 552Debug.Assert(ODB.DBKIND_PGUID_PROPID != dbColumnInfo.columnid.eKind, "OLE DB providers never return pGuid-style bindings."); 582Debug.WriteLine($"OleDbDataReader[{info.ordinal}, {dbColumnInfo.pwszName}]={dbType.enumOleDbType},{dbType.dataSourceType}, {dbType.wType}"); 602Debug.Assert(null == _dbSchemaTable, "BuildSchemaTableRowset - non-null SchemaTable"); 603Debug.Assert(null != handle, "BuildSchemaTableRowset(object) - unexpected null handle"); 614Debug.Assert((0 == hr) || prgOptColumns.IsInvalid, "GetAvailableCOlumns: unexpected return"); 618Debug.Assert((0 <= hr) || (null == rowset), "if GetColumnsRowset failed, rowset should be null"); 1015Debug.Assert(fieldType != null); 1055Debug.Assert(null != _metadata[index].columnName); 1110Debug.Assert(null != binding, "null binding"); 1115Debug.Assert(_nextAccessorForRetrieval <= binding.IndexForAccessor, "backwards index for accessor"); 1116Debug.Assert(_nextAccessorForRetrieval == i, "failed to increment"); 1214Debug.Assert(!_hasRowsReadCheck, "_hasRowsReadCheck not reset"); 1263Debug.Assert(OleDbHResult.DB_E_OBJECTOPEN == hr, "unexpected"); 1296Debug.Fail("<oledb.OleDbDataReader.NextResultsInfinite|INFO> System.Data.OleDb.OleDbDataReader: 2000 IMultipleResult.GetResult(NULL, DBRESULTFLAG_DEFAULT, IID_NULL, NULL, NULL) iterations with 0 records affected. Stopping suspect infinite loop. To work-around try using ExecuteReader() and iterating through results with NextResult().\n"); 1317Debug.Assert(null == _irow, "NextResult: row loop check"); 1318Debug.Assert(null == _irowset, "NextResult: rowset loop check"); 1417Debug.Assert(null != _irowset, "ReadRow: null IRowset"); 1418Debug.Assert(0 <= _metadata!.Length, "incorrect state for fieldCount"); 1430Debug.Assert(0 == _currentRow, "incorrect state for _currentRow"); 1431Debug.Assert(0 <= _metadata.Length, "incorrect state for fieldCount"); 1432Debug.Assert(0 == _nextAccessorForRetrieval, "incorrect state for nextAccessorForRetrieval"); 1433Debug.Assert(0 == _nextValueForRetrieval, "incorrect state for nextValueForRetrieval"); 1443Debug.Assert(null != _irowset, "ReleaseCurrentRow: no rowset"); 1449Debug.Assert(null != bindings, "ReleaseCurrentRow: null dbBindings"); 1467Debug.Assert(null == _bindings, "CreateAccessor: dbBindings already exists"); 1468Debug.Assert(null != _irowset, "CreateAccessor: no IRowset available"); 1469Debug.Assert(null != _metadata && 0 < _metadata.Length, "no columns"); 1580Debug.Assert(indexToBinding[index] < dbbindings.Length, "bad indexToAccessor"); 1600Debug.Assert(NativeDBType.STR != getType, "Should have bound as WSTR"); 1676Debug.Assert(count == columnBindings[k].Index, "column binding mismatch"); 1689Debug.Assert(0 < (int)_rowHandleFetchCount, "GetRowHandles: bad _rowHandleFetchCount"); 1690Debug.Assert(!_isRead, "GetRowHandles: _isRead"); 1706Debug.Assert(rowHandleBuffer.DangerousGetHandle() == rowHandlesPtr, "rowhandlebuffer changed"); 1739Debug.Assert(null != _bindings, "GetRowDataFromHandle: null dbBindings"); 1740Debug.Assert(null != _rowHandleNativeBuffer, "GetRowDataFromHandle: null dbBindings"); 1777Debug.Assert(0 < (int)_rowFetchedCount, "invalid _rowFetchedCount"); 1835Debug.Assert(null != _irow, "GetRowValue: null IRow"); 1836Debug.Assert(null != _metadata, "GetRowValue: null MetaData"); 1841Debug.Assert(_nextValueForRetrieval <= columnBindings[0].Index, "backwards retrieval"); 1910Debug.Assert(null != _connection, "null connection"); 1911Debug.Assert(null != _metadata, "no _metadata"); 1953Debug.WriteLine("Multiple BaseTableName detected:" 2074Debug.WriteLine($"PartialKeyColumn detected: <{name}> metaindex={metaindex}"); 2165Debug.WriteLine($"MultipleUniqueIndexes detected: <{uniqueIndexName}> <{indexname}>"); 2177Debug.WriteLine($"PartialKeyColumn detected: {name}"); 2192Debug.WriteLine($"PartialUniqueIndexes detected: <{uniqueIndexName}> <{indexname}>"); 2213Debug.WriteLine($"upgrade single unique index to be a key: <{uniqueIndexName}>"); 2248Debug.Assert(null == dataReader._fieldNameLookup, "lookup already exists"); 2457Debug.WriteLine($"Filtered Column: DBCOLUMN_GUID=DBCOL_SPECIALCOL DBCOLUMN_NAME={info.columnName} DBCOLUMN_KEYCOLUMN={info.isKeyColumn}"); 2468Debug.WriteLine($"Filtered Column: DBCOLUMN_NUMBER={info.ordinal} DBCOLUMN_NAME={info.columnName}"); 2479Debug.WriteLine($"Filtered Column: DBCOLUMN_FLAGS={info.flags:X8} DBCOLUMN_NAME={info.columnName}");
OleDbException.cs (2)
32Debug.Assert(null != errors, "OleDbException without OleDbErrorCollection"); 106Debug.Assert(0 < exceptions.Count, "missing exceptions");
OleDbInfoMessageEvent.cs (1)
14Debug.Assert(null != exception, "OleDbInfoMessageEventArgs without OleDbException");
OleDbMetaDataFactory.cs (2)
400Debug.Assert(sourceColumns.Length == targetColumns.Length); 558Debug.Assert(numberOfSupportedRestictions != -1, "PrepareCollection was called for an collection that is not supported.");
OleDbParameter.cs (7)
31Debug.Assert(!(value is OleDbType), "use OleDbParameter(string, OleDbType)"); 32Debug.Assert(!(value is SqlDbType), "use OleDbParameter(string, OleDbType)"); 384Debug.Assert(NativeDBType.STR != dbtype.wType, "should have ANSI binding, describing is okay"); 412Debug.Assert(NativeDBType.STR != dbtype.wType, "should have ANSI binding, describing is okay"); 459Debug.Assert(_changeID == changeID, "parameter has unexpectedly changed"); 466Debug.Assert(null != destinationType, "null destinationType"); 545Debug.Assert(IsParameterComputed(), "Prepare computed parameter");
OleDbParameterCollectionHelper.cs (2)
259Debug.Assert((null != items) && (0 <= index) && (index < Count), "RemoveIndex, invalid"); 268Debug.Assert((null != items) && (0 <= index) && (index < Count), "Replace Index invalid");
OleDbReferenceCollection.cs (1)
35Debug.Fail("shouldn't be here");
OleDbTransaction.cs (2)
50Debug.Assert(_mustComplete, "transaction already completed"); 78Debug.Assert(_mustComplete, "transaction already completed");
OleDbWrapper.cs (8)
102Debug.Assert(null != e, "CreateProviderError"); 110Debug.Assert(!datasrcWrapper.IsInvalid, "bad DataSource"); 377Debug.Assert(constr.HaveQueriedForCreateCommand, "expected HaveQueriedForCreateCommand"); 378Debug.Assert(null != constr.DangerousIDBCreateCommandCreateCommand, "expected DangerousIDBCreateCommandCreateCommand"); 499Debug.Assert(null != _value, "null IDBProperties"); 506Debug.Assert(null != _value, "null IDBProperties"); 563Debug.Assert(null != _value, "null IOpenRowsetWrapper"); 570Debug.Assert(null != _value, "null IDBProperties");
RowBinding.cs (30)
46Debug.Assert(0 < _bindingCount, "bad _bindingCount"); 47Debug.Assert(0 < _headerLength, "bad _headerLength"); 48Debug.Assert(0 < _dataLength, "bad _dataLength"); 49Debug.Assert(_bindingCount * 3 * IntPtr.Size <= _dataLength, "_dataLength too small"); 50Debug.Assert(_headerLength + _dataLength <= _emptyStringOffset, "bad string offset"); 51Debug.Assert(_headerLength + _dataLength + 8 <= length, "bad length"); 58Debug.Fail("previous row not yet cleared"); 114Debug.Fail("unknown accessor buffer"); 124Debug.Assert(null != bindings, "null bindings"); 125Debug.Assert(dbbindings.Length == BindingCount(), "count mismatch"); 170Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false"); 171Debug.Assert(0 == (ODB.SizeOf_Variant % 8), "unexpected VARIANT size mutiplier"); 172Debug.Assert(0 == offset % 8, "invalid alignment"); 200Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false"); 201Debug.Assert(0 == (ODB.SizeOf_Variant % 8), "unexpected VARIANT size mutiplier"); 202Debug.Assert(0 == offset % 8, "invalid alignment"); 241Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false"); 242Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 280Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false"); 281Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 374Debug.Assert(0 <= _bindingCount && (_bindingCount * ODB.SizeOf_tagDBBINDING) < Length, "bad _bindingCount"); 386Debug.Fail("expected _needToReset"); 396Debug.Assert(IntPtr.Zero != buffer && _needToReset && _haveData, "shouldn't be calling ResetValues"); 459Debug.Fail("investigate"); 469Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset"); 481Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset"); 510Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset"); 538Debug.Assert(0 == (sizeof(ComVariant) % 8), "unexpected PROPVARIANT size mutiplier"); 539Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset"); 568Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
SafeHandles.cs (9)
93Debug.Assert(ODB.DB_NULL_HROW != value, "bad rowHandle"); 257Debug.Assert(buf1 != buf2, "buf1 and buf2 are the same"); 258Debug.Assert(buf1.ToInt64() < buf2.ToInt64() || buf2.ToInt64() + count <= buf1.ToInt64(), "overlapping region buf1"); 259Debug.Assert(buf2.ToInt64() < buf1.ToInt64() || buf1.ToInt64() + count <= buf2.ToInt64(), "overlapping region buf2"); 260Debug.Assert(0 <= count, "negative count"); 273Debug.Assert(dst != src, "dst and src are the same"); 274Debug.Assert(dst.ToInt64() < src.ToInt64() || src.ToInt64() + count <= dst.ToInt64(), "overlapping region dst"); 275Debug.Assert(src.ToInt64() < dst.ToInt64() || dst.ToInt64() + count <= src.ToInt64(), "overlapping region src"); 276Debug.Assert(0 <= count, "negative count");
System\Data\Common\AdapterUtil.cs (12)
39Debug.Assert(e != null, "TraceException: null Exception"); 52Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 57Debug.Assert(ADP.IsCatchableExceptionType(e), "Invalid exception type, should have been re-thrown!"); 223Debug.Assert(e != null, "Unexpected null exception!"); 243Debug.Assert(e != null, "Unexpected null exception!"); 269Debug.Fail($"valid CommandType {value}"); 286Debug.Fail($"valid DataRowVersion {value}"); 306Debug.Fail($"valid IsolationLevel {value}"); 323Debug.Fail($"valid ParameterDirection {value}"); 340Debug.Fail($"valid UpdateRowSource {value}"); 714Debug.Assert(null != value, "null value on conversion failure"); 715Debug.Assert(null != inner, "null inner on conversion failure");
System\Data\Common\FieldNameLookup.cs (1)
33Debug.Assert(null != fieldNames[i]);
System\Data\Common\NameValuePair.cs (2)
17Debug.Assert(!string.IsNullOrEmpty(name), "empty keyname"); 27Debug.Assert(0 < _length, "NameValuePair zero Length usage");
System\Data\ProviderBase\DbBuffer.cs (37)
62Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 88Debug.Assert(0 == offset % 4, "invalid alignment"); 120Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 121Debug.Assert(null != destination, "null destination"); 122Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 153Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 154Debug.Assert(null != destination, "null destination"); 155Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 186Debug.Assert(0 == offset % 2, "invalid alignment"); 212Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 213Debug.Assert(null != destination, "null destination"); 214Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 238Debug.Assert(0 == offset % 4, "invalid alignment"); 264Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 265Debug.Assert(null != destination, "null destination"); 266Debug.Assert(startIndex + length <= destination.Length, "destination too small"); 290Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 316Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 358Debug.Assert(null != structure, "null structure"); 361Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 385Debug.Assert(0 == offset % 4, "invalid alignment"); 409Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 410Debug.Assert(null != source, "null source"); 411Debug.Assert(startIndex + length <= source.Length, "source too small"); 435Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 436Debug.Assert(null != source, "null source"); 437Debug.Assert(startIndex + length <= source.Length, "source too small"); 466Debug.Assert(0 == offset % 2, "invalid alignment"); 490Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 491Debug.Assert(null != source, "null source"); 492Debug.Assert(startIndex + length <= source.Length, "source too small"); 516Debug.Assert(0 == offset % 4, "invalid alignment"); 540Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 541Debug.Assert(null != source, "null source"); 542Debug.Assert(startIndex + length <= source.Length, "source too small"); 566Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment"); 590Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
System\Data\ProviderBase\DbConnectionClosed.cs (1)
127Debug.Assert(retry.Task.Status == TaskStatus.RanToCompletion, "retry task must be completed successfully");
System\Data\ProviderBase\DbConnectionFactory.cs (15)
69Debug.Assert(null != owningConnection, "null owningConnection?"); 70Debug.Assert(null != poolGroup, "null poolGroup?"); 87Debug.Assert(null != pool, "null pool?"); 124Debug.Assert(null != owningConnection, "null owningConnection?"); 293Debug.Assert(null != owningObject, "null owningObject?"); 294Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 312Debug.Assert(null != connectionOptions, "prevent expansion of connectionString"); 315Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?"); 397Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered"); 400Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?"); 401Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?"); 412Debug.Assert(connectionPoolGroup != null, "connectionPoolGroup may not be null."); 495Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered"); 520Debug.Assert(null != pool, "null pool?"); 540Debug.Assert(null != poolGroup, "null poolGroup?");
System\Data\ProviderBase\DbConnectionHelper.cs (11)
128Debug.Assert(null != value, "null poolGroup"); 251Debug.Assert(DbConnectionClosedConnecting.SingletonInstance == _innerConnection, "not connecting"); 261Debug.Assert(null != userConnectionOptions, "null UserConnectionOptions"); 274Debug.Assert(null != _innerConnection, "null InnerConnection"); 275Debug.Assert(null != to, "to null InnerConnection"); 299Debug.Fail("unexpected state switch"); 313Debug.Assert(null != _innerConnection, "null InnerConnection"); 314Debug.Assert(null != from, "from null InnerConnection"); 315Debug.Assert(null != to, "to null InnerConnection"); 326Debug.Assert(null != _innerConnection, "null InnerConnection"); 327Debug.Assert(null != to, "to null InnerConnection");
System\Data\ProviderBase\DbConnectionInternal.cs (3)
20Debug.Assert(1 == activateCount, "activated multiple times?"); 66Debug.Assert(null != owningObject, "null owningObject"); 67Debug.Assert(null != connectionFactory, "null connectionFactory");
System\Data\ProviderBase\DbConnectionInternal.Shared.cs (4)
338Debug.Assert(0 == activateCount, "activated multiple times?"); 424Debug.Assert(outerConnection != null, "outerConnection may not be null."); 427Debug.Assert(metaDataFactory != null, "metaDataFactory may not be null."); 543Debug.Assert(!IsEmancipated, "pooled object not in pool");
System\Data\ProviderBase\DbConnectionPool.cs (38)
67Debug.Assert(null != pool, "null pool?"); 83Debug.Assert(null != transaction, "null transaction?"); 104Debug.Assert(connections != null); 123Debug.Assert(null != transaction, "null transaction?"); 124Debug.Assert(null != transactedObject, "null transactedObject?"); 137Debug.Assert(connections != null); 142Debug.Assert(0 > connections.IndexOf(transactedObject), "adding to pool a second time?"); 172Debug.Assert(connections != null); 177Debug.Assert(0 > connections.IndexOf(transactedObject), "adding to pool a second time?"); 253Debug.Assert(0 == SEMAPHORE_HANDLE, "SEMAPHORE_HANDLE"); 254Debug.Assert(1 == ERROR_HANDLE, "ERROR_HANDLE"); 255Debug.Assert(2 == CREATION_HANDLE, "CREATION_HANDLE"); 376Debug.Assert(ADP.IsWindowsNT, "Attempting to construct a connection pool on Win9x?"); 377Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup"); 540Debug.Assert(obj != null, "null connection is not expected"); 600Debug.Assert(obj != null, "null connection is not expected"); 602Debug.Assert(!obj.IsEmancipated, "pooled object not in pool"); 603Debug.Assert(obj.CanBePooled, "pooled object is not poolable"); 632Debug.Assert(obj != null, "null connection is not expected"); 638Debug.Assert(obj != null, "null connection is not expected"); 687Debug.Assert(oldConnectionPool._state == State.ShuttingDown, "Old connections pool should be shutting down"); 733Debug.Assert(timerIsNotDisposed, "ErrorCallback timer has been disposed"); 765Debug.Assert(_state == State.Running || _state == State.ShuttingDown); 817Debug.Assert(_transactedConnectionPool != null, "Transacted connection pool was not expected to be null."); 859Debug.Assert(!destroyObject); 875Debug.Assert(rootTxn || returnToGeneralPool || destroyObject); 896Debug.Assert(removed, "attempt to DestroyObject not in list"); 929Debug.Assert(!Thread.CurrentThread.IsThreadPoolThread, "This thread may block for a long time. Threadpool threads should not be used."); 1012Debug.Assert(connection != null, "connection should never be null in success case"); 1120Debug.Assert(2 == waitHandleCount || 3 == waitHandleCount, "unexpected waithandle count"); 1193Debug.Assert(2 == CREATION_HANDLE, "creation handle changed value"); 1237Debug.Assert(waitForMultipleObjectsExHR != 0, "WaitForMultipleObjectsEx failed but waitForMultipleObjectsExHR remained 0"); 1341Debug.Assert(obj != null, "null connection is not expected"); 1346Debug.Assert(obj != null, "null connection is not expected"); 1516Debug.Assert(null != obj, "why are we adding a null object to the pool?"); 1532Debug.Assert(null != obj, "null obj?"); 1560Debug.Assert(null != obj, "null pooledObject?"); 1561Debug.Assert(obj.EnlistedTransaction == null, "pooledObject is still enlisted?");
System\Data\ProviderBase\DbConnectionPoolCounters.cs (1)
260Debug.Assert(result.Length == CounterInstanceNameMaxLength,
System\Data\ProviderBase\DbConnectionPoolGroup.cs (6)
47Debug.Assert(null != connectionOptions, "null connection options"); 48Debug.Assert(null == poolGroupOptions || ADP.IsWindowsNT, "should not have pooling options on Win9x"); 177Debug.Assert(ADP.IsWindowsNT, "should not be pooling on Win9x"); 214Debug.Assert(addResult, "No other pool with current identity should exist at this point"); 221Debug.Assert(PoolGroupStateDisabled == _state, "state should be disabled"); 231Debug.Assert(PoolGroupStateActive == _state, "state should be active since a pool exists and lock holds");
System\Data\ProviderBase\DbMetaDataFactory.cs (3)
134Debug.Assert(requestedCollectionRow != null); 338Debug.Assert(dataSourceInfoTable.TableName == DbMetaDataCollectionNames.DataSourceInformation); 409Debug.Assert(_metaDataCollectionsDataSet != null);
System\Data\ProviderBase\DbReferenceCollection.cs (8)
19Debug.Assert(!HasTarget, "Entry already has a valid target"); 20Debug.Assert(tag != 0, "Bad tag"); 21Debug.Assert(target != null, "Invalid target"); 84Debug.Assert(null != value && 0 != tag, "AddItem with null value or 0 tag"); 95Debug.Assert(_items[i].HasTarget, "missing expected target"); 117Debug.Assert(_items[i].HasTarget, "missing expected target"); 201Debug.Assert(!_items[index].HasTarget, "Unexpected target after notifying"); 231Debug.Assert(null != value, "RemoveItem with null");
System.Diagnostics.Debug (1)
System.Diagnostics.Debug.cs (1)
4[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.Diagnostics.DiagnosticSource (91)
src\runtime\src\libraries\Common\src\System\Diagnostics\DiagnosticsHelper.cs (4)
141Debug.Assert(index >= 0); 142Debug.Assert(index < _maxIndex); 152Debug.Assert(index >= 0); 153Debug.Assert(index < _maxIndex);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\Activity.cs (9)
395Debug.Assert(activity != null); 1357Debug.Assert(!string.IsNullOrEmpty(Parent.Id)); 1363Debug.Assert(ParentId.Length != 0); 1452Debug.Assert(_traceId is null); 1474Debug.Assert(!W3CIdFlagsSet); 1746Debug.Assert(_last != null); 1835Debug.Assert(_last != null); 2062Debug.Assert(outBytes.Length == 16 || outBytes.Length == 8); 2079Debug.Assert(outBytes.Length * 2 == charData.Length);
System\Diagnostics\Activity.GenerateRootId.netcoreapp.cs (2)
16Debug.Assert(s_uniqSuffix.Length < 50); // Ensure stackalloc not too large 20Debug.Assert(formatted);
System\Diagnostics\ActivitySource.cs (7)
240Debug.Assert(!ReferenceEquals(listeners, s_disposedListeners)); 520Debug.Assert(activity != null); 526Debug.Assert(!ReferenceEquals(listeners, s_disposedListeners)); 533Debug.Assert(activity != null); 539Debug.Assert(!ReferenceEquals(listeners, s_disposedListeners)); 546Debug.Assert(activity != null); 552Debug.Assert(!ReferenceEquals(listeners, s_disposedListeners));
System\Diagnostics\DiagLinkedList.cs (3)
29Debug.Assert(e is not null); 57Debug.Assert(_first is not null); 58Debug.Assert(_last is not null);
System\Diagnostics\DiagnosticListener.cs (2)
305Debug.Assert(!(cur.Observer == Observer && cur.IsEnabled1Arg == IsEnabled1Arg && cur.IsEnabled3Arg == IsEnabled3Arg), "Did not remove subscription!"); 364Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
417Debug.Assert(str2 != null);
System\Diagnostics\DistributedContextPropagator.cs (1)
76Debug.Assert(s_current is not null);
System\Diagnostics\DsesActivitySourceListener.cs (7)
49Debug.Assert(activitySourceSpecs != null); 55Debug.Assert(currentActivitySourceSpec.SourceName != null); 56Debug.Assert(currentActivitySourceSpec.SampleFunc != null); 92Debug.Assert(_wildcardSpec != null || _specsBySourceNameAndActivityName != null); 112Debug.Assert(_activityListener == null); 113Debug.Assert(_wildcardSpec != null 213Debug.Assert(activitySourceName != null);
System\Diagnostics\DsesFilterAndTransform.cs (12)
112Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length); 207Debug.Assert(endIdx - startIdx >= 4); 208Debug.Assert(IsActivitySourceEntry(filterAndPayloadSpec, startIdx, endIdx)); 603Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length); 696Debug.Assert(obj != null || IsStatic); 740Debug.Assert(type != null, "Type should only be null for the well-known static fetchers already checked"); 836Debug.Assert(typeof(TObject).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())); 841Debug.Assert(obj is TObject); 855Debug.Assert(typeof(TStruct) == type); 860Debug.Assert(obj is TStruct); 894Debug.Assert(enumerable is not null); 957Debug.Assert(obj is IEnumerable<ElementType>);
System\Diagnostics\DsesSamplerBuilder.cs (1)
72Debug.Assert(maximumRatePerSecond > 0, "maximumRatePerSecond must be greater than 0");
System\Diagnostics\Metrics\AggregationManager.cs (5)
137Debug.Assert(collectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 148Debug.Assert(cookie is not null); 176Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested); 177Debug.Assert(CollectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 259Debug.Assert(collectionIntervalSecs >= MinCollectionTimeSecs);
System\Diagnostics\Metrics\AggregatorStore.cs (2)
88Debug.Assert(match); 293Debug.Fail("Unexpected sequence type");
System\Diagnostics\Metrics\Base2ExponentialHistogramAggregator.cs (4)
219Debug.Assert(n == 0, "Increment should always succeed after scale down."); 232Debug.Assert(double.IsFinite(value), "IEEE-754 +Inf, -Inf and NaN should be filtered out before calling this method."); 233Debug.Assert(value != 0, "IEEE-754 zero values should be handled by ZeroCount."); 234Debug.Assert(value > 0, "IEEE-754 negative values should be normalized before calling this method.");
System\Diagnostics\Metrics\CircularBufferBuckets.cs (4)
55Debug.Assert(_trait is not null, "trait was null"); 124Debug.Assert(capacity >= 2, "The capacity must be at least 2."); 143Debug.Assert(level > 0, "The scale down level must be a positive integer."); 299Debug.Assert(divisor > 0, $"{nameof(divisor)} must be a positive integer.");
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (1)
126Debug.Assert(count == 0);
System\Diagnostics\Metrics\Instrument.cs (1)
191Debug.Assert(false);
System\Diagnostics\Metrics\Meter.cs (5)
34Debug.Assert(options.Name is not null); 38Debug.Assert(Name is not null); 69Debug.Assert(Name is not null); 527Debug.Assert(instrumentList is not null); 554Debug.Assert(instrumentList is not null);
System\Diagnostics\Metrics\MeterOptions.cs (1)
53Debug.Assert(_name is not null);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
476Debug.Assert(AggregationManager.MinCollectionTimeSecs <= defaultIntervalSecs);
System\Diagnostics\Metrics\RuntimeMetrics.cs (1)
177Debug.Assert(!OperatingSystem.IsBrowser() && !OperatingSystem.IsWasi() &&!OperatingSystem.IsTvOS() && !(OperatingSystem.IsIOS() && !OperatingSystem.IsMacCatalyst()));
System\Diagnostics\Metrics\TagList.netcore.cs (1)
119Debug.Assert(_overflowTags is not null || _tagsCount == InlineTags.Length);
System\Diagnostics\RateLimiter.cs (1)
26Debug.Assert(maxOperationsPerSecond > 0, "maxOperationsPerSecond must be greater than 0");
System\Diagnostics\W3CPropagator.cs (3)
227Debug.Assert(traceState != null, "traceState cannot be null"); 228Debug.Assert(setter != null, "setter cannot be null"); 414Debug.Assert(span.Length > 0 && span[0] == Percent);
System.Diagnostics.EventLog (17)
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
52Debug.Assert(mutexOut == null, "You must pass in a null ref Mutex");
System\Diagnostics\EventLogInternal.cs (7)
878Debug.Assert(readHandle != null); 883Debug.Assert(cache != null, "Cannot get a non-negative position out of GetCachedEntryPos unless we have a cache"); 1014Debug.Assert(cache != null); 1020Debug.Assert(cache != null); 1150Debug.Assert(info != null); 1168Debug.Assert(!boolFlags[Flag_registeredAsListener], "StartListening called with boolFlags[Flag_registeredAsListener] true."); 1212Debug.Assert(boolFlags[Flag_registeredAsListener], "StopListening called without StartListening.");
System\Diagnostics\Reader\EventLogConfiguration.cs (4)
105Debug.Assert(descriptor is not null, "EvtChannelConfigAccess can only return EvtVarTypeString"); 119Debug.Assert(logFilePath is not null, "EvtChannelLoggingConfigLogFilePath can only return EvtVarTypeString"); 183Debug.Assert(owningProviderName is not null, "EvtChannelConfigOwningPublisher can only return EvtVarTypeString"); 193Debug.Assert(providerNames is not null, "EvtChannelPublisherList can only return EvtVarTypeString or EVT_VARIANT_TYPE_ARRAY");
System\Diagnostics\Reader\EventLogSession.cs (2)
176Debug.Assert(s != null, "value should only be null when there are no more items"); 199Debug.Assert(s != null, "value should only be null when there are no more items");
System\Diagnostics\Reader\EventLogWatcher.cs (1)
227Debug.Assert(_numEventsInBuffer == 0);
System\Diagnostics\Reader\NativeWrapper.cs (1)
875Debug.Fail($"Do not understand EVT_SYSTEM_PROPERTY_ID {i}. A new case is needed.");
System\Diagnostics\Reader\ProviderMetadataCachedInformation.cs (1)
66Debug.Assert(session != null);
System.Diagnostics.PerformanceCounter (21)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafePerfProviderHandle.cs (1)
17Debug.Assert(Status == (uint)Interop.Errors.ERROR_SUCCESS, "PerfStopProvider() fails");
src\runtime\src\libraries\Common\src\System\Diagnostics\NetFrameworkUtils.cs (1)
52Debug.Assert(mutexOut == null, "You must pass in a null ref Mutex");
System\Diagnostics\PerformanceCounterLib.cs (2)
495Debug.Assert(!string.IsNullOrEmpty(counterData.CounterHelp), "CounterHelp should have been fixed up by the caller"); 1468Debug.Assert(index > 0, "Index > 0 because base counters should never be at index 0");
System\Diagnostics\PerformanceData\CounterSet.cs (2)
214Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterSetInfoStruct) == 40); 215Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterInfoStruct) == 32);
System\Diagnostics\PerformanceData\CounterSetInstance.cs (1)
33Debug.Assert(sizeof(Interop.PerfCounter.PerfCounterSetInstanceStruct) == 32);
System\Diagnostics\SharedPerformanceCounter.cs (14)
110Debug.Fail("Counter " + counterName + " does not exist in category " + catName); 149Debug.Assert(!_categoryData.UseUniqueSharedMemory, "We should never be calling CalculateAndAllocateMemory in the unique shared memory"); 318Debug.Assert(nextPtr - _baseAddress == freeMemoryOffset + totalSize + alignmentAdjustment, "We should have used all of the space we requested at this point"); 419Debug.Assert(firstCounterInCategoryPointer->NextCounterOffset != 0, "The unique shared memory should have all of its counters created by the time we hit CreateInstance"); 450Debug.Assert(nextPtr - _baseAddress == freeMemoryOffset + totalSize, "We should have used all of the space we requested at this point"); 476Debug.Assert(!_categoryData.UseUniqueSharedMemory, "We should never be calling CreateCounter in the unique shared memory"); 491Debug.Assert(nextPtr + counterNameLength - _baseAddress == freeMemoryOffset + totalSize, "We should have used all of the space we requested at this point"); 696Debug.Assert(counterNamesObject is string[], $"Expected string[], got '{counterNamesObject}' of type '{counterNamesObject?.GetType()}' with kind '{categoryKey.GetValueKind("Counter Names")}' for category '{_categoryName}'"); 783Debug.Assert(counterFound, "All counters should be created, so we should always find the counter"); 819Debug.Assert(counterFound, "All counters should be created, so we should always find the counter"); 834Debug.Assert(counterFound, "All counters should be created, so we should always find the counter"); 1127Debug.Assert(((instanceName.Length + 1) * 2) <= InstanceNameSlotSize, "The instance name length should always fit in our slot size"); 1255Debug.Assert(currentCategoryPointer->FirstInstanceOffset <= freeOffset, "The head of the list is inconsistent - possible mismatch of V2 & V3 instances?"); 1276Debug.Assert(currentInstancePointer->RefCount != 0, "RefCount must be 1 for instances passed to VerifyLifetime");
System.Diagnostics.Process (70)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (3)
69Debug.Assert(_handle != null); 197Debug.Assert(exited); 198Debug.Assert(exitStatus is not null);
src\runtime\src\libraries\Common\src\Interop\Linux\cgroups\Interop.cgroups.cs (6)
83Debug.Fail($"Failed to read \"{path}/memory.stat\": {e}"); 197Debug.Fail($"Failed to read \"{path}\": {e}"); 344Debug.Fail($"Unexpected cgroup version \"{cgroupVersion}\""); 357Debug.Fail($"Failed to read or parse \"{mountInfoFilePath}\": {e}"); 429Debug.Fail($"Unexpected cgroup version: \"{cgroupVersion}\""); 436Debug.Fail($"Failed to read or parse \"{procCGroupFilePath}\": {e}");
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.cs (2)
102Debug.Assert(!b || pid == ProcPid.Self|| (ProcPid)result.pid == pid, "Expected process ID from stat file to match supplied pid"); 109Debug.Assert(!b || result.pid == tid, "Expected thread ID from stat file to match supplied tid");
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
36Debug.Assert(lines != null);
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid"); 126Debug.Assert(valueParsed); 141Debug.Assert(!string.IsNullOrEmpty(path));
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.cs (1)
67Debug.Fail($"Failed to read \"{ProcMountInfoFilePath}\": {e}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (3)
148Debug.Assert(dataOffset == dataByteLength); 200Debug.Assert(entryIndex == count); 201Debug.Assert(dataOffset == dataByteLength);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
70Debug.Assert(passwd.Name != null);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSetPriority.cs (1)
40Debug.Assert((nice >= -20) && (nice <= 20));
src\runtime\src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (1)
226Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Diagnostics\AsyncStreamReader.cs (2)
50Debug.Assert(stream != null && encoding != null && callback != null, "Invalid arguments!"); 51Debug.Assert(stream.CanRead, "Stream must be readable!");
System\Diagnostics\Process.cs (1)
732Debug.Assert(waitHandleContext != null, "Process.CompletionCallback called with no waitHandleContext");
System\Diagnostics\Process.Linux.cs (1)
244Debug.Assert(bytesRead < buffer.Length);
System\Diagnostics\Process.Unix.cs (8)
213Debug.Assert(_haveProcessId, $"{nameof(ConfigureAfterProcessIdSet)} should only be called once a process ID is set"); 230Debug.Assert(_waitHandle == null); 231Debug.Assert(_registeredWaitHandle == null); 232Debug.Assert(Associated, "Process.EnsureWatchingForExit called with no associated process"); 258Debug.Assert(exited || milliseconds != Timeout.Infinite); 335Debug.Assert(pri >= -20 && pri <= 20); 357Debug.Assert(value == ProcessPriorityClass.Normal, "Input should have been validated by caller"); 442Debug.Assert(!startedProcess.IsInvalid);
System\Diagnostics\ProcessManager.Linux.cs (3)
183Debug.Assert(pid >= 0); 227Debug.Fail($"Unexpected status character: {c}"); 296Debug.Assert(procSelfPid.HasValue);
System\Diagnostics\ProcessStartInfo.cs (2)
108Debug.Assert(!(e is IDisposable), "Environment.GetEnvironmentVariables should not be IDisposable."); 591Debug.Assert(stdinHandle is not null && stdoutHandle is not null && stderrHandle is not null);
System\Diagnostics\ProcessUtils.ConfigureTerminalForChildProcesses.Unix.cs (4)
16Debug.Assert(increment != 0); 21Debug.Assert(s_processStartLock.IsReadLockHeld); 22Debug.Assert(configureConsole); 29Debug.Assert(s_processStartLock.IsWriteLockHeld);
System\Diagnostics\ProcessUtils.Unix.cs (2)
54Debug.Assert(!string.IsNullOrEmpty(startInfo.UserName)); 58Debug.Assert(userId.HasValue == groupId.HasValue, "userId and groupId both need to have values, or both need to be null.");
System\Diagnostics\ProcessWaitState.Unix.cs (11)
243Debug.Assert(processId >= 0); 253Debug.Assert(!Monitor.IsEntered(_gate)); 268Debug.Assert(Monitor.IsEntered(_gate)); 281Debug.Assert(!Monitor.IsEntered(_gate)); 314Debug.Assert(_exited); 363Debug.Assert(Monitor.IsEntered(_gate)); 392Debug.Fail("Unexpected errno value from kill"); 412Debug.Assert(!Monitor.IsEntered(_gate)); 521Debug.Assert(Monitor.IsEntered(_gate)); 522Debug.Assert(!_isChild); 561Debug.Assert(!_exited);
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
145Debug.Assert(inMemoryPdbAddress != IntPtr.Zero);
System.Diagnostics.TextWriterTraceListener (4)
System\Diagnostics\XmlWriterTraceListener.cs (4)
392Debug.Assert(typeof(T) == typeof(int) || typeof(T) == typeof(uint) || typeof(T) == typeof(long), "We only currently stackalloc enough space for these types."); 399Debug.Assert(charsWritten > 0); 411Debug.Assert(charsWritten == span.Length); 423Debug.Assert(charsWritten > 0);
System.Diagnostics.TraceSource (15)
System\Diagnostics\CorrelationManager.cs (1)
57Debug.Assert(stack != null);
System\Diagnostics\DefaultTraceListener.cs (2)
116/// Writes the output using <see cref="System.Diagnostics.Debug.Write(string)"/>. 126/// Writes the output followed by a line terminator using <see cref="System.Diagnostics.Debug.Write(string)"/>.
System\Diagnostics\Switch.cs (1)
161Debug.Assert(switchValueString is not null, "Unexpected 'switchValueString' null value");
System\Diagnostics\TraceInternal.cs (10)
68Debug.SetProvider(new TraceProvider()); 73defaultListener.IndentLevel = Debug.IndentLevel; 74defaultListener.IndentSize = Debug.IndentSize; 117get { return Debug.IndentLevel; } 121Debug.IndentLevel = value; 129return Debug.IndentSize; 134Debug.IndentSize = value; 140Debug.IndentLevel++; 145Debug.IndentLevel--; 324Debug.IndentSize = DiagnosticsConfiguration.IndentSize;
System\Diagnostics\TraceSource.cs (1)
105Debug.Assert(_listeners != null);
System.DirectoryServices (113)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaClass.cs (7)
139Debug.Assert(_propertyValuesFromServer != null); 431Debug.Assert(_classEntry != null); 1059Debug.Assert(_propertyValuesFromServer != null); 1062Debug.Assert(values != null); 1084Debug.Assert(_propertyValuesFromServer != null); 1087Debug.Assert(values != null); 1239Debug.Assert(_classEntry != null);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySchemaProperty.cs (12)
192Debug.Assert(_propertyValuesFromServer != null); 468Debug.Assert(_propertyEntry != null); 673Debug.Assert(_propertyEntry != null); 823Debug.Assert(_propertyEntry != null); 866Debug.Assert(_propertyEntry != null); 919Debug.Assert(_propertyEntry != null); 1035Debug.Assert(_propertyEntry != null); 1107Debug.Assert(_propertyValuesFromServer != null); 1331Debug.Assert(_propertyEntry != null); 1347Debug.Assert(_propertyEntry != null); 1358Debug.Assert(_propertyEntry != null); 1394Debug.Assert(_propertyEntry != null);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (7)
172Debug.Assert(existing); 211Debug.Assert(siteName != null); 600Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188); 944Debug.Assert(fromSite != null && Utils.Compare(fromSite, 0, 3, "CN=", 0, 3) == 0); 1023Debug.Assert(otherSite != null && Utils.Compare(otherSite, 0, 3, "CN=", 0, 3) == 0); 1305Debug.Assert(handle != 0); 1330Debug.Assert(val != 0);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLink.cs (2)
541Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188); 718Debug.Assert(rdn != null && Utils.Compare(rdn, 0, 3, "CN=", 0, 3) == 0);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySiteLinkBridge.cs (1)
374Debug.Assert(rdn != null && Utils.Compare(rdn, 0, 3, "CN=", 0, 3) == 0);
System\DirectoryServices\ActiveDirectory\ActiveDirectorySubnet.cs (2)
76Debug.Assert(rdn != null && Utils.Compare(rdn, 0, 3, "CN=", 0, 3) == 0); 170Debug.Assert(existing);
System\DirectoryServices\ActiveDirectory\ApplicationPartition.cs (3)
331Debug.Assert(domainControllerInfo.DomainControllerName.Length > 2, "ApplicationPartition:FindByName - domainControllerInfo.DomainControllerName.Length <= 2"); 714Debug.Assert(_crossRefEntry != null, "ApplicationPartition::Save - crossRefEntry on already committed partition which is being modified is null."); 1176Debug.Assert(domainControllerInfo.DomainControllerName.Length > 2, "ApplicationPartition:FindDirectoryServerInternal - domainControllerInfo.DomainControllerName.Length <= 2");
System\DirectoryServices\ActiveDirectory\AttributeMetaData.cs (2)
25Debug.Assert(attrMetaData != null); 40Debug.Assert(attrMetaData != null);
System\DirectoryServices\ActiveDirectory\ConfigSet.cs (1)
600Debug.Fail("ConfigurationSet.GetRoleOwner: Invalid role type.");
System\DirectoryServices\ActiveDirectory\DirectoryContext.cs (21)
222Debug.Assert(domainControllerInfo != null); 223Debug.Assert(domainControllerInfo.DomainName != null); 239Debug.Assert(domainControllerInfo != null); 240Debug.Assert(domainControllerInfo.DomainName != null); 248Debug.Assert(context.Name != null); 271Debug.Assert(domainControllerInfo != null); 272Debug.Assert(domainControllerInfo.DnsForestName != null); 288Debug.Assert(domainControllerInfo != null); 289Debug.Assert(domainControllerInfo.DnsForestName != null); 296Debug.Assert(context.Name != null); 453Debug.Assert(_name != null); 463Debug.Assert(domainControllerInfo.DnsForestName != null); 464Debug.Assert(currentDomainControllerInfo.DnsForestName != null); 524Debug.Assert(_name != null); 532Debug.Assert(_name != null); 538Debug.Fail("DirectoryContext::GetServerName - Unknown contextType"); 585Debug.Assert((responseBuffer.callerName != null), "NativeMethods.LsaCallAuthenticationPackage returned null callerName."); 587Debug.Assert((index != -1), "NativeMethods.LsaCallAuthenticationPackage returned callerName not in domain\\username format."); 604Debug.Assert(index != -1); 674Debug.Assert(domainControllerInfo != null); 675Debug.Assert(domainControllerInfo.DomainName != null);
System\DirectoryServices\ActiveDirectory\DirectoryServer.cs (3)
250Debug.Assert(readOnlyPartitions != null); 489Debug.Assert(neighbors != null); 584Debug.Assert(update != (IntPtr)0);
System\DirectoryServices\ActiveDirectory\DirectoryServerCollection.cs (2)
96Debug.Assert(siteName != null); 198Debug.Assert(siteName != null);
System\DirectoryServices\ActiveDirectory\Domain.cs (2)
516Debug.Assert(collection.Count == 1); 1057Debug.Fail("Domain.GetRoleOwner: Invalid role type.");
System\DirectoryServices\ActiveDirectory\DomainController.cs (2)
994Debug.Assert(domainControllerInfo.DomainControllerName.Length > 2); 1028Debug.Assert(domainControllerInfo.DomainName != null);
System\DirectoryServices\ActiveDirectory\Forest.cs (2)
323Debug.Assert(collection.Count == 1); 812Debug.Fail("Forest.GetRoleOwner: Invalid role type.");
System\DirectoryServices\ActiveDirectory\GlobalCatalog.cs (2)
374Debug.Assert(tempDomainControllerInfo.DnsForestName != null); 397Debug.Assert(domainControllerInfo.DomainControllerName.Length > 2);
System\DirectoryServices\ActiveDirectory\PropertyManager.cs (4)
116Debug.Assert(directoryEntry != null, "PropertyManager::GetPropertyValue - directoryEntry is null"); 118Debug.Assert(propertyName != null, "PropertyManager::GetPropertyValue - propertyName is null"); 144Debug.Assert(res != null, "PropertyManager::GetSearchResultPropertyValue - res is null"); 146Debug.Assert(propertyName != null, "PropertyManager::GetSearchResultPropertyValue - propertyName is null");
System\DirectoryServices\ActiveDirectory\ReplicationConnection.cs (1)
790Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188);
System\DirectoryServices\ActiveDirectory\TrustHelper.cs (4)
69Debug.Assert(buffer != (IntPtr)0); 163Debug.Assert(buffer != (IntPtr)0); 290Debug.Assert(buffer != (IntPtr)0); 848Debug.Assert(buffer != (IntPtr)0);
System\DirectoryServices\ActiveDirectory\Utils.cs (28)
104Debug.Assert(distinguishedName != null); 199Debug.Assert(dnsName != null); 461Debug.Assert(distinguishedName != null, "Utils.GetDNComponents: distinguishedName is null"); 497Debug.Assert(distinguishedName != null, "Utils.GetDNComponents: distinguishedName is null"); 690Debug.Assert((domainControllerName != null && domainName == null) || (domainName != null && domainControllerName == null)); 822Debug.Assert(DN != null); 827Debug.Assert(component.Length == 1); 1311Debug.Assert(replicaLocations != null); 1385Debug.Assert(partitionName != null); 1386Debug.Assert(!isGC); 1413Debug.Assert(partitionName != null); 1537Debug.Assert(dnString.Length > 10, "ConfigurationSet::GetReplicaList - dnWithBinary is not in the expected format."); 1603Debug.Assert(ntdsaNamesForRangeRetrieval.Count > 0); 1674Debug.Assert(dnString.Length > 10, "ConfigurationSet::GetReplicaList - dnWithBinary is not in the expected format."); 1734Debug.Fail($"ConfigurationSet::GetReplicaList - no dnsHostName information for replica {ntdsaName}"); 1749Debug.Fail($"ConfigurationSet::GetReplicaList - no port number information for replica {ntdsaName}"); 1959Debug.Assert(index != -1); 2007Debug.Assert(success); 2051Debug.Assert(tokenHandle.IsInvalid); 2071Debug.Assert(!tokenHandle.IsInvalid); 2092Debug.Assert(neededBufferSize > 0); 2114Debug.Assert(global::Interop.Advapi32.IsValidSid(pUserSid)); 2157Debug.Assert(!policyHandle.IsInvalid); 2168Debug.Assert(pBuffer != IntPtr.Zero); 2171Debug.Assert(global::Interop.Advapi32.IsValidSid(info.DomainSid)); 2230Debug.Assert(global::Interop.Advapi32.IsValidSid(pSid)); 2318Debug.Assert(pBytes != IntPtr.Zero); 2330Debug.Assert(global::Interop.Advapi32.IsValidSid(pSid));
System\DirectoryServices\ActiveDirectorySecurity.cs (2)
414Debug.Fail("Invalid PropertyAccess value"); 510Debug.Fail("Invalid PropagationFlags value");
System\DirectoryServices\DirectoryEntry.cs (3)
496Debug.Assert(_adsObject != null); 747Debug.Assert(_adsObject != null); 1101Debug.Fail("ntSecurityDescriptor property exists in cache but has no values.");
System.DirectoryServices.AccountManagement (498)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
48System.Diagnostics.Debug.Assert(bufferSize > 0);
System\DirectoryServices\AccountManagement\AccountInfo.cs (5)
247Debug.Assert(_owningPrincipal.Context != null); 264Debug.Assert(_owningPrincipal.Context != null); 357Debug.Fail($"AccountInfo.LoadValueIntoProperty: fell off end looking for {propertyName}"); 405Debug.Fail($"AccountInfo.GetChangeStatusForProperty: fell off end looking for {propertyName}"); 442Debug.Fail($"AccountInfo.GetValueForProperty: fell off end looking for {propertyName}");
System\DirectoryServices\AccountManagement\AD\ADAMStoreCtx.cs (16)
64Debug.Assert(!ap.fakePrincipal); 71Debug.Assert(de.Properties["msDS-UserAccountDisabled"].Count == 1); 98Debug.Assert(this.ctxBase != null); 164Debug.Assert(!p.unpersisted); 165Debug.Assert(p is UserPrincipal); 167Debug.Assert(p.UnderlyingObject != null); 213Debug.Assert(!p.fakePrincipal); 215Debug.Assert(p != null); 216Debug.Assert(newPassword != null); // but it could be an empty string 219Debug.Assert(de != null); 234Debug.Assert(!p.fakePrincipal); 237Debug.Assert(!p.unpersisted); 239Debug.Assert(p != null); 240Debug.Assert(newPassword != null); // but it could be an empty string 241Debug.Assert(oldPassword != null); // but it could be an empty string 244Debug.Assert(de != null);
System\DirectoryServices\AccountManagement\AD\ADDNConstraintLinkedAttrSet.cs (4)
49Debug.Assert(constraintData != null); 66Debug.Assert(constraintData != null); 122Debug.Fail("ADStoreCtx.ADDNConstraintLinkedAttrSet: Invalid constraint data. Expected: object of type ResultValidator"); 127Debug.Fail("ADStoreCtx.ADDNConstraintLinkedAttrSet: fell off end looking for " + _constraint.ToString());
System\DirectoryServices\AccountManagement\AD\ADDNLinkedAttrSet.cs (15)
148Debug.Assert(_currentForeignPrincipal != null); 212Debug.Assert(_primaryGroupDN != null); 238Debug.Assert(_memberSearchersQueue != null); 250Debug.Assert(_memberSearchResults != null); 810Debug.Assert(_recursive); 820Debug.Assert(foreignGroup.Context.QueryCtx is ADStoreCtx); 821Debug.Assert(foreignGroup.UnderlyingObject is DirectoryEntry); 822Debug.Assert(((DirectoryEntry)foreignGroup.UnderlyingObject).Path.StartsWith("LDAP:", StringComparison.Ordinal)); 840Debug.Assert(_recursive); 850Debug.Assert(foreignGroup.Context.QueryCtx is ADStoreCtx); 851Debug.Assert(foreignGroup.UnderlyingObject is DirectoryEntry); 852Debug.Assert(((DirectoryEntry)foreignGroup.UnderlyingObject).Path.StartsWith("LDAP:", StringComparison.Ordinal)); 887Debug.Assert(_queryMembersResults != null); 897Debug.Assert(this.current != null); 1127Debug.Assert(bookmark is ADDNLinkedAttrSetBookmark);
System\DirectoryServices\AccountManagement\AD\ADEntriesSet.cs (2)
51Debug.Assert(!_endReached && _current != null); 64Debug.Assert(_enumerator != null);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_LoadStore.cs (45)
195Debug.Assert(propertyEntry.propertyName == (string)dictEntry.Key); 235Debug.Assert(storeObject != null); 250Debug.Assert(storeObject is SearchResult); 299Debug.Assert(p != null); 352Debug.Assert(p != null); 353Debug.Assert(p.UnderlyingObject != null); 354Debug.Assert(p.UnderlyingObject is DirectoryEntry); 362Debug.Assert(de != null); 363Debug.Assert(p.GetUnderlyingObjectType() == typeof(DirectoryEntry)); 380Debug.Assert(null != entries); 402Debug.Assert(p != null); 403Debug.Assert(p.UnderlyingObject != null); 404Debug.Assert(p.UnderlyingObject is DirectoryEntry); 407Debug.Assert(de != null); 644Debug.Assert(src != null); 679Debug.Assert(p != null); 844Debug.Assert(properties["objectGuid"].Count == 1); 883Debug.Assert(properties[suggestedAdProperty].Count == 1); 884Debug.Assert(properties[suggestedAdProperty][0] is bool); 892Debug.Assert(string.Equals(suggestedAdProperty, "userWorkstations", StringComparison.OrdinalIgnoreCase)); 901Debug.Assert(values.Count == 1); 902Debug.Assert(values[0] is string); 937Debug.Assert(string.Equals(suggestedAdProperty, "userAccountControl", StringComparison.OrdinalIgnoreCase)); 954Debug.Assert(values[values.Count - 1] is string); 993Debug.Assert(values.Count == 1); 1019Debug.Assert(string.Equals(suggestedAdProperty, "groupType", StringComparison.OrdinalIgnoreCase)); 1025Debug.Assert(values.Count == 1); 1026Debug.Assert(values[0] is int); 1053Debug.Assert((groupTypeCombined & ADGroupScope.Universal) != 0); // ADS_GROUP_TYPE_UNIVERSAL_GROUP 1059Debug.Fail("ADStoreCtx.GroupTypeFromLdapConverter: Fell off end looking for " + propertyName); 1283Debug.Assert(string.Equals(suggestedAdProperty, "userAccountControl", StringComparison.OrdinalIgnoreCase)); 1400Debug.Assert(propertyName == PropertyNames.GroupIsSecurityGroup || propertyName == PropertyNames.GroupGroupScope); 1409Debug.Assert(de.Properties[suggestedAdProperty].Count == 1); 1460Debug.Assert(groupType == GroupScope.Universal); 1467Debug.Fail("ADStoreCtx.GroupTypeToLdapConverter: Fell off end looking for " + propertyName); 1478Debug.Assert(!group.fakePrincipal); 1502Debug.Assert(copyOfDe != null); 1543Debug.Assert(member.Context != null); 1590Debug.Assert(!member.unpersisted); 1591Debug.Assert(member.ContextType == ContextType.Domain || member.ContextType == ContextType.ApplicationDirectory); 1594Debug.Assert(!members.Cleared); 1643Debug.Assert(!p.unpersisted); 1660Debug.Assert(de != null); // since member can't be unpersisted 1681Debug.Assert(propertyName == PropertyNames.PwdInfoCannotChangePassword); 1710Debug.Assert(urnScheme == UrnScheme.SidScheme);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx_Query.cs (23)
206Debug.Fail($"ADStoreCtx.GetObjectClassPortion: fell off end looking for {principalType}"); 235Debug.Assert(sizeLimit >= -1); 242Debug.Assert(src != null); 342Debug.Assert(NonPresentAttrDefaultStateMapping != null); 343Debug.Assert(NonPresentAttrDefaultStateMapping.ContainsKey(suggestedAdProperty)); 568Debug.Assert(string.Equals(suggestedAdProperty, "userAccountControl", StringComparison.OrdinalIgnoreCase)); 634Debug.Fail("ADStoreCtx.UserAccountControlConverter: fell off end looking for " + filter.PropertyName); 650Debug.Assert(string.Equals(suggestedAdProperty, "accountExpires", StringComparison.OrdinalIgnoreCase)); 651Debug.Assert(filter is ExpirationDateFilter); 662Debug.Assert(string.Equals(suggestedAdProperty, "objectGuid", StringComparison.OrdinalIgnoreCase)); 663Debug.Assert(filter is GuidFilter); 684Debug.Assert(filter.Value is QbeMatchType); 693Debug.Assert(filter.Value is QbeMatchType); 697Debug.Assert(qmt.Value is DateTime); 704Debug.Assert(filter.Value is QbeMatchType); 708Debug.Assert(qmt.Value is DateTime); 715Debug.Assert(filter.Value is QbeMatchType); 719Debug.Assert(qmt.Value is DateTime); 720Debug.Assert((suggestedAdProperty == "lastLogon") || (suggestedAdProperty == "lastLogonTimestamp")); 731Debug.Assert(string.Equals(suggestedAdProperty, "groupType", StringComparison.OrdinalIgnoreCase)); 732Debug.Assert(filter is GroupIsSecurityGroupFilter || filter is GroupScopeFilter); 764Debug.Assert(value2 == GroupScope.Universal); 769Debug.Fail("ADStoreCtx.GroupTypeConverter: fell off end looking for " + filter.PropertyName);
System\DirectoryServices\AccountManagement\AD\ADStoreCtx.cs (88)
77Debug.Assert(qbeType != null); 78Debug.Assert(f != null); 81Debug.Assert(mappingTable[qbeType] == null); 125Debug.Assert(propertyName != null); 126Debug.Assert((ldapAttribute != null && fromLdap != null) || (fromLdap == null)); 284Debug.Assert(ctxBase != null); 347Debug.Assert(this.ctxBase != null); 364Debug.Assert(p.unpersisted); 365Debug.Assert(!p.fakePrincipal); 388Debug.Assert(p.Key == null); // since it was previously unpersisted 390Debug.Assert(p.UnderlyingObject != null); // since we just persisted it 391Debug.Assert(p.UnderlyingObject is DirectoryEntry); 466Debug.Assert(p is AuthenticablePrincipal); 480Debug.Assert(p is AuthenticablePrincipal); 488Debug.Assert(ap is AuthenticablePrincipal); 489Debug.Assert(ap.GetUnderlyingObject() is DirectoryEntry); 606Debug.Assert(!ap.fakePrincipal); 614Debug.Assert(de.Properties["userAccountControl"].Count == 1); 663Debug.Assert(!p.fakePrincipal); 664Debug.Assert(!p.unpersisted); 665Debug.Assert(p.UnderlyingObject != null); 666Debug.Assert(p.UnderlyingObject is DirectoryEntry); 696Debug.Assert(!p.fakePrincipal); 699Debug.Assert(!p.unpersisted); 700Debug.Assert(p.UnderlyingObject != null); 702Debug.Assert(p.UnderlyingObject is DirectoryEntry); 715Debug.Assert(p != null); 716Debug.Assert(originalStore != null); 717Debug.Assert(originalStore is ADStoreCtx); 794Debug.Assert(p != null); 795Debug.Assert(!p.fakePrincipal); 796Debug.Assert(p.unpersisted); // should only ever be called for new principals 800Debug.Assert(de != null); 825Debug.Assert(!p.fakePrincipal); 827Debug.Assert(!p.unpersisted); 830Debug.Assert(de != null); 837Debug.Assert(de.Properties["msDS-User-Account-Control-Computed"].Count == 1); 887Debug.Assert(!p.fakePrincipal); 900Debug.Assert(!p.fakePrincipal); 902Debug.Assert(p != null); 903Debug.Assert(newPassword != null); // but it could be an empty string 906Debug.Assert(de != null); 919Debug.Assert(!p.fakePrincipal); 922Debug.Assert(!p.unpersisted); 924Debug.Assert(p != null); 925Debug.Assert(newPassword != null); // but it could be an empty string 926Debug.Assert(oldPassword != null); // but it could be an empty string 935Debug.Assert(de != null); 947Debug.Assert(!p.fakePrincipal); 960Debug.Assert(!p.fakePrincipal); 975Debug.Assert(p != null); 984Debug.Assert(p != null); 1024Debug.Assert(ldapAttributes != null); 1025Debug.Assert(ldapAttributes.Length > 0); 1026Debug.Assert(subtype == typeof(Principal) || subtype.IsSubclassOf(typeof(Principal))); 1105Debug.Fail("ADStoreCtx.FindByDate: fell off end looking for " + matchType.ToString()); 1119Debug.Assert(src != null); 1146Debug.Assert(!p.unpersisted); 1162Debug.Assert(p.UnderlyingObject != null); 1190Debug.Assert(p.ContextType == ContextType.Domain); 1308Debug.Assert(principalDE.Properties["primaryGroupID"].Count == 1); 1309Debug.Assert(principalDE.Properties["objectSid"].Count == 1); 1494Debug.Assert(sr.Properties["primaryGroupID"].Count == 1); 1495Debug.Assert(sr.Properties["objectSid"].Count == 1); 1510Debug.Assert(foreignPrincipal.ContextType != ContextType.ApplicationDirectory); 1580Debug.Assert(!p.unpersisted); 1581Debug.Assert(p is UserPrincipal); 1628Debug.Assert(!g.unpersisted); 1638Debug.Assert(g.UnderlyingObject != null); 1649Debug.Assert(groupDE.Properties["objectSid"].Count == 1); 1701Debug.Assert(groupSid != null); 1727Debug.Assert(!g.unpersisted); 1728Debug.Assert(!p.unpersisted); 1744Debug.Assert(g.UnderlyingObject != null && g.UnderlyingObject is DirectoryEntry); 1751Debug.Assert(p.UnderlyingObject != null && p.UnderlyingObject is DirectoryEntry); 1766Debug.Assert(g.SmallGroupMemberSearchResult != null); 1882Debug.Assert(g.UnderlyingObject != null); 1892Debug.Assert(groupDE.Properties["objectSid"].Count == 1); 1983Debug.Assert(g.UnderlyingObject != null); 1984Debug.Assert(member.UnderlyingObject != null); 1991Debug.Assert(groupDE.Properties["objectSid"].Count == 1); 1992Debug.Assert(memberDE.Properties["primaryGroupID"].Count == 1); 2050Debug.Assert(o is DirectoryEntry); 2051Debug.Assert(ADUtils.IsOfObjectClass((DirectoryEntry)o, "foreignSecurityPrincipal")); 2064Debug.Assert(fpoDE.Properties["objectSid"].Count == 1); 2413Debug.Assert(this.ctxBase != null); 2526Debug.Assert(domainNC.Properties["lockoutDuration"].Count == 1); 2528Debug.Assert(negativeLockoutDuration <= 0);
System\DirectoryServices\AccountManagement\AD\ADStoreKey.cs (3)
22Debug.Assert(guid != Guid.Empty); 36Debug.Assert(!string.IsNullOrEmpty(domainName)); 37Debug.Assert(sid != null && sid.Length != 0);
System\DirectoryServices\AccountManagement\AD\ADUtils.cs (1)
328Debug.Assert(s != null);
System\DirectoryServices\AccountManagement\AD\RangeRetriever.cs (1)
224Debug.Assert(_currentResult != null && !_endReached);
System\DirectoryServices\AccountManagement\AD\SDSCache.cs (2)
104Debug.Assert(credTable != null); 191Debug.Assert(f);
System\DirectoryServices\AccountManagement\AD\SDSUtils.cs (38)
137Debug.Assert(sr.Path.StartsWith("LDAP:", StringComparison.Ordinal) || sr.Path.StartsWith("GC:", StringComparison.Ordinal)); 149Debug.Assert(de.Path.StartsWith("LDAP:", StringComparison.Ordinal)); 207Debug.Assert(storeCtx != null); 208Debug.Assert(storeCtx is ADStoreCtx || storeCtx is SAMStoreCtx); 209Debug.Assert(p != null); 240Debug.Assert(p is AuthenticablePrincipal); 243Debug.Assert(password != null); // if null, PasswordInfo should not have indicated it was changed 251Debug.Assert(p is AuthenticablePrincipal); 274Debug.Assert(storeCtx != null); 275Debug.Assert(storeCtx is ADStoreCtx || storeCtx is SAMStoreCtx || storeCtx is ADAMStoreCtx); 276Debug.Assert(p != null); 277Debug.Assert(updateGroupMembership != null); 282Debug.Assert(de == p.UnderlyingObject); 309Debug.Assert(newPassword != null); // but it could be an empty string 310Debug.Assert(de != null); 341Debug.Assert(newPassword != null); // but it could be an empty string 342Debug.Assert(oldPassword != null); // but it could be an empty string 344Debug.Assert(de != null); 400Debug.Assert(attribute != null && attribute.Length > 0); 413Debug.Assert(copyOfDe != null); 442Debug.Assert(attribute != null && attribute.Length > 0); 455Debug.Assert(copyOfDe != null); 491Debug.Assert(properties[suggestedProperty].Count == 1); 492Debug.Assert(properties[suggestedProperty][0] is T); 506Debug.Assert(value is T); 561Debug.Fail("SDSUtils.AccountControlFromDirectoryEntry: Fell off end looking for " + propertyName); 570Debug.Assert( 575Debug.Assert(!string.Equals(propertyName, PropertyNames.PwdInfoCannotChangePassword, StringComparison.OrdinalIgnoreCase) || testCantChangePassword); 581Debug.Assert(values.Count == 1); 582Debug.Assert(values[0] is int); 622Debug.Assert(changedValue.Left != null); // since it came from the system 648Debug.Assert( 661Debug.Assert(de.Properties[suggestedProperty].Count == 1); 669Debug.Assert(de.Properties["msDS-User-Account-Control-Computed"].Count == 1); 677Debug.Assert(!p.unpersisted); 699Debug.Assert(!isSAM && isUnpersisted); 745Debug.Fail( 753Debug.Fail("SDSUtils.AccountControlToDirectoryEntry: Fell off end looking for " + propertyName);
System\DirectoryServices\AccountManagement\AD\SidList.cs (5)
105Debug.Assert(!policyHandle.IsInvalid); 169Debug.Assert(names.Length == sidCount); 179Debug.Assert(name.Name.Length % 2 == 0); 183Debug.Assert(name.DomainIndex < domains.Length); 187Debug.Assert(domain.Name.Length % 2 == 0);
System\DirectoryServices\AccountManagement\AD\TokenGroupsSet.cs (1)
78Debug.Assert(_principalDN != null);
System\DirectoryServices\AccountManagement\AuthenticablePrincipal.cs (4)
494Debug.Fail("AuthenticablePrincipal.GetValueForProperty(AcctInfo): shouldn't be here"); 505Debug.Fail("AuthenticablePrincipal.GetValueForProperty(PwdInfo): shouldn't be here"); 546Debug.Assert(_certificates.Count == 0); 625Debug.Assert(remainingOriginalThumbprints.Count == 0);
System\DirectoryServices\AccountManagement\AuthZSet.cs (9)
107Debug.Assert(bufferSize > 0); 163Debug.Fail("With a zero-length buffer, this should have never succeeded"); 224Debug.Assert(_currentGroup >= 0 && _currentGroup < _groupSidList.Length); 288Debug.Fail("AuthZSet.CurrentAsPrincipal: hit a user with a non-domain SID"); 309Debug.Assert(sidIssuerName != null); 310Debug.Assert(sidIssuerName.Length > 0); 323Debug.Assert(_userType == ContextType.Domain); 362Debug.Assert((_userType == ContextType.Domain) && 376Debug.Assert(ctx.QueryCtx is ADStoreCtx);
System\DirectoryServices\AccountManagement\Context.cs (13)
304Debug.Assert(_contextType == ContextType.Machine); 497Debug.Assert(_connectedServer != null || !_initialized); 500Debug.Assert(_connectedServer == null || _connectedServer.Length != 0); 589Debug.Fail("PrincipalContext.Initialize: fell off end looking for " + _contextType.ToString()); 602Debug.Assert(_contextType == ContextType.ApplicationDirectory); 620Debug.Assert(_contextType == ContextType.Machine); 621Debug.Assert(_container == null); 670Debug.Assert(_contextType == ContextType.Domain); 852Debug.Assert(adsPathUserGroupOrg == null); 864Debug.Assert(adsPathComputer == null); 1170Debug.Assert(entry != null); 1187Debug.Assert(entry.Path.StartsWith("WinNT:", StringComparison.Ordinal)); 1241Debug.Assert(t == typeof(System.DirectoryServices.AccountManagement.GroupPrincipal) || t.IsSubclassOf(typeof(System.DirectoryServices.AccountManagement.GroupPrincipal)));
System\DirectoryServices\AccountManagement\EmptySet.cs (1)
20Debug.Fail("EmptySet.CurrentAsPrincipal: Shouldn't be here");
System\DirectoryServices\AccountManagement\FindResultEnumerator.cs (1)
43Debug.Assert(typeof(T) == typeof(System.DirectoryServices.AccountManagement.Principal) || typeof(T).IsSubclassOf(typeof(System.DirectoryServices.AccountManagement.Principal)));
System\DirectoryServices\AccountManagement\GlobalDebug.cs (2)
33Debug.WriteLineIf(f, string.Format(CultureInfo.InvariantCulture, message, args), category); 41Debug.WriteLineIf(f, message, category);
System\DirectoryServices\AccountManagement\Group.cs (2)
272Debug.Fail("Group.LoadValueIntoProperty: Trying to load Members, but Members is demand-loaded."); 368Debug.Assert(de != null);
System\DirectoryServices\AccountManagement\PasswordInfo.cs (3)
281Debug.Fail($"PasswordInfo.LoadValueIntoProperty: fell off end looking for {propertyName}"); 316Debug.Fail($"PasswordInfo.GetChangeStatusForProperty: fell off end looking for {propertyName}"); 347Debug.Fail($"PasswordInfo.GetValueForProperty: fell off end looking for {propertyName}");
System\DirectoryServices\AccountManagement\Principal.cs (20)
35Debug.Assert(_ctx != null || this.unpersisted); 50Debug.Assert(_ctx != null || this.unpersisted); 306Debug.Assert(this.unpersisted); 312Debug.Assert(storeCtxToUse != null); // since we know this.ctx isn't null 317Debug.Assert(storeCtxToUse == _ctx.ContextForType(this.GetType())); 324Debug.Assert(storeCtxToUse == _ctx.QueryCtx); 343Debug.Assert(this.unpersisted); 363Debug.Assert(this.unpersisted); 374Debug.Assert(newStoreCtx != null); // since we know this.ctx isn't null 375Debug.Assert(originalStoreCtx != null); // since we know this.ctx isn't null 381Debug.Assert(newStoreCtx == _ctx.ContextForType(this.GetType())); 460Debug.Assert(_ctx != null); 525Debug.Assert(_ctx != null); 641Debug.Assert(this.GetUnderlyingObjectType() == typeof(DirectoryEntry)); 804Debug.Assert(this.unpersisted); 958Debug.Assert(storeCtx != null); 975Debug.Assert(storeCtx != null); 991Debug.Assert(!this.unpersisted); 996Debug.Assert(_ctx != null); 1218Debug.Fail($"Principal.GetValueForProperty: Ran off end of list looking for {propertyName}");
System\DirectoryServices\AccountManagement\PrincipalCollection.cs (5)
329Debug.Assert(storeCtxToUse != null || _owningGroup.unpersisted); 382Debug.Assert(storeCtxToUse != null || _owningGroup.unpersisted); 613Debug.Assert(results != null); 747Debug.Assert(!_removedValuesCompleted.Contains(p)); 755Debug.Assert(!_insertedValuesCompleted.Contains(p));
System\DirectoryServices\AccountManagement\PrincipalCollectionEnumerator.cs (4)
41Debug.Assert(_current != null); 100Debug.Assert(_resultSet != null); 202Debug.Fail($"PrincipalCollectionEnumerator.MoveNext: fell off end of function, mode = {_currentMode}"); 248Debug.Assert(resultSet != null);
System\DirectoryServices\AccountManagement\PrincipalSearcher.cs (4)
61Debug.Assert(value.Context != null); 143Debug.Assert(storeCtx != null); 167Debug.Assert(storeCtx != null); 304Debug.Assert(_qbeFilter.unpersisted);
System\DirectoryServices\AccountManagement\QbeFilterDescription.cs (1)
88Debug.Assert(type != null);
System\DirectoryServices\AccountManagement\SAM\SAMGroupsSet.cs (1)
34Debug.Assert(_current != null);
System\DirectoryServices\AccountManagement\SAM\SAMMembersSet.cs (8)
65Debug.Assert(_foreignResultSet != null); 156Debug.Assert(cElements >= 2); // "WinNT://BUILTIN/foo" == 2 elements 174Debug.Assert(sidType == SidType.RealObject); 322Debug.Assert(_recursive); 338Debug.Assert(_recursive); 364Debug.Assert(_foreignMembers.Count == 0); 387Debug.Assert(sidType != SidType.FakeObject); 518Debug.Assert(bookmark is SAMMembersSetBookmark);
System\DirectoryServices\AccountManagement\SAM\SAMQuerySet.cs (24)
48Debug.Assert(!_endReached && _current != null); 61Debug.Assert(_enumerator != null); 229Debug.Assert(qbeType != null); 230Debug.Assert(winNTPropertyName != null); 231Debug.Assert(f != null); 234Debug.Assert(filterPropertiesTable[qbeType] == null); 359Debug.Assert(valueToMatch.Value is DateTime); 371Debug.Assert(values.Count == 1); 372Debug.Assert(values[0] is int); 513Debug.Assert(winNTPropertyName == "UserFlags"); 561Debug.Fail("SAMQuerySet.UserFlagsMatcher: fell off end looking for " + filter.PropertyName); 621Debug.Assert(filter is ExpirationDateFilter); 622Debug.Assert(winNTPropertyName == "AccountExpirationDate"); 649Debug.Assert(winNTPropertyName == "groupType"); 650Debug.Assert(filter is GroupScopeFilter); 710Debug.Fail("FindByDateMatcher.Matches: Fell off end looking for propertyToMatch=" + _propertyToMatch.ToString()); 723Debug.Assert(values.Count == 1); 739Debug.Assert(values.Count == 1); 754Debug.Assert(values.Count == 1); 755Debug.Assert(values[0] is int); 774Debug.Assert(nullableStoreValue.HasValue); 798Debug.Fail("FindByDateMatcher.TestForMatch: Fell off end looking for matchType=" + _matchType.ToString()); 810Debug.Assert(memberSidToMatch != null); 811Debug.Assert(memberSidToMatch.Length != 0);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_LoadStore.cs (35)
96Debug.Assert(principalType == typeof(ComputerPrincipal)); 118Debug.Assert(propertyEntry.propertyName == (string)dictEntry.Key); 140Debug.Assert(p is AuthenticablePrincipal); 143Debug.Assert(password != null); // if null, PasswordInfo should not have indicated it was changed 199Debug.Assert(discriminant == null); 201Debug.Assert(storeObject != null); 202Debug.Assert(storeObject is DirectoryEntry); 210Debug.Assert(p != null); 215Debug.Assert((de.Properties["objectSid"] != null) && (de.Properties["objectSid"].Count == 1)); 225Debug.Assert(p != null); 226Debug.Assert(p.UnderlyingObject != null); 227Debug.Assert(p.UnderlyingObject is DirectoryEntry); 244Debug.Assert(principalType == typeof(ComputerPrincipal)); 276Debug.Assert(p != null); 277Debug.Assert(p.UnderlyingObject != null); 278Debug.Assert(p.UnderlyingObject is DirectoryEntry); 281Debug.Assert(de != null); 302Debug.Assert(principalType == typeof(ComputerPrincipal)); 612Debug.Assert(principalType == typeof(Principal)); 629Debug.Assert(p != null); 791Debug.Assert(de.Properties["Name"].Count == 1); 831Debug.Assert(propertyName == PropertyNames.GroupGroupScope); 837Debug.Assert(((int)values[0]) == 4); 862Debug.Assert(values.Count == 1); 863Debug.Assert(values[0] is int); 879Debug.Assert(values.Count == 1); 891Debug.Assert(string.Equals(suggestedWinNTProperty, "UserFlags", StringComparison.OrdinalIgnoreCase)); 928Debug.Assert(propertyName == PropertyNames.AcctInfoPermittedLogonTimes); 968Debug.Assert(propertyName == PropertyNames.GroupGroupScope); 1001Debug.Assert(string.Equals(suggestedWinNTProperty, "UserFlags", StringComparison.OrdinalIgnoreCase)); 1008Debug.Assert(!group.fakePrincipal); 1083Debug.Assert(member.Context != null); 1115Debug.Assert(!member.unpersisted); 1118Debug.Assert(!members.Cleared); 1149Debug.Assert(!p.unpersisted);
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx_Query.cs (5)
28Debug.Fail("SAMStoreCtx: SearcherNativeType: There is no native searcher type."); 46Debug.Assert(ps.UnderlyingSearcher == null); 76Debug.Assert(sizeLimit >= -1); 88Debug.Assert(entries != null); 139Debug.Fail($"SAMStoreCtx.GetSchemaFilter: fell off end looking for {principalType}");
System\DirectoryServices\AccountManagement\SAM\SAMStoreCtx.cs (73)
61Debug.Assert(propertyName != null); 62Debug.Assert((winNTAttribute != null && fromWinNT != null) || (fromWinNT == null)); 63Debug.Assert(principalType == typeof(Principal) || principalType.IsSubclassOf(typeof(Principal))); 100Debug.Assert(principalType == typeof(Principal)); 160Debug.Assert(ctxBase != null); 163Debug.Assert(SAMUtils.IsOfObjectClass(ctxBase, "Computer")); 204Debug.Assert(_ctxBase != null); 220Debug.Assert(p.unpersisted); 221Debug.Assert(!p.fakePrincipal); 239Debug.Assert(p.Key == null); // since it was previously unpersisted 241Debug.Assert(p.UnderlyingObject != null); // since we just persisted it 242Debug.Assert(p.UnderlyingObject is DirectoryEntry); 246Debug.Assert((de.Properties["objectSid"] != null) && (de.Properties["objectSid"].Count == 1)); 269Debug.Assert(!p.fakePrincipal); 270Debug.Assert(!p.unpersisted); 271Debug.Assert(p.UnderlyingObject != null); 272Debug.Assert(p.UnderlyingObject is DirectoryEntry); 297Debug.Assert(!p.fakePrincipal); 300Debug.Assert(!p.unpersisted); 301Debug.Assert(p.UnderlyingObject != null); 303Debug.Assert(p.UnderlyingObject is DirectoryEntry); 327Debug.Assert(values.Count == 1); 328Debug.Assert(values[0] is int); 333Debug.Fail("SAMStoreCtx.AccessCheck: user entry has an empty UserFlags value"); 341Debug.Fail("SAMStoreCtx.AccessCheck: Fell off end looking for " + targetPermission.ToString()); 368Debug.Assert(p != null); 369Debug.Assert(!p.fakePrincipal); 370Debug.Assert(p.unpersisted); // should only ever be called for new principals 374Debug.Assert(de != null); 385Debug.Assert(!p.fakePrincipal); 387Debug.Assert(!p.unpersisted); 390Debug.Assert(de != null); 411Debug.Assert(!p.fakePrincipal); 413Debug.Assert(!p.unpersisted); 423Debug.Assert(de != null); 434Debug.Assert(copyOfDe != null); 453Debug.Assert(!p.fakePrincipal); 455Debug.Assert(p is UserPrincipal || p is ComputerPrincipal); 458Debug.Assert(!p.unpersisted); 467Debug.Assert(p != null); 468Debug.Assert(newPassword != null); // but it could be an empty string 471Debug.Assert(de != null); 478Debug.Assert(!p.fakePrincipal); 480Debug.Assert(p is UserPrincipal || p is ComputerPrincipal); 483Debug.Assert(!p.unpersisted); 492Debug.Assert(p != null); 493Debug.Assert(newPassword != null); // but it could be an empty string 494Debug.Assert(oldPassword != null); // but it could be an empty string 497Debug.Assert(de != null); 504Debug.Assert(!p.fakePrincipal); 518Debug.Assert(!p.fakePrincipal); 532Debug.Assert(p is UserPrincipal || p is ComputerPrincipal); 534Debug.Assert(p != null); 590Debug.Assert(entries != null); 611Debug.Assert(!p.unpersisted); 624Debug.Assert(p.UnderlyingObject != null); 645Debug.Assert(entries != null); 715Debug.Assert(!p.unpersisted); 716Debug.Assert(p is UserPrincipal); 750Debug.Assert(!g.unpersisted); 760Debug.Assert(g.UnderlyingObject != null); 775Debug.Fail("SAMStoreCtx.IsMemberOfInStore: Shouldn't be here."); 811Debug.Assert(o is DirectoryEntry); 822Debug.Assert(foreignDE.Properties["objectSid"].Count == 1); 952Debug.Assert(_isLSAM.HasValue); 970Debug.Assert(_machineUserSuppliedName != null); 988Debug.Assert(_machineFlatName != null); 1003Debug.Assert(_ctxBase != null); 1004Debug.Assert(SAMUtils.IsOfObjectClass(_ctxBase, "Computer")); 1017Debug.Assert(versionMajor > 0); 1018Debug.Assert(versionMinor >= 0); 1035Debug.Assert(_ctxBase.Properties["Name"].Count == 1); 1087Debug.Fail("Property not found");
System\DirectoryServices\AccountManagement\SAM\SAMStoreKey.cs (2)
17Debug.Assert(machineName != null && machineName.Length > 0); 18Debug.Assert(sid != null && sid.Length > 0);
System\DirectoryServices\AccountManagement\SAM\SAMUtils.cs (7)
25Debug.Assert(SAMUtils.IsOfObjectClass(computerDE, "Computer")); 36Debug.Assert(computerDE.Properties["OperatingSystemVersion"].Count == 1); 63Debug.Assert(versionComponents.Length >= 1); // since version was a non-empty string 75Debug.Fail("SAMUtils.GetOSVersion: {computerDE.Path} claims to have negetive OS version, {version}"); 81Debug.Fail($"SAMUtils.GetOSVersion: FormatException on {version} for {computerDE.Path}"); 86Debug.Fail($"SAMUtils.GetOSVersion: OverflowException on {version} for {computerDE.Path}"); 108Debug.Fail($"SAMUtils.DirectoryEntryAsPrincipal: fell off end, Path={de.Path}, SchemaClassName={de.SchemaClassName}");
System\DirectoryServices\AccountManagement\StoreCtx.cs (2)
37Debug.Assert(value != null); 438Debug.Fail($"StoreCtx.BuildFilterSet: fell off end looking for {propertyName} of type {value.GetType()}");
System\DirectoryServices\AccountManagement\TrackedCollection.cs (3)
64Debug.Fail("TrackedCollection.SyncRoot: shouldn't be here."); 74Debug.Fail("TrackedCollection.IEnumerable.GetEnumerator(): should not be here"); 110Debug.Fail("TrackedCollection.GetEnumerator(): should not be here");
System\DirectoryServices\AccountManagement\TrackedCollectionEnumerator.cs (1)
67Debug.Assert(_enumerator != null);
System\DirectoryServices\AccountManagement\User.cs (1)
297Debug.Assert(storeCtx != null);
System\DirectoryServices\AccountManagement\Utils.cs (17)
169Debug.Assert(pBytes != IntPtr.Zero); 203Debug.Assert(Interop.Advapi32.IsValidSid(pSid)); 319Debug.Assert(success); 363Debug.Assert(tokenHandle.IsInvalid); 387Debug.Assert(!tokenHandle.IsInvalid); 410Debug.Assert(neededBufferSize > 0); 436Debug.Assert(Interop.Advapi32.IsValidSid(pUserSid)); 488Debug.Assert(!policyHandle.IsInvalid); 503Debug.Assert(pBuffer != IntPtr.Zero); 506Debug.Assert(Interop.Advapi32.IsValidSid(info.DomainSid)); 604Debug.Assert(hUser != IntPtr.Zero || 616Debug.Assert(f == 0); // should never succeed, with a 0 buffer size 618Debug.Assert(nameLength > 0); 619Debug.Assert(domainNameLength > 0); 629Debug.Assert(lastErr != 0); 664Debug.Assert(ClassifySID(sid) == SidType.FakeObject); 829Debug.Assert(Interop.Advapi32.IsValidSid(pSid));
System.DirectoryServices.Protocols (52)
src\runtime\src\libraries\Common\src\Interop\Linux\OpenLdap\Interop.Ber.cs (10)
44Debug.Assert(format == "n"); 76Debug.Assert(format == "b"); 102Debug.Assert(format == "X"); 127Debug.Assert(format == "{" || format == "}" || format == "[" || format == "]" || format == "n" || format == "x"); 139Debug.Assert(format == "n" || format == "x"); 162Debug.Assert(format == "b"); 178Debug.Assert(format == "B"); 190Debug.Assert(format == "O"); 200Debug.Assert(format == "v" || format == "V"); 207Debug.Assert(format == "v" || format == "V");
System\DirectoryServices\Protocols\common\BerConverter.cs (29)
23Debug.WriteLine("Begin encoding\n"); 58Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 65Debug.WriteLine("type should be int\n"); 80Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 87Debug.WriteLine("type should be boolean\n"); 102Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 109Debug.WriteLine("type should be string, but receiving value has type of "); 110Debug.WriteLine(value[valueCount].GetType()); 131Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 138Debug.WriteLine("type should be byte[], but receiving value has type of "); 139Debug.WriteLine(value[valueCount].GetType()); 154Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 161Debug.WriteLine("type should be string[], but receiving value has type of "); 162Debug.WriteLine(value[valueCount].GetType()); 195Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 202Debug.WriteLine("type should be byte[][], but receiving value has type of "); 203Debug.WriteLine(value[valueCount].GetType()); 218Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n"); 225Debug.WriteLine("type should be int\n"); 238Debug.WriteLine("Format string contains undefined character: "); 239Debug.WriteLine(new string(fmt, 1)); 246Debug.WriteLine("ber_printf failed\n"); 263Debug.WriteLine("ber_flatten failed\n"); 306Debug.WriteLine("Begin decoding"); 340Debug.WriteLine("ber_scanf for {, }, [, ], n or x failed"); 365Debug.WriteLine("ber_scanf for format character 'i', 'e' or 'b' failed"); 434Debug.WriteLine("Format string contains undefined character\n"); 506Debug.WriteLine("ber_scanf for format character 'O' failed"); 626Debug.WriteLine("ber_scanf for format character 'V' failed");
System\DirectoryServices\Protocols\common\DirectoryControl.cs (3)
157Debug.Assert(controls[i] != null); 158Debug.Assert(controls[i]._directoryControlValue != null); 250Debug.Assert(asnReadSuccessful);
System\DirectoryServices\Protocols\ldap\LdapConnection.cs (3)
243Debug.Assert(vt.IsCompleted); 518Debug.WriteLine("rebind occurs\n"); 1923Debug.Assert(control.ldctl_oid != IntPtr.Zero);
System\DirectoryServices\Protocols\ldap\LdapConnection.Linux.cs (2)
33Debug.Assert(!_ldapHandle.IsInvalid); 129Debug.Assert(AuthType != AuthType.Anonymous && AuthType != AuthType.Basic);
System\DirectoryServices\Protocols\ldap\LdapPartialResultsProcessor.cs (3)
140Debug.Assert(vt.IsCompleted); 296Debug.Assert(asyncResult._resultStatus == ResultsStatus.Done); 371Debug.WriteLine(e.Message);
System\DirectoryServices\Protocols\ldap\LdapSessionOptions.cs (2)
888Debug.Assert(_callbackRoutine.QueryForConnection != null); 1098Debug.Assert(serverCert != IntPtr.Zero);
System.Drawing.Common (81)
System\Drawing\Brush.cs (1)
33Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\BufferedGraphicsContext.cs (1)
446Debug.Assert(_oldBitmap.IsNull);
System\Drawing\Drawing2D\CustomLineCap.cs (1)
81Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\Drawing2D\GraphicsPath.cs (2)
126Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 131Debug.Fail($"Exception thrown during Dispose: {ex}");
System\Drawing\Drawing2D\GraphicsPathIterator.cs (2)
36Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 46Debug.Fail($"Exception thrown during Dispose: {ex}");
System\Drawing\Drawing2D\HatchBrush.cs (1)
27Debug.Assert(nativeBrush is not null, "Initializing native brush with null.");
System\Drawing\Drawing2D\LinearGradientBrush.cs (1)
89Debug.Assert(nativeBrush is not null, "Initializing native brush with null.");
System\Drawing\Drawing2D\Matrix.cs (1)
147Debug.Assert(elements.Length >= 6);
System\Drawing\Drawing2D\PathGradientBrush.cs (1)
107Debug.Assert(nativeBrush is not null, "Initializing native brush with null.");
System\Drawing\Font.cs (5)
185Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 338Debug.Assert(_nativeFont is null, "nativeFont already initialized, this will generate a handle leak."); 339Debug.Assert(_fontFamily is not null, "fontFamily not initialized."); 477Debug.Assert(_nativeFont is null, "GDI+ native font already initialized, this will generate a handle leak"); 478Debug.Assert(nativeFont is not null, "nativeFont is null");
System\Drawing\FontConverter.cs (2)
450Debug.Assert(fontName is not null); 481Debug.Assert(Values is not null);
System\Drawing\FontFamily.cs (5)
23Debug.Assert(_nativeFamily is null, "Setting GDI+ native font family when already initialized."); 41Debug.Assert(clonedFamily == family); 95Debug.Assert(n is null || n[name.Length] == '\0', "Expected null-terminated string."); 217Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 238Debug.Assert(span.Length == (int)PInvokeCore.LF_FACESIZE);
System\Drawing\Graphics.cs (5)
186Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 2697Debug.Assert(_printingHelper is null, "WARNING: Overwriting the printing helper reference!"); 3400Debug.Assert(context is not null && context.State != 0, "GraphicsContext object is null or not valid."); 3417Debug.Assert(_previousContext is not null, "Trying to restore a context when the stack is empty"); 3435Debug.Fail("Warning: context state not found!");
System\Drawing\Icon.cs (4)
573Debug.Assert(sourceData.Height == targetData.Height, "Unexpected height. How did this happen?"); 616Debug.Assert(_iconData is not null); 633Debug.Assert(_bestImageOffset >= 0 && (_bestImageOffset + _bestBytesInRes) <= _iconData.Length, "Illegal offset/length for the Icon data"); 869Debug.Assert(size is >= 0 and <= ushort.MaxValue);
System\Drawing\Image.cs (2)
215Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 827Debug.Assert(count >= 0, "FrameDimensionsList returns bad count");
System\Drawing\ImageAnimator.cs (3)
239Debug.Assert(t_threadWriterLockWaitCount >= 0, "threadWriterLockWaitCount less than zero."); 341Debug.Assert(t_threadWriterLockWaitCount >= 0, "threadWriterLockWaitCount less than zero."); 387Debug.Assert(s_imageInfoList is not null, "Null images list");
System\Drawing\ImageConverter.cs (2)
109Debug.Assert(nameSpan.SequenceEqual("Bitmap Image\0"u8)); 110Debug.Assert(classSpan.SequenceEqual("Paint.Picture\0"u8));
System\Drawing\ImageInfo.cs (3)
53Debug.Assert(values.Length % 4 == 0, "PropertyItem has an invalid value byte array. It should have a length evenly divisible by 4 to represent ints."); 54Debug.Assert(_frameCount % (values.Length / 4) == 0, "PropertyItem has invalid value byte array. The FrameCount should be evenly divisible by a quarter of the byte array's length."); 93Debug.Assert(values.Length == sizeof(short), "PropertyItem has an invalid byte array. It should represent a single short value.");
System\Drawing\Imaging\ImageAttributes.cs (1)
77Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\Internal\SystemColorTracker.cs (7)
28Debug.Assert(s_list is not null, "List is null"); 29Debug.Assert(s_list.Length > 0, "INITIAL_SIZE was initialized after list"); 55Debug.Assert(!reference.TryGetTarget(out _), $"Trying to reuse a weak reference that isn't broken yet: list[{index}], length = {s_list.Length}"); 94Debug.Assert(s_count >= 0 && s_count <= s_list.Length, "count not a legal index into list"); 109Debug.Assert(s_list[i]?.TryGetTarget(out _) == false, "Partitioning didn't work"); 122Debug.Assert(s_list.Length < WARNING_SIZE, "SystemColorTracker is using way more memory than expected."); 133Debug.Assert(s_list[i] is not null, "null value in active part of list");
System\Drawing\Pen.cs (2)
78Debug.Assert(nativePen is not null); 123Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\Printing\DefaultPrintController.cs (7)
24Debug.Assert(_hdc is null && _graphics is null, "PrintController methods called in the wrong order?"); 31Debug.Assert(_modeHandle is not null, "_modeHandle should have been set by PrintController.OnStartPrint"); 73Debug.Assert(_hdc is not null && _graphics is null, "PrintController methods called in the wrong order?"); 74Debug.Assert(_modeHandle is not null); 82Debug.Assert(result == _hdc, "ResetDC didn't return the same handle"); 114Debug.Assert(_hdc is not null && _graphics is not null, "PrintController methods called in the wrong order?"); 138Debug.Assert(_hdc is not null && _graphics is null, "PrintController methods called in the wrong order?");
System\Drawing\Printing\PageSettings.cs (1)
31Debug.Assert(printerSettings is not null, "printerSettings == null");
System\Drawing\Printing\PrintController.cs (1)
200Debug.Assert(_modeHandle is not null, "modeHandle is null. Someone must have forgot to call base.StartPrint");
System\Drawing\Printing\PrinterSettings.cs (6)
343Debug.Assert(imageFormat == ImageFormat.Jpeg || imageFormat == ImageFormat.Png); 403Debug.Assert(result != -1); 822Debug.Fail("Invalid field in GetModeField"); 861Debug.Assert( 871Debug.Assert( 917Debug.Assert(
System\Drawing\Printing\PrinterUnitConvert.cs (1)
81Debug.Fail($"Unknown PrinterUnit {unit}");
System\Drawing\Printing\PrintPageEventArgs.cs (1)
64Debug.Assert(Graphics is null);
System\Drawing\Printing\TriState.cs (1)
30Debug.Assert(o is TriState);
System\Drawing\Region.cs (1)
97Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\SolidBrush.cs (1)
32Debug.Assert(nativeBrush is not null, "Initializing native brush with null.");
System\Drawing\StringFormat.cs (2)
77Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}"); 87Debug.Fail($"Exception thrown during Dispose: {ex}");
System\Drawing\SystemBrushes.cs (1)
74Debug.Assert(idx >= 0 && idx < systemBrushes.Length, "System colors have been added but our system color array has not been expanded.");
System\Drawing\SystemFonts.cs (1)
215Debug.Assert(defaultFont is not null, "defaultFont wasn't set.");
System\Drawing\SystemPens.cs (1)
74Debug.Assert(idx >= 0 && idx < systemPens.Length, "System colors have been added but our system color array has not been expanded.");
System\Drawing\Text\FontCollection.cs (1)
50Debug.Assert(gpFamilies.Length == numFound, "GDI+ can't give a straight answer about how many fonts there are");
System\Drawing\Text\PrivateFontCollection.cs (1)
39Debug.Assert(status == Status.Ok, $"GDI+ returned an error status: {status}");
System\Drawing\TextureBrush.cs (1)
90Debug.Assert(nativeBrush is not null, "Initializing native brush with null.");
System\Drawing\ToolboxBitmapAttribute.cs (1)
315Debug.Assert(stream is not null, "DefaultComponent.bmp must be present as an embedded resource.");
System.Drawing.Primitives (9)
src\runtime\src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\Drawing\Color.cs (2)
396Debug.Assert(name != null); 403Debug.Assert(tableName != null, $"Could not find known color '{(KnownColor)knownColor}' in the KnownColorTable");
System\Drawing\KnownColorNames.cs (1)
199Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple);
System\Drawing\KnownColorTable.cs (4)
477Debug.Assert((argb & Color.ARGBAlphaMask) == Color.ARGBAlphaMask); 478Debug.Assert(ColorValueTable.Length == ColorKindTable.Length); 495Debug.Assert(color > 0 && color <= KnownColor.RebeccaPurple); 515Debug.Assert(Color.IsKnownColorSystem(color));
System.Formats.Asn1 (121)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
System\Formats\Asn1\Asn1Tag.cs (3)
232Debug.Assert(bytesConsumed > 0); 338Debug.Assert(segment <= byte.MaxValue); 344Debug.Assert(idx == 0);
System\Formats\Asn1\AsnCharacterStringEncodings.cs (7)
172Debug.Assert(minCharAllowed <= maxCharAllowed); 173Debug.Assert(maxCharAllowed <= 0x7F); 193Debug.Assert(!isAllowed[c]); 227Debug.Fail("Fallback should have thrown"); 259Debug.Fail("Fallback should have thrown"); 291Debug.Fail("Fallback should have thrown"); 325Debug.Fail("Fallback should have thrown");
System\Formats\Asn1\AsnCharacterStringEncodings.net.cs (11)
45Debug.Assert(Vector<byte>.Count == 2 * Vector<ushort>.Count); 80Debug.Assert(Vector<byte>.Count == 2 * Vector<ushort>.Count); 200Debug.Assert(minCharAllowed <= maxCharAllowed); 201Debug.Assert(maxCharAllowed <= 0x7F); 234Debug.Fail("Fallback should have thrown"); 266Debug.Fail("Fallback should have thrown"); 286Debug.Assert(Vector<byte>.Count == 2 * Vector<ushort>.Count); 325Debug.Assert(Vector<byte>.Count == 2 * Vector<ushort>.Count); 414Debug.Fail("Fallback should have thrown"); 445Debug.Fail("Fallback should have thrown"); 468Debug.Fail("Fallback should have thrown");
System\Formats\Asn1\AsnDecoder.BitString.cs (6)
328Debug.Fail("TryCopyConstructedBitStringValue failed with a pre-allocated buffer"); 367Debug.Assert(unusedBitCount == 0); 492Debug.Assert(length != null); 548Debug.Fail("Non-overlapping data encountered..."); 626Debug.Assert(bytesWritten == contentLength); 663Debug.Assert(contentsLength.HasValue);
System\Formats\Asn1\AsnDecoder.cs (8)
315Debug.Fail($"No handler is present for status {status}."); 440Debug.Assert(bytesRead > 0); 533Debug.Assert(validity != LengthValidity.Valid); 544Debug.Fail($"No handler for validity {validity}."); 647Debug.Assert(offset >= 0); 659Debug.Assert(offset >= 0); 688Debug.Fail("AsnReader asked for a matching slice from a non-overlapping input"); 695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER);
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (6)
192Debug.Assert(!contents.IsEmpty); 194Debug.Assert(state == GetNextState(octet)); 211Debug.Fail($"Unhandled value '{octet:X2}' in {nameof(FracState)}"); 267Debug.Assert(!contents.IsEmpty); 269Debug.Assert(state == GetNextState(octet)); 291Debug.Fail($"Unhandled value '{octet:X2}' in {nameof(SuffixState)}");
System\Formats\Asn1\AsnDecoder.Integer.cs (2)
434Debug.Assert(sizeLimit <= sizeof(long)); 473Debug.Assert(sizeLimit <= sizeof(ulong));
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (2)
347Debug.Fail("TryReadBitString failed with an over-allocated buffer"); 368Debug.Assert(valueSpan.Length <= sizeof(long));
System\Formats\Asn1\AsnDecoder.OctetString.cs (6)
212Debug.Assert(contentLength.HasValue); 355Debug.Assert(length != null); 413Debug.Fail("Non-overlapping data encountered..."); 472Debug.Assert(bytesWritten == contentLength); 485Debug.Assert(rented == null); 530Debug.Fail("TryCopyConstructedOctetStringContents failed with a pre-allocated buffer");
System\Formats\Asn1\AsnDecoder.Oid.cs (8)
85Debug.Assert(source.Length > 0); 198Debug.Assert(idx == nextStop); 199Debug.Assert(writeSpan.Length >= SemanticByteCount); 202Debug.Assert(accumValueBytes[7] == 0); 223Debug.Assert(paddingByteCount >= 0 && paddingByteCount < sizeof(long)); 288Debug.Assert(largeValue != null); 293Debug.Assert(firstIdentifier > long.MaxValue); 319Debug.Assert((smallValue == null) != (largeValue == null));
System\Formats\Asn1\AsnDecoder.UtcTime.cs (3)
99Debug.Fail($"UtcTime did not fit in tmpSpace ({contents.Length} total)"); 177Debug.Assert( 193Debug.Assert(contents.IsEmpty);
System\Formats\Asn1\AsnWriter.BitString.cs (5)
111Debug.Assert(contentLength > MaxCERContentSize); 119Debug.Assert( 147Debug.Assert(payload.Length > MaxCERContentSize); 192Debug.Assert(_offset - savedOffset == expectedSize, $"expected size was {expectedSize}, actual was {_offset - savedOffset}"); 193Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerBitString)}");
System\Formats\Asn1\AsnWriter.Boolean.cs (2)
31Debug.Assert(!tag.IsConstructed); 35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (19)
93Debug.Assert(_buffer != null); 181Debug.Assert(bytesWritten == _offset); 441Debug.Fail($"TryWrite failed or written was wrong value ({written} vs {spaceRequired})"); 452Debug.Assert(length >= -1); 464Debug.Assert(length >= 0); 495Debug.Assert(idx == _offset); 605Debug.Assert(tag.IsConstructed); 623Debug.Assert(tag.IsConstructed); 633Debug.Assert(tagType == UniversalTagNumber.SetOf); 653Debug.Assert(containedLength >= 0); 693Debug.Assert(_offset == expectedEnd); 716Debug.Assert(_offset - lenOffset - 1 == shiftSize); 722Debug.Assert(buffer != null); 723Debug.Assert(end >= start); 760Debug.Assert(pos == end); 775Debug.Assert(pos == len); 878Debug.Assert(writer._nestingStack != null); 893Debug.Assert(_writer == null || _writer._nestingStack != null); 914Debug.Fail($"No handler for {_frame.ItemType}");
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (7)
65Debug.Assert(normalized.Year <= 9999, "DateTimeOffset guards against this internally"); 88Debug.Fail($"Utf8Formatter.TryFormat could not format {floatingTicks} / TicksPerSecond"); 92Debug.Assert(bytesWritten > 2, $"{bytesWritten} should be > 2"); 93Debug.Assert(fraction[0] == (byte)'0'); 94Debug.Assert(fraction[1] == (byte)'.'); 110Debug.Assert(!tag.IsConstructed); 132Debug.Fail($"Utf8Formatter.TryFormat failed to build components of {normalized:O}");
System\Formats\Asn1\AsnWriter.Integer.cs (7)
141Debug.Assert(!tag.IsConstructed); 160Debug.Assert(_buffer[_offset] != 0xFF || _buffer[_offset + 1] < 0x80); 193Debug.Assert(!tag.IsConstructed); 212Debug.Assert(_buffer[_offset] != 0 || _buffer[_offset + 1] > 0x7F); 232Debug.Assert(!tag.IsConstructed); 270Debug.Assert(!tag.IsConstructed); 281Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Null.cs (1)
30Debug.Assert(!tag.IsConstructed);
System\Formats\Asn1\AsnWriter.OctetString.cs (4)
106Debug.Assert(payload.Length > MaxCERSegmentSize); 117Debug.Assert( 165Debug.Assert(_offset - savedOffset == expectedSize, $"expected size was {expectedSize}, actual was {_offset - savedOffset}"); 166Debug.Assert(_buffer == ensureNoExtraCopy, $"_buffer was replaced during {nameof(WriteConstructedCerOctetString)}");
System\Formats\Asn1\AsnWriter.Oid.cs (2)
135Debug.Assert(!tag.IsConstructed); 190Debug.Assert(dest.Length > 0);
System\Formats\Asn1\AsnWriter.Sequence.cs (2)
59Debug.Assert(tag.IsConstructed); 66Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.SetOf.cs (2)
68Debug.Assert(tag.IsConstructed); 75Debug.Assert(tag.IsConstructed);
System\Formats\Asn1\AsnWriter.Text.cs (3)
105Debug.Fail( 115Debug.Assert(size > AsnReader.MaxCERSegmentSize); 122Debug.Fail(
System\Formats\Asn1\AsnWriter.UtcTime.cs (2)
80Debug.Assert(!tag.IsConstructed); 108Debug.Fail($"Utf8Formatter.TryFormat failed to build components of {normalized:O}");
System.Formats.Cbor (47)
System\Formats\Cbor\CborConformanceLevel.cs (2)
221Debug.Assert(!left.IsEmpty && !right.IsEmpty); 256Debug.Fail("Invalid conformance mode used in encoding sort.");
System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Formats\Cbor\Reader\CborReader.cs (11)
71Debug.Assert(maxDepth >= -1); 216Debug.Assert(CurrentDepth < MaxDepth); 249Debug.Assert(_nestedDataItems?.Count > 0); 277Debug.Assert(_definiteLength is null || _definiteLength - _itemsRead > 0); 299Debug.Assert(_offset + length <= _data.Length); 308Debug.Assert(position <= _data.Length); 423Debug.Assert(restoreHeight >= 0, "Attempting to restore checkpoint outside of its original context."); 429Debug.Assert(_nestedDataItems != null); 430Debug.Assert(_nestedDataItems.ToArray()[restoreHeight - 1].FrameOffset == checkpoint.FrameOffset, 445Debug.Assert(checkpoint.FrameOffset == _frameOffset, "Attempting to restore checkpoint outside of its original context."); 462Debug.Assert(CurrentDepth == checkpoint.Depth);
System\Formats\Cbor\Reader\CborReader.Map.cs (4)
105Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 == 0); 126Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 != 0); 133Debug.Assert(_currentKeyOffset != null); 161Debug.Assert(_currentKeyOffset != null);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (5)
32Debug.Assert(!AllowMultipleRootLevelValues); 38Debug.Fail("CborReader internal error. Invalid CBOR major type pushed to stack."); 74Debug.Assert(AllowMultipleRootLevelValues); 84Debug.Fail("CborReader internal error. Invalid CBOR major type pushed to stack."); 129Debug.Fail("CborReader internal error. Invalid CBOR major type.");
System\Formats\Cbor\Reader\CborReader.SkipValue.cs (1)
43Debug.Assert(0 <= depth && depth <= CurrentDepth);
System\Formats\Cbor\Reader\CborReader.String.cs (3)
346Debug.Assert(target.IsEmpty); 409Debug.Assert(target.IsEmpty); 489Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString);
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
74Debug.Assert(majorType == CborMajorType.Array || majorType == CborMajorType.Map);
System\Formats\Cbor\Writer\CborWriter.cs (7)
82Debug.Assert(maxDepth >= -1); 83Debug.Assert(initialCapacity >= -1); 310Debug.Assert(CurrentDepth < MaxDepth); 355Debug.Assert(_nestedDataItems?.Count > 0); // implied by previous check 442Debug.Assert(_definiteLength == null); 457Debug.Assert(_itemsWritten % 2 == 0); 461Debug.Fail("Invalid CBOR major type pushed to stack.");
System\Formats\Cbor\Writer\CborWriter.Map.cs (4)
97Debug.Assert(_currentKeyOffset != null && _currentValueOffset == null); 121Debug.Assert(_currentKeyOffset != null && _currentValueOffset != null); 154Debug.Assert(_keyValuePairEncodingRanges != null); 173Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.String.cs (5)
49Debug.Assert(_currentIndefiniteLengthStringRanges != null); 145Debug.Assert(_currentIndefiniteLengthStringRanges != null); 198Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString); 199Debug.Assert(_currentIndefiniteLengthStringRanges != null); 222Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.Tag.cs (2)
162Debug.Assert((flags & ScaleMask) == 0, "mantissa argument should be integral."); 193Debug.Fail("Unreachable code in decimal exponentiation logic");
System.Formats.Nrbf (19)
System\Formats\Nrbf\ArrayInfo.cs (1)
39Debug.Assert(FlattenedLength <= MaxArrayLength);
System\Formats\Nrbf\ArrayRecord.cs (3)
129Debug.Assert(incrementCount == 1, "IncrementCount other than 1 is allowed only for null records."); 159Debug.Assert(numElementsWritten == (uint)source.Count, "We should have traversed the entirety of the source records collection."); 160Debug.Assert(numElementsWritten == (ulong)destination.LongLength, "We should have traversed the entirety of the destination array.");
System\Formats\Nrbf\ArrayRectangularPrimitiveRecord.cs (2)
77Debug.Assert(numElementsWritten == (uint)_values.Count, "We should have traversed the entirety of the source values collection."); 78Debug.Assert(numElementsWritten == (ulong)result.LongLength, "We should have traversed the entirety of the destination array.");
System\Formats\Nrbf\ArraySingleObjectRecord.cs (1)
67Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ArraySingleStringRecord.cs (2)
78Debug.Assert(nullCount > 0, "All implementations of NullsRecord are expected to return a positive value for NullCount."); 87Debug.Assert(valueIndex == values.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\ClassInfo.cs (1)
38Debug.Assert(_typeName is not null);
System\Formats\Nrbf\ClassRecord.cs (1)
149Debug.Assert(nextRecord is not (ObjectNullMultiple256Record or ObjectNullMultipleRecord));
System\Formats\Nrbf\JaggedArrayRecord.cs (1)
36Debug.Assert(TypeName.GetElementType().IsArray, "Jagged arrays are required.");
System\Formats\Nrbf\RectangularArrayRecord.cs (2)
33Debug.Assert(elementType == typeof(string) || elementType == typeof(SerializationRecord)); 34Debug.Assert(!TypeName.GetElementType().IsArray, "Use JaggedArrayRecord instead.");
System\Formats\Nrbf\SZArrayOfRecords.cs (2)
62Debug.Assert(nullCount > 0, "All implementations of NullsRecord are expected to return a positive value for NullCount."); 72Debug.Assert(resultIndex == result.Length, "We should have traversed the entirety of the newly created array.");
System\Formats\Nrbf\Utils\BinaryReaderExtensions.cs (1)
217Debug.Assert(requiredBytes >= 0);
System\Formats\Nrbf\Utils\TypeNameHelpers.cs (2)
117Debug.Assert(payloadOptions.UndoTruncatedTypeNames); 118Debug.Assert(libraryRecord.RawLibraryName is not null);
System.Formats.Tar (127)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
70Debug.Assert(passwd.Name != null);
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
120Debug.Assert(rootLength > 0);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (1)
225Debug.Assert(!_hasReachedEnd);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Formats\Tar\GnuSparseStream.cs (6)
178Debug.Assert(vt.IsCompleted, "Synchronous Read completed asynchronously."); 217Debug.Assert(_segments is not null && _packedStartOffsets is not null); 268Debug.Assert(vt.IsCompleted, "Synchronous CopyPopulatedDataTo completed asynchronously."); 288Debug.Assert(_segments is not null && _packedStartOffsets is not null); 359Debug.Assert(_segments is not null); 413Debug.Assert(_segments is not null);
System\Formats\Tar\GnuTarEntry.cs (2)
62Debug.Assert(_header._aTime == default); 63Debug.Assert(_header._cTime == default);
System\Formats\Tar\PosixTarEntry.cs (2)
37Debug.Assert(other._header._uName != null); 38Debug.Assert(other._header._gName != null);
System\Formats\Tar\TarEntry.cs (15)
31Debug.Assert(header._format == format); 41Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 289Debug.Assert(vt.IsCompleted, "Synchronous AdvanceDataStreamIfNeeded completed asynchronously."); 366Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 367Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 523Debug.Assert(Path.IsPathFullyQualified(qualifiedPath), $"{qualifiedPath} is not qualified"); 524Debug.Assert(PathInternal.EndsInDirectorySeparator(destinationDirectoryFullPath), "caller must ensure the path ends with a separator."); 568Debug.Assert(EntryType is not (TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile)); 576Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 577Debug.Assert(!Directory.Exists(filePath)); 590Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 596Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 624Debug.Fail($"Metadata entry type should not be visible: '{EntryType}'"); 669Debug.Assert(!Path.Exists(destinationFileName)); 696Debug.Assert(!Path.Exists(destinationFileName));
System\Formats\Tar\TarEntry.Unix.cs (6)
16Debug.Assert(EntryType is TarEntryType.BlockDevice); 23Debug.Assert(EntryType is TarEntryType.CharacterDevice); 30Debug.Assert(EntryType is TarEntryType.Fifo); 37Debug.Assert(EntryType is TarEntryType.HardLink); 38Debug.Assert(!string.IsNullOrEmpty(targetFilePath)); 39Debug.Assert(!string.IsNullOrEmpty(hardLinkFilePath));
System\Formats\Tar\TarFile.cs (12)
552Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 553Debug.Assert(!string.IsNullOrEmpty(destinationFileName)); 674Debug.Assert(!string.IsNullOrEmpty(sourceFileName)); 675Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryFullPath)); 723Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 724Debug.Assert(destination != null); 725Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 726Debug.Assert(destination.CanWrite); 732Debug.Assert(source != null); 733Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 734Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 735Debug.Assert(source.CanRead);
System\Formats\Tar\TarHeader.cs (3)
140Debug.Assert(_ea == null); 141Debug.Assert(existing != null); 264Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink);
System\Formats\Tar\TarHeader.Read.cs (1)
63Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu);
System\Formats\Tar\TarHeader.Write.cs (46)
38Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 39Debug.Assert(_dataStream is null || _dataStream.CanSeek); 55Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 56Debug.Assert(_dataStream == null || _dataStream.CanSeek); 70Debug.Assert(destinationStream.CanSeek); 71Debug.Assert(_dataStream is not null); 72Debug.Assert(!_dataStream.CanSeek); 111Debug.Assert(destinationStream.CanSeek); 112Debug.Assert(_dataStream != null); 113Debug.Assert(!_dataStream.CanSeek); 199Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 200Debug.Assert(globalExtendedAttributesEntryNumber >= 0); 205Debug.Assert(archiveStream.CanSeek || _dataStream is null || _dataStream.CanSeek); 220Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 233Debug.Assert(archiveStream.CanSeek || _dataStream is null || _dataStream.CanSeek); 248Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 263Debug.Assert(archiveStream.CanSeek || _dataStream is null || _dataStream.CanSeek); 264Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 295Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 296Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 345Debug.Assert(archiveStream.CanSeek || _dataStream is null || _dataStream.CanSeek); 350Debug.Assert(longLinkHeader._dataStream is not null && longLinkHeader._dataStream.CanSeek); 358Debug.Assert(longPathHeader._dataStream is not null && longPathHeader._dataStream.CanSeek); 376Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 382Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 391Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 416Debug.Assert(_linkName != null); 430Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 464Debug.Assert(_dataStream is null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); 472Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 479Debug.Assert(isGea && globalExtendedAttributesEntryNumber >= 0 || !isGea && globalExtendedAttributesEntryNumber < 0); 597Debug.Assert(prefix.Length != 1 || !PathInternal.Utf8DirectorySeparators.Contains(prefix[0])); 614Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 673Debug.Assert(_dataStream.CanSeek); 789Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 806Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 853Debug.Assert(length == CountDigits(length) + 3 + Encoding.UTF8.GetByteCount(attribute) + Encoding.UTF8.GetByteCount(value)); 867Debug.Assert(formatted); 893Debug.Assert(value >= 0); 961Debug.Assert(destination.Length > 1); 975Debug.Assert(destination.Length > 1); 1005Debug.Assert(bytes.Length <= 512); 1035Debug.Assert(destination.Length == 8, "8 byte field expected."); 1060Debug.Assert(destination.Length == 12, "12 byte field expected."); 1149Debug.Assert(globalExtendedAttributesEntryNumber >= 1); 1165Debug.Assert(GetUtf8TextLength(text) > utf8MaxLength);
System\Formats\Tar\TarHelpers.Unix.cs (2)
60Debug.Assert(pendingModes is not null); 104Debug.Assert(pendingModes is not null);
System\Formats\Tar\TarReader.cs (12)
56Debug.Assert(vt.IsCompleted, "Synchronous Dispose completed asynchronously."); 111Debug.Assert(_archiveStream.CanRead); 120Debug.Assert(vt.IsCompleted, "Synchronous GetNextEntry completed asynchronously."); 153Debug.Assert(_archiveStream.CanRead); 175Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 247Debug.Assert(!_reachedEndMarkers); 351Debug.Assert(header._linkName != null); 352Debug.Assert(secondHeader._name != null); 359Debug.Assert(header._name != null); 360Debug.Assert(secondHeader._linkName != null); 372Debug.Assert(header._linkName != null); 377Debug.Assert(header._name != null);
System\Formats\Tar\TarWriter.cs (3)
118Debug.Assert(vt.IsCompleted, "Synchronous Dispose completed asynchronously."); 162Debug.Assert(vt.IsCompleted, "Synchronous WriteEntry completed asynchronously."); 333Debug.Assert(entry.Format == TarEntryFormat.Unknown, "Missing format handler");
System\Formats\Tar\TarWriter.Unix.cs (3)
20Debug.Assert(!string.IsNullOrEmpty(fullPath)); 124Debug.Assert(hardLinkTarget is not null); 130Debug.Assert(entry._header._dataStream == null);
System.IO.Compression (208)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeZstdHandle.cs (4)
35Debug.Assert(_dictionary == null); 36Debug.Assert(dictionary != null); 110Debug.Assert(_dictionary == null); 111Debug.Assert(dictionary != null);
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (3)
269Debug.Assert(zlibErrorContext is "deflateInit2_" or "inflateInit2_"); 294Debug.Assert(InitializationState == State.NotInitialized); 373Debug.Assert(InitializationState == State.NotInitialized);
src\runtime\src\libraries\Common\src\System\IO\SubReadStream.cs (1)
225Debug.Assert(!_hasReachedEnd);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateDecoder.cs (2)
62Debug.Assert(_state is not null); 122Debug.Assert(_state is not null);
System\IO\Compression\DeflateEncoder.cs (3)
192Debug.Assert(_state is not null); 262Debug.Assert(_state is not null); 309Debug.Assert(_state is not null);
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (2)
30Debug.Assert(method == ZipCompressionMethod.Deflate64); 121Debug.Assert(_inflater.AvailableOutput == 0, "We should have copied all stuff out!");
System\IO\Compression\DeflateManaged\HuffmanTree.cs (3)
48Debug.Assert( 102Debug.Assert(length > 0 && length <= 16, "Invalid len"); 236Debug.Assert(value < 0, "CreateTable: Only negative numbers are used for tree pointers!");
System\IO\Compression\DeflateManaged\InflaterManaged.cs (7)
335Debug.Fail("check why we are here!"); 358Debug.Assert(_literalLengthTree != null); 403Debug.Assert(_extraBits != 0, "We handle other cases separately!"); 432Debug.Assert(_distanceTree != null); 479Debug.Fail("check why we are here!"); 577Debug.Assert(_codeLengthTree != null); 671Debug.Fail("check why we are here!");
System\IO\Compression\DeflateManaged\InputBuffer.cs (13)
35Debug.Assert(0 < count && count <= 16, "count is invalid."); 110Debug.Assert(0 < count && count <= 16, "count is invalid."); 131Debug.Assert(_bitsInBuffer % 8 == 0); 163Debug.Assert(output != null); 164Debug.Assert(offset >= 0); 165Debug.Assert(length >= 0); 166Debug.Assert(offset <= output.Length - length); 167Debug.Assert((_bitsInBuffer % 8) == 0); 202Debug.Assert(buffer != null); 203Debug.Assert(offset >= 0); 204Debug.Assert(length >= 0); 205Debug.Assert(offset <= buffer.Length - length); 213Debug.Assert(_bitsInBuffer >= n, "No enough bits in the buffer, Did you call EnsureBitsAvailable?");
System\IO\Compression\DeflateManaged\OutputWindow.cs (3)
35Debug.Assert(_bytesUsed < WindowSize, "Can't add byte when window is full!"); 43Debug.Assert((_bytesUsed + length) <= WindowSize, "No Enough space"); 148Debug.Assert(_bytesUsed >= 0, "check this function and find why we copied more bytes than we have");
System\IO\Compression\DeflateZLib\Deflater.cs (14)
65Debug.Assert(NeedsInput(), "We have something left in previous input!"); 66Debug.Assert(!inputBuffer.IsEmpty); 79Debug.Assert(NeedsInput(), "We have something left in previous input!"); 80Debug.Assert(inputBufferPtr != null); 81Debug.Assert(count > 0); 92Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 93Debug.Assert(!NeedsInput(), "GetDeflateOutput should only be called after providing input"); 113Debug.Assert(outputBuffer?.Length > 0); 132Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 133Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 144Debug.Assert(null != outputBuffer, "Can't pass in a null output buffer!"); 145Debug.Assert(outputBuffer.Length > 0, "Can't pass in an empty output buffer!"); 146Debug.Assert(NeedsInput(), "We have something left in previous input!"); 201Debug.Assert(windowBits >= minWindowBits && windowBits <= maxWindowBits);
System\IO\Compression\DeflateZLib\DeflateStream.cs (30)
119Debug.Assert(stream != null); 149Debug.Assert(_buffer == null); 234Debug.Assert(_deflater != null && _buffer != null); 249Debug.Assert(flushSuccessful == (compressedBytes > 0)); 280Debug.Assert(_inflater != null); 310Debug.Assert(_inflater != null); 359Debug.Assert(bytesRead == 0); 455Debug.Assert(_inflater != null); 578Debug.Assert(_deflater != null); 594Debug.Assert(_deflater != null && _buffer != null); 611Debug.Assert(_deflater != null && _buffer != null); 622Debug.Assert(flushSuccessful == (compressedBytes > 0)); 641Debug.Assert(_deflater != null && _buffer != null); 667Debug.Assert(_deflater != null && _buffer != null); 689Debug.Assert(stream != null); 690Debug.Assert(_mode == CompressionMode.Decompress); 691Debug.Assert(stream.CanSeek); 692Debug.Assert(_inflater != null); 861Debug.Assert(_deflater != null); 878Debug.Assert(_deflater != null && _buffer != null); 931Debug.Assert(deflateStream != null); 932Debug.Assert(destination != null); 933Debug.Assert(bufferSize > 0); 946Debug.Assert(_deflateStream._inflater != null); 989Debug.Assert(_deflateStream._inflater != null); 1028Debug.Assert(buffer != _arrayPoolBuffer); 1053Debug.Assert(_deflateStream._inflater is not null); 1076Debug.Assert(buffer != _arrayPoolBuffer); 1090Debug.Assert(_deflateStream._inflater != null); 1139Debug.Assert(_activeAsyncOperation);
System\IO\Compression\DeflateZLib\Inflater.cs (13)
51Debug.Assert(bytesRead == 0 || bytesRead == 1); 62Debug.Assert(null != bytes, "Can't pass in a null output buffer!"); 140Debug.Assert(!NeedsInput()); 141Debug.Assert(IsGzipStream()); 142Debug.Assert(IsInputBufferHandleAllocated); 174Debug.Assert(NeedsInput(), "We have something left in previous input!"); 175Debug.Assert(inputBuffer != null); 176Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 177Debug.Assert(!IsInputBufferHandleAllocated); 184Debug.Assert(NeedsInput(), "We have something left in previous input!"); 185Debug.Assert(!IsInputBufferHandleAllocated); 289Debug.Assert(IsInputBufferHandleAllocated); 305Debug.Assert(windowBits >= MinWindowBits && windowBits <= MaxWindowBits);
System\IO\Compression\WinZipAesKeyMaterial.cs (2)
60Debug.Assert(salt.Length == saltSize, $"Salt must be {saltSize} bytes for AES-{keySizeBits}."); 66Debug.Assert(totalKeySize <= 66, "totalKeySize should be at most 66 bytes (AES-256: 32 + 32 + 2)");
System\IO\Compression\WinZipAesStream.cs (12)
165Debug.Assert((totalStreamSize >= 0) == !encrypting, "Total stream size must be known when decrypting"); 204Debug.Assert(_hmac is not null, "HMAC should have been initialized"); 214Debug.Assert(storedAuth.Length == 10); 223Debug.Assert(!_encrypting, "ValidateAuthCode should only be called during decryption."); 239Debug.Assert(!_encrypting, "ValidateAuthCode should only be called during decryption."); 255Debug.Assert(!_headerWritten); 265Debug.Assert(!_headerWritten); 274Debug.Assert(_hmac is not null, "HMAC should have been initialized"); 327Debug.Assert(dest.Length <= src.Length); 337Debug.Assert(_encrypting, "WriteAuthCode should only be called during encryption."); 338Debug.Assert(_hmac is not null, "HMAC should have been initialized"); 620Debug.Assert(_encrypting && !_authCodeFinalized);
System\IO\Compression\ZipArchive.Async.cs (3)
103Debug.Assert(mode == ZipArchiveMode.Update); 155Debug.Assert(_mode == ZipArchiveMode.Update); 359Debug.Assert(_readEntries);
System\IO\Compression\ZipArchive.cs (6)
155Debug.Assert(mode == ZipArchiveMode.Update); 354Debug.Assert(_mode == ZipArchiveMode.Update); 528internal void DebugAssertIsStillArchiveStreamOwner(ZipArchiveEntry entry) => Debug.Assert(_archiveStreamOwner == entry); 532Debug.Assert(_archiveStreamOwner == entry); 611Debug.Assert(currentHeader != null, "currentHeader should not be null here"); 907Debug.Assert(_readEntries);
System\IO\Compression\ZipArchiveEntry.Async.cs (4)
128Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 460Debug.Assert(await GetIsOpenableAsync(false, true, cancellationToken).ConfigureAwait(false)); 474Debug.Assert(await GetIsOpenableAsync(false, true, cancellationToken).ConfigureAwait(false)); 939Debug.Assert(_compressedBytes != null);
System\IO\Compression\ZipArchiveEntry.cs (19)
567Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 584Debug.Assert(entryStringBytes != null); 746Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 747Debug.Assert(_fileComment.Length <= ushort.MaxValue); 929Debug.Assert(IsOpenable(false, true, out _)); 959Debug.Assert(IsOpenable(false, true, out _)); 1008Debug.Assert(CompressionMethod == ZipCompressionMethod.Deflate 1134Debug.Assert((ushort)CompressionMethod != WinZipAesMethod, 1583Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 1601Debug.Assert(_uncompressedSize == 0); 1602Debug.Assert(_crc32 == 0); 1636Debug.Assert(_crc32 == 0); 1955Debug.Assert(_compressedBytes != null); 2135Debug.Assert((_generalPurposeBitFlag & BitFlagValues.DataDescriptor) != 0); 2318Debug.Assert(CanWrite); 2340Debug.Assert(CanWrite); 2371Debug.Assert(CanWrite); 2394Debug.Assert(CanWrite); 2402Debug.Assert(CanWrite);
System\IO\Compression\ZipBlocks.Async.cs (2)
87Debug.Assert(zip64eocdLocatorProper && zip64EOCDLocator != null); // we just found this using the signature finder, so it should be okay 218Debug.Assert(bytesToRead == collatedHeader.Length - remainingBufferLength);
System\IO\Compression\ZipBlocks.cs (5)
488Debug.Assert(zip64eocdLocatorProper && zip64EOCDLocator != null); // we just found this using the signature finder, so it should be okay 673Debug.Assert(blockBytes.Length == FieldLengths.FilenameLength + FieldLengths.ExtraFieldLength); 900Debug.Assert(buffer.Length >= BlockConstantSectionSize); 1030Debug.Assert(bytesToRead == collatedHeader[remainingBufferLength..].Length); 1102Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength);
System\IO\Compression\ZipCryptoStream.cs (4)
66Debug.Assert(!encrypting, "Use the overload with passwordVerifierLow2Bytes for encryption."); 78Debug.Assert(!encrypting, "Use the overload with passwordVerifierLow2Bytes for encryption."); 95Debug.Assert(encrypting, "Use the overload with expectedCheckByte for decryption."); 149Debug.Assert(header.Length == 12);
System\IO\Compression\ZipCustomStreams.cs (10)
372Debug.Assert(CanWrite); 379Debug.Assert(_baseStream == null); 386Debug.Assert(_baseStream != null); 397Debug.Assert(CanWrite); 404Debug.Assert(_baseStream == null); 411Debug.Assert(_baseStream != null); 430Debug.Assert(CanWrite); 440Debug.Assert(_baseStream == null); 447Debug.Assert(_baseStream != null); 461Debug.Assert(CanWrite);
System\IO\Compression\ZipHelper.Async.cs (4)
21Debug.Assert(signatureToFind.Length != 0); 22Debug.Assert(maxBytesToRead > 0); 60Debug.Assert(bufferPointer < bufferMemory.Length); 99Debug.Assert(overlap <= buffer.Length);
System\IO\Compression\ZipHelper.cs (6)
78Debug.Assert(ValidZipDate_YearMin <= dateTime.Year && dateTime.Year <= ValidZipDate_YearMax); 95Debug.Assert(signatureToFind.Length != 0); 96Debug.Assert(maxBytesToRead > 0); 134Debug.Assert(bufferPointer < bufferSpan.Length); 171Debug.Assert(overlap <= buffer.Length); 192Debug.Assert(maxBytes >= 0, "maxBytes must be non-negative");
System\IO\Compression\Zstandard\ZstandardDecoder.cs (2)
401Debug.Assert(_context != null); 415Debug.Assert(_context != null);
System\IO\Compression\Zstandard\ZstandardDictionary.cs (1)
110Debug.Assert(lengthsAsNuint.Length == sampleLengths.Length);
System\IO\Compression\Zstandard\ZstandardEncoder.cs (2)
483Debug.Assert(_context != null); 491Debug.Assert(handle != null);
System\IO\Compression\Zstandard\ZstandardStream.Compress.cs (7)
87Debug.Assert(_encoder != null); 99Debug.Assert(_encoder != null); 115Debug.Assert(!output.IsEmpty, "Internal buffer should be initialized to non-zero size"); 124Debug.Assert(buffer.Length == 0); 160Debug.Assert(_encoder != null); 176Debug.Assert(!output.IsEmpty, "Internal buffer should be initialized to non-zero size"); 185Debug.Assert(buffer.Length == 0);
System\IO\Compression\Zstandard\ZstandardStream.Decompress.cs (8)
63Debug.Assert(_decoder != null); 97Debug.Assert(status == OperationStatus.DestinationTooSmall); 104Debug.Assert( 199Debug.Assert(advanceTask.IsCompleted, "AdvanceToNextFrame should complete synchronously when async: false"); 221Debug.Assert(_decoder != null); 429Debug.Assert(stream != null); 430Debug.Assert(_mode == CompressionMode.Decompress); 431Debug.Assert(stream.CanSeek);
System\IO\Compression\Zstandard\ZstandardUtils.cs (2)
59Debug.Assert(IsError((nuint)error)); 65Debug.Assert(IsError((nuint)error));
System.IO.Compression.Brotli (17)
System\IO\Compression\BrotliStream.cs (4)
127Debug.Assert(stream != null); 128Debug.Assert(_mode == CompressionMode.Decompress); 129Debug.Assert(stream.CanSeek); 226Debug.Assert(_activeAsyncOperation);
System\IO\Compression\dec\BrotliDecoder.cs (4)
58Debug.Assert(_state != null); 82Debug.Assert(availableInput <= (nuint)source.Length); 83Debug.Assert(availableOutput <= (nuint)destination.Length); 122Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System\IO\Compression\dec\BrotliStream.Decompress.cs (3)
235Debug.Assert(lastResult == OperationStatus.DestinationTooSmall); 238Debug.Assert(bytesWritten == 0); 243Debug.Assert(
System\IO\Compression\enc\BrotliEncoder.cs (6)
75Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 93Debug.Assert(_state != null && !_state.IsInvalid && !_state.IsClosed); 145Debug.Assert(_state != null); 166Debug.Assert(availableInput <= (nuint)source.Length); 167Debug.Assert(availableOutput <= (nuint)destination.Length); 220Debug.Assert(success ? availableOutput <= (nuint)destination.Length : availableOutput == 0);
System.IO.Compression.ZipFile (2)
src\runtime\src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
System.IO.FileSystem.AccessControl (14)
src\runtime\src\libraries\Common\src\System\IO\FileSystem.Attributes.Windows.cs (1)
66Debug.Assert(errorCode == Interop.Errors.ERROR_ACCESS_DENIED || errorCode == Interop.Errors.ERROR_SHARING_VIOLATION || errorCode == Interop.Errors.ERROR_SEM_TIMEOUT,
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
120Debug.Assert(rootLength > 0);
src\runtime\src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PathHelper.Windows.cs (2)
75Debug.Assert(PathInternal.IsPartiallyQualified(path) || !PathInternal.IsExtended(path)); 132Debug.Assert(!PathInternal.IsPartiallyQualified(outputBuilder.AsSpan()), "should have resolved by now");
System\IO\FileSystemAclExtensions.cs (1)
257Debug.Assert(fullPath != null);
System\Security\AccessControl\DirectoryObjectSecurity.cs (2)
290Debug.Assert(SecurityDescriptor.DiscretionaryAcl != null); 431Debug.Assert(SecurityDescriptor.SystemAcl != null);
System.IO.FileSystem.DriveInfo (3)
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.cs (1)
67Debug.Fail($"Failed to read \"{ProcMountInfoFilePath}\": {e}");
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System.IO.FileSystem.Watcher (46)
src\runtime\src\libraries\Common\src\Interop\Linux\System.Native\Interop.INotify.cs (1)
37Debug.Fail("inotify_rm_watch failed with " + hr);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
120Debug.Assert(rootLength > 0);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\IO\FileSystemWatcher.cs (3)
69Debug.Assert(c_notifyFiltersValidMask == s_notifyFiltersValidMask, "The NotifyFilters enum has changed. The c_notifyFiltersValidMask must be updated to reflect the values of the NotifyFilters enum."); 435Debug.Fail("Unknown FileSystemEvent change type! Value: " + changeType); 584Debug.Assert(EnableRaisingEvents, "Expected EnableRaisingEvents to be true");
System\IO\FileSystemWatcher.Linux.cs (32)
177Debug.Assert(Monitor.IsEntered(s_watchersLock)); 183Debug.Assert(Monitor.IsEntered(s_watchersLock)); 207Debug.Assert(!_isThreadStopping); 220Debug.Assert(!Monitor.IsEntered(watcher)); // We mustn't hold the watcher lock prior to taking the _addLock. 295Debug.Assert(watcher.RootDirectory is null); 360Debug.Assert(!Monitor.IsEntered(removedDir.Watcher)); // We mustn't hold the watcher lock prior to taking the _addLock. 441Debug.Assert(dir.Parent is not null); // !IsRootDirectory 443Debug.Assert(idx != -1); 513Debug.Assert(_inotifyHandle.IsClosed); 789Debug.Assert(moveTo.Watcher == watcher); 823Debug.Assert(Monitor.IsEntered(watcher)); 848Debug.Assert(_buffer != null); 849Debug.Assert(_buffer.Length > 0); 850Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 851Debug.Assert(_bufferPos >= 0 && _bufferPos <= _bufferAvailable); 865Debug.Assert(_bufferAvailable <= this._buffer.Length); 871Debug.Fail("Buffer provided to read was too small"); 873Debug.Assert(_bufferAvailable >= 0); 880Debug.Assert(_bufferAvailable >= INotifyEventSize); 892Debug.Assert(_bufferPos + INotifyEventSize <= _bufferAvailable); 915Debug.Assert(position > 0); 916Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length); 1017Debug.Assert(Monitor.IsEntered(this)); 1022Debug.Assert(Monitor.IsEntered(this)); 1043Debug.Assert(_inotify is null); 1099Debug.Assert(_inotify is not null); 1178Debug.Assert(_inotify is not null); 1222Debug.Assert(ev.Type != WatcherEvent.ErrorType); 1332Debug.Assert(Monitor.IsEntered(Watcher)); 1337Debug.Assert(Monitor.IsEntered(Watcher)); 1345Debug.Assert(Monitor.IsEntered(Watcher)); 1409Debug.Assert(Monitor.IsEntered(this));
System.IO.Hashing (74)
System\IO\Hashing\Adler32.cs (5)
221Debug.Assert(!source.IsEmpty); 245Debug.Assert(source.Length >= Vector128<byte>.Count * 2); 365Debug.Assert(source.Length >= Vector256<byte>.Count); 424Debug.Assert(source.Length >= Vector512<byte>.Count); 490Debug.Assert(length is > 0 and < NMax);
System\IO\Hashing\Crc32ParameterSet.Table.cs (2)
77Debug.Assert(lookupTable.Length == 256); 104Debug.Assert(lookupTable.Length == 256);
System\IO\Hashing\Crc32ParameterSet.Vectorized.cs (1)
27Debug.Assert(shouldVectorizeScale > 0);
System\IO\Hashing\Crc32ParameterSet.WellKnown.cs (3)
137Debug.Assert(System.Runtime.Intrinsics.Arm.Crc32.Arm64.IsSupported, "ARM CRC support is required."); 159Debug.Assert(System.Runtime.Intrinsics.Arm.Crc32.IsSupported, "ARM CRC support is required."); 197Debug.Assert(Sse42.IsSupported || ArmCrc32.IsSupported);
System\IO\Hashing\Crc64ParameterSet.Table.cs (1)
77Debug.Assert(lookupTable.Length == 256);
System\IO\Hashing\CrcPolynomialHelper.cs (1)
116Debug.Assert(count >= 0);
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
281Debug.Assert(destination.Length == HashLengthInBytes);
System\IO\Hashing\XxHash128.cs (6)
255Debug.Assert(length >= 1 && length <= 3); 280Debug.Assert(length >= 4 && length <= 8); 306Debug.Assert(length >= 9 && length <= 16); 332Debug.Assert(length >= 17 && length <= 128); 358Debug.Assert(length >= 129 && length <= 240); 391Debug.Assert(length > 240);
System\IO\Hashing\XxHash3.cs (7)
226Debug.Assert(length >= 1 && length <= 3); 244Debug.Assert(length >= 4 && length <= 8); 261Debug.Assert(length >= 9 && length <= 16); 280Debug.Assert(length >= 17 && length <= 128); 309Debug.Assert(length >= 129 && length <= 240); 327Debug.Assert((length - 16 * 8) / 16 == 7); 358Debug.Assert(length > 240);
System\IO\Hashing\XxHash32.State.cs (1)
39Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHash64.State.cs (1)
50Debug.Assert(source.Length >= StripeSize);
System\IO\Hashing\XxHashShared.cs (45)
118Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 121Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 124Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 125Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 126Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 127Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 128Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 129Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 130Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 131Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 132Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 133Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 134Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 135Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 136Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 137Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 138Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 139Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 142Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 143Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 144Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 145Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 155Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 205Debug.Assert(length > 240); 221Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 222Debug.Assert(stripesSoFar < stripesPerBlock); 243Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 273Debug.Assert(sourceIndex < source.Length); 279Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 283Debug.Assert(stripesToEnd <= stripes); 302Debug.Assert(sourceIndex < source.Length); // at least some bytes left 324Debug.Assert(sourceIndex < source.Length); 325Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 326Debug.Assert(state.BufferedCount == 0); 363Debug.Assert(state.BufferedCount > 0); 792Debug.Assert(shift >= 0 && shift < 64);
System.IO.IsolatedStorage (5)
src\runtime\src\libraries\Common\src\System\Security\IdentityHelper.cs (2)
79Debug.Assert(((buff.Length % 5) == 0), "Unexpected hash length"); 119Debug.Assert(((b2 & 0xF8) == 0), "Unexpected set bits");
System\IO\IsolatedStorage\IsolatedStorageFile.cs (3)
541Debug.Assert(partialPath != null, "partialPath should be non null"); 609Debug.Assert(parentDirectory != null); 628Debug.Assert(parentDirectory != null);
System.IO.MemoryMappedFiles (24)
Microsoft\Win32\SafeMemoryMappedFileHandle.Unix.cs (1)
44Debug.Assert(!ownsFileHandle || fileHandle != null, "We can only own a FileStream we're actually given.");
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\MemoryMappedFiles\MemoryMappedFile.cs (10)
20Debug.Assert(handle != null); 21Debug.Assert(!handle.IsClosed); 22Debug.Assert(!handle.IsInvalid); 30Debug.Assert(handle != null); 31Debug.Assert(!handle.IsClosed); 32Debug.Assert(!handle.IsInvalid); 33Debug.Assert(fileHandle != null); 165Debug.Assert(handle != null); 166Debug.Assert(!handle.IsInvalid); 500Debug.Assert(access == MemoryMappedFileAccess.Write);
System\IO\MemoryMappedFiles\MemoryMappedFile.Unix.cs (3)
205Debug.Fail($"shm_open failed with ENAMETOOLONG for {Encoding.UTF8.GetByteCount(mapName)} byte long name."); 260Debug.Assert(charsWritten == 32); 263Debug.Assert(Encoding.UTF8.GetByteCount(span) <= MaxNameLength); // the standard uses Utf8
System\IO\MemoryMappedFiles\MemoryMappedView.cs (4)
18Debug.Assert(viewHandle != null); 75Debug.Assert(size >= 0); 76Debug.Assert(offset >= 0); 77Debug.Assert(allocationGranularity > 0);
System\IO\MemoryMappedFiles\MemoryMappedView.Unix.cs (2)
39Debug.Assert(pageSize > 0); 57Debug.Assert(!fd.IsInvalid);
System\IO\MemoryMappedFiles\MemoryMappedViewAccessor.cs (1)
15Debug.Assert(view != null, "view is null");
System\IO\MemoryMappedFiles\MemoryMappedViewStream.cs (1)
15Debug.Assert(view != null, "view is null");
System.IO.Packaging (67)
System\IO\Packaging\ContentType.cs (2)
216Debug.Assert(!string.IsNullOrEmpty(_type) || !string.IsNullOrEmpty(_subType)); 254Debug.Assert(!IsLinearWhiteSpaceChar(contentType[0]) && !IsLinearWhiteSpaceChar(contentType[contentType.Length - 1]));
System\IO\Packaging\InterleavedZipPackagePartStream.cs (4)
69Debug.Assert(_dir.GetStartOffset(GetCurrentPieceNumber()) == 0); 149Debug.Assert(_dir.GetStartOffset(pieceNumber) == _currentOffset + totalBytesRead); 268Debug.Assert(newLength - _dir.GetStartOffset(lastPieceNumber) >= 0); 384Debug.Assert(totalBytesWritten == buffer.Length);
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (6)
78Debug.Assert(stream != null); 79Debug.Assert(pieceStart >= 0); 113Debug.Assert(sortedPieceInfoList.Count > 0); 192Debug.Assert(pieceNumber <= _lastPieceIndex, "We should have found the valid pieceNumber earlier"); 257Debug.Assert(pieceNumber <= _lastPieceIndex); 446Debug.Assert(_pieceStreamInfoList.Count == 0);
System\IO\Packaging\InternalRelationshipCollection.cs (6)
152Debug.Assert(id != null, "id should not be null"); 176Debug.Assert(package != null, "package parameter passed should never be null"); 224Debug.Assert(_package.FileOpenAccess == FileAccess.Read || _package.FileOpenAccess == FileAccess.ReadWrite, 362Debug.Assert(!reader.IsEmptyElement, "This method should only be called if the Relationship Element is not empty"); 548Debug.Assert(targetMode == TargetMode.Internal); 549Debug.Assert(!target.IsAbsoluteUri, "Uri should be relative at this stage");
System\IO\Packaging\Package.cs (2)
401Debug.Assert((parts != null), 981Debug.Assert(index >= 0, "Given uri must be present in the dictionary");
System\IO\Packaging\PackagePart.cs (3)
331Debug.Assert(!IsStreamClosed(s)); 582Debug.Assert(!_deleted, "PackagePart.Flush should never be called on a deleted part"); 650Debug.Assert(!_deleted, "PackagePart.FlushRelationsips should never be called on a deleted part");
System\IO\Packaging\PackagePartCollection.cs (1)
54Debug.Assert(partList != null, "partDictionary parameter cannot be null");
System\IO\Packaging\PackageRelationship.cs (3)
137Debug.Assert((targetMode == TargetMode.External || !targetUri.IsAbsoluteUri), 141Debug.Assert((targetMode >= TargetMode.Internal || targetMode <= TargetMode.External), 145Debug.Assert(relationshipType.Trim() != string.Empty,
System\IO\Packaging\PackageRelationshipCollection.cs (4)
53Debug.Assert(relationships != null, "relationships parameter cannot be null"); 86Debug.Assert((enumerator != null), "Enumerator cannot be null"); 87Debug.Assert(filter != null, "PackageRelationship filter string cannot be null"); 90Debug.Assert(filter.Trim() != string.Empty,
System\IO\Packaging\PackageRelationshipSelector.cs (1)
153Debug.Fail("This option should never be called");
System\IO\Packaging\PackagingUtilities.cs (3)
31Debug.Assert(reader != null && reader.ReadState == ReadState.Initial); 85Debug.Assert(reader != null, "xmlReader should not be null"); 86Debug.Assert(reader.NodeType == XmlNodeType.Element, "XmlReader should be positioned at an Element");
System\IO\Packaging\PackUriHelper.cs (12)
209Debug.Assert((partName.Length - file.Length) > 0, 265Debug.Assert((path.Length - partNameWithoutExtension.Length - RelationshipPartExtensionName.Length - 1) > 0, 271Debug.Assert((path.Length - RelationshipPartSegmentName.Length) > 0, 348Debug.Assert(partUriString != null && partUriString.Length == 0); 353Debug.Assert(!string.IsNullOrEmpty(partUriString)); 361Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 523Debug.Assert(partUri != null, "Null reference check for this uri parameter should have been made earlier"); 524Debug.Assert(!(partUri is ValidatedPartUri), "This method should only be called when we have not already validated the part uri"); 558Debug.Assert(partName != null, "Null reference check for this partName parameter should have been made earlier"); 736Debug.Assert(!string.IsNullOrEmpty(partUriString)); 784Debug.Assert(segments.Length > 0 && segments[0].Length == 0); 787Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System\IO\Packaging\PackUriHelper.PackUriScheme.cs (2)
300Debug.Assert(packUri != null, "packUri parameter cannot be null"); 320Debug.Assert(packUri != null, "packUri parameter cannot be null");
System\IO\Packaging\PartBasedPackageProperties.cs (8)
324Debug.Assert(_xmlWriter == null); 376Debug.Assert(!initializing || reader != null); 418Debug.Assert(_propertyPart == null); // This gets called exclusively from constructor. 592Debug.Fail("Unknown value type for properties"); 739Debug.Assert(_xmlWriter != null); 768Debug.Assert(_xmlWriter != null); 773Debug.Assert(entry.Value != null); 815Debug.Assert(_xmlWriter != null);
System\IO\Packaging\XmlCompatibilityReader.cs (1)
316Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
System\IO\Packaging\XmlWrappingReader.cs (1)
21Debug.Assert(baseReader != null);
System\IO\Packaging\ZipPackage.cs (8)
429Debug.Assert(opcName != null && opcName.Length > 0); 479Debug.Fail("Encountered an invalid CompressionOption enum value"); 502Debug.Assert(zipItemName != null, "The parameter zipItemName should not be null"); 540Debug.Assert(sortedPieceInfoList != null); 735Debug.Assert(extensionA != null, "extension should not be null"); 736Debug.Assert(extensionB != null, "extension should not be null"); 747Debug.Assert(extension != null, "extension should not be null"); 1221Debug.Assert(!reader.IsEmptyElement, "This method should only be called it the Relationship Element is not empty");
System.IO.Pipelines (55)
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment is not null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
System\IO\Pipelines\BufferSegment.cs (5)
27Debug.Assert(value <= AvailableMemory.Length); 83Debug.Assert(_array != null); 109Debug.Assert(segment != null); 110Debug.Assert(Next == null); 118Debug.Assert(segment.NextSegment != null);
System\IO\Pipelines\Pipe.cs (19)
252Debug.Assert(prerented is null); 267Debug.Assert(segment.MemoryOwner is null); 268Debug.Assert(sizeHint >= 0); 318Debug.Assert(segment.MemoryOwner is null); 333Debug.Assert(prerented is null); 362Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 363Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!"); 364Debug.Assert(segment != _writingHead, "Returning _writingHead segment that's in use!"); 385Debug.Assert(_writingHead != null); 521Debug.Assert(_writerAwaitable.IsCompleted || _readerAwaitable.IsCompleted); 604Debug.Assert(_unconsumedBytes >= 0, "Length has gone negative"); 605Debug.Assert(ResumeWriterThreshold >= 1, "ResumeWriterThreshold is less than 1"); 611Debug.Assert(examinedBytes > 0); 677Debug.Assert(_writerAwaitable.IsCompleted, "PipeWriter.FlushAsync isn't completed and will deadlock"); 913Debug.Assert(completionCallbacks != null); 947Debug.Assert(completionData.SynchronizationContext != null || completionData.ExecutionContext != null); 979Debug.Assert(completionData.ExecutionContext != null); 1082Debug.Assert(_readTail != null); 1210Debug.Assert(_writingHead != null);
System\IO\Pipelines\PipeAwaitable.cs (4)
63Debug.Assert(previousAwaitableState == _awaitableState, "The awaitable state changed!"); 106Debug.Assert(_completion == null); 107Debug.Assert(_completionState == null); 108Debug.Assert(_schedulingContext == null);
System\IO\Pipelines\PipeCompletion.cs (3)
71Debug.Assert(IsCompleted); 86Debug.Assert(IsCompleted); 87Debug.Assert(_callbacks == null);
System\IO\Pipelines\PipeReaderStream.cs (1)
18Debug.Assert(pipeReader != null);
System\IO\Pipelines\PipeWriterStream.cs (1)
16Debug.Assert(pipeWriter != null);
System\IO\Pipelines\StreamPipeReader.cs (5)
271Debug.Assert(length + reader._readTail.End <= reader._readTail.AvailableMemory.Length); 493Debug.Assert(_readTail == null); 499Debug.Assert(_readTail != null); 553Debug.Assert(segment != _readHead, "Returning _readHead segment that's in use!"); 554Debug.Assert(segment != _readTail, "Returning _readTail segment that's in use!");
System\IO\Pipelines\StreamPipeWriter.cs (4)
132Debug.Assert(_tail != null); 154Debug.Assert(sizeHint >= 0); 305Debug.Assert(_tail != null); 382Debug.Assert(_tail != null);
System.IO.Pipes (28)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
52Debug.Assert(!IsInvalid); 110Debug.Assert(socket != null);
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
70Debug.Assert(passwd.Name != null);
System\IO\Pipes\AnonymousPipeClientStream.cs (2)
65Debug.Assert(direction != PipeDirection.InOut, "anonymous pipes are unidirectional, caller should have verified before calling Init"); 66Debug.Assert(safePipeHandle != null && !safePipeHandle.IsInvalid, "safePipeHandle must be valid");
System\IO\Pipes\AnonymousPipeServerStream.Unix.cs (1)
17Debug.Assert(direction != PipeDirection.InOut, "Anonymous pipe direction shouldn't be InOut");
System\IO\Pipes\NamedPipeServerStream.Unix.cs (11)
28Debug.Assert(!string.IsNullOrEmpty(pipeName), "fullPipeName is null or empty"); 29Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 30Debug.Assert(inBufferSize >= 0, "inBufferSize is negative"); 31Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 32Debug.Assert((maxNumberOfServerInstances >= 1) || (maxNumberOfServerInstances == MaxAllowedServerInstances), "maxNumberOfServerInstances is invalid"); 33Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 252Debug.Assert(!string.IsNullOrEmpty(path)); 253Debug.Assert(maxCount >= 1); 292Debug.Assert(server._currentCount >= 0 && server._currentCount < server._maxCount); 302Debug.Assert(_currentCount >= 1 && _currentCount <= _maxCount); 307Debug.Assert(removed);
System\IO\Pipes\PipeStream.cs (5)
59Debug.Assert(direction >= PipeDirection.In && direction <= PipeDirection.InOut, "invalid pipe direction"); 60Debug.Assert(transmissionMode >= PipeTransmissionMode.Byte && transmissionMode <= PipeTransmissionMode.Message, "transmissionMode is out of range"); 61Debug.Assert(outBufferSize >= 0, "outBufferSize is negative"); 107Debug.Assert(handle != null, "handle is null"); 108Debug.Assert(!handle.IsClosed, "handle is closed");
System\IO\Pipes\PipeStream.Unix.cs (3)
258Debug.Assert(_handle != null); 282Debug.Assert(_handle != null); 322Debug.Assert(bytesWritten > 0 && bytesWritten <= source.Length);
System.IO.Ports (25)
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
System\IO\Ports\SafeSerialDeviceHandle.Unix.cs (2)
21Debug.Assert(portName != null); 42Debug.Assert(result == 0, $"Close failed with result {result} and error {Interop.Sys.GetLastErrorInfo()}");
System\IO\Ports\SerialPort.cs (13)
689Debug.Assert(CachedBytesToRead == 0, "there should be nothing left in our internal buffer"); 721Debug.Assert(IsOpen, "ReadOneChar - port not open"); 817Debug.Assert(IsOpen, "port not open!"); 818Debug.Assert(buffer != null, "invalid buffer!"); 819Debug.Assert(offset >= 0, "invalid offset!"); 820Debug.Assert(count >= 0, "invalid count!"); 821Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!"); 889Debug.Assert(count != 0, "Count should never be zero. We will probably see bugs further down if count is 0."); 933Debug.Assert((lastFullCharPos + currentBytesToExamine) <= _readLen, "We should never be attempting to read more bytes than we have"); 951Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!"); 1102Debug.Assert((char.IsSurrogate(_singleCharBuffer[i])), "number of chars read should be more than one only for surrogate characters!"); 1105Debug.Assert((numCharsRead > 0), "possible bug in ReadBufferIntoChars, reading surrogate char?"); 1332Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System\IO\Ports\SerialStream.Unix.cs (8)
277Debug.Assert(!(value < Handshake.None || value > Handshake.RequestToSendXOnXOff), 296Debug.Assert(!(value < MinDataBits || value > MaxDataBits), "An invalid value was passed to DataBits"); 313Debug.Assert(!(value < Parity.None || value > Parity.Space), "An invalid value was passed to Parity"); 331Debug.Assert(!(value < StopBits.One || value > StopBits.OnePointFive), "An invalid value was passed to StopBits"); 532Debug.Fail("This should not happen"); 681Debug.Assert(_handle != null); 853Debug.Assert(ret >= 0); 1131Debug.Assert(Buffer.Length == 0);
System.Linq (223)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Linq\AppendPrepend.cs (8)
46Debug.Assert(source is not null); 52Debug.Assert(_enumerator is null); 62Debug.Assert(_enumerator is not null); 179Debug.Assert(prepended is not null || appended is not null); 180Debug.Assert(prependCount > 0 || appendCount > 0); 181Debug.Assert(prependCount + appendCount >= 2); 182Debug.Assert((prepended?.GetCount() ?? 0) == prependCount); 183Debug.Assert((appended?.GetCount() ?? 0) == appendCount);
System\Linq\AppendPrepend.SpeedOpt.cs (2)
15Debug.Assert(GetCount(onlyIfCheap: true) == -1); 189Debug.Assert(GetCount(onlyIfCheap: true) == -1);
System\Linq\Cast.cs (1)
62Debug.Assert(_enumerator is not null);
System\Linq\Chunk.cs (1)
111Debug.Assert(local.Length == size);
System\Linq\Concat.cs (10)
61Debug.Assert(first is not null); 62Debug.Assert(second is not null); 80Debug.Assert(index >= 0 && index <= 2); 142Debug.Assert(tail is not null); 143Debug.Assert(head is not null); 144Debug.Assert(headIndex >= 2); 172Debug.Assert(index >= 0); 190Debug.Assert(index == 0 || index == 1); 191Debug.Assert(node._tail is Concat2Iterator<TSource>); 243Debug.Assert(_enumerator is not null);
System\Linq\Concat.SpeedOpt.cs (7)
177Debug.Assert(!_hasOnlyCollections || collection is not null); 187Debug.Assert(node._tail is Concat2Iterator<TSource>); 197Debug.Assert(!_hasOnlyCollections); 229Debug.Assert(_hasOnlyCollections); 232Debug.Assert(count >= 0); 346Debug.Assert(node._tail is Concat2Iterator<TSource>); 363Debug.Assert(node._tail is Concat2Iterator<TSource>);
System\Linq\DefaultIfEmpty.cs (2)
37Debug.Assert(source is not null); 63Debug.Assert(_enumerator is not null);
System\Linq\Distinct.cs (3)
104Debug.Assert(source is not null); 130Debug.Assert(_enumerator is not null); 131Debug.Assert(_set is not null);
System\Linq\ElementAt.cs (2)
130Debug.Assert(source is not null); 153Debug.Assert(source is not null);
System\Linq\Grouping.cs (13)
161Debug.Assert(_g is not null); 162Debug.Assert(_lookup is not null); 175Debug.Assert(_g is not null); 217Debug.Assert(_g is not null); 218Debug.Assert(_lookup is not null); 231Debug.Assert(_g is not null); 273Debug.Assert(_g is not null); 274Debug.Assert(_lookup is not null); 287Debug.Assert(_g is not null); 326Debug.Assert(_g is not null); 327Debug.Assert(_lookup is not null); 340Debug.Assert(_g is not null); 391Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\Lookup.cs (10)
86Debug.Assert(source is not null); 87Debug.Assert(keySelector is not null); 88Debug.Assert(elementSelector is not null); 101Debug.Assert(source is not null); 102Debug.Assert(keySelector is not null); 153Debug.Assert(g is not null); 172Debug.Assert(g is not null); 179Debug.Assert(index == _count, "All list elements were not initialized."); 194Debug.Assert(g is not null); 297Debug.Assert(g is not null);
System\Linq\Lookup.SpeedOpt.cs (1)
21Debug.Assert(g is not null);
System\Linq\OfType.cs (1)
47Debug.Assert(_enumerator is not null);
System\Linq\OfType.SpeedOpt.cs (1)
159Debug.Assert(o is TResult);
System\Linq\OrderedEnumerable.cs (17)
128Debug.Assert(_buffer is not null); 129Debug.Assert(_map is not null); 130Debug.Assert(_map.Length == _buffer.Length); 173Debug.Assert(TypeIsImplicitlyStable<TElement>()); 202Debug.Assert(buffer is not null); 415Debug.Assert(typeof(TKey) == typeof(TElement)); 425Debug.Assert(keys is not null); 446Debug.Assert(typeof(TKey).IsValueType); 447Debug.Assert(_comparer == Comparer<TKey>.Default); 448Debug.Assert(_next is null); 449Debug.Assert(!_descending); 452Debug.Assert(keys is not null); 462Debug.Assert(typeof(TKey).IsValueType); 463Debug.Assert(_comparer == Comparer<TKey>.Default); 464Debug.Assert(_next is null); 465Debug.Assert(_descending); 468Debug.Assert(keys is not null);
System\Linq\OrderedEnumerable.SpeedOpt.cs (3)
392Debug.Assert(TypeIsImplicitlyStable<TElement>(), "Using Min/Max has different semantics for floating-point values."); 467Debug.Assert(_buffer is not null); 468Debug.Assert(_map is not null);
System\Linq\PartialArrayEnumerator.cs (1)
19Debug.Assert(array is not null);
System\Linq\Range.cs (2)
39Debug.Assert(int.CreateChecked(endExclusive - start) >= 0); 53Debug.Assert(_start != _endExclusive);
System\Linq\Repeat.cs (1)
37Debug.Assert(count > 0);
System\Linq\Repeat.SpeedOpt.cs (3)
38Debug.Assert(count > 0); 50Debug.Assert(count > 0); 86Debug.Assert(_count > 0);
System\Linq\Reverse.cs (3)
64Debug.Assert(source is not null); 78Debug.Assert(_state == -1 || _state == 0); 100Debug.Assert(_buffer is not null);
System\Linq\SegmentedArrayBuilder.cs (1)
62Debug.Assert(segmentsCount > 0);
System\Linq\Select.cs (11)
120Debug.Assert(source is not null); 121Debug.Assert(selector is not null); 149Debug.Assert(_enumerator is not null); 180Debug.Assert(source is not null); 181Debug.Assert(selector is not null); 182Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 224Debug.Assert(source is not null); 225Debug.Assert(selector is not null); 274Debug.Assert(source is not null); 275Debug.Assert(selector is not null); 293Debug.Assert(_enumerator is not null);
System\Linq\Select.SizeOpt.cs (3)
43Debug.Assert(count > 0); 49Debug.Assert(count > 0); 62Debug.Assert(_enumerator is not null);
System\Linq\Select.SpeedOpt.cs (35)
145Debug.Assert(source.Length > 0); 156Debug.Assert(source.Length > 0); 190Debug.Assert(count > 0); 201Debug.Assert(count > 0); 222Debug.Assert(_source.Length > 0); // See assert in constructor 230Debug.Assert(_source.Length > 0); // See assert in constructor 258Debug.Assert(start is not null); 259Debug.Assert(end is not null); 260Debug.Assert(selector is not null); 261Debug.Assert(uint.CreateTruncating(end - start) <= (uint)int.MaxValue); 282Debug.Assert(_start < _end - T.CreateChecked(index)); 332Debug.Assert(count > 0); 344Debug.Assert(count > 0); 368Debug.Assert(_end > _start); 375Debug.Assert(_end > _start); 448Debug.Assert(count > 0); 454Debug.Assert(count > 0); 566Debug.Assert(count > 0); 572Debug.Assert(count > 0); 642Debug.Assert(source is not null); 643Debug.Assert(selector is not null); 660Debug.Assert(_enumerator is not null); 690Debug.Assert(count > 0); 697Debug.Assert(count > 0); 728Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 747Debug.Assert(count > 0); 748Debug.Assert(count == _source.GetCount(onlyIfCheap: true)); 768Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 815Debug.Assert(index == results.Length, "All list elements were not initialized."); 855Debug.Assert(source is not null); 856Debug.Assert(selector is not null); 857Debug.Assert(minIndexInclusive >= 0); 858Debug.Assert(minIndexInclusive <= maxIndexInclusive); 890Debug.Assert(count > 0); 897Debug.Assert(count > 0);
System\Linq\SelectMany.cs (4)
155Debug.Assert(source is not null); 156Debug.Assert(selector is not null); 195Debug.Assert(_sourceEnumerator is not null); 209Debug.Assert(_subEnumerator is not null);
System\Linq\Sequence.cs (2)
124Debug.Assert(step > T.Zero); 150Debug.Assert(step < T.Zero);
System\Linq\Shuffle.cs (2)
38Debug.Assert(source is not null); 52Debug.Assert(buffer is not null);
System\Linq\Shuffle.SpeedOpt.cs (5)
101Debug.Assert(source is not null); 102Debug.Assert(takeCount > 0); 118Debug.Assert(buffer is not null); 209Debug.Assert(listCount > takeCount, "Known listCount <= takeCount should have been handled by Iterator.Take override"); 355Debug.Assert(_takeCount > 0, $"Expected positive {nameof(_takeCount)}.");
System\Linq\SingleLinkedNode.cs (4)
30Debug.Assert(linked is not null); 74Debug.Assert(index >= 0 && index < GetCount()); 80Debug.Assert(node is not null); 92Debug.Assert(count == GetCount());
System\Linq\SkipTake.SpeedOpt.cs (18)
24Debug.Assert(source is not null); 25Debug.Assert(minIndexInclusive >= 0); 26Debug.Assert(minIndexInclusive <= maxIndexInclusive); 231Debug.Assert(source is not null); 232Debug.Assert(!(source is IList<TSource>), $"The caller needs to check for {nameof(IList<TSource>)}."); 233Debug.Assert(minIndexInclusive >= 0); 234Debug.Assert(maxIndexInclusive >= -1); 238Debug.Assert(maxIndexInclusive == -1 || (maxIndexInclusive - minIndexInclusive < int.MaxValue), $"{nameof(Limit)} will overflow!"); 239Debug.Assert(maxIndexInclusive == -1 || minIndexInclusive <= maxIndexInclusive); 291Debug.Assert(count != (uint)int.MaxValue + 1 || _minIndexInclusive > 0, "Our return value will be incorrect."); 313Debug.Assert(_enumerator is not null); 323Debug.Assert(_enumerator is not null); 366Debug.Assert(minIndex >= 0, $"We should have taken care of all cases when {nameof(minIndex)} overflows."); 394Debug.Assert(maxIndex >= 0, $"We should have taken care of all cases when {nameof(maxIndex)} overflows."); 403Debug.Assert(_minIndexInclusive + index >= 0, $"Adding {nameof(index)} caused {nameof(_minIndexInclusive)} to overflow."); 424Debug.Assert(!HasLimit || Limit > 0); 550Debug.Assert(index >= 0); 556Debug.Assert(en is not null);
System\Linq\Sum.cs (3)
82Debug.Assert(span.Length >= Vector<T>.Count * 4); 83Debug.Assert(Vector<T>.Count > 2); 84Debug.Assert(Vector.IsHardwareAccelerated);
System\Linq\Take.cs (8)
54Debug.Assert(startIndex >= 0); 55Debug.Assert(endIndex >= 0); 79Debug.Assert(source is not null); 80Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 81Debug.Assert(isStartIndexFromEnd 142Debug.Assert(queue.Count == Math.Min(count, startIndex)); 147Debug.Assert(endIndex - startIndex <= queue.Count); 156Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\Take.SpeedOpt.cs (4)
13Debug.Assert(source is not null && !IsEmptyArray(source)); 14Debug.Assert(count > 0); 24Debug.Assert(source is not null && !IsEmptyArray(source)); 25Debug.Assert(startIndex >= 0 && startIndex < endIndex);
System\Linq\ThrowHelper.cs (1)
67Debug.Fail("The ExceptionArgument value is not defined.");
System\Linq\Union.cs (8)
137Debug.Assert(_enumerator is not null); 148Debug.Assert(_enumerator is not null); 149Debug.Assert(_set is not null); 220Debug.Assert(first is not null); 221Debug.Assert(second is not null); 230Debug.Assert(index >= 0 && index <= 2); 258Debug.Assert(headIndex >= 2); 259Debug.Assert(sources?.GetCount() == headIndex + 1);
System\Linq\Where.cs (17)
102Debug.Assert(source is not null); 103Debug.Assert(predicate is not null); 130Debug.Assert(_enumerator is not null); 166Debug.Assert(source is not null && source.Length > 0); 167Debug.Assert(predicate is not null); 214Debug.Assert(source is not null); 215Debug.Assert(predicate is not null); 269Debug.Assert(source is not null && source.Length > 0); 270Debug.Assert(predicate is not null); 271Debug.Assert(selector is not null); 318Debug.Assert(source is not null); 319Debug.Assert(predicate is not null); 320Debug.Assert(selector is not null); 373Debug.Assert(source is not null); 374Debug.Assert(predicate is not null); 375Debug.Assert(selector is not null); 404Debug.Assert(_enumerator is not null);
System\Linq\Where.SizeOpt.cs (2)
19Debug.Assert(source is not null); 20Debug.Assert(predicate is not null);
System.Linq.AsyncEnumerable (59)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Linq\Append.cs (8)
40Debug.Assert(source is not null); 46Debug.Assert(_enumerator is null); 56Debug.Assert(_enumerator is not null); 176Debug.Assert(prepended is not null || appended is not null); 177Debug.Assert(prependCount > 0 || appendCount > 0); 178Debug.Assert(prependCount + appendCount >= 2); 179Debug.Assert((prepended?.GetCount() ?? 0) == prependCount); 180Debug.Assert((appended?.GetCount() ?? 0) == appendCount);
System\Linq\Chunk.cs (1)
79Debug.Assert(local.Length == size);
System\Linq\Concat.cs (10)
63Debug.Assert(first is not null); 64Debug.Assert(second is not null); 79Debug.Assert(index >= 0); 127Debug.Assert(tail is not null); 128Debug.Assert(head is not null); 129Debug.Assert(headIndex >= 2); 155Debug.Assert(index >= 0); 173Debug.Assert(index == 0 || index == 1); 174Debug.Assert(node._tail is Concat2AsyncIterator<TSource>); 226Debug.Assert(_enumerator is not null);
System\Linq\GroupBy.cs (1)
426Debug.Assert(_count > 0, "A grouping should only have been created if an element was being added to it.");
System\Linq\OrderBy.cs (13)
229Debug.Assert(keySelector is Func<TElement, TKey> or Func<TElement, CancellationToken, ValueTask<TKey>>); 327Debug.Assert(typeof(TKey) == typeof(TElement)); 357Debug.Assert(keys is not null); 389Debug.Assert(typeof(TKey).IsValueType); 390Debug.Assert(_comparer == Comparer<TKey>.Default); 391Debug.Assert(_next is null); 392Debug.Assert(!_descending); 395Debug.Assert(keys is not null); 405Debug.Assert(typeof(TKey).IsValueType); 406Debug.Assert(_comparer == Comparer<TKey>.Default); 407Debug.Assert(_next is null); 408Debug.Assert(_descending); 411Debug.Assert(keys is not null);
System\Linq\Sequence.cs (2)
98Debug.Assert(step > T.Zero); 124Debug.Assert(step < T.Zero);
System\Linq\SingleLinkedNode.cs (4)
30Debug.Assert(linked is not null); 74Debug.Assert(index >= 0 && index < GetCount()); 80Debug.Assert(node is not null); 92Debug.Assert(count == GetCount());
System\Linq\Take.cs (10)
74Debug.Assert(startIndex >= 0); 75Debug.Assert(endIndex >= 0); 97Debug.Assert(source is not null); 98Debug.Assert(startIndex >= 0 && startIndex < endIndex); 129Debug.Assert(source is not null); 130Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 131Debug.Assert(isStartIndexFromEnd 173Debug.Assert(queue.Count == Math.Min(count, startIndex)); 178Debug.Assert(endIndex - startIndex <= queue.Count); 187Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\ToLookupAsync.cs (7)
291Debug.Assert(source is not null); 292Debug.Assert(keySelector is not null); 313Debug.Assert(source is not null); 314Debug.Assert(keySelector is not null); 344Debug.Assert(g is not null); 434Debug.Assert(g is not null); 453Debug.Assert(g is not null);
System.Linq.Expressions (489)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ArrayBuilder.cs (7)
25Debug.Assert(capacity >= 0); 54Debug.Assert(index >= 0 && index < _count); 78Debug.Assert(_count > 0); 87Debug.Assert(_count > 0); 104Debug.Assert(_array != null); // Nonzero _count should imply this 134Debug.Assert(_count < Capacity); 141Debug.Assert(minimum > Capacity);
System\Dynamic\BindingRestrictions.cs (5)
77Debug.Assert(obj != null); 241Debug.Assert(expression != null); 262Debug.Assert(parameter != null); 263Debug.Assert(type != null); 285Debug.Assert(parameter != null);
System\Dynamic\DynamicMetaObject.cs (1)
264Debug.Assert(expr != null, "Unexpected null expression; ctor should have caught this.");
System\Dynamic\DynamicObject.cs (3)
579Debug.Assert(binder is ConvertBinder && fallbackInvoke == null); 583Debug.Assert(convert.Method == null); 835Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\ExpandoObject.cs (7)
144Debug.Assert(data[exactMatch] == Uninitialized); 154Debug.Assert(index != ExpandoObject.NoMatch); 242Debug.Assert(index >= 0 && index <= _data.Length); 265Debug.Assert(oldClass != newClass); 930Debug.Assert(originalClass != klass); 982Debug.Assert(index != ExpandoObject.NoMatch); 1010Debug.Assert(Restrictions == BindingRestrictions.Empty, "We don't merge, restrictions are always empty");
System\Dynamic\Utils\ContractUtils.cs (8)
22Debug.Fail("Unreachable"); 41Debug.Assert(!string.IsNullOrEmpty(paramName)); 67Debug.Assert(!string.IsNullOrEmpty(paramName)); 110Debug.Assert(!string.IsNullOrEmpty(arrayName)); 125Debug.Assert(Monitor.IsEntered(lockObject), "Expected lock is not held."); 137Debug.Assert(!string.IsNullOrEmpty(offsetName)); 138Debug.Assert(!string.IsNullOrEmpty(countName)); 139Debug.Assert(array != null);
System\Dynamic\Utils\ExpressionUtils.cs (3)
102Debug.Assert(nodeKind == ExpressionType.Invoke || nodeKind == ExpressionType.Call || nodeKind == ExpressionType.Dynamic || nodeKind == ExpressionType.New); 245Debug.Assert(current != null); 261Debug.Assert(current != null);
System\Dynamic\Utils\ListArgumentProvider.cs (1)
97Debug.Assert(n > 0);
System\Dynamic\Utils\TypeExtensions.cs (2)
24Debug.Assert(types != null); 40Debug.Assert(argTypes != null);
System\Dynamic\Utils\TypeUtils.cs (26)
27Debug.Assert(type != null, "type cannot be null"); 95Debug.Assert(nullableType.IsNullableType()); 290Debug.Assert(source != null && dest != null); 321Debug.Assert(source != null && dest != null); 359Debug.Assert(source != typeof(object) && dest != typeof(object)); 441Debug.Assert(source.IsArray); 468Debug.Assert(dest.IsSZArray); 495Debug.Assert(t != null); 501Debug.Assert(t != null); 507Debug.Assert(t != null); 513Debug.Assert(t != null); 519Debug.Assert(source != null && dest != null); 547Debug.Assert(genericParameters != null); 548Debug.Assert(sourceArguments != null); 549Debug.Assert(destArguments != null); 550Debug.Assert(genericParameters.Length == sourceArguments.Length); 551Debug.Assert(genericParameters.Length == destArguments.Length); 558Debug.Assert(sourceArgument != null && destArgument != null); 568Debug.Assert(genericParameter != null); 670Debug.Assert(left.IsValueType); 868Debug.Assert(!definition.IsInterface); 896Debug.Assert(name == "op_False" || name == "op_True"); 969Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 1010Debug.Assert(arrayType.IsArray); 1018Debug.Assert(arrayType.IsArray); 1026Debug.Assert(arrayType.IsArray);
System\Linq\Expressions\BinaryExpression.cs (13)
137Debug.Assert(IsOpAssignment(op)); 315Debug.Assert(nodeType != ExpressionType.Assign); 318Debug.Assert(method == null && TypeUtils.AreEquivalent(type, right.Type) && nodeType == ExpressionType.Coalesce); 395Debug.Assert(IsLiftedLogical); 401Debug.Assert(opTrueFalse != null); 633System.Diagnostics.Debug.Assert(method != null); 763Debug.Assert(method != null); 1393Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1400Debug.Assert(pms.Length == conversion.ParameterCount); 1549Debug.Assert(typeof(System.MulticastDelegate).IsAssignableFrom(delegateType) && delegateType != typeof(System.MulticastDelegate)); 1552Debug.Assert(pms.Length == conversion.ParameterCount); 1561Debug.Assert(method != null); 2750Debug.Assert(method != null);
System\Linq\Expressions\BlockExpression.cs (31)
210Debug.Assert(expressions != null); 241Debug.Assert(args != null); 242Debug.Assert(args.Length == 2); 243Debug.Assert(variables == null || variables.Count == 0); 263Debug.Assert(expressions != null); 307Debug.Assert(args != null); 308Debug.Assert(args.Length == 3); 309Debug.Assert(variables == null || variables.Count == 0); 330Debug.Assert(expressions != null); 379Debug.Assert(args != null); 380Debug.Assert(args.Length == 4); 381Debug.Assert(variables == null || variables.Count == 0); 414Debug.Assert(expressions != null); 457Debug.Assert(args != null); 458Debug.Assert(args.Length == 5); 459Debug.Assert(variables == null || variables.Count == 0); 471Debug.Assert(expressions.Count != 0); 481Debug.Assert(index >= 0 && index < _expressions.Count); 495Debug.Assert(variables == null || variables.Count == 0); 496Debug.Assert(args != null); 554Debug.Assert(expressions != null); 590Debug.Assert(variables!.Count == Variables.Count); 594Debug.Assert(args.Length == 1); 595Debug.Assert(variables == null || variables.Count == Variables.Count); 629Debug.Assert(variables!.Count == Variables.Count); 633Debug.Assert(args.Length == ExpressionCount); 634Debug.Assert(variables == null || variables.Count == Variables.Count); 654Debug.Assert(variables!.Count == Variables.Count); 658Debug.Assert(args.Length == ExpressionCount); 659Debug.Assert(variables == null || variables.Count == Variables.Count); 770Debug.Assert(n > 0);
System\Linq\Expressions\Compiler\BoundConstants.cs (1)
97Debug.Assert(!ILGen.CanEmitConstant(value, type));
System\Linq\Expressions\Compiler\CompilerScope.cs (3)
187Debug.Assert(locals != null); 288Debug.Assert(_parent == null && parent != this); 402Debug.Assert(ShouldCache(v) && !_locals.ContainsKey(v));
System\Linq\Expressions\Compiler\DelegateHelpers.Generated.cs (2)
136Debug.Assert(types != null && types.Length > 0); 183Debug.Assert(result != null);
System\Linq\Expressions\Compiler\ILGen.cs (45)
21Debug.Assert(methodBase is MethodInfo || methodBase is ConstructorInfo); 38Debug.Assert(index >= 0); 39Debug.Assert(index < ushort.MaxValue); 46Debug.Assert(index >= 0); 47Debug.Assert(index < ushort.MaxValue); 54Debug.Assert(index >= 0); 55Debug.Assert(index < ushort.MaxValue); 65Debug.Assert(type != null); 118Debug.Assert(type != null); 163Debug.Assert(type != null); 215Debug.Assert(type != null); 258Debug.Assert(type != null); 270Debug.Assert(fi != null); 277Debug.Assert(fi != null); 284Debug.Assert(fi != null); 291Debug.Assert(ci != null); 292Debug.Assert(!ci.DeclaringType!.ContainsGenericParameters); 308Debug.Assert(value != null); 484Debug.Assert(value != null); 559Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 603Debug.Assert(!typeTo.IsValueType); 652Debug.Assert(typeFrom != typeTo); 789Debug.Assert(typeFrom.IsNullableType()); 790Debug.Assert(typeTo.IsNullableType()); 823Debug.Assert(!typeFrom.IsNullableType()); 824Debug.Assert(typeTo.IsNullableType()); 833Debug.Assert(typeFrom.IsNullableType()); 834Debug.Assert(!typeTo.IsNullableType()); 844Debug.Assert(typeFrom.IsNullableType()); 845Debug.Assert(!typeTo.IsNullableType()); 846Debug.Assert(typeTo.IsValueType); 859Debug.Assert(typeFrom.IsNullableType()); 870Debug.Assert(isTypeFromNullable || isTypeToNullable); 881Debug.Assert(nullableType.IsNullableType()); 884Debug.Assert(nullableType.IsValueType); 890Debug.Assert(nullableType.IsNullableType()); 893Debug.Assert(nullableType.IsValueType); 899Debug.Assert(nullableType.IsNullableType()); 902Debug.Assert(nullableType.IsValueType); 936Debug.Assert(elementType != null); 937Debug.Assert(count >= 0); 952Debug.Assert(arrayType != null); 953Debug.Assert(arrayType.IsArray); 967Debug.Assert(ci != null); 1069Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Compiler\LabelInfo.cs (1)
382Debug.Assert(CanJumpInto);
System\Linq\Expressions\Compiler\LambdaCompiler.Address.cs (6)
24Debug.Assert(node != null); 68Debug.Assert(node.NodeType == ExpressionType.ArrayIndex && node.Method == null); 74Debug.Assert(node.Right.Type == typeof(int)); 209Debug.Assert(node.NodeType == ExpressionType.Unbox); 210Debug.Assert(type.IsValueType); 219Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type));
System\Linq\Expressions\Compiler\LambdaCompiler.Binary.cs (21)
24Debug.Assert(b.NodeType != ExpressionType.AndAlso && b.NodeType != ExpressionType.OrElse && b.NodeType != ExpressionType.Coalesce); 41Debug.Assert(!b.IsLiftedToNull || b.Type == typeof(bool?)); 71Debug.Assert(e.Type.IsNullableType()); 72Debug.Assert(op == ExpressionType.Equal || op == ExpressionType.NotEqual); 107Debug.Assert(mc.Type == typeof(bool)); 108Debug.Assert(b.NodeType == ExpressionType.Equal 118Debug.Assert(TypeUtils.AreReferenceAssignable(p1.Type, b.Left.Type.GetNonNullableType())); 119Debug.Assert(TypeUtils.AreReferenceAssignable(p2.Type, b.Right.Type.GetNonNullableType())); 131Debug.Assert(op != ExpressionType.Coalesce); 134Debug.Assert(rightType == typeof(int)); 150Debug.Assert(!leftType.IsNullableType()); 151Debug.Assert(!rightType.IsNullableType()); 152Debug.Assert(leftType.IsPrimitive || (op == ExpressionType.Equal || op == ExpressionType.NotEqual) && (!leftType.IsValueType || leftType.IsEnum)); 237Debug.Assert(rightType == typeof(int)); 242Debug.Assert(rightType == typeof(int)); 268Debug.Assert(!resultType.IsNullableType()); 289Debug.Assert(leftType.IsNullableType() || rightType.IsNullableType()); 331Debug.Assert(leftType == rightType); 334Debug.Assert(resultType == typeof(bool?)); 339Debug.Assert(resultType == typeof(bool)); 422Debug.Assert(leftIsNullable || rightIsNullable);
System\Linq\Expressions\Compiler\LambdaCompiler.ControlFlow.cs (3)
47Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 54Debug.Assert(node.Target != null); 72Debug.Assert(label != null);
System\Linq\Expressions\Compiler\LambdaCompiler.cs (5)
231Debug.Assert(local != null); 256Debug.Assert(_hasClosureArgument, "must have a Closure argument"); 257Debug.Assert(_method.IsStatic, "must be a static method"); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (25)
39Debug.Assert(newValue == CompilationFlags.EmitAsTail || newValue == CompilationFlags.EmitAsMiddle || newValue == CompilationFlags.EmitAsNoTail); 49Debug.Assert(newValue == CompilationFlags.EmitExpressionStart || newValue == CompilationFlags.EmitNoExpressionStart); 59Debug.Assert(newValue == CompilationFlags.EmitAsDefaultType || newValue == CompilationFlags.EmitAsVoidType); 85Debug.Assert(node != null); 136Debug.Assert(TypeUtils.AreReferenceAssignable(type, node.Type)); 214Debug.Assert(wb.Count > 0); 251Debug.Assert(!node.IsByRef); 376Debug.Assert(obj != null); 516Debug.Assert(args.ArgumentCount + skipParameters == pis.Length); 567Debug.Assert(value != null); 588Debug.Assert(_method is DynamicMethod); 616Debug.Assert(siteType.IsGenericType && siteType.GetGenericTypeDefinition() == typeof(CallSite<>)); 635Debug.Assert(node.ArgumentCount == 0, "Node with arguments must have a constructor."); 636Debug.Assert(node.Type.IsValueType, "Only value type may have constructor not set."); 681Debug.Assert(!type.IsValueType); 688Debug.Assert(result == AnalyzeTypeIsResult.Unknown); 787Debug.Assert(!node.IsByRef); 819Debug.Assert(member is PropertyInfo); 863Debug.Assert(member is PropertyInfo); 881Debug.Assert(instance.NodeType == ExpressionType.Parameter); 882Debug.Assert(type!.IsValueType); 966Debug.Assert(binding.Member is PropertyInfo); 1104Debug.Assert(member is FieldInfo || member is PropertyInfo); 1114Debug.Assert(TypeUtils.AreEquivalent(resultType.GetNonNullableType(), mc.Type.GetNonNullableType())); 1186Debug.Assert(nodeType == ExpressionType.LessThan
System\Linq\Expressions\Compiler\LambdaCompiler.Generated.cs (1)
24Debug.Assert(node != null);
System\Linq\Expressions\Compiler\LambdaCompiler.Lambda.cs (4)
28Debug.Assert(_method is DynamicMethod); 99Debug.Assert(dynamicMethod != null); 133Debug.Assert(_method is DynamicMethod); 246Debug.Assert(_labelBlock.Parent == null && _labelBlock.Kind == LabelScopeKind.Lambda);
System\Linq\Expressions\Compiler\LambdaCompiler.Logical.cs (18)
18Debug.Assert(node.Test.Type == typeof(bool)); 89Debug.Assert(b.Method == null); 97Debug.Assert(!b.Left.Type.IsValueType); 112Debug.Assert(b.Method == null); 126Debug.Assert(b.Conversion.ParameterCount == 1); 128Debug.Assert(p.Type.IsAssignableFrom(b.Left.Type) || 189Debug.Assert(b.Conversion!.ParameterCount == 1); 226Debug.Assert(!b.Left.Type.IsValueType); 282Debug.Assert(opFalse != null, "factory should check that the method exists"); 295Debug.Assert(b.Method.IsStatic); 395Debug.Assert(opTrue != null, "factory should check that the method exists"); 408Debug.Assert(b.Method.IsStatic); 522Debug.Assert(node.NodeType == ExpressionType.Equal || node.NodeType == ExpressionType.NotEqual); 523Debug.Assert(!node.IsLiftedToNull); 544Debug.Assert(!node.Right.Type.IsValueType); 558Debug.Assert(!node.Left.Type.IsValueType); 597Debug.Assert(node.NodeType == ExpressionType.AndAlso || node.NodeType == ExpressionType.OrElse); 598Debug.Assert(!node.IsLiftedToNull);
System\Linq\Expressions\Compiler\LambdaCompiler.Statements.cs (6)
107Debug.Assert(_scope.Node == node); 179Debug.Assert(node.Type == typeof(void)); 222Debug.Assert(TypeUtils.AreReferenceAssignable(testValue.Type, test.Type)); 295Debug.Assert(key > buckets[buckets.Count - 1].Key); 623Debug.Assert(key == bucket[bucket.Count - 1].Key + 1); 624Debug.Assert(slot == jmpLabels.Length);
System\Linq\Expressions\Compiler\LambdaCompiler.Unary.cs (7)
34Debug.Assert(typeof(LambdaExpression).IsAssignableFrom(quote.Type)); 75Debug.Assert(type == node.Operand.Type); 149Debug.Assert(TypeUtils.AreEquivalent(operandType, resultType)); 274Debug.Assert(node.Type.IsValueType); 309Debug.Assert(pis != null && pis.Length == 1); 317Debug.Assert(operand.Method == null); 321Debug.Assert(node.Method == null);
System\Linq\Expressions\Compiler\StackSpiller.ChildRewriter.cs (3)
122Debug.Assert(!_done); 379Debug.Assert(_comma!.Capacity == _comma.Count + 1); 450Debug.Assert(first == 0);
System\Linq\Expressions\Compiler\StackSpiller.cs (9)
133Debug.Assert(result.Node != null); 136Debug.Assert((result.Action == RewriteAction.None) ^ (node != result.Node), "rewrite action does not match node object identity"); 139Debug.Assert(result.Node.NodeType != ExpressionType.Extension, "extension nodes must be rewritten"); 142Debug.Assert( 150Debug.Assert( 605Debug.Assert(node.NodeType != ExpressionType.Quote, "unexpected Quote"); 606Debug.Assert(node.NodeType != ExpressionType.Throw, "unexpected Throw"); 1031Debug.Assert(original != null); 1032Debug.Assert(max < original.Count);
System\Linq\Expressions\Compiler\StackSpiller.Temps.cs (6)
143Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 144Debug.Assert(_usedTemps == null || !_usedTemps.Contains(temp)); 160Debug.Assert(_freeTemps == null || !_freeTemps.Contains(temp)); 190Debug.Assert(_usedTemps == null || mark <= _usedTemps.Count); 192Debug.Assert(mark == 0 || _usedTemps != null); 211Debug.Assert(_usedTemps == null || _usedTemps.Count == 0);
System\Linq\Expressions\Compiler\VariableBinder.cs (1)
221Debug.Assert(referenceScope != null);
System\Linq\Expressions\DebugViewWriter.cs (8)
99Debug.Assert(string.IsNullOrEmpty(le.Name)); 105Debug.Assert(string.IsNullOrEmpty(p.Name)); 111Debug.Assert(string.IsNullOrEmpty(target.Name)); 120Debug.Assert(node != null); 121Debug.Assert(writer != null); 555Debug.Assert(parent != null); 598Debug.Assert(child.NodeType == parent.NodeType); 611Debug.Assert(binary != null);
System\Linq\Expressions\DynamicExpression.cs (7)
24Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == typeof(object) || GetType() != typeof(DynamicExpression)); 516Debug.Assert(args.Length == ((IArgumentProvider)this).ArgumentCount); 527Debug.Assert(delegateType.GetInvokeMethod().GetReturnType() == returnType); 574Debug.Assert(args.Length == 1); 643Debug.Assert(args.Length == 2); 718Debug.Assert(args.Length == 3); 799Debug.Assert(args.Length == 4);
System\Linq\Expressions\Expression.cs (2)
240Debug.Assert(items != null); 272Debug.Assert(member is FieldInfo);
System\Linq\Expressions\ExpressionStringBuilder.cs (6)
71Debug.Assert(node != null); 79Debug.Assert(node != null); 87Debug.Assert(node != null); 98Debug.Assert(node != null); 109Debug.Assert(node != null); 757Debug.Assert(node.Indexer != null);
System\Linq\Expressions\IndexExpression.cs (4)
30Debug.Assert(instance != null && instance.Type.IsArray); 31Debug.Assert(instance.Type.GetArrayRank() == arguments.Count); 122Debug.Assert(instance != null); 123Debug.Assert(arguments == null || arguments.Length == _arguments.Count);
System\Linq\Expressions\Interpreter\AddInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\BranchLabel.cs (4)
46Debug.Assert(_targetIndex != UnknownIndex && _stackDepth != UnknownDepth && _continuationStackDepth != UnknownDepth); 70Debug.Assert(((_targetIndex == UnknownIndex) == (_stackDepth == UnknownDepth))); 71Debug.Assert(((_targetIndex == UnknownIndex) == (_continuationStackDepth == UnknownDepth))); 86Debug.Assert(_targetIndex != UnknownIndex);
System\Linq\Expressions\Interpreter\CallInstruction.Generated.cs (1)
137Debug.Assert(pi.Length == 2);
System\Linq\Expressions\Interpreter\ControlFlowInstructions.cs (20)
25Debug.Assert(_offset == Unknown && offset != Unknown); 57Debug.Assert(_offset != Unknown); 77Debug.Assert(_offset != Unknown); 98Debug.Assert(_offset != Unknown); 142Debug.Assert(_offset != Unknown); 160Debug.Assert(_labelIndex != UnknownInstrIndex); 166Debug.Assert(_labelIndex != UnknownInstrIndex); 173Debug.Assert(_labelIndex != UnknownInstrIndex); 261Debug.Assert(_tryHandler == null && tryHandler != null, "the tryHandler can be set only once"); 287Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 313Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 319Debug.Assert(!(unwrappedException is RethrowException)); 347Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/catch/finally"); 372Debug.Assert(!isFromJump || (isFromJump && _tryHandler.FinallyStartIndex == frame.InstructionIndex), "we should already jump to the first instruction of the finally"); 409Debug.Assert(tryHandler != null); 410Debug.Assert(_tryHandler == null, "the tryHandler can be set only once"); 416Debug.Assert(_tryHandler != null, "the tryHandler must be set already"); 445Debug.Assert(instructions[index] is GotoInstruction, "should be the 'Goto' instruction that jumps out the try/fault"); 561Debug.Assert(!frame.IsJumpHappened()); 584Debug.Assert(!frame.IsJumpHappened());
System\Linq\Expressions\Interpreter\DecrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\DefaultValueInstruction.cs (2)
17Debug.Assert(type.IsValueType); 18Debug.Assert(!type.IsNullableType());
System\Linq\Expressions\Interpreter\DivInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\EqualInstruction.cs (2)
528Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 550Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\FieldOperations.cs (2)
27Debug.Assert(field.IsStatic); 88Debug.Assert(field.IsStatic);
System\Linq\Expressions\Interpreter\GreaterThanInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\GreaterThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\IncrementInstruction.cs (1)
157Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\InstructionList.cs (5)
194Debug.Assert(instruction.ConsumedStack >= 0 && instruction.ProducedStack >= 0 && 198Debug.Assert(_currentStackDepth >= 0, $"negative stack depth {instruction}"); 206Debug.Assert(_currentContinuationsDepth >= 0, $"negative continuations {instruction}"); 239Debug.Assert(Count > 0); 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (2)
213Debug.Assert(_pendingContinuation >= 0); 255Debug.Assert(!gotoExceptionHandler || (gotoExceptionHandler && _continuationIndex == target.ContinuationStackDepth),
System\Linq\Expressions\Interpreter\LabelInfo.cs (1)
329Debug.Assert(CanJumpInto);
System\Linq\Expressions\Interpreter\LessThanInstruction.cs (1)
278Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LessThanOrEqualInstruction.cs (1)
279Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\LightCompiler.cs (37)
43Debug.Assert(exceptionType != null); 71Debug.Assert((FinallyStartIndex != Instruction.UnknownInstrIndex) == (FinallyEndIndex != Instruction.UnknownInstrIndex)); 86Debug.Assert(handlers != null, "catch blocks should exist"); 220Debug.Assert(d1 != null && d2 != null); 329Debug.Assert(_instructions.CurrentStackDepth == (node.ReturnType != typeof(void) ? 1 : 0)); 461Debug.Assert(local.IsBoxed); 692Debug.Assert(fi != null); 898Debug.Assert(node.Right.Type == typeof(int)); 979Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 989Debug.Assert(IsNullComparison(left, right) || left.Type == right.Type || !left.Type.IsValueType && !right.Type.IsValueType); 1000Debug.Assert(left.Type == right.Type && left.Type.IsNumeric()); 1017Debug.Assert(left.Type == right.Type && left.Type.IsArithmetic()); 1043Debug.Assert(parameters.Length == 1); 1115Debug.Assert(typeFrom != typeof(void) && typeTo != typeof(void)); 1360Debug.Assert(opTrue != null, "factory should check that the method exists"); 1382Debug.Assert(expr.Method.IsStatic); 1567Debug.Assert(node.Type == typeof(void)); 1663Debug.Assert(!hasValue); 1707Debug.Assert(!hasValue); 1763Debug.Assert(label != null); 1806Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 2009Debug.Assert(enterTryInstr != null); 2090Debug.Assert(startOfFinally != null); 2106Debug.Assert(exHandlers != null); 2119Debug.Assert(expr.Finally == null); 2120Debug.Assert(expr.Handlers.Count == 0); 2126Debug.Assert(enterTryInstr == _instructions.GetInstruction(tryStart)); 2173Debug.Assert(parameters.Length == arguments.ArgumentCount); 2343Debug.Assert(member.Member is PropertyInfo); 2445Debug.Assert(type.IsValueType); 2470Debug.Assert(!forBinding); 2536Debug.Assert(typeof(NewArrayExpression).GetCustomAttribute<RequiresDynamicCodeAttribute>() is not null); 2553Debug.Assert(node.NodeType == ExpressionType.NewArrayBounds); 2919Debug.Assert(expr.NodeType == ExpressionType.TypeEqual); 2942Debug.Assert(expr.NodeType == ExpressionType.TypeIs); 3028Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth); 3118Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth + (expr.Type == typeof(void) ? 0 : 1),
System\Linq\Expressions\Interpreter\LightDelegateCreator.cs (2)
18Debug.Assert(interpreter != null); 19Debug.Assert(lambda != null);
System\Linq\Expressions\Interpreter\LocalAccess.cs (3)
273Debug.Assert(defaultValue != null); 377Debug.Assert(type.IsValueType, "MutableValue only supports value types."); 416Debug.Assert(type.IsValueType, "MutableBox only supports value types.");
System\Linq\Expressions\Interpreter\LocalVariables.cs (1)
115Debug.Assert(!local.IsBoxed && !local.InClosure);
System\Linq\Expressions\Interpreter\ModuloInstruction.cs (1)
165Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\MulInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 302Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\NegateInstruction.cs (2)
106Debug.Assert(!type.IsEnum); 182Debug.Assert(!type.IsEnum);
System\Linq\Expressions\Interpreter\NotEqualInstruction.cs (2)
510Debug.Assert(type.GetNonNullableType().GetTypeCode() == TypeCode.Double); 532Debug.Assert(type.IsNullableOrReferenceType());
System\Linq\Expressions\Interpreter\SubInstruction.cs (2)
165Debug.Assert(type.IsArithmetic()); 301Debug.Assert(type.IsArithmetic());
System\Linq\Expressions\Interpreter\TypeOperations.cs (8)
153Debug.Assert(mi.ReturnType.IsValueType, "Nullable is only allowed on value types."); 154Debug.Assert(!mi.ReturnType.IsNullableType()); 356Debug.Assert(!t.IsEnum); 386Debug.Assert(t.IsEnum); 393Debug.Assert( 410Debug.Assert(t.IsEnum); 417Debug.Assert(from != null); 456Debug.Assert(_t.GetTypeCode() == TypeCode.Boolean);
System\Linq\Expressions\Interpreter\Utilities.cs (6)
178Debug.Assert(key != null); 201Debug.Assert(key != null); 222Debug.Assert(key != null); 272Debug.Assert(key != null); 284Debug.Assert(key != null); 340Debug.Assert(var != null);
System\Linq\Expressions\InvocationExpression.cs (14)
146Debug.Assert(lambda != null); 147Debug.Assert(arguments == null || arguments.Length == _arguments.Count); 174Debug.Assert(lambda != null); 175Debug.Assert(arguments == null || arguments.Length == 0); 207Debug.Assert(lambda != null); 208Debug.Assert(arguments == null || arguments.Length == 1); 247Debug.Assert(lambda != null); 248Debug.Assert(arguments == null || arguments.Length == 2); 290Debug.Assert(lambda != null); 291Debug.Assert(arguments == null || arguments.Length == 3); 336Debug.Assert(lambda != null); 337Debug.Assert(arguments == null || arguments.Length == 4); 385Debug.Assert(lambda != null); 386Debug.Assert(arguments == null || arguments.Length == 5);
System\Linq\Expressions\LambdaExpression.cs (13)
122Debug.Assert(lambdaExpressionType.IsAssignableTo(typeof(LambdaExpression))); 145Debug.Assert(CanInterpret); 225Debug.Assert(CanInterpret); 377Debug.Assert(body != null); 378Debug.Assert(parameters == null || parameters.Length == 0); 421Debug.Assert(body != null); 422Debug.Assert(parameters == null || parameters.Length == 1); 483Debug.Assert(body != null); 484Debug.Assert(parameters == null || parameters.Length == 2); 551Debug.Assert(body != null); 552Debug.Assert(parameters == null || parameters.Length == 3); 584Debug.Assert(body != null); 585Debug.Assert(parameters == null || parameters.Length == _parameters.Count);
System\Linq\Expressions\MemberExpression.cs (2)
35Debug.Assert(property != null); 41Debug.Assert(field != null);
System\Linq\Expressions\MethodCallExpression.cs (25)
159Debug.Assert(instance != null); 191Debug.Assert(instance == null); 192Debug.Assert(args == null || args.Count == _arguments.Count); 222Debug.Assert(instance != null); 223Debug.Assert(args == null || args.Count == _arguments.Count); 253Debug.Assert(instance == null); 254Debug.Assert(args == null || args.Count == 0); 300Debug.Assert(instance == null); 301Debug.Assert(args == null || args.Count == 1); 366Debug.Assert(instance == null); 367Debug.Assert(args == null || args.Count == 2); 437Debug.Assert(instance == null); 438Debug.Assert(args == null || args.Count == 3); 514Debug.Assert(instance == null); 515Debug.Assert(args == null || args.Count == 4); 597Debug.Assert(instance == null); 598Debug.Assert(args == null || args.Count == 5); 633Debug.Assert(instance != null); 634Debug.Assert(args == null || args.Count == 0); 682Debug.Assert(instance != null); 683Debug.Assert(args == null || args.Count == 1); 747Debug.Assert(instance != null); 748Debug.Assert(args == null || args.Count == 2); 818Debug.Assert(instance != null); 819Debug.Assert(args == null || args.Count == 3);
System\Linq\Expressions\NewArrayExpression.cs (1)
28Debug.Assert(type.IsArray);
System\Linq\Expressions\TryExpression.cs (3)
184Debug.Assert(tryBody != null); 208Debug.Assert(cb.Body != null); 221Debug.Assert(cb.Body != null);
System\Linq\Expressions\TypeBinaryExpression.cs (1)
77Debug.Assert(TypeUtils.AreReferenceAssignable(typeof(object), Expression.Type), "Expecting reference types only after this point.");
System\Linq\Expressions\UnaryExpression.cs (8)
124Debug.Assert(Operand.NodeType == ExpressionType.Parameter); 145Debug.Assert(NodeType == ExpressionType.PreDecrementAssign || NodeType == ExpressionType.PostDecrementAssign); 262Debug.Assert(i == temps.Length); 268Debug.Assert(i == temps.Length); 271Debug.Assert(i == block.Length); 382Debug.Assert(method != null); 428Debug.Assert(method != null); 1063Debug.Assert(kind == ExpressionType.PreDecrementAssign || kind == ExpressionType.PostDecrementAssign);
System\Runtime\CompilerServices\CallSite.cs (3)
135Debug.Assert(s_cachedNoMatch != null, "all normal sites should have Update cached once there is an instance."); 140Debug.Assert(s_cachedUpdate != null, "all normal sites should have Update cached once there is an instance."); 191Debug.Assert(matchmaker?._match != false, "cached site should be set up for matchmaking");
System\Runtime\CompilerServices\CallSiteBinder.cs (1)
219Debug.Assert(result != null);
System\Runtime\CompilerServices\RuntimeOps.ExpressionQuoter.cs (1)
28Debug.Assert(hoistedLocals != null && locals != null);
System\Runtime\CompilerServices\RuntimeOps.RuntimeVariableList.cs (2)
76Debug.Assert(data != null); 77Debug.Assert(indexes != null);
System.Linq.Parallel (687)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Linq\Parallel\Channels\AsynchronousChannel.cs (21)
118Debug.Assert(chunkSize > 0, "chunk size must be greater than 0"); 119Debug.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0"); 258Debug.Assert(_producerChunk != null); 289Debug.Assert(chunk != null); 290Debug.Assert(!_done, "can't continue producing after the production is over"); 294Debug.Assert(!IsFull, "expected a non-full buffer"); 315Debug.Assert(_consumerEvent != null); 327Debug.Assert(_producerEvent != null); 383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); 410Debug.Assert(_consumerChunk == null); 418Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 488Debug.Assert(_consumerChunk == null); 496Debug.Assert(_consumerChunk != null, "consumer chunk is null"); 497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds"); 587Debug.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here"); 606Debug.Assert(!IsChunkBufferEmpty); 630Debug.Assert(_producerEvent != null); 663Debug.Assert(_done, "Expected channel to be done before disposing"); 664Debug.Assert(_producerEvent != null); 665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (7)
67Debug.Assert(_queue != null); 69Debug.Assert(!_done, "trying to enqueue into the queue after production is done"); 89Debug.Assert(_queue != null); 91Debug.Assert(_done, "trying to dequeue before production is done -- this is not safe"); 117Debug.Assert(_queue != null && array != null); 119Debug.Assert(_done, "Can only copy from the channel after it's done being added to"); 132Debug.Assert(_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (4)
25Debug.Assert(source != null); 26Debug.Assert(sign == -1 || sign == 1); 101Debug.Assert(default(T) != null || element.Second != null, "nulls unexpected in final reduce"); 118Debug.Assert(accumulator.First || default(T) == null,
System\Linq\Parallel\Enumerables\EnumerableWrapperWeakToStrong.cs (2)
32Debug.Assert(wrappedEnumerable != null); 60Debug.Assert(wrappedEnumerator != null);
System\Linq\Parallel\Enumerables\OrderedParallelQuery.cs (1)
29Debug.Assert(sortOp is IOrderedEnumerable<TSource>);
System\Linq\Parallel\Enumerables\ParallelEnumerableWrapper.cs (3)
31Debug.Assert(source != null); 69Debug.Assert(wrappedEnumerable != null, "wrappedEnumerable must not be null."); 89Debug.Assert(_wrappedEnumerable != null);
System\Linq\Parallel\Enumerables\ParallelQuery.cs (4)
52Debug.Fail("The derived class must override this method."); 65Debug.Fail("The derived class must override this method."); 78Debug.Fail("The derived class must override this method."); 127Debug.Fail("The derived class must override this method.");
System\Linq\Parallel\Enumerables\RepeatEnumerable.cs (1)
33Debug.Assert(count >= 0, "count not within range (must be >= 0)");
System\Linq\Parallel\Merging\ArrayMergeHelper.cs (2)
76Debug.Fail("ArrayMergeHelper<>.GetEnumerator() is not intended to be used. Call GetResultsAsArray() instead."); 86Debug.Assert(_outputArray != null);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (8)
48Debug.Assert(channels != null); 50foreach (AsynchronousChannel<T> c in channels) Debug.Assert(c != null); 153Debug.Assert(dequeueResult, "channel isn't empty, yet the dequeue failed, hmm"); 165Debug.Assert(_channels[currChannelIndex].IsDone, "thought this channel was done"); 166Debug.Assert(_channels[currChannelIndex].IsChunkBufferEmpty, "thought this channel was empty"); 226Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 227Debug.Assert(_consumerEvent != null); 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (8)
48Debug.Assert(partitions != null); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 88Debug.Assert(_channelEnumerator != null, "enumerator can't be null if we're not ignoring output"); 103Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 118Debug.Assert(_partitions.PartitionCount == 1); 128Debug.Assert(_ignoreOutput || _channelEnumerator != null);
System\Linq\Parallel\Merging\MergeEnumerator.cs (2)
30Debug.Assert(taskGroupState != null); 68Debug.Assert(_taskGroupState.CancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Merging\MergeExecutor.cs (9)
53Debug.Assert(partitions != null); 54Debug.Assert(partitions.PartitionCount > 0); 55Debug.Assert(!ignoreOutput || options == ParallelMergeOptions.FullyBuffered, "Pipelining with no output is not supported."); 62Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 102Debug.Assert(_mergeHelper != null); 118Debug.Assert(_mergeHelper != null); 128Debug.Assert(_mergeHelper != null); 151Debug.Assert(options == ParallelMergeOptions.NotBuffered || options == ParallelMergeOptions.AutoBuffered);
System\Linq\Parallel\Merging\OrderPreservingMergeHelper.cs (2)
41Debug.Assert(partitions != null); 69Debug.Assert(_results.Value != null);
System\Linq\Parallel\Merging\OrderPreservingPipeliningMergeHelper.cs (10)
122Debug.Assert(partitions != null); 139Debug.Assert(typeof(TKey) == typeof(int)); 175Debug.Fail("An ordered pipelining merge is not intended to be used this way."); 375Debug.Fail("QueryEnd() should have thrown an exception."); 415Debug.Assert(_mergeHelper._producerDone[producer]); 421Debug.Assert(buffer.Count > 0, "Producer's buffer should not be empty here."); 427Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 452Debug.Assert(gotElement); 471Debug.Assert(_privateBuffer[producer]!.Count == 0); 535Debug.Assert(x.MaxKey >= 0 && y.MaxKey >= 0); // Guarantees no overflow on next line
System\Linq\Parallel\Merging\SynchronousChannelMergeEnumerator.cs (5)
36Debug.Assert(channels != null); 38foreach (SynchronousChannel<T> c in channels) Debug.Assert(c != null); 78Debug.Assert(_channels != null); 90Debug.Assert(current != null); 109Debug.Assert(_channelIndex == _channels.Length);
System\Linq\Parallel\Partitioning\HashRepartitionEnumerator.cs (15)
69Debug.Assert(source != null); 70Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 71Debug.Assert(repartitionStream != null); 72Debug.Assert(barrier != null); 73Debug.Assert(valueExchangeMatrix != null); 74Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 75Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 76Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 88Debug.Assert(partitionCount == 1); 126Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 135Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 158Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 202Debug.Assert(mutables != null); 225Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 229Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount,
System\Linq\Parallel\Partitioning\HashRepartitionStream.cs (2)
54Debug.Assert(_keyComparer == null || _elementComparer == null); 55Debug.Assert(_elementComparer == null || typeof(THashKey) == typeof(NoKeyMemoizationRequired));
System\Linq\Parallel\Partitioning\OrderedHashRepartitionEnumerator.cs (19)
71Debug.Assert(source != null); 72Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 73Debug.Assert(repartitionStream != null); 74Debug.Assert(barrier != null); 75Debug.Assert(valueExchangeMatrix != null); 76Debug.Assert(valueExchangeMatrix.GetLength(0) == partitionCount, "expected square matrix of buffers (NxN)"); 77Debug.Assert(partitionCount > 0 && valueExchangeMatrix[0].Length == partitionCount, "expected square matrix of buffers (NxN)"); 78Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 124Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 133Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 145Debug.Assert(mutables._currentKeyBuffer != null); 151Debug.Assert(mutables._currentKeyBuffer != null, "expected same # of buffers/key-buffers"); 161Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count > 0); 162Debug.Assert((mutables._currentBuffer == null) == (mutables._currentKeyBuffer == null)); 163Debug.Assert(mutables._currentBuffer == null || mutables._currentBuffer.Count == mutables._currentKeyBuffer!.Count); 208Debug.Assert(mutables != null); 232Debug.Assert(typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 236Debug.Assert(0 <= destinationIndex && destinationIndex < _partitionCount, 249Debug.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
74Debug.Assert(source != null); 75Debug.Assert(partitionCount > 0); 81Debug.Assert(source != null); 138Debug.Assert(partitions.Length == partitionCount); 161Debug.Assert(source != null); 162Debug.Assert(partitionCount > 0); 238Debug.Assert(data != null, "data mustn't be null"); 239Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 240Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 241Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 242Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 251Debug.Assert(sectionSize > 0); 277Debug.Assert(mutables != null); 278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 340Debug.Assert(data != null, "data must not be null"); 341Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 342Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 343Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 360Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 409Debug.Assert(data != null, "data must not be null"); 410Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 411Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 412Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 413Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1"); 422Debug.Assert(sectionSize > 0); 448Debug.Assert(mutables != null); 449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 511Debug.Assert(data != null, "data must not be null"); 512Debug.Assert(partitionCount > 0, "partitionCount must be positive"); 513Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative"); 514Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount"); 531Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread"); 595Debug.Assert(source != null); 596Debug.Assert(sourceSyncLock != null); 597Debug.Assert(currentIndex != null); 614Debug.Assert(mutables._chunkBuffer != null); 624Debug.Assert(_source != null); 625Debug.Assert(chunkBuffer != null); 626Debug.Assert(mutables._currentChunkSize > 0); 627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length); 641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length);
System\Linq\Parallel\Partitioning\PartitionedStream.cs (7)
40Debug.Assert(partitionCount > 0); 57Debug.Assert(_partitions != null); 58Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 63Debug.Assert(_partitions != null); 64Debug.Assert(value != null); 65Debug.Assert(0 <= index && index < _partitions.Length, "index out of bounds"); 78Debug.Assert(_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (16)
78Debug.Assert(child != null, "child data source cannot be null"); 79Debug.Assert(intermediateReduce != null, "need an intermediate reduce function"); 80Debug.Assert(finalReduce != null, "need a final reduce function"); 81Debug.Assert(resultSelector != null, "need a result selector function"); 82Debug.Assert(options.IsValidQueryAggregationOption(), "enum out of valid range"); 83Debug.Assert((options & QueryAggregationOptions.Associative) == QueryAggregationOptions.Associative, "expected an associative operator"); 84Debug.Assert(typeof(TIntermediate) == typeof(TInput) || seedIsSpecified, "seed must be specified if TIntermediate differs from TInput"); 105Debug.Assert(_finalReduce != null); 106Debug.Assert(_resultSelector != null); 204Debug.Fail("This method should never be called. Associative aggregation can always be parallelized."); 242Debug.Assert(source != null); 243Debug.Assert(reduceOperator != null); 261Debug.Assert(_reduceOperator != null); 262Debug.Assert(_reduceOperator._intermediateReduce != null, "expected a compiled operator"); 286Debug.Assert(typeof(TInput) == typeof(TIntermediate)); 319Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (10)
42Debug.Assert(firstChild != null, "first child data source cannot be null"); 43Debug.Assert(secondChild != null, "second child data source cannot be null"); 90Debug.Assert(!ExchangeUtilities.IsWorseThan(leftStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 109Debug.Assert(!ExchangeUtilities.IsWorseThan(rightStream.OrdinalIndexState, OrdinalIndexState.Increasing)); 172Debug.Assert(firstSource != null); 173Debug.Assert(secondSource != null); 189Debug.Assert(_firstSource != null); 190Debug.Assert(_secondSource != null); 257Debug.Assert(leftChildQueryResults.IsIndexible && rightChildQueryResults.IsIndexible); 272Debug.Assert(_leftChildCount >= 0 && _rightChildCount >= 0);
System\Linq\Parallel\QueryOperators\Binary\ExceptQueryOperator.cs (13)
34Debug.Assert(left != null && right != null, "child data sources cannot be null"); 56Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 156Debug.Assert(leftSource != null); 157Debug.Assert(rightSource != null); 171Debug.Assert(_leftSource != null); 172Debug.Assert(_rightSource != null); 199Debug.Assert(_outputLoopCount != null); 221Debug.Assert(_leftSource != null && _rightSource != null); 248Debug.Assert(leftSource != null); 249Debug.Assert(rightSource != null); 264Debug.Assert(_leftSource != null); 265Debug.Assert(_rightSource != null); 326Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\GroupJoinQueryOperator.cs (10)
44Debug.Assert(left != null && right != null, "child data sources cannot be null"); 45Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 46Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 47Debug.Assert(resultSelector != null, "need a result selector function"); 75Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 224Debug.Assert(dataSource != null); 250Debug.Assert(baseLookup != null); 314Debug.Assert(dataSource != null); 354Debug.Assert(baseLookup != null); 434Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\HashJoinQueryOperatorEnumerator.cs (13)
69Debug.Assert(leftSource != null); 70Debug.Assert(rightLookupBuilder != null); 71Debug.Assert(resultSelector != null); 72Debug.Assert(outputKeyBuilder != null); 95Debug.Assert(_resultSelector != null, "expected a compiled result selector"); 96Debug.Assert(_leftSource != null); 97Debug.Assert(_rightLookupBuilder != null); 133Debug.Assert(mutables._rightHashLookup != null); 139Debug.Assert(mutables._currentRightMatches == null || mutables._currentRightMatches.Count > 0, 164Debug.Assert(mutables._currentRightMatches != null); 165Debug.Assert(0 <= mutables._currentRightMatchesIndex && mutables._currentRightMatchesIndex < mutables._currentRightMatches.Count); 179Debug.Assert(_leftSource != null && _rightLookupBuilder != null); 241Debug.Assert(dataSource != null);
System\Linq\Parallel\QueryOperators\Binary\IntersectQueryOperator.cs (13)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 58Debug.Assert(leftPartitionedStream.PartitionCount == rightPartitionedStream.PartitionCount); 144Debug.Assert(leftSource != null); 145Debug.Assert(rightSource != null); 159Debug.Assert(_leftSource != null); 160Debug.Assert(_rightSource != null); 188Debug.Assert(_outputLoopCount != null); 210Debug.Assert(_leftSource != null && _rightSource != null); 247Debug.Assert(leftSource != null); 248Debug.Assert(rightSource != null); 263Debug.Assert(_leftSource != null); 264Debug.Assert(_rightSource != null); 325Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\JoinQueryOperator.cs (9)
60Debug.Assert(left != null && right != null, "child data sources cannot be null"); 61Debug.Assert(leftKeySelector != null, "left key selector must not be null"); 62Debug.Assert(rightKeySelector != null, "right key selector must not be null"); 63Debug.Assert(resultSelector != null, "need a result selector function"); 78Debug.Assert(rightStream.PartitionCount == leftStream.PartitionCount); 201Debug.Assert(dataSource != null); 220Debug.Assert(_dataSource != null); 234Debug.Assert(baseLookup != null); 271Debug.Assert(baseLookup != null);
System\Linq\Parallel\QueryOperators\Binary\UnionQueryOperator.cs (11)
33Debug.Assert(left != null && right != null, "child data sources cannot be null"); 60Debug.Assert(leftStream.PartitionCount == rightStream.PartitionCount); 202Debug.Assert(leftSource != null); 203Debug.Assert(rightSource != null); 223Debug.Assert(_hashLookup != null); 263Debug.Assert(_outputLoopCount != null); 315Debug.Assert(leftSource != null); 316Debug.Assert(rightSource != null); 335Debug.Assert(_leftSource != null); 336Debug.Assert(_rightSource != null); 397Debug.Assert(_leftSource != null && _rightSource != null);
System\Linq\Parallel\QueryOperators\Binary\ZipQueryOperator.cs (7)
60Debug.Assert(resultSelector != null, "operator cannot be null"); 88Debug.Assert(settings.DegreeOfParallelism != null); 90Debug.Assert(settings.TaskScheduler != null); 97Debug.Assert(merger.MergeExecutor != null); 108Debug.Assert(merger.MergeExecutor != null); 181Debug.Assert(_leftChildResults.IsIndexible); 182Debug.Assert(_rightChildResults.IsIndexible);
System\Linq\Parallel\QueryOperators\BinaryQueryOperator.cs (5)
42Debug.Assert(leftChild != null && rightChild != null); 105Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 106Debug.Assert(_settings.ExecutionMode != null); 110Debug.Assert(_settings.DegreeOfParallelism != null); 119Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Inlined\CountAggregationOperator.cs (2)
89Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 183Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\DoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 125Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatAverageAggregationOperator.cs (2)
97Debug.Assert(source != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatMinMaxAggregationOperator.cs (3)
34Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 119Debug.Assert(source != null); 180Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\FloatSumAggregationOperator.cs (2)
84Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\InlinedAggregationOperator.cs (2)
37Debug.Assert(child != null, "child data source cannot be null"); 140Debug.Fail("This method should never be called. Associative aggregation can always be parallelized.");
System\Linq\Parallel\QueryOperators\Inlined\IntAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongCountAggregationOperator.cs (2)
87Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 115Debug.Assert(source != null); 177Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\LongSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 132Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 175Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDecimalSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 139Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableDoubleSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatMinMaxAggregationOperator.cs (3)
35Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 121Debug.Assert(source != null); 185Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableFloatSumAggregationOperator.cs (2)
83Debug.Assert(source != null); 126Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntAverageAggregationOperator.cs (2)
95Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 113Debug.Assert(source != null); 174Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableIntSumAggregationOperator.cs (2)
86Debug.Assert(source != null); 131Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 140Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongMinMaxAggregationOperator.cs (3)
29Debug.Assert(sign == -1 || sign == 1, "invalid sign"); 114Debug.Assert(source != null); 176Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\NullableLongSumAggregationOperator.cs (2)
87Debug.Assert(source != null); 133Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\PartitionedStreamMerger.cs (1)
38Debug.Assert(_received, "Cannot return the merge executor because Receive() has not been called yet.");
System\Linq\Parallel\QueryOperators\PartitionerQueryOperator.cs (3)
130Debug.Assert(_settings.DegreeOfParallelism.HasValue); 233Debug.Assert(_sourceEnumerator != null); 263Debug.Assert(_sourceEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryOpeningEnumerator.cs (1)
50Debug.Assert(queryOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperator.cs (14)
127Debug.Assert(querySettings.ExecutionMode != null); 138Debug.Assert(mergeOptions != null); 152Debug.Assert(querySettings.TaskScheduler != null); 166Debug.Assert(merger.MergeExecutor != null); 178Debug.Assert(querySettings.TaskScheduler != null); 179Debug.Assert(querySettings.DegreeOfParallelism.HasValue); 180Debug.Assert(querySettings.ExecutionMode.HasValue); 200Debug.Assert(querySettings.ExecutionMode != null); 233Debug.Assert(querySettings.TaskScheduler != null); 238Debug.Assert(merger.MergeExecutor != null); 241Debug.Assert(output != null); 287Debug.Assert(taskScheduler != null); 310Debug.Assert(source != null); 335Debug.Assert(sourceAsOperator != null);
System\Linq\Parallel\QueryOperators\QueryOperatorEnumerator.cs (1)
60Debug.Assert(operatorEnumerator != null);
System\Linq\Parallel\QueryOperators\QueryResults.cs (2)
63Debug.Fail("GetElement property is not supported by non-indexable query results"); 78Debug.Fail("ElementsCount property is not supported by non-indexable query results");
System\Linq\Parallel\QueryOperators\QuerySettings.cs (13)
40Debug.Assert(_cancellationState != null); 93Debug.Assert(_cancellationState != null); 149Debug.Assert(topLevelCancellationTokenSource != null, "There should always be a top-level cancellation signal specified."); 159Debug.Assert(settings.CancellationState.InternalCancellationTokenSource != null); 160Debug.Assert(settings.CancellationState.MergedCancellationToken.CanBeCanceled); 161Debug.Assert(settings.CancellationState.TopLevelDisposedFlag != null); 185Debug.Assert(settings.TaskScheduler != null); 186Debug.Assert(settings.DegreeOfParallelism.HasValue); 187Debug.Assert(settings.DegreeOfParallelism.Value >= 1 && settings.DegreeOfParallelism <= Scheduling.MAX_SUPPORTED_DOP); 188Debug.Assert(settings.ExecutionMode != null); 189Debug.Assert(settings.MergeOptions != null); 191Debug.Assert(settings.MergeOptions != ParallelMergeOptions.Default); 207Debug.Assert(_cancellationState.MergedCancellationTokenSource != null);
System\Linq\Parallel\QueryOperators\ScanQueryOperator.cs (3)
33Debug.Assert(data != null); 59Debug.Assert(settings.DegreeOfParallelism.HasValue); 131Debug.Assert(_settings.DegreeOfParallelism != null);
System\Linq\Parallel\QueryOperators\Unary\AnyAllSearchOperator.cs (8)
54Debug.Assert(child != null, "child data source cannot be null"); 55Debug.Assert(predicate != null, "need a predicate function"); 129Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 166Debug.Assert(source != null); 167Debug.Assert(predicate != null); 168Debug.Assert(resultFoundFlag != null); 186Debug.Assert(_predicate != null); 234Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ContainsSearchOperator.cs (7)
40Debug.Assert(child != null, "child data source cannot be null"); 107Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 144Debug.Assert(source != null); 145Debug.Assert(comparer != null); 146Debug.Assert(resultFoundFlag != null); 164Debug.Assert(_comparer != null); 211Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DefaultIfEmptyQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 62Debug.Assert(partitionCount == 1); 125Debug.Assert(source != null); 126Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 127Debug.Assert(partitionCount > 0); 128Debug.Assert(sharedEmptyCount != null); 129Debug.Assert(sharedLatch != null); 146Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\DistinctQueryOperator.cs (9)
34Debug.Assert(source != null, "child data source cannot be null"); 134Debug.Assert(source != null); 146Debug.Assert(_source != null); 147Debug.Assert(_hashLookup != null); 176Debug.Assert(_source != null); 210Debug.Assert(source != null); 226Debug.Assert(_source != null); 227Debug.Assert(_hashLookup != null); 272Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ElementAtQueryOperator.cs (9)
40Debug.Assert(child != null, "child data source cannot be null"); 41Debug.Assert(index >= 0, "index can't be less than 0"); 75Debug.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexable); 103Debug.Fail("This method should never be called as fallback to sequential is handled in Aggregate()."); 152Debug.Assert(!e.MoveNext(), "expected enumerator to be empty"); 182Debug.Assert(source != null); 183Debug.Assert(index >= 0); 184Debug.Assert(resultFoundFlag != null); 225Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (8)
39Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 103Debug.Fail("This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 143Debug.Assert(source != null); 144Debug.Assert(operatorState != null); 145Debug.Assert(sharedBarrier != null); 146Debug.Assert(keyComparer != null); 163Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ForAllOperator.cs (9)
35Debug.Assert(child != null, "child data source cannot be null"); 36Debug.Assert(elementAction != null, "need a function"); 47Debug.Assert(_elementAction != null); 65Debug.Assert(enumerator == null); 105Debug.Fail("AsSequentialQuery is not supported on ForAllOperator"); 136Debug.Assert(source != null); 137Debug.Assert(elementAction != null); 151Debug.Assert(_elementAction != null, "expected a compiled operator"); 173Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (25)
56Debug.Assert(child != null, "child data source cannot be null"); 57Debug.Assert(keySelector != null, "need a selector function"); 58Debug.Assert(elementSelector != null || 114Debug.Assert(typeof(TSource) == typeof(TElement)); 153Debug.Assert(typeof(TSource) == typeof(TElement)); 192Debug.Assert(typeof(TElement) == typeof(TSource)); 243Debug.Assert(source != null); 258Debug.Assert(_source != null); 271Debug.Assert(mutables._hashLookup != null); 345Debug.Assert(currentValue != null); 374Debug.Assert(elementSelector != null); 407Debug.Assert(currentValue != null); 446Debug.Assert(source != null); 447Debug.Assert(keySelector != null); 464Debug.Assert(_source != null); 465Debug.Assert(_keySelector != null); 478Debug.Assert(mutables._hashLookup != null); 582Debug.Assert(currentValue != null); 616Debug.Assert(elementSelector != null); 657Debug.Assert(currentValue != null); 689Debug.Assert(keyValues.Value != null); 711Debug.Assert(_keyValues.Value != null); 759Debug.Assert(_sortedValues != null); 774Debug.Assert(_values != null); 784Debug.Assert(_values != null);
System\Linq\Parallel\QueryOperators\Unary\IndexedSelectQueryOperator.cs (9)
47Debug.Assert(child != null, "child data source cannot be null"); 48Debug.Assert(selector != null, "need a selector function"); 71Debug.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 103Debug.Assert(typeof(TKey) == typeof(int)); 145Debug.Assert(source != null); 146Debug.Assert(selector != null); 161Debug.Assert(_selector != null, "expected a compiled selection function"); 217Debug.Assert(_childQueryResults.IsIndexible); 226Debug.Assert(_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (7)
46Debug.Assert(child != null, "child data source cannot be null"); 47Debug.Assert(predicate != null, "need a filter function"); 97Debug.Assert(typeof(TKey) == typeof(int)); 152Debug.Assert(source != null); 153Debug.Assert(predicate != null); 165Debug.Assert(_predicate != null, "expected a compiled operator"); 188Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (8)
40Debug.Assert(child != null, "child data source cannot be null"); 76Debug.Assert(partitionCount == 1); 99Debug.Fail("This method should never be called as fallback to sequential is handled in ParallelEnumerable.First()."); 139Debug.Assert(source != null); 140Debug.Assert(operatorState != null); 141Debug.Assert(sharedBarrier != null); 142Debug.Assert(keyComparer != null); 159Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\ReverseQueryOperator.cs (9)
41Debug.Assert(child != null, "child data source cannot be null"); 56Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 118Debug.Assert(source != null); 147Debug.Assert(_bufferIndex != null); 196Debug.Assert(_childQueryResults.IsIndexible); 209Debug.Assert(_count >= 0); 216Debug.Assert(_count >= 0); 217Debug.Assert(index >= 0); 218Debug.Assert(index < _count);
System\Linq\Parallel\QueryOperators\Unary\SelectManyQueryOperator.cs (21)
58Debug.Assert(leftChild != null, "left child data source cannot be null"); 59Debug.Assert(rightChildSelector != null || indexedRightChildSelector != null, 61Debug.Assert(rightChildSelector == null || indexedRightChildSelector == null, 63Debug.Assert(typeof(TRightInput) == typeof(TOutput) || resultSelector != null, 208Debug.Assert(_indexedRightChildSelector != null); 261Debug.Assert(leftSource != null); 262Debug.Assert(selectManyOperator != null); 294Debug.Assert(_selectManyOperator._indexedRightChildSelector != null); 299Debug.Assert(rightChild != null); 302Debug.Assert(_currentRightSource != null); 313Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 320Debug.Assert(_mutables != null); 333Debug.Assert(_currentRightSourceAsOutput != null); 390Debug.Assert(leftSource != null); 391Debug.Assert(selectManyOperator != null); 424Debug.Assert(_selectManyOperator._rightChildSelector != null); 428Debug.Assert(rightChild != null); 431Debug.Assert(_currentRightSource != null); 442Debug.Assert(_currentRightSourceAsOutput == _currentRightSource, 449Debug.Assert(_mutables != null); 462Debug.Assert(_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (9)
42Debug.Assert(child != null, "child data source cannot be null"); 43Debug.Assert(selector != null, "need a selector function"); 104Debug.Assert(source != null); 105Debug.Assert(selector != null); 120Debug.Assert(_selector != null, "expected a compiled operator"); 163Debug.Assert(op._selector != null); 165Debug.Assert(_childQueryResults.IsIndexible); 181Debug.Assert(index >= 0); 182Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (5)
39Debug.Assert(child != null, "child data source cannot be null"); 78Debug.Fail("This method should never be called as it is an ending operator with LimitsParallelism=false."); 113Debug.Assert(source != null); 114Debug.Assert(totalElementCount != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (5)
36Debug.Assert(keySelector != null, "key selector must not be null"); 180Debug.Assert(source != null); 181Debug.Assert(keySelector != null, "need a key comparer"); 195Debug.Assert(_source != null); 209Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (16)
51Debug.Assert(child != null, "child data source cannot be null"); 89Debug.Assert(Child.OrdinalIndexState != OrdinalIndexState.Indexable, "Don't take this code path if the child is indexable."); 112Debug.Assert(partitionCount == 1); 175Debug.Assert(source != null); 176Debug.Assert(sharedIndices != null); 177Debug.Assert(sharedBarrier != null); 178Debug.Assert(keyComparer != null); 195Debug.Assert(_sharedIndices != null); 243Debug.Assert(_buffer != null && _bufferIndex != null); 275Debug.Assert(_buffer != null && _bufferIndex != null); 298Debug.Assert(_count <= 0 || _keyComparer.Compare(currentKey, minKey) > 0, 360Debug.Assert(_childQueryResults.IsIndexible); 374Debug.Assert(_childCount >= 0); 388Debug.Assert(_childCount >= 0); 389Debug.Assert(index >= 0); 390Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipWhileQueryOperator.cs (14)
71Debug.Assert(child != null, "child data source cannot be null"); 72Debug.Assert(predicate != null || indexedPredicate != null, "need a predicate function"); 131Debug.Assert(partitionCount == 1); 137Debug.Assert(_indexedPredicate == null || typeof(TKey) == typeof(int)); 176Debug.Assert(_predicate != null); 186Debug.Assert(_predicate != null); 232Debug.Assert(source != null); 233Debug.Assert(predicate != null || indexedPredicate != null); 234Debug.Assert(operatorState != null); 235Debug.Assert(sharedBarrier != null); 236Debug.Assert(keyComparer != null); 303Debug.Assert(_indexedPredicate != null); 342Debug.Assert(_bufferIndex != null); 390Debug.Assert(_keyComparer.Compare(currentKey, _operatorState._currentLowKey) > 0,
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (6)
41Debug.Assert(child != null, "child data source cannot be null"); 42Debug.Assert(predicate != null, "need a filter function"); 116Debug.Assert(source != null); 117Debug.Assert(predicate != null); 130Debug.Assert(_predicate != null, "expected a compiled operator"); 152Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\UnaryQueryOperator.cs (2)
110Debug.Assert(IsIndexible == (_op.OrdinalIndexState == OrdinalIndexState.Indexable)); 112Debug.Assert(_settings.ExecutionMode != null && _settings.DegreeOfParallelism != null);
System\Linq\Parallel\Scheduling\OrderPreservingPipeliningSpoolingTask.cs (12)
67Debug.Assert(partition != null); 68Debug.Assert(taskGroupState != null); 69Debug.Assert(consumerWaiting != null); 70Debug.Assert(producerWaiting != null && producerWaiting.Length == consumerWaiting.Length); 71Debug.Assert(producerDone != null && producerDone.Length == consumerWaiting.Length); 72Debug.Assert(buffers != null && buffers.Length == consumerWaiting.Length); 73Debug.Assert(partitionIndex >= 0 && partitionIndex < consumerWaiting.Length); 153Debug.Assert(groupState != null); 154Debug.Assert(partitions != null); 155Debug.Assert(producerDone != null && producerDone.Length == partitions.PartitionCount); 156Debug.Assert(buffers != null && buffers.Length == partitions.PartitionCount); 157Debug.Assert(bufferLocks != null);
System\Linq\Parallel\Scheduling\OrderPreservingSpoolingTask.cs (9)
48Debug.Assert(groupState != null); 49Debug.Assert(results != null); 50Debug.Assert(sortHelper != null); 74Debug.Assert(groupState != null); 75Debug.Assert(partitions != null); 76Debug.Assert(results != null); 77Debug.Assert(results.Value == null); 131Debug.Assert(_sortHelper != null); 143Debug.Assert(sortedOutput != null);
System\Linq\Parallel\Scheduling\QueryTask.cs (6)
35Debug.Assert(groupState != null); 46Debug.Assert(o != null); 62Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 75Debug.Assert(o != null); 81Debug.Assert(taskScheduler == TaskScheduler.Default, "PLINQ queries can currently execute only on the default scheduler."); 94Debug.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (4)
73Debug.Assert(rootTask != null, "Expected a non-null task"); 74Debug.Assert(_rootTask == null, "Cannot begin a query more than once"); 86Debug.Assert(_rootTask != null); 158Debug.Assert(_cancellationState.TopLevelDisposedFlag.Value);
System\Linq\Parallel\Scheduling\Scheduling.cs (1)
88Debug.Assert((DEFAULT_BYTES_PER_CHUNK % IntPtr.Size) == 0, "bytes per chunk should be a multiple of pointer size");
System\Linq\Parallel\Scheduling\SpoolingTask.cs (8)
36Debug.Assert(partitions.PartitionCount == channels.Length); 37Debug.Assert(groupState != null); 92Debug.Assert(partitions.PartitionCount == channels.Length); 93Debug.Assert(groupState != null); 136Debug.Assert(groupState != null); 207Debug.Assert(source != null); 296Debug.Assert(source != null); 380Debug.Assert(source != null);
System\Linq\Parallel\Scheduling\SpoolingTaskBase.cs (1)
62Debug.Assert(_groupState.CancellationState.InternalCancellationTokenSource != null);
System\Linq\Parallel\Utils\ExchangeUtilities.cs (1)
71Debug.Assert(returnValue.PartitionCount == partitionCount);
System\Linq\Parallel\Utils\FixedMaxHeap.cs (3)
36Debug.Assert(comparer != null); 133Debug.Assert(_count > 0); 144Debug.Assert(_count > 0);
System\Linq\Parallel\Utils\GrowingArray.cs (1)
56Debug.Assert(newSize > _array.Length);
System\Linq\Parallel\Utils\ListChunk.cs (2)
31Debug.Assert(size > 0); 81Debug.Assert(curr._chunkCount == curr._chunk.Length || curr._nextChunk == null);
System\Linq\Parallel\Utils\Lookup.cs (2)
115Debug.Assert(_defaultKeyGrouping == null, "Cannot insert two groupings with the default key into a lookup."); 121Debug.Assert(!_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (32)
62Debug.Assert(source != null); 63Debug.Assert(groupState != null); 64Debug.Assert(sharedIndices != null); 65Debug.Assert(sharedkeys != null); 66Debug.Assert(sharedValues != null); 67Debug.Assert(sharedBarriers != null); 68Debug.Assert(sharedIndices.Length <= sharedkeys.Length); 69Debug.Assert(sharedIndices.Length == sharedValues.Length); 86Debug.Assert(_sharedKeys.Length >= _sharedValues.Length); 194Debug.Assert(sourceValues != null, "values weren't populated"); 195Debug.Assert(sourceKeys != null, "keys weren't populated"); 203Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 267Debug.Assert(keys != null); 268Debug.Assert(values != null); 269Debug.Assert(keys.Count == values.Count); 425Debug.Assert(myKeysArr != null); 435Debug.Assert(myIndices != null); 451Debug.Assert(mergedIndices != null); 458Debug.Assert(rightIndices != null); 465Debug.Assert(mergedIndices != null); 499Debug.Assert(leftValues != null); 500Debug.Assert(leftKeys != null); 512Debug.Assert(myIndices != null); 522Debug.Assert(leftIndices != null); 529Debug.Assert(mergedIndices != null); 542Debug.Assert(mergedIndices != null); 584Debug.Assert(keys != null, "need a non-null keyset"); 585Debug.Assert(keys.Length >= indices.Length); 586Debug.Assert(left <= right); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length); 608Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) sort failed - bogus IComparer?");
System\Linq\Parallel\Utils\TraceHelpers.cs (1)
22Debug.WriteLine(string.Format(msg, args));
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
29Debug.Assert(_comparer != null); 35Debug.Assert(_comparer != null);
System\Linq\ParallelEnumerable.cs (11)
1524Debug.Assert(source != null); 1525Debug.Assert(reduce != null); 1526Debug.Assert(options.IsValidQueryAggregationOption(), "enum is out of range"); 1547Debug.Assert(source != null); 1548Debug.Assert(func != null); 1549Debug.Assert(seedIsSpecified || typeof(TSource) == typeof(TAccumulate)); 4888Debug.Assert(input != null); 5150Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TSource>>); 5237Debug.Assert(groupings is QueryOperator<IGrouping<TKey, TElement>>); 5334Debug.Assert(queryOp != null, "expected query operator"); 5353Debug.Assert(!e.MoveNext(), "expected only a single element");
System.Linq.Queryable (4)
System\Linq\EnumerableRewriter.cs (4)
227Debug.Assert(matchingMethods.Length > 0, "All static methods with arguments on Queryable have equivalents on Enumerable."); 247Debug.Assert(matchingMethods.Length > 1); 273Debug.Fail("Search should have found a maximal element"); 278Debug.Assert(left.Length == right.Length);
System.Management (1)
System\Management\ManagementPath.cs (1)
674Debug.Assert(nsPath != null);
System.Memory (56)
src\runtime\src\libraries\Common\src\System\Buffers\ArrayBufferWriter.cs (5)
95Debug.Assert(_buffer.Length >= _index); 164Debug.Assert(_buffer.Length > _index); 195Debug.Assert(_buffer.Length > _index); 227Debug.Assert(needed > currentLength); 240Debug.Assert(FreeCapacity > 0 && FreeCapacity >= sizeHint);
src\runtime\src\libraries\Common\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
26Debug.Assert(task.IsCompletedSuccessfully, "Expected that a stored last task completed successfully");
System\Buffers\ReadOnlySequence.cs (9)
81Debug.Assert((startSegment != null && endSegment != null) || 205Debug.Assert(startObject != null); 230Debug.Assert(beginObject != null); 305Debug.Assert(sliceEndIndex >= 0 && startIndex >= 0 && endIndex >= 0); 334Debug.Assert(start <= int.MaxValue - startIndex); 387Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 417Debug.Assert(length <= int.MaxValue - sliceStartIndex); 564Debug.Assert(positionSequenceObject != null); 582Debug.Assert(currentSegment!.RunningIndex + positionIndex >= 0);
System\Buffers\ReadOnlySequence.Helpers.cs (27)
32Debug.Assert(positionObject is ReadOnlySequenceSegment<T>); 58Debug.Assert(positionObject is T[]); 64Debug.Assert(positionObject is string); 70Debug.Assert(type == SequenceType.MemoryManager); 71Debug.Assert(positionObject is MemoryManager<T>); 130Debug.Assert(startIndex < 0 || endIndex < 0); 135Debug.Assert(endIndex < 0); 206Debug.Assert(startIndex < 0 || endIndex < 0); 211Debug.Assert(endIndex < 0); 244Debug.Assert(startObject != null); 260Debug.Assert(startObject == endObject); 280Debug.Assert(startObject != null); 296Debug.Assert(startObject == endObject); 309Debug.Assert(currentSegment != null); // currentSegment parameter is marked as nullable as the parameter is reused/reassigned in the body 310Debug.Assert(offset >= 0); 359Debug.Assert(position.GetObject() != null); 397Debug.Assert(sliceStartIndex >= 0 && startIndex >= 0 && endIndex >= 0); 530Debug.Assert(_endObject != null); 547Debug.Assert(_startObject != null); 564Debug.Assert(_startObject != null); 575Debug.Assert(start <= int.MaxValue); 576Debug.Assert(end <= int.MaxValue); 577Debug.Assert(start <= end); 601Debug.Assert(start <= long.MaxValue); 602Debug.Assert(end <= long.MaxValue); 603Debug.Assert(start <= end); 678Debug.Assert(startIndex < 0);
System\Buffers\SequenceReader.cs (7)
148Debug.Assert(CurrentSpanIndex + offset >= 0); 153Debug.Assert(offset <= int.MaxValue); 335Debug.Assert(count >= 0); 350Debug.Assert(count >= 0); 355Debug.Assert(CurrentSpanIndex < CurrentSpan.Length); 381Debug.Assert(count >= 0); 434Debug.Assert(firstSpan.Length < destination.Length);
System\Buffers\SequenceReader.Search.cs (4)
78Debug.Assert(sequence.Length > 0); 195Debug.Assert(skip >= 0); 439Debug.Assert(sequence.Length > 0); 809Debug.Assert(currentSpan.Length < next.Length);
System\Buffers\SequenceReaderExtensions.Binary.cs (1)
39Debug.Assert(reader.UnreadSpan.Length < sizeof(T));
System\Text\EncodingExtensions.cs (2)
209Debug.Assert(remainingBytes.IsEmpty, "Over-allocated the byte[] instance?"); 395Debug.Assert(span.IsEmpty, "Over-allocated the string instance?");
System.Net.Http (918)
src\runtime\src\libraries\Common\src\System\CharArrayHelpers.cs (4)
13Debug.Assert(array != null, "Null array"); 14Debug.Assert(startIndex >= 0, $"Expected {nameof(startIndex)} to be >= 0, got {startIndex}"); 15Debug.Assert(length >= 0, $"Expected {nameof(length)} to be >= 0, got {length}"); 16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\runtime\src\libraries\Common\src\System\Collections\Generic\BidirectionalDictionary.cs (2)
26Debug.Assert(_forward.Count == _backward.Count, "both the dictionaries must have the same number of elements"); 33Debug.Assert(!_backward.ContainsKey(item2), "No added item1 should ever have existing item2");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\runtime\src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\DynamicTable.cs (2)
76Debug.Assert(_count + 1 <= maxCapacity); 80Debug.Assert(newBufferSize > _count);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackDecoder.cs (5)
182Debug.Fail("HPACK decoder reach an invalid state"); 249Debug.Assert(intResult != 0, "A header name length of 0 should never be encoded with a continuation byte."); 261Debug.Assert(intResult != 0, "A header value length of 0 should never be encoded with a continuation byte."); 315Debug.Assert(_state == State.Ready, "Should be ready to parse a new header."); 608Debug.Assert(_stringLength <= _maxHeadersLength, "String length should have been checked prior to decode.");
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (19)
95Debug.Assert(indexLength >= 1); 127Debug.Assert(indexLength >= 1); 159Debug.Assert(indexLength >= 1); 197Debug.Assert(indexLength >= 1); 369Debug.Assert(Ascii.IsValid(value)); 376Debug.Assert(integerLength >= 1); 382Debug.Assert(status == OperationStatus.Done); 383Debug.Assert(valueBytesWritten == value.Length); 397Debug.Assert(destination.Length >= value.Length); 406Debug.Assert(status == OperationStatus.Done); 407Debug.Assert(bytesWritten == value.Length); 426Debug.Assert(integerLength >= 1); 470Debug.Assert(integerLength >= 1); 481Debug.Assert(written == encodedStringLength); 528Debug.Assert(separator != null); 529Debug.Assert(Ascii.IsValid(separator)); 551Debug.Assert(integerLength >= 1); 603Debug.Assert(success, $"Stack-allocated space was too small for index '{index}'."); 615Debug.Assert(success, $"Stack-allocated space was too small for \"{name}\".");
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (2)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8); 40Debug.Assert((b & ~((1 << prefixLength) - 1)) == 0, "bits other than prefix data must be set to 0.");
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Frames\Http3Frame.cs (1)
43Debug.Assert(VariableLengthIntegerHelper.GetByteCount((long)frameType) == 1, $"{nameof(TryWriteFrameEnvelope)} assumes {nameof(frameType)} will fit within a single byte varint.");
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (9)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 73Debug.Assert(value >= 0 && value <= EightByteLimit, "Serialized values are within [0, 2^62)."); 118Debug.Assert(result); 119Debug.Assert(bytesRead == length); 149Debug.Assert(longToEncode >= 0); 150Debug.Assert(longToEncode <= EightByteLimit); 193Debug.Assert(res); 199Debug.Assert(value >= 0); 200Debug.Assert(value <= EightByteLimit);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackDecoder.cs (4)
233Debug.Fail("QPACK decoder reach an invalid state"); 428Debug.Assert(_state == State.CompressedHeaders, "Should be ready to parse a new header."); 646Debug.Assert(_stringLength <= _maxHeadersLength, "String length should have been checked prior to decode."); 652Debug.Assert(_stringOctets != null, "String buffer should have a value.");
src\runtime\src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\QPackEncoder.cs (14)
42Debug.Assert(res); 97Debug.Assert(res); 106Debug.Assert(res); 167Debug.Assert(res); 177Debug.Assert(res); 204Debug.Assert(written == encodedStringLength); 235Debug.Assert(separator != null); 236Debug.Assert(Ascii.IsValid(separator)); 303Debug.Assert(buffer.Length >= s.Length); 312Debug.Assert(status == OperationStatus.Done); 313Debug.Assert(bytesWritten == s.Length); 318Debug.Assert(Ascii.IsValid(s)); 331Debug.Assert(status == OperationStatus.Done); 332Debug.Assert(valueBytesWritten == s.Length);
src\runtime\src\libraries\Common\src\System\Net\Http\UriRedactionHelper.cs (1)
36Debug.Assert(pathAndQuery is not null);
src\runtime\src\libraries\Common\src\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs (2)
16Debug.Assert(name != null); 290Debug.Assert(potentialHeader != null);
src\runtime\src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (40)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}"); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}"); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}"); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?"); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}"); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\runtime\src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (6)
43Debug.Assert(properties.Length == 15); 52Debug.Assert(cloneEnumerable != null, $"{pi.Name}. Expected enumerable cloned value."); 62Debug.Assert(e2.MoveNext(), $"{pi.Name}. Cloned enumerator too short."); 63Debug.Assert(Equals(e1.Current, e2.Current), $"{pi.Name}. Cloned enumerator's values don't match."); 65Debug.Assert(!e2.MoveNext(), $"{pi.Name}. Cloned enumerator too long."); 79Debug.Assert(Equals(origValue, cloneValue), $"{pi.Name}. Expected: {origValue}, Actual: {cloneValue}");
src\runtime\src\libraries\Common\src\System\StrongToWeakReference.cs (2)
17Debug.Assert(obj != null, "Expected non-null obj"); 28Debug.Assert(_strongRef != null, $"Expected non-null {nameof(_strongRef)} after setting");
src\runtime\src\libraries\Common\src\System\Text\SimpleRegex.cs (1)
68Debug.Assert(patternPos <= pattern.Length);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Http\DiagnosticsHandler.cs (2)
28Debug.Assert(GlobalHttpSettings.DiagnosticsHandler.EnableActivityPropagation); 29Debug.Assert(innerHandler is not null && propagator is not null);
System\Net\Http\DiagnosticsHelper.cs (3)
44Debug.Assert(request.RequestUri is not null); 75Debug.Assert(Enum.GetValues<HttpRequestError>().Length == 12, "We need to extend the mapping in case new values are added to HttpRequestError."); 114Debug.Assert(statusCode >= 400 && statusCode <= 599);
System\Net\Http\Headers\AltSvcHeaderParser.cs (3)
27Debug.Assert(startIndex >= 0); 28Debug.Assert(startIndex < value.Length); 308Debug.Assert(value[startIndex] == '"' && value[startIndex + quotedLength - 1] == '"', $"{nameof(HttpRuleParser.GetQuotedStringLength)} should return {nameof(HttpParseResult.NotParsed)} if the opening/closing quotes are missing.");
System\Net\Http\Headers\AuthenticationHeaderValue.cs (4)
48Debug.Assert(source != null); 118Debug.Assert(startIndex >= 0); 236Debug.Assert(parseEndIndex < input.Length, "Expected string to have at least 1 char"); 237Debug.Assert(input[parseEndIndex] == ',');
System\Net\Http\Headers\ByteArrayHeaderParser.cs (1)
22Debug.Assert(value is byte[]);
System\Net\Http\Headers\CacheControlHeaderParser.cs (1)
48Debug.Assert(isInvalidValue || storeValue == null || temp != null, "'storeValue' is not of type CacheControlHeaderValue");
System\Net\Http\Headers\CacheControlHeaderValue.cs (5)
67Debug.Assert(sizeof(Flags) == sizeof(int)); 171Debug.Assert(source != null); 351Debug.Assert(startIndex >= 0); 371Debug.Assert(nameValue is not null); 491Debug.Assert(nameValue != null);
System\Net\Http\Headers\ContentDispositionHeaderValue.cs (5)
134Debug.Assert(source != null); 209Debug.Assert(startIndex >= 0); 255Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length)); 337Debug.Assert(nameParameter.Value != null); 447Debug.Assert(input != null);
System\Net\Http\Headers\ContentRangeHeaderValue.cs (2)
86Debug.Assert(source != null); 159Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\CookieHeaderParser.cs (1)
22Debug.Assert(index == 0);
System\Net\Http\Headers\DateHeaderParser.cs (1)
22Debug.Assert(value is DateTimeOffset);
System\Net\Http\Headers\EntityTagHeaderValue.cs (3)
47Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0); 129Debug.Assert(tagLength != input.Length || (startIndex == 0 && !isWeak));
System\Net\Http\Headers\GenericHeaderParser.cs (1)
59Debug.Assert(getParsedValueLength != null);
System\Net\Http\Headers\HeaderDescriptor.cs (8)
33Debug.Assert(customHeader || KnownHeaders.TryGetKnownHeader(headerName) is null, $"The {nameof(KnownHeader)} overload should be used for {headerName}"); 63Debug.Assert(!string.IsNullOrEmpty(headerName)); 85Debug.Assert(headerName.Length > 0); 106Debug.Assert(index >= 0); 110Debug.Assert(qpackStaticTable.Length == 99); 129Debug.Assert(_descriptor is KnownHeader); 130Debug.Assert(HeaderType != HttpHeaderType.Custom); 304Debug.Assert(candidate is null || candidate.Length == contentTypeValue.Length);
System\Net\Http\Headers\HeaderUtilities.cs (8)
32Debug.Assert(parameters != null); 124Debug.Assert(parameters != null); 208Debug.Assert(xItem != null); 235Debug.Assert(Array.TrueForAll(alreadyFound, value => value), 244Debug.Assert(input != null); 245Debug.Assert(startIndex <= input.Length); // it's OK if index == value.Length. 275Debug.Assert(store != null); 292Debug.Assert(store != null);
System\Net\Http\Headers\HttpGeneralHeaders.cs (1)
151Debug.Assert(parent != null);
System\Net\Http\Headers\HttpHeaderParser.cs (4)
35Debug.Assert(!string.IsNullOrEmpty(separator)); 36Debug.Assert(Ascii.IsValid(separator)); 55Debug.Assert((value == null) || ((index >= 0) && (index <= value.Length))); 73Debug.Assert(value != null);
System\Net\Http\Headers\HttpHeaders.cs (65)
68Debug.Assert((allowedHeaderTypes & treatAsCustomHeaderTypes) == 0); 101Debug.Assert(!Contains(descriptor)); 154Debug.Assert(!Contains(descriptor)); 184Debug.Assert(currentValue is string); 341Debug.Assert(singleValue is not null ^ multiValue is not null); 353Debug.Assert(multiValue is not null && multiValue.Length > 0); 371Debug.Assert(singleValue is not null ^ multiValue is not null); 394Debug.Assert(_headerStore is not null); 397Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty"); 444Debug.Assert(value != null); 445Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 451Debug.Assert(descriptor.Parser.SupportsMultipleValues, $"Header '{descriptor.Name}' doesn't support multiple values"); 458Debug.Assert(value != null); 459Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 489Debug.Assert(value != null); 495Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 496Debug.Assert(descriptor.Parser.SupportsMultipleValues, 514Debug.Assert(parsedValue.GetType() == value.GetType(), 531Debug.Assert(item.GetType() == value.GetType(), 573Debug.Assert(headerRemoved, $"Existing header '{descriptor.Name}' couldn't be removed."); 584Debug.Assert(value != null); 590Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available."); 591Debug.Assert(descriptor.Parser.SupportsMultipleValues, 609Debug.Assert(parsedValue.GetType() == value.GetType(), 621Debug.Assert(item.GetType() == value.GetType(), 640Debug.Assert(sourceHeaders != null); 641Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type."); 680Debug.Assert(sourceValue is string); 732Debug.Assert(source is not InvalidValue); 778Debug.Assert(!Contains(descriptor)); 784Debug.Assert((descriptor.HeaderType & _treatAsCustomHeaderTypes) == 0); 836Debug.Assert(value is string); 856Debug.Assert(!info.IsEmpty); 869Debug.Assert(rawValue is not null); 874Debug.Assert(info.ParsedAndInvalidValues is not null); 882Debug.Assert(Monitor.IsEntered(info)); 921Debug.Assert(!Contains(descriptor)); 931Debug.Assert(info != null); 932Debug.Assert(descriptor.Parser != null); 964Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1007Debug.Assert(value != null); 1017Debug.Assert(!(value is List<object>), 1050Debug.Assert(currentStoreValue is T); 1054Debug.Assert(value is T); 1103Debug.Assert(info != null); 1104Debug.Assert(descriptor.Parser != null); 1129Debug.Assert(index < value.Length, "Parser must return an index value within the string length."); 1219Debug.Assert(singleValue is not null ^ multiValue is not null); 1228Debug.Assert(sourceValues is string); 1247Debug.Assert(length > 1, "The header should have been removed when it became empty"); 1255Debug.Assert(currentIndex == length); 1266Debug.Assert(sourceValues is string); 1280Debug.Assert(length > 0); 1290Debug.Assert(currentIndex == length); 1298Debug.Assert(info != null); 1299Debug.Assert(Monitor.IsEntered(info)); 1324Debug.Assert(item != null); 1334Debug.Assert(value != null); 1351Debug.Assert(value is not null); 1367Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header."); 1390Debug.Assert(item is not InvalidValue); 1395Debug.Assert(ParsedAndInvalidValues is not InvalidValue); 1439Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser"); 1579Debug.Assert(dictionary.Count == _count - 1); 1597Debug.Assert(!Contains(entry.Key));
System\Net\Http\Headers\HttpHeadersNonValidated.cs (2)
69Debug.Assert(singleValue is not null ^ multiValue is not null); 146Debug.Assert(singleValue is not null ^ multiValue is not null);
System\Net\Http\Headers\HttpHeaderValueCollection.cs (5)
102Debug.Assert(storeValue is T); 116Debug.Assert(item is T); 153Debug.Assert(item is T); 159Debug.Assert(storeValue is T); 190Debug.Assert(typeof(T) == typeof(string));
System\Net\Http\Headers\HttpRequestHeaders.cs (1)
277Debug.Assert(sourceRequestHeaders != null);
System\Net\Http\Headers\HttpResponseHeaders.cs (1)
149Debug.Assert(sourceResponseHeaders != null);
System\Net\Http\Headers\Int32NumberHeaderParser.cs (1)
26Debug.Assert(value is int);
System\Net\Http\Headers\Int64NumberHeaderParser.cs (1)
26Debug.Assert(value is long);
System\Net\Http\Headers\KnownHeader.cs (3)
17Debug.Assert(!string.IsNullOrEmpty(name)); 18Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 29Debug.Assert(asciiBytes == name.Length);
System\Net\Http\Headers\MediaTypeHeaderParser.cs (1)
19Debug.Assert(mediaTypeCreator != null);
System\Net\Http\Headers\MediaTypeHeaderValue.cs (4)
85Debug.Assert(source != null); 178Debug.Assert(mediaTypeCreator != null); 179Debug.Assert(startIndex >= 0); 228Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length));
System\Net\Http\Headers\NameValueHeaderValue.cs (10)
54Debug.Assert(source != null); 62Debug.Assert(_name != null); 168Debug.Assert(destination != null); 209Debug.Assert(input != null); 210Debug.Assert(startIndex >= 0); 211Debug.Assert(nameValueCreator != null); 268Debug.Assert(nameValueCollection != null); 269Debug.Assert(startIndex >= 0); 306Debug.Assert((name != null) && (name.Length > 0)); 325Debug.Assert(input != null);
System\Net\Http\Headers\NameValueWithParametersHeaderValue.cs (3)
98Debug.Assert(input != null); 99Debug.Assert(startIndex >= 0); 120Debug.Assert(nameValueWithParameters != null);
System\Net\Http\Headers\ObjectCollection.cs (5)
41Debug.Assert(item != null); 53Debug.Assert(_size == 1); 72Debug.Assert(_size > 0); 73Debug.Assert(_size == array.Length); 103Debug.Assert(_size == 0 || _size == 1);
System\Net\Http\Headers\ProductHeaderValue.cs (2)
45Debug.Assert(source != null); 106Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\ProductInfoHeaderValue.cs (4)
38Debug.Assert(source != null); 48Debug.Assert(_comment != null); 76Debug.Assert(_comment != null); 117Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 75Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RangeHeaderValue.cs (3)
43Debug.Assert(source != null); 133Debug.Assert(startIndex >= 0); 171Debug.Assert(current == input.Length, "GetRangeItemListLength() should consume the whole string or fail.");
System\Net\Http\Headers\RangeItemHeaderValue.cs (4)
46Debug.Assert(source != null); 82Debug.Assert(rangeCollection != null); 83Debug.Assert(startIndex >= 0); 129Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\RetryConditionHeaderValue.cs (2)
38Debug.Assert(source != null); 79Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\StringWithQualityHeaderValue.cs (2)
42Debug.Assert(source != null); 87Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\TimeSpanHeaderParser.cs (1)
20Debug.Assert(value is TimeSpan);
System\Net\Http\Headers\TransferCodingHeaderParser.cs (1)
25Debug.Assert(transferCodingCreator != null);
System\Net\Http\Headers\TransferCodingHeaderValue.cs (3)
28Debug.Assert(source != null); 63Debug.Assert(transferCodingCreator != null); 64Debug.Assert(startIndex >= 0);
System\Net\Http\Headers\UriHeaderParser.cs (1)
90Debug.Assert(value is Uri);
System\Net\Http\Headers\ViaHeaderValue.cs (3)
71Debug.Assert(source != null); 139Debug.Assert(startIndex >= 0); 157Debug.Assert(protocolVersion != null);
System\Net\Http\Headers\WarningHeaderValue.cs (3)
67Debug.Assert(source != null); 137Debug.Assert(startIndex >= 0); 220Debug.Fail("Unable to parse value even though it was parsed as <=3 digits string. Input: '" +
System\Net\Http\HttpClient.cs (2)
134Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue); 626Debug.Assert(_timeout.TotalSeconds > 0);
System\Net\Http\HttpContent.cs (42)
54Debug.Assert(encoding != null); 56Debug.Assert(codePage == encoding.CodePage, 62Debug.Assert(preamble.SequenceEqual(actualPreamble), 72Debug.Assert(_headers is null); 73Debug.Assert(headers is not null); 93Debug.Assert(IsBuffered); 108Debug.Assert(IsBuffered); 126Debug.Assert(firstBuffer.Length >= 4 || firstBuffer.Length == stream.Length); 204Debug.Assert(_bufferedContent != null); 264Debug.Assert(_contentReadStream is Stream, $"Expected a Stream, got ${_contentReadStream}"); 293Debug.Assert(_contentReadStream is Task<Stream>, $"Expected a Task<Stream>, got ${_contentReadStream}"); 622Debug.Assert(contentLength >= 0); 706Debug.Assert(StreamCopyExceptionNeedsWrapping(e)); 713Debug.Assert(encoding != null); 820Debug.Assert(maxBufferSize >= 0); 821Debug.Assert(expectedFinalSize >= 0); 839Debug.Assert(_pooledBuffers is null); 840Debug.Assert(!_lastBufferIsPooled); 856Debug.Assert(!_shouldPoolFinalSize || _expectedFinalSize == 0); 860Debug.Assert(_pooledBuffers is null); 877Debug.Assert(!_lastBufferIsPooled); 878Debug.Assert(_pooledBuffers is null); 892Debug.Assert(!_lastBufferIsPooled); 893Debug.Assert(_pooledBuffers is null); 894Debug.Assert(_lastBufferOffset == _totalLength); 895Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 902Debug.Assert(_lastBufferIsPooled || _pooledBuffers is null); 938Debug.Assert(_totalLength + buffer.Length <= _maxBufferSize); 966Debug.Assert(newBufferCapacity > 0); 993Debug.Assert(_pooledBuffers is null); 994Debug.Assert(_lastBufferOffset == 0); 995Debug.Assert(_totalLength == 0); 998Debug.Assert(_shouldPoolFinalSize || newBuffer.Length != _expectedFinalSize); 1006Debug.Assert(_lastBufferIsPooled); 1013Debug.Assert(remainingInCurrentBuffer.Length < buffer.Length); 1039Debug.Assert(bufferCount <= 16); 1055Debug.Assert(destination.Length >= _totalLength); 1059Debug.Assert(buffers.Length > 0 && buffers[0] is not null); 1068Debug.Assert(destination.Length >= buffer.Length); 1075Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 1076Debug.Assert(_lastBufferOffset <= destination.Length); 1098Debug.Assert(_lastBuffer is not null);
System\Net\Http\HttpMethod.SocketsHttpHandler.cs (1)
56Debug.Assert(Ascii.IsValid(Method));
System\Net\Http\HttpRequestMessage.cs (1)
260Debug.Assert(value);
System\Net\Http\HttpResponseMessage.cs (1)
118Debug.Assert(headers.ContainsTrailingHeaders);
System\Net\Http\HttpRuleParser.cs (14)
38Debug.Assert(input is not null); 55Debug.Assert(IsToken(input)); 62Debug.Assert(input != null); 96Debug.Assert(input != null); 97Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 140Debug.Assert(input != null); 141Debug.Assert(startIndex >= 0); 191Debug.Assert(input != null); 192Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 227Debug.Assert(input != null); 228Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 280Debug.Fail("'NotParsed' is unexpected: We started nested expression " + 290Debug.Fail("Unknown enum result: " + nestedResult); 323Debug.Assert(!ContainsNewLineOrNull(host.ToString()));
System\Net\Http\HttpTelemetry.AnyOS.cs (1)
27Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\HttpTelemetry.cs (5)
50Debug.Assert(request.RequestUri != null && request.RequestUri.IsAbsoluteUri); 185Debug.Assert(redirectUri.IsAbsoluteUri); 203Debug.Assert(count >= 0); 218Debug.Assert(count >= 0); 233Debug.Assert(count >= 0);
System\Net\Http\MessageProcessingHandler.cs (1)
143Debug.Assert(handler != null);
System\Net\Http\Metrics\MetricsHandler.cs (3)
90Debug.Fail($"Decrement for non-existing request {key}"); 138Debug.Assert(GlobalHttpSettings.MetricsHandler.IsGloballyEnabled); 174Debug.Assert(GlobalHttpSettings.MetricsHandler.IsGloballyEnabled);
System\Net\Http\MultipartContent.cs (4)
160Debug.Assert(stream != null); 204Debug.Assert(stream != null); 238Debug.Assert(task.IsCompleted); 412Debug.Assert(streams != null);
System\Net\Http\NetEventSource.Http.cs (4)
24Debug.Assert(Log.IsEnabled()); 35Debug.Assert(Log.IsEnabled()); 58Debug.Assert(Log.IsEnabled()); 69Debug.Assert(Log.IsEnabled());
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.cs (5)
236Debug.Assert(pool.PreAuthCredentials != null); 242Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NegotiateScheme) == null); 243Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NtlmScheme) == null); 244Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, DigestScheme) == null); 382Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.Digest.cs (4)
108Debug.Assert(request.RequestUri != null); 222Debug.Assert(written == SHA256.HashSizeInBytes); 229Debug.Assert(written == MD5.HashSizeInBytes); 316Debug.Assert(currentIndex < data.Length && !CharIsSpaceOrTab(data[currentIndex]));
System\Net\Http\SocketsHttpHandler\AuthenticationHelper.NtAuth.cs (1)
212Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (20)
25Debug.Assert(response != null, "The HttpResponseMessage cannot be null."); 71Debug.Assert(_connection.RemainingBuffer.Length == 0); 72Debug.Assert(buffer.Length != 0); 154Debug.Assert(_state == ParsingState.Done); 166Debug.Assert(_connection != null); 187Debug.Assert(_connection.RemainingBuffer.Length == 0); 188Debug.Assert(buffer.Length != 0); 296Debug.Assert(buffer.Length > 0); 305Debug.Assert(bytesRead.Length <= buffer.Length); 315Debug.Assert(_connection != null); 323Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 359Debug.Assert(_chunkBytesRemaining > 0); 368Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); 380Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 396Debug.Assert(_chunkBytesRemaining == 0, $"Expected {nameof(_chunkBytesRemaining)} == 0, got {_chunkBytesRemaining}"); 421Debug.Fail($"Unexpected state: {_state}"); 470Debug.Assert(_connection != null); 528Debug.Assert(_connection is not null); 532Debug.Assert(fillTask.IsCompleted); 538Debug.Assert(_connection is not null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingWriteStream.cs (3)
26Debug.Assert(connection._currentRequest != null); 36Debug.Assert(writeTask.IsCompleted); 50Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectHelper.cs (1)
48Debug.Assert(localRequest != null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\ConnectionSetupDistributedTracing.cs (5)
28Debug.Assert(serverAddress is not null, "serverAddress should not be null when System.Net.Http.EnableActivityPropagation is true."); 43Debug.Assert(activity is not null); 61Debug.Assert(exception is not null); 68Debug.Assert(errorType is not null, "DiagnosticsHelper.TryGetErrorType() should succeed whenever an exception is provided."); 83Debug.Assert(connectionSetupActivity is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (46)
91Debug.Assert(host is not null || (kind == HttpConnectionKind.Proxy && proxyUri is not null)); 106Debug.Assert(host != null); 107Debug.Assert(port != 0); 108Debug.Assert(sslHostName == null); 109Debug.Assert(proxyUri == null); 115Debug.Assert(host != null); 116Debug.Assert(port != 0); 117Debug.Assert(sslHostName != null); 118Debug.Assert(proxyUri == null); 122Debug.Assert(host == null); 123Debug.Assert(port == 0); 124Debug.Assert(sslHostName == null); 125Debug.Assert(proxyUri != null); 132Debug.Assert(host != null); 133Debug.Assert(port != 0); 134Debug.Assert(sslHostName == null); 135Debug.Assert(proxyUri != null); 144Debug.Assert(host != null); 145Debug.Assert(port != 0); 146Debug.Assert(sslHostName != null); 147Debug.Assert(proxyUri != null); 153Debug.Assert(host != null); 154Debug.Assert(port != 0); 155Debug.Assert(sslHostName == null); 156Debug.Assert(proxyUri != null); 169Debug.Assert(host != null); 170Debug.Assert(port != 0); 171Debug.Assert(proxyUri != null); 177Debug.Fail("Unknown HttpConnectionKind in HttpConnectionPool.ctor"); 204Debug.Assert(Encoding.ASCII.GetString(_hostHeaderLineBytes) == $"Host: {hostHeader}\r\n"); 275Debug.Assert(sslHostName != null); 310Debug.Assert(!Monitor.IsEntered(_http11Connections)); 426Debug.Assert(async); 466Debug.Assert(connection is not null || !_http2Enabled); 515Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries); 558Debug.Assert(CanFallBackToHttp11(request)); 559Debug.Assert(_http2SessionAuthSeen); 567Debug.Assert(http11ConnectionWaiter is null || http2ConnectionWaiter?.ConnectionCancellationTokenSource is null); 633Debug.Assert(stream != null); 826Debug.Assert(_proxyUri != null); 836Debug.Assert(e is not HttpRequestException); 882Debug.Assert(desiredVersion == 2 || desiredVersion == 3); 904Debug.Assert(!HasSyncObjLock); 950Debug.Assert(!HasSyncObjLock); 1007Debug.Fail($"Unexpected exception while evaluating connections for eviction: {e}"); 1061Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"Expected {nameof(_availableHttp2Connections)}.{nameof(_availableHttp2Connections.Count)} == 0");
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (14)
105Debug.Assert(_associatedHttp11ConnectionCount >= connectionCount + _pendingHttp11ConnectionCount, 108Debug.Assert(_associatedHttp11ConnectionCount <= _maxHttp11Connections, 110Debug.Assert(_associatedHttp11ConnectionCount >= _pendingHttp11ConnectionCount, 126Debug.Assert(success == waiter is not null); 173Debug.Assert(connection is not null); 221Debug.Assert(HasSyncObjLock); 289Debug.Assert(connectionException is not null); 316Debug.Assert(_associatedHttp11ConnectionCount > 0); 317Debug.Assert(_pendingHttp11ConnectionCount > 0); 344Debug.Assert(_pendingHttp11ConnectionCount > 0); 421Debug.Assert(_associatedHttp11ConnectionCount > 0); 422Debug.Assert(!disposing || Array.IndexOf(_http11Connections.ToArray(), connection) < 0); 440Debug.Assert(pool.HasSyncObjLock); 441Debug.Assert(connections.Count <= pool._associatedHttp11ConnectionCount);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (24)
75Debug.Assert(_kind is HttpConnectionKind.Https or HttpConnectionKind.SslProxyTunnel or HttpConnectionKind.Http or HttpConnectionKind.ProxyTunnel or HttpConnectionKind.SocksTunnel or HttpConnectionKind.SslSocksTunnel); 149Debug.Assert(HasSyncObjLock); 250Debug.Assert(connectionException is not null); 288Debug.Assert(_associatedHttp2ConnectionCount > 0); 289Debug.Assert(_pendingHttp2Connection); 318Debug.Assert(_pendingHttp2Connection); 319Debug.Assert(_associatedHttp2ConnectionCount > 0); 388Debug.Assert(!HasSyncObjLock); 389Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 395Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 396Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 414Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection), $"HTTP2 connection already in available list"); 415Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0), 420Debug.Assert(_pendingHttp2Connection); 438Debug.Assert((_availableHttp2Connections?.Count ?? 0) == 0, $"With {(_availableHttp2Connections?.Count ?? 0)} available HTTP2 connections, we shouldn't have a waiter."); 457Debug.Assert(!added); 476Debug.Assert(_disposed); 487Debug.Assert(initialRequestWaiter is not null, "Expect request for a new connection"); 539Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 540Debug.Assert(_associatedHttp2ConnectionCount > 0); 565Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count); 597Debug.Assert(!HasSyncObjLock); 613Debug.Assert(!HasSyncObjLock); 623Debug.Assert(removed);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (35)
66Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 68Debug.Assert(_kind == HttpConnectionKind.Https); 69Debug.Assert(_http3Enabled); 134Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 209Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 211Debug.Assert(HasSyncObjLock); 248Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 293Debug.Assert(connectionSetupActivity?.IsStopped is not true); 332Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 348Debug.Assert(_associatedHttp3ConnectionCount > 0); 349Debug.Assert(_pendingHttp3Connection); 363Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 367Debug.Assert(!HasSyncObjLock); 368Debug.Assert(isNewConnection || initialRequestWaiter is null, "Shouldn't have a request unless the connection is new"); 374Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 375Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 393Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection), $"HTTP3 connection already in available list"); 394Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0), 399Debug.Assert(_pendingHttp3Connection); 417Debug.Assert((_availableHttp3Connections?.Count ?? 0) == 0, $"With {(_availableHttp3Connections?.Count ?? 0)} available HTTP3 connections, we shouldn't have a waiter."); 436Debug.Assert(!added); 457Debug.Assert(_disposed); 485Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 506Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 507Debug.Assert(_associatedHttp3ConnectionCount > 0); 528Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 537Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 564Debug.Assert(GlobalHttpSettings.SocketsHttpHandler.AllowHttp3); 662Debug.Assert(parsedValue is not null); 674Debug.Assert(_authorityExpireTimer != null || _disposed); 772Debug.Assert(HasSyncObjLock); 811Debug.Assert(badAuthority != null); 861Debug.Assert(_authorityExpireTimer != null); 865Debug.Assert(_altSvcBlocklistTimerCancellation != null); 898Debug.Assert(_authorityExpireTimer != null || _disposed);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (2)
33Debug.Assert(typeof(T) == typeof(HttpConnection) || typeof(T) == typeof(Http2Connection)); 68Debug.Assert(connection is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (3)
50Debug.Assert(_size > 0); 166Debug.Assert(_attemptedConnectionsOffset >= 0); 167Debug.Assert(_attemptedConnectionsOffset < _size, $"{_attemptedConnectionsOffset} < {_size}");
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (12)
19Debug.Assert(contentLength > 0, "Caller should have checked for 0."); 31Debug.Assert(_contentBytesRemaining > 0); 44Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 67Debug.Assert(_contentBytesRemaining > 0); 106Debug.Assert((ulong)bytesRead <= _contentBytesRemaining); 146Debug.Assert(_connection != null); 174Debug.Assert(maxBytesToRead > 0); 175Debug.Assert(_contentBytesRemaining > 0); 176Debug.Assert(_connection != null); 185Debug.Assert(bytesToConsume > 0); 197Debug.Assert(_connection != null); 198Debug.Assert(_contentBytesRemaining > 0);
System\Net\Http\SocketsHttpHandler\ContentLengthWriteStream.cs (2)
33Debug.Assert(connection._currentRequest != null); 47Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (2)
18Debug.Assert(valuesArray.Length > 0, "No values for header??"); 19Debug.Assert(response.RequestMessage != null && response.RequestMessage.RequestUri != null);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (7)
22Debug.Assert(owner != null); 23Debug.Assert(!string.IsNullOrWhiteSpace(name)); 97Debug.Assert(_current <= 0 || _waitersTail is null, "Shouldn't have waiters when credit is available"); 105Debug.Assert(waiter != null); 111Debug.Assert(_waitersTail == waiter); 161Debug.Assert(Monitor.IsEntered(SyncObject), "Shouldn't be called outside lock."); 167Debug.Assert(_waitersTail is null, "Shouldn't have waiters when credit is available");
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (10)
33Debug.Assert(decompressionMethods != DecompressionMethods.None); 34Debug.Assert(innerHandler != null); 100Debug.Assert(response.Content != null); 103Debug.Assert(contentEncodings is string[] { Length: > 0 }); 184Debug.Assert(task.IsCompleted); 352Debug.Assert(_firstByteStatus == FirstByteStatus.None); 368Debug.Assert(_firstByteStatus == FirstByteStatus.None); 398Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 416Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 422Debug.Assert(_firstByteStatus != FirstByteStatus.None);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (57)
239Debug.Assert(requiredSpace == _outgoingBuffer.ActiveLength); 288Debug.Assert(Monitor.IsEntered(SyncObject)); 289Debug.Assert(!_pool.HasSyncObjLock); 309Debug.Assert(!_pool.HasSyncObjLock); 332Debug.Assert(!_pool.HasSyncObjLock); 338Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 342Debug.Assert(_streamsInUse >= _httpStreams.Count); 363Debug.Assert(!_pool.HasSyncObjLock); 367Debug.Assert(_availableStreamsWaiter is null, "As used currently, shouldn't already have a waiter"); 389Debug.Assert(Monitor.IsEntered(SyncObject)); 393Debug.Assert(_shutdown != result); 522Debug.Assert(InitialSettingsReceived.Task.IsCompleted); 563Debug.Assert(bytesRead >= 0); 664Debug.Assert(frameHeader.Type == FrameType.Headers); 767Debug.Assert(frameHeader.Type == FrameType.AltSvc); 768Debug.Assert(!Monitor.IsEntered(SyncObject)); 796Debug.Assert(frameHeader.Type == FrameType.Data); 825Debug.Assert(frameHeader.Type == FrameType.Settings); 861Debug.Assert((settings.Length % 6) == 0); 952Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 965Debug.Assert(newSize >= 0); 982Debug.Assert(frameHeader.Type == FrameType.Priority); 996Debug.Assert(frameHeader.Type == FrameType.Ping); 1011Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1030Debug.Assert(frameHeader.Type == FrameType.WindowUpdate); 1040Debug.Assert(amount >= 0); 1067Debug.Assert(frameHeader.Type == FrameType.RstStream); 1100Debug.Assert(lastStreamId >= 0); 1115Debug.Assert(streamId == kvp.Value.StreamId); 1133Debug.Assert(frameHeader.Type == FrameType.GoAway); 1169Debug.Assert(canceled, "Callback should have been unregistered if the operation was completing successfully."); 1216Debug.Assert(_shutdown && _streamsInUse == 0); 1296Debug.Fail($"Unexpected exception in {nameof(ProcessOutgoingFramesAsync)}: {e}"); 1336Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1363Debug.Assert(!_pool.HasSyncObjLock); 1492Debug.Assert(headerValuesCount > 0, "No values for header??"); 1567Debug.Assert(request.RequestUri != null); 1699Debug.Assert(headerBytes.Length > 0); 1745Debug.Assert(span.Length == 0); 1825Debug.Assert(amount > 0); 1841Debug.Assert(amount > 0); 1842Debug.Assert(_pendingWindowUpdate < ConnectionWindowThreshold); 1887Debug.Assert(pending >= 0); 1913Debug.Assert(streamId == kvp.Value.StreamId); 1930Debug.Assert(_shutdown); 1931Debug.Assert(_streamsInUse == 0); 1938Debug.Assert(completed, "FinalTeardown was called twice"); 1993Debug.Assert(streamId >= 0); 2009Debug.Assert(buffer.Length >= Size); 2021Debug.Assert(destination.Length >= Size); 2022Debug.Assert(type <= FrameType.Last); 2023Debug.Assert((flags & FrameFlags.ValidBits) == flags); 2024Debug.Assert((uint)payloadLength <= MaxPayloadLength); 2078Debug.Assert(async); 2079Debug.Assert(!_pool.HasSyncObjLock); 2191Debug.Fail($"Stream {http2Stream.StreamId} not found in dictionary during RemoveStream???"); 2261Debug.Fail($"Unexpected keep alive state ({_keepAliveState})");
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (71)
170Debug.Assert(_response != null); 182Debug.Assert(_requestCompletionState == StreamCompletionState.Completed); 187Debug.Assert(_requestBodyCancellationSource != null); 245Debug.Assert(!Monitor.IsEntered(SyncObject)); 248Debug.Assert(_requestCompletionState == StreamCompletionState.InProgress, $"Request already completed with state={_requestCompletionState}"); 255Debug.Assert(_responseCompletionState == StreamCompletionState.Completed); 257Debug.Assert(!ConnectProtocolEstablished); 265Debug.Assert(!sendReset); 269Debug.Assert(!ConnectProtocolEstablished); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 291Debug.Assert(_requestCompletionState == StreamCompletionState.InProgress, $"Request already completed with state={_requestCompletionState}"); 322Debug.Assert(!ConnectProtocolEstablished); 335Debug.Assert(_request?.Content != null); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 365Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 366Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 367Debug.Assert(_requestCompletionState == StreamCompletionState.Failed || _responseCompletionState == StreamCompletionState.Failed, 383Debug.Assert(Monitor.IsEntered(SyncObject)); 384Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 385Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 410Debug.Assert(!Monitor.IsEntered(SyncObject)); 416Debug.Assert(requestBodyCancellationSource != null); 453Debug.Assert(Monitor.IsEntered(SyncObject)); 555Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 578Debug.Assert(index >= FirstHPackRequestPseudoHeaderId && index <= LastHPackNormalHeaderId); 619Debug.Assert(!Monitor.IsEntered(SyncObject)); 641Debug.Assert(_response != null); 683Debug.Assert(!Monitor.IsEntered(SyncObject)); 710Debug.Assert(_trailers != null); 716Debug.Assert(_response != null && _response.Content != null); 722Debug.Assert(_response != null); 731Debug.Assert(name.Length > 0); 763Debug.Assert(!Monitor.IsEntered(SyncObject)); 786Debug.Assert(!Monitor.IsEntered(SyncObject)); 827Debug.Assert(_responseCompletionState == StreamCompletionState.InProgress, $"Response already completed with state={_responseCompletionState}"); 850Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 901Debug.Assert(_responseCompletionState == StreamCompletionState.InProgress, $"Response already completed with state={_responseCompletionState}"); 924Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 949Debug.Assert(!Monitor.IsEntered(SyncObject)); 988Debug.Assert(requestBodyCancellationSource != null); 1001Debug.Assert(_requestBodyAbandoned); 1002Debug.Assert(!cancel); 1013Debug.Assert(Monitor.IsEntered(SyncObject)); 1034Debug.Assert(!Monitor.IsEntered(SyncObject)); 1040Debug.Assert(!_hasWaiter); 1067Debug.Assert(!wait); 1070Debug.Assert(_response is not null); 1079Debug.Assert(_response != null && _response.Content != null); 1108Debug.Assert(!Monitor.IsEntered(SyncObject)); 1127Debug.Assert(_responseProtocolState == ResponseProtocolState.ExpectingData || _responseProtocolState == ResponseProtocolState.ExpectingTrailingHeaders); 1129Debug.Assert(!_hasWaiter); 1143Debug.Assert(bytesRead == 0); 1146Debug.Assert(!wait); 1167Debug.Assert(bytesRead == 0); 1170Debug.Assert(!wait); 1197Debug.Assert(bytesRead == 0); 1200Debug.Assert(!wait); 1233Debug.Assert(bytesRead == 0); 1236Debug.Assert(!wait); 1268Debug.Assert(_requestBodyCancellationSource != null); 1311Debug.Assert(_creditWaiter != null); 1324Debug.Assert(sendSize > 0); 1376Debug.Assert(!Monitor.IsEntered(SyncObject)); 1421Debug.Assert(!Monitor.IsEntered(SyncObject)); 1435Debug.Assert(!_waitSource.RunContinuationsAsynchronously); 1441Debug.Assert(_waitSource.RunContinuationsAsynchronously); 1459Debug.Assert(!Monitor.IsEntered(thisRef.SyncObject)); 1517Debug.Assert(contentLength >= -1); 1551Debug.Assert(http2Stream != null); 1552Debug.Assert(http2Stream._response != null);
System\Net\Http\SocketsHttpHandler\Http2StreamWindowManager.cs (5)
48Debug.Assert(_lastWindowUpdate != default); // Make sure Start() has been invoked, otherwise we should not be receiving DATA. 49Debug.Assert(bytesConsumed > 0); 50Debug.Assert(_deliveredBytes < StreamWindowThreshold); 120Debug.Assert(_streamWindowSize <= MaxStreamWindowSize); 244Debug.Assert(payload < 0);
System\Net\Http\SocketsHttpHandler\Http3Connection.cs (16)
67Debug.Assert(Monitor.IsEntered(SyncObj)); 133Debug.Assert(Monitor.IsEntered(SyncObj)); 134Debug.Assert(ShuttingDown); 193Debug.Assert(singleConnection || _availableRequestStreamsCount >= 0); 214Debug.Assert(!_pool.Settings.EnableMultipleHttp3Connections || _availableRequestStreamsCount >= 0); 226Debug.Assert(_connection is null || connection == _connection); 230Debug.Assert(_availableStreamsWaiter is null || _availableRequestStreamsCount >= 0); 245Debug.Assert(_pool.Settings.EnableMultipleHttp3Connections, "Calling WaitForAvailableStreamsAsync() is invalid when EnableMultipleHttp3Connections is false."); 249Debug.Assert(_availableRequestStreamsCount >= 0); 260Debug.Assert(_availableStreamsWaiter is null); 507Debug.Assert(ex.ApplicationErrorCode.HasValue); 524Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit); 568Debug.Assert(ex.ApplicationErrorCode.HasValue); 695Debug.Assert(ex.ApplicationErrorCode.HasValue); 960Debug.Assert(!Started); 993Debug.Assert(_activity?.IsStopped != false);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (22)
253Debug.Assert(_response != null && _response.Content != null); 293Debug.Assert(ex.ApplicationErrorCode.HasValue); 317Debug.Assert(ex.ApplicationErrorCode.HasValue); 355Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested); 383Debug.Fail($"Unexpected exception type in Http3RequestStream.SendAsync: {ex}"); 410Debug.Assert(_response == null); 427Debug.Assert(_response != null); 627Debug.Fail($"Received unexpected frame type {frameType}."); 669Debug.Assert(_sendBuffer.ActiveLength == 0); 693Debug.Assert(request.RequestUri != null); 753Debug.Assert(actualHeadersLengthEncodedSize == headersLengthEncodedSize); 781Debug.Assert(headerValuesCount > 0, "No values for header??"); 993Debug.Assert(name.Length > 0); 1082Debug.Fail(message); 1155Debug.Fail($"Unexpected {nameof(Http3RequestStream)}.{nameof(_headerState)} '{_headerState}'."); 1163Debug.Fail($"This has no use in HTTP/3 and should never be called by {nameof(QPackDecoder)}."); 1196Debug.Assert(_response == null); 1269Debug.Assert(_response == null); 1348Debug.Assert(e.ApplicationErrorCode.HasValue); 1353Debug.Assert(e.ApplicationErrorCode.HasValue); 1510Debug.Assert(_response != null); 1523Debug.Assert(_response != null);
System\Net\Http\SocketsHttpHandler\HttpAuthority.cs (2)
21Debug.Assert(host != null); 42Debug.Assert(uri.HostNameType == UriHostNameType.Basic);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (75)
81Debug.Assert(stream != null); 138Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_Completed); 162Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted); 196Debug.Assert(_readAheadTaskStatus != ReadAheadTask_CompletionReserved); 206Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started); 233Debug.Assert(_readAheadTask == default); 247Debug.Assert(_readAheadTask == default); 248Debug.Assert(_readBuffer.ActiveLength == 0); 280Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_CompletionReserved); 306Debug.Assert(bytesToConsume <= _readBuffer.ActiveLength); 312Debug.Assert(request.RequestUri is not null); 333Debug.Assert(request.RequestUri.Scheme == Uri.UriSchemeHttp); 342Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class 352Debug.Assert(Kind != HttpConnectionKind.Proxy); 357Debug.Assert(Kind == HttpConnectionKind.Proxy); 412Debug.Assert(success); 420Debug.Assert(_currentRequest is not null); 438Debug.Assert(headerValuesCount > 0, "No values for header??"); 492Debug.Assert(Ascii.IsValid(s)); 497Debug.Assert(status == OperationStatus.Done); 498Debug.Assert(bytesWritten == s.Length); 517Debug.Assert(status == OperationStatus.Done); 518Debug.Assert(bytesWritten == s.Length); 537Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}."); 538Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer"); 539Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started, 606Debug.Assert(_readBuffer.ActiveLength == 0); 615Debug.Assert(_readAheadTask != default); 616Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 861Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 949Debug.Assert(request.Content is not null); 975Debug.Assert(stream.BytesWritten == 0); 1148Debug.Assert(_allowedReadLineBytes >= 0); 1325Debug.Assert(added); 1379Debug.Assert(source.Length <= _writeBuffer.AvailableLength); 1537Debug.Assert(formatted); 1543Debug.Assert(_writeBuffer.Capacity >= 8); 1651Debug.Assert(!ReadAheadTaskHasStarted); 1652Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1653Debug.Assert(_readBuffer.AvailableLength >= InitialReadBufferSize); 1667Debug.Assert(_readAheadTask == default); 1707Debug.Assert(_readBuffer.ActiveStartOffset == 0); 1708Debug.Assert(_readBuffer.ActiveLength > searchOffset); 1721Debug.Assert(searchOffset == readLength - 1 && _readBuffer.ActiveReadOnlySpan[searchOffset] == '\n'); 1738Debug.Assert(buffer.Length > 0); 1794Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1812Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1833Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1840Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1872Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers."); 1874Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1887Debug.Assert(count <= _readBuffer.ActiveLength); 1907Debug.Assert(destination != null); 1926Debug.Assert(remaining > 0); 1943Debug.Assert(destination != null); 1944Debug.Assert(length > 0); 1962Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty."); 2012Debug.Assert(origReadBuffer.Length > 0); 2033Debug.Assert(_currentRequest == null); 2034Debug.Assert(!_inUse); 2041Debug.Assert(_inUse); 2059Debug.Assert(_inUse); 2066Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request."); 2067Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed."); 2102Debug.Assert(_inUse); 2109Debug.Assert(response.Content != null); 2113Debug.Assert(responseStream != null || stream is EmptyReadStream); 2117Debug.Assert(response.RequestMessage == _currentRequest); 2126Debug.Assert(_currentRequest == null); 2133Debug.Assert(!_disposed, "Connection should not be disposed."); 2134Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request."); 2135Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed."); 2136Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status."); 2137Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer."); 2154Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (9)
73Debug.Assert(this is HttpConnection or Http2Connection or Http3Connection); 74Debug.Assert(pool != null); 117Debug.Assert(_pool.Settings._metrics is not null); 128Debug.Assert(_pool.TelemetryServerAddress is not null, "TelemetryServerAddress should not be null when System.Diagnostics.Metrics.Meter.IsSupported is true."); 204Debug.Assert(cache is not null); 259Debug.Assert(_pool.Settings._shouldEvictConnection is not null); 260Debug.Assert(_connectionDisposalCts is not null); 261Debug.Assert(_evictionContext is not null); 330Debug.Assert(task.IsFaulted);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (6)
251Debug.Assert(uri != null); 255Debug.Assert(uri == proxyUri); 278Debug.Assert(HttpUtilities.IsSupportedProxyScheme(proxyUri.Scheme)); 334Debug.Assert(uri is not null); 420Debug.Assert(request.RequestUri != null); 517Debug.Assert(_cleaningTimer != null);
System\Net\Http\SocketsHttpHandler\HttpConnectionResponseContent.cs (3)
18Debug.Assert(stream != null); 19Debug.Assert(stream.CanRead); 20Debug.Assert(!_consumedStream);
System\Net\Http\SocketsHttpHandler\HttpContentReadStream.cs (2)
44Debug.Fail($"DrainAsync should not be called for this response stream: {GetType()}"); 75Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
18Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (3)
95Debug.Fail($"Decrement for non-existing connection {key}"); 170Debug.Assert(versionMajor is 1 or 2 or 3); 186Debug.Assert(pool.TelemetryServerAddress is not null, "TelemetryServerAddress should not be null when System.Diagnostics.Metrics.Meter.IsSupported is true.");
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (9)
51Debug.Assert(failedProxyCache != null); 80Debug.Assert(failedProxyCache != null); 98Debug.Assert(_failedProxyCache != null); 115Debug.Assert(_failedProxyCache != null); 141Debug.Assert(uri != null); 155Debug.Assert(_uris != null || _proxyConfig != null, $"{nameof(ReadNext)} must not be called on a default-initialized {nameof(MultiProxy)}."); 171Debug.Assert(_proxyConfig != null); 177Debug.Assert(_currentIndex <= _proxyConfig.Length); 264Debug.Assert(charactersConsumed > 0);
System\Net\Http\SocketsHttpHandler\PreAuthCredentialCache.cs (6)
18Debug.Assert(uriPrefix != null); 19Debug.Assert(authType != null); 31Debug.Assert(uriPrefix != null); 32Debug.Assert(authType != null); 46Debug.Assert(uriPrefix != null); 47Debug.Assert(authType != null);
System\Net\Http\SocketsHttpHandler\RedirectHandler.cs (3)
19Debug.Assert(innerHandler != null); 20Debug.Assert(maxAutomaticRedirections > 0); 33Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
586Debug.Assert(_decompressionHandlerFactory is not null);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (7)
55Debug.Fail("Bad socks version."); 163Debug.Assert(bytesWritten == 4); 168Debug.Assert(hostIP.AddressFamily == AddressFamily.InterNetworkV6); 171Debug.Assert(bytesWritten == 16); 271Debug.Assert(isVersion4a); 280Debug.Assert(bytesWritten == 4); 329Debug.Assert(Encoding.UTF8.GetByteCount(chars) > 255);
System\Net\Http\StreamContent.cs (2)
50Debug.Assert(stream != null); 67Debug.Assert(stream != null);
System\Net\Http\StreamToStreamCopy.cs (6)
25Debug.Assert(source != null); 26Debug.Assert(destination != null); 27Debug.Assert(bufferSize >= 0); 52Debug.Assert(source != null); 53Debug.Assert(destination != null); 54Debug.Assert(bufferSize >= 0);
System\Net\Http\StringContent.cs (1)
51Debug.Assert(DefaultStringEncoding.WebName == "utf-8");
System.Net.Http.Json (5)
System\Net\Http\Json\HttpClientJsonExtensions.cs (1)
120Debug.Assert(client.MaxResponseContentBufferSize is > 0 and <= int.MaxValue);
System\Net\Http\Json\JsonContent.cs (2)
27Debug.Assert(jsonTypeInfo is not null); 28Debug.Assert(inputValue is null || jsonTypeInfo.Type.IsAssignableFrom(inputValue.GetType()));
System\Net\Http\Json\JsonHelpers.cs (2)
19Debug.Assert(type is not null); 53Debug.Assert(encoding != null);
System.Net.Http.WinHttpHandler (138)
src\runtime\src\libraries\Common\src\Interop\Windows\WinHttp\Interop.SafeWinHttpHandle.cs (3)
35Debug.Assert(_parentHandle == null); 36Debug.Assert(parentHandle != null); 37Debug.Assert(!parentHandle.IsInvalid);
src\runtime\src\libraries\Common\src\System\CharArrayHelpers.cs (4)
13Debug.Assert(array != null, "Null array"); 14Debug.Assert(startIndex >= 0, $"Expected {nameof(startIndex)} to be >= 0, got {startIndex}"); 15Debug.Assert(length >= 0, $"Expected {nameof(length)} to be >= 0, got {length}"); 16Debug.Assert(startIndex <= array.Length - length, $"Expected {startIndex} to be <= {array.Length} - {length}, got {startIndex}");
src\runtime\src\libraries\Common\src\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs (2)
16Debug.Assert(name != null); 290Debug.Assert(potentialHeader != null);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Runtime\ExceptionServices\ExceptionStackTrace.cs (1)
15Debug.Assert(exception != null, "Expected non-null Exception");
src\runtime\src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (9)
18private static readonly Action s_completionSentinel = static () => Debug.Fail("Completion sentinel should never be invoked"); 45Debug.Assert(c == null || c == s_completionSentinel); 55Debug.Assert(_continuation != null); 96Debug.Assert(exception != null); 109Debug.Assert(c != s_completionSentinel); 125Debug.Assert(continuation != null); 130Debug.Assert(c == s_completionSentinel); 145Debug.Assert(_resultSet ^ (_error != null)); 149Debug.Assert(!_resultSet && _error == null);
System\Net\Http\CachedCertificateValue.cs (1)
27Debug.Assert(message.RequestUri != null);
System\Net\Http\NoWriteNoSeekStreamContent.cs (5)
20Debug.Assert(content != null); 21Debug.Assert(content.CanRead); 22Debug.Assert(!content.CanWrite); 23Debug.Assert(!content.CanSeek); 39Debug.Assert(stream != null);
System\Net\Http\WinHttpAuthHelper.cs (18)
57Debug.Assert(state.RequestMessage != null); 58Debug.Assert(state.RequestMessage.RequestUri != null); 59Debug.Assert(state.RequestHandle != null); 99Debug.Assert(authTarget == Interop.WinHttp.WINHTTP_AUTH_TARGET_SERVER); 152Debug.Assert(authTarget == Interop.WinHttp.WINHTTP_AUTH_TARGET_PROXY); 167Debug.Assert(state.ServerCredentials != null); 176Debug.Assert(state.RequestHandle != null); 177Debug.Assert(state.RequestMessage != null); 178Debug.Assert(state.RequestMessage.RequestUri != null); 202Debug.Assert(proxyCredentials != null); 203Debug.Assert(proxyUri != null); 269Debug.Assert(!string.IsNullOrEmpty(authType)); 293Debug.Assert(authTarget == Interop.WinHttp.WINHTTP_AUTH_TARGET_PROXY || 321Debug.Assert(credentials != null); 322Debug.Assert(authScheme != 0); 323Debug.Assert(authTarget == Interop.WinHttp.WINHTTP_AUTH_TARGET_PROXY || 327Debug.Assert(!string.IsNullOrEmpty(authType)); 400Debug.Assert(uri != null);
System\Net\Http\WinHttpCookieContainerAdapter.cs (11)
20Debug.Assert(state.Handler != null); 23Debug.Assert(state.Handler.CookieUsePolicy == CookieUsePolicy.UseSpecifiedCookieContainer); 24Debug.Assert(request != null); 25Debug.Assert(requestHandle != null); 26Debug.Assert(cookieContainer != null); 27Debug.Assert(request.RequestUri != null); 53Debug.Assert(state.Handler != null); 54Debug.Assert(state.Handler.CookieUsePolicy == CookieUsePolicy.UseSpecifiedCookieContainer); 55Debug.Assert(state.Handler.CookieContainer != null); 56Debug.Assert(requestHandle != null); 92Debug.Assert(cookies != null);
System\Net\Http\WinHttpException.cs (1)
75Debug.Assert(!string.IsNullOrEmpty(nameOfCalledFunction));
System\Net\Http\WinHttpHandler.cs (29)
718Debug.Assert(requestMessage.RequestUri != null); 788Debug.Assert(state.Proxy != null); 789Debug.Assert(state.RequestMessage != null); 790Debug.Assert(state.RequestMessage.RequestUri != null); 859Debug.Assert(state.RequestMessage != null); 860Debug.Assert(state.RequestMessage.RequestUri != null); 861Debug.Assert(state.Handler != null); 862Debug.Assert(state.Tcs != null); 883Debug.Assert(_sessionHandle != null); 1043Debug.Assert(state.RequestMessage != null); 1044Debug.Assert(state.RequestMessage.RequestUri != null); 1260Debug.Assert(state.RequestHandle != null); 1261Debug.Assert(state.RequestMessage != null); 1262Debug.Assert(state.RequestMessage.RequestUri != null); 1277Debug.Assert(state.RequestMessage != null); 1278Debug.Assert(state.RequestMessage.RequestUri != null); 1279Debug.Assert(state.RequestHandle != null); 1439Debug.Assert(_sessionHandle != null); 1489Debug.Assert(state.RequestHandle != null); 1514Debug.Assert(requestHandle != null); 1531Debug.Assert(handle != null); 1547Debug.Assert(handle != null); 1560Debug.Assert(state.Tcs != null); 1656Debug.Assert(state.RequestHandle != null); 1683Debug.Assert(state.RequestMessage != null); 1684Debug.Assert(state.RequestMessage.Content != null); 1697Debug.Assert(state.RequestHandle != null); 1741Debug.Assert(Monitor.IsEntered(_lockObject)); 1742Debug.Assert(_certificateCleanupTimer != null);
System\Net\Http\WinHttpRequestCallback.cs (30)
51Debug.Assert(state != null, "WinHttpCallback must have a non-null state object"); 83Debug.Assert(statusInformationLength == sizeof(int)); 110Debug.Assert( 141Debug.Assert(state != null); 142Debug.Assert(state.Handler != null); 143Debug.Assert(state.RequestMessage != null); 157Debug.Assert(state != null, "OnRequestSendRequestComplete: state is null"); 167Debug.Assert(state != null, "OnRequestSendRequestComplete: state is null"); 168Debug.Assert(state.LifecycleAwaitable != null, "OnRequestSendRequestComplete: LifecycleAwaitable is null"); 175Debug.Assert(state != null, "OnRequestDataAvailable: state is null"); 182Debug.Assert(state != null, "OnRequestReadComplete: state is null"); 204Debug.Assert(state != null, "OnRequestWriteComplete: state is null"); 205Debug.Assert(state.TcsInternalWriteDataToRequestStream != null, "TcsInternalWriteDataToRequestStream is null"); 206Debug.Assert(!state.TcsInternalWriteDataToRequestStream.Task.IsCompleted, "TcsInternalWriteDataToRequestStream.Task is completed"); 213Debug.Assert(state != null, "OnRequestReceiveResponseHeadersComplete: state is null"); 214Debug.Assert(state.LifecycleAwaitable != null, "LifecycleAwaitable is null"); 221Debug.Assert(state != null, "OnRequestRedirect: state is null"); 222Debug.Assert(state.Handler != null, "OnRequestRedirect: state.Handler is null"); 223Debug.Assert(state.RequestMessage != null, "OnRequestRedirect: state.RequestMessage is null"); 224Debug.Assert(redirectUri != null, "OnRequestRedirect: redirectUri is null"); 264Debug.Assert(state != null, "OnRequestSendingRequest: state is null"); 265Debug.Assert(state.Handler != null, "OnRequestSendingRequest: state.Handler is null"); 266Debug.Assert(state.RequestMessage != null, "OnRequestSendingRequest: state.RequestMessage is null"); 267Debug.Assert(state.RequestMessage.RequestUri != null, "OnRequestSendingRequest: state.RequestMessage.RequestUri is null"); 345Debug.Assert(ipAddress != null, "AddressFamily is not supported"); 440Debug.Assert(state != null, "OnRequestError: state is null"); 465Debug.Assert(state.RequestHandle != null, "OnRequestError: state.RequestHandle is null"); 506Debug.Assert(state.TcsInternalWriteDataToRequestStream != null); 520Debug.Fail( 531Debug.Assert(requestHandle != null);
System\Net\Http\WinHttpRequestState.cs (1)
197Debug.Assert(disposing, "WinHttpRequestState.Dispose() should have disposing=TRUE");
System\Net\Http\WinHttpRequestStream.cs (4)
34Debug.Assert(_state.RequestHandle != null); 209Debug.Assert(_chunkedMode == WinHttpChunkMode.Manual); 210Debug.Assert(count > 0); 222Debug.Assert(count > 0);
System\Net\Http\WinHttpResponseHeaderReader.cs (1)
90Debug.Assert(_buffer != null);
System\Net\Http\WinHttpResponseParser.cs (9)
22Debug.Assert(request != null); 23Debug.Assert(requestHandle != null); 113Debug.Assert(buffer == null || (buffer != null && buffer.Length > StackLimit)); 177Debug.Assert(buffer != null, "buffer must not be null."); 178Debug.Assert(buffer.Length > 0, "buffer must not be empty."); 194Debug.Assert(lastError != Interop.WinHttp.ERROR_INSUFFICIENT_BUFFER, "buffer must be of sufficient size."); 222Debug.Assert(isTrailingHeaders || lastError != Interop.WinHttp.ERROR_WINHTTP_HEADER_NOT_FOUND); 241Debug.Assert(bufferLength >= 0, "bufferLength must not be negative."); 265Debug.Assert(bufferLength > 0);
System\Net\Http\WinHttpResponseStream.cs (4)
135Debug.Assert(bytesAvailable > 0); 152Debug.Assert(bytesRead > 0); 224Debug.Assert(!_requestHandle.IsInvalid); 235Debug.Assert(!_requestHandle.IsInvalid);
System\Net\Http\WinHttpTraceHelper.cs (2)
14Debug.Assert(NetEventSource.Log.IsEnabled()); 24Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Http\WinHttpTrailersHelper.cs (1)
53Debug.Fail("Querying WINHTTP_OPTION_STREAM_ERROR_CODE on a session handle should never succeed.");
System.Net.HttpListener (48)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\CookieParser.cs (3)
539Debug.Assert(method != null, "We need to use an internal method named InternalSetName that is declared on Cookie."); 557Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\runtime\src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
246Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 248Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 387Debug.Assert(state is LazyAsyncResult);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\HttpListener.cs (1)
210Debug.Assert(operationStatus == OperationStatus.Done);
System\Net\HttpListenerRequestUriBuilder.cs (16)
49Debug.Assert(!string.IsNullOrEmpty(rawUri), "Empty raw URL."); 50Debug.Assert(!string.IsNullOrEmpty(cookedUriScheme), "Empty cooked URL scheme."); 51Debug.Assert(!string.IsNullOrEmpty(cookedUriHost), "Empty cooked URL host."); 52Debug.Assert(!string.IsNullOrEmpty(cookedUriPath), "Empty cooked URL path."); 122Debug.Assert((type == EncodingType.Primary) || (type == EncodingType.Secondary), $"Unknown 'EncodingType' value: {type}"); 136Debug.Assert(encoding != null, "'encoding' must be assigned."); 137Debug.Assert(!string.IsNullOrEmpty(_rawPath), "'rawPath' must have at least one character."); 150Debug.Assert(_rawOctets.Count == 0, 172Debug.Assert(encoding != null, "'encoding' must be assigned."); 176Debug.Assert(_rawPath != null); 229Debug.Assert(_requestUriString != null); 288Debug.Assert(_rawOctets != null); 365Debug.Assert(uriString != null, "uriString must not be null"); 366Debug.Assert(uriString.Length > 0, "uriString must not be empty"); 408Debug.Assert((uriString.Length == 1) && (uriString[0] == '*'), "Unknown request Uri string format", 434Debug.Assert(path != null, "'path' must not be null");
System\Net\Managed\ChunkStream.cs (1)
137Debug.Assert(offset == 0);
System\Net\Managed\HttpListenerRequest.Managed.cs (1)
152Debug.Assert(_rawUrl != null);
System\Net\Managed\HttpRequestStream.Managed.cs (2)
122Debug.Assert(nread <= _remainingBody); 208Debug.Assert(nread <= _remainingBody);
System\Net\ServiceNameStore.cs (2)
137Debug.Assert(!string.IsNullOrEmpty(uriPrefix)); 166Debug.Assert(!string.IsNullOrEmpty(uriPrefix));
System\Net\WebSockets\HttpListenerWebSocketContext.cs (5)
42Debug.Assert(requestUri != null, "requestUri shouldn't be null"); 43Debug.Assert(headers != null, "headers shouldn't be null"); 44Debug.Assert(cookieCollection != null, "cookieCollection shouldn't be null"); 45Debug.Assert(secWebSocketProtocols != null, "secWebSocketProtocols shouldn't be null"); 46Debug.Assert(webSocket != null, "webSocket shouldn't be null");
System\Net\Windows\CookieExtensions.cs (4)
18Debug.Assert(s_toServerStringFunc != null, "Reflection failed for Cookie.ToServerString()."); 27Debug.Assert(s_cloneFunc != null, "Reflection failed for Cookie.Clone()."); 45Debug.Assert(s_getVariantFunc != null, "Reflection failed for Cookie.Variant."); 57Debug.Assert(s_internalAddFunc != null, "Reflection failed for CookieCollection.InternalAdd().");
System.Net.Mail (68)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Net\Base64Stream.cs (1)
64Debug.Assert(_writeState != null, "_writeState was null");
System\Net\Mail\DomainLiteralReader.cs (2)
34Debug.Assert(0 <= index && index < data.Length, $"index was outside the bounds of the string: {index}"); 35Debug.Assert(data[index] == MailBnfHelper.EndSquareBracket, "data did not end with a square bracket");
System\Net\Mail\DotAtomReader.cs (1)
40Debug.Assert(0 <= index && index < data.Length, $"index was outside the bounds of the string: {index}");
System\Net\Mail\MailAddress.cs (5)
34Debug.Assert(_host != null, 37Debug.Assert(userName != null, 40Debug.Assert(displayName != null, 76Debug.Assert(parseSuccess); 297Debug.Assert(Address != null, "address was null");
System\Net\Mail\MailAddressParser.cs (6)
30Debug.Assert(!parseSuccess || index == -1, $"The index indicates that part of the address was not parsed: {index}"); 45Debug.Assert(index == -1 || data[index] == MailBnfHelper.Comma, 69Debug.Assert(!string.IsNullOrEmpty(data)); 70Debug.Assert(index >= 0 && index < data.Length, $"Index out of range: {index}, {data.Length}"); 396Debug.Assert(data[index + 1] == MailBnfHelper.Quote, $"Mis-aligned index: {index}"); 435Debug.Assert(index < 0 || data[index] == MailBnfHelper.Comma, $"Mis-aligned index: {index}");
System\Net\Mail\MailBnfHelper.cs (2)
363Debug.Assert(index >= 0); 364Debug.Assert(index < data.Length);
System\Net\Mail\MailHeaderInfo.cs (1)
77Debug.Assert((int)s_headerInfo[i].ID == i, "Header info data structures are not in sync");
System\Net\Mail\MailPriority.cs (1)
408System.Diagnostics.Debug.Assert(_headersEncoding != null);
System\Net\Mail\MailWriter.cs (1)
55Diagnostics.Debug.Assert(_contentStream == sender);
System\Net\Mail\QuotedPairReader.cs (3)
37Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}"); 85Debug.Assert(index >= 0 && data[index] == MailBnfHelper.Backslash, $"index was not a backslash: {index}"); 96Debug.Assert(index < 0 || data[index] != MailBnfHelper.Backslash, $"index was a backslash: {index}");
System\Net\Mail\QuotedStringFormatReader.cs (3)
38Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}"); 40Debug.Assert(data[index] == MailBnfHelper.Quote, $"Initial char at index {index} was not a quote."); 129Debug.Assert(0 <= index && index < data.Length, $"Index out of range: {index}, {data.Length}");
System\Net\Mail\SmtpCommands.cs (1)
60System.Diagnostics.Debug.Assert(lines.Length == 1, "Did not expect more than one line response for auth command");
System\Net\Mail\SmtpReplyReaderFactory.cs (1)
263System.Diagnostics.Debug.Assert(_readState == ReadState.Status0);
System\Net\Mail\WhitespaceReader.cs (4)
34Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 35Debug.Assert(index < data.Length, "index was outside the bounds of the string"); 117Debug.Assert(!string.IsNullOrEmpty(data), "data was null or empty"); 118Debug.Assert(index < data.Length, "index was outside the bounds of the string");
System\Net\Mime\Base64Encoder.cs (4)
22Debug.Assert(_writeState != null, "_writeState was null"); 74Debug.Fail("paddind was not in range [0,2]"); 115Debug.Fail("paddind was not in range [0,2]"); 141Debug.Fail("paddind was not in range [0,2]");
System\Net\Mime\ByteEncoder.cs (4)
56Debug.Assert(value != null, "value was null"); 57Debug.Assert(WriteState != null, "writestate was null"); 58Debug.Assert(WriteState.Buffer != null, "writestate.buffer was null"); 77Debug.Assert(codepointSize == 1 || codepointSize == 2, "codepointSize was not 1 or 2");
System\Net\Mime\MediaTypeMap.cs (5)
734Debug.Assert(ExtensionToMediaTypeCount == s_extensionToMediaType.Dictionary.Count, 738Debug.Assert( 745Debug.Assert(MediaTypeToExtensionCount == s_mediaTypeToExtension.Dictionary.Count, 749Debug.Assert( 756Debug.Assert(longestExtensionLength == MaxExtensionLength,
System\Net\Mime\SmtpDateTime.cs (7)
163Debug.Assert(timeZone.Seconds == 0, "Span had seconds value"); 164Debug.Assert(timeZone.Milliseconds == 0, "Span had milliseconds value"); 175Debug.Assert(!string.IsNullOrEmpty(offset), "violation of precondition: offset must not be null or empty"); 176Debug.Assert(offset != UnknownTimeZoneDefaultOffset, "Violation of precondition: do not pass an unknown offset"); 177Debug.Assert(offset.StartsWith('-') || offset.StartsWith('+'), "offset initial character was not a + or -"); 211Debug.Assert(!string.IsNullOrEmpty(value), "violation of precondition: offset must not be null or empty"); 268Debug.Assert(dateValue.Kind == DateTimeKind.Unspecified);
System\Net\TrackingValidationObjectDictionary.cs (1)
45Debug.Assert(key != null, "key was null");
System.Net.NameResolution (47)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\runtime\src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
16Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten == Interop.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}");
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
System\Net\Dns.cs (8)
30Debug.Fail("LogFailure should return false"); 501Debug.Assert(!activityOrDefault.HasValue); 558Debug.Fail("LogFailure should return false"); 576Debug.Assert(result is not null); 611Debug.Assert(name != null); 615Debug.Fail("LogFailure should return false"); 650Debug.Fail("LogFailure should return false"); 957Debug.Assert(!Monitor.IsEntered(s_tasks));
System\Net\DnsEncodedName.cs (8)
138Debug.Assert(asciiStatus == OperationStatus.Done); 293Debug.Assert(success); 366Debug.Assert(success); 491Debug.Assert(b <= 63); // enforced by condition above 565Debug.Assert(_pos + 1 < _buffer.Length, "Truncated compression pointer"); 567Debug.Assert(pointer < _pos, "Forward or self-referencing compression pointer"); 578Debug.Assert(b <= 63, "Invalid label length byte"); 581Debug.Assert(_pos + labelLen <= _buffer.Length, "Label extends past buffer");
System\Net\DnsResolver.cs (8)
91Debug.Assert(task.IsCompleted); 108Debug.Assert(task.IsCompleted); 125Debug.Assert(task.IsCompleted); 142Debug.Assert(task.IsCompleted); 159Debug.Assert(task.IsCompleted); 176Debug.Assert(task.IsCompleted); 192Debug.Assert(task.IsCompleted); 209Debug.Assert(task.IsCompleted);
System\Net\DnsResolverPal.Managed.cs (5)
147Debug.Assert(qtype == DnsRecordType.AAAA); 385Debug.Assert(serverList.Count > 0); 612Debug.Assert(status == OperationStatus.Done); 616Debug.Assert(ok); 618Debug.Assert(ok);
System\Net\NameResolutionPal.Unix.cs (3)
48Debug.Fail($"Unexpected error: {error} errno: {Interop.Sys.GetErrNo()}"); 51Debug.Fail($"Unexpected error: {error}"); 176Debug.Assert(bytesWritten == rawAddressLength);
System\Net\NameResolutionTelemetry.cs (4)
128Debug.Assert(hostNameOrAddress is not null); 139Debug.Assert(host is not null, $"Unknown hostNameOrAddress type: {hostNameOrAddress.GetType().Name}"); 204Debug.Assert(answerValues is not null); 209Debug.Assert(exception is not null);
System.Net.NetworkInformation (24)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetDomainName.cs (1)
31Debug.Fail($"{nameof(GetDomainName)} failed with error {err}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
66Debug.Assert(_buffer != null);
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (1)
226Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
System\Net\NetworkInformation\NetEventSource.NetworkInformation.cs (1)
24Debug.Assert(IsEnabled());
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (9)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 75Debug.Assert(Socket == null, 127Debug.Assert(Socket == null, 154Debug.Assert(Monitor.IsEntered(s_gate)); 155Debug.Assert(Socket == null, "Socket is not null, must close existing socket before opening another."); 179Debug.Assert(Monitor.IsEntered(s_gate)); 180Debug.Assert(Socket != null, "Socket was null when CloseSocket was called."); 215Debug.Fail($"Unexpected error: {ex}");
System\Net\NetworkInformation\StringParsingHelpers.Connections.cs (1)
360Debug.Assert(hexAddress.Length == 32);
System\Net\NetworkInformation\UnicastIPAddressInformation.cs (3)
72Debug.Assert((0 <= prefixLength) && (prefixLength <= 126)); 73Debug.Assert((family == AddressFamily.InterNetwork) || (family == AddressFamily.InterNetworkV6)); 80Debug.Assert(prefixLength <= (addressBytes.Length * 8));
System.Net.Ping (10)
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
System\Net\NetworkInformation\Ping.cs (2)
101Debug.Assert(currentStatus == Disposed, $"Expected currentStatus == Disposed, got {currentStatus}"); 121Debug.Assert(_status == InProgress, $"Invalid status: {_status}");
System\Net\NetworkInformation\Ping.RawSocket.cs (1)
394Debug.Assert(Marshal.SizeOf<IcmpHeader>() == 8, "The size of an ICMP Header must be 8 bytes.");
System.Net.Primitives (81)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetDomainName.cs (1)
31Debug.Fail($"{nameof(GetDomainName)} failed with error {err}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\CookieParser.cs (2)
557Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedDomain that is declared on Cookie."); 574Debug.Assert(fieldInfo != null, "We need to use an internal field named IsQuotedVersion that is declared on Cookie.");
src\runtime\src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 208Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 319Debug.Assert(parts[0] <= 0xFF); 326Debug.Assert(parts[0] <= 0xFF); 327Debug.Assert(parts[1] <= 0xFF); 334Debug.Assert(parts[0] <= 0xFF); 335Debug.Assert(parts[1] <= 0xFF); 336Debug.Assert(parts[2] <= 0xFF);
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 127Debug.Assert(start < end); 316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\NetworkInformation\InterfaceInfoPal.Unix.cs (2)
21Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 41Debug.Assert(bufferSize <= int.MaxValue - 1);
src\runtime\src\libraries\Common\src\System\Net\SocketAddress.cs (4)
107Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 117Debug.Assert(ipAddress.AddressFamily == AddressFamily.InterNetwork); 180Debug.Assert(formatted); 195Debug.Assert(formatted);
src\runtime\src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
System\Net\Cookie.cs (3)
80Debug.Assert(MaxSupportedVersion.ToString(NumberFormatInfo.InvariantInfo).Equals(MaxSupportedVersionString, StringComparison.Ordinal)); 343Debug.Assert(idxOfSeparator == -1); 416Debug.Assert(m_domainKey is not null);
System\Net\CookieContainer.cs (4)
323Debug.Assert(m_maxCookies != 0); 324Debug.Assert(m_maxCookiesPerDomain != 0); 367Debug.Assert(cc != null); 918Debug.Assert(value != null);
System\Net\CredentialCache.cs (7)
177Debug.Assert(cache != null); 200Debug.Assert(cache != null); 250Debug.Assert(table != null); 275Debug.Assert(cache._cacheForHosts != null); 356Debug.Assert(!string.IsNullOrEmpty(host)); 357Debug.Assert(port >= 0); 358Debug.Assert(authenticationType != null);
System\Net\IPAddress.cs (14)
75Debug.Assert(IsIPv4); 80Debug.Assert(IsIPv4); 91Debug.Assert(IsIPv4 || IsIPv4MappedToIPv6); 105Debug.Assert(IsIPv6); 110Debug.Assert(IsIPv6); 157Debug.Assert(numbers.Length == NumberOfLabels); 165Debug.Assert(numbers != null); 166Debug.Assert(numbers.Length == NumberOfLabels); 354Debug.Assert(numbers is { Length: NumberOfLabels }); 394Debug.Assert(_numbers is { Length: NumberOfLabels }); 520Debug.Assert(tmpDestination.Length >= IPAddressParser.MaxIPv4StringLength); 688Debug.Assert(comparand != null); 702Debug.Assert(_numbers.Length == IPAddressParserStatics.IPv6AddressShorts); 703Debug.Assert(comparand._numbers!.Length == IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPAddressParser.cs (5)
36Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 83Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 84Debug.Assert(numbersLength >= IPAddressParserStatics.IPv6AddressShorts); 184Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 216Debug.Assert(formatted);
System\Net\IPEndPoint.cs (1)
102Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char));
System\Net\IPNetwork.cs (5)
97Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 99Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 191Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 219Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 264Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes);
System.Net.Quic (133)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
68Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 88Debug.Assert(
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
119Debug.Fail($"Unexpected result {result} from {nameof(CryptoNative_IsSignatureAlgorithmAvailable)}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
84Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 208Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 319Debug.Assert(parts[0] <= 0xFF); 326Debug.Assert(parts[0] <= 0xFF); 327Debug.Assert(parts[1] <= 0xFF); 334Debug.Assert(parts[0] <= 0xFF); 335Debug.Assert(parts[1] <= 0xFF); 336Debug.Assert(parts[2] <= 0xFF);
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 127Debug.Assert(start < end); 316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (40)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}"); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}"); 130Debug.Assert(byteCount >= 0); 131Debug.Assert(limit >= 0); 147Debug.Assert(byteCount >= 0); 157Debug.Assert(byteCount > AvailableMemory.Length); 169Debug.Assert(_allocatedEnd == 0); 170Debug.Assert(_activeStart == 0); 171Debug.Assert(_availableStart == 0); 183Debug.Assert(_allocatedEnd % BlockSize == 0); 184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}"); 225Debug.Assert(_allocatedEnd % BlockSize == 0); 227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null); 230Debug.Assert(_blocks[allocatedBlockCount] is null); 237Debug.Assert(byteCount <= AvailableMemory.Length); 247Debug.Assert(_activeStart == 0); 248Debug.Assert(_availableStart == 0); 249Debug.Assert(_allocatedEnd == 0); 253Debug.Assert(_activeStart <= _availableStart); 254Debug.Assert(_availableStart <= _allocatedEnd); 255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize); 257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?"); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}"); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0"); 350Debug.Assert(_blocks is not null); 355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}"); 357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
src\runtime\src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
60Debug.Assert(hostNameMatch == 0 || hostNameMatch == 1, $"Expected 0 or 1 from CheckX509Hostname, got {hostNameMatch}");
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
42Debug.Assert(s_fileStream != null); 67Debug.Assert(s_fileStream != null); 68Debug.Assert(!clientRandom.IsEmpty);
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
src\runtime\src\libraries\Common\src\System\Net\StreamBuffer.cs (17)
39Debug.Assert(!Monitor.IsEntered(SyncObject)); 51Debug.Assert(!Monitor.IsEntered(SyncObject)); 63Debug.Assert(!Monitor.IsEntered(SyncObject)); 80Debug.Assert(!Monitor.IsEntered(SyncObject)); 95Debug.Assert(buffer.Length > 0); 97Debug.Assert(!Monitor.IsEntered(SyncObject)); 145Debug.Assert(bytesWritten == buffer.Length); 168Debug.Assert(bytesWritten == buffer.Length); 179Debug.Assert(!Monitor.IsEntered(SyncObject)); 195Debug.Assert(!Monitor.IsEntered(SyncObject)); 229Debug.Assert(bytesRead == 0); 232Debug.Assert(!wait); 245Debug.Assert(bytesRead == 0); 248Debug.Assert(!wait); 258Debug.Assert(!Monitor.IsEntered(SyncObject)); 303Debug.Assert(!_hasWaiter); 323Debug.Assert(cancellationToken.IsCancellationRequested);
System\Net\Quic\Internal\MsQuicApi.cs (2)
228Debug.Assert(IsQuicSupported); 240Debug.Assert(MsQuicOpenVersion != null);
System\Net\Quic\Internal\MsQuicBuffers.cs (3)
52Debug.Assert(index < _count); 53Debug.Assert(_buffers[index].Buffer is null); 54Debug.Assert(_buffers[index].Length == 0);
System\Net\Quic\Internal\MsQuicConfiguration.Cache.cs (2)
47Debug.Assert(success); 56Debug.Assert(success);
System\Net\Quic\Internal\MsQuicSafeHandle.cs (1)
107Debug.Assert(_disposable is null);
System\Net\Quic\Internal\ResettableValueTaskSource.cs (2)
101Debug.Assert(!_keepAlive.IsAllocated); 176Debug.Assert(final);
System\Net\Quic\Internal\ValueTaskSource.cs (1)
84Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\QuicConnection.cs (4)
391Debug.Assert(host is not null); 634Debug.Assert(_negotiatedSslProtocol == SslProtocols.Tls13, $"Unexpected TLS version {info.TlsProtocolVersion}"); 850Debug.Assert(_connectedTcs.IsCompleted); 851Debug.Assert(_connectionCloseTcs.Task.IsCompleted);
System\Net\Quic\QuicConnection.SslConnectionOptions.cs (2)
131Debug.Assert(certificate == null); 208Debug.Assert(X509Certificate2.GetCertContentType(chainData) is X509ContentType.Pkcs7);
System\Net\Quic\QuicListener.cs (1)
299Debug.Assert(task.IsCompleted);
System\Net\Quic\QuicStream.cs (3)
283Debug.Assert(!_startedTcs.IsCompleted); 574Debug.Assert(_decrementStreamCapacity is not null); 789Debug.Assert(_startedTcs.IsCompleted);
System.Net.Requests (29)
src\runtime\src\libraries\Common\src\System\Net\ContextAwareResult.cs (7)
133Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Called on completed result."); 144Debug.Assert(AsyncCallback != null || (_flags & StateFlags.CaptureContext) != 0, "No context captured - specify a callback or forceCaptureContext."); 150Debug.Assert(_lock != null, "Must lock (StartPostingAsyncOp()) { ... FinishPostingAsyncOp(); } when calling ContextCopy (unless it's only called after FinishPostingAsyncOp)."); 156Debug.Assert((_flags & StateFlags.ThreadSafeContextCopy) != 0, "Result became completed during call."); 186Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 270Debug.Assert((_flags & StateFlags.PostBlockStarted) != 0, "Called without calling StartPostingAsyncOp."); 313Debug.Assert(AsyncCallback == null || CompletedSynchronously, "Didn't capture context, but didn't complete synchronously!");
src\runtime\src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\runtime\src\libraries\Common\src\System\Net\LazyAsyncResult.cs (3)
246Debug.Assert(value != DBNull.Value, "Result can't be set to DBNull - it's a special internal value."); 248Debug.Assert(!InternalPeekCompleted, "Called on completed result."); 387Debug.Assert(state is LazyAsyncResult);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
System\Net\FtpControlStream.cs (2)
175Debug.Assert(_dataStream != null, "Data stream is null"); 697Debug.Assert(port != -1, "'port' not set.");
System\Net\FtpWebRequest.cs (1)
1447Debug.Assert(stream is ICloseEx, "The _stream member is not CloseEx hence the risk of connection been orphaned.");
System\Net\HttpWebRequest.cs (4)
1027Debug.Assert(_sendRequestCts != null); 1721Debug.Assert(handler.UseCookies); // Default of handler.UseCookies is true. 1735Debug.Assert(handler.UseProxy); // Default of handler.UseProxy is true. 1736Debug.Assert(handler.Proxy == null); // Default of handler.Proxy is null.
System\Net\NetworkStreamWrapper.cs (1)
56Debug.Assert(value is SslStream, "Expected SslStream");
System\Net\RequestBufferingStream.cs (1)
109Debug.Assert(success); // Buffer should always be visible since default MemoryStream constructor was used.
System\Net\RequestStreamContent.cs (1)
20Debug.Assert(stream is not null);
System\Net\ServicePoint\ServicePoint.cs (1)
24Debug.Assert(address != null);
System\Net\TaskExtensions.cs (1)
35Debug.Assert(tcs.Task.IsCanceled);
System\Net\TimerThread.cs (1)
200Debug.Assert(_timers.Prev!.Next == _timers, $"Tail corruption.");
System\Net\WebException.cs (1)
82Debug.Assert(exception != null);
System\Net\WebRequest.cs (1)
364Debug.Assert(prefixList.Count == Count, $"Expected {Count}, got {prefixList.Count}");
System.Net.Security (231)
src\runtime\src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (3)
21Debug.Assert(destination != null, "target destination cannot be null"); 22Debug.Assert((offset >= 0 && offset < destination.Length) || destination.Length == 0, $"invalid offset {offset}"); 74Debug.Assert(sizeof(GssBuffer) == 16);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ASN1.cs (2)
68Debug.Assert(bytesNeeded != 0, "OBJ_obj2txt reported a zero-length response"); 88Debug.Assert(
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Crypto.cs (1)
119Debug.Fail($"Unexpected result {result} from {nameof(CryptoNative_IsSignatureAlgorithmAvailable)}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.ERR.cs (1)
84Debug.Assert(error <= uint.MaxValue, "ErrGetError should only return error codes in the UInt32 range.");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OCSP.cs (1)
76Debug.Assert(ret == 0, $"Unexpected response from X509DecodeOcspToExpiration: {ret}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (30)
71Debug.Assert(success); 77Debug.Assert(success); 108Debug.Assert( 146Debug.Assert((sslAuthenticationOptions.EnabledSslProtocols & FakeAlpnSslProtocol) == 0); 244Debug.Assert(cipherList.IsEmpty || cipherList[^1] == 0); 247Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); 281Debug.Assert(result == 1); 336Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 337Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 395Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 417Debug.Assert(sslHandle != null, "Expected non-null return value from SafeSslHandle.Create"); 439Debug.Assert(success); 512Debug.Assert(certList != null); 528Debug.Fail("Failed to add issuer to trusted CA list."); 677Debug.Assert(size < 10 * 1024, "The buffer should not grow too large."); 910Debug.Assert( 966Debug.Assert(consumed == input.Length, "Expected all input to be consumed."); 1035Debug.Assert(data != IntPtr.Zero, "Expected non-null data pointer from SslGetData"); 1038Debug.Assert(options != null, "Expected to get SslAuthenticationOptions from GCHandle"); 1041Debug.Assert(sslHandle is not null, "Expected SslAuthenticationOptions.SafeSslHandle to be set by SafeSslHandle.Create"); 1078Debug.Assert(validator is not null, "Expected SslAuthenticationOptions.RemoteCertificateValidator to be set by SslStream or TlsSession"); 1200Debug.Assert(certificate != null, "Remote certificate should not be null here."); 1221Debug.Assert(options != null, "Expected to get SslAuthenticationOptions from GCHandle"); 1263Debug.Assert(ssl != IntPtr.Zero); 1264Debug.Assert(session != IntPtr.Zero); 1296Debug.Assert(name != null); 1317Debug.Assert(ctx != IntPtr.Zero && session != IntPtr.Zero); 1334Debug.Assert(name != null); 1347Debug.Assert(count >= 0); 1348Debug.Assert(buffer.Length >= count);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (4)
348Debug.Assert(GetAlpnProtocolListSerializedLength(applicationProtocols) == buffer.Length, 397Debug.Assert(stapledResponse.Length > 0); 607Debug.Fail("Unexpected exception while transferring SafeBioHandle ownership to SafeSslHandle", exc.ToString()); 667Debug.Assert(!IsInvalid, "Expected a valid context in Disconnect");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (9)
157Debug.Assert(_gch.IsAllocated); 169Debug.Assert(_sslSessions == null); 173Debug.Assert(_gch.IsAllocated); 180Debug.Assert(_sslSessions != null && session != IntPtr.Zero); 188Debug.Assert(targetName != null); 206Debug.Assert(added); 230Debug.Assert(_sslSessions != null); 233Debug.Assert(targetName != null); 259Debug.Assert(_sslSessions != null);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\GssSafeHandles.cs (2)
18Debug.Assert(!string.IsNullOrEmpty(name), "Invalid user name passed to SafeGssNameHandle create"); 35Debug.Assert(!string.IsNullOrEmpty(name), "Invalid target name passed to SafeGssNameHandle create");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeBioHandle.Unix.cs (2)
50Debug.Assert(_parent == null, "Expected no existing parent"); 51Debug.Assert(parent != null && !parent.IsInvalid, "Expected new parent to be non-null and valid");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (2)
32Debug.Assert(task.IsCompletedSuccessfully); 166Debug.Fail("Unable to load required type.");
src\runtime\src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 208Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 319Debug.Assert(parts[0] <= 0xFF); 326Debug.Assert(parts[0] <= 0xFF); 327Debug.Assert(parts[1] <= 0xFF); 334Debug.Assert(parts[0] <= 0xFF); 335Debug.Assert(parts[1] <= 0xFF); 336Debug.Assert(parts[2] <= 0xFF);
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 127Debug.Assert(start < end); 316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\runtime\src\libraries\Common\src\System\Net\Security\CertificateValidation.Unix.cs (1)
60Debug.Assert(hostNameMatch == 0 || hostNameMatch == 1, $"Expected 0 or 1 from CheckX509Hostname, got {hostNameMatch}");
src\runtime\src\libraries\Common\src\System\Net\Security\MD4.cs (2)
65Debug.Assert(destination.Length == 128 >> 3); 83Debug.Assert(padLen is >= 0 and <= 120);
src\runtime\src\libraries\Common\src\System\Net\Security\RC4.cs (2)
78Debug.Assert(input.Length == output.Length); 79Debug.Assert(state != null);
src\runtime\src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
42Debug.Assert(s_fileStream != null); 67Debug.Assert(s_fileStream != null); 68Debug.Assert(!clientRandom.IsEmpty);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\runtime\src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (3)
22Debug.Fail($"Convert.TryToBase64 failed with {input.Length} bytes to a {base64.Length} buffer"); 26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
System\Net\CertificateValidationPal.cs (1)
76Debug.Fail($"Failed to open cert store, location: {storeLocation} exception: {exception}");
System\Net\CertificateValidationPal.Unix.cs (2)
124Debug.Assert(session != IntPtr.Zero); 182Debug.Assert(storeLocation == StoreLocation.CurrentUser);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (18)
300Debug.Assert(clientOptions.Package == NegotiationInfoClass.NTLM); 338Debug.Assert(incomingBlob.IsEmpty); 354Debug.Assert(!incomingBlob.IsEmpty); 364Debug.Assert(HeaderLength == NtlmHeader.Length); 365Debug.Assert(asBytes.Length == sizeof(NegotiateMessage)); 438Debug.Assert(written == HMACMD5.HashSizeInBytes); 454Debug.Assert(serverChallenge.Length == ChallengeLength); 455Debug.Assert(clientChallenge.Length == ChallengeLength); 456Debug.Assert(ntlm2hash.Length == DigestLength); 502Debug.Assert(written == MD5.HashSizeInBytes); 590Debug.Assert(bytesWritten == spnSize); 726Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 737Debug.Assert(flags.HasFlag(Flags.NegotiateSign) && flags.HasFlag(Flags.NegotiateKeyExchange)); 742Debug.Assert(sessionKeyWritten == HMACMD5.HashSizeInBytes); 754Debug.Assert(_negotiateMessage != null); 773Debug.Assert(payloadOffset == responseBytes.Length); 829Debug.Assert(_clientSeal is not null); 830Debug.Assert(_clientSigningKey is not null);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
83Debug.Assert(clientOptions.Package == NegotiationInfoClass.Negotiate);
System\Net\NegotiateAuthenticationPal.Unix.cs (10)
116Debug.Assert(_securityContext is not null && _isAuthenticated, "Trying to get the client SPN before handshaking is done!"); 131Debug.Assert(_securityContext is not null); 328Debug.Assert(_securityContext is not null); 359Debug.Assert(_securityContext is not null); 387Debug.Assert(_securityContext is not null); 418Debug.Assert(_securityContext is not null); 444Debug.Assert(_securityContext is not null); 483Debug.Assert(username != null && password != null, "Username and Password can not be null"); 644Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi"); 699Debug.Assert(resultBlob != null, "Unexpected null buffer returned by GssApi");
System\Net\Security\CipherSuitesPolicyPal.Linux.cs (3)
94Debug.Assert( 111Debug.Assert( 186Debug.Fail($"Unknown EncryptionPolicy value ({policy})");
System\Net\Security\NegotiateAuthentication.cs (2)
189Debug.Assert(!OperatingSystem.IsTvOS(), "Server authentication is not supported on tvOS"); 445Debug.Assert(_extendedProtectionPolicy != null);
System\Net\Security\NegotiateStream.cs (10)
307Debug.Assert(vt.IsCompleted, "Should have completed synchroously with sync adapter"); 338Debug.Assert(_context is not null); 511Debug.Assert(_context is not null); 512Debug.Assert(_writeBuffer is not null); 730Debug.Assert(_context != null); 759Debug.Assert(_context != null); 788Debug.Fail("Unreachable"); 849Debug.Fail("Unreachable"); 868Debug.Assert(_framer != null); 894Debug.Assert(_context != null);
System\Net\Security\NetSecurityTelemetry.cs (5)
148Debug.Assert(sizeof(SslProtocols) == 4); 183Debug.Assert(Enum.GetValues<SslProtocols>()[^1] == SslProtocols.Tls13, "Make sure to add a counter for new SslProtocols"); 249Debug.Assert(count >= 0); 252Debug.Assert(count >= 0); 340Debug.Assert(protocolVersion is not null);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (3)
23Debug.Assert(certHashBytes != null, "check certHashBytes is not null"); 24Debug.Assert(certHashBytes.Length <= CertHashMaxSize); 33Debug.Assert(kind == ChannelBindingKind.Endpoint || kind == ChannelBindingKind.Unique);
System\Net\Security\SslApplicationProtocol.cs (1)
29Debug.Assert(protocol != null);
System\Net\Security\SslConnectionInfo.Unix.cs (1)
35Debug.Assert(data != 0, $"No mapping found for cipherSuite {cipherSuite}");
System\Net\Security\SslSessionsCache.cs (1)
159Debug.Assert(creds != null, "creds == null");
System\Net\Security\SslStream.cs (11)
88Debug.Assert(length <= DecryptedLength); 118Debug.Assert(byteCount <= _decryptedLength, "byteCount <= _decryptedBytes"); 135Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 136Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 143Debug.Assert(_decryptedLength == 0, "_decryptedBytes == 0"); 144Debug.Assert(_decryptedPadding == 0, "_encryptedOffset == 0"); 780Debug.Assert(bytesRead == 0 || bytesRead == 1); 796Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 812Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 831Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously"); 850Debug.Assert(vt.IsCompleted, "Sync operation must have completed synchronously");
System\Net\Security\SslStream.IO.cs (9)
47Debug.Assert(e != null, $"Expected non-null Exception to be passed to {nameof(SetException)}"); 331Debug.Assert(consumed == (reAuthenticationData?.Length ?? 0)); 335Debug.Assert(token.Payload != null); 554Debug.Assert(frameSize > 0); 583Debug.Assert(frameSize > 0); 852Debug.Assert(_buffer.AvailableLength > 0, "_buffer.AvailableBytes > 0"); 923Debug.Assert(_buffer.EncryptedLength == 0); 928Debug.Assert(_buffer.DecryptedLength == 0); 1092Debug.Assert(_buffer.DecryptedLength > 0);
System\Net\Security\SslStream.Protocol.cs (12)
186Debug.Assert(ret && written == certHash.Length); 253Debug.Assert(certificate != null); 499Debug.Assert((object?)clientCertificate == (object?)selectedCert || clientCertificate!.Equals(selectedCert), "'selectedCert' does not match 'clientCertificate'."); 630Debug.Assert(_sslAuthenticationOptions.CertificateContext is null); 716Debug.Assert(localCertificate.Equals(selectedCert), "'selectedCert' does not match 'localCertificate'."); 720Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 989Debug.Assert(_securityContext != null); 1011Debug.Assert(_maxDataSize > 0); 1352Debug.Assert(chain != null); 1490Debug.Assert(chain != null); 1562Debug.Assert(Payload == null); 1599Debug.Assert(Payload != null || Size == 0);
System\Net\Security\SslStream.TlsSessionWedge.cs (1)
26Debug.Assert(_sslAuthenticationOptions != null);
System\Net\Security\SslStreamCertificateContext.Linux.cs (9)
271Debug.Assert(_rootCertificate != null); 274Debug.Assert(_ocspUrls is not null); 275Debug.Assert(_ocspUrls.Count > 0); 276Debug.Assert(caCert is not null); 280Debug.Assert(subject != 0); 281Debug.Assert(issuer != 0); 389Debug.Assert(baseUri.Length > 0); 390Debug.Assert(encodedRequest.Count > 0); 422Debug.Assert(_staplingForbidden, "Shouldn't release resources while OCSP stapling may be happening on the background.");
System\Net\Security\SslStreamPal.Unix.cs (2)
206Debug.Assert(sslAuthenticationOptions.IsClient); 250Debug.Assert(CanGenerateCustomAlerts);
System\Net\Security\TlsContext.cs (1)
175Debug.Assert(sharedOptions != null);
System\Net\Security\TlsSession.cs (13)
140Debug.Assert(socket != null); 141Debug.Assert(!_disposed, "AttachSocket called on a disposed session"); 142Debug.Assert(_socketHandle is null, "AttachSocket called twice on the same session"); 143Debug.Assert(_socket is null, "AttachSocket called after the managed Socket wrapper was already created"); 144Debug.Assert(_securityContext is null, "AttachSocket called after the PAL security context was already allocated"); 178Debug.Assert(_context is null); 179Debug.Assert(context is not null); 999Debug.Assert(token.Payload != null); 1055Debug.Assert(token.Payload != null); 1197Debug.Assert(token.Payload != null); 1441Debug.Assert(token.Payload != null); 1521Debug.Assert(token.Payload != null); 1881Debug.Assert(token.Payload != null);
System\Net\SslStreamContext.cs (1)
16Debug.Assert(sslStream != null);
System\Security\Authentication\ExtendedProtection\ServiceNameCollection.cs (4)
45Debug.Assert(list != null); 46Debug.Assert(additionalCapacity >= 0); 109Debug.Assert(serviceNames != null); 122Debug.Assert(serviceNames != null);
System.Net.ServerSentEvents (25)
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
System\Net\ServerSentEvents\Helpers.cs (4)
18Debug.Assert(MaxDecimalDigits <= buffer.Length); 21Debug.Assert(success); 36Debug.Assert(value.Length <= buffer.Length); 50Debug.Assert(buffer.Length >= maxByteCount);
System\Net\ServerSentEvents\SseFormatter.cs (4)
107Debug.Assert(bufferWriter.WrittenCount is 0); 111Debug.Assert(!eventType.ContainsLineBreaks()); 123Debug.Assert(!eventId.ContainsLineBreaks()); 132Debug.Assert(retry >= TimeSpan.Zero);
System\Net\ServerSentEvents\SseParser_1.cs (7)
269Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}"); 270Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}"); 271Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}"); 273Debug.Assert(searchLength >= 0, $"{searchLength}"); 274Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}"); 279Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline"); 547Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
System.Net.Sockets (179)
src\runtime\src\libraries\Common\src\System\Net\InternalException.cs (1)
16Debug.Fail($"InternalException thrown for unexpected value: {unexpectedValue}");
src\runtime\src\libraries\Common\src\System\Net\InteropIPAddressExtensions.Unix.cs (1)
16Debug.Assert(bytesWritten == sizeof(uint) || bytesWritten == Interop.Sys.IPv6AddressBytes, $"Unexpected length: {bytesWritten}");
src\runtime\src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\runtime\src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (6)
27Debug.Assert(err == Interop.Error.SUCCESS, $"Unexpected err: {err}"); 28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds); 55Debug.Fail("Unexpected failure in GetAddressFamily");
System\Net\Sockets\SafeSocketHandle.cs (4)
127Debug.Fail($"handle:{handle}, error:{exception}"); 158Debug.Assert(ExceptionCheck.IsFatal(exception), $"handle:{handle}, error:{exception}"); 166Debug.Assert(ret, $"ReleaseHandle failed. handle:{handle}"); 173Debug.Assert(!IsClosed);
System\Net\Sockets\SafeSocketHandle.Unix.cs (2)
175Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}"); 188Debug.Assert(value == -1 || value > 0, $"Unexpected value: {value}");
System\Net\Sockets\SafeSocketHandle.Unix.OptionTracking.cs (3)
34Debug.Assert(values.Length == TrackableOptionCount); 85Debug.Assert(values.Length == TrackableOptionCount); 89Debug.Assert((_trackedOptions & lingerFlag) == lingerFlag);
System\Net\Sockets\Socket.cs (12)
89Debug.Assert(_handle.IsInvalid); 95Debug.Assert(!_handle.IsInvalid); 140Debug.Assert(SocketPal.MaximumAddressSize <= 512); 152Debug.Assert(bufferLength <= buffer.Length); 1079Debug.Assert(acceptedSocketHandle.IsInvalid); 1090Debug.Assert(!acceptedSocketHandle.IsInvalid); 2894Debug.Assert(!saeaMultiConnectCancelable || cancellationToken == default); 3586Debug.Assert(boundAddress != null, "Not Bound"); 3798Debug.Assert(fd != null && !fd.IsInvalid); 3856Debug.Assert(!_nonBlockingConnectInProgress); 4075Debug.Assert(t.IsCanceled || t.IsFaulted); 4082Debug.Assert(t.Exception != null);
System\Net\Sockets\Socket.Tasks.cs (13)
65Debug.Assert(saea.BufferList is null); 66Debug.Assert(saea.AcceptSocket is null); 184Debug.Assert(endPoint.Port == port); 196Debug.Assert(lastException != null); 301Debug.Assert(saea.BufferList == null); 391Debug.Assert(saea.BufferList == null); 431Debug.Assert(saea.BufferList == null); 492Debug.Assert(saea.BufferList == null); 547Debug.Assert(saea.BufferList == null); 565Debug.Assert(saea.BufferList == null); 655Debug.Assert(saea.BufferList == null); 685Debug.Assert(saea.BufferList == null); 783Debug.Assert(index == packetsCount);
System\Net\Sockets\Socket.Unix.cs (4)
60Debug.Assert(!_handle.LastConnectFailed); 94Debug.Assert(e == Interop.Error.SUCCESS, e.ToString()); 114Debug.Assert(rv == 0 || blocking); // ignore failures 297Debug.Assert(Equals(origValue, cloneValue), $"{pi.Name}. Expected: {origValue}, Actual: {cloneValue}");
System\Net\Sockets\SocketAsyncContext.Unix.cs (62)
164Debug.Assert(oldState == State.Waiting, $"Unexpected operation state: {(State)oldState}"); 169Debug.Assert(_state is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state"); 182Debug.Assert(state is State.Running or State.RunningWithPendingCancellation, $"Unexpected operation state: {(State)state}"); 246Debug.Assert(_state == State.Canceled); 258Debug.Assert(!Interlocked.Exchange(ref _callbackQueued, true), $"Unexpected _callbackQueued: {_callbackQueued}"); 285Debug.Assert(Event == null); 307Debug.Fail("Expected derived type to implement IThreadPoolWorkItem"); 471Debug.Assert(SocketAddress.Length == 0); 627Debug.Assert(ErrorCode == SocketError.Success || AcceptedFileDescriptor == (IntPtr)(-1), $"Unexpected values: ErrorCode={ErrorCode}, AcceptedFileDescriptor={AcceptedFileDescriptor}"); 718Debug.Assert(lockObject != null); 722Debug.Assert(!Monitor.IsEntered(_lockObject)); 726Debug.Assert(success, "Timed out waiting for queue lock"); 734Debug.Assert(Monitor.IsEntered(_lockObject)); 800Debug.Assert(_queueLock == null); 819Debug.Assert(sizeof(QueueState) == sizeof(int)); 859Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 871Debug.Assert(operation.Next == operation, "Expected operation.Next == operation"); 875Debug.Assert(!_isNextOperationSynchronous); 898Debug.Assert(_tail == null); 925Debug.Assert(error != Interop.Error.SUCCESS); 959Debug.Assert(_tail == null, "State == Ready but queue is not empty!"); 965Debug.Assert(_tail != null, "State == Waiting but queue is empty!"); 967Debug.Assert(_isNextOperationSynchronous == (op.Event != null)); 980Debug.Assert(_tail != null, "State == Processing but queue is empty!"); 986Debug.Assert(_tail == null); 1006Debug.Assert(!skipAsyncEvents); 1015Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation"); 1042Debug.Assert(_tail == null); 1048Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1049Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O"); 1050Debug.Assert(op == _tail.Next, "Operation is not at head of queue???"); 1070Debug.Assert(_tail == null); 1076Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1082Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???"); 1102Debug.Assert(_tail == null); 1107Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!"); 1108Debug.Assert(_tail.Next == op, "Queue modified while processing queue"); 1130Debug.Assert(result != OperationResult.Pending); 1137Debug.Assert(op.Event != null); 1146Debug.Assert(_tail == null); 1150Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing"); 1220Debug.Assert(_state != QueueState.Stopped); 1226Debug.Assert(_state != QueueState.Stopped); 1290Debug.Assert(_isHandleNonBlocking); 1397Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1472Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1479Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}"); 1497Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1498Debug.Assert(callback != null, "Expected non-null callback"); 1507Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}"); 1535Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1562Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 1563Debug.Assert(callback != null, "Expected non-null callback"); 1640Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1785Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1854Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1891Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 1983Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2015Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2094Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2164Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}"); 2284Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketAsyncEngine.Unix.cs (7)
135Debug.Assert(context.GlobalContextIndex == -1); 154Debug.Assert(s_registeredContexts[index] is null); 173Debug.Assert(context.GlobalContextIndex >= 0); 174Debug.Assert(ReferenceEquals(s_registeredContexts[context.GlobalContextIndex], context)); 240Debug.Assert(numEvents > 0, $"Unexpected numEvents: {numEvents}"); 269Debug.Assert((uint)socketEvent.Data < (uint)s_registeredContexts.Length); 336Debug.Assert(root._left is null && root._right is null);
System\Net\Sockets\SocketAsyncEventArgs.cs (7)
124Debug.Assert(success); 236Debug.Fail($"Callers should guard against calling this method for '{LastOperation}'"); 543Debug.Assert(status == OperationState.InProgress || status == OperationState.Configuring || status == OperationState.Disposed, $"Unexpected status: {status}"); 688Debug.Assert(endPoint.AddressFamily == AddressFamily.Unspecified || 694Debug.Assert(!cancellationToken.CanBeCanceled, "Task-based connect logic should not use _multipleConnectCancellation for cancellation."); 802Debug.Assert(existing.Port == port); 1144Debug.Assert(socketError != SocketError.IOPending);
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (4)
55Debug.Assert(acceptHandle == null, $"Unexpected acceptHandle: {acceptHandle}"); 189Debug.Assert(socketAddress.Length == socketAddressSize); 246Debug.Assert(_sendPacketsElements != null); 333Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Sockets\SocketPal.Unix.cs (37)
68Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1"); 89Debug.Assert(fd == (IntPtr)(-1), $"Unexpected fd: {fd}"); 107Debug.Assert(!handle.IsSocket); 122Debug.Assert(socket.IsSocket); 146Debug.Assert(socket.IsSocket); 158Debug.Assert(socketAddress.Length != 0 || sockAddr == null); 187Debug.Assert(!handle.IsSocket); 216Debug.Assert(socket.IsSocket); 243Debug.Assert(socket.IsSocket); 287Debug.Assert(socket.IsSocket); 382Debug.Assert(socket.IsSocket); 485Debug.Assert(socket.IsSocket); 501Debug.Assert(socketAddress.Length != 0 || rawSocketAddress == null); 543Debug.Assert(socket.IsSocket); 650Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1"); 673Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}"); 747Debug.Assert(err == Interop.Error.EBADF, $"Unexpected err: {err}"); 782Debug.Assert(flags == SocketFlags.None); 841Debug.Assert(flags == SocketFlags.None); 842Debug.Assert(buffers == null); 980Debug.Assert(flags == SocketFlags.None); 981Debug.Assert(buffers == null); 1534Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName: {optionName}"); 1557Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1686Debug.Assert((uint)optionLength <= optionValue.Length); 1705Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1730Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}"); 1798Debug.Assert(count > 0, $"Expected at least one entry."); 1881Debug.Assert(refsAdded == 0); 1894Debug.Assert(buffer.Length == socketList.Count); 1940Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength"); 1950Debug.Assert(offset == eventsLength, $"Invalid adds. offset={offset}, eventsLength={eventsLength}."); 1951Debug.Assert(refsAdded == eventsLength, $"Invalid ref adds. refsAdded={refsAdded}, eventsLength={eventsLength}."); 1989Debug.Assert(refsAdded == 0); 2001Debug.Assert(arrOffset < arrLength, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 2036Debug.Assert(arrEndOffset >= 0, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls."); 2088Debug.Assert(elements.Length == fileHandles.Length);
System\Net\Sockets\SocketsTelemetry.cs (5)
148Debug.Assert(newCount >= 0); 170Debug.Assert(exceptionMessage is null); 204Debug.Assert(exceptionMessage is null); 218Debug.Assert(count >= 0); 225Debug.Assert(count >= 0);
System\Net\Sockets\TCPClient.cs (1)
370Debug.Assert(_clientSocket == null);
System\Net\Sockets\TCPListener.cs (1)
282Debug.Assert(OperatingSystem.IsWindows());
System\Net\Sockets\UnixDomainSocketEndPoint.cs (2)
57Debug.Assert(bufferLength - (isAbstract ? 0 : 1) == bytesEncoded); 69Debug.Assert(AddressFamily.Unix == SocketAddressPal.GetAddressFamily(socketAddress));
System\Net\Sockets\UnixDomainSocketEndPoint.Unix.cs (3)
28Debug.Assert(s_nativePathOffset >= 0, "Expected path offset to be positive"); 29Debug.Assert(s_nativePathOffset + s_nativePathLength <= s_nativeAddressSize, "Expected address size to include all of the path length"); 30Debug.Assert(s_nativePathLength >= 92, "Expected max path length to be at least 92"); // per http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/sys_un.h.html
System.Net.WebClient (27)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\IO\ChunkedMemoryStream.cs (3)
29Debug.Assert(chunk._next == null || chunk._freeOffset == chunk._buffer.Length); 97Debug.Assert(_headChunk == null); 102Debug.Assert(_headChunk != null);
src\runtime\src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\runtime\src\libraries\Common\src\System\Threading\Tasks\BeginEndAwaitableAdapter.cs (3)
13Debug.Assert(asyncResult != null); 14Debug.Assert(asyncResult.IsCompleted); 15Debug.Assert(asyncResult.AsyncState is BeginEndAwaitableAdapter);
src\runtime\src\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (9)
18private static readonly Action s_completionSentinel = static () => Debug.Fail("Completion sentinel should never be invoked"); 45Debug.Assert(c == null || c == s_completionSentinel); 55Debug.Assert(_continuation != null); 96Debug.Assert(exception != null); 109Debug.Assert(c != s_completionSentinel); 125Debug.Assert(continuation != null); 130Debug.Assert(c == s_completionSentinel); 145Debug.Assert(_resultSet ^ (_error != null)); 149Debug.Assert(!_resultSet && _error == null);
System\Net\WebClient.cs (5)
516Debug.Assert(conversionStatus == OperationStatus.Done); 871Debug.Assert(_progress != null, "ProgressData should have been initialized"); 872Debug.Assert(asyncOp != null); 1009Debug.Assert(asyncOp != null); 1010Debug.Assert(_progress != null, "ProgressData should have been initialized");
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
142Debug.Assert(headers.Count == Items);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
381Debug.Assert(formatted);
System.Net.WebSockets (86)
src\runtime\src\libraries\Common\src\System\IO\Compression\ZLibNative.cs (3)
269Debug.Assert(zlibErrorContext is "deflateInit2_" or "inflateInit2_"); 294Debug.Assert(InitializationState == State.NotInitialized); 373Debug.Assert(InitializationState == State.NotInitialized);
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
74Debug.Assert(IsEnabled()); 99Debug.Assert(IsEnabled());
src\runtime\src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\AsyncMutex.cs (9)
118Debug.Assert(_waitersTail.Next != null && _waitersTail.Prev != null); 141Debug.Assert(w.Prev != null); 156Debug.Assert(m._waitersTail == w); 205Debug.Assert(_lockedSemaphoreFull); 214Debug.Assert(w.Next != null && w.Prev != null); 215Debug.Assert(w.Next != w || w.Prev == w); 216Debug.Assert(w.Prev != w || w.Next == w); 225Debug.Assert(w.Next != null && w.Prev != null); 226Debug.Assert(w.Next != w && w.Prev != w);
System\Net\WebSockets\Compression\WebSocketDeflater.cs (10)
43Debug.Assert(_buffer is null, "Invalid state, ReleaseBuffer not called."); 60Debug.Assert(consumed == payload.Length); 95Debug.Assert(written == output.Length); 106Debug.Assert(output.Slice(written - WebSocketInflater.FlushMarkerLength, WebSocketInflater.FlushMarkerLength) 124Debug.Assert(_stream is not null); 155Debug.Assert(_stream is not null); 156Debug.Assert(_stream.AvailIn == 0); 157Debug.Assert(output.Length > 0); 171Debug.Assert(errorCode is ErrorCode.Ok or ErrorCode.BufError); 185Debug.Assert(errorCode == ErrorCode.Ok);
System\Net\WebSockets\Compression\WebSocketInflater.cs (6)
74Debug.Assert(_available > 0); 89Debug.Assert(totalBytesReceived == 0 || _buffer is not null, "Prepare must be called."); 98Debug.Assert(_available == 0); 178Debug.Assert(_stream is not null && _stream.AvailIn == 0); 179Debug.Assert(_available == 0); 242Debug.Assert(destination.Length > 0);
System\Net\WebSockets\ManagedWebSocket.cs (32)
142Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null"); 143Debug.Assert(stream != null, $"Expected non-null {nameof(stream)}"); 144Debug.Assert(stream.CanRead, $"Expected readable {nameof(stream)}"); 145Debug.Assert(stream.CanWrite, $"Expected writeable {nameof(stream)}"); 146Debug.Assert(keepAliveInterval == Timeout.InfiniteTimeSpan || keepAliveInterval >= TimeSpan.Zero, $"Invalid {nameof(keepAliveInterval)}: {keepAliveInterval}"); 147Debug.Assert(keepAliveTimeout == Timeout.InfiniteTimeSpan || keepAliveTimeout >= TimeSpan.Zero, $"Invalid {nameof(keepAliveTimeout)}: {keepAliveTimeout}"); 236Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 431Debug.Assert(_sentCloseFrame); 459Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held"); 499Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 653Debug.Assert(_sendBuffer != null); 715Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}"); 890Debug.Assert(header.Opcode == MessageOpcode.Binary || header.Opcode == MessageOpcode.Text, $"Unexpected opcode {header.Opcode}"); 915Debug.Assert(_inflater is not null); 1146Debug.Assert(_receiveMutex.IsHeld, $"Expected {nameof(_receiveMutex)} to be held"); 1186Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}"); 1290Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}"); 1314Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header."); 1332Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length."); 1338Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length."); 1455Debug.Assert( 1561Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match"); 1595Debug.Assert(count >= 0, $"Expected non-negative {nameof(count)}, got {count}"); 1596Debug.Assert(count <= _receiveBufferCount, $"Trying to consume {count}, which is more than exists {_receiveBufferCount}"); 1605Debug.Assert(minimumRequiredBytes <= _receiveBuffer.Length, $"Requested number of bytes {minimumRequiredBytes} must not exceed {_receiveBuffer.Length}"); 1644Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up 1651Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}"); 1671Debug.Assert(maskOffsetIndex < MaskLength, $"Unexpected {nameof(maskOffsetIndex)}: {maskOffsetIndex}"); 1672Debug.Assert(mask.Length >= MaskLength + maskOffset, $"Unexpected inputs: {mask.Length}, {maskOffset}"); 1683Debug.Assert(maskIndex < sizeof(int)); 1801Debug.Assert((b & 0x80) != 0, "Should have already skipped past ASCII"); 1909Debug.Assert(task.IsFaulted);
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (5)
38Debug.Assert((opcode is MessageOpcode.Pong) || (!IsUnsolicitedPongKeepAlive && opcode is MessageOpcode.Ping)); 53Debug.Assert(_keepAlivePingState != null); 115Debug.Assert(_keepAlivePingState != null); 190Debug.Assert(Monitor.IsEntered(StateUpdateLock)); 207Debug.Assert(Monitor.IsEntered(StateUpdateLock));
System\Net\WebSockets\NetEventSource.WebSockets.cs (12)
56Debug.Assert(Log.IsEnabled()); 63Debug.Assert(Log.IsEnabled()); 70Debug.Assert(Log.IsEnabled()); 93Debug.Assert(Log.IsEnabled()); 112Debug.Assert(Log.IsEnabled()); 119Debug.Assert(Log.IsEnabled()); 138Debug.Assert(Log.IsEnabled()); 145Debug.Assert(Log.IsEnabled()); 164Debug.Assert(Log.IsEnabled()); 171Debug.Assert(Log.IsEnabled()); 190Debug.Assert(Log.IsEnabled()); 197Debug.Assert(Log.IsEnabled());
System\Net\WebSockets\ValueWebSocketReceiveResult.cs (3)
26Debug.Assert(count == Count); 27Debug.Assert(messageType == MessageType); 28Debug.Assert(endOfMessage == EndOfMessage);
System\Net\WebSockets\WebSocketStateHelper.cs (2)
35Debug.Assert(state == ManagedWebSocketStates.Aborted); 46Debug.Assert(Enum.IsDefined(flag));
System.Net.WebSockets.Client (6)
src\runtime\src\libraries\Common\src\System\Net\WebSockets\WebSocketValidate.cs (1)
97Debug.Assert(!string.IsNullOrEmpty(parameterName), "'parameterName' MUST NOT be NULL or string.Empty");
System\Net\WebSockets\BrowserWebSockets\ClientWebSocketOptions.cs (1)
156Debug.Assert(!_isReadOnly, "Already set");
System\Net\WebSockets\ClientWebSocket.cs (4)
48Debug.Assert(_state == InternalState.Disposed); 136Debug.Assert(_state == InternalState.Disposed); 173Debug.Assert(_innerWebSocket != null); 174Debug.Assert(_innerWebSocket.WebSocket != null);
System.Numerics.Tensors (399)
System\Buffers\NIndex.cs (1)
179Debug.Assert(formatted);
System\Buffers\NRange.cs (2)
74Debug.Assert(formatted); 85Debug.Assert(formatted);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (54)
190Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 372Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 554Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 712Debug.Assert(sizeof(T) == 8); 720Debug.Assert(sizeof(T) == 1); 758Debug.Assert(Vector256.IsHardwareAccelerated); 772Debug.Assert(Vector256.IsHardwareAccelerated); 797Debug.Assert(Vector128.IsHardwareAccelerated); 811Debug.Assert(Vector128.IsHardwareAccelerated); 891Debug.Assert(sizeof(T) == 2); 913Debug.Assert(Vector256.IsHardwareAccelerated); 927Debug.Assert(Vector256.IsHardwareAccelerated); 944Debug.Assert(Vector128.IsHardwareAccelerated); 958Debug.Assert(Vector128.IsHardwareAccelerated); 1006Debug.Assert(sizeof(T) == 4); 1019Debug.Assert(Vector256.IsHardwareAccelerated); 1032Debug.Assert(Vector256.IsHardwareAccelerated); 1044Debug.Assert(Vector128.IsHardwareAccelerated); 1057Debug.Assert(Vector128.IsHardwareAccelerated); 1095Debug.Assert(sizeof(T) == 8); 1104Debug.Assert(Vector256.IsHardwareAccelerated); 1117Debug.Assert(Vector256.IsHardwareAccelerated); 1127Debug.Assert(Vector128.IsHardwareAccelerated); 1140Debug.Assert(Vector128.IsHardwareAccelerated); 1316Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 1523Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 1730Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 1908Debug.Assert(sizeof(T) == 8); 1916Debug.Assert(sizeof(T) == 1); 1954Debug.Assert(Vector256.IsHardwareAccelerated); 1970Debug.Assert(Vector256.IsHardwareAccelerated); 1996Debug.Assert(Vector128.IsHardwareAccelerated); 2012Debug.Assert(Vector128.IsHardwareAccelerated); 2093Debug.Assert(sizeof(T) == 2); 2115Debug.Assert(Vector256.IsHardwareAccelerated); 2131Debug.Assert(Vector256.IsHardwareAccelerated); 2149Debug.Assert(Vector128.IsHardwareAccelerated); 2165Debug.Assert(Vector128.IsHardwareAccelerated); 2214Debug.Assert(sizeof(T) == 4); 2227Debug.Assert(Vector256.IsHardwareAccelerated); 2242Debug.Assert(Vector256.IsHardwareAccelerated); 2255Debug.Assert(Vector128.IsHardwareAccelerated); 2270Debug.Assert(Vector128.IsHardwareAccelerated); 2311Debug.Assert(sizeof(T) == 8); 2320Debug.Assert(Vector256.IsHardwareAccelerated); 2335Debug.Assert(Vector256.IsHardwareAccelerated); 2346Debug.Assert(Vector128.IsHardwareAccelerated); 2361Debug.Assert(Vector128.IsHardwareAccelerated); 2414Debug.Assert(sizeof(T) == 8); 2450Debug.Assert(sizeof(T) == 8); 2486Debug.Assert(sizeof(T) == 8); 2522Debug.Assert(sizeof(T) == 8); 2558Debug.Assert(sizeof(T) == 8); 2594Debug.Assert(sizeof(T) == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBinaryOperator.cs (49)
198Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 440Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 682Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 897Debug.Assert(sizeof(T) == 8); 905Debug.Assert(sizeof(T) == 1); 942Debug.Assert(Vector256.IsHardwareAccelerated); 958Debug.Assert(Vector256.IsHardwareAccelerated); 984Debug.Assert(Vector128.IsHardwareAccelerated); 1000Debug.Assert(Vector128.IsHardwareAccelerated); 1093Debug.Assert(sizeof(T) == 2); 1114Debug.Assert(Vector256.IsHardwareAccelerated); 1130Debug.Assert(Vector256.IsHardwareAccelerated); 1148Debug.Assert(Vector128.IsHardwareAccelerated); 1164Debug.Assert(Vector128.IsHardwareAccelerated); 1217Debug.Assert(sizeof(T) == 4); 1229Debug.Assert(Vector256.IsHardwareAccelerated); 1244Debug.Assert(Vector256.IsHardwareAccelerated); 1257Debug.Assert(Vector128.IsHardwareAccelerated); 1272Debug.Assert(Vector128.IsHardwareAccelerated); 1311Debug.Assert(sizeof(T) == 8); 1319Debug.Assert(Vector256.IsHardwareAccelerated); 1334Debug.Assert(Vector256.IsHardwareAccelerated); 1345Debug.Assert(Vector128.IsHardwareAccelerated); 1360Debug.Assert(Vector128.IsHardwareAccelerated); 1529Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1767Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2005Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2217Debug.Assert(sizeof(T) == 8); 2225Debug.Assert(sizeof(T) == 1); 2262Debug.Assert(Vector256.IsHardwareAccelerated); 2280Debug.Assert(Vector256.IsHardwareAccelerated); 2306Debug.Assert(Vector128.IsHardwareAccelerated); 2324Debug.Assert(Vector128.IsHardwareAccelerated); 2417Debug.Assert(sizeof(T) == 2); 2438Debug.Assert(Vector256.IsHardwareAccelerated); 2456Debug.Assert(Vector256.IsHardwareAccelerated); 2474Debug.Assert(Vector128.IsHardwareAccelerated); 2492Debug.Assert(Vector128.IsHardwareAccelerated); 2545Debug.Assert(sizeof(T) == 4); 2557Debug.Assert(Vector256.IsHardwareAccelerated); 2574Debug.Assert(Vector256.IsHardwareAccelerated); 2587Debug.Assert(Vector128.IsHardwareAccelerated); 2604Debug.Assert(Vector128.IsHardwareAccelerated); 2643Debug.Assert(sizeof(T) == 8); 2651Debug.Assert(Vector256.IsHardwareAccelerated); 2668Debug.Assert(Vector256.IsHardwareAccelerated); 2679Debug.Assert(Vector128.IsHardwareAccelerated); 2696Debug.Assert(Vector128.IsHardwareAccelerated); 2761Debug.Assert(sizeof(T) == 8);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IBooleanUnaryOperator.cs (7)
78Debug.Assert(!x.IsEmpty); 211Debug.Assert(sizeof(T) == sizeof(bool)); 319Debug.Assert(sizeof(T) == 2 * sizeof(bool)); 436Debug.Assert(sizeof(T) == 4 * sizeof(bool)); 571Debug.Assert(sizeof(T) == 8 * sizeof(bool)); 619Debug.Assert(sizeof(T) == 8 * sizeof(bool)); 667Debug.Assert(sizeof(T) == 8 * sizeof(bool));
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IIndexOfMinMaxOperator.cs (15)
88Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); 89Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); 90Debug.Assert(sizeof(TInt) == sizeof(T)); 157Debug.Assert(sizeof(T) == 2); 232Debug.Assert(sizeof(T) == 1); 319Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); 320Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); 321Debug.Assert(sizeof(TInt) == sizeof(T)); 388Debug.Assert(sizeof(T) == 2); 463Debug.Assert(sizeof(T) == 1); 550Debug.Assert(sizeof(T) == 4 || sizeof(T) == 8); 551Debug.Assert(typeof(TInt) == typeof(uint) || typeof(TInt) == typeof(ulong)); 552Debug.Assert(sizeof(TInt) == sizeof(T)); 619Debug.Assert(sizeof(T) == 2); 694Debug.Assert(sizeof(T) == 1);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IStatefulUnaryOperator.cs (24)
158Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 369Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 580Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 769Debug.Assert(sizeof(T) == 8); 777Debug.Assert(sizeof(T) == 1); 814Debug.Assert(Vector256.IsHardwareAccelerated); 828Debug.Assert(Vector256.IsHardwareAccelerated); 853Debug.Assert(Vector128.IsHardwareAccelerated); 867Debug.Assert(Vector128.IsHardwareAccelerated); 945Debug.Assert(sizeof(T) == 2); 966Debug.Assert(Vector256.IsHardwareAccelerated); 980Debug.Assert(Vector256.IsHardwareAccelerated); 997Debug.Assert(Vector128.IsHardwareAccelerated); 1011Debug.Assert(Vector128.IsHardwareAccelerated); 1057Debug.Assert(sizeof(T) == 4); 1069Debug.Assert(Vector256.IsHardwareAccelerated); 1082Debug.Assert(Vector256.IsHardwareAccelerated); 1094Debug.Assert(Vector128.IsHardwareAccelerated); 1107Debug.Assert(Vector128.IsHardwareAccelerated); 1143Debug.Assert(sizeof(T) == 8); 1151Debug.Assert(Vector256.IsHardwareAccelerated); 1164Debug.Assert(Vector256.IsHardwareAccelerated); 1174Debug.Assert(Vector128.IsHardwareAccelerated); 1187Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.ITernaryOperator.cs (72)
191Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 464Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 737Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 978Debug.Assert(sizeof(T) == 8); 986Debug.Assert(sizeof(T) == 1); 1023Debug.Assert(Vector256.IsHardwareAccelerated); 1041Debug.Assert(Vector256.IsHardwareAccelerated); 1068Debug.Assert(Vector128.IsHardwareAccelerated); 1086Debug.Assert(Vector128.IsHardwareAccelerated); 1194Debug.Assert(sizeof(T) == 2); 1215Debug.Assert(Vector256.IsHardwareAccelerated); 1233Debug.Assert(Vector256.IsHardwareAccelerated); 1252Debug.Assert(Vector128.IsHardwareAccelerated); 1270Debug.Assert(Vector128.IsHardwareAccelerated); 1330Debug.Assert(sizeof(T) == 4); 1342Debug.Assert(Vector256.IsHardwareAccelerated); 1359Debug.Assert(Vector256.IsHardwareAccelerated); 1373Debug.Assert(Vector128.IsHardwareAccelerated); 1390Debug.Assert(Vector128.IsHardwareAccelerated); 1432Debug.Assert(sizeof(T) == 8); 1440Debug.Assert(Vector256.IsHardwareAccelerated); 1457Debug.Assert(Vector256.IsHardwareAccelerated); 1469Debug.Assert(Vector128.IsHardwareAccelerated); 1486Debug.Assert(Vector128.IsHardwareAccelerated); 1665Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1934Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2203Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2441Debug.Assert(sizeof(T) == 8); 2449Debug.Assert(sizeof(T) == 1); 2486Debug.Assert(Vector256.IsHardwareAccelerated); 2506Debug.Assert(Vector256.IsHardwareAccelerated); 2533Debug.Assert(Vector128.IsHardwareAccelerated); 2553Debug.Assert(Vector128.IsHardwareAccelerated); 2661Debug.Assert(sizeof(T) == 2); 2682Debug.Assert(Vector256.IsHardwareAccelerated); 2702Debug.Assert(Vector256.IsHardwareAccelerated); 2721Debug.Assert(Vector128.IsHardwareAccelerated); 2741Debug.Assert(Vector128.IsHardwareAccelerated); 2801Debug.Assert(sizeof(T) == 4); 2813Debug.Assert(Vector256.IsHardwareAccelerated); 2832Debug.Assert(Vector256.IsHardwareAccelerated); 2846Debug.Assert(Vector128.IsHardwareAccelerated); 2865Debug.Assert(Vector128.IsHardwareAccelerated); 2907Debug.Assert(sizeof(T) == 8); 2915Debug.Assert(Vector256.IsHardwareAccelerated); 2934Debug.Assert(Vector256.IsHardwareAccelerated); 2946Debug.Assert(Vector128.IsHardwareAccelerated); 2965Debug.Assert(Vector128.IsHardwareAccelerated); 3149Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 3413Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 3677Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 3912Debug.Assert(sizeof(T) == 8); 3920Debug.Assert(sizeof(T) == 1); 3957Debug.Assert(Vector256.IsHardwareAccelerated); 3978Debug.Assert(Vector256.IsHardwareAccelerated); 4005Debug.Assert(Vector128.IsHardwareAccelerated); 4026Debug.Assert(Vector128.IsHardwareAccelerated); 4134Debug.Assert(sizeof(T) == 2); 4155Debug.Assert(Vector256.IsHardwareAccelerated); 4176Debug.Assert(Vector256.IsHardwareAccelerated); 4195Debug.Assert(Vector128.IsHardwareAccelerated); 4216Debug.Assert(Vector128.IsHardwareAccelerated); 4276Debug.Assert(sizeof(T) == 4); 4288Debug.Assert(Vector256.IsHardwareAccelerated); 4308Debug.Assert(Vector256.IsHardwareAccelerated); 4322Debug.Assert(Vector128.IsHardwareAccelerated); 4342Debug.Assert(Vector128.IsHardwareAccelerated); 4384Debug.Assert(sizeof(T) == 8); 4392Debug.Assert(Vector256.IsHardwareAccelerated); 4412Debug.Assert(Vector256.IsHardwareAccelerated); 4424Debug.Assert(Vector128.IsHardwareAccelerated); 4444Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToFourOperator.cs (7)
33Debug.Assert(sizeof(TInput) * 4 == sizeof(TOutput)); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 83Debug.Assert(Vector256<TInput>.IsSupported); 84Debug.Assert(Vector256<TOutput>.IsSupported); 120Debug.Assert(Vector128<TInput>.IsSupported); 121Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOneToTwoOperator.cs (7)
33Debug.Assert(sizeof(TInput) * 2 == sizeof(TOutput)); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 79Debug.Assert(Vector256<TInput>.IsSupported); 80Debug.Assert(Vector256<TOutput>.IsSupported); 112Debug.Assert(Vector128<TInput>.IsSupported); 113Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryOperator.cs (24)
198Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<TInput>)) == 0); 409Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<TInput>)) == 0); 620Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<TInput>)) == 0); 809Debug.Assert(sizeof(TInput) == 8); 817Debug.Assert(sizeof(TInput) == 1); 854Debug.Assert(Vector256.IsHardwareAccelerated); 868Debug.Assert(Vector256.IsHardwareAccelerated); 893Debug.Assert(Vector128.IsHardwareAccelerated); 907Debug.Assert(Vector128.IsHardwareAccelerated); 985Debug.Assert(sizeof(TInput) == 2); 1006Debug.Assert(Vector256.IsHardwareAccelerated); 1020Debug.Assert(Vector256.IsHardwareAccelerated); 1037Debug.Assert(Vector128.IsHardwareAccelerated); 1051Debug.Assert(Vector128.IsHardwareAccelerated); 1097Debug.Assert(sizeof(TInput) == 4); 1109Debug.Assert(Vector256.IsHardwareAccelerated); 1122Debug.Assert(Vector256.IsHardwareAccelerated); 1134Debug.Assert(Vector128.IsHardwareAccelerated); 1147Debug.Assert(Vector128.IsHardwareAccelerated); 1183Debug.Assert(sizeof(TInput) == 8); 1191Debug.Assert(Vector256.IsHardwareAccelerated); 1204Debug.Assert(Vector256.IsHardwareAccelerated); 1214Debug.Assert(Vector128.IsHardwareAccelerated); 1227Debug.Assert(Vector128.IsHardwareAccelerated);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IUnaryTwoToOneOperator.cs (7)
33Debug.Assert(sizeof(TInput) == sizeof(TOutput) * 2); 46Debug.Assert(Vector512<TInput>.IsSupported); 47Debug.Assert(Vector512<TOutput>.IsSupported); 79Debug.Assert(Vector256<TInput>.IsSupported); 80Debug.Assert(Vector256<TOutput>.IsSupported); 112Debug.Assert(Vector128<TInput>.IsSupported); 113Debug.Assert(Vector128<TOutput>.IsSupported);
System\Numerics\Tensors\netcore\Tensor_1.cs (3)
220Debug.Assert((int)(linearOffset) == linearOffset); 235Debug.Assert((int)(linearOffset) == linearOffset); 250Debug.Assert((int)(linearOffset) == linearOffset);
System\Numerics\Tensors\netcore\Tensor.cs (3)
1630Debug.Assert(moved); 1691Debug.Assert(srcMoved && dstMoved); 1810Debug.Assert(moved);
System\Numerics\Tensors\netcore\TensorOperation.cs (10)
480Debug.Assert(destination.Length == 1); 498Debug.Assert(destination.Length == 1); 2374Debug.Assert(destination.Length == 1); 2392Debug.Assert(destination.Length == 1); 2463Debug.Assert(destination.Length == 1); 2481Debug.Assert(destination.Length == 1); 2552Debug.Assert(destination.Length == 1); 2570Debug.Assert(destination.Length == 1); 2641Debug.Assert(destination.Length == 1); 2659Debug.Assert(destination.Length == 1);
System\Numerics\Tensors\netcore\TensorPrimitives.Asin.cs (3)
51Debug.Assert(typeof(T) == typeof(float)); 68Debug.Assert(typeof(T) == typeof(float)); 85Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Cbrt.cs (3)
41Debug.Assert(typeof(T) == typeof(double)); 54Debug.Assert(typeof(T) == typeof(double)); 67Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Ceiling.cs (3)
46Debug.Assert(typeof(T) == typeof(double)); 59Debug.Assert(typeof(T) == typeof(double)); 72Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (3)
83Debug.Assert(typeof(T) == typeof(float)); 96Debug.Assert(typeof(T) == typeof(float)); 109Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (3)
92Debug.Assert(typeof(T) == typeof(double)); 113Debug.Assert(typeof(T) == typeof(double)); 134Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (3)
61Debug.Assert(typeof(T) == typeof(double)); 84Debug.Assert(typeof(T) == typeof(double)); 107Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (3)
47Debug.Assert(typeof(T) == typeof(float)); 60Debug.Assert(typeof(T) == typeof(float)); 73Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (3)
57Debug.Assert(typeof(T) == typeof(float)); 70Debug.Assert(typeof(T) == typeof(float)); 83Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (3)
46Debug.Assert(typeof(T) == typeof(double)); 59Debug.Assert(typeof(T) == typeof(double)); 72Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
132Debug.Assert(typeof(T) == typeof(float)); 145Debug.Assert(typeof(T) == typeof(float)); 158Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Half.cs (13)
52Debug.Assert(typeof(T) == typeof(Half)); 69Debug.Assert(typeof(T) == typeof(Half)); 86Debug.Assert(typeof(T) == typeof(Half)); 104Debug.Assert(typeof(T) == typeof(Half)); 122Debug.Assert(typeof(T) == typeof(Half)); 140Debug.Assert(typeof(T) == typeof(Half)); 158Debug.Assert(typeof(T) == typeof(Half)); 176Debug.Assert(typeof(T) == typeof(Half)); 194Debug.Assert(typeof(T) == typeof(Half)); 228Debug.Assert(typeof(T) == typeof(Half)); 247Debug.Assert(typeof(T) == typeof(Half)); 266Debug.Assert(typeof(T) == typeof(Half)); 285Debug.Assert(typeof(T) == typeof(Half));
System\Numerics\Tensors\netcore\TensorPrimitives.HammingDistance.cs (1)
198Debug.Assert(count >= 0 && count <= x.Length, $"Expected count to be in the range [0, {x.Length}], got {count}.");
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (3)
51Debug.Assert(typeof(T) == typeof(float)); 64Debug.Assert(typeof(T) == typeof(float)); 77Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (2)
88Debug.Assert(sizeof(T) == 4); 105Debug.Assert(sizeof(T) == 2);
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (3)
111Debug.Assert(typeof(T) == typeof(float)); 124Debug.Assert(typeof(T) == typeof(float)); 137Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
113Debug.Assert(typeof(T) == typeof(float)); 126Debug.Assert(typeof(T) == typeof(float)); 139Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (3)
59Debug.Assert(typeof(T) == typeof(float)); 72Debug.Assert(typeof(T) == typeof(float)); 85Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.PopCount.cs (3)
120Debug.Assert(sizeof(T) == 4); 168Debug.Assert(sizeof(T) == 4); 216Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Pow.cs (3)
74Debug.Assert(typeof(T) == typeof(double)); 87Debug.Assert(typeof(T) == typeof(double)); 100Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.RadiansToDegrees.cs (3)
40Debug.Assert(typeof(T) == typeof(float)); 53Debug.Assert(typeof(T) == typeof(float)); 66Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.RootN.cs (3)
43Debug.Assert(typeof(T) == typeof(double)); 56Debug.Assert(typeof(T) == typeof(double)); 69Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Round.cs (6)
154Debug.Assert(typeof(T) == typeof(float)); 167Debug.Assert(typeof(T) == typeof(float)); 180Debug.Assert(typeof(T) == typeof(float)); 211Debug.Assert(typeof(T) == typeof(double)); 224Debug.Assert(typeof(T) == typeof(double)); 237Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (3)
73Debug.Assert(typeof(T) == typeof(float)); 86Debug.Assert(typeof(T) == typeof(float)); 99Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (3)
76Debug.Assert(typeof(T) == typeof(double)); 101Debug.Assert(typeof(T) == typeof(double)); 126Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (3)
61Debug.Assert(typeof(T) == typeof(double)); 84Debug.Assert(typeof(T) == typeof(double)); 107Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (3)
76Debug.Assert(typeof(T) == typeof(double)); 89Debug.Assert(typeof(T) == typeof(double)); 102Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (3)
44Debug.Assert(PopCountOperator<T>.Vectorizable); 51Debug.Assert(PopCountOperator<T>.Vectorizable); 58Debug.Assert(PopCountOperator<T>.Vectorizable);
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (3)
48Debug.Assert(typeof(T) == typeof(float)); 61Debug.Assert(typeof(T) == typeof(float)); 74Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorShape.cs (16)
77Debug.Assert(rank >= 1); 268Debug.Assert((flattenedLength == minimumLinearLength) || (strides.Length != 0)); 282Debug.Assert(strides.Length == rank); 409Debug.Assert(indexes.Length >= Rank); 410Debug.Assert(indexes.Length == destinationShape.Rank); 437Debug.Assert((length == 1) && (stride == 0)); 474Debug.Assert(indexes.Length >= Rank); 475Debug.Assert(indexes.Length == destinationShape.Rank); 502Debug.Assert((length == 1) && (stride == 0)); 576Debug.Assert(rankDelta > 0); 989Debug.Assert(FlattenedLength == LinearLength); 990Debug.Assert(HasAnyDenseDimensions); 994Debug.Assert(HasAnyDenseDimensions == CalculateHasAnyDenseDimensions(Lengths, Strides)); 996Debug.Assert(IsBroadcast == Strides.Contains(0)); 1205Debug.Assert(minimumLinearLength <= _linearLength); 1234Debug.Assert(computedOffset == GetLinearOffset<TGetOffsetAndLength, T>(state));
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (4)
30Debug.Assert(destination1.Length >= inputLength); 31Debug.Assert(destination1.Length >= inputLength); 50Debug.Assert(sizeof(TFrom) == sizeof(TTo)); 66Debug.Assert(sizeof(TFrom) == sizeof(TTo));
System.ObjectModel (4)
System\Collections\ObjectModel\KeyedCollection.cs (2)
51Debug.Assert(base.Items is List<TItem>); 273Debug.Assert(key != null, "key shouldn't be null!");
System\Collections\ObjectModel\ObservableCollection.cs (1)
307Debug.Assert(collection != null);
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (1)
282Debug.Assert(list != null);
System.Private.CoreLib (4897)
Internal\Reflection\Augments\ReflectionAugments.cs (6)
48Debug.Assert(type != null); 348Debug.Assert(runtimeDelegateType.IsDelegate); 395Debug.Fail("RuntimeMethodHandle should only return a methodbase implemented by the runtime."); 437Debug.Assert(runtimeTypeInfo.IsActualEnum); 458Debug.Assert(methodTable->IsEnum); 492Debug.Assert(x is byte or ushort or uint or ulong);
Internal\Reflection\Core\Execution\ExecutionDomain.cs (2)
112Debug.Assert(pEEType != null); 152Debug.Fail("Invalid RuntimeTypeHandle");
Internal\Reflection\Core\Execution\ReflectionCoreExecution.cs (1)
25Debug.Assert(s_executionEnvironment == null);
Internal\Reflection\Extensions\NonPortable\CustomAttributeInheritanceRules.cs (1)
242Debug.Assert(e.Position == -1);
Internal\Runtime\Augments\RuntimeAugments.cs (19)
78Debug.Assert(MethodTable.Of<object>()->NumVtableSlots > 0); 85Debug.Assert(!mt->ContainsGCPointers || RuntimeImports.RhGetGCDescSize(mt) != 0); 94Debug.Assert(typeHandleForArrayType.ToMethodTable()->IsSzArray); 115Debug.Assert(lengths != null); 116Debug.Assert(lowerBounds == null || lowerBounds.Length == lengths.Length); 149Debug.Assert(value.GetMethodTable()->ValueTypeSize == IntPtr.Size); 155Debug.Assert(value.GetMethodTable()->IsValueType && elementMT->ValueTypeSize == value.GetMethodTable()->ValueTypeSize); 297Debug.Assert(TypedReference.TargetTypeToken(typedReference).ToMethodTable()->IsValueType); 305Debug.Assert(TypedReference.TargetTypeToken(typedReference).ToMethodTable()->IsValueType); 306Debug.Assert(fieldTypeHandle.ToMethodTable()->IsValueType); 314Debug.Assert(TypedReference.TargetTypeToken(typedReference).ToMethodTable()->IsValueType); 322Debug.Assert(TypedReference.TargetTypeToken(typedReference).ToMethodTable()->IsValueType); 330Debug.Assert(TypedReference.TargetTypeToken(typedReference).ToMethodTable()->IsValueType); 366Debug.Assert(IsArrayType(arrayHandle)); 455Debug.Assert(eeType->IsGeneric); 462Debug.Assert(eeType->IsGeneric); 470Debug.Assert(eeType->IsGeneric); 537Debug.Assert(argumentIndex < GetFunctionPointerParameterCount(typeHandle)); 654Debug.Assert(callbacks != null);
Internal\Runtime\CompilerHelpers\InteropHelpers.cs (2)
333Debug.Assert(hModule != IntPtr.Zero); 439Debug.Assert(ptr != null);
Internal\Runtime\CompilerHelpers\LibraryInitializer.cs (1)
8using Debug = System.Diagnostics.Debug;
Internal\Runtime\CompilerHelpers\RuntimeInteropData.cs (2)
70Debug.Assert(!structureMT->ContainsGCPointers); 71Debug.Assert(structureMT->IsValueType);
Internal\Runtime\CompilerHelpers\SharedCodeHelpers.cs (3)
9using Debug = System.Diagnostics.Debug; 20Debug.Assert(interfaceIndex < pType->NumInterfaces); 32Debug.Assert(success);
Internal\Runtime\CompilerServices\FunctionPointerOps.cs (4)
8using Debug = System.Diagnostics.Debug; 56Debug.Assert(canonFunctionPointer != IntPtr.Zero); 81Debug.Assert(canonFunctionPointer == genericFunctionPointer->MethodFunctionPointer); 82Debug.Assert(instantiationArgument == genericFunctionPointer->InstantiationArgument);
Internal\Runtime\CompilerServices\MethodNameAndSignature.cs (1)
49Debug.Assert(Reader == other.Reader);
Internal\Runtime\Dispatch.cs (1)
113Debug.Assert(cellIndex > 0);
Internal\Runtime\FrozenObjectHeapManager.cs (13)
9using Debug = System.Diagnostics.Debug; 39Debug.Assert(type != null); 82Debug.Assert(obj != null); 116Debug.Assert(m_Size > FOH_COMMIT_SIZE); 117Debug.Assert(m_Size % FOH_COMMIT_SIZE == 0); 126Debug.Assert(m_Size > FOH_COMMIT_SIZE); 127Debug.Assert(m_Size % FOH_COMMIT_SIZE == 0); 159Debug.Assert((m_pStart != null) && (m_Size > 0)); 162Debug.Assert(objectSize <= FOH_COMMIT_SIZE); 163Debug.Assert(m_pCurrent >= m_pStart + sizeof(ObjHeader)); 168Debug.Assert(spaceUsed >= (nuint)sizeof(ObjHeader)); 169Debug.Assert(spaceLeft >= (nuint)sizeof(ObjHeader)); 181Debug.Assert(m_SizeCommitted + FOH_COMMIT_SIZE <= m_Size);
Internal\Runtime\FrozenObjectHeapManager.Unix.cs (1)
35Debug.Assert(size != 0);
Internal\Runtime\ThreadStatics.cs (7)
11using Debug = System.Diagnostics.Debug; 38Debug.Assert(threadStorage == null); 55Debug.Assert(typeTlsIndex >= 0); 57Debug.Assert(moduleIndex >= 0); 79Debug.Assert(typeTlsIndex >= 0); 81Debug.Assert(moduleIndex >= 0); 112Debug.Assert(moduleStorage[typeTlsIndex] == null);
Internal\Runtime\TypeLoaderExceptionHelper.cs (2)
10using Debug = System.Diagnostics.Debug; 126Debug.Assert(false);
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\CompilerHelpers\StartupDebug.cs (1)
10/// <see cref="System.Diagnostics.Debug"/> replacement for the startup path.
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\MethodTable.cs (47)
11using Debug = System.Diagnostics.Debug; 114Debug.Assert(index <= _defaultEntryCount + _standardEntryCount); 120Debug.Assert(index <= _defaultStaticEntryCount + _standardStaticEntryCount); 221Debug.Assert(IsGenericTypeDefinition); 282Debug.Assert(IsCanonical || IsArray); 409Debug.Assert(this.IsArray); 427Debug.Assert(this.IsArray); 440Debug.Assert(IsArray); 449Debug.Assert(HasComponentSize); 475Debug.Assert(IsGeneric); 510Debug.Assert(IsGeneric); 519Debug.Assert(IsGeneric); 546Debug.Assert(IsGeneric || IsGenericTypeDefinition); 628Debug.Assert(IsParameterizedType); 643Debug.Assert(IsFunctionPointer); 659Debug.Assert(IsFunctionPointer); 689Debug.Assert(IsFunctionPointer); 710Debug.Fail("RequiresAlign8 called for array or string"); 782Debug.Assert(IsValueType); 791Debug.Assert(IsValueType); 845Debug.Assert(IsFinalizable); 893Debug.Assert(!IsArray, "array type not supported in NonArrayBaseType"); 894Debug.Assert(IsCanonical || IsGenericTypeDefinition, "we expect type definitions here"); 895Debug.Assert(!IsGenericTypeDefinition || _relatedType._pBaseType == null, "callers assume this would be null for a generic definition"); 904Debug.Assert(IsNullable); 905Debug.Assert(GenericArity == 1); 917Debug.Assert(IsNullable); 927Debug.Assert(IsParameterizedType); 959Debug.Assert(HasSealedVTableEntries); 990Debug.Assert(IsDynamicType); 1014Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasGCStatics) != 0); 1030Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasNonGCStatics) != 0); 1046Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasThreadStatics) != 0); 1122Debug.Assert(IsDynamicType); 1178Debug.Assert(HasDispatchMap); 1187Debug.Assert(IsFinalizable); 1203Debug.Assert(IsGeneric); 1213Debug.Assert(IsGeneric || (IsGenericTypeDefinition && HasGenericVariance)); 1223Debug.Assert(IsFunctionPointer); 1233Debug.Assert(IsDynamicType); 1242Debug.Assert(IsDynamicType); 1253Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasGCStatics) != 0); 1261Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasNonGCStatics) != 0); 1269Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasThreadStatics) != 0); 1273Debug.Fail("Unknown MethodTable field type"); 1368Debug.Assert(((nint)pFirst & IsRelative) == 0); 1375Debug.Assert(((nint)pFirst & IsRelative) == 0);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifier.cs (17)
81Debug.Assert(key != null); 82Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); 102Debug.Assert(checkedFound); 104Debug.Assert(object.ReferenceEquals(checkedValue, value)); 174Debug.Assert(_owner._lock.IsHeldByCurrentThread); 197Debug.Assert(_owner._lock.IsHeldByCurrentThread); 204Debug.Assert(_owner._lock.IsHeldByCurrentThread); 238Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 260Debug.Assert(_owner._lock.IsHeldByCurrentThread); 261Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 270Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 271Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 272Debug.Assert(_entries[walk1]._key != null); 274Debug.Assert(hashCode == _entries[walk1]._hashCode); 276Debug.Assert(storedBucket == bucket); 283Debug.Fail("Bucket " + bucket + " has a cycle in its linked list."); 288Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierW.cs (20)
91Debug.Assert(key != null); 92Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); 113Debug.Assert(checkedFound); 114Debug.Assert(object.ReferenceEquals(checkedValue, value)); 125Debug.Assert(!(value is IDisposable), 204Debug.Assert(_owner._lock.IsHeldByCurrentThread); 222Debug.Fail("Add: You were supposed to verify inside the lock that this entry's weak reference had already expired!"); 254Debug.Assert(_owner._lock.IsHeldByCurrentThread); 261Debug.Assert(_owner._lock.IsHeldByCurrentThread); 322Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 344Debug.Assert(_owner._lock.IsHeldByCurrentThread); 345Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 354Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 355Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 356Debug.Assert(_entries[walk1]._key != null); 358Debug.Assert(hashCode == _entries[walk1]._hashCode); 359Debug.Assert(_entries[walk1]._weakValue != null); 361Debug.Assert(storedBucket == bucket); 368Debug.Fail("Bucket " + bucket + " has a cycle in its linked list."); 373Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
src\runtime\src\coreclr\nativeaot\Common\src\System\Collections\Concurrent\ConcurrentUnifierWKeyed.cs (19)
100Debug.Assert(key != null); 101Debug.Assert(!_lock.IsHeldByCurrentThread, "GetOrAdd called while lock already acquired. A possible cause of this is an Equals or GetHashCode method that causes reentrancy in the table."); 122Debug.Assert(checkedFound); 123Debug.Assert(object.ReferenceEquals(checkedValue, value)); 134Debug.Assert(!(value is IDisposable), 215Debug.Assert(_owner._lock.IsHeldByCurrentThread); 236Debug.Assert(_owner._lock.IsHeldByCurrentThread); 243Debug.Assert(_owner._lock.IsHeldByCurrentThread); 303Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 325Debug.Assert(_owner._lock.IsHeldByCurrentThread); 326Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 335Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 336Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 337Debug.Assert(_entries[walk1]._weakValue != null); 342Debug.Assert(key != null); 344Debug.Assert(hashCode == _entries[walk1]._hashCode); 348Debug.Assert(storedBucket == bucket); 355Debug.Fail("Bucket " + bucket + " has a cycle in its linked list."); 360Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\CachedInterfaceDispatch.cs (1)
218Diagnostics.Debug.Assert(pTargetCode != IntPtr.Zero);
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\DispatchResolve.cs (4)
20Debug.Assert((flags & ResolveFlags.DefaultInterfaceImplementation) == 0); 88Debug.Assert((flags & ResolveFlags.Variant) == 0 || (flags & ResolveFlags.DefaultInterfaceImplementation) != 0); 131Debug.Assert(pTgtType->HasDispatchMap, "Missing dispatch map"); 237Debug.Assert(itfArity == (int)pCurEntryType->GenericArity, "arity mismatch between generic instantiations");
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (12)
759Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass"); 783Debug.Assert(isValid, "RhThrowEx called with an unexpected context"); 870Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass"); 871Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass"); 911Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly"); 922Debug.Assert(pReversePInvokePropagationCallback != IntPtr.Zero, "Unwound to a reverse P/Invoke in the second pass. We should have a propagation handler."); 923Debug.Assert(frameIter.PreviousTransitionFrame != IntPtr.Zero, "Should have a transition frame for reverse P/Invoke."); 924Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass."); 964Debug.Fail("unreachable"); 972Debug.Assert(ip != null, "IP address must not be null"); 978Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value"); 980Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\RuntimeExports.cs (10)
37Debug.Assert(false); 61Debug.Assert(pEEType->IsSzArray); 79Debug.Assert(pEEType->IsArray || pEEType->IsString); 129Debug.Assert(pEEType->IsValueType && !pEEType->IsByRefLike && !pEEType->IsFinalizable); 236Debug.Assert(pType->IsValueType); 250Debug.Assert(pUnboxToEEType != null && pUnboxToEEType->IsNullable); 263Debug.Assert(pEEType->IsValueType); 267Debug.Assert((pUnboxToEEType == null) || UnboxAnyTypeCompare(pEEType, pUnboxToEEType) || pUnboxToEEType->IsNullable); 270Debug.Assert(pUnboxToEEType->NullableType == pEEType); 327Debug.Assert(isValid, "Missing RhGetCurrentThreadStackTrace frame");
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (46)
98Debug.Assert(pTargetType->IsInterface); 99Debug.Assert(!pTargetType->HasGenericVariance); 187Debug.Assert(!pTargetType->IsParameterizedType, "IsInstanceOfClass called with parameterized MethodTable"); 188Debug.Assert(!pTargetType->IsFunctionPointer, "IsInstanceOfClass called with function pointer MethodTable"); 189Debug.Assert(!pTargetType->IsInterface, "IsInstanceOfClass called with interface MethodTable"); 190Debug.Assert(!pTargetType->HasGenericVariance, "IsInstanceOfClass with variant MethodTable"); 198Debug.Assert(obj.GetMethodTable()->IsArray); 301Debug.Assert(result != CastResult.CannotCast); 307Debug.Assert(pTargetType->IsInterface); 308Debug.Assert(!pTargetType->HasGenericVariance); 392Debug.Assert(!pTargetType->IsParameterizedType, "CheckCastClass called with parameterized MethodTable"); 393Debug.Assert(!pTargetType->IsFunctionPointer, "CheckCastClass called with function pointer MethodTable"); 394Debug.Assert(!pTargetType->IsInterface, "CheckCastClass called with interface MethodTable"); 395Debug.Assert(!pTargetType->HasGenericVariance, "CheckCastClass with variant MethodTable"); 409Debug.Assert(!pTargetType->IsParameterizedType, "CheckCastClassSpecial called with parameterized MethodTable"); 410Debug.Assert(!pTargetType->IsFunctionPointer, "CheckCastClassSpecial called with function pointer MethodTable"); 411Debug.Assert(!pTargetType->IsInterface, "CheckCastClassSpecial called with interface MethodTable"); 412Debug.Assert(!pTargetType->HasGenericVariance, "CheckCastClassSpecial with variant MethodTable"); 415Debug.Assert(mt != pTargetType, "The check for the trivial cases should be inlined by the JIT"); 420Debug.Assert(mt->IsArray); 477Debug.Assert(!pDerivedType->IsArray, "did not expect array type"); 478Debug.Assert(!pDerivedType->IsParameterizedType, "did not expect parameterType"); 479Debug.Assert(!pDerivedType->IsFunctionPointer, "did not expect function pointer"); 480Debug.Assert(!pBaseType->IsArray, "did not expect array type"); 481Debug.Assert(!pBaseType->IsInterface, "did not expect interface type"); 482Debug.Assert(!pBaseType->IsParameterizedType, "did not expect parameterType"); 483Debug.Assert(!pBaseType->IsFunctionPointer, "did not expect function pointer"); 484Debug.Assert(pBaseType->IsCanonical || pBaseType->IsGenericTypeDefinition, "unexpected MethodTable"); 485Debug.Assert(pDerivedType->IsCanonical || pDerivedType->IsGenericTypeDefinition, "unexpected MethodTable"); 504Debug.Assert(!pTargetType->IsParameterizedType, "did not expect parameterized type"); 505Debug.Assert(!pTargetType->IsFunctionPointer, "did not expect function pointer type"); 506Debug.Assert(pTargetType->IsInterface, "IsInstanceOfInterface called with non-interface MethodTable"); 535Debug.Assert(pTargetVarianceInfo != null, "did not expect empty variance info"); 560Debug.Assert(pInterfaceVarianceInfo != null, "did not expect empty variance info"); 564Debug.Assert(targetArity == interfaceArity, "arity mismatch between generic instantiations"); 596Debug.Assert(pTargetVarianceInfo != null, "did not expect empty variance info"); 602Debug.Assert(pSourceVarianceInfo != null, "did not expect empty variance info"); 606Debug.Assert(targetArity == sourceArity, "arity mismatch between generic instantiations"); 704Debug.Fail("unknown generic variance type"); 720Debug.Assert(array.GetMethodTable()->IsArray, "first argument must be an array"); 756Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array"); 763Debug.Assert(index >= 0); 788Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array"); 794Debug.Assert(index >= 0); 853Debug.Assert(pTargetType->IsArray, "IsInstanceOfArray called with non-array MethodTable"); 934Debug.Assert((int)elementType < 32);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.CoreCLR.cs (33)
97Debug.Assert(index != 0); 120Debug.Assert(index != 0); 131Debug.Assert(index != 0); 256Debug.Assert(curThread != null); 257Debug.Assert(StackState != null); 281Debug.Assert(CurrentThread != null); 486Debug.Assert(obj is IValueTaskSource); 574Debug.Assert(obj is IValueTaskSource<T>); 754Debug.Assert((m_stateFlags & (int)InternalTaskOptions.PromiseTask) != 0, "Expected state flags to already be configured."); 755Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for Continuation."); 768Debug.Assert(action is Action); 775Debug.Assert(stateObject is Continuation); 782Debug.Assert(m_stateObject == null); 789Debug.Assert(currentThread != null); 816Debug.Assert((headContinuation.Flags & ContinuationFlags.AllContinuationFlags) == 0); 824Debug.Assert((headContinuation.Flags & ContinuationFlags.AllContinuationFlags) == 0); 829Debug.Assert(headContinuation == taskCont); 833Debug.Assert(taskCont.Task != null); 842Debug.Assert(headContinuation == valueTaskSourceCont); 844Debug.Assert(source != null); 890Debug.Assert((headContinuation.Flags & ContinuationFlags.AllContinuationFlags) == 0); 891Debug.Assert(stackState->Notifier != null); 964Debug.Assert(asyncDispatcherInfo.NextContinuation != null); 971Debug.Assert(awaitState.CurrentThread != null); 1085Debug.Assert(asyncDispatcherInfo.NextContinuation != null); 1094Debug.Assert(awaitState.CurrentThread != null); 1229Debug.Assert(continuationContext is SynchronizationContext { }); 1255Debug.Assert(continuationContext is TaskScheduler { }); 1269Debug.Assert(state is RuntimeAsyncTask<T>); 1355Debug.Assert(successfullySet); 1367Debug.Assert(successfullySet); 1518Debug.Assert(threadExecCtx == null || !threadExecCtx.InstanceIsFlowSuppressed || execCtx == ExecutionContext.DefaultFlowSuppressed); 1584Debug.Assert(threadExecCtx == null || !threadExecCtx.InstanceIsFlowSuppressed || execCtx == ExecutionContext.DefaultFlowSuppressed);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.RuntimeAsyncYielder.cs (1)
27Debug.Assert(
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.ValueTaskSourceContinuation.cs (6)
27Debug.Assert(Source != null); 54Debug.Assert(source is IValueTaskSource); 61Debug.Assert(source is IValueTaskSource); 68Debug.Assert(source is IValueTaskSource<T>); 75Debug.Assert(source is IValueTaskSource<T>); 95Debug.Assert((vtsCont.Flags & ContinuationFlags.AllContinuationFlags) == 0);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.CoreCLR.cs (1)
100Debug.Assert(info.AsyncProfilerInfo.CurrentContinuation is Continuation);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeAsyncTaskContinuation.cs (8)
29Debug.Assert(RuntimeAsyncTask != null); 46Debug.Assert(RuntimeAsyncTask != null); 71Debug.Assert(continuationContext is SynchronizationContext { }); 95Debug.Assert(continuationContext is TaskScheduler { }); 108Debug.Assert(Task != null); 136Debug.Assert(task is Task<T>); 160Debug.Assert((taskCont.Flags & ContinuationFlags.AllContinuationFlags) == 0); 170Debug.Assert(state is Task);
src\runtime\src\coreclr\tools\Common\Internal\LowLevelLinq\LowLevelEnumerable.cs (4)
14Debug.Assert(values != null); 22Debug.Assert(values != null); 31Debug.Assert(source != null); 32Debug.Assert(filter != null);
src\runtime\src\coreclr\tools\Common\Internal\LowLevelLinq\LowLevelEnumerable.ToArray.cs (1)
14Debug.Assert(values != null);
src\runtime\src\coreclr\tools\Common\Internal\Metadata\NativeFormat\MdBinaryReaderGen.cs (1)
13using Debug = System.Diagnostics.Debug;
src\runtime\src\coreclr\tools\Common\Internal\Metadata\NativeFormat\NativeFormatReaderGen.cs (63)
74Debug.Assert(hType == HandleType.ArraySignature || hType == HandleType.Null); 155Debug.Assert(hType == HandleType.ByReferenceSignature || hType == HandleType.Null); 235Debug.Assert(hType == HandleType.ConstantBooleanArray || hType == HandleType.Null); 315Debug.Assert(hType == HandleType.ConstantBooleanValue || hType == HandleType.Null); 395Debug.Assert(hType == HandleType.ConstantByteArray || hType == HandleType.Null); 475Debug.Assert(hType == HandleType.ConstantByteValue || hType == HandleType.Null); 555Debug.Assert(hType == HandleType.ConstantCharArray || hType == HandleType.Null); 635Debug.Assert(hType == HandleType.ConstantCharValue || hType == HandleType.Null); 715Debug.Assert(hType == HandleType.ConstantDoubleArray || hType == HandleType.Null); 795Debug.Assert(hType == HandleType.ConstantDoubleValue || hType == HandleType.Null); 879Debug.Assert(hType == HandleType.ConstantEnumArray || hType == HandleType.Null); 963Debug.Assert(hType == HandleType.ConstantEnumValue || hType == HandleType.Null); 1043Debug.Assert(hType == HandleType.ConstantHandleArray || hType == HandleType.Null); 1123Debug.Assert(hType == HandleType.ConstantInt16Array || hType == HandleType.Null); 1203Debug.Assert(hType == HandleType.ConstantInt16Value || hType == HandleType.Null); 1283Debug.Assert(hType == HandleType.ConstantInt32Array || hType == HandleType.Null); 1363Debug.Assert(hType == HandleType.ConstantInt32Value || hType == HandleType.Null); 1443Debug.Assert(hType == HandleType.ConstantInt64Array || hType == HandleType.Null); 1523Debug.Assert(hType == HandleType.ConstantInt64Value || hType == HandleType.Null); 1599Debug.Assert(hType == HandleType.ConstantReferenceValue || hType == HandleType.Null); 1679Debug.Assert(hType == HandleType.ConstantSByteArray || hType == HandleType.Null); 1759Debug.Assert(hType == HandleType.ConstantSByteValue || hType == HandleType.Null); 1839Debug.Assert(hType == HandleType.ConstantSingleArray || hType == HandleType.Null); 1919Debug.Assert(hType == HandleType.ConstantSingleValue || hType == HandleType.Null); 2000Debug.Assert(hType == HandleType.ConstantStringArray || hType == HandleType.Null); 2082Debug.Assert(hType == HandleType.ConstantStringValue || hType == HandleType.Null); 2162Debug.Assert(hType == HandleType.ConstantUInt16Array || hType == HandleType.Null); 2242Debug.Assert(hType == HandleType.ConstantUInt16Value || hType == HandleType.Null); 2322Debug.Assert(hType == HandleType.ConstantUInt32Array || hType == HandleType.Null); 2402Debug.Assert(hType == HandleType.ConstantUInt32Value || hType == HandleType.Null); 2482Debug.Assert(hType == HandleType.ConstantUInt64Array || hType == HandleType.Null); 2562Debug.Assert(hType == HandleType.ConstantUInt64Value || hType == HandleType.Null); 2652Debug.Assert(hType == HandleType.CustomAttribute || hType == HandleType.Null); 2749Debug.Assert(hType == HandleType.Event || hType == HandleType.Null); 2850Debug.Assert(hType == HandleType.Field || hType == HandleType.Null); 2931Debug.Assert(hType == HandleType.FieldSignature || hType == HandleType.Null); 3011Debug.Assert(hType == HandleType.FunctionPointerSignature || hType == HandleType.Null); 3112Debug.Assert(hType == HandleType.GenericParameter || hType == HandleType.Null); 3202Debug.Assert(hType == HandleType.MemberReference || hType == HandleType.Null); 3306Debug.Assert(hType == HandleType.Method || hType == HandleType.Null); 3392Debug.Assert(hType == HandleType.MethodInstantiation || hType == HandleType.Null); 3476Debug.Assert(hType == HandleType.MethodSemantics || hType == HandleType.Null); 3575Debug.Assert(hType == HandleType.MethodSignature || hType == HandleType.Null); 3655Debug.Assert(hType == HandleType.MethodTypeVariableSignature || hType == HandleType.Null); 3745Debug.Assert(hType == HandleType.ModifiedType || hType == HandleType.Null); 3839Debug.Assert(hType == HandleType.NamedArgument || hType == HandleType.Null); 3936Debug.Assert(hType == HandleType.NamespaceDefinition || hType == HandleType.Null); 4021Debug.Assert(hType == HandleType.NamespaceReference || hType == HandleType.Null); 4118Debug.Assert(hType == HandleType.Parameter || hType == HandleType.Null); 4199Debug.Assert(hType == HandleType.PointerSignature || hType == HandleType.Null); 4300Debug.Assert(hType == HandleType.Property || hType == HandleType.Null); 4390Debug.Assert(hType == HandleType.PropertySignature || hType == HandleType.Null); 4474Debug.Assert(hType == HandleType.QualifiedField || hType == HandleType.Null); 4558Debug.Assert(hType == HandleType.QualifiedMethod || hType == HandleType.Null); 4639Debug.Assert(hType == HandleType.SZArraySignature || hType == HandleType.Null); 4779Debug.Assert(hType == HandleType.ScopeDefinition || hType == HandleType.Null); 4887Debug.Assert(hType == HandleType.ScopeReference || hType == HandleType.Null); 5025Debug.Assert(hType == HandleType.TypeDefinition || hType == HandleType.Null); 5113Debug.Assert(hType == HandleType.TypeForwarder || hType == HandleType.Null); 5199Debug.Assert(hType == HandleType.TypeInstantiationSignature || hType == HandleType.Null); 5284Debug.Assert(hType == HandleType.TypeReference || hType == HandleType.Null); 5365Debug.Assert(hType == HandleType.TypeSpecification || hType == HandleType.Null); 5445Debug.Assert(hType == HandleType.TypeVariableSignature || hType == HandleType.Null);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (7)
19Debug.Assert(false); 228Debug.Assert(base_ <= base_ + size); 244Debug.Assert((byte*)address >= _base); 245Debug.Assert((byte*)address <= _base + _size); 251Debug.Assert(offset < _size); 258Debug.Assert(false); 392Debug.Assert(value < _reader.Size);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.Primitives.cs (4)
105Debug.Assert(false); 150Debug.Assert(false); 173Debug.Assert(false); 196Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\DehydratedData.cs (4)
7using Debug = System.Diagnostics.Debug; 38Debug.Assert((command & DehydratedDataCommandMask) == command); 39Debug.Assert(commandData <= MaxShortPayload); 45Debug.Assert((command & DehydratedDataCommandMask) == command);
src\runtime\src\coreclr\tools\Common\Internal\Runtime\DispatchCell.cs (4)
54Debug.Assert(!DispatchCell.IsGvmDispatchCell); 59Debug.Assert((value & GvmTypeFlag) == 0); 77Debug.Assert(DispatchCell.IsGvmDispatchCell); 82Debug.Assert((value & GvmTypeFlag) == 0);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtable.cs (4)
9using Debug = System.Diagnostics.Debug; 160Debug.Assert(!foundAOne); 185Debug.Assert(hashTableLocal.Length > 0); 607Debug.Assert(hashTableLocal.Length > 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\LockFreeReaderHashtableOfPointers.cs (5)
10using Debug = System.Diagnostics.Debug; 147Debug.Assert(!foundAOne); 172Debug.Assert(hashTableLocal.Length > 0); 501Debug.Assert(GetValueHashCode(newValue) == GetKeyHashCode(key)); 543Debug.Assert(hashTableLocal.Length > 0);
src\runtime\src\libraries\Common\src\Interop\Interop.ICU.cs (2)
17Debug.Assert(icuuc != IntPtr.Zero); 18Debug.Assert(icuin != IntPtr.Zero);
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (3)
61Debug.Assert(!b || (ProcPid)result.Pid == pid || pid == ProcPid.Self, "Expected process ID from status file to match supplied pid"); 126Debug.Assert(valueParsed); 141Debug.Assert(!string.IsNullOrEmpty(path));
src\runtime\src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcMountInfo.cs (1)
67Debug.Fail($"Failed to read \"{ProcMountInfoFilePath}\": {e}");
src\runtime\src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (2)
13Debug.Assert(errorInfo.Error != Error.SUCCESS); 14Debug.Assert(errorInfo.Error != Error.EINTR, "EINTR errors should be handled by the native shim and never bubble up to managed code");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetHostName.cs (1)
35Debug.Fail($"GetHostName failed with error {err}");
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
70Debug.Assert(passwd.Name != null);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
40Debug.Assert(Array.IndexOf<byte>(version, 0) >= 0);
src\runtime\src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (3)
35Debug.Assert(Name != null, "should not have a null name"); 41Debug.Assert(nameBytes.Length > 0, "we shouldn't have gotten a garbage value from the OS"); 47Debug.Assert(!result.Contains('\0'), "should not have embedded nulls");
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment is not null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
src\runtime\src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (17)
102Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported); 122Debug.Assert(source.Length >= (Vector128<TChar>.Count / 2)); 154Debug.Assert(typeof(TChar) == typeof(ushort)); 167Debug.Assert(typeof(TChar) == typeof(ushort)); 189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 306Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported); 307Debug.Assert(source.Length <= (destination.Length * 2)); 308Debug.Assert((source.Length % 2) == 0); 318Debug.Assert(typeof(TChar) == typeof(ushort)); 321Debug.Assert(source.Length >= elementsReadPerIteration); 347Debug.Assert(typeof(TChar) == typeof(ushort)); 447Debug.Assert(typeof(TChar) == typeof(ushort)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\IO\PathInternal.cs (1)
120Debug.Assert(rootLength > 0);
src\runtime\src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\runtime\src\libraries\Common\src\System\IO\StringParser.cs (1)
226Debug.Assert(result == char.Parse(ExtractCurrent()), "Expected manually parsed result to match Parse result");
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 724Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 758Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 828Debug.Assert(p >= spanPtr - 1, "Underflow"); 873Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 894Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 921Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 943Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 967Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 1021Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte));
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (7)
41Debug.Assert(digits != null); 49Debug.Assert(!digits.IsEmpty); 69Debug.Assert(Kind is NumberBufferKind.Integer or NumberBufferKind.Decimal or NumberBufferKind.FloatingPoint or NumberBufferKind.DecimalIeee754); 70Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 82Debug.Assert(char.IsAsciiDigit((char)digit), $"Unexpected character found in Number: {digit}"); 85Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 86Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\runtime\src\libraries\Common\src\System\Number.Parsing.Common.cs (13)
24Debug.Assert((str != null) || (str == strEnd)); 25Debug.Assert((strEnd != null) || (str == strEnd)); 26Debug.Assert(str <= strEnd); 27Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 36Debug.Assert(number.DigitsCount == 0); 37Debug.Assert(number.Scale == 0); 38Debug.Assert(!number.IsNegative); 39Debug.Assert(!number.HasNonZeroTail); 236Debug.Assert(numberOfTrailingZeros >= 0); 304Debug.Assert(info != null); 360Debug.Assert((p != null) || (p == pEnd)); 361Debug.Assert((pEnd != null) || (p == pEnd)); 362Debug.Assert(p <= pEnd);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
23Debug.Assert(name.Length != 0);
src\runtime\src\libraries\Common\src\System\Sha1ForNonSecretPurposes.cs (2)
29Debug.Assert(destination.Length == 20); 139Debug.Assert(output.Length == 20);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\Threading\Tasks\CachedCompletedInt32Task.cs (1)
26Debug.Assert(task.IsCompletedSuccessfully, "Expected that a stored last task completed successfully");
src\runtime\src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (1)
121Debug.Assert(task is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (4)
56Debug.Assert(op == Operation.None, $"An operation was queued before the previous {op}'s completion."); 82Debug.Assert(_operation >= Operation.Read && _operation <= Operation.WriteGather); 105Debug.Assert(_readScatterBuffers != null); 109Debug.Assert(_writeGatherBuffers != null);
src\runtime\src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (7)
90Debug.Assert(!value); // We should only use the setter to disable random access. 111Debug.Assert(path != null); 152Debug.Assert(_path is not null); 228Debug.Assert(fileLength >= 0); 398Debug.Assert(status.Size == 0 || Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 506Debug.Assert(mode == FileMode.Create || mode == FileMode.CreateNew); 521Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
175Debug.Assert(_innerExceptions[i] != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
72Debug.Assert(s_dataStore is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.cs (28)
70Debug.Assert(array != null); 491Debug.Assert(sourceArray.Rank == destinationArray.Rank); 517Debug.Fail("Fell through switch in Array.Copy!"); 539Debug.Assert(!sourceArray.ElementMethodTable->IsValueType); 540Debug.Assert(pDestMT->IsValueType); 584Debug.Assert(pSrcMT->IsValueType); 585Debug.Assert(!destinationArray.ElementMethodTable->IsValueType); 608Debug.Assert(!sourceArray.ElementMethodTable->IsValueType); 609Debug.Assert(!pDestMT->IsValueType); 632Debug.Assert(sourceArray.ElementMethodTable->IsPrimitive); 633Debug.Assert(destinationArray.ElementMethodTable->IsPrimitive); 679Debug.Assert(totalByteLength % (nuint)sizeof(IntPtr) == 0); 726Debug.Assert(Rank == 1); 742Debug.Assert(indices.Length == Rank); 756Debug.Assert((nuint)flattenedIndex < NativeLength); 1004Debug.Assert(low <= hi); 1005Debug.Assert(hi - low >= 0, "Length overflow!"); 1337Debug.Fail("All primitive types should be handled above"); 1845Debug.Fail("All primitive types should be handled above"); 2072Debug.Fail("All primitive types should be handled above"); 2721Debug.Assert(hi >= lo); 2722Debug.Assert(depthLimit >= 0); 2729Debug.Assert(partitionSize >= 2); 2764Debug.Assert(hi - lo >= IntrosortSizeThreshold); 2934Debug.Assert(hi >= lo); 2935Debug.Assert(depthLimit >= 0); 2942Debug.Assert(partitionSize >= 2); 2977Debug.Assert(hi - lo >= IntrosortSizeThreshold);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
117Debug.Assert(array == null || endIndex == array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ArraySegment.cs (6)
203Debug.Assert(index < 0 || 244Debug.Assert(index < 0 || 290Debug.Assert(arraySegment.Array != null); 291Debug.Assert(arraySegment.Offset >= 0); 292Debug.Assert(arraySegment.Count >= 0); 293Debug.Assert(arraySegment.Offset + arraySegment.Count <= arraySegment.Array.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Attribute.cs (1)
116Debug.Assert(thisValueArray.Rank == 1 && thatValueArray.Rank == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\BitConverter.cs (13)
60Debug.Assert(success); 88Debug.Assert(success); 116Debug.Assert(success); 144Debug.Assert(success); 172Debug.Assert(success); 201Debug.Assert(success); 231Debug.Assert(success); 261Debug.Assert(success); 291Debug.Assert(success); 320Debug.Assert(success); 348Debug.Assert(success); 376Debug.Assert(success); 404Debug.Assert(success);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffer.cs (1)
176Debug.Assert(byteCount > BulkMoveWithWriteBarrierChunk);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\SharedArrayPool.cs (2)
288Debug.Assert(t_tlsBuckets is null, $"Non-null {nameof(t_tlsBuckets)}"); 485Debug.Assert(array is not null, "No nulls should have been present in slots < _count.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (1)
160Debug.Assert(destination.Length == FormatStringLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Decoder.cs (6)
91Debug.Assert(status == OperationStatus.InvalidData); 112Debug.Assert(status is OperationStatus.Done or OperationStatus.InvalidData); 141Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall); 201Debug.Assert(status == OperationStatus.InvalidData); 223Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall); 244Debug.Assert(status is OperationStatus.Done or OperationStatus.InvalidData);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Encoder.cs (5)
83Debug.Assert(status == OperationStatus.DestinationTooSmall); 96Debug.Assert(destination.Length == bytesWritten); 180Debug.Assert(status == OperationStatus.DestinationTooSmall); 193Debug.Assert(destination.Length == charsWritten); 207Debug.Assert(buffer.Length == charsWritten, $"The source length: {source.Length}, chars written: {charsWritten}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (12)
116Debug.Assert(destLength < (int.MaxValue / 4 * 3)); 171Debug.Assert(typeof(TBase64Decoder) == typeof(Base64DecoderByte) ? remaining == 4 : remaining < 8); 545Debug.Assert(bufferIdx > 0); 580Debug.Assert(localConsumed == 0 && localWritten == 0, "On failure, should not have consumed or written any bytes"); 609Debug.Assert(!source.IsEmpty); 650Debug.Assert(bufferIdx > 0); 685Debug.Assert(localConsumed == 0 && localWritten == 0, "On failure, should not have consumed or written any bytes"); 713Debug.Assert(!source.IsEmpty); 800Debug.Assert(source.Length == sourceIndex); 1014Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported) && BitConverter.IsLittleEndian); 1178Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported) && BitConverter.IsLittleEndian); 1379Debug.Assert(value >= 0 && value <= ushort.MaxValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64Helper.cs (4)
25Debug.Fail($"Read for {typeof(TVector)} is not within safe bounds. srcIndex: {srcIndex}, srcLength: {srcLength}"); 39Debug.Fail($"Write for {typeof(TVector)} is not within safe bounds. destIndex: {destIndex}, destLength: {destLength}"); 53Debug.Fail($"Read for {typeof(TVector)} is not within safe bounds. srcIndex: {srcIndex}, srcLength: {srcLength}"); 67Debug.Fail($"Write for {typeof(TVector)} is not within safe bounds. destIndex: {destIndex}, destLength: {destLength}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlDecoder.cs (5)
95Debug.Assert(status is OperationStatus.Done); 129Debug.Assert(status is OperationStatus.InvalidData); 151Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall); 172Debug.Assert(status is OperationStatus.Done or OperationStatus.InvalidData); 228Debug.Assert(status == OperationStatus.InvalidData);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (5)
77Debug.Assert(status == OperationStatus.DestinationTooSmall); 91Debug.Assert(destination.Length == bytesWritten); 128Debug.Assert(status == OperationStatus.DestinationTooSmall); 142Debug.Assert(destination.Length == charsWritten); 162Debug.Assert(buffer.Length == charsWritten, $"The source length: {source.Length}, bytes written: {charsWritten}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (3)
25Debug.Assert(log2ToPow10.Length == 64); 54Debug.Assert((elementOffset + 1) <= powersOf10.Length); 102Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (2)
36Debug.Assert(value.Upper == 0); 46Debug.Assert(digits == 21);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
108Debug.Assert(bytesWritten == DateTimeFormat.FormatRLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\ParserHelpers.cs (1)
69Debug.Fail("Control should never reach this point.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.cs (1)
83Debug.Assert(kind == DateTimeKind.Unspecified);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.Helpers.cs (2)
113Debug.Assert(year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 162Debug.Assert(fraction >= 0 && fraction <= Utf8Constants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.O.cs (1)
227Debug.Assert(offsetChar == Utf8Constants.Plus || offsetChar == Utf8Constants.Minus);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Number.cs (5)
18Debug.Assert(number.DigitsCount == 0); 19Debug.Assert(number.Scale == 0); 20Debug.Assert(!number.IsNegative); 21Debug.Assert(!number.HasNonZeroTail); 112Debug.Assert(dstIndex == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpan.cs (2)
109Debug.Assert(digitCount == 1); 133Debug.Assert(fraction <= Utf8Constants.MaxDateTimeFraction); // This value comes from TryParseTimeSpanFraction() which already rejects any fraction string longer than 7 digits.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.TimeSpanSplitter.cs (4)
98Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 118Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 138Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period); 158Debug.Assert(result == ComponentParseResult.Colon || result == ComponentParseResult.Period);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
27Debug.Assert(maxSize >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Char.cs (2)
97Debug.Assert(IsLatin1(c), "char.GetLatin1UnicodeCategory(): c should be <= 00ff"); 414Debug.Assert(IsLatin1(c));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\BitArray.cs (5)
1014Debug.Assert(bitLength >= 0); 1021Debug.Assert(bitLength >= 0); 1038Debug.Assert(byteLength >= 0, "byteLength should be non-negative."); 1039Debug.Assert(byteLength % sizeof(int) == 0, "byteLength should be a multiple of sizeof(int)."); 1119Debug.Assert(index >= _bitArray._bitLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentDictionary.cs (29)
308Debug.Assert(comparer is not null); 330Debug.Assert(comparer is not null); 470Debug.Assert((prev is null && curr == bucket) || prev!._next == curr); 542Debug.Assert(comparer is not null); 576Debug.Assert(comparer is not null); 638Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 666Debug.Assert((prev is null && node == bucket) || prev!._next == node); 814Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 829Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 844Debug.Assert(index < int.MaxValue, "This method should only be called when there's no overflow risk"); 902Debug.Assert(buckets is not null); 926Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 961Debug.Assert((prev is null && node == bucket) || prev!._next == node); 2066Debug.Assert(locksAcquired == _tables._locks.Length); 2079Debug.Assert(locksAcquired == 0); 2080Debug.Assert(!Monitor.IsEntered(locks[0])); 2096Debug.Assert(Monitor.IsEntered(locks[0])); 2097Debug.Assert(locksAcquired == 1); 2105Debug.Assert(locksAcquired == locks.Length); 2112Debug.Assert(locksAcquired >= 0); 2147Debug.Assert(i == count); 2183Debug.Assert(i == count); 2273Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 2314Debug.Assert(tables is not null); 2323Debug.Assert(IsCompatibleKey<TAlternateKey>(tables)); 2337Debug.Assert(dictionary is not null); 2338Debug.Assert(IsCompatibleKey<TAlternateKey>(dictionary._tables)); 2421Debug.Assert((prev is null && node == bucket) || prev!._next == node); 2622Debug.Assert((prev is null && curr == bucket) || prev!._next == curr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (22)
240Debug.Assert(count == i); 335Debug.Assert(s._frozenForEnqueues, "Internal segment must be frozen as there's a following segment."); 369Debug.Assert(head._preservedForObservation); 370Debug.Assert(head._frozenForEnqueues); 371Debug.Assert(tail._preservedForObservation); 372Debug.Assert(tail._frozenForEnqueues); 403Debug.Assert(s._preservedForObservation); 404Debug.Assert(s._frozenForEnqueues); 469Debug.Assert(count == i - index); 499Debug.Assert(head != null); 500Debug.Assert(tail != null); 501Debug.Assert(tail._nextSegment == null); 509Debug.Assert(s._frozenForEnqueues); // any non-tail should already be marked 524Debug.Assert(segment._preservedForObservation); 544Debug.Assert(head._preservedForObservation); 545Debug.Assert(head._frozenForEnqueues); 546Debug.Assert(tail._preservedForObservation); 547Debug.Assert(tail._frozenForEnqueues); 577Debug.Assert(s._preservedForObservation, "Would have had to been preserved as a segment part of enumeration"); 578Debug.Assert(s._frozenForEnqueues, "Would have had to be frozen for enqueues as it's intermediate"); 719Debug.Assert(head._frozenForEnqueues); 782Debug.Assert(next == s._nextSegment);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueueSegment.cs (2)
48Debug.Assert(boundedLength >= 2, $"Must be >= 2, got {boundedLength}"); 49Debug.Assert(BitOperations.IsPow2(boundedLength), $"Must be a power of 2, got {boundedLength}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (76)
56Debug.Assert(comparer != null, "Check the arguments in the caller!"); 75Debug.Assert(array != null, "Check the arguments in the caller!"); 76Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 101Debug.Assert(i != j); 114Debug.Assert(i != j); 123Debug.Assert(comparer != null); 136Debug.Assert(!keys.IsEmpty); 137Debug.Assert(depthLimit >= 0); 138Debug.Assert(comparer != null); 181Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 182Debug.Assert(comparer != null); 219Debug.Assert(comparer != null); 220Debug.Assert(!keys.IsEmpty); 237Debug.Assert(comparer != null); 326Debug.Assert(array != null, "Check the arguments in the caller!"); 327Debug.Assert(index >= 0 && length >= 0 && (array.Length - index >= length), "Check the arguments in the caller!"); 401Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 413Debug.Assert(!keys.IsEmpty); 414Debug.Assert(depthLimit >= 0); 460Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 509Debug.Assert(!keys.IsEmpty); 635Debug.Assert(comparer != null); 636Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 637Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 638Debug.Assert(i != j); 655Debug.Assert(i != j); 668Debug.Assert(comparer != null); 669Debug.Assert(keys.Length == values.Length); 679Debug.Assert(!keys.IsEmpty); 680Debug.Assert(values.Length == keys.Length); 681Debug.Assert(depthLimit >= 0); 682Debug.Assert(comparer != null); 725Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 726Debug.Assert(comparer != null); 763Debug.Assert(comparer != null); 764Debug.Assert(!keys.IsEmpty); 781Debug.Assert(comparer != null); 808Debug.Assert(comparer != null); 878Debug.Assert(i != j); 896Debug.Assert(i != j); 909Debug.Assert(!keys.IsEmpty); 910Debug.Assert(values.Length == keys.Length); 911Debug.Assert(depthLimit >= 0); 954Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 999Debug.Assert(!keys.IsEmpty); 1113Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float)); 1151Debug.Assert(comparer != null); 1171Debug.Assert(i != j); 1180Debug.Assert(i != j); 1192Debug.Assert(comparer != null); 1205Debug.Assert(!keys.IsEmpty); 1206Debug.Assert(depthLimit >= 0); 1207Debug.Assert(comparer != null); 1249Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 1250Debug.Assert(comparer != null); 1287Debug.Assert(comparer != null); 1288Debug.Assert(!keys.IsEmpty); 1305Debug.Assert(comparer != null); 1353Debug.Assert(comparer != null); 1374Debug.Assert(i != j); 1387Debug.Assert(comparer != null); 1388Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 1389Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 1390Debug.Assert(i != j); 1406Debug.Assert(comparer != null); 1407Debug.Assert(keys.Length == values.Length); 1417Debug.Assert(!keys.IsEmpty); 1418Debug.Assert(values.Length == keys.Length); 1419Debug.Assert(depthLimit >= 0); 1420Debug.Assert(comparer != null); 1462Debug.Assert(keys.Length >= Array.IntrosortSizeThreshold); 1463Debug.Assert(comparer != null); 1499Debug.Assert(comparer != null); 1500Debug.Assert(!keys.IsEmpty); 1517Debug.Assert(comparer != null); 1544Debug.Assert(comparer != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (51)
129Debug.Assert(source._entries is not null); 130Debug.Assert(_entries is not null); 131Debug.Assert(_entries.Length >= source.Count); 132Debug.Assert(_count == 0); 199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 244Debug.Assert(modified); 251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 285Debug.Assert(_buckets != null, "_buckets should be non-null"); 286Debug.Assert(_entries != null, "_entries should be non-null"); 407Debug.Assert(_entries != null, "expected entries to be != null"); 445Debug.Assert(comparer is not null); 520Debug.Assert(_buckets != null); 523Debug.Assert(entries != null, "expected entries to be non-null"); 526Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 568Debug.Assert(comparer is not null); 603Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 696Debug.Assert(dictionary is not null); 697Debug.Assert(IsCompatibleKey(dictionary)); 731Debug.Assert(dictionary is not null); 739Debug.Assert(IsCompatibleKey(dictionary)); 782Debug.Assert(actualKey is not null); 809Debug.Assert(dictionary._entries != null, "expected entries to be != null"); 879Debug.Assert(dictionary._entries != null, "entries should be non-null"); 906Debug.Assert((StartOfFreeList - dictionary._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 971Debug.Assert(dictionary._buckets != null); 974Debug.Assert(entries != null, "expected entries to be non-null"); 982Debug.Assert(comparer is not null); 1013Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1052Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1085Debug.Assert(dictionary._buckets != null); 1088Debug.Assert(entries != null, "expected entries to be non-null"); 1091Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 1124Debug.Assert(comparer is not null); 1150Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1189Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here"); 1251Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 1252Debug.Assert(_entries != null, "_entries should be non-null"); 1253Debug.Assert(newSize >= _entries.Length); 1262Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1306Debug.Assert(_entries != null, "entries should be non-null"); 1310Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1336Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1368Debug.Assert(comparer is not null); 1384Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1432Debug.Assert(_entries != null, "entries should be non-null"); 1436Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1464Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1496Debug.Assert(comparer is not null); 1514Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 1711Debug.Assert(oldEntries is not null); 1718Debug.Assert(_entries is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (32)
148Debug.Assert(EffectiveEqualityComparersAreEqual(this, source), "must use identical effective comparers."); 187Debug.Assert(Count == source.Count); 202Debug.Assert(_buckets != null, "_buckets should be non-null"); 203Debug.Assert(_entries != null, "_entries should be non-null"); 225Debug.Assert(entries != null, "Expected _entries to be initialized"); 255Debug.Assert(comparer is not null); 297Debug.Assert(entries != null, "entries should be non-null"); 303Debug.Assert(typeof(T).IsValueType || comparer is not null); 327Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 426Debug.Assert(set is not null); 427Debug.Assert(IsCompatibleItem(set)); 438Debug.Assert(set is not null); 446Debug.Assert(IsCompatibleItem(set)); 462Debug.Assert(set._buckets != null); 465Debug.Assert(entries != null, "expected entries to be non-null"); 472Debug.Assert(comparer is not null); 502Debug.Assert((StartOfFreeList - entries[set._freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 549Debug.Assert(entries != null, "entries should be non-null"); 574Debug.Assert((StartOfFreeList - set._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646"); 634Debug.Assert(set._entries != null, "expected entries to be != null"); 1253Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type."); 1297Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 1298Debug.Assert(_entries != null, "_entries should be non-null"); 1299Debug.Assert(newSize >= _entries.Length); 1308Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1425Debug.Assert(_buckets != null); 1428Debug.Assert(entries != null, "expected entries to be non-null"); 1464Debug.Assert(comparer is not null); 1492Debug.Assert((StartOfFreeList - entries[_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow"); 1525Debug.Assert(location >= 0); 1583Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first"); 1741Debug.Assert((_buckets != null) && (_count > 0), "_buckets was null but count greater than 0");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\List.cs (3)
216Debug.Assert(_size == _items.Length); 466Debug.Assert(insertionCount > 0); 490Debug.Assert(_items.Length < capacity);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (3)
31Debug.Assert(underlyingComparer != null); 87Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters."); 119Debug.Assert(obj != null, "This implementation is only called from first-party collection types that guarantee non-null parameters.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (3)
312Debug.Assert(capacity >= _size); 349Debug.Assert(_size == 0); 397Debug.Assert(_array.Length < capacity);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (13)
281Debug.Assert(_loadsize < hashsize, "Invalid hashtable loadsize!"); 424Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); 536Debug.Assert(array != null); 537Debug.Assert(array.Rank == 1); 555Debug.Assert(array != null); 556Debug.Assert(array.Rank == 1); 607Debug.Assert(array != null); 608Debug.Assert(array.Rank == 1); 743Debug.Assert(_loadsize < newsize, "Our current implementation means this is not possible."); 790Debug.Assert(key != null, "key can't be null here!"); 934Debug.Fail("hash table insert failed! Load factor too high, or our double hashing function is incorrect."); 940Debug.Assert(hashcode >= 0); // make sure collision bit (sign bit) wasn't set. 972Debug.Assert(!_isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (4)
64Debug.Assert(pComWeakRef != IntPtr.Zero); 80Debug.Assert(weakHandle != 0); 155Debug.Assert((taggedHandle & ComAwareBit) != 0); 172Debug.Assert((taggedHandle & ComAwareBit) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Convert.cs (8)
171Debug.Assert(value != null, "[Convert.DefaultToType]value!=null"); 2366Debug.Assert(buffer.Length == charsWritten, $"Expected {buffer.Length} == {charsWritten}"); 2405Debug.Assert(charsWritten == charLengthRequired); 2410Debug.Assert(converted == charLengthRequired); 2441Debug.Assert(written == charLengthRequired); 2446Debug.Assert(converted == charLengthRequired); 2455Debug.Assert(destination.Length >= ToBase64_CalculateAndValidateOutputLength(source.Length, insertLineBreaks: true)); 2464Debug.Assert(status == OperationStatus.Done && bytesConsumed == chunkSize);
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (5)
38Debug.Assert(dayNumber <= MaxDayNumber); 752Debug.Assert(result != ParseFailureKind.None); 759Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 817Debug.Assert(charsWritten == destination.Length); 823Debug.Assert(charsWritten == destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateTime.cs (5)
151Debug.Assert((dateData & TicksMask) <= MaxTicks); 201Debug.Assert(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); 1130Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 1143Debug.Assert(ticks <= MaxTicks, "Input parameters validated already"); 2039Debug.Assert(ticks <= MaxTicks, "Input parameters validated already");
src\runtime\src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (4)
73Debug.Assert(validOffsetMinutes is >= MinOffsetMinutes and <= MaxOffsetMinutes); 74Debug.Assert(validDateTime.Kind == DateTimeKind.Unspecified); 75Debug.Assert((ulong)(validDateTime.Ticks + validOffsetMinutes * TimeSpan.TicksPerMinute) <= DateTime.MaxTicks); 937Debug.Assert(offset.Ticks >= MinOffset && offset.Ticks <= MaxOffset, "Offset not validated.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.cs (1)
382Debug.Assert((exponent >= 67) && (exponent <= 95));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (17)
350Debug.Assert(den > bufNum.High64); 375Debug.Assert(den > bufNum.High64); 467Debug.Assert(bufDen.U2 > bufNum.U3); 593Debug.Assert(hiRes < Buf24.Length); 721Debug.Assert(cur + 1 < Buf24.Length); 788Debug.Assert(bufQuo.U2 == 0); 1064Debug.Assert(cur < Buf24.Length); 1076Debug.Assert(hiProd + 1 < Buf24.Length); 1112Debug.Assert(cur < Buf24.Length); 1114Debug.Assert(hiProd < Buf24.Length); 1139Debug.Assert(cur < Buf24.Length); 1786Debug.Assert(drop is 1 or 2, "The scaling above guarantees one guard bit and at most one extra bit, so the ulong shifts and masks below stay in range."); 1818Debug.Assert((uint)exponent <= DEC_SCALE_MAX); 2216Debug.Assert(d2.High == 0); 2217Debug.Assert(scale == 0); 2274Debug.Assert(high + 1 < Buf28.Length); 2436Debug.Assert(mode == MidpointRounding.ToPositiveInfinity);
src\runtime\src\libraries\System.Private.CoreLib\src\System\DefaultBinder.cs (1)
1064Debug.Assert(cur1.IsStatic != cur2.IsStatic, "hierarchyDepth1 == hierarchyDepth2");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Delegate.cs (1)
82Debug.Assert(HasSingleTarget && Target == _target && _target != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractFailedEventArgs.cs (1)
19Debug.Assert(originalException == null || failureKind == ContractFailureKind.PostconditionOnException);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Debug.cs (5)
279/// <summary>Provides an interpolated string handler for <see cref="Debug.Assert"/> that only performs formatting if the assert fails.</summary> 290/// <param name="condition">The condition Boolean passed to the <see cref="Debug"/> method.</param> 373/// <summary>Provides an interpolated string handler for <see cref="Debug.WriteIf"/> and <see cref="Debug.WriteLineIf"/> that only performs formatting if the condition applies.</summary> 384/// <param name="condition">The condition Boolean passed to the <see cref="Debug"/> method.</param>
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\DebugProvider.cs (2)
103int indentCount = Debug.IndentSize * Debug.IndentLevel;
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\StackTrace.cs (3)
377Debug.Assert(mb != null); 437Debug.Assert(method != null); 438Debug.Assert(method.DeclaringType != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (3)
62Debug.Assert((options & EventActivityOptions.Disable) == 0); 506Debug.Assert(value < 16); 507Debug.Assert(ptr < endPtr);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (10)
49Debug.Assert(e.Command == EventCommand.Enable || e.Command == EventCommand.Disable); 55Debug.Assert(e.Arguments != null); 77Debug.Assert(e.Command == EventCommand.Disable); 94Debug.Assert((s_counterGroupEnabledList == null && !_eventSource.IsEnabled()) 112Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 131Debug.Assert(s_counterGroups != null); 156Debug.Assert(pollingIntervalInSeconds > 0); 157Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 195Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 211Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\DiagnosticCounter.cs (6)
42Debug.Assert(_group is null); 43Debug.Assert(Name != null); 44Debug.Assert(EventSource != null); 117Debug.Assert(Monitor.IsEntered(this)); 127Debug.Assert(_metadata.Count > 0); 129Debug.Assert(gotOne);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
80Debug.Assert(Monitor.IsEntered(this)); 174Debug.Assert(Monitor.IsEntered(this));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventListener.cs (12)
276Debug.Assert(s_EventSources != null); 335Debug.Assert(EventSource.IsSupported); 339Debug.Assert(s_EventSources != null); 351Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 398Debug.Assert(Monitor.IsEntered(EventListenersLock)); 400Debug.Assert(s_EventSources != null); 442Debug.Fail("EventSource did not have a registered EventListener!"); 474Debug.Assert(s_EventSources != null); 491Debug.Assert(eventSource.m_id == id, "Unexpected event source ID."); 497Debug.Assert(allListeners.ContainsKey(dispatcher.m_Listener), "EventSource has a listener not on the global list."); 507Debug.Assert(dispatcher != null, "Listener is not on all eventSources."); 541Debug.Assert(s_EventSources != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (6)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 116Debug.Fail("GetSessionInfo returned false."); 125Debug.Assert(Volatile.Read(ref m_sessionID) == 0); 134Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 142Debug.Assert(sessionID != 0); 182Debug.Assert((syncTimeUtc.Ticks != 0) && (syncTimeQPC != 0) && (timeQPCFrequency != 0));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.Threads.cs (3)
13Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 14Debug.Assert(sessionID != 0); 23Debug.Assert(sessionID != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (2)
76Debug.Assert(!_gcHandle.IsAllocated); 126Debug.Assert(userDataCount >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
178Debug.Assert(offset == v1MetadataLength); 208Debug.Assert(totalMetadataLength == offset); 226Debug.Assert(bufferLength >= (offset + srcLength)); 236Debug.Assert(bufferLength >= (offset + sizeof(T))); 312Debug.Assert(property != null); 313Debug.Assert(pMetadataBlob != null); 386Debug.Assert(pMetadataBlob != null); 406Debug.Assert(typeInfo != null); 407Debug.Assert(pMetadataBlob != null); 613Debug.Assert(property != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipePayloadDecoder.cs (1)
133Debug.Fail($"Unsupported type \"{parameterType}\" encountered.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (4)
167Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 466Debug.Assert(EtwAPIMaxRefObjCount == 8, $"{nameof(EtwAPIMaxRefObjCount)} must equal the number of fields in {nameof(InlineArray8<>)}"); 662Debug.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1279Debug.Assert(filterData != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (51)
464Debug.Assert(EventListener.s_EventSources != null); 774Debug.Assert(m_eventData != null); 775Debug.Assert(m_eventPipeProvider != null); 802Debug.Assert(eventHandle != IntPtr.Zero); 1362Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 1530Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 1728Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. 1804Debug.Assert(data->Size == 4); 1816Debug.Assert(dataType.IsEnum); 1836Debug.Assert(*(int*)dataPointer == (data + 1)->Size); 1851Debug.Assert(!dataType.IsEnum); 1854Debug.Assert(size == 1); 1859Debug.Assert(size == 1); 1864Debug.Assert(size == 2); 1869Debug.Assert(size == 2); 1874Debug.Assert(size == 2); 1911Debug.Assert(size == 16); 1916Debug.Assert(size == 16); 1960Debug.Assert(data->Size >= 0 && data->Size % 2 == 0, "String size should be even"); 1965Debug.Assert(*(charPointer + i) != 0, "String may not contain null chars"); 1967Debug.Assert(*(charPointer + charLength) == 0, "String must be null terminated"); 1992Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 2100Debug.Assert(m_eventData != null); 2120Debug.Assert(m_eventData != null); 2150Debug.Assert(m_eventData != null); 2180Debug.Assert(data->Size == 4); 2201Debug.Assert(dispatcher.m_EventEnabled != null); 2378Debug.Assert(m_eventData != null); 2671Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2686Debug.Assert(m_eventData != null); 2744Debug.Assert(commandArgs.perEventSourceSessionId >= -1 && commandArgs.perEventSourceSessionId <= SessionMask.MAX); 2762Debug.Assert(m_eventData != null); 2778Debug.Assert(dispatcher.m_EventEnabled != null); 2839Debug.Assert(m_eventData != null); 2855Debug.Assert(dispatcher.m_EventEnabled != null); 2872Debug.Assert(m_eventData != null); 2887Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2891Debug.Assert(m_rawManifest == null); 2893Debug.Assert(m_eventData != null); 2898Debug.Assert(EventListener.s_EventSources != null, "should be called within lock on EventListener.EventListenersLock which ensures s_EventSources to be initialized"); 2939Debug.Assert(!SelfDescribingEvents); 3227Debug.Assert(0 <= startEventId); 3270Debug.Assert(eventData != null); 3304Debug.Assert(eventData != null); 3364Debug.Assert(attributeType == typeof(EventAttribute) || attributeType == typeof(EventSourceAttribute)); 3379Debug.Assert(data.ConstructorArguments.Count <= 1); 3621Debug.Assert(eventAttribute.Task != EventTask.None || eventAttribute.Opcode != EventOpcode.Info); 3868Debug.Assert(((m_config & EventSourceSettings.EtwManifestEventFormat) != 0) != 4578Debug.Assert(perEventSourceSessionId < MAX); 4596Debug.Assert(perEventSourceSessionId < MAX); 4601Debug.Assert(perEventSourceSessionId < MAX);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ManifestBuilder.cs (7)
153Debug.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug); 195Debug.Assert(numParams == 0); 196Debug.Assert(this.eventName == null); 274Debug.Assert(eventName != null); 393Debug.Assert(channelInfo.Name != null); 426Debug.Assert(localEnumType.IsEnum); 654Debug.Assert(info!.Attribs != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.Threading.NativeSinks.cs (5)
82Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 103Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 122Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 352Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword)); 366Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\ArrayTypeInfo.cs (1)
46Debug.Assert(value != null, "null accepted only for some overrides");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (6)
99Debug.Assert(buffer != null); 134Debug.Assert(buffer != null); 173Debug.Assert(buffer != null); 214Debug.Assert(value != null && buffer != null); 239Debug.Assert(buffer != null); 272Debug.Assert(buffer != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EnumerableTypeInfo.cs (1)
51Debug.Assert(value != null, "null accepted only for some overrides");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
19Debug.Assert(payloadNames.Length == payloadValues.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (2)
208Debug.Assert(custom != null); 209Debug.Assert(pos >= 0 && this.fixedCount >= 0 && pos <= metadata.Length - this.fixedCount);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\PropertyValue.cs (3)
153Debug.Assert(_scalarLength == 0, "This ReflectedValue refers to an unboxed value type, not a reference type or boxed value type."); 162Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type"); 171Debug.Assert(_scalarLength > 0, "This ReflectedValue refers to a reference type or boxed value type, not an unboxed value type");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleEventTypes.cs (1)
33Debug.Assert(instance != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (6)
420Debug.Assert(eventHandle != IntPtr.Zero); 530Debug.Assert(eventHandle != IntPtr.Zero); 598Debug.Assert(eventHandle != IntPtr.Zero); 632Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Start when eventName is null"); 637Debug.Assert(eventName != null, "GetOpcodeWithDefault should not returned Stop when eventName is null"); 790Debug.Assert(ProviderMetadata.SequenceEqual(m_providerMetadata));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Double.cs (7)
297Debug.Assert(IsNaN(value)); 1635Debug.Assert(ax >= ay); 1723Debug.Assert(n == 0); 1762Debug.Assert(IsPositiveInfinity(x)); 1767Debug.Assert(IsNegativeInfinity(x)); 1807Debug.Assert(IsPositiveInfinity(x)); 1812Debug.Assert(IsNegativeInfinity(x));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Enum.cs (27)
258Debug.Assert(enumType.IsActualEnum); 341Debug.Assert(enumType.IsActualEnum); 371Debug.Assert(enumType.IsActualEnum); 462Debug.Fail("Unknown enum underlying type"); 584Debug.Assert(success && result is not null); 604Debug.Assert(success && result is not null); 646Debug.Assert(success); 663Debug.Assert(success); 1246Debug.Fail("Unknown enum underlying type"); 1348Debug.Fail("Unknown enum underlying type"); 1546Debug.Assert(success); 1547Debug.Assert(charsWritten == sizeof(TStorage) * 2); 1806Debug.Assert(typeof(TEnum).IsEnum); 1807Debug.Assert(value is not null); 1898Debug.Assert(!format.IsEmpty); 1934Debug.Assert(names.Length == values.Length); 1965Debug.Assert(!isDestinationTooSmall); 1969Debug.Assert(names.Length == values.Length); 2015Debug.Assert(foundItemsCount >= 2 && foundItemsCount <= 64, $"{nameof(foundItemsCount)} == {foundItemsCount}"); 2110Debug.Assert(foundItems.Length >= 2, $"{nameof(foundItems)} == {foundItems.Length}"); 2297Debug.Assert( 2312if (typeof(TUnderlying) == typeof(sbyte)) Debug.Assert(typeof(TStorage) == typeof(byte)); 2313else if (typeof(TUnderlying) == typeof(short)) Debug.Assert(typeof(TStorage) == typeof(ushort)); 2314else if (typeof(TUnderlying) == typeof(int)) Debug.Assert(typeof(TStorage) == typeof(uint)); 2315else if (typeof(TUnderlying) == typeof(long)) Debug.Assert(typeof(TStorage) == typeof(ulong)); 2316else if (typeof(TUnderlying) == typeof(nint)) Debug.Assert(typeof(TStorage) == typeof(nuint)); 2317else Debug.Assert(typeof(TUnderlying) == typeof(TStorage));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.cs (4)
177Debug.Assert(processId != 0); 203Debug.Assert(processPath != null); 226Debug.Assert(osVersion != null); 259Debug.Assert(target != EnvironmentVariableTarget.Process);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (6)
42Debug.Assert(option == SpecialFolderOption.Create); 72Debug.Fail($"Unable to get home directory: {exc}"); 167Debug.Assert(!string.IsNullOrEmpty(homeDir), $"Expected non-empty homeDir"); 168Debug.Assert(!string.IsNullOrEmpty(key), $"Expected non-empty key"); 169Debug.Assert(!string.IsNullOrEmpty(fallback), $"Expected non-empty fallback"); 244Debug.Fail($"Failed reading {userDirsPath}: {exc}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Unix.cs (2)
21Debug.Assert(variable != null); 43Debug.Assert(variable != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
175Debug.Assert(resultSpan.Length == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (2)
69Debug.Assert(_callback1 != null); 91Debug.Assert(_callback0 != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Calendar.cs (2)
98Debug.Assert(BaseCalendarID != CalendarId.UNINITIALIZED_VALUE, "[Calendar.CurrentEraValue] Expected a real calendar ID"); 369Debug.Assert(offset >= 0, "Calendar.GetFirstDayWeekOfYear(): offset >= 0");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
104Debug.Assert(!GlobalizationMode.Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (11)
38Debug.Assert(!GlobalizationMode.UseNls); 62Debug.Assert(this.saMonthNames != null); 65Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 89Debug.Assert(!GlobalizationMode.Invariant); 90Debug.Assert(!GlobalizationMode.UseNls); 117Debug.Assert(!GlobalizationMode.UseNls); 125Debug.Assert(!GlobalizationMode.Invariant); 223Debug.Assert(index + 3 < modifiedPattern.Length); 332Debug.Assert(!unsupportedDateFieldSymbols.Contains(input[index]), 386Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14); 464Debug.Fail(e.ToString());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (3)
16Debug.Assert(!GlobalizationMode.Invariant); 17Debug.Assert(GlobalizationMode.UseNls); 73Debug.Assert(context->strings != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Unix.cs (1)
27Debug.Assert(!GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (8)
146Debug.Assert(gregorianYear < 1620 || 2020 <= gregorianYear); 155Debug.Assert(1988 <= gregorianYear && gregorianYear <= 2019); 161Debug.Assert(1900 <= gregorianYear && gregorianYear <= 1987); 168Debug.Assert(1800 <= gregorianYear && gregorianYear <= 1899); 175Debug.Assert(1700 <= gregorianYear && gregorianYear <= 1799); 182Debug.Assert(1620 <= gregorianYear && gregorianYear <= 1699); 209Debug.Fail("Not expected to come here"); 388Debug.Assert(day != upperBoundNewYearDay);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (10)
56Debug.Assert(s != null); 57Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); 89Debug.Assert(bidiCategory == StrongBidiCategory.Other || bidiCategory == StrongBidiCategory.StrongLeftToRight || bidiCategory == StrongBidiCategory.StrongRightToLeft, "Unknown StrongBidiCategory value."); 96Debug.Assert(index >= 0 && index < s.Length, "index < s.Length"); 392Debug.Assert(value != null, "value can not be null"); 393Debug.Assert(index < value.Length); 404Debug.Assert(str != null, "str can not be null"); 405Debug.Assert(str.Length > 0); 406Debug.Assert(index >= 0 && index < str.Length); 438Debug.Assert((uint)index < (uint)s.Length, "index < s.Length");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfoData.cs (6)
17Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 18Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 19Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count."); 1483Debug.Assert(level1BitCount == 11, "Unexpected level 1 bit count."); 1484Debug.Assert(level2BitCount == 5, "Unexpected level 2 bit count."); 1485Debug.Assert(level3BitCount == 4, "Unexpected level 3 bit count.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (6)
222Debug.Assert(m_name != null, "CompareInfo.OnSerializing - expected m_name to be set already"); 239Debug.Assert(m_name != null, "CompareInfo.Name Expected _name to be set"); 367Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span1))); 368Debug.Assert(!Unsafe.IsNullRef(ref MemoryMarshal.GetReference(span2))); 396Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2); 1048Debug.Assert(matchLengthPtr != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (50)
40Debug.Assert(!GlobalizationMode.UseNls); 41Debug.Assert(interopCultureName != null); 53Debug.Assert(!GlobalizationMode.Invariant); 54Debug.Assert(!GlobalizationMode.UseNls); 55Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 69Debug.Assert(!GlobalizationMode.Invariant); 70Debug.Assert(!GlobalizationMode.UseNls); 71Debug.Assert(target.Length != 0); 106Debug.Assert(!GlobalizationMode.Invariant); 108Debug.Assert(!target.IsEmpty); 109Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 221Debug.Assert(!GlobalizationMode.Invariant); 223Debug.Assert(!target.IsEmpty); 224Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 316Debug.Assert(!GlobalizationMode.Invariant); 317Debug.Assert(!GlobalizationMode.UseNls); 319Debug.Assert(!prefix.IsEmpty); 320Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 345Debug.Assert(!GlobalizationMode.Invariant); 347Debug.Assert(!prefix.IsEmpty); 348Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 427Debug.Assert(!GlobalizationMode.Invariant); 429Debug.Assert(!prefix.IsEmpty); 430Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 500Debug.Assert(!GlobalizationMode.Invariant); 501Debug.Assert(!GlobalizationMode.UseNls); 503Debug.Assert(!suffix.IsEmpty); 504Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 529Debug.Assert(!GlobalizationMode.Invariant); 531Debug.Assert(!suffix.IsEmpty); 532Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 612Debug.Assert(!GlobalizationMode.Invariant); 614Debug.Assert(!suffix.IsEmpty); 615Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 686Debug.Assert(!GlobalizationMode.Invariant); 687Debug.Assert(!GlobalizationMode.UseNls); 743Debug.Assert(!GlobalizationMode.Invariant); 744Debug.Assert(!GlobalizationMode.UseNls); 745Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 792Debug.Assert(!GlobalizationMode.Invariant); 793Debug.Assert(!GlobalizationMode.UseNls); 794Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 822Debug.Assert(!GlobalizationMode.Invariant); 823Debug.Assert(!GlobalizationMode.UseNls); 824Debug.Assert(!text.IsEmpty); 847Debug.Assert(!GlobalizationMode.Invariant); 848Debug.Assert(!GlobalizationMode.UseNls); 849Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 946Debug.Assert(!GlobalizationMode.Invariant); 947Debug.Assert(!GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Invariant.cs (6)
46Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 58Debug.Assert(sortKey.Length >= source.Length * sizeof(char)); 86Debug.Assert(GlobalizationMode.Invariant); 87Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 112Debug.Assert(GlobalizationMode.Invariant); 113Debug.Assert((options & ValidCompareMaskOffFlags) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (64)
15Debug.Assert(GlobalizationMode.UseNls); 51Debug.Assert(!GlobalizationMode.Invariant); 52Debug.Assert(!source.IsEmpty); 53Debug.Assert(!value.IsEmpty); 58Debug.Assert(pSource != null); 59Debug.Assert(pValue != null); 69Debug.Assert(ret >= -1 && ret <= source.Length); 72Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 80Debug.Assert(!GlobalizationMode.Invariant); 81Debug.Assert(GlobalizationMode.UseNls); 83Debug.Assert(source.Length != 0); 84Debug.Assert(value.Length != 0); 92Debug.Assert(!GlobalizationMode.Invariant); 93Debug.Assert(GlobalizationMode.UseNls); 95Debug.Assert(source != null); 96Debug.Assert(value != null); 109Debug.Assert(!GlobalizationMode.Invariant); 110Debug.Assert(GlobalizationMode.UseNls); 111Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 174Debug.Assert(!GlobalizationMode.Invariant); 175Debug.Assert(GlobalizationMode.UseNls); 177Debug.Assert(count1 > 0); 178Debug.Assert(count2 > 0); 183Debug.Assert(char1 != null); 184Debug.Assert(char2 != null); 198Debug.Assert(!GlobalizationMode.Invariant); 199Debug.Assert(GlobalizationMode.UseNls); 200Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 222Debug.Assert(*pString1 >= 0); // assert that we can always dereference this 223Debug.Assert(*pString2 >= 0); // assert that we can always dereference this 252Debug.Assert(!GlobalizationMode.Invariant); 253Debug.Assert(!lpStringValue.IsEmpty); 274Debug.Assert(pSource != null && pValue != null); 288Debug.Assert(result >= -1 && result <= lpStringSource.Length); 291Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 299Debug.Assert(!GlobalizationMode.Invariant); 300Debug.Assert(GlobalizationMode.UseNls); 302Debug.Assert(target.Length != 0); 310Debug.Assert(!GlobalizationMode.Invariant); 311Debug.Assert(GlobalizationMode.UseNls); 313Debug.Assert(!prefix.IsEmpty); 314Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 331Debug.Assert(!GlobalizationMode.Invariant); 332Debug.Assert(GlobalizationMode.UseNls); 334Debug.Assert(!suffix.IsEmpty); 335Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 361Debug.Assert(!GlobalizationMode.Invariant); 362Debug.Assert(GlobalizationMode.UseNls); 413Debug.Assert(!GlobalizationMode.Invariant); 414Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 442Debug.Assert(pSource != null); 443Debug.Assert(pSortKey != null); 454Debug.Assert(actualSortKeyLength == 0, "LCMapStringEx should never return a negative value."); 470Debug.Assert(actualSortKeyLength <= destination.Length); 476Debug.Assert(!GlobalizationMode.Invariant); 477Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 496Debug.Assert(pSource != null); 506Debug.Assert(sortKeyLength == 0, "LCMapStringEx should never return a negative value."); 519Debug.Assert(!GlobalizationMode.Invariant); 520Debug.Assert(GlobalizationMode.UseNls); 521Debug.Assert(!text.IsEmpty); 558Debug.Assert(((options & ~(CompareOptions.IgnoreCase | 572Debug.Assert(!GlobalizationMode.Invariant); 573Debug.Assert(GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (20)
903Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already"); 1083Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already"); 1659Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already"); 1726Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR, 1750Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already"); 1780Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already"); 1804Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already"); 1816Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already"); 1889Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already"); 1932Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0"); 1938Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 1944Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0"); 2022Debug.Assert(str != null); 2023Debug.Assert(start >= 0); 2024Debug.Assert(end >= 0); 2109Debug.Assert(startIndex >= 0, "startIndex cannot be negative"); 2110Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters"); 2204Debug.Assert(index >= 10, $"Couldn't read native digits for '{_sWindowsName}' successfully."); 2230Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already"); 2250Debug.Assert(_sRealName != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (33)
35Debug.Assert(name is not null); 36Debug.Assert(name.Length <= ICU_ULOC_FULLNAME_CAPACITY); 115Debug.Assert(_sRealName != null); 116Debug.Assert(!GlobalizationMode.Invariant); 153Debug.Assert(_sWindowsName != null); 214Debug.Assert(!GlobalizationMode.Invariant); 215Debug.Assert(!GlobalizationMode.UseNls); 216Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); 230Debug.Assert(!GlobalizationMode.UseNls); 231Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); 246Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleStringData)] Failed"); 254Debug.Assert(!GlobalizationMode.UseNls); 256Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleNumberData)] Expected _sWindowsName to be populated already"); 271Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleNumberData)] failed"); 279Debug.Assert(!GlobalizationMode.UseNls); 280Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo(LocaleGroupingData)] Expected _sWindowsName to be populated already"); 287Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleGroupingData type)] failed"); 302Debug.Assert(!GlobalizationMode.UseNls); 303Debug.Assert(_sWindowsName != null, "[CultureData.GetTimeFormatString(bool shortFormat)] Expected _sWindowsName to be populated already"); 325Debug.Fail("[CultureData.GetTimeFormatString(bool shortFormat)] Failed"); 352Debug.Assert(!GlobalizationMode.UseNls); 367Debug.Assert(icuFormatString.Length < ICU_ULOC_FULLNAME_CAPACITY); 454Debug.Assert(!GlobalizationMode.Invariant); 455Debug.Assert(!GlobalizationMode.UseNls); 463Debug.Assert(!GlobalizationMode.UseNls); 473Debug.Assert(!GlobalizationMode.UseNls); 480Debug.Assert(!GlobalizationMode.UseNls); 481Debug.Assert(cultureName != null); 504Debug.Fail("[CultureData.IcuGetListSeparator] Unexpected ListSeparator value."); 514Debug.Assert(!GlobalizationMode.UseNls); 520Debug.Assert(!GlobalizationMode.Invariant); 521Debug.Assert(!GlobalizationMode.UseNls); 593Debug.Assert(!GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (25)
42Debug.Assert(!GlobalizationMode.Invariant); 49Debug.Assert(ShouldUseUserOverrideNlsData); 50Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfo] Expected _sRealName to be populated by already"); 58Debug.Assert(ShouldUseUserOverrideNlsData); 66Debug.Assert(IsWin32Installed); 77Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 83Debug.Assert(ShouldUseUserOverrideNlsData); 84Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 90Debug.Assert(GlobalizationMode.UseNls); 96Debug.Assert(ShouldUseUserOverrideNlsData); 97Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 103Debug.Assert(ShouldUseUserOverrideNlsData); 104Debug.Assert(_sRealName != null, "[CultureData.DoGetLocaleInfoInt] Expected _sRealName to be populated by already"); 116Debug.Assert(!GlobalizationMode.Invariant); 117Debug.Assert(GlobalizationMode.UseNls); 118Debug.Assert(regionName != null); 140Debug.Assert(GlobalizationMode.UseNls); 160Debug.Assert(GlobalizationMode.UseNls); 176Debug.Assert(localeName != null, "[CultureData.GetLocaleInfoFromLCType] Expected localeName to be not be null"); 447Debug.Assert(!GlobalizationMode.Invariant); 454Debug.Assert(GlobalizationMode.UseNls); 460Debug.Assert(!GlobalizationMode.Invariant); 461Debug.Assert(GlobalizationMode.UseNls); 511Debug.Assert(GlobalizationMode.UseNls); 519Debug.Assert(GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Unix.cs (1)
17Debug.Assert(!GlobalizationMode.Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (6)
175Debug.Assert(cultureData != null); 183Debug.Assert(name != null); 448Debug.Assert(s_InvariantCultureInfo != null, "[CultureInfo.InvariantCulture] s_InvariantCultureInfo is null"); 570Debug.Assert(_name != null, "[CultureInfo.DisplayName] Always expect _name to be set"); 781Debug.Assert(!GlobalizationMode.Invariant); 797Debug.Assert(calType != CalendarId.GREGORIAN, "calType!=CalendarId.GREGORIAN");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.Unix.cs (1)
18Debug.Assert(localeName != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (23)
166Debug.Assert(value >= 0, "DateTimeFormat.FormatDigits(): value >= 0"); 167Debug.Assert(minimumLength <= 16); 209Debug.Assert(dayOfWeek >= 0 && dayOfWeek <= 6); 221Debug.Assert(month >= 1 && month <= 12, "month >=1 && month <= 12"); 262Debug.Assert(repeatCount != 3 || repeatCount != 4, "repeateCount should be 3 or 4"); 755Debug.Assert(typeof(TChar) == typeof(byte)); 770Debug.Assert(typeof(TChar) == typeof(byte)); 782Debug.Assert(charCount != 0); 841Debug.Assert(tokenLen >= 3); 934Debug.Assert(charsWritten == FormatSLength); 941Debug.Assert(charsWritten == FormatInvariantGMinLength); 960Debug.Assert(charsWritten == FormatInvariantGMaxLength); 979Debug.Assert(charsWritten is >= FormatOMinLength and <= FormatOMaxLength); 986Debug.Assert(charsWritten == str.Length); 993Debug.Assert(charsWritten == str.Length); 1000Debug.Assert(charsWritten == str.Length); 1020Debug.Assert(charsWritten == FormatInvariantGMinLength); 1050Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1439Debug.Assert(dayAbbrev.Length == 3); 1442Debug.Assert(monthAbbrev.Length == 3); 1646Debug.Assert(dayAbbrev.Length == 3); 1649Debug.Assert(monthAbbrev.Length == 3); 1750Debug.Assert(dtfi != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (51)
166Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week"); 180Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week"); 194Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week"); 208Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13, 223Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13, 237Debug.Assert(cultureData != null); 238Debug.Assert(cal != null); 248Debug.Assert(cultureData != null); 249Debug.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initialized calendarId"); 266Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns"); 269Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns"); 272Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns"); 275Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns"); 278Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns"); 345Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null"); 364Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 374Debug.Assert(calendar != null, "DateTimeFormatInfo.Calendar: calendar != null"); 578Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0"); 594Debug.Assert(dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null"); 613Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 627Debug.Assert(firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1"); 659Debug.Assert(calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1"); 773Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0"); 777Debug.Assert(monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null"); 797Debug.Assert(pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null"); 816Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 979Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null"); 998Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1042Debug.Assert(values != null, "value != null"); 1043Debug.Assert(values.Length >= length); 1201Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13, 1211Debug.Assert(genitiveMonthNames.Length == 13, 1227Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.InternalGetLeapYearMonthNames] Expected Calendar.ID > 0"); 1229Debug.Assert(leapYearMonthNames.Length == 13, 1268Debug.Assert(patterns1 != null); 1269Debug.Assert(patterns2 != null); 1371Debug.Assert(patterns != null && patterns.Length > 0, 1373Debug.Assert(defaultPattern != null, 1449Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0"); 1451Debug.Assert(allYearMonthPatterns.Length > 0, 1470Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0"); 1472Debug.Assert(allShortDatePatterns.Length > 0, 1491Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0"); 1493Debug.Assert(allLongDatePatterns.Length > 0, 1513Debug.Assert(allShortTimePatterns.Length > 0, 1533Debug.Assert(allLongTimePatterns.Length > 0, 1698Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2251Debug.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber, 2300Debug.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length"); 2418Debug.Fail("The hashtable is full. This should not happen."); 2502Debug.Fail("The hashtable is full. This should not happen.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (24)
98Debug.Assert(dtfi != null, "dtfi == null"); 191Debug.Assert(dtfi != null, "dtfi == null"); 409Debug.Assert(DateParsingStates.Length == Width * Height); 563Debug.Assert(hourOffset >= 0 && hourOffset <= 99); 564Debug.Assert(minuteOffset >= 0 && minuteOffset <= 99); 1060Debug.Fail("Should never be reached"); 1082Debug.Fail("Should never be reached"); 2059Debug.Assert(raw.numCount >= 2); 2081Debug.Assert(raw.numCount >= 3); 2503Debug.Assert(dtfi != null, "dtfi == null"); 2823Debug.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified); 3185Debug.Assert(minDigitLen > 0); 3186Debug.Assert(maxDigitLen < 9); 3187Debug.Assert(minDigitLen <= maxDigitLen); 3222Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits); 5335Debug.Fail("Unknown DateTimeParseFailure: " + result.failure.ToString()); 5514Debug.Assert(dtfi != null, "Expected non-null DateTimeFormatInfo"); 5553Debug.Assert(Index + count <= Length, "__DTString::Advance: Index + count <= len"); 5880Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5889Debug.Assert(Index >= 0 && Index < Length, "Index >= 0 && Index < len"); 5890Debug.Assert(char.IsAsciiDigit(Value[Index]), "IsDigit(Value[Index])"); 6042Debug.Assert(number >= 0 && number <= 9); 6064Debug.Assert(sub.index == Index); 6065Debug.Assert(sub.index + sub.length <= Length, "sub.index + sub.length <= len");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewCalendar.cs (2)
494Debug.Assert(numDays >= 1, "NumDays >= 1"); 659Debug.Assert(hebrewYearType >= 1 && hebrewYearType <= 6,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (3)
102Debug.Assert(Number > 0 && Number <= 999, "Number is out of range."); 213Debug.Assert(typeof(TChar) == typeof(byte)); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IcuLocaleData.cs (3)
3779Debug.Assert(CulturesCount == (ThreeLetterWindowsLanguageName.Length / 3)); 3815Debug.Assert(ch <= 'z'); 3821Debug.Assert(CulturesCount * 2 == LocalesNamesIndexes.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (14)
214Debug.Assert(input.Length > 0); 262Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now."); 296Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now."); 476Debug.Assert(!char.IsLowSurrogate(unicode[basicCount]), "[IdnMapping.punycode_encode]Unexpected low surrogate"); 553Debug.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int"); 567Debug.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int"); 578Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_encode]Expected c_punycodeBase (36) to be != t"); 597Debug.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int"); 837Debug.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0"); 845Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != c_punycodeBase (36)"); 855Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0, 979Debug.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints."); 987Debug.Assert(delta + c_skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew."); 1012Debug.Assert(d >= 0 && d < c_punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (10)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(!GlobalizationMode.UseNls); 54Debug.Assert(!GlobalizationMode.Invariant); 55Debug.Assert(!GlobalizationMode.UseNls); 79Debug.Assert(!GlobalizationMode.Invariant); 80Debug.Assert(!GlobalizationMode.UseNls); 101Debug.Assert(!GlobalizationMode.Invariant); 102Debug.Assert(!GlobalizationMode.UseNls); 125Debug.Assert(!GlobalizationMode.Invariant); 126Debug.Assert(!GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (14)
14Debug.Assert(!GlobalizationMode.Invariant); 15Debug.Assert(GlobalizationMode.UseNls); 43Debug.Assert(!GlobalizationMode.Invariant); 44Debug.Assert(GlobalizationMode.UseNls); 51Debug.Assert(length == output.Length); 57Debug.Assert(!GlobalizationMode.Invariant); 58Debug.Assert(GlobalizationMode.UseNls); 88Debug.Assert(!GlobalizationMode.Invariant); 89Debug.Assert(GlobalizationMode.UseNls); 117Debug.Assert(!GlobalizationMode.Invariant); 118Debug.Assert(GlobalizationMode.UseNls); 125Debug.Assert(length == output.Length); 131Debug.Assert(!GlobalizationMode.Invariant); 132Debug.Assert(GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\InvariantModeCasing.cs (13)
113Debug.Assert(GlobalizationMode.Invariant); 114Debug.Assert(source.Length <= destination.Length); 139Debug.Assert(GlobalizationMode.Invariant); 140Debug.Assert(source.Length <= destination.Length); 183Debug.Assert(GlobalizationMode.Invariant); 199Debug.Assert(codePointLengthA == codePointLengthB); 211Debug.Assert(codePointLengthA == codePointLengthB); 226Debug.Assert(value.Length > 0); 227Debug.Assert(value.Length <= source.Length); 228Debug.Assert(GlobalizationMode.Invariant); 288Debug.Assert(value.Length > 0); 289Debug.Assert(value.Length <= source.Length); 290Debug.Assert(GlobalizationMode.Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
20Debug.Assert(!GlobalizationMode.UseNls); 122Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 149Debug.Assert(!GlobalizationMode.Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Nls.cs (1)
130Debug.Fail("Should never be called non-Windows platforms.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (16)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(!GlobalizationMode.UseNls); 17Debug.Assert(!source.IsEmpty); 19Debug.Assert(normalizationForm is NormalizationForm.FormC or NormalizationForm.FormD or NormalizationForm.FormKC or NormalizationForm.FormKD); 49Debug.Assert(!GlobalizationMode.Invariant); 50Debug.Assert(!GlobalizationMode.UseNls); 51Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 95Debug.Assert(realLen > StackallocThreshold); 124Debug.Assert(!GlobalizationMode.Invariant); 125Debug.Assert(!GlobalizationMode.UseNls); 126Debug.Assert(!source.IsEmpty); 127Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 170Debug.Assert(!GlobalizationMode.Invariant); 171Debug.Assert(!GlobalizationMode.UseNls); 172Debug.Assert(!source.IsEmpty); 173Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (18)
16Debug.Assert(!GlobalizationMode.Invariant); 17Debug.Assert(GlobalizationMode.UseNls); 18Debug.Assert(!source.IsEmpty); 19Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 37Debug.Assert(!GlobalizationMode.Invariant); 38Debug.Assert(GlobalizationMode.UseNls); 39Debug.Assert(strInput != null); 40Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 80Debug.Assert(realLength > buffer.Length, "Buffer overflow should have iLength > cBuffer.Length"); 88Debug.Assert(realLength > StackallocThreshold); 117Debug.Assert(!GlobalizationMode.Invariant); 118Debug.Assert(GlobalizationMode.UseNls); 119Debug.Assert(!source.IsEmpty); 120Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 167Debug.Assert(!GlobalizationMode.Invariant); 168Debug.Assert(GlobalizationMode.UseNls); 169Debug.Assert(!source.IsEmpty); 170Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (15)
105Debug.Assert(utf8.Length > 0); 287Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 379Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 401Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 445Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 530Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 553Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 589Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 610Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 647Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 670Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 706Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 727Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 748Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 770Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (5)
85Debug.Assert(length >= TVector.ElementCount); 249Debug.Assert(length == 1); 273Debug.Assert(length == 0); 466Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= source.Length); 532Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= source.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.Utf8.cs (10)
107Debug.Assert(lengthA >= Vector128<byte>.Count); 108Debug.Assert(lengthB >= Vector128<byte>.Count); 109Debug.Assert(Vector128.IsHardwareAccelerated); 275Debug.Assert(length == 1); 302Debug.Assert(length == 0); 417Debug.Assert(sourceLength >= Vector128<byte>.Count); 418Debug.Assert(prefixLength >= Vector128<byte>.Count); 419Debug.Assert(Vector128.IsHardwareAccelerated); 585Debug.Assert(length == 1); 616Debug.Assert(length == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (18)
176Debug.Assert(!GlobalizationMode.Invariant); 177Debug.Assert(!GlobalizationMode.UseNls); 230Debug.Assert(!GlobalizationMode.Invariant); 231Debug.Assert(!GlobalizationMode.UseNls); 263Debug.Assert(!GlobalizationMode.Invariant); 264Debug.Assert(!GlobalizationMode.UseNls); 335Debug.Assert(lowSurrogateA != '\0'); 336Debug.Assert(lowSurrogateB != '\0'); 365Debug.Assert(value.Length > 0); 366Debug.Assert(value.Length <= source.Length); 368Debug.Assert(!GlobalizationMode.Invariant); 369Debug.Assert(!GlobalizationMode.UseNls); 429Debug.Assert(value.Length > 0); 430Debug.Assert(value.Length <= source.Length); 432Debug.Assert(!GlobalizationMode.Invariant); 433Debug.Assert(!GlobalizationMode.UseNls); 506Debug.Assert(pageNumber >= 0 && pageNumber < 256); 537Debug.Assert(pageNumber > 0 && pageNumber < 256);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\PersianCalendar.cs (13)
126Debug.Assert(ordinalDay <= 366); 138Debug.Assert(1 <= month && month <= 12); 155Debug.Assert(y >= 1); 170Debug.Assert(ordinalDay >= 1); 171Debug.Assert(m >= 1 && m <= 12); 178Debug.Assert(1 <= d); 179Debug.Assert(d <= 31); 205Debug.Assert(year >= 1); 211Debug.Assert(ordinalDay >= 1); 212Debug.Assert(month >= 1 && month <= 12); 215Debug.Assert(1 <= day); 216Debug.Assert(day <= 31); 282Debug.Assert(daysInMonth == 30);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\RegionInfo.cs (1)
112Debug.Assert(_name != null, "Expected RegionInfo._name to be populated already");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\SortKey.cs (2)
54Debug.Assert(key1Data != null); 55Debug.Assert(key2Data != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\SurrogateCasing.cs (8)
15Debug.Assert(char.IsHighSurrogate(h)); 16Debug.Assert(char.IsLowSurrogate(l)); 20Debug.Assert(char.IsHighSurrogate(hr)); 21Debug.Assert(char.IsLowSurrogate(lr)); 27Debug.Assert(char.IsHighSurrogate(h)); 28Debug.Assert(char.IsLowSurrogate(l)); 32Debug.Assert(char.IsHighSurrogate(hr)); 33Debug.Assert(char.IsLowSurrogate(lr));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextElementEnumerator.cs (2)
21Debug.Assert(str != null, "TextElementEnumerator(): str != null"); 22Debug.Assert(startIndex >= 0 && startIndex <= str.Length, "TextElementEnumerator(): startIndex >= 0 && startIndex <= str.Length");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (10)
183Debug.Assert(!GlobalizationMode.Invariant); 237Debug.Assert(destination.Length >= source.Length); 244Debug.Assert(destination.Length >= source.Length); 251Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 270Debug.Assert(operationStatus == OperationStatus.Done); 301Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 304Debug.Assert(source != null); 574Debug.Assert(_isAsciiCasingSameAsInvariant == NullableBool.True || _isAsciiCasingSameAsInvariant == NullableBool.False); 729Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddNonLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!"); 745Debug.Assert(charLen == 1 || charLen == 2, "[TextInfo.AddTitlecaseLetter] CharUnicodeInfo.InternalGetUnicodeCategory returned an unexpected charLen!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Icu.cs (3)
15Debug.Assert(localeName != null); 22Debug.Assert(!GlobalizationMode.Invariant); 23Debug.Assert(!GlobalizationMode.UseNls);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (8)
13Debug.Assert(!GlobalizationMode.Invariant); 14Debug.Assert(GlobalizationMode.UseNls); 15Debug.Assert(pSource != null); 16Debug.Assert(pResult != null); 17Debug.Assert(pSourceLen >= 0); 18Debug.Assert(pResultLen >= 0); 19Debug.Assert(pSourceLen <= pResultLen); 40Debug.Assert(ret == pSourceLen, "Expected getting the same length of the original string");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (27)
53Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 111Debug.Assert(format == StandardFormat.C || format == StandardFormat.G || format == StandardFormat.g); 127Debug.Assert(ticks == long.MinValue /* -9223372036854775808 */); 144Debug.Assert(fraction < 10_000_000); 152Debug.Assert(decimalSeparator.IsEmpty); 167Debug.Assert(format == StandardFormat.g); 182Debug.Assert(seconds < 60); 190Debug.Assert(minutes < 60); 194Debug.Assert(totalHoursRemaining <= uint.MaxValue); 201Debug.Assert(hours < 24); 216Debug.Assert(dayDigits <= 8); 251Debug.Assert(hourDigits == 1 || hourDigits == 2); 289Debug.Assert(p - dest == requiredOutputLength); 299Debug.Assert(dtfi != null); 522Debug.Assert(field >= 0 && field <= 5); 539Debug.Fail("Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 551Debug.Assert((field == 0 && sb.Length == 0) || field == 1, "field == 0 || field == 1, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 559Debug.Assert((field == 1 && sb.Length == 0) || field == 2, "field == 1 || field == 2, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 567Debug.Assert((field == 2 && sb.Length == 0) || field == 3, "field == 2 || field == 3, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 575Debug.Assert((field == 3 && sb.Length == 0) || field == 4, "field == 3 || field == 4, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 584Debug.Assert((field == 4 && sb.Length == 0) || field == 5, "field == 4 || field == 5, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 597Debug.Assert(field == 5); 600Debug.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 601Debug.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 602Debug.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 603Debug.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern"); 604Debug.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (19)
109Debug.Assert(_ttt == TTT.Num); 110Debug.Assert(_num > -1); 146Debug.Assert(_zeroes > 0); // Already validated that in the condition _zeroes == 0 && _num > MaxFraction 155Debug.Assert(totalDigitsCount - MaxFractionDigits <= MaxFractionDigits); 159Debug.Assert(_num < MaxFraction); 187Debug.Assert(pos > -1); 407Debug.Assert(dtfi != null); 447Debug.Assert(_tokenCount == (_sepCount + _numCount), "tokenCount == (SepCount + NumCount)"); 540Debug.Assert(argumentName != null); 591Debug.Assert(powersOfTen.Length == MaxFractionDigits + 1); 631Debug.Assert(success, "Should have thrown on failure"); 653Debug.Assert(success, "Should have thrown on failure"); 675Debug.Assert(success, "Should have thrown on failure"); 719Debug.Assert(tokenizer.EOL); 774Debug.Assert(raw._numCount == 5); 844Debug.Assert(raw._numCount == 4); 970Debug.Assert(raw._numCount == 3); 1096Debug.Assert(raw._numCount == 2); 1165Debug.Assert(raw._numCount == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\UmAlQuraCalendar.cs (6)
267Debug.Assert((HijriYear >= MinCalendarYear) && (HijriYear <= MaxCalendarYear), "Hijri year is out of range."); 268Debug.Assert(HijriMonth >= 1, "Hijri month is out of range."); 269Debug.Assert(HijriDay >= 1, "Hijri day is out of range."); 339Debug.Assert((time.Ticks >= s_minDate.Ticks) && (time.Ticks <= s_maxDate.Ticks), "Gregorian date is out of range."); 487Debug.Assert((year >= MinCalendarYear) && (year <= MaxCalendarYear), "Hijri year is out of range."); 497Debug.Assert((days == 354) || (days == 355), "Hijri year has to be 354 or 355 days.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Guid.cs (9)
273Debug.Assert(success, "GuidParseThrowStyle.All means throw on all failures"); 344Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 358Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 438Debug.Assert(success, "GuidParseThrowStyle.AllButOverflow means throw on all failures"); 833Debug.Assert(lookup.Length == 256); 934Debug.Assert(typeof(TChar) == typeof(byte)); 1251Debug.Assert(result && bytesWritten == guidString.Length, "Formatting guid should have succeeded."); 1445Debug.Assert(p == guidChars + charsWritten - ((byte)flags != 0 ? 1 : 0)); 1520Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported) && BitConverter.IsLittleEndian);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Half.cs (1)
1584Debug.Assert(IsSubnormal(x));
src\runtime\src\libraries\System.Private.CoreLib\src\System\HashCode.cs (3)
336Debug.Assert(value.Length >= sizeof(int)); 341Debug.Assert(value.Length >= sizeof(int)); 346Debug.Assert(value.Length >= sizeof(int));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
160Debug.Assert(formatted);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int128.cs (5)
520Debug.Assert(value >= -TwoPow127); 521Debug.Assert(double.IsFinite(value)); 522Debug.Assert(value < TwoPow127); 765Debug.Assert((sign == 0) || (sign == -1)); 838Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
313Debug.Assert((sign == 0) || (sign == -1)); 379Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
334Debug.Assert((sign == 0) || (sign == -1)); 407Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
331Debug.Assert((sign == 0) || (sign == -1)); 404Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
364Debug.Assert((sign == 0) || (sign == -1)); 437Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (7)
159Debug.Assert(numBytes is 1 or 2, "BinaryReader::ReadOneChar assumes it's reading one or two bytes only."); 178Debug.Assert(charsRead < 2, "BinaryReader::ReadOneChar - assuming we only got 0 or 1 char, not 2!"); 180Debug.Assert(charsRead > 0); 317Debug.Assert(!_disposed); 359Debug.Assert(_stream is MemoryStream); 474Debug.Assert(buffer.Length != 1, "length of 1 should use ReadByte."); 479Debug.Assert(_stream is MemoryStream);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (84)
92Debug.Assert(_stream != null); 100Debug.Assert(_stream != null); 108Debug.Assert(_stream != null); 116Debug.Assert(_buffer != null); 117Debug.Assert(_bufferSize > 0); 132Debug.Assert(_bufferSize > 0); 199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 270Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 292Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 315Debug.Assert(_stream != null); 323Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 344Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0))); 353Debug.Assert(_writePos == 0 && _readPos == _readLen); 367Debug.Assert(_stream != null); 368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!"); 382Debug.Assert(_stream != null); 383Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]"); 393Debug.Assert(_readPos < _readLen); 406Debug.Assert(_stream != null); 407Debug.Assert(_readPos == 0 && _readLen == 0, 409Debug.Assert(_buffer != null && _bufferSize >= _writePos, 419Debug.Assert(_stream != null); 420Debug.Assert(_readPos == 0 && _readLen == 0, 422Debug.Assert(_buffer != null && _bufferSize >= _writePos, 433Debug.Assert(readbytes >= 0); 449Debug.Assert(readbytes >= 0); 477Debug.Assert(_stream != null); 499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 532Debug.Assert(_stream != null); 549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 675Debug.Assert(_stream != null); 676Debug.Assert(_stream.CanRead); 677Debug.Assert(_bufferSize > 0); 678Debug.Assert(_asyncActiveSemaphore != null); 679Debug.Assert(semaphoreLockTask != null); 699Debug.Assert(_readLen == _readPos); 742Debug.Assert(_readPos == _readLen); 751Debug.Assert(_stream != null); 798Debug.Assert(_stream != null); 863Debug.Assert(_writePos < _bufferSize); 880Debug.Assert(count == 0); 884Debug.Assert(count >= 0); 885Debug.Assert(_writePos == _bufferSize); 886Debug.Assert(_buffer != null); 893Debug.Assert(count == 0); 894Debug.Assert(_writePos < _bufferSize); 901Debug.Assert(_buffer != null); 902Debug.Assert(totalUserbytes >= _bufferSize); 927Debug.Assert(_stream != null); 933Debug.Assert(_writePos < _bufferSize, $"Expected {_writePos} < {_bufferSize}"); 952Debug.Assert(bytesWritten == buffer.Length); 957Debug.Assert(_writePos == _bufferSize); 958Debug.Assert(_buffer != null); 966Debug.Assert(bytesWritten == buffer.Length); 968Debug.Assert(_writePos < _bufferSize); 975Debug.Assert(_buffer != null); 976Debug.Assert(totalUserbytes >= _bufferSize); 1028Debug.Assert(_writePos < _bufferSize); 1035Debug.Assert(bytesWritten == buffer.Length); 1058Debug.Assert(_stream != null); 1059Debug.Assert(_stream.CanWrite); 1060Debug.Assert(_bufferSize > 0); 1061Debug.Assert(_asyncActiveSemaphore != null); 1062Debug.Assert(semaphoreLockTask != null); 1091Debug.Assert(buffer.Length == 0); 1095Debug.Assert(buffer.Length >= 0); 1096Debug.Assert(_writePos == _bufferSize); 1097Debug.Assert(_buffer != null); 1103Debug.Assert(bytesWritten == buffer.Length); 1105Debug.Assert(_writePos < _bufferSize); 1113Debug.Assert(_buffer != null); 1114Debug.Assert(totalUserBytes >= _bufferSize); 1172Debug.Assert(_stream != null); 1179Debug.Assert(_writePos < _bufferSize); 1186Debug.Assert(_stream != null); 1207Debug.Assert(oldPos == _stream.Position + (_readPos - _readLen)); 1229Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})"); 1241Debug.Assert(_stream != null); 1252Debug.Assert(_stream != null); 1255Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 1260Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 1287Debug.Assert(_stream != null); 1294Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 1299Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
55Debug.Assert(path[^1] == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (1)
194Debug.Assert(path != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Enumeration\FileSystemEntry.Unix.cs (2)
86Debug.Assert(Directory.Length + FileName.Length < _pathBuffer.Length, 89Debug.Assert(charsWritten > 0, "didn't write any chars to buffer");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\File.cs (11)
105Debug.Assert(path != null, "File.Exists: GetFullPath returned null"); 960Debug.Assert(writer != null); 961Debug.Assert(contents != null); 1123Debug.Assert(!string.IsNullOrEmpty(path)); 1124Debug.Assert(encoding != null); 1269Debug.Assert(bytesRead < rentedArray.Length); 1331Debug.Assert(!string.IsNullOrEmpty(path)); 1332Debug.Assert(encoding != null); 1381Debug.Assert(writer != null); 1382Debug.Assert(contents != null); 1535Debug.Assert(bytesRead < buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileInfo.cs (1)
26Debug.Assert(!isNormalized || !PathInternal.IsPartiallyQualified(fullPath.AsSpan()), "should be fully qualified if normalized");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileNotFoundException.cs (1)
53Debug.Assert(_message != null, "_message was null after calling SetMessageField");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileStatus.Unix.cs (6)
42Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 53Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 136Debug.Assert(_state != Uninitialized); // Use this after EnsureCachesInitialized has been called. 195Debug.Assert(handle is not null || path.Length > 0); 493Debug.Assert(handle is not null || path.Length > 0); 515Debug.Assert(errorInfo.RawErrno > 0); // Expect a positive integer
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystem.Unix.cs (7)
249Debug.Assert(directoryName != null); 285Debug.Assert(fullPath.Length > 0); 286Debug.Assert(PathInternal.IsDirectorySeparator(fullPath[0])); 333Debug.Assert(!PathInternal.IsDirectorySeparator(fullPath[i])); 400Debug.Assert(!isCaseSensitiveRename || !PathInternal.IsCaseSensitive); 472Debug.Assert(recursive); 718Debug.Assert(sb.Length > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\FileSystemInfo.Unix.cs (1)
24Debug.Assert(!PathInternal.IsPartiallyQualified(fullPath), $"'{fullPath}' should be fully qualified when constructed from directory enumeration");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (3)
241Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 328Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 531Debug.Assert(_position >= _origin);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (10)
640Debug.Assert(result, "should never fail joining first two paths"); 705Debug.Assert(first.Length > 0 && second.Length > 0, "should have dealt with empty paths"); 716Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0, "should have dealt with empty paths"); 732Debug.Assert(first.Length > 0 && second.Length > 0 && third.Length > 0 && fourth.Length > 0, "should have dealt with empty paths"); 781Debug.Assert(fourth.Length == destination.Length); 797Debug.Assert(bytes != null); 798Debug.Assert(byteCount == 8, $"Unexpected {nameof(byteCount)}"); 799Debug.Assert(chars.Length == 12, $"Unexpected {nameof(chars)}.Length"); 829Debug.Assert((b2 & 0xF8) == 0, "Unexpected set bits"); 869Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (4)
56Debug.Assert(!string.IsNullOrEmpty(path)); 57Debug.Assert(!path.Contains('\0')); 68Debug.Assert(collapsedString.Length < path.Length || collapsedString.ToString() == path, 120Debug.Assert(path[^1] == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
107Debug.Assert(passwd.HomeDirectory != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\ReadLinesIterator.cs (4)
36Debug.Assert(path != null); 37Debug.Assert(path.Length > 0); 38Debug.Assert(encoding != null); 39Debug.Assert(reader != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\SharedMemoryManager.Unix.cs (5)
173Debug.Assert(processDataHeader._sharedDataTotalByteCount == sharedDataTotalByteCount); 189Debug.Assert(!createIfNotExist); 315Debug.Assert(_referenceCount > 0, "Ref count should not be negative."); 321Debug.Assert(_referenceCount > 0, "Ref count should not be negative."); 855Debug.Assert(acquired);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (40)
28Debug.Assert(bufferSize > 1, "Buffering must not be enabled for smaller buffer sizes"); 62Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time."); 162Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 233Debug.Assert(_readPos == _readLen, "Read buffer should be empty!"); 254Debug.Assert(_readPos == _readLen); 301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 352Debug.Assert(!_strategy.CanSeek); 380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional."); 394Debug.Assert(_asyncActiveSemaphore != null); 395Debug.Assert(_strategy.CanSeek); 428Debug.Assert(_readLen == _readPos, "The read buffer must now be empty"); 519Debug.Assert(_writePos == 0, "FlushWrite must set _writePos to 0"); 525Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 576Debug.Assert(_writePos <= _bufferSize); 599Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed"); 600Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 602Debug.Assert(_strategy.CanSeek || (_readPos == 0 && _readLen == 0), 661Debug.Assert(!_strategy.CanSeek); 678Debug.Assert(_asyncActiveSemaphore != null); 679Debug.Assert(_strategy.CanSeek); 723Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted."); 760Debug.Assert(!_strategy.IsClosed, "FileStream responsibility"); 761Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen), 782Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 806Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 821Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 826Debug.Assert(_writePos == 0 && _readPos == _readLen); 851Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 856Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 882Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}"); 887Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer"); 919Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen)); 941Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})"); 954Debug.Assert(_writePos == 0, "Write buffer must be empty in FlushRead!"); 967Debug.Assert(_readPos == 0 && _readLen == 0, "Read buffer must be empty in FlushWrite!"); 968Debug.Assert(_buffer != null && _bufferSize >= _writePos, "Write buffer must be allocated and write position must be in the bounds of the buffer in FlushWrite!"); 979Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]"); 989Debug.Assert(_readPos < _readLen); 1043Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (3)
189Debug.Assert(value >= 0); 192Debug.Assert(!_fileHandle.TryGetCachedLength(out _), "If length can be cached (file opened for reading, not shared for writing), it should be impossible to modify file length"); 221Debug.Assert(r >= 0, $"RandomAccess.ReadAtOffset returned {r}.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (17)
239Debug.Assert(thisTask != null && thisTask._stream != null, 430Debug.Assert(minimumBytes <= buffer.Length); 515Debug.Assert(thisTask != null && thisTask._stream != null, 553Debug.Assert(readWriteTask != null); 554Debug.Assert(asyncWaiter != null); 559Debug.Assert(asyncWaiter.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 566Debug.Assert(t.IsCompletedSuccessfully, "The semaphore wait should always complete successfully."); 568Debug.Assert(rwt._stream != null, "Validates that this code isn't run a second time."); 576Debug.Assert(readWriteTask != null); 588Debug.Assert(_asyncActiveSemaphore != null, "Must have been initialized in order to get here."); 613Debug.Assert(writeTask.Status == TaskStatus.RanToCompletion); 662Debug.Assert(function != null); 663Debug.Assert(stream != null); 688Debug.Assert(completedTask is ReadWriteTask); 691Debug.Assert(callback != null); 707Debug.Assert(callback != null); 891Debug.Assert(minimumBytes <= buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (34)
125Debug.Assert(this is NullStreamReader); 491Debug.Assert(_byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?"); 500Debug.Assert(_byteLen >= 2, "Caller should've validated that at least 2 bytes were available."); 578Debug.Assert(_checkPreamble); 581Debug.Assert(_bytePos < preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?"); 595Debug.Assert(_bytePos <= preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 626Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 628Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 640Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 642Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 671Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 681Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 726Debug.Assert(charsRead == 0); 730Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 732Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 744Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 746Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 778Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 796Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer."); 841Debug.Assert(!charBufferSpan.IsEmpty, "ReadBuffer returned > 0 but didn't bump _charLen?"); 951Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?"); 1172Debug.Assert(n == 0); 1176Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1179Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1200Debug.Assert(n == 0); 1212Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1216Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1248Debug.Assert(n == 0); 1392Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?"); 1395Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class."); 1407Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?"); 1409Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! Bug in stream class."); 1438Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration."); 1448Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (3)
190Debug.Assert(GetType() == typeof(NullStreamWriter)); 281Debug.Assert(GetType() == typeof(StreamWriter)); 808Debug.Assert(n > 0, "StreamWriter::Write(char[], int, int) isn't making progress! This is most likely a race condition in user code.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (1)
49Debug.Assert(writers is { Length: > 0 });
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.cs (1)
129Debug.Assert(CoreNewLineStr == new string(CoreNewLine));
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
465Debug.Assert(intsWritten == 4);
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (3)
383Debug.Assert(pos + nInt >= 0, "_position + n >= 0"); // len is less than 2^63 -1. 436Debug.Assert(ex is not OperationCanceledException); 713Debug.Assert(ex is not OperationCanceledException);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Lazy.cs (3)
83Debug.Fail("internal constructor, this should never occur"); 93Debug.Assert(_exceptionDispatch != null, "execution path is invalid"); 119Debug.Fail("Invalid logic; State should always have a valid value");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
55Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 100Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 113Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (4)
42Debug.Assert(ucount < 2); 78Debug.Assert(ucount <= int.MaxValue); // this should fit into a signed int 84Debug.Assert(count > 0); 90Debug.Assert(charsWritten == count); // invariant case conversion should involve simple folding; preserve code unit count
src\runtime\src\libraries\System.Private.CoreLib\src\System\Math.cs (3)
908Debug.Assert(double.IsSubnormal(x)); 1642Debug.Assert(ret == result, $"Multiply overflow got: {ret}, expected: {result}"); 1685Debug.Assert(ret == left * right, $"Multiply overflow got: {ret}, expected: {left * right}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
210Debug.Assert(float.IsSubnormal(x));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Memory.cs (7)
123Debug.Assert(manager != null); 147Debug.Assert(manager != null); 163Debug.Assert((obj == null) 302Debug.Assert(tmpObject is T[]); 315Debug.Assert(tmpObject is MemoryManager<T>); 408Debug.Assert(tmpObject is T[]); 427Debug.Assert(tmpObject is MemoryManager<T>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (11)
2184Debug.Assert(lowInclusive is null || highInclusive is null); 5351Debug.Assert(startInclusive <= endExclusive); 5853Debug.Assert(index > 2); 5943Debug.Assert(treatAsSingleSeparator, "Should only ever be called as true; exists to differentiate from separators overload"); 5994Debug.Assert(_splitMode == SpanSplitEnumeratorMode.SearchValues, $"Unknown split mode: {_splitMode}"); 6325Debug.Assert(alignment > value.Length); 6409Debug.Assert(_hasCustomFormatter); 6410Debug.Assert(_provider != null); 6413Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 6428Debug.Assert(startingPos >= 0 && startingPos <= _pos); 6429Debug.Assert(alignment != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
74Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 126Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 157Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 208Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 380Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 418Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.Utf8.cs (1)
58Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.MinMax.cs (1)
345Debug.Assert(Vector128<T>.Count == 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.cs (3)
167Debug.Assert((uint)start <= span.Length); 499Debug.Assert((uint)start <= span.Length); 862Debug.Assert((uint)start <= span.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (2)
18Debug.Assert(!Rune.IsWhiteSpace(Rune.ReplacementChar)); 43Debug.Assert(!Rune.IsWhiteSpace(Rune.ReplacementChar));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (7)
622Debug.Assert(_numBytes > 0); 663Debug.Assert(_numChars > 0); 675Debug.Assert(s_lookupTable.Count == 253, $"There should be 253 HTML entities, but {nameof(s_lookupTable)} has {s_lookupTable.Count} of them."); 678Debug.Assert(s_lookupTable[ToUInt64Key("quot")] == '\x0022'); 679Debug.Assert(s_lookupTable[ToUInt64Key("alpha")] == '\x03b1'); 680Debug.Assert(s_lookupTable[ToUInt64Key("diams")] == '\x2666'); 978Debug.Assert(entity.Length <= 8);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (29)
371Debug.Assert(carry == 1); 372Debug.Assert(resultIndex == resultLength); 373Debug.Assert(unchecked((uint)resultLength) < MaxBlockCount); 392Debug.Assert(unchecked((uint)lhs._length) <= MaxBlockCount); 393Debug.Assert(unchecked((uint)rhs._length) <= MaxBlockCount); 407Debug.Assert(rhsLength == 0); 455Debug.Assert(!rhs.IsZero()); 591Debug.Assert(carry == t + 1); 597Debug.Assert(carry == 1); 762Debug.Assert(unchecked((uint)resultLength) < MaxBlockCount); 813Debug.Assert(unchecked((uint)maxResultLength) <= MaxBlockCount); 873Debug.Assert(unchecked((uint)result._length) <= MaxBlockCount); 922Debug.Assert((Pow10BigNumTableIndices[^1] + MaxBlockCount + 2) == Pow10BigNumTable.Length); 944Debug.Assert((pow10BigNumTableIndex + ((sizeof(BigInteger) + sizeof(uint) - 1) / sizeof(uint))) < Pow10BigNumTable.Length); 968Debug.Assert(lhsLength >= 0); 969Debug.Assert(rhsLength >= 0); 970Debug.Assert(lhsLength >= rhsLength); 990Debug.Assert(q <= 0xFFFFFFFF); 1023Debug.Assert(lhsLength >= 0); 1024Debug.Assert(rhsLength >= 0); 1025Debug.Assert(lhsLength >= rhsLength); 1026Debug.Assert(q <= uint.MaxValue); 1078Debug.Assert(unchecked((uint)length) < MaxBlockCount); 1096Debug.Assert((uint)index < _length); 1151Debug.Assert(unchecked((uint)length) < MaxBlockCount); 1230Debug.Assert(shift >= 0); 1249Debug.Assert(unchecked((uint)length) < MaxBlockCount); 1278Debug.Assert(unchecked((uint)length) < MaxBlockCount); 1381Debug.Assert(value >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.cs (14)
360Debug.Assert(number.Digits[0] != '0'); 361Debug.Assert(number.DigitsCount != 0); 424Debug.Assert(exponent > TDecimal.MaxAdjustedExponent); 479Debug.Assert(significand <= TDecimal.MaxSignificand); 770Debug.Assert(digitsRemain < number.DigitsCount); 771Debug.Assert(digitsRemain <= TDecimal.Precision); 772Debug.Assert(digitsRemain >= 0); 780Debug.Assert(exponent >= TDecimal.MinAdjustedExponent && exponent <= TDecimal.MaxAdjustedExponent); 784Debug.Assert(significand <= TDecimal.MaxSignificand); 1483Debug.Assert(shift > 0); 2435Debug.Assert(TValue.IsZero(highHigh)); 2436Debug.Assert(newHigh >= highLow); 2748Debug.Assert(TValue.IsZero(high)); 3523Debug.Assert(magnitude != UInt128.Zero);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DecimalIeee754.DiyFp128Conversions.cs (3)
31Debug.Assert(coefficient != UInt128.Zero); 83Debug.Assert(!TValue.IsZero(significand)); 156Debug.Assert(shift is > 0 and < 128);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.DiyFp.cs (5)
43Debug.Assert(TNumber.IsFinite(value)); 44Debug.Assert(value > TNumber.Zero); 92Debug.Assert(f != 0); 102Debug.Assert(e == other.e); 103Debug.Assert(f >= other.f);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (17)
25Debug.Assert(v > TNumber.Zero); 26Debug.Assert(TNumber.IsFinite(v)); 40Debug.Assert(mantissa != 0); 67Debug.Assert(buffer.Length > 0); 74Debug.Assert(mantissa != 0); 259Debug.Assert(cutoffNumber > 0); 265Debug.Assert(cutoffNumber >= 0); 283Debug.Assert(scale.GetLength() > 0); 292Debug.Assert(hiBlock != 0); 294Debug.Assert((hiBlockLog2 < 3) || (hiBlockLog2 > 27)); 314Debug.Assert(isSignificantDigits); 315Debug.Assert(digitExponent >= cutoffExponent); 324Debug.Assert(outputDigit < 10); 367Debug.Assert((cutoffNumber > 0) || ((cutoffNumber == 0) && !isSignificantDigits)); 377Debug.Assert(outputDigit < 10); 405Debug.Assert((0 < outputDigit) && (outputDigit < 10)); 492Debug.Assert(outputLen <= buffer.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (93)
349Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 414Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 419Debug.Assert(s is null || typeof(TChar) == typeof(char)); 441Debug.Assert(number.Kind == NumberBufferKind.DecimalIeee754); 546Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 592Debug.Assert(significand.Length < TDecimal.BufferLength); 766Debug.Assert((fmt | 0x20) == 'x'); 767Debug.Assert(TNumber.IsFinite(value)); 862Debug.Assert(bitsToDiscard > 0 && bitsToDiscard < 64); 958Debug.Assert(actualExponent >= 0); 978Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 983Debug.Assert(s is null || typeof(TChar) == typeof(char)); 1001Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1063Debug.Assert(((precision != -1) && (precision < TNumber.MaxRoundTripDigits)) || (TNumber.FloatToBits(value) == TNumber.FloatToBits(NumberToFloat<TNumber>(ref number)))); 1069Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 1083Debug.Assert(precision == TNumber.MaxPrecisionCustomFormat); 1091Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1092Debug.Assert(source != null); 1294Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1410Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1526Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1643Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1761Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1856Debug.Assert(value < 0); 1868Debug.Assert(p == buffer + sNegative.Length); 1874Debug.Assert(p == buffer); 1881Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1882Debug.Assert(value < 0); 1900Debug.Assert(p == buffer + sNegative.Length); 1906Debug.Assert(p == buffer); 1923Debug.Assert(p == buffer); 1930Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1948Debug.Assert(p == buffer); 1956Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1979Debug.Assert(p == buffer); 1986Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2004Debug.Assert(p == buffer); 2012Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2049Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2050Debug.Assert(value <= 99); 2065Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2066Debug.Assert(value <= 9999); 2094Debug.Assert(value < 10); 2095Debug.Assert(cur == ptr); 2102Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2131Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2165Debug.Assert(value < SmallNumberCacheLength); 2182Debug.Assert(p == buffer); 2198Debug.Assert(p == buffer); 2205Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2214Debug.Assert(p == buffer); 2225Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2238Debug.Assert(p == buffer); 2289Debug.Assert(value < 0); 2301Debug.Assert(p == buffer + sNegative.Length); 2307Debug.Assert(p == buffer); 2314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2315Debug.Assert(value < 0); 2333Debug.Assert(p == buffer + sNegative.Length); 2339Debug.Assert(p == buffer); 2356Debug.Assert(p == buffer); 2363Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2381Debug.Assert(p == buffer); 2391Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2428Debug.Assert(p == buffer); 2435Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2453Debug.Assert(p == buffer); 2463Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2524Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2563Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2608Debug.Assert(p == buffer); 2626Debug.Assert(p == buffer); 2633Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2643Debug.Assert(p == buffer); 2665Debug.Assert(p == buffer); 2715Debug.Assert(Int128.IsNegative(value)); 2729Debug.Assert(p == buffer + sNegative.Length); 2735Debug.Assert(p == buffer); 2742Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2743Debug.Assert(Int128.IsNegative(value)); 2763Debug.Assert(p == buffer + sNegative.Length); 2769Debug.Assert(p == buffer); 2788Debug.Assert(p == buffer); 2795Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2815Debug.Assert(p == buffer); 2851Debug.Assert(p == buffer); 2858Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2878Debug.Assert(p == buffer); 2934Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2946Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2970Debug.Assert(p == buffer); 2988Debug.Assert(p == buffer); 3006Debug.Assert(p == buffer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Grisu3.cs (39)
329Debug.Assert(v > TNumber.Zero); 330Debug.Assert(TNumber.IsFinite(v)); 349Debug.Assert((requestedDigits == -1) || (length == requestedDigits)); 364Debug.Assert(requestedDigits > 0); 371Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 372Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 416Debug.Assert(boundaryPlus.e == w.e); 423Debug.Assert(MinimalTargetExponent <= (w.e + tenMk.e + DiyFp.SignificandSize)); 424Debug.Assert(MaximalTargetExponent >= (w.e + tenMk.e + DiyFp.SignificandSize)); 437Debug.Assert(scaledW.e == (boundaryPlus.e + tenMk.e + DiyFp.SignificandSize)); 472Debug.Assert(number < (1U << (numberBits + 1))); 476Debug.Assert((uint)(exponentGuess) < SmallPowersOfTen.Length); 515Debug.Assert(MinimalTargetExponent <= w.e); 516Debug.Assert(w.e <= MaximalTargetExponent); 517Debug.Assert(MinimalTargetExponent >= -60); 518Debug.Assert(MaximalTargetExponent <= -32); 544Debug.Assert(buffer[0] == '\0'); 562Debug.Assert(digit <= 9); 598Debug.Assert(one.e >= MinimalTargetExponent); 599Debug.Assert(fractionals < one.f); 600Debug.Assert((ulong.MaxValue / 10) >= one.f); 609Debug.Assert(digit <= 9); 684Debug.Assert(low.e == w.e); 685Debug.Assert(w.e == high.e); 687Debug.Assert((low.f + 1) <= (high.f - 1)); 689Debug.Assert(MinimalTargetExponent <= w.e); 690Debug.Assert(w.e <= MaximalTargetExponent); 741Debug.Assert(digit <= 9); 780Debug.Assert(one.e >= MinimalTargetExponent); 781Debug.Assert(fractionals < one.f); 782Debug.Assert((ulong.MaxValue / 10) >= one.f); 793Debug.Assert(digit <= 9); 820Debug.Assert(CachedPowersSignificand.Length == CachedPowersBinaryExponent.Length); 821Debug.Assert(CachedPowersSignificand.Length == CachedPowersDecimalExponent.Length); 826Debug.Assert((uint)(index) < CachedPowersSignificand.Length); 828Debug.Assert(minExponent <= CachedPowersBinaryExponent[index]); 829Debug.Assert(CachedPowersBinaryExponent[index] <= maxExponent); 849Debug.Assert(rest < tenKappa); 995Debug.Assert(rest <= unsafeInterval);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (11)
830Debug.Assert((TFloat.DenormalMantissaMask & (1UL << TFloat.DenormalMantissaBits)) == 0); 832Debug.Assert((shiftedExponent & TFloat.DenormalMantissaMask) == 0); 833Debug.Assert((mantissa & ~TFloat.DenormalMantissaMask) == 0); 834Debug.Assert((shiftedExponent & ~(((1UL << TFloat.ExponentBits) - 1) << TFloat.DenormalMantissaBits)) == 0); // exponent fits in its place 896Debug.Assert((1 <= count) && (count <= 9)); 920Debug.Assert((1 <= count) && (count <= 19)); 976Debug.Assert(TFloat.DenormalMantissaBits <= FloatingPointMaxDenormalMantissaBits); 978Debug.Assert(number.DigitsPtr[0] != '0'); 980Debug.Assert(number.Scale <= FloatingPointMaxExponent); 981Debug.Assert(number.Scale >= FloatingPointMinExponent); 983Debug.Assert(number.DigitsCount != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (10)
207Debug.Assert(p != null); 316Debug.Assert((styles & ~(NumberStyles.Integer | AllowTrailingInvalidCharacters)) == 0, "Only handles subsets of Integer format"); 639Debug.Assert((styles & ~TParser.AllowedStyles) == 0, $"Only handles subsets of {TParser.AllowedStyles} format"); 926Debug.Assert((c == 0) || !hasZeroTail); 1113Debug.Assert(typeof(TChar) == typeof(byte)); 1132Debug.Assert(typeof(TChar) == typeof(byte)); 1150Debug.Assert(typeof(TChar) == typeof(byte)); 1166Debug.Assert(typeof(TChar) == typeof(byte)); 1497Debug.Assert(shiftRight >= 11, "shiftRight is always >= 11 for all IEEE float types (double: 11, float: 40, Half: 53, BFloat16: 56)"); 1563Debug.Assert(shiftRight > 0 && shiftRight <= 64);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Number.Rounding.cs (8)
23Debug.Assert(double.IsFinite(value)); 24Debug.Assert((uint)digits <= 19); 25Debug.Assert((uint)mode <= (uint)MidpointRounding.ToPositiveInfinity); 35Debug.Assert(float.IsFinite(value)); 36Debug.Assert((uint)digits <= 10); 37Debug.Assert((uint)mode <= (uint)MidpointRounding.ToPositiveInfinity); 299Debug.Assert(TNumber.IsFinite(value)); 300Debug.Assert(digits >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\BFloat16.cs (3)
549Debug.Assert((ushort)roundedValueBits == 0); // The value should be properly rounded 614Debug.Assert((ushort)roundedValueBits == 0); // The value should be properly rounded 1193Debug.Assert(IsSubnormal(x));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (20)
480Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 503Debug.Assert(Vector<double>.Count == Vector128<double>.Count); 611Debug.Assert(Vector<float>.Count == Vector128<float>.Count); 774Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 893Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 948Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 972Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 996Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1020Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1044Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1068Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1101Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1125Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1157Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1711Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 1949Debug.Assert(Vector<T>.Count == Vector128<T>.Count); 2991Debug.Assert(Vector<uint>.Count == Vector128<uint>.Count); 3017Debug.Assert(Vector<ulong>.Count == Vector128<ulong>.Count); 3809Debug.Assert((index >= 0) && (index < Vector<T>.Count)); 3817Debug.Assert((index >= 0) && (index < Vector<T>.Count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\OperatingSystem.cs (1)
108Debug.Fail($"Unknown platform {_platform}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\ParseNumbers.cs (2)
242Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16); 301Debug.Assert(radix == 2 || radix == 8 || radix == 10 || radix == 16);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Progress.cs (1)
35Debug.Assert(_synchronizationContext != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.CompatImpl.cs (4)
83Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 206Debug.Assert(minValue == maxValue || minValue + 1 == maxValue); 275Debug.Assert(_seedArray is null); 342Debug.Assert(_seedArray is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.cs (9)
52Debug.Assert(isThreadSafeRandom); 293Debug.Assert(!T.IsNegative(maxExclusive)); 339Debug.Assert(T.IsPositive(maxExclusive)); 380Debug.Assert(minValue < maxValue); 456Debug.Assert(chunk >= 1 && chunk <= 62); 462Debug.Assert(value >= T.Zero && value < T.ScaleB(T.One, significandBitLength)); 732Debug.Assert(result >= minInclusive && result < maxExclusive, $"Expected {minInclusive} <= {result} < {maxExclusive}"); 736Debug.Assert(result == minInclusive, $"Expected {minInclusive} == {result}"); 743Debug.Assert(result >= 0.0 && result < 1.0, $"Expected 0.0 <= {result} < 1.0");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (6)
93Debug.Assert(maxValue >= 0); 100Debug.Assert(minValue <= maxValue); 122Debug.Assert(maxValue >= 0); 129Debug.Assert(minValue <= maxValue); 160Debug.Assert(buffer.Length < sizeof(ulong)); 197Debug.Fail("Not used or called for this implementation.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Range.cs (2)
79Debug.Assert(formatted); 90Debug.Assert(formatted);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlyMemory.cs (5)
98Debug.Assert((obj == null) 224Debug.Assert(tmpObject is T[]); 237Debug.Assert(tmpObject is MemoryManager<T>); 323Debug.Assert(tmpObject is T[]); 342Debug.Assert(tmpObject is MemoryManager<T>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
128Debug.Assert(length >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\AssemblyName.cs (3)
340Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 341Debug.Assert(charsConsumed is 1 or 2); 365Debug.Assert(charsToCopy > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeBuilderInstantiation.cs (1)
33Debug.Assert(type != null, "this is only called from RuntimeType.MakeGenericType and TypeBuilder.MakeGenericType so 'type' cannot be null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\LocalVariableInfo.cs (1)
10public virtual Type LocalType { get { Debug.Fail("type must be set!"); return null!; } }
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
19Debug.Assert(unmodifiedType.IsFunctionPointer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
16Debug.Assert(unmodifiedType.IsGenericType);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedHasElementType.cs (1)
19Debug.Assert(unmodifiedType.HasElementType);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (2)
485Debug.Assert(genericParameter.IsGenericParameter); 523Debug.Assert(genericParameter.IsGenericParameter &&
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureArrayType.cs (2)
13Debug.Assert(rank > 0); 14Debug.Assert(rank == 1 || isMultiDim);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureConstructedGenericType.cs (3)
15Debug.Assert(genericTypeDefinition != null); 16Debug.Assert(typeArguments != null); 17Debug.Assert(genericTypeDefinition.IsGenericTypeDefinition);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureGenericParameterType.cs (1)
12Debug.Assert(position >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureHasElementType.cs (1)
12Debug.Assert(elementType != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\TypeNameResolver.cs (2)
18Debug.Fail("Expected to be unreachable"); 64Debug.Fail("Expected to be unreachable");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FileBasedResourceGroveler.cs (5)
20Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 29Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 64Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 65Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 88Debug.Assert(file != null, "file shouldn't be null; check caller");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (24)
31Debug.Assert(mediator != null, "mediator shouldn't be null; check caller"); 37Debug.Assert(culture != null, "culture shouldn't be null; check caller"); 38Debug.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller"); 90Debug.Assert(satellite != null, "satellite should not be null when stream is set"); 112Debug.Assert(_mediator.NeutralResourcesCulture != null); 128Debug.Assert(a != null, "assembly != null"); 154Debug.Fail(CoreLib.Name + "'s NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + attr.CultureName + "\" Exception: " + e); 168Debug.Assert(store != null, "I need a Stream!"); 208Debug.Assert(_mediator.MainAssembly != null); 225Debug.Assert(readerTypeName != null, "Reader Type name should be set"); 226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set"); 300Debug.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here."); 315Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 316Debug.Assert(fileName != null, "fileName shouldn't be null; check caller"); 328Debug.Assert(satellite != null, "satellite shouldn't be null; check caller"); 329Debug.Assert(name != null, "name shouldn't be null; check caller"); 357Debug.Assert(_mediator.MainAssembly != null); 392Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller"); 393Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller"); 419Debug.Assert(_mediator.MainAssembly != null); 427Debug.Assert(_mediator.NeutralResourcesCulture != null); 462Debug.Assert(_mediator.BaseName != null); 467Debug.Fail("Couldn't get " + CoreLib.Name + ResourceManager.ResFileExtension + " from " + CoreLib.Name + "'s assembly" + Environment.NewLineConst + Environment.NewLineConst + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug."); 473Debug.Assert(_mediator.MainAssembly != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (7)
252Debug.Assert(MainAssembly != null); 289Debug.Assert(_resourceSets != null); 410Debug.Assert(MainAssembly != null); 415Debug.Assert(localResourceSets != null); 430Debug.Assert(culture != null); 431Debug.Assert(_resourceSets != null); 556Debug.Assert(asmTypeName != null, "asmTypeName was unexpectedly null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.Core.cs (6)
29Debug.Assert(stream != null, "Need a stream!"); 30Debug.Assert(stream.CanRead, "Stream should be readable!"); 31Debug.Assert(resCache != null, "Need a Dictionary!"); 65Debug.Assert(_binaryFormatter is not null, "BinaryFormatter should be initialized or we should have thrown an exception!"); 163Debug.Assert(index >= 0 && index < _numResources, "Couldn't find data position within sorted data positions array!"); 166Debug.Assert(len >= 0 && len <= (int)_store.BaseStream.Length - dataPos + _dataSectionOffset, "Length was negative or outside the bounds of the file!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 191Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}"); 195Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 200Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 207Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}"); 211Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 216Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 252Debug.Assert(_store != null, "ResourceReader is closed!"); 333Debug.Assert(_store != null, "ResourceReader is closed!"); 334Debug.Assert(Monitor.IsEntered(this)); // uses _store 376Debug.Assert(_store != null, "ResourceReader is closed!"); 447Debug.Assert(_store != null, "ResourceReader is closed!"); 471Debug.Assert(_store != null, "ResourceReader is closed!"); 533Debug.Assert(_store != null, "ResourceReader is closed!"); 534Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 535Debug.Assert(Monitor.IsEntered(this)); // uses _store 555Debug.Assert(Monitor.IsEntered(this)); // uses _store 615Debug.Assert(_store != null, "ResourceReader is closed!"); 616Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 617Debug.Assert(Monitor.IsEntered(this)); // uses _store 637Debug.Assert(Monitor.IsEntered(this)); // uses _store 723Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 775Debug.Assert(!Monitor.IsEntered(this)); // only called during init 776Debug.Assert(_store != null, "ResourceReader is closed!"); 798Debug.Assert(!Monitor.IsEntered(this)); // only called during init 987Debug.Assert(Monitor.IsEntered(this)); // uses _store 995Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1026Debug.Assert(typeCode >= 0, "can't be negative"); 1027Debug.Assert(Monitor.IsEntered(this)); // uses _store 1031Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1037Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 1111Debug.Assert(!Monitor.IsEntered(_reader));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (2)
189Debug.Assert(_table != null); 190Debug.Assert(Reader != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
277Debug.Assert(!Monitor.IsEntered(reader));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.cs (4)
189Debug.Assert(obj is IValueTaskSource<T>); 229Debug.Assert(obj is IValueTaskSource); 313Debug.Assert(obj is IValueTaskSource); 380Debug.Assert(obj is IValueTaskSource<T>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (5)
72Debug.Fail("SetStateMachine should not be used."); 91Debug.Assert(stateMachine != null); 160Debug.Assert(continuation != null, "Expected non-null continuation"); 161Debug.Assert(invokeAction != null, "Expected non-null invokeAction"); 162Debug.Assert(innerTask != null, "Expected non-null innerTask");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncProfiler.cs (30)
104Debug.Assert(eventID == Entries[(byte)eventID - 1].EventId); 145Debug.Assert((byte)entries[i].EventId == i + 1, "EventManifest.Entries must be dense and ordered by ascending AsyncEventID starting at 1."); 240Debug.Assert(entries.Length <= byte.MaxValue); 539Debug.Assert(EventManifest.GetPayloadLengthFieldSize(eventID) == EventManifestEntry.PayloadLengthFieldSize.NoPayload); 551Debug.Assert(EventManifest.GetPayloadLengthFieldSize(eventID) == EventManifestEntry.PayloadLengthFieldSize.NoPayload); 557Debug.Assert(payloadLengthFieldSize == EventManifest.GetPayloadLengthFieldSize(eventID)); 612Debug.Assert(payloadLengthFieldSize == EventManifest.GetPayloadLengthFieldSize(eventID)); 656Debug.Assert(payloadLengthFieldSize == EventManifest.GetPayloadLengthFieldSize(eventID)); 662Debug.Assert(payloadLength <= byte.MaxValue); 667Debug.Assert(payloadLengthFieldSize == EventManifestEntry.PayloadLengthFieldSize.UShort); 668Debug.Assert(payloadLength <= ushort.MaxValue); 720Debug.Assert(InUse || BlockContext); 729Debug.Assert(!context.InUse); 743Debug.Assert(!context.InUse); 755Debug.Assert(context.InUse); 774Debug.Assert(info.Context == null || info.Context is AsyncThreadContext); 791Debug.Assert(!context.InUse); 806Debug.Assert(InUse || BlockContext); 815Debug.Assert(InUse || BlockContext); 983Debug.Assert(eventID == AsyncEventID.CreateRuntimeAsyncContext || eventID == AsyncEventID.CreateStateMachineAsyncContext); 1054Debug.Assert(eventID == AsyncEventID.ResumeRuntimeAsyncContext || eventID == AsyncEventID.ResumeStateMachineAsyncContext); 1088Debug.Assert(eventID == AsyncEventID.SuspendRuntimeAsyncContext || eventID == AsyncEventID.SuspendStateMachineAsyncContext); 1121Debug.Assert(eventID == AsyncEventID.CompleteRuntimeAsyncContext || eventID == AsyncEventID.CompleteStateMachineAsyncContext); 1142Debug.Assert(eventID == AsyncEventID.UnwindRuntimeAsyncException || eventID == AsyncEventID.UnwindStateMachineAsyncException); 1182Debug.Assert(eventID == AsyncEventID.ResumeRuntimeAsyncMethod || eventID == AsyncEventID.ResumeStateMachineAsyncMethod); 1188Debug.Assert(eventID == AsyncEventID.ResumeRuntimeAsyncMethod || eventID == AsyncEventID.ResumeStateMachineAsyncMethod); 1209Debug.Assert(eventID == AsyncEventID.CompleteRuntimeAsyncMethod || eventID == AsyncEventID.CompleteStateMachineAsyncMethod); 1484Debug.Assert(!context.InUse); 1625Debug.Assert(eventID == AsyncEventID.ResumeStateMachineAsyncCallstack || eventID == AsyncEventID.AppendStateMachineAsyncCallstack); 1776Debug.Assert(eventID == AsyncEventID.CreateRuntimeAsyncCallstack ||
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncStateMachineDispatcher.cs (1)
103Debug.Assert(dispatcherBox != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (1)
86Debug.Assert(m_task == null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (9)
426Debug.Assert(s is AsyncStateMachineBox<TStateMachine>); 438Debug.Assert((m_stateFlags & (int)InternalTaskOptions.PromiseTask) != 0, "Expected state flags to already be configured."); 439Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for ExecutionContext."); 478Debug.Assert(m_stateObject is null or ExecutionContext, $"Expected {nameof(m_stateObject)} to be null or an ExecutionContext but was {(m_stateObject is object o ? o.GetType().ToString() : "(null)")}."); 512Debug.Assert(!IsCompleted); 522Debug.Assert(StateMachine != null); 552Debug.Assert(IsCompleted); 618Debug.Assert(m_task == null); 663Debug.Assert(task != null, "Expected non-null task");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncVoidMethodBuilder.cs (1)
152Debug.Assert(context != null, "Must only be used with a non-null context.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\CastCache.cs (4)
39Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 40Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 217Debug.Assert(size > 1); 219Debug.Assert((size & (size - 1)) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (24)
399Debug.Assert(table != null, "Must provide a valid table"); 400Debug.Assert(Monitor.IsEntered(table._lock), "Must hold the _lock lock to construct the enumerator"); 401Debug.Assert(table._container != null, "Should not be used on a finalized table"); 402Debug.Assert(table._container.FirstFreeEntry > 0, "Should have returned an empty enumerator instead"); 406Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count before incrementing"); 433Debug.Assert(table._activeEnumeratorRefCount >= 0, "Should never have a negative ref count after decrementing"); 500Debug.Assert(Monitor.IsEntered(_lock)); 501Debug.Assert(key != null); // key already validated as non-null and not already in table. 569Debug.Assert(parent != null); 570Debug.Assert(BitOperations.IsPow2(InitialCapacity)); 589Debug.Assert(parent != null); 590Debug.Assert(buckets != null); 591Debug.Assert(entries != null); 592Debug.Assert(buckets.Length == entries.Length); 593Debug.Assert(BitOperations.IsPow2(buckets.Length)); 608Debug.Assert(key != null); // key already validated as non-null and not already in table. 609Debug.Assert(HasCapacity); 632Debug.Assert(key != null); // Key already validated as non-null 646Debug.Assert(key != null); // Key already validated as non-null. 725Debug.Assert(entryIndex >= 0 && entryIndex < _firstFreeEntry); 740Debug.Assert(entryIndex != -1); 756Debug.Assert(!HasCapacity); 797Debug.Assert(newSize >= _buckets.Length); 798Debug.Assert(BitOperations.IsPow2(newSize));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConfiguredValueTaskAwaitable.cs (6)
55Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 77Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 97Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 168Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 190Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 210Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ContractHelper.cs (1)
95Debug.ContractFailure(displayMessage, string.Empty, GetFailureMessage(kind, null));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (8)
525Debug.Assert(provider is not null); 526Debug.Assert(provider is not CultureInfo || provider.GetFormat(typeof(ICustomFormatter)) is null, "Expected CultureInfo to not provide a custom formatter"); 543Debug.Assert(_hasCustomFormatter); 544Debug.Assert(_provider != null); 547Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 560Debug.Assert(startingPos >= 0 && startingPos <= _pos); 561Debug.Assert(alignment != 0); 629Debug.Assert(additionalChars > _chars.Length - _pos);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\GenericCache.cs (4)
77Debug.Assert(BitOperations.PopCount((uint)initialCacheSize) == 1 && initialCacheSize > 1); 78Debug.Assert(BitOperations.PopCount((uint)maxCacheSize) == 1 && maxCacheSize >= initialCacheSize); 201Debug.Assert(size > 1); 203Debug.Assert((size & (size - 1)) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\PoolingAsyncValueTaskMethodBuilderT.cs (4)
387Debug.Assert(s_perCoreCache.Length == Environment.ProcessorCount, $"{s_perCoreCache.Length} != {Environment.ProcessorCount}"); 396Debug.Assert(transientValue is null || transientValue is StateMachineBox<TStateMachine>, 420Debug.Assert(s is StateMachineBox<TStateMachine>, $"Expected {nameof(StateMachineBox<TStateMachine>)}, got '{s}'"); 445Debug.Assert(StateMachine is not null, $"Null {nameof(StateMachine)}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
139Debug.Assert(srcET.IsPrimitiveType() && dstET.IsPrimitiveType());
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (16)
32Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 107Debug.Assert(taskCompleted, "With an infinite timeout, the task should have always completed."); 129Debug.Assert(task.IsCompleted, "Task must have been completed by now."); 130Debug.Assert(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully."); 144Debug.Fail("Throw() should have thrown"); 155Debug.Fail("Throw() should have thrown"); 160Debug.Fail("There should be exceptions if we're Faulted."); 198Debug.Assert(stateMachineBox != null); 245Debug.Assert(task != null, "Need a task to wait on"); 246Debug.Assert(continuation != null, "Need a continuation to invoke when the wait completes"); 326Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 394Debug.Assert(task != null, "Constructing an awaitable requires a task to await."); 422Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 423Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0); 504Debug.Assert(task != null, "Constructing an awaiter requires a task to await."); 505Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (2)
1004Debug.Assert(nuint.IsPow2(alignment)); 1016Debug.Assert(nuint.IsPow2(alignment));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ValueTaskAwaiter.cs (6)
50Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 70Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 89Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 140Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 160Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 179Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (1)
118Debug.Assert(box != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\GCSettings.cs (1)
49Debug.Assert(status == SetLatencyModeStatus.Succeeded, $"Unexpected return value '{status}' from {nameof(SetGCLatencyMode)}.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\CollectionsMarshal.cs (2)
30Debug.Assert(items is not null, "Implementation depends on List<T> always having an array."); 38Debug.Assert(typeof(T[]) == list._items.GetType(), "Implementation depends on List<T> always using a T[] and not U[] where U : T.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\ComWrappers.cs (12)
242Debug.Assert(GetComCount(RefCount) != 0); 261Debug.Assert(GetTrackerCount(RefCount) != 0); 310Debug.Assert(Holder is not null); 359Debug.Assert(GetComCount(RefCount) == 0 || HolderHandle == IntPtr.Zero); 685Debug.Assert(flags.HasFlag(CreateObjectFlags.TrackerObject)); 686Debug.Assert(trackerObject != IntPtr.Zero); 1263Debug.Assert(wrapper.ProxyHandle.Target == comProxy); 1264Debug.Assert(wrapper.IsUniqueInstance || _rcwCache.FindProxyForComInstance(wrapper.ExternalComObject) == comProxy); 1273Debug.Assert(registeredWrapper.ExternalComObject != wrapper.ExternalComObject); 1316Debug.Assert(wrapper.ProxyHandle.Target == comProxy); 1326Debug.Assert(rcwEntry.IsAllocated); 1433Debug.Assert(_lock.IsWriteLockHeld);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
141Debug.Assert(target is Array);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshal.Unix.cs (1)
38Debug.Assert(bufferLength >= (s.Length + 1) * SystemMaxDBCSCharSize, "Insufficient buffer length passed to StringToAnsiString");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
97Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\ComVariant.cs (3)
29Debug.Assert(variantSize == (4 * IntPtr.Size)); 33Debug.Assert(IntPtr.Size == 8); 34Debug.Assert(variantSize == (3 * IntPtr.Size));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (4)
339Debug.Assert(obj is MemoryManager<T>); 400Debug.Assert(length >= 0); 489Debug.Assert(offset >= 0); 490Debug.Assert(count >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\NativeLibrary.Unix.cs (1)
26Debug.Assert(handle != IntPtr.Zero);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (1)
45Debug.Assert(osArch >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (4)
114Debug.Assert(_fullyInitialized); 120Debug.Assert(_fullyInitialized); 153Debug.Assert(_fullyInitialized); 191Debug.Assert(_fullyInitialized || disposeOrFinalizeOperation);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\TrackerObjectManager.cs (2)
19Debug.Assert(referenceTracker != IntPtr.Zero); 42Debug.Assert(referenceTracker != IntPtr.Zero);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (3)
3404Debug.Assert(Vector128<T>.Count == Vector128<TIndex>.Count); 4338Debug.Assert((index >= 0) && (index < Vector128<T>.Count)); 4374Debug.Assert((index >= 0) && (index < Vector128<T>.Count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (2)
103Debug.Assert(Vector<T>.Count >= Vector128<T>.Count); 175Debug.Assert(Vector<T>.Count >= Vector128<T>.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (3)
3447Debug.Assert(Vector256<T>.Count == Vector256<TIndex>.Count); 4244Debug.Assert((index >= 0) && (index < Vector256<T>.Count)); 4293Debug.Assert((index >= 0) && (index < Vector256<T>.Count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (5)
370Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 387Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 3488Debug.Assert(Vector512<T>.Count == Vector512<TIndex>.Count); 4237Debug.Assert((index >= 0) && (index < Vector512<T>.Count)); 4286Debug.Assert((index >= 0) && (index < Vector512<T>.Count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (3)
3588Debug.Assert(Vector64<T>.Count == Vector64<TIndex>.Count); 4461Debug.Assert((index >= 0) && (index < Vector64<T>.Count)); 4497Debug.Assert((index >= 0) && (index < Vector64<T>.Count));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (25)
318Debug.Assert((typeof(T) != typeof(byte)) 671Debug.Assert(TVectorDouble.GreaterThanOrEqualAll(ax, ay)); 1568Debug.Assert((typeof(T) == typeof(sbyte)) 1655Debug.Assert((typeof(T) == typeof(sbyte)) 2591Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2609Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2623Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2652Debug.Assert(typeof(TVectorSingle) == typeof(Vector<float>)); 2657Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2662Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2667Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2672Debug.Assert(typeof(TVectorSingle) == typeof(Vector512<float>)); 2908Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2931Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 2949Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 2982Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 2987Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 2992Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2997Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 3002Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 3022Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 3027Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 3032Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 3037Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 3042Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (4)
122Debug.Assert(IsCollectible); 124Debug.Assert(_state != InternalState.Unloading); 280Debug.Assert(allContexts != null, "Creating the default context should have initialized the contexts collection."); 886Debug.Assert(assemblyName.CultureName?.Length > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\MemoryFailPoint.cs (2)
270Debug.Fail("Fell through switch statement!"); 337Debug.Assert(Volatile.Read(ref s_failPointReservedMemory) >= 0, "Process-wide MemoryFailPoint reserved memory was negative!");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (14)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count"); 267Debug.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null"); 268Debug.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null"); 269Debug.Assert(type is not null, "[SerializationInfo.UpdateValue]type!=null"); 310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 314Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length"); 328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length"); 331Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null"); 349Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null"); 355Debug.Assert(type is not null, "[SerializationInfo.GetValue]type ==null"); 356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type"); 367Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.SerializationGuard.cs (1)
46Debug.Assert(!string.IsNullOrWhiteSpace(switchSuffix));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfoEnumerator.cs (7)
38Debug.Assert(members != null, "[SerializationInfoEnumerator.ctor]members!=null"); 39Debug.Assert(info != null, "[SerializationInfoEnumerator.ctor]info!=null"); 40Debug.Assert(types != null, "[SerializationInfoEnumerator.ctor]types!=null"); 41Debug.Assert(numItems >= 0, "[SerializationInfoEnumerator.ctor]numItems>=0"); 42Debug.Assert(members.Length >= numItems, "[SerializationInfoEnumerator.ctor]members.Length>=numItems"); 43Debug.Assert(info.Length >= numItems, "[SerializationInfoEnumerator.ctor]info.Length>=numItems"); 44Debug.Assert(types.Length >= numItems, "[SerializationInfoEnumerator.ctor]types.Length>=numItems");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\FrameworkName.cs (4)
26Debug.Assert(_identifier != null); 35Debug.Assert(_version != null); 44Debug.Assert(_profile != null); 57Debug.Assert(_fullName != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Versioning\VersioningHelper.cs (1)
166Debug.Assert(requires == SxSRequirements.None, "Computed a strange set of required resource scoping. It's probably wrong.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
316Debug.Assert((sign == 0) || (sign == -1)); 369Debug.Assert((sign == 0) || (sign == -1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1CharPackedIgnoreCaseSearchValues.cs (1)
20Debug.Assert((value | 0x20) == value);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2CharPackedIgnoreCaseSearchValues.cs (2)
23Debug.Assert((value0 | 0x20) == value0 && char.IsAscii(value0)); 24Debug.Assert((value1 | 0x20) == value1 && char.IsAscii(value1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 3);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 4);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 5);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiByteSearchValues.cs (1)
23Debug.Assert(Ascii.IsValid(values) || (TUniqueLowNibble.Value && (AdvSimd.IsSupported || PackedSimd.IsSupported)));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (2)
24Debug.Assert(Ascii.IsValid(values) || (TUniqueLowNibble.Value && (AdvSimd.IsSupported || PackedSimd.IsSupported))); 25Debug.Assert(!values.ContainsAnyInRange((char)byte.MaxValue, char.MaxValue));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (1)
17Debug.Assert(maxInclusive <= char.MaxValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
28Debug.Assert(c < 256); 45Debug.Assert(b < 256);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (18)
39Debug.Assert((uint)value <= 127); 77Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 102Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 144Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 212Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 239Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 346Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 399Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 478Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 529Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector."); 628Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 677Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 753Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 802Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 900Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 952Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong."); 1028Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128."); 1080Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (17)
429Debug.Assert(Avx512Vbmi.VL.IsSupported); 430Debug.Assert(searchSpaceLength >= 16); 473Debug.Assert(searchSpaceLength is > 32 and <= 64); 490Debug.Assert(searchSpaceLength is >= 16 and <= 32); 514Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported); 515Debug.Assert(searchSpaceLength >= 16); 605Debug.Assert(Avx512Vbmi.VL.IsSupported); 606Debug.Assert(searchSpaceLength >= 16); 622Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 64 * sizeof(char)); 650Debug.Assert(searchSpaceLength is > 32 and <= 64); 651Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 668Debug.Assert(searchSpaceLength is >= 16 and <= 32); 669Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char)); 693Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported || PackedSimd.IsSupported); 694Debug.Assert(searchSpaceLength >= 16); 712Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 754Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (18)
35Debug.Assert(!values.IsEmpty); 57Debug.Assert((IntPtr)valuesPtr != IntPtr.Zero); 65Debug.Assert(_hashEntries is not null); 76Debug.Assert(_hashEntries is not null); 77Debug.Assert((IntPtr)_slowContainsValuesPtr == IntPtr.Zero); 86Debug.Assert(offset < (ulong)hashEntries.Length); 94Debug.Assert(_hashEntries is null); 95Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 106Debug.Assert(_hashEntries is null); 107Debug.Assert((IntPtr)_slowContainsValuesPtr != IntPtr.Zero); 131Debug.Assert(maxInclusive <= char.MaxValue); 167Debug.Assert(modulus < MaxModulus); 211Debug.Assert(divisor > 0); 212Debug.Assert(divisor <= MaxModulus); 221Debug.Assert(multiplier == GetFastModMultiplier(divisor)); 225Debug.Assert(result == (value % divisor)); 239Debug.Assert(state._hashEntries is not null); 279Debug.Assert(state._hashEntries is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (8)
22Debug.Assert(IndexOfAnyAsciiSearcher.IsVectorizationSupported); 23Debug.Assert(values.ContainsAnyInRange((char)0, (char)127)); 53Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 57Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 66Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0), 150Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 156Debug.Assert(_inverseAsciiState.Lookup.Contains(0), "The inverse bitmap did not contain a 0."); 165Debug.Assert(!(Ssse3.IsSupported || PackedSimd.IsSupported) || !_inverseAsciiState.Lookup.Contains(0),
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
55Debug.Assert(values.Length is 2 or 3 or 4 or 5);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (11)
122Debug.Assert(!TBucketized.Value); 123Debug.Assert(n is 2 or 3); 138Debug.Assert(TBucketized.Value); 139Debug.Assert(n is 2 or 3); 256Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN2); 308Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN2); 434Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN3); 489Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN3); 566Debug.Assert(bucket is not null); 611Debug.Assert(bucket is not null); 656Debug.Assert(bucket is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasick.cs (22)
79Debug.Assert(typeof(TCaseSensitivity) != typeof(StringSearchValuesHelper.CaseInsensitiveUnicode)); 87Debug.Assert(nodeIndex == 0); 122Debug.Assert((uint)i < (uint)span.Length); 127Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 135Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 140Debug.Assert(result == -1 || result >= i + 1 - matchLength); 168Debug.Assert(nodeIndex == -1); 169Debug.Assert(result >= 0); 231Debug.Assert((uint)i < (uint)span.Length); 258Debug.Assert(lowSurrogateUpper != LowSurrogateNotSet); 269Debug.Assert(c == destination[0]); 270Debug.Assert(lowSurrogateUpper == LowSurrogateNotSet || lowSurrogateUpper == destination[1]); 276Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 284Debug.Assert((uint)nodeIndex < (uint)_nodes.Length); 289Debug.Assert(result == -1 || result >= i + 1 - matchLength); 317Debug.Assert(nodeIndex == -1); 318Debug.Assert(result >= 0); 331Debug.Assert(char.IsHighSurrogate(h)); 332Debug.Assert(char.IsLowSurrogate(l)); 338Debug.Assert(written == 2); 343Debug.Assert(char.IsHighSurrogate(hr)); 344Debug.Assert(char.IsLowSurrogate(lr));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (4)
24Debug.Assert(!values.IsEmpty); 25Debug.Assert(!string.IsNullOrEmpty(values[0])); 31Debug.Assert(values[i - 1].Length <= values[i].Length); 44Debug.Assert(_nodes[0].MatchLength == 0, "The root node shouldn't have a match.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickNode.cs (3)
40Debug.Assert(children is int[] || children is Dictionary<char, int>); 96Debug.Assert(ReferenceEquals(_children, EmptyChildrenSentinel)); 139Debug.Assert(children.Count > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\CharacterFrequencyHelper.cs (5)
34Debug.Assert(value.Length > 1); 35Debug.Assert(!ignoreCase || char.IsAscii(value[0])); 43Debug.Assert(!ignoreCase); 74Debug.Assert(ch2Offset != 0); 75Debug.Assert(ch2Offset != ch3Offset);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (7)
42Debug.Assert(values.Length <= MaxValues); 50Debug.Assert(minimumLength > 1); 111Debug.Assert(typeof(TCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 112Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled short inputs."); 128Debug.Assert(_buckets is not null); 164Debug.Assert(span.Length <= MaxInputLength, "Teddy should have handled long inputs."); 175Debug.Assert(charsWritten == upperCase.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (20)
21Debug.Assert(searchSpaceLength >= 0); 29Debug.Assert(offset >= 0); 32Debug.Assert(currentByteOffset >= 0); 33Debug.Assert((currentByteOffset & 1) == 0); 37Debug.Assert(offset <= availableLength); 59Debug.Assert(lengthRemaining > 0); 87Debug.Assert(typeof(TCaseSensitivity) == typeof(CaseInsensitiveUnicode)); 121Debug.Assert(value.Length >= 2); 163Debug.Assert(value.Length is 2 or 3); 186Debug.Assert(Value.Length is >= 9 and <= 16); 187Debug.Assert(ToUpperMask256 == default); 208Debug.Assert(Value.Length is >= 9 and <= 16); 209Debug.Assert(ToUpperMask256 != default); 273Debug.Assert(state.Value.Length is 2 or 3); 283Debug.Assert(matchStart == state.Value[0] || (matchStart & 0xFF) == state.Value[0]); 295Debug.Assert(matchStart == state.Value[0], "This should only be called after the first character has been checked"); 341Debug.Assert(state.Value.Length is 2 or 3); 352Debug.Assert(TransformInput((char)(matchStart & 0xFF)) == state.Value[0]); 364Debug.Assert(TransformInput(matchStart) == state.Value[0], "This should only be called after the first character has been checked"); 433Debug.Assert(state.Value.Length is 2 or 3);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (9)
17Debug.Assert(values.Length <= 8); 29Debug.Assert(char.IsAscii(c)); 50Debug.Assert(valueBuckets.Length <= 8); 62Debug.Assert(char.IsAscii(c)); 77Debug.Assert(bucketCount == 8, "This may change if we end up supporting the 'fat Teddy' variant."); 78Debug.Assert(values.Length > bucketCount, "Should be using a non-bucketized implementation."); 79Debug.Assert(values.Length <= RabinKarp.MaxValues); 97Debug.Assert(char.IsAscii(value[j])); 129Debug.Assert(count == strings.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesPackedThreeChars.cs (4)
52Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported); 55Debug.Assert(value.Length > 1); 56Debug.Assert(ch3Offset == 0 || ch3Offset > ch2Offset); 57Debug.Assert(value[0] <= byte.MaxValue && value[ch2Offset] <= byte.MaxValue && value[ch3Offset] <= byte.MaxValue);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (5)
49Debug.Assert(value.Length > 1); 50Debug.Assert(ch3Offset == 0 || ch3Offset > ch2Offset); 61Debug.Assert(char.IsAscii((char)_ch1) && char.IsAscii((char)_ch2) && char.IsAscii((char)_ch3)); 333Debug.Assert(bitPos % 2 == 0); 361Debug.Assert(bitPos % 2 == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (12)
62Debug.Assert(i == normalizedValues.Length); 97Debug.Assert(newCount <= values.Length - unreachableValues.Count); 98Debug.Assert(newCount > 0); 241Debug.Assert(!(asciiStartLettersOnly && asciiStartUnaffectedByCaseConversion)); 281Debug.Assert(typeof(TStartCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 282Debug.Assert(values.Length > 1); 283Debug.Assert(n is 2 or 3); 306Debug.Assert(n is 2 or 3); 307Debug.Assert(values.Length < maxValues); 318Debug.Assert(char.IsAscii(c)); 329Debug.Assert(newValuesCount > values.Length, "Shouldn't have been called if there were no letters present"); 362Debug.Assert(newValuesCount == newValues.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValuesBase.cs (2)
30Debug.Assert(_uniqueValues is not null, "ContainsCore should be overridden if uniqueValues weren't provided."); 36Debug.Assert(_uniqueValues is not null, "GetValues should be overridden if uniqueValues weren't provided.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (11)
56Debug.Assert(str._buffer != null, "Expected other SecureString's buffer to be non-null"); 57Debug.Assert(str._encrypted, "Expected to be used only on encrypted SecureStrings"); 60Debug.Assert(_buffer != null); 83Debug.Assert(_buffer != null); 103Debug.Assert(_buffer != null); 133Debug.Assert(_buffer != null); 184Debug.Assert(_buffer != null); 231Debug.Assert(_buffer != null); 263Debug.Assert(_buffer != null); 428Debug.Assert(byteLength >= 0); 443Debug.Assert(bytesLength <= destination.ByteLength);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Security\SecurityElement.cs (8)
87Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 176Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 237Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 306Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 317Debug.Fail("Unable to find escape sequence for this character"); 344Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 417Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly"); 481Debug.Assert(iMax % 2 == 0, "Odd number of strings means the attr/value pairs were not added correctly");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Single.cs (7)
296Debug.Assert(IsNaN(value)); 1606Debug.Assert(IsNaN(x) || IsNaN(y)); 1639Debug.Assert(n == 0); 1678Debug.Assert(IsPositiveInfinity(x)); 1683Debug.Assert(IsNegativeInfinity(x)); 1723Debug.Assert(IsPositiveInfinity(x)); 1728Debug.Assert(IsNegativeInfinity(x));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
133Debug.Assert(length >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Byte.cs (24)
18Debug.Assert(searchSpaceLength >= 0); 19Debug.Assert(valueLength >= 0); 83Debug.Assert(offset >= 0); 85Debug.Assert(offset + ch1ch2Distance + Vector512<byte>.Count <= searchSpaceLength); 144Debug.Assert(offset >= 0); 146Debug.Assert(offset + ch1ch2Distance + Vector256<byte>.Count <= searchSpaceLength); 205Debug.Assert(offset >= 0); 207Debug.Assert(offset + ch1ch2Distance + Vector128<byte>.Count <= searchSpaceLength); 254Debug.Assert(searchSpaceLength >= 0); 255Debug.Assert(valueLength >= 0); 276Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 828Debug.Assert(lengthToExamine < length); 858Debug.Assert(lengthToExamine < length); 888Debug.Assert(lengthToExamine < length); 918Debug.Assert(length <= (nuint)sizeof(nuint) * 2); 929Debug.Assert(length >= (nuint)sizeof(nuint)); 934Debug.Assert(lengthToExamine < length); 965Debug.Assert(firstLength >= 0); 966Debug.Assert(secondLength >= 0); 1014Debug.Assert(result != 0); 1055Debug.Assert(result != 0); 1092Debug.Assert(result != 0); 1202Debug.Assert(length >= (uint)Vector128<byte>.Count); 1301Debug.Assert(length > 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.ByteMemOps.cs (14)
57Debug.Assert(len > 16 && len <= 64); 98Debug.Assert(len > 16 && len <= 64); 116Debug.Assert(len >= 8 && len <= 16); 132Debug.Assert(len >= 4 && len < 8); 139Debug.Assert(len < 4); 173Debug.Assert(len > 64 && len <= MemmoveNativeThreshold); 229Debug.Assert(len > 0); 240Debug.Assert(len > 0); 284Debug.Assert(len > 16 && len <= 64); 325Debug.Assert(len > 16 && len <= 64); 343Debug.Assert(len >= 8 && len <= 16); 359Debug.Assert(len >= 4 && len < 8); 366Debug.Assert(len < 4); 395Debug.Assert(len > 64 && len <= ZeroMemoryNativeThreshold);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (20)
17Debug.Assert(searchSpaceLength >= 0); 18Debug.Assert(valueLength >= 0); 90Debug.Assert(offset + ch1ch2Distance + Vector512<ushort>.Count <= searchSpaceLength); 157Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= searchSpaceLength); 219Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= searchSpaceLength); 267Debug.Assert(searchSpaceLength >= 0); 268Debug.Assert(valueLength >= 0); 289Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 468Debug.Assert(firstLength >= 0); 469Debug.Assert(secondLength >= 0); 586Debug.Assert(length - offset >= Vector128<ushort>.Count); 647Debug.Assert(lengthToExamine >= Vector512<ushort>.Count); 676Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 699Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 730Debug.Assert(length - offset >= Vector128<ushort>.Count); 764Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 787Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 818Debug.Assert(length - offset >= Vector128<ushort>.Count); 825Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 890Debug.Assert(length > 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (9)
15Debug.Assert(Unsafe.IsOpportunisticallyAligned(ref ip, (uint)sizeof(IntPtr)), "Should've been aligned on natural word boundary."); 33Debug.Assert(pointerSizeLength <= 7); 66Debug.Assert(pointerSizeLength >= 4); 75Debug.Assert(pointerSizeLength >= 2); 82Debug.Assert(pointerSizeLength >= 1); 90Debug.Assert(length > 1); 195Debug.Assert(length > 1); 301Debug.Assert(length > 1); 333Debug.Assert(length > 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Packed.cs (24)
24Debug.Assert(PackedIndexOfIsSupported); 25Debug.Assert(RuntimeHelpers.IsBitwiseEquatable<T>()); 26Debug.Assert(sizeof(T) == sizeof(ushort)); 65Debug.Assert((value | 0x20) == value); 74Debug.Assert((value | 0x20) == value); 83Debug.Assert((value0 | 0x20) == value0); 84Debug.Assert((value1 | 0x20) == value1); 93Debug.Assert((value0 | 0x20) == value0); 94Debug.Assert((value1 | 0x20) == value1); 112Debug.Assert(CanUsePackedIndexOf(value)); 316Debug.Assert(CanUsePackedIndexOf(value)); 519Debug.Assert(CanUsePackedIndexOf(value0)); 520Debug.Assert(CanUsePackedIndexOf(value1)); 732Debug.Assert(CanUsePackedIndexOf(value0)); 733Debug.Assert(CanUsePackedIndexOf(value1)); 734Debug.Assert(CanUsePackedIndexOf(value2)); 950Debug.Assert(CanUsePackedIndexOf(lowInclusive)); 951Debug.Assert(CanUsePackedIndexOf((short)(lowInclusive + rangeInclusive))); 952Debug.Assert(rangeInclusive >= 0); 1145Debug.Assert(Avx512BW.IsSupported); 1157Debug.Assert(Avx2.IsSupported); 1169Debug.Assert(Sse2.IsSupported); 1303Debug.Assert(Avx2.IsSupported); 1315Debug.Assert(Avx512F.IsSupported);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (63)
86Debug.Fail("Vector<T> is unexpected size."); 98Debug.Fail("Vector<T> is unexpected size."); 104Debug.Fail("Vector<T> is greater than 512 bits in size?"); 207Debug.Assert(searchSpaceLength >= 0); 208Debug.Assert(valueLength >= 0); 220Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 249Debug.Assert(length >= 0); 255Debug.Assert(value is not null); 320Debug.Assert(length >= 0); 325Debug.Assert(value is not null); 419Debug.Assert(length >= 0); 425Debug.Assert(value0 is not null && value1 is not null); 544Debug.Assert(length >= 0); 550Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 669Debug.Assert(searchSpaceLength >= 0); 670Debug.Assert(valueLength >= 0); 738Debug.Assert(searchSpaceLength >= 0); 739Debug.Assert(valueLength >= 0); 757Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 784Debug.Assert(length >= 0); 788Debug.Assert(value is not null); 876Debug.Assert(length >= 0); 881Debug.Assert(value0 is not null && value1 is not null); 1000Debug.Assert(length >= 0); 1005Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 1124Debug.Assert(searchSpaceLength >= 0); 1125Debug.Assert(valueLength >= 0); 1179Debug.Assert(length >= 0, "Expected non-negative length"); 1194Debug.Assert(length >= 0, "Expected non-negative length"); 1209Debug.Assert(length >= 0, "Expected non-negative length"); 1225Debug.Assert(length >= 0, "Expected non-negative length"); 1241Debug.Assert(length >= 0, "Expected non-negative length"); 1259Debug.Assert(length >= 0, "Expected non-negative length"); 1277Debug.Assert(length >= 0, "Expected non-negative length"); 1296Debug.Assert(length >= 0, "Expected non-negative length"); 1315Debug.Assert(length >= 0); 1442Debug.Assert(firstLength >= 0); 1443Debug.Assert(secondLength >= 0); 1474Debug.Assert(length >= 0, "Expected non-negative length"); 1475Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1661Debug.Assert(length >= 0, "Expected non-negative length"); 1662Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 1895Debug.Assert(length >= 0, "Expected non-negative length"); 1896Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2136Debug.Assert(length >= 0, "Expected non-negative length"); 2137Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2362Debug.Assert(length >= 0, "Expected non-negative length"); 2363Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2535Debug.Assert(length >= 0, "Expected non-negative length"); 2536Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 2711Debug.Assert(length >= 0, "Expected non-negative length"); 2712Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types"); 2855Debug.Assert(length >= 0, "Expected non-negative length"); 2856Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3072Debug.Assert(length >= 0, "Expected non-negative length"); 3073Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3289Debug.Assert(length >= 0, "Expected non-negative length"); 3290Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types"); 3436Debug.Assert(oldValue is not null); 3466Debug.Assert(Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported, "Vector128 is not HW-accelerated or not supported"); 3523Debug.Assert(Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported, "Vector512 is not HW-accelerated or not supported"); 3561Debug.Assert(length >= 0, "Expected non-negative length"); 3562Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
26Debug.Fail("SR::GetResourceString with empty resourceKey. Bug in caller, or weird recursive loading problem?"); 97Debug.Assert(s != null, $"Looking up resource '{key}' failed. Was your resource name misspelled? Did you rebuild after adding a resource?");
src\runtime\src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (5)
163Debug.Assert(Path.IsPathFullyQualified(startupHook.Path)); 168Debug.Assert(startupHook.AssemblyName != null); 184Debug.Assert(assembly != null); 210Debug.Assert(initializeMethod == null); 222Debug.Assert(initializeMethod != null &&
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (20)
26Debug.Assert(strA != null); 27Debug.Assert(strB != null); 28Debug.Assert(strA.Length == strB.Length); 39Debug.Assert(strA != null); 40Debug.Assert(strB != null); 41Debug.Assert(indexA >= 0 && indexB >= 0); 42Debug.Assert(countA >= 0 && countB >= 0); 43Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length); 52Debug.Assert(strA.Length == strB.Length); 59Debug.Assert(strA != null); 60Debug.Assert(strB != null); 320Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier 741Debug.Fail("Should not reach this point."); 772Debug.Assert(src[Length] == '\0', "src[Length] == '\\0'"); 773Debug.Assert(((int)src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 869Debug.Assert(src[Length] == '\0', "src[this.Length] == '\\0'"); 870Debug.Assert(((int) src) % 4 == 0, "Managed string should start at 4 bytes boundary"); 1006Debug.Assert(charsWritten == length); 1179Debug.Assert((uint)comparisonType <= (uint)StringComparison.OrdinalIgnoreCase); 1199Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.cs (6)
229Debug.Assert(numBytes >= 0); 230Debug.Assert(pb <= (pb + numBytes)); 540Debug.Assert(bytes != null); 541Debug.Assert(byteLength >= 0); 545Debug.Assert(stringLength >= 0); 556Debug.Assert(stringLength == doubleCheck,
src\runtime\src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (25)
58Debug.Assert(char.IsWhiteSpace((char)i) == sv.Contains((char)i)); 69Debug.Assert(dest != null); 70Debug.Assert(src != null); 71Debug.Assert(src.Length <= dest.Length - destPos); 149Debug.Assert(s != null); 150Debug.Assert(position <= totalLength - s.Length, "We didn't allocate enough space for the result string!"); 703Debug.Assert(index > 2); 1241Debug.Assert(!oldValue.IsEmpty); 1242Debug.Assert(compareInfo != null); 1432Debug.Assert(indices.Length > 0); 1463Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx); 1899Debug.Assert(count >= 0); 1946Debug.Assert(count >= 2); 1983Debug.Assert(count >= 2); 2036Debug.Assert(arrIndex < maxItems); 2122Debug.Assert(sourceSpan.Length >= Vector128<ushort>.Count*2); 2413Debug.Fail("We should not be able to reach this point of MakeSeparatorListVectorized."); 2424Debug.Assert(!separator.IsEmpty, "Empty separator"); 2452Debug.Assert(!separators.IsEmpty, "Zero separators"); 2531Debug.Assert(startIndex == 0); 2555Debug.Assert(startIndex >= 0 && startIndex <= this.Length, "StartIndex is out of range!"); 2556Debug.Assert(length >= 0 && startIndex <= this.Length - length, "length is out of range!"); 2638Debug.Assert(Length > 0); 2934Debug.Assert(trimChars != null); 2935Debug.Assert(trimCharsLength > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (10)
186Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 200Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 212Debug.Assert(typeof(TFrom) == typeof(byte) || typeof(TFrom) == typeof(ushort)); 213Debug.Assert(typeof(TTo) == typeof(byte) || typeof(TTo) == typeof(ushort)); 214Debug.Assert(typeof(TCasing) == typeof(ToUpperConversion) || typeof(TCasing) == typeof(ToLowerConversion)); 269Debug.Assert((nuint)(&pDest[i]) % expectedWriteAlignment == 0, "Destination buffer wasn't properly aligned!"); 276Debug.Assert(i <= elementCount, "We overran a buffer somewhere."); 347Debug.Assert(Vector128.IsHardwareAccelerated); 406Debug.Assert(Vector128.IsHardwareAccelerated); 499Debug.Fail("Unknown types.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.cs (3)
50Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 146Debug.Assert((int)i > 3 * Vector256<T>.Count); 198Debug.Assert((int)i > 3 * Vector128<T>.Count);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (6)
47Debug.Assert( 71Debug.Assert(Vector512<TLeft>.Count == Vector512<TRight>.Count 101Debug.Assert(Vector256<TLeft>.Count == Vector256<TRight>.Count 201Debug.Assert( 546Debug.Assert(Vector256<byte>.Count == Vector256<ushort>.Count * 2); 571Debug.Assert(Vector512<byte>.Count == Vector512<ushort>.Count * 2);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
40Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 75Debug.Assert(numElementsActuallyConverted <= numElementsToConvert);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (87)
57Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 84Debug.Assert((mask != 0) ? index < 16 : index >= 16); 157Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte."); 158Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 161Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 165Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 193Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte."); 194Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 197Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 201Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 229Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte."); 230Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 233Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 237Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 338Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 353Debug.Assert(sseMask != uint.MaxValue); 354Debug.Assert(Sse2.IsSupported); 361Debug.Assert(advSimdIndex != uint.MaxValue); 362Debug.Assert(AdvSimd.IsSupported); 373Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required."); 374Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian."); 432Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte."); 433Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 601Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data."); 606Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data."); 619Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 630Debug.Assert(bufferLength < SizeOfVector128); 761Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 782Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char."); 783Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 786Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 790Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned."); 818Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char."); 819Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 822Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 826Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned."); 853Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 854Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 857Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 861Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned."); 940Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 945Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input."); 974Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller."); 975Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian."); 991Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 1021Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 1022Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 1100Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 1143Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data."); 1168Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data."); 1186Debug.Assert(bufferLength < SizeOfVector128InChars); 1271Debug.Assert(AllCharsInUInt64AreAscii(value)); 1326Debug.Assert(AllCharsInUInt32AreAscii(value)); 1392Debug.Assert(currentOffset <= elementCount); 1508Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input."); 1605Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1616Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1640Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1658Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1726Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required."); 1727Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1728Debug.Assert(elementCount >= 2 * SizeOfVector128); 1779Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 1780Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1781Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 1799Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 1822Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 1844Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required."); 1845Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1846Debug.Assert(elementCount >= 2 * Vector256.Size); 1896Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector."); 1897Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 1898Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector."); 1916Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned."); 1939Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned."); 1961Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required."); 1962Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian."); 1963Debug.Assert(elementCount >= 2 * Vector512.Size); 2014Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector."); 2015Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 2016Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector."); 2034Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned."); 2057Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned."); 2095Debug.Assert(currentOffset <= elementCount); 2167Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input."); 2266Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>)); 2280Debug.Assert(AllBytesInUInt32AreAscii(value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.Helpers.cs (1)
49Debug.Assert(!AllBytesInUInt32AreAscii(value), "Caller shouldn't provide an all-ASCII value.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (14)
157Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 158Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 350Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 351Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 352Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 353Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 409Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?"); 499Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 500Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 641Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 642Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 643Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 644Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 697Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (9)
35Debug.Assert(format is not null); 39Debug.Assert(segments is not null); 46Debug.Assert((segment.Literal is not null) ^ (segment.ArgIndex >= 0), "The segment should represent a literal or a format hole, but not both."); 60Debug.Assert(literalLength >= 0); 61Debug.Assert(formattedCount >= 0); 62Debug.Assert(formattedCount == 0 || argsRequired > 0); 184Debug.Assert(format[pos - 1] == '{'); 185Debug.Assert(ch != '{'); 316Debug.Assert(format[pos] == '}');
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Decoder.cs (1)
179Debug.Assert(result <= charCount, "Returned more chars than we have space for");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderFallback.cs (2)
109Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 164Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (13)
77Debug.Assert(_encoding is not null); 130Debug.Assert(_encoding is not null); 184Debug.Assert(_encoding is not null); 228Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 229Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 238Debug.Assert(_encoding is not null); 259Debug.Fail("Unexpected OperationStatus return value."); 269Debug.Assert(charCount >= 0, "Fallback buffer shouldn't have returned a negative char count."); 284Debug.Assert(_fallbackBuffer is null || _fallbackBuffer.Remaining == 0, "Should have no data remaining in the fallback buffer."); 285Debug.Assert(HasLeftoverData, "Caller shouldn't invoke this routine unless there's leftover data in the decoder."); 296Debug.Assert(_encoding is not null); 324Debug.Fail("Unexpected OperationStatus return value."); 352Debug.Assert(combinedBufferBytesConsumed == combinedBuffer.Length, "We should be asked to persist the entire combined buffer.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\DecoderReplacementFallback.cs (1)
132Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoder.cs (1)
177Debug.Assert(result <= byteCount, "Returned more bytes than we have space for");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (6)
124Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this if there's no data to fall back."); 197Debug.Assert(encoding != null); 234Debug.Fail("Unexpected return value."); 247Debug.Assert(encoding != null); 262Debug.Assert(byteCountThisIteration >= 0, "Encoding shouldn't have returned a negative byte count."); 299Debug.Assert(charStart != null,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderLatin1BestFitFallback.cs (4)
42Debug.Assert(_iCount < 1, $"[EncoderLatin1BestFitFallbackBuffer.Fallback(non surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 68Debug.Assert(_iCount < 1, $"[EncoderLatin1BestFitFallbackBuffer.Fallback(surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 142Debug.Assert(index + 1 < ArrayCharBestFit.Length, 163Debug.Assert(index + 1 < ArrayCharBestFit.Length,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (9)
73Debug.Assert(_encoding is not null); 116Debug.Assert(_encoding is not null); 170Debug.Assert(_encoding is not null); 214Debug.Assert(_encoding is not null); 285Debug.Assert(_encoding is not null); 288Debug.Assert(byteCount >= 0, "Encoding shouldn't have returned a negative byte count."); 308Debug.Assert(_fallbackBuffer is not null); 359Debug.Assert(_encoding is not null); 374Debug.Fail("Unknown return value.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncoderReplacementFallback.cs (1)
160Debug.Assert(_fallbackIndex < _strDefault.Length && _fallbackIndex >= 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (8)
631Debug.Assert(byteCount == bytesReceived); 657Debug.Assert(byteCount == bytesReceived); 711Debug.Assert(result <= byteCount, "[Encoding.GetBytes]Returned more bytes than we have space for"); 860Debug.Assert(result <= charCount, "[Encoding.GetChars]Returned more chars than we have space for"); 1287Debug.Assert(_fallbackBuffer.Remaining == 0, 1339Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date"); 1446Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 1488Debug.Assert(_chars > _charStart ||
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (73)
76Debug.Fail("This should be overridden by a subclassed type."); 82Debug.Fail("This should be overridden by a subclassed type."); 114Debug.Fail("This should be overridden by a subclassed type."); 124Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 125Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 126Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 207Debug.Fail("This should be overridden by a subclassed type."); 232Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 258Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 259Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 313Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 314Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 348Debug.Assert(byteCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 349Debug.Assert(charsConsumedThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 371Debug.Assert(byteCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 372Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 386Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetByteCount."); 401Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 402Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 403Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 404Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 405Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 470Debug.Fail("This should be overridden by a subclassed type."); 495Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method."); 496Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Invalid arguments provided to method."); 525Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS."); 526Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition."); 527Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Caller should've checked this condition."); 589Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 590Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 591Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 609Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed."); 659Debug.Assert(bytesWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 660Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 689Debug.Assert(encoder is null); 698Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?"); 702Debug.Assert(fallbackBuffer.Remaining == 0 || encoder != null, "Shouldn't have any leftover data in fallback buffer unless an EncoderNLS is in use."); 717Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 718Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 719Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 726Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Fallback buffer can't hold data between GetChars invocations."); 801Debug.Fail("This should be overridden by a subclassed type."); 826Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 852Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 853Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 913Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 914Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 945Debug.Assert(charCountThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 967Debug.Assert(charCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 968Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 982Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetCharCount."); 997Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 998Debug.Assert(byteCount >= 0, "Caller should've checked this condition."); 999Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count."); 1000Debug.Assert(charCount >= 0, "Caller should've checked this condition."); 1001Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count."); 1066Debug.Fail("This should be overridden by a subclassed type."); 1091Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method."); 1092Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Invalid arguments provided to method."); 1121Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS."); 1122Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition."); 1123Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Caller should've checked this condition."); 1147Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Should be no remaining fallback data at this point."); 1190Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer."); 1191Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter."); 1192Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter."); 1211Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed."); 1228Debug.Assert(charsWrittenThisIteration >= 0, "Fallback shouldn't have returned a negative value."); 1259Debug.Assert(charsWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1260Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value."); 1273Debug.Assert(fallbackBuffer.Remaining == 0); 1286Debug.Assert(decoder is null); 1295Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (7)
46Debug.Assert(EncodingNameIndices.Length == CodePagesByName.Length + 1); 47Debug.Assert(EncodingNameIndices[^1] == EncodingNames.Length); 57Debug.Assert(index < EncodingNameIndices.Length - 1); 80Debug.Assert(left < EncodingNameIndices.Length - 1); 120Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length); 126Debug.Assert(encodingInfoList != null); 241Debug.Fail("Unexpected code page");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (10)
109Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 110Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 296Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 297Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 298Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 299Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 602Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 603Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 604Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 605Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (33)
41Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 64Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVectorInChars, "We should've made forward progress of at least one char."); 65Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 68Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector."); 72Debug.Assert((nuint)pBuffer % SizeOfVectorInChars == 0, "Vector read should be aligned."); 150Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars."); 155Debug.Assert(!AllCharsInUInt32AreLatin1(currentUInt32), "Shouldn't have reached this point if we have an all-Latin-1 input."); 185Debug.Assert(Sse2.IsSupported, "Should've been checked by caller."); 186Debug.Assert(BitConverter.IsLittleEndian, "SSE2 assumes little-endian."); 205Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 241Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char."); 242Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer."); 371Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count."); 426Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-Latin-1 data."); 434Debug.Assert(!AllCharsInUInt32AreLatin1(currentDWord), "Shouldn't be here unless we see non-Latin-1 data."); 452Debug.Assert(bufferLength < SizeOfVector128InChars); 551Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported."); 631Debug.Assert(currentOffset <= elementCount); 747Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input."); 780Debug.Assert(Sse2.IsSupported); 781Debug.Assert(BitConverter.IsLittleEndian); 782Debug.Assert(elementCount >= 2 * SizeOfVector128); 863Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector."); 865Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer."); 866Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector."); 899Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned."); 934Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned."); 972Debug.Assert(Sse2.IsSupported); 973Debug.Assert(BitConverter.IsLittleEndian); 998Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char)); 1028Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop."); 1072Debug.Assert(!Sse2.IsSupported); 1099Debug.Assert(elementCount - currentOffset < SizeOfVector, "Vectorized logic should result in less than a vector's length of data remaining.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.Helpers.cs (2)
51Debug.Assert(AllCharsInUInt64AreLatin1(value)); 95Debug.Assert(AllCharsInUInt32AreLatin1(value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (12)
199Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf16CharsPerRune); 216Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf8BytesPerRune); 229Debug.Assert(!GlobalizationMode.Invariant, "This should've been checked by the caller."); 230Debug.Assert(textInfo != null, "This should've been checked by the caller."); 301Debug.Assert(buffer.Length >= MaxUtf16CharsPerRune); 476Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0080, 0x07FF)); 527Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0800, 0xFFFF)); 556Debug.Assert(1 <= bytesConsumed && bytesConsumed <= 4); // Valid subsequences are always length [1..4] 562Debug.Assert(0 <= index && index <= 3); // Incomplete subsequences are always length 0..3 569Debug.Assert(1 <= index && index <= 3); // Invalid subsequences are always length 1..3 719Debug.Assert(!source.IsEmpty, "Shouldn't reach this for empty inputs."); 1328Debug.Assert(!value.IsAscii, "Shouldn't use this non-optimized code path for ASCII characters.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (64)
240Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue."); 247Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity); 248Debug.Assert(currentBlock.m_ChunkChars != null); 250Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 251Debug.Assert(currentBlock.m_ChunkLength >= 0); 252Debug.Assert(currentBlock.m_ChunkOffset >= 0); 257Debug.Assert(currentBlock.m_ChunkOffset == 0); 261Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength); 471Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing."); 481Debug.Assert(Length == value, "Something went wrong setting Length."); 576Debug.Assert(next.m_ChunkPrevious != null); 602Debug.Assert(stringBuilder != null); 655Debug.Assert(stringBuilder != null); 709Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller."); 731Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 874Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count); 930Debug.Assert(chunk != null); 982Debug.Assert(insertingChars + this.Length < int.MaxValue); 1050Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 1097Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1110Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1276Debug.Assert(values != null); 1277Debug.Assert(!Unsafe.IsNullRef(ref separator)); 1278Debug.Assert(separatorLength >= 0); 1468Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known"); 1640Debug.Assert(format[pos - 1] == '{'); 1641Debug.Assert(ch != '{'); 1744Debug.Assert(format[pos] == '}'); 1972Debug.Assert(index > 2); 2061Debug.Assert(thisChunk != null && sbChunk != null); 2098Debug.Assert(offset == Length); 2153Debug.Assert(chunk != null, "chunk was null in replace"); 2177Debug.Assert(count >= 0, "count should never go negative"); 2195Debug.Assert(oldValue.Length > Math.Min(count, chunk.m_ChunkLength - indexInChunk), 2215Debug.Assert(indexInChunk >= chunk.m_ChunkLength || count == 0, 2233Debug.Assert(chunk != null || count == 0, "Chunks ended prematurely!"); 2293Debug.Assert(chunk.m_ChunkPrevious != null); 2353Debug.Assert(valueCount >= 0, "Invalid length; should have been validated by caller."); 2405Debug.Assert(m_ChunkLength == 0, "A new block was not created."); 2422Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value."); 2443Debug.Assert(!replacements.IsEmpty); 2476Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen"); 2477Debug.Assert(gapStart <= gapEnd, "negative gap size"); 2478Debug.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big"); 2487Debug.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk"); 2556Debug.Assert(chunk != null, "chunk should not be null at this point"); 2558Debug.Assert(lengthInChunk >= 0, "Index isn't in the chunk."); 2590Debug.Assert(0 <= index && index <= Length); 2595Debug.Assert(result.m_ChunkPrevious != null); 2599Debug.Assert(result != null); 2632Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left."); 2633Debug.Assert(minBlockCharCount > 0); 2723Debug.Assert(count > 0); 2724Debug.Assert(index >= 0); 2735Debug.Assert(chunk.m_ChunkPrevious != null); 2792Debug.Assert(size > 0); 2793Debug.Assert(maxCapacity > 0); 2818Debug.Assert(startIndex >= 0 && startIndex < Length); 2846Debug.Assert(chunk.m_ChunkPrevious != null); 2849Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 2881Debug.Assert(chunk != null, "We fell off the beginning of the string!"); 3281Debug.Assert(_hasCustomFormatter); 3282Debug.Assert(_provider != null); 3285Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (5)
55Debug.Assert(innerStream != null); 56Debug.Assert(innerEncoding != null); 57Debug.Assert(thisEncoding != null); 93Debug.Assert(disposing, "This type isn't finalizable."); 150Debug.Assert(pendingData.Count != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.cs (10)
46Debug.Assert(AllCharsInUInt32AreAscii(value)); 76Debug.Assert(AllCharsInUInt32AreAscii(value)); 105Debug.Assert(AllCharsInUInt64AreAscii(value)); 134Debug.Assert(AllCharsInUInt64AreAscii(value)); 162Debug.Assert(AllCharsInUInt32AreAscii(value)); 187Debug.Assert(AllCharsInUInt32AreAscii(value)); 213Debug.Assert(AllCharsInUInt32AreAscii(valueA)); 214Debug.Assert(AllCharsInUInt32AreAscii(valueB)); 270Debug.Assert(AllCharsInUInt64AreAscii(valueA)); 271Debug.Assert(AllCharsInUInt64AreAscii(valueB));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (5)
75Debug.Assert(inputLength >= 0, "Input length must not be negative."); 76Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 82Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength); 121Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer); 175Debug.Assert((debugMask & 0b_1010_1010_1010_1010) == 0, "Shouldn't have set the 0x8000 bit of any element in 'charIsNonAscii'.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (11)
199Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 286Debug.Assert(!source.IsEmpty, "Expected 'Done' if source is fully consumed."); 663Debug.Assert(_hasCustomFormatter); 664Debug.Assert(_provider is not null); 667Debug.Assert(formatter is not null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't"); 684Debug.Assert(value is ISpanFormattable); 694Debug.Assert(value is ISpanFormattable); 731Debug.Assert(typeof(T).IsEnum); 741Debug.Assert(value is ISpanFormattable); 775Debug.Assert(startingPos >= 0 && startingPos <= _pos); 776Debug.Assert(alignment != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.cs (8)
64Debug.Assert(AllBytesInUInt32AreAscii(value)); 94Debug.Assert(AllBytesInUInt32AreAscii(value)); 123Debug.Assert(AllBytesInUInt64AreAscii(value)); 152Debug.Assert(AllBytesInUInt64AreAscii(value)); 181Debug.Assert(AllBytesInUInt32AreAscii(valueA)); 182Debug.Assert(AllBytesInUInt32AreAscii(valueB)); 244Debug.Assert(AllBytesInUInt64AreAscii(valueA)); 245Debug.Assert(AllBytesInUInt64AreAscii(valueB));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (12)
20Debug.Assert(UInt32BeginsWithUtf8ThreeByteMask(value)); 45Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value) && !UInt32BeginsWithOverlongUtf8TwoByteSequence(value)); 108Debug.Assert(IsWellFormedUtf16SurrogatePair(value)); 186Debug.Assert(IsFirstCharTwoUtf8Bytes(value) && IsSecondCharTwoUtf8Bytes(value)); 214Debug.Assert(IsFirstCharTwoUtf8Bytes(value)); 456Debug.Assert(UInt32BeginsWithUtf8TwoByteMask(value)); 575Debug.Assert(UInt32EndsWithUtf8TwoByteMask(value)); 639Debug.Assert(BitConverter.IsLittleEndian); 658Debug.Assert(BitConverter.IsLittleEndian); 726Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF"); 727Debug.Assert(IsSecondCharAtLeastThreeUtf8Bytes(value) && !IsSecondCharSurrogate(value), "Second half of value should've been 0800..D7FF or E000..FFFF"); 761Debug.Assert(IsFirstCharAtLeastThreeUtf8Bytes(value) && !IsFirstCharSurrogate(value), "First half of value should've been 0800..D7FF or E000..FFFF");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (18)
26Debug.Assert(inputLength >= 0, "Input length must not be negative."); 27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 29Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative."); 30Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 66Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 76Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 136Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord)); 154Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 226Debug.Assert(outputCharsRemaining == 1); 846Debug.Assert(inputLength >= 0, "Input length must not be negative."); 847Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 849Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative."); 850Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null."); 902Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 912Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 1096Debug.Assert(!Utf16Utility.AllCharsInUInt64AreAscii(possibleNonAsciiQWord)); // this condition should've been checked earlier 1164Debug.Assert(!Utf16Utility.AllCharsInUInt32AreAscii(thisDWord)); // this should have been handled earlier 1441Debug.Assert(inputLength < CharsPerDWord);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (9)
30Debug.Assert(inputLength >= 0, "Input length must not be negative."); 31Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null."); 81Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read."); 195Debug.Assert((AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian) || Sse2.IsSupported || PackedSimd.IsSupported); 203Debug.Assert(trailingZeroCount < 16); 240Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 666Debug.Assert(inputLength < 4); 676Debug.Assert(inputBufferRemainingBytes < 4); 748Debug.Assert(pOriginalInputBuffer + originalInputLength == pInputBuffer, "About to return an unexpected value.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UnicodeDebug.cs (6)
15Debug.Fail($"The value {ToHexString(codePoint)} is not a valid BMP code point."); 24Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 high surrogate code point."); 33Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 low surrogate code point."); 42Debug.Fail($"The value {ToHexString(codePoint)} is not a valid Unicode code point."); 51Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid Unicode scalar value."); 60Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid supplementary plane Unicode scalar value.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
347Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null"); 348Debug.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0"); 491Debug.Assert(chars > charStart, 559Debug.Assert(chars > charStart, 626Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 636Debug.Assert(chars is not null, "[UnicodeEncoding.GetBytes]chars!=null"); 637Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetBytes]byteCount >=0"); 638Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetBytes]charCount >=0"); 639Debug.Assert(bytes is not null, "[UnicodeEncoding.GetBytes]bytes!=null"); 776Debug.Assert(chars > charStart, 844Debug.Assert(chars > charStart + 1 || bytes == byteStart, 873Debug.Assert(chars > charStart, 908Debug.Assert(chars > charStart, 975Debug.Assert((encoder is not null && !encoder.MustFlush) || charLeftOver == (char)0, 978Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0 || 987Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null"); 988Debug.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0"); 1022Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1293Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0, 1302Debug.Assert(chars is not null, "[UnicodeEncoding.GetChars]chars!=null"); 1303Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetChars]byteCount >=0"); 1304Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetChars]charCount >=0"); 1305Debug.Assert(bytes is not null, "[UnicodeEncoding.GetChars]bytes!=null"); 1321Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, 1473Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1522Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1539Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1581Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1598Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1643Debug.Assert(bytes >= byteStart + 2 || chars == charStart, 1699Debug.Assert(!decoder.MustFlush || ((lastChar == (char)0) && (lastByte == -1)), 1709Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (26)
355Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null"); 356Debug.Assert(count >= 0, "[UTF32Encoding.GetByteCount]count >=0"); 419Debug.Assert(chars > charStart, 477Debug.Assert(fallbackBuffer.Remaining == 0, 487Debug.Assert(chars is not null, "[UTF32Encoding.GetBytes]chars!=null"); 488Debug.Assert(bytes is not null, "[UTF32Encoding.GetBytes]bytes!=null"); 489Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetBytes]byteCount >=0"); 490Debug.Assert(charCount >= 0, "[UTF32Encoding.GetBytes]charCount >=0"); 560Debug.Assert(chars > charStart + 1 || bytes == byteStart, 588Debug.Assert(chars > charStart, 633Debug.Assert(chars > charStart, 670Debug.Assert(highSurrogate == 0 || (encoder is not null && !encoder.MustFlush), 688Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null"); 689Debug.Assert(count >= 0, "[UTF32Encoding.GetCharCount]count >=0"); 714Debug.Assert(fallbackBuffer.Remaining == 0, 821Debug.Assert(fallbackBuffer.Remaining == 0, 831Debug.Assert(chars is not null, "[UTF32Encoding.GetChars]chars!=null"); 832Debug.Assert(bytes is not null, "[UTF32Encoding.GetChars]bytes!=null"); 833Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetChars]byteCount >=0"); 834Debug.Assert(charCount >= 0, "[UTF32Encoding.GetChars]charCount >=0"); 858Debug.Assert(baseDecoder is not null); 863Debug.Assert(fallbackBuffer.Remaining == 0, 928Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 951Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 968Debug.Assert(bytes >= byteStart + 4 || chars == charStart, 1036Debug.Assert(fallbackBuffer.Remaining == 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (15)
62Debug.Assert(_base64Bytes.Length == 64); 391Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null"); 392Debug.Assert(count >= 0, "[UTF7Encoding.GetByteCount]count >=0"); 401Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetBytes]byteCount >=0"); 402Debug.Assert(chars is not null, "[UTF7Encoding.GetBytes]chars!=null"); 403Debug.Assert(charCount >= 0, "[UTF7Encoding.GetBytes]charCount >=0"); 540Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0"); 541Debug.Assert(bytes is not null, "[UTF7Encoding.GetCharCount]bytes!=null"); 550Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetChars]byteCount >=0"); 551Debug.Assert(bytes is not null, "[UTF7Encoding.GetChars]bytes!=null"); 552Debug.Assert(charCount >= 0, "[UTF7Encoding.GetChars]charCount >=0"); 571Debug.Assert(!firstByte || decoder.bitCount <= 0, 849Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks"); 850Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte"); 902Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (12)
206Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 207Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 396Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 397Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 398Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 399Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 598Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 599Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 600Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer."); 601Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified."); 716Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer."); 717Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.Sealed.cs (6)
57Debug.Assert(s != null); 58Debug.Assert(s.Length <= MaxSmallInputElementCount); 68Debug.Assert(0 <= bytesWritten && bytesWritten <= s.Length * MaxUtf8BytesPerChar); 135Debug.Assert(bytes != null); 136Debug.Assert(bytes.Length <= MaxSmallInputElementCount); 146Debug.Assert(0 <= charsWritten && charsWritten <= sourceLength); // should never have more output chars than input bytes
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (3)
85Debug.Assert(format[pos - 1] == '{'); 86Debug.Assert(ch != '{'); 189Debug.Assert(format[pos] == '}');
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\AsyncLocal.cs (6)
51Debug.Assert(_valueChangedHandler is not null); 104Debug.Assert(asyncLocalValueMap is not null); 105Debug.Assert(asyncLocalValueMap == Empty || asyncLocalValueMap.GetType() != typeof(EmptyAsyncLocalValueMap)); 392Debug.Assert(keyValues.Length is >= 5 and <= MaxMultiElements); 522Debug.Assert(index == MultiElementAsyncLocalValueMap.MaxMultiElements); 535Debug.Assert(map.Count == count - 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (22)
327Debug.Assert(IsCancellationRequested); 346Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 589Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a CancellationToken."); 590Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>); 625Debug.Assert(node.Prev == null, "Nodes in the free list should all have a null Prev"); 677Debug.Assert(id != 0, "IDs should never be the reserved value 0."); 695Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished"); 731Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true"); 768Debug.Assert(node.Registrations.Source == this); 769Debug.Assert(node.Prev == null); 829Debug.Assert(exceptionList.Count > 0, $"Expected {exceptionList.Count} > 0"); 938Debug.Assert(s is CancellationTokenSource, $"Expected {typeof(CancellationTokenSource)}, got {s}"); 982Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>); 1028Debug.Assert(_locked); 1050Debug.Assert(node != null, "Expected non-null node"); 1051Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance"); 1079Debug.Assert(node.Prev == null); 1084Debug.Assert(node.Prev != null); 1175Debug.Assert(_locked); 1195Debug.Assert(registrations != null, "Expected non-null parent registrations"); 1204Debug.Assert(Callback != null); 1212Debug.Assert(node.Callback != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Condition.cs (11)
36Debug.Assert(waiter.next is null && waiter.prev is null); 60Debug.Assert(_waitersHead != null && _waitersTail != null); 61Debug.Assert((_waitersHead == waiter) == (waiter.prev == null)); 62Debug.Assert((_waitersTail == waiter) == (waiter.next == null)); 67Debug.Fail("Waiter is not in the waiter list"); 73Debug.Assert(waiter.next == null && waiter.prev == null); 74Debug.Assert((_waitersHead == null) == (_waitersTail == null)); 78Debug.Fail("Waiter is in the waiter list, but should not be"); 90Debug.Assert(_lock.IsHeldByCurrentThread); 108Debug.Assert(_lock.IsHeldByCurrentThread); 160Debug.Assert(_lock.IsHeldByCurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\EventWaitHandle.cs (4)
94Debug.Assert(result != null, "result should be non-null on success"); 107Debug.Assert(result != null, "result should be non-null on success"); 114Debug.Assert(openExistingResult != OpenExistingResult.Success); 125Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (24)
88Debug.Assert(Thread.CurrentThread == currentThread); 101Debug.Assert(isFlowSuppressed != m_isFlowSuppressed); 267Debug.Assert(threadPoolThread == Thread.CurrentThread); 315Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default."); 331Debug.Assert(currentThread == Thread.CurrentThread); 332Debug.Assert(contextToRestore != currentContext); 367Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 368Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext."); 369Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext."); 374Debug.Assert(previousExecutionCtx != nextExecutionCtx); 381Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null); 389Debug.Assert(previousExecutionCtx!.m_localValues != null); 390Debug.Assert(nextExecutionCtx!.m_localValues != null); 424Debug.Assert(previousExecutionCtx!.m_localValues != null); 438Debug.Assert(nextExecutionCtx!.m_localValues != null); 473Debug.Assert(!current.IsDefault); 474Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 487Debug.Assert(!current.IsDefault); 488Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 510Debug.Assert(!current.IsDefault); 511Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context"); 530Debug.Assert(newChangeNotifications != null); 531Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 573Debug.Assert(currentThread == Thread.CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (4)
279Debug.Assert(sizeof(T) == 8); 532Debug.Assert(sizeof(T) == 8); 708Debug.Assert(sizeof(T) == 8); 851Debug.Assert(sizeof(T) == 8);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (3)
29Debug.Assert(helper != null, "IOCompletionCallbackHelper cannot be null"); 35Debug.Assert(pNativeOverlapped != null); 53Debug.Assert(callback is IOCompletionCallbackHelper);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (3)
70Debug.Assert(target != null); 116Debug.Assert(target != null); 272Debug.Assert(target != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (67)
123Debug.Assert(currentThreadId != UninitializedThreadId); 130Debug.Assert(currentThreadId != UninitializedThreadId); 131Debug.Assert(currentThreadId == _owningThreadId); 280Debug.Assert(timeoutMs >= -1); 285Debug.Assert(_owningThreadId == UninitializedThreadId); 286Debug.Assert(_recursionCount == 0); 319Debug.Assert(currentThreadId != UninitializedThreadId); 320Debug.Assert(currentThreadId == ManagedThreadId.CurrentManagedThreadIdUnchecked); 333Debug.Assert(_owningThreadId != UninitializedThreadId); 334Debug.Assert(_owningThreadId == ManagedThreadId.CurrentManagedThreadIdUnchecked); 335Debug.Assert(new State(this).IsLocked); 355Debug.Assert(IsHeldByCurrentThread); 372Debug.Assert(!IsHeldByCurrentThread); 383Debug.Assert(timeoutMs >= -1); 390Debug.Assert(_owningThreadId != currentThreadId); 398Debug.Assert(new State(this).IsLocked); 443Debug.Assert(IsAdaptiveSpinEnabled(minSpinCountForAdaptiveSpin)); 500Debug.Assert(tryLockResult == TryLockResult.Wait); 522Debug.Assert(tryLockResult == TryLockResult.Wait); 529Debug.Assert(tryLockResult != TryLockResult.Spin); 535Debug.Assert(tryLockResult == TryLockResult.Locked); 538Debug.Assert(_owningThreadId == UninitializedThreadId); 539Debug.Assert(_recursionCount == 0); 634Debug.Assert(_owningThreadId == UninitializedThreadId); 635Debug.Assert(_recursionCount == 0); 717Debug.Assert(WaitEvent != null); 719Debug.Assert(signaled); 732Debug.Assert(!isHeld || new State(this).IsLocked); 744Debug.Assert(WaitEvent != null); 754Debug.Assert(currentManagedThreadId != UninitializedThreadId); 758Debug.Assert(_owningThreadId == UninitializedThreadId); 759Debug.Assert(_recursionCount == 0); 770Debug.Assert(currentManagedThreadId != UninitializedThreadId); 773Debug.Assert(!isHeld || new State(this).IsLocked); 824Debug.Assert( 859Debug.Assert( 910Debug.Assert(recursionCount == 0 || managedThreadId != UninitializedThreadId); 911Debug.Assert(!new State(this).UseTrivialWaits); 917Debug.Assert(!new State(this).UseTrivialWaits); 1016Debug.Assert(!IsLocked); 1024Debug.Assert(!ShouldNotPreemptWaiters); 1025Debug.Assert(HasAnyWaiters); 1032Debug.Assert(ShouldNotPreemptWaiters); 1040Debug.Assert(HasAnyWaiters || !ShouldNotPreemptWaiters); 1060Debug.Assert(HasAnySpinners); 1068Debug.Assert(HasAnyWaiters); 1069Debug.Assert(NeedToSignalWaiter); 1076Debug.Assert(IsWaiterSignaledToWake); 1088Debug.Assert(lockObj._state == 0); 1111Debug.Assert(HasAnyWaiters); 1119Debug.Assert(HasAnyWaiters); 1168Debug.Assert(IsLockedMask == 1); 1171Debug.Assert(!state.IsLocked); 1207Debug.Assert(spinCount >= 0); 1229Debug.Assert(!newState.ShouldNotPreemptWaiters); 1263Debug.Assert(state.HasAnySpinners); 1291Debug.Assert(new State(state._state + SpinnerCountIncrement).HasAnySpinners); 1295Debug.Assert(state.HasAnyWaiters || !state.ShouldNotPreemptWaiters); 1355Debug.Assert(state.HasAnyWaiters || waiterStartTimeWasReset); 1379Debug.Assert(state.HasAnyWaiters); 1380Debug.Assert(state.IsWaiterSignaledToWake); 1411Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1435Debug.Assert(new State(state._state + IsWaiterSignaledToWakeMask).IsWaiterSignaledToWake); 1440Debug.Assert(state.HasAnyWaiters); 1470Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1494Debug.Assert(state.HasAnyWaiters); 1524Debug.Assert(state.HasAnyWaiters);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelFutex.Unix.cs (1)
26Debug.Assert(milliseconds >= -1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (21)
86Debug.Assert(timeoutMs >= -1); 175Debug.Assert(HasWaitersToWake(counts)); 182Debug.Assert(newCounts.CountOfWaitersSignaledToWake == 1); 202Debug.Assert(timeoutMs > 0 || timeoutMs == -1); 241Debug.Assert(counts.WaiterCount != 0); 244Debug.Assert(counts.CountOfWaitersSignaledToWake == 1); 284Debug.Assert(timeoutMs >= -1); 304Debug.Assert(_blockerStack == null); 305Debug.Assert(_racingUnblocks > 0); 366Debug.Assert(origWake == 0); 405Debug.Assert(_pendingWake == 1); 417Debug.Assert(_racingUnblocks != ushort.MaxValue); 423Debug.Assert(_pendingWake == 0); 493Debug.Assert(countsAfterUpdate.SignalCount != ushort.MaxValue); // overflow check 499Debug.Assert(SignalCount != 0); 510Debug.Assert(WaiterCount != 0); 517Debug.Assert(WaiterCount != 0); 523Debug.Assert(countsAfterUpdate.WaiterCount != ushort.MaxValue); // underflow check 529Debug.Assert(countsAfterUpdate.WaiterCount != ushort.MaxValue); // overflow check 542Debug.Assert(countsAfterUpdate.CountOfWaitersSignaledToWake != ushort.MaxValue); // overflow check 547Debug.Assert(CountOfWaitersSignaledToWake != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (10)
51Debug.Assert(!isLocked || (_state & LockedMask) != 0); 61Debug.Assert(_ownerThread == Thread.CurrentThread); 63Debug.Assert((_state & LockedMask) != 0); 71Debug.Assert(_ownerThread != Thread.CurrentThread); 79Debug.Assert(_ownerThread == null); 163Debug.Assert((_state & LockedMask) != 0); 185Debug.Assert(state >= WaiterCountIncrement); 186Debug.Assert((state & WaiterWoken) != 0); 199Debug.Assert((_state & LockedMask) != 0); 215Debug.Assert((_state & LockedMask) != 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.cs (4)
36Debug.Assert(IsLocked); 44Debug.Assert(!IsLocked); 52Debug.Assert(_ownerThread == null); 97Debug.Assert(timeoutMilliseconds >= -1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.Unix.cs (1)
49Debug.Assert(timeoutMilliseconds >= -1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
21Debug.Assert(condition != null); 56Debug.Assert(spinIndex >= 0); 57Debug.Assert(sleep0Threshold >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelThreadBlocker.cs (1)
145Debug.Assert(timeoutMs >= -1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (10)
87Debug.Assert(m_eventObj != null); 127Debug.Assert(value >= 0, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 128Debug.Assert(value <= SpinCountState_MaxValue, "SpinCount is a restricted-width integer. The value supplied is outside the legal range."); 157Debug.Assert((m_combinedState & NumWaitersState_BitMask) != 0, "NumWaiters should never be less than zero. This indicates an internal error."); 221Debug.Assert(DEFAULT_SPIN_SP >= 0, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 222Debug.Assert(DEFAULT_SPIN_SP <= SpinCountState_MaxValue, "Internal error - DEFAULT_SPIN_SP is outside the legal range."); 268Debug.Assert(currentIsSet, 307Debug.Assert(m_lock != null); // if waiters>0, then m_lock has already been created. 673Debug.Assert(obj is ManualResetEventSlim, "Expected a ManualResetEventSlim"); 675Debug.Assert(mre.m_lock != null); // the lock should have been created before this callback is registered for use.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Mutex.cs (4)
116Debug.Assert(result != null, "result should be non-null on success"); 128Debug.Assert(result != null, "result should be non-null on success"); 135Debug.Assert(openExistingResult != OpenExistingResult.Success); 146Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\NamedMutex.Unix.cs (13)
60Debug.Assert(_head != namedMutex); 178Debug.Assert(IsLockOwnedByCurrentThread || (!abandonedThread.IsAlive && Thread.CurrentThreadIsFinalizerThread()), 183Debug.Assert(Thread.CurrentThreadIsFinalizerThread()); 194Debug.Assert(_lockOwnerThread is not null); 252Debug.Assert(acquireResult == MutexTryAcquireLockResult.AcquiredLock); 350Debug.Assert(IsLockOwnedByCurrentThread); 351Debug.Assert(!IsAbandoned); 372Debug.Assert(_lockCount == 0); 449Debug.Assert(_lockCount == 0); 504Debug.Assert(IsLockOwnedByCurrentThread); 533Debug.Assert(acquiredLock); 699Debug.Assert(namedMutexProcessData._processData is not null); 712Debug.Assert(namedMutexProcessData._processData is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\NamedWaitHandleOptions.cs (4)
82Debug.Assert(WasSpecified); 91Debug.Assert(WasSpecified); 100Debug.Assert(!string.IsNullOrEmpty(name)); 101Debug.Assert(WasSpecified);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (3)
182Debug.Assert(GCHandleCountRef(pNativeOverlapped) == handleCount); 228Debug.Assert(target is Overlapped); 231Debug.Assert(overlapped._pNativeOverlapped == pNativeOverlapped);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (2)
225Debug.Assert(!_stopped, "Unexpectedly stopped without _signaled being true."); 265Debug.Assert(!Monitor.IsEntered(this));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.Blocking.cs (5)
44Debug.Assert(_numBlockedThreads > 0); 70Debug.Assert(BlockingConfig.IsCooperativeBlockingEnabled); 71Debug.Assert(Thread.CurrentThread.IsThreadPoolThread); 77Debug.Assert(_numBlockedThreads > 0); 123Debug.Assert(_pendingBlockingAdjustment != PendingBlockingAdjustment.None);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (1)
347Debug.Assert(t_completionCountNode == null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (4)
252Debug.Assert(numRuns >= 0); 253Debug.Assert(numRuns <= MaxRuns); 322Debug.Assert(nextDelay <= GateActivitiesPeriodMs); 340Debug.Assert(HasBlockingAdjustmentDelay);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (3)
444Debug.Assert(numSamples >= period); // can't measure a wave that doesn't fit 445Debug.Assert(period >= 2); // can't measure above the Nyquist frequency 446Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.ThreadCounts.cs (10)
37Debug.Assert(value >= 0); 42Debug.Assert(value >= 0); 69Debug.Assert(NumProcessingWork >= 0); 74Debug.Assert(NumProcessingWork > 0); 91Debug.Assert(NumProcessingWork > 0); 101Debug.Assert(NumProcessingWork >= 0); 114Debug.Assert(value >= 0); 119Debug.Assert(value >= 0); 132Debug.Assert(value > 0); 137Debug.Assert(value > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (13)
127Debug.Assert(current != null, "The wait thread to remove was not found in the list of thread pool wait threads."); 220Debug.Assert(registeredWait != null); 250Debug.Assert(signaledHandleIndex != WaitHandle.WaitAbandoned); // the first wait handle is an event 262Debug.Assert(signaledHandle != null); 276Debug.Assert(registeredHandle != null); 295Debug.Assert(_numPendingRemoves >= 0); 296Debug.Assert(_numPendingRemoves <= _pendingRemoves.Length); 297Debug.Assert(_numUserWaits >= 0); 298Debug.Assert(_numUserWaits <= _registeredWaits.Length); 299Debug.Assert(_numPendingRemoves <= _numUserWaits, $"Num removals {_numPendingRemoves} should be less than or equal to num user waits {_numUserWaits}"); 317Debug.Assert(j < numUserWaits); 354Debug.Assert(originalNumUserWaits - originalNumPendingRemoves == _numUserWaits, 405Debug.Assert(success);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerThread.cs (2)
287Debug.Assert(newCounts.NumProcessingWork - oldCounts.NumProcessingWork == 1); 291Debug.Assert(toCreate == 0 || toCreate == 1);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WorkerTracking.cs (3)
87Debug.Assert(Current == HighWatermark); 88Debug.Assert(Current != short.MaxValue); 95Debug.Assert(Current > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
40Debug.Assert(s_processorIdRefreshRate <= ProcessorIdCacheCountDownMask);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (30)
149Debug.Assert(_spinLock.IsHeld); 157Debug.Assert(_spinLock.IsHeld); 553Debug.Assert(_fIsReentrant); 554Debug.Assert(_fUpgradeThreadHoldingRead); 587Debug.Assert(_numWriteUpgradeWaiters == 0, "There can be at most one thread with the upgrade lock held."); 611Debug.Assert((_owners & WRITER_HELD) > 0); 615Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 692Debug.Assert((_owners & WRITER_HELD) > 0); 756Debug.Assert(lrwc != null, "Initialized based on _fIsReentrant earlier in the method"); 795Debug.Assert(_owners > 0, "ReleasingReaderLock: releasing lock and no read lock taken"); 799Debug.Assert(lrwc.readercount == 1); 843Debug.Assert((_owners & WRITER_HELD) > 0, "Calling ReleaseWriterLock when no write lock is held"); 907Debug.Assert(_spinLock.IsHeld); 908Debug.Assert(waitEvent == null); 931Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 954Debug.Assert(_spinLock.IsHeld); 975Debug.Assert(enterLockType == EnterLockType.UpgradeToWrite); 1067Debug.Assert(_spinLock.IsHeld); 1129Debug.Assert(_spinLock.IsHeld); 1138Debug.Assert(_numReadWaiters != 0 || _numUpgradeWaiters != 0); 1470Debug.Assert( 1490Debug.Assert(DeprioritizeEnterAnyReadIncrement == (1 << 16)); 1499Debug.Assert(DeprioritizeEnterAnyWriteIncrement == 1); 1506Debug.Assert((reason & EnterSpinLockReason.Wait) != 0 || reason == (reason & EnterSpinLockReason.OperationMask)); 1507Debug.Assert( 1516Debug.Assert( 1527Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) == 0); 1531Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) != 0); 1596Debug.Assert( 1610Debug.Assert(_isLocked, "Exiting spin lock that is not held");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (8)
89Debug.Assert(!IsInfiniteTimeout); 97Debug.Assert(WaitThread != null); 173Debug.Assert(handleValue == handle!.DangerousGetHandle()); 195Debug.Assert(_numRequestedCallbacks != 0); 273Debug.Assert(IsBlocking); 274Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user. 283Debug.Assert(!IsBlocking); 284Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user.
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Unix.cs (1)
35Debug.Assert(_waitHandle != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.cs (4)
107Debug.Assert(result != null, "result should be non-null on success"); 120Debug.Assert(result != null, "result should be non-null on success"); 127Debug.Assert(openExistingResult != OpenExistingResult.Success); 138Debug.Assert(openExistingResult == OpenExistingResult.ObjectIncompatibleWithCurrentUserOnly);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (14)
370Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't"); 402Debug.Assert(!waitSuccessful || m_currentCount > 0, 700Debug.Assert(m_currentCount == 0, "m_currentCount should never be negative"); 713Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 721Debug.Assert(m_asyncTail is null, "If head is null, so too should be tail"); 727Debug.Assert(m_asyncTail is not null, "If head is not null, neither should be tail"); 742Debug.Assert(task is not null, "Expected non-null task"); 743Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 753Debug.Assert((m_asyncHead is null) == (m_asyncTail is null), "Head is null iff tail is null"); 769Debug.Assert(asyncWaiter is not null, "Waiter should have been constructed"); 770Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held"); 861Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount); 889Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't null"); 963Debug.Assert(obj is SemaphoreSlim, "Expected a SemaphoreSlim");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (4)
117Debug.Assert(!IsThreadOwnerTrackingEnabled, "property should be false by now"); 365Debug.Assert((newOwner & WAITERS_MASK) >= 0); 397Debug.Assert(!IsThreadOwnerTrackingEnabled); // Make sure the waiters never be negative which will cause the thread tracking bit to be flipped 409Debug.Assert(IsThreadOwnerTrackingEnabled);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SpinWait.cs (4)
101Debug.Assert(value >= 0); 158Debug.Assert(sleep1Threshold >= -1); 159Debug.Assert(sleep1Threshold < 0 || sleep1Threshold >= YieldThreshold); 263Debug.Assert(result);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here."); 211Debug.Assert(state is ConcurrentExclusiveSchedulerPair); 213Debug.Assert(!localThis.m_completionState!.IsCompleted, "Completion should only happen once."); 219Debug.Assert(success, "Expected to complete completion task."); 230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0, 340else Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0."); 364Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode."); 365Debug.Assert(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed."); 370Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 388Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingExclusiveTask, 399Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive."); 412Debug.Assert(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode."); 417Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing, 446Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingConcurrentTasks, 457Debug.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent."); 524Debug.Assert(pair != null, "Scheduler must be associated with a valid pair."); 525Debug.Assert(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask, 527Debug.Assert( 547Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 563Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 573Debug.Assert(task != null, "Infrastructure should have provided a non-null task."); 647Debug.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception."); 671Debug.Assert(scheduler != null, "Need a scheduler with which to construct the debug view."); 694Debug.Assert(pair != null, "Need a pair with which to construct the debug view."); 734Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Sources\ManualResetValueTaskSourceCore.cs (9)
144Debug.Assert(_capturedContext is null); 261Debug.Assert(context is TaskScheduler or SynchronizationContext, $"context is {context}"); 276Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}"); 277Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 290Debug.Fail("The sentinel delegate should never be invoked."); 296Debug.Assert( 318Debug.Assert(cc._scheduler is TaskScheduler, $"{nameof(cc._scheduler)} is {cc._scheduler}"); 336Debug.Assert(continuation is not null, $"{nameof(continuation)} is null"); 337Debug.Assert(capturedContext is ExecutionContext or CapturedSchedulerAndExecutionContext, $"{nameof(capturedContext)} is {capturedContext}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task_T.cs (7)
400Debug.Assert(!IsCompleted, "The promise must not yet be completed."); 408Debug.Assert(success); 442Debug.Assert(!IsWaitNotificationEnabledOrNotRanToCompletion, 461Debug.Assert(IsCompletedSuccessfully, "Task<T>.Result getter: Expected result to have been set."); 483Debug.Assert(m_action != null); 495Debug.Fail("Invalid m_action in Task<TResult>"); 1420Debug.Assert(task != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (123)
195Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection"); 473Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false"); 667Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null, 711Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options"); 715Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags"); 716Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits"); 743Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task."); 785Debug.Assert(continuation != null); 831Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get"); 886Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, 894Debug.Assert(success, "Tried to set enabled on completed Task"); 924Debug.Assert(tasks != null, "Expected non-null array of tasks"); 961Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 980Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set."); 1021Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context"); 1042Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context"); 1045Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2"); 1190Debug.Assert(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler"); 1261Debug.Assert( 1278Debug.Assert((m_stateFlags & (int)TaskStateFlags.Canceled) != 0, "Task.RunSynchronously: expected TaskStateFlags.Canceled to be set"); 1408Debug.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted"); 1812Debug.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected"); 1813Debug.Assert((m_stateFlags & (int)TaskStateFlags.Started) == 0, "task has already started"); 1861Debug.Assert( 1881Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1892Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object"); 1900Debug.Assert( 1906Debug.Assert( 1998Debug.Assert(m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null, "ExceptionRecorded should imply this"); 2016Debug.Assert(IsFaulted && ExceptionRecorded, "Must only be used when the task has faulted with exceptions."); 2024Debug.Assert(IsCanceled, "Must only be used when the task has canceled."); 2039Debug.Assert(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true"); 2144Debug.Assert(userDelegateExecute || m_contingentProperties != null); 2306Debug.Assert(childTask != null); 2307Debug.Assert(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task"); 2309Debug.Assert(childTask.m_contingentProperties?.m_parent == this, "ProcessChildCompletion should only be called for a child of this task"); 2351Debug.Assert(props != null); 2369Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed"); 2373Debug.Assert(exceptionHolder != null); 2536Debug.Assert(obj is Task); 2547Debug.Assert(m_action != null, "Null action in InnerInvoke()"); 2559Debug.Fail("Invalid m_action in Task"); 2569Debug.Assert(unhandledException != null); 2641Debug.Assert(continuationAction != null); 2686Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context."); 2712Debug.Assert(stateMachineBox != null); 2785Debug.Assert(waitResult, "expected wait to succeed"); 2941Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state."); 3018Debug.Assert(source != null); 3019Debug.Assert(millisecondsDelay != 0); 3073Debug.Assert(completingTask.IsCompleted); 3165Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3328Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task"); 3400Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state."); 3401Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation"); 3402Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default); 3420Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task"); 3423Debug.Assert(m_contingentProperties!.m_cancellationToken == default); 3440Debug.Assert(edi != null, "Expected either an OCE or an EDI"); 3442Debug.Assert(oce != null, "Expected EDI to contain an OCE"); 3444Debug.Assert(oce.CancellationToken == tokenToRecord, 3455Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved."); 3487Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task"); 3488Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled"); 3525Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument"); 3528Debug.Assert( 3570Debug.Assert( 3616Debug.Assert(continuationObject != null); 3736Debug.Assert(currentContinuation is TaskContinuation); 3779Debug.Assert(currentContinuation is ITaskCompletionAction); 4638Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask"); 4639Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler"); 4640Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed"); 4725Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex"); 4728Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object"); 4764Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel"); 4802Debug.Assert(tc != null); 4898Debug.Assert(waitResult, "expected wait to succeed"); 4918Debug.Assert(waitResult, "expected wait to succeed"); 5224Debug.Assert(exceptions != null, "Should have seen at least one exception"); 5250Debug.Assert(tasks != null, "Expected a non-null list of tasks"); 5251Debug.Assert(tasks.Count > 0, "Expected at least one task"); 5299Debug.Assert(count > 0, "Expected count > 0"); 5306Debug.Assert(_count >= 0, "Count should never go below 0"); 5349Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed"); 5526Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5528Debug.Assert(signaledTaskIndex >= 0); 5614Debug.Assert(succeeded, "This should always succeed on a new task."); 5628Debug.Assert(succeeded, "This should always succeed on a new task."); 5658Debug.Assert(exception != null); 5662Debug.Assert(succeeded, "This should always succeed on a new task."); 5672Debug.Assert(exception != null); 5676Debug.Assert(succeeded, "This should always succeed on a new task."); 5965Debug.Assert(millisecondsDelay != 0); 6024Debug.Assert(token.CanBeCanceled); 6222Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array"); 6223Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks."); 6298Debug.Assert(failedOrCanceled is Task, $"Expected Task, got {failedOrCanceled}"); 6307Debug.Assert(failedOrCanceled is List<Task>); 6330Debug.Assert(completed); 6362Debug.Assert(failedOrCanceled is Task); 6368Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6380Debug.Assert(IsCompleted); 6383Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0"); 6576Debug.Assert(tasks != null, "Expected a non-null task array"); 6577Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array"); 6615Debug.Assert(task != null, "Constituent task in WhenAll should never be null"); 6628Debug.Assert(task.Status == TaskStatus.RanToCompletion); 6640Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception"); 6661Debug.Assert(m_count >= 0, "Count should never go below 0"); 6802Debug.Assert(task1 != null && task2 != null); 6838Debug.Assert(task1 != null && task2 != null); 6839Debug.Assert(task1.IsCompleted || task2.IsCompleted); 6862Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 7110Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending); 7231Debug.Assert(outerTask != null); 7576Debug.Assert(outerTask != null, "Expected non-null outerTask"); 7630Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed"); 7633Debug.Fail("UnwrapPromise in illegal state"); 7657Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task"); 7658Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!"); 7670Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed"); 7687Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (2)
47Debug.Assert(moveNextTask.IsCompleted); 65Debug.Assert(disposeTask.IsCompleted);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskCache.cs (1)
33Debug.Assert(ExclusiveInt32Max >= InclusiveInt32Min, "Expected max to be at least min");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (36)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>, 31Debug.Assert(antecedent != null, 39Debug.Assert(m_action != null); 51Debug.Fail("Invalid m_action in ContinuationTaskFromTask"); 64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>, 77Debug.Assert(antecedent != null, 85Debug.Assert(m_action != null); 97Debug.Fail("Invalid m_action in ContinuationResultTaskFromTask"); 110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>, 123Debug.Assert(antecedent != null, 131Debug.Assert(m_action != null); 143Debug.Fail("Invalid m_action in ContinuationTaskFromResultTask"); 156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>, 169Debug.Assert(antecedent != null, 177Debug.Assert(m_action != null); 189Debug.Fail("Invalid m_action in ContinuationResultTaskFromResultTask"); 216Debug.Assert(task != null); 217Debug.Assert(task.m_taskScheduler != null); 274Debug.Assert(task != null, "TaskContinuation ctor: task is null"); 275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null"); 291Debug.Assert(completedTask != null); 292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed"); 295Debug.Assert(continuationTask != null); 369Debug.Assert(state is Action); 385Debug.Assert(context != null); 418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation); 466Debug.Assert(scheduler != null); 493Debug.Assert(action != null); 494Debug.Assert(scheduler != null && scheduler != TaskScheduler.Default); 547Debug.Assert(action != null); 563Debug.Assert(action != null); 564Debug.Assert(scheduler != null); 683Debug.Assert(state is Action); 697Debug.Assert(callback != null); 698Debug.Assert(currentTask == Task.t_currentTask); 847Debug.Assert(m_action != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (17)
47Debug.Assert(task != null, "Expected a non-null task."); 92Debug.Assert(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject"); 93Debug.Assert( 109Debug.Assert(exceptionObject != null, "Expected exceptionObject to be non-null."); 111Debug.Assert(m_cancellationException == null, 116Debug.Assert(m_faultExceptions == null, 129Debug.Assert(edi != null && edi.SourceException is OperationCanceledException, 145Debug.Assert(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject"); 173Debug.Assert(exc != null, "No exceptions should be null"); 179Debug.Assert(numExceptions > 0, "Collection should contain at least one exception."); 189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info."); 192Debug.Assert(tmp != null, "No dispatch infos should be null"); 255Debug.Assert(exceptions != null, "Expected an initialized list."); 256Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 284Debug.Assert(exceptions != null, "Expected an initialized list."); 285Debug.Assert(exceptions.Count > 0, "Expected at least one exception."); 300Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (31)
498Debug.Assert((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 642Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 764Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 786Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 881Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 903Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1006Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1028Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1139Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null"); 1161Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1200Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1201Debug.Assert(beginMethod != null, "Expected a non-null beginMethod"); 1202Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1215Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed."); 1243Debug.Assert(thisRef != null, "Expected a non-null thisRef"); 1244Debug.Assert(endMethod != null, "Expected a non-null endMethod"); 1273Debug.Assert(thisRef != null); 1290Debug.Assert(!IsCompleted, "The task should not have been completed yet."); 1319Debug.Assert(successfullySet, "Expected the task to not yet be completed"); 1611Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1637Debug.Assert(continuationAction != null); 1658Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 1682Debug.Assert(state is Func<Task[], TResult>); 1689Debug.Assert(continuationAction != null); 1694Debug.Assert(state is Action<Task[]>); 1982Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2002Debug.Assert(state is Func<Task, TResult>); 2009Debug.Assert(continuationAction != null); 2013Debug.Assert(state is Action<Task>); 2032Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null"); 2055Debug.Assert(continuationAction != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (10)
1554Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1581Debug.Assert(_count >= 0, "Count should never go below 0"); 1598Debug.Assert(tasksCopy != null); 1624Debug.Assert((tasksCopy != null) && (tasksCopy.Length > 0), "Expected non-null task array with at least one element in it"); 1651Debug.Assert(_count >= 0, "Count should never go below 0"); 1668Debug.Assert(tasksCopy != null); 2274Debug.Assert(tasks != null, "Expected non-null collection of tasks"); 2309Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful."); 2317Debug.Assert(tasks != null, "Should not have been nulled out yet."); 2338Debug.Assert(tasks != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (3)
226Debug.Assert(task != null); 506Debug.Assert(scheduler != null, "Table returned an incorrect Count or CopyTo failed"); 599Debug.Assert(s is Task);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
35Debug.Assert(s is Task);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
548Diagnostics.Debug.Assert(stateMachineBox != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (13)
182Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 308Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 331Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 353Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 380Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 401Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 423Debug.Assert(valueTask._obj is null or Task or IValueTaskSource, "If the ValueTask<>'s backing object is an IValueTaskSource<TResult>, it must also be IValueTaskSource."); 586Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 718Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 741Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 763Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 790Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 814Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (11)
44Debug.Assert(state != null); 288Debug.Assert(startHelper != null); 392Debug.Assert(thread != null); 418Debug.Assert(ThreadState.HasFlag(ThreadState.Unstarted) || this == CurrentThread); 419Debug.Assert(IsThreadPoolThread); 431Debug.Assert(this == CurrentThread); 432Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 443Debug.Assert(this == CurrentThread); 444Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 445Debug.Assert(_mayNeedResetForThreadPool); 717Debug.Assert(slot.Data != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Thread.Unix.cs (2)
47Debug.Assert((ThreadState & ThreadState.Unstarted) == 0 || (millisecondsTimeout == 0)); 79Debug.Assert(!waitHandle.IsClosed);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadBlockingInfo.cs (6)
53Debug.Assert(objectPtr != null); 64Debug.Assert(_objectPtr != null); 65Debug.Assert(t_first != null); 66Debug.Assert(t_first->_next == _next); 82Debug.Assert(_objectPtr != null); 90Debug.Assert(_objectKind == ObjectKind.Condition);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadInt64PersistentCounter.cs (4)
97Debug.Assert(counter != null); 149Debug.Assert(count != 0); 164Debug.Assert(count != 0); 190Debug.Assert(node != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (8)
178Debug.Assert(id >= 0 || !_initialized, "expected id >= 0 if initialized"); 185Debug.Assert(_linkedSlot != null, "Should be non-null if not yet disposed"); 353Debug.Assert(ts_finalizationHelper != null, "Should have been initialized when this thread's slot array was created."); 396Debug.Assert(_linkedSlot != null, "Should only be null if disposed"); 516Debug.Assert(table.Length < minLength); 554Debug.Assert(minSize > 0); 709Debug.Assert(slotArray != null); 745Debug.Assert(linkedSlot._previous != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.PlatformNotSupported.cs (1)
15Debug.Fail("Unreachable");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (33)
39Debug.Assert(queue != null); 43Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 57Debug.Assert(queue != null); 69Debug.Fail("Should have found the queue"); 202Debug.Assert(m_headIndex <= m_tailIndex); 220Debug.Assert(unused == null || unused == obj); 456Debug.Assert(s_assignableWorkItemQueueCount > 0); 467Debug.Assert(count >= 0); 498Debug.Assert(s_assignableWorkItemQueueCount > 0); 503Debug.Assert(queueIndex >= 0); 516Debug.Assert(_assignedWorkItemQueueThreadCounts[queueIndex] >= 0); 539Debug.Assert(s_assignableWorkItemQueueCount > 0); 552Debug.Assert(newCount >= 0); 584Debug.Assert(ThreadPoolWorkQueueThreadLocals.threadLocals == null); 612Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 681Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 810Debug.Assert(c > 0, "There must at least be a queue for this thread."); 834Debug.Assert(!tl.isProcessingHighPriorityWorkItems); 1080Debug.Assert(ThreadPool.EnableWorkerTracking); 1081Debug.Assert(currentThread == Thread.CurrentThread); 1108Debug.Assert(workItem is IThreadPoolWorkItem); 1171Debug.Assert(_executed, "A QueueUserWorkItemCallback was never called!"); 1179Debug.Assert(!Interlocked.Exchange(ref _executed, true), "A QueueUserWorkItemCallback was called twice!"); 1192Debug.Assert(quwi._callback != null); 1201Debug.Assert(context != null); 1224Debug.Assert(callback != null); 1235Debug.Assert(_callback != null); 1250Debug.Assert(callback != null); 1261Debug.Assert(_callback != null); 1278Debug.Assert(callback != null); 1289Debug.Assert(_callback != null); 1334Debug.Assert(helper != null, "Null state passed to PerformWaitOrTimerCallback!"); 1659Debug.Assert(null != workItem);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
22Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (10)
206Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "A timer in the list must have a valid due time."); 376Debug.Assert(timer._dueTime != Timeout.UnsignedInfinite, "Expected timer to be on a list."); 377Debug.Assert(timer._short != shortList, "Unnecessary if timer is already on the right list."); 402Debug.Assert(timer._short); 407Debug.Assert(!timer._short); 425Debug.Assert(ActiveCount >= 0); 576Debug.Assert(toSignal != null); 642Debug.Assert( 693Debug.Assert(toSignal is WaitHandle || toSignal is Task); 731Debug.Assert(state is TimerQueueTimer);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
31Debug.Assert(s_scheduledTimers == null); 52Debug.Assert((int)actualDuration >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (9)
113Debug.Assert(millisecondsTimeout >= -1); 243Debug.Assert(waitHandles.Length > 0); 244Debug.Assert(waitHandles.Length <= MaxWaitHandles); 283Debug.Assert(lastSafeWaitHandle != null); 368Debug.Assert(safeWaitHandles.Length != 0); 369Debug.Assert(safeWaitHandles.Length <= MaxWaitHandles); 370Debug.Assert(millisecondsTimeout >= -1); 381Debug.Assert(safeWaitHandles[i] != null); 391Debug.Assert(safeWaitHandles[i] != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.HandleManager.Unix.cs (5)
22Debug.Assert(waitInfo.Thread == Thread.CurrentThread); 24Debug.Assert(timeoutMilliseconds >= -1); 47Debug.Assert(waitableObject != null); 52Debug.Assert(handle != IntPtr.Zero); 53Debug.Assert(handle != new IntPtr(-1));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.ThreadWaitInfo.Unix.cs (49)
101Debug.Assert(thread != null); 135Debug.Assert(_thread == Thread.CurrentThread); 136Debug.Assert(_waitedCount == 0); 141Debug.Assert(_waitedObjects[i] == null); 155Debug.Assert(_thread == Thread.CurrentThread); 156Debug.Assert(_waitedCount == 0); 180Debug.Assert(_thread == Thread.CurrentThread); 182Debug.Assert(waitedCount > (isWaitForAll ? 1 : 0)); 183Debug.Assert(waitedCount <= _waitedObjects.Length); 185Debug.Assert(_waitedCount == 0); 191Debug.Assert(waitedObjects[i] != null); 195Debug.Assert(waitedObjects[i] == null); 230Debug.Assert(_waitedCount > (_isWaitForAll ? 1 : 0)); 244Debug.Assert(_thread == Thread.CurrentThread); 254Debug.Assert(_waitedObjectIndexThatSatisfiedWait >= 0); 262Debug.Assert(_waitedObjectIndexThatSatisfiedWait >= 0); 269Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 273Debug.Assert(_waitSignalState == WaitSignalState.NotWaiting_SignaledToInterruptWait); 274Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 289Debug.Assert(_thread == Thread.CurrentThread); 291Debug.Assert(timeoutMilliseconds >= -1); 292Debug.Assert(timeoutMilliseconds != 0); // caller should have taken care of it 305Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 306Debug.Assert(_waitSignalState == WaitSignalState.NotWaiting); 326Debug.Assert(waitResult != WaitHandle.WaitTimeout); 355Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 370Debug.Assert(isSleep == (_waitedCount == 0)); 394Debug.Assert(timeoutMilliseconds >= -1); 413Debug.Assert(waitResult == WaitHandle.WaitTimeout); 419Debug.Assert(_thread != Thread.CurrentThread); 421Debug.Assert(registeredListNode != null); 422Debug.Assert(registeredListNode.WaitInfo == this); 423Debug.Assert(registeredListNode.WaitedObjectIndex >= 0); 424Debug.Assert(registeredListNode.WaitedObjectIndex < _waitedCount); 426Debug.Assert(_waitedCount > (_isWaitForAll ? 1 : 0)); 464Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 500Debug.Assert(_waitedObjectIndexThatSatisfiedWait < 0); 519Debug.Assert(s_lock.IsLocked || _waitMonitor.IsLocked); 593Debug.Assert(LockedMutexesHead != waitableObject); 623Debug.Assert(waitInfo != null); 624Debug.Assert(waitedObjectIndex >= 0); 625Debug.Assert(waitedObjectIndex < WaitHandle.MaxWaitHandles); 685Debug.Assert(_waitInfo.Thread == Thread.CurrentThread); 687Debug.Assert(waitableObject != null); 689Debug.Assert(_previous == null); 690Debug.Assert(_next == null); 708Debug.Assert(waitableObject != null); 720Debug.Assert(waitableObject.WaitersHead == this); 731Debug.Assert(waitableObject.WaitersTail == this);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.Unix.cs (19)
193Debug.Assert(acquiredLock); 280Debug.Assert(waitableObject != null); 300Debug.Assert(waitableObject != null); 315Debug.Assert(count > 0); 321Debug.Assert(waitableObject != null); 322Debug.Assert(count > 0); 342Debug.Assert(waitableObject != null); 357Debug.Assert(timeoutMilliseconds >= -1); 366Debug.Assert(waitableObject != null); 367Debug.Assert(timeoutMilliseconds >= -1); 377Debug.Assert(waitHandles.Length > 0); 378Debug.Assert(waitHandles.Length <= WaitHandle.MaxWaitHandles); 379Debug.Assert(timeoutMilliseconds >= -1); 398Debug.Assert(waitHandles[i] != IntPtr.Zero); 459Debug.Assert(timeoutMilliseconds >= -1); 474Debug.Assert(waitableObjectToSignal != null); 475Debug.Assert(waitableObjectToWaitOn != null); 476Debug.Assert(timeoutMilliseconds >= -1); 518Debug.Assert(thread != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\WaitSubsystem.WaitableObject.Unix.cs (85)
48Debug.Assert(initialSignalCount >= 0); 49Debug.Assert(maximumSignalCount > 0); 50Debug.Assert(initialSignalCount <= maximumSignalCount); 62Debug.Assert((resetMode == EventResetMode.AutoReset) || (resetMode == EventResetMode.ManualReset)); 172Debug.Assert(!result || _maximumSignalCount == 1); 173Debug.Assert(!result || _ownershipInfo == null); 185Debug.Assert(!result || _maximumSignalCount == 1); 186Debug.Assert(!result || _ownershipInfo == null); 198Debug.Assert(!result || _maximumSignalCount == 1); 199Debug.Assert(!result || _ownershipInfo == null); 211Debug.Assert(!result || _maximumSignalCount > 0); 212Debug.Assert(!result || _ownershipInfo == null); 224Debug.Assert(!result || _maximumSignalCount == 1); 225Debug.Assert(!result || _ownershipInfo != null); 274Debug.Assert(isSignaled || !IsMutex || (_ownershipInfo != null && _ownershipInfo.Thread != null)); 282Debug.Assert(IsSignaled); 295Debug.Assert(_type == WaitableObjectType.Mutex); 298Debug.Assert(_ownershipInfo!.Thread == null); 311Debug.Assert(waitInfo != null); 312Debug.Assert(waitInfo.Thread == Thread.CurrentThread); 314Debug.Assert(timeoutMilliseconds >= -1); 315Debug.Assert(!interruptible || !waitInfo.CheckAndResetPendingInterrupt); 361Debug.Assert(waitInfo != null); 362Debug.Assert(waitInfo.Thread == Thread.CurrentThread); 364Debug.Assert(waitableObjects != null); 365Debug.Assert(waitableObjects.Length >= count); 366Debug.Assert(count > 1); 367Debug.Assert(timeoutMilliseconds >= -1); 384Debug.Assert(waitableObject != null); 421Debug.Assert(waitableObject != null); 461Debug.Assert(waitableObject.IsMutex); 463Debug.Assert(ownershipInfo.Thread == waitInfo.Thread); 509Debug.Assert(waitingThread != null); 510Debug.Assert(waitingThread != Thread.CurrentThread); 511Debug.Assert(waitedObjects != null); 512Debug.Assert(waitedObjects.Length >= waitedCount); 513Debug.Assert(waitedCount > 1); 514Debug.Assert(signaledWaitedObjectIndex >= 0); 515Debug.Assert(signaledWaitedObjectIndex <= WaitHandle.MaxWaitHandles); 516Debug.Assert(!wouldAnyMutexReacquireCountOverflow); 520Debug.Assert(waitedObjects[i] != null); 564Debug.Assert(waitInfo != null); 565Debug.Assert(waitInfo.Thread != Thread.CurrentThread); 566Debug.Assert(waitedObjects != null); 567Debug.Assert(waitedObjects.Length >= waitedCount); 568Debug.Assert(waitedCount > 1); 569Debug.Assert(signaledWaitedObjectIndex >= 0); 570Debug.Assert(signaledWaitedObjectIndex <= WaitHandle.MaxWaitHandles); 574Debug.Assert(waitedObjects[i] != null); 587Debug.Assert(waitedObject.IsMutex); 589Debug.Assert(ownershipInfo.Thread == waitInfo.Thread); 597Debug.Assert(count > 0); 602Debug.Assert(count == 1); 607Debug.Assert(count == 1); 616Debug.Assert(count == 1); 646Debug.Assert(IsManualResetEvent); 669Debug.Assert(IsAutoResetEvent); 712Debug.Assert(count > 0); 721Debug.Assert(oldSignalCount <= _maximumSignalCount); 777Debug.Assert(IsMutex); 778Debug.Assert(!IsSignaled); 793Debug.Assert(IsMutex); 794Debug.Assert(!IsSignaled); 795Debug.Assert(_ownershipInfo != null); 856Debug.Assert(waitableObject != null); 857Debug.Assert(waitableObject.IsMutex); 858Debug.Assert(waitableObject._ownershipInfo == this); 860Debug.Assert(_thread == null); 861Debug.Assert(_reacquireCount == 0); 862Debug.Assert(_previous == null); 863Debug.Assert(_next == null); 881Debug.Assert(waitableObject != null); 882Debug.Assert(waitableObject.IsMutex); 883Debug.Assert(waitableObject._ownershipInfo == this); 885Debug.Assert(_thread != null); 887Debug.Assert(isAbandoned ? _reacquireCount >= 0 : _reacquireCount == 0); 888Debug.Assert(!_isAbandoned); 907Debug.Assert(waitInfo.LockedMutexesHead == waitableObject); 924Debug.Assert(_thread != null); 925Debug.Assert(_reacquireCount >= 0); 926Debug.Assert(!_isAbandoned); 934Debug.Assert(CanIncrementReacquireCount); 942Debug.Assert(_thread == Thread.CurrentThread); 943Debug.Assert(_reacquireCount >= 0); 944Debug.Assert(!_isAbandoned);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (3)
714Debug.Assert(array.Length - offset < count); 1064Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 1252Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (4)
921Debug.Assert(result != ParseFailureKind.None); 928Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 988Debug.Assert(charsWritten == destination.Length); 994Debug.Assert(charsWritten == destination.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
436System.Diagnostics.Debug.Assert(minUnits < 0); 437System.Diagnostics.Debug.Assert(maxUnits > 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.AdjustmentRule.cs (1)
243Diagnostics.Debug.Assert(daylightDelta <= MaxDaylightDelta && daylightDelta >= -MaxDaylightDelta,
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Cache.cs (9)
106Debug.Assert(boundary <= _yearsTransitionsCount && transitions is not null); 213Debug.Assert(boundary <= _yearsTransitionsCount && transitions is not null); 255Debug.Assert(boundary <= _yearsTransitionsCount && transitions is not null); 322Debug.Assert(boundary <= _yearsTransitionsCount && transitions is not null); 394Debug.Assert(boundary <= _yearsTransitionsCount && transitions is not null); 461Debug.Assert(_adjustmentRules is not null && _adjustmentRules.Length > 0); 637Debug.Assert(_adjustmentRules is not null && _adjustmentRules.Length > 0); 648Debug.Assert(ruleIndex < _adjustmentRules.Length); 1341Debug.Assert(count > 0 && allTransitions is not null && count < allTransitions.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (5)
505Debug.Assert(e is InvalidTimeZoneException, 723Debug.Assert(dateTime.Kind != DateTimeKind.Utc); 1204Debug.Assert(zone != null); 1215Debug.Assert(Monitor.IsEntered(cachedData)); 1280Debug.Assert(!Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (1)
77Debug.Assert(!GlobalizationMode.Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (5)
289Debug.Assert(Monitor.IsEntered(cachedData)); 329Debug.Assert(Monitor.IsEntered(cachedData)); 932Debug.Assert(!date.IsEmpty); 933Debug.Assert(date[0] == 'J'); 964Debug.Assert(i > 0 && i < days.Length);
src\runtime\src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (5)
75Debug.Assert(!Invariant); 309Debug.Assert(!Invariant); 351Debug.Assert(!Invariant); 414Debug.Assert(!Invariant); 488Debug.Assert(!Invariant);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Tuple.cs (1)
1248Debug.Fail("Missed all cases for computing Tuple hash code");
src\runtime\src\libraries\System.Private.CoreLib\src\System\UInt128.cs (15)
541Debug.Assert(value >= 0); 542Debug.Assert(double.IsFinite(value)); 543Debug.Assert(value < TwoPow128); 791Debug.Assert(left > right); 792Debug.Assert(right > ulong.MaxValue); 861Debug.Assert(valHi - chkHi is 0 or 1); 862Debug.Assert(left == right * q + (rem >> shift)); 917Debug.Assert(hi < divisor); 918Debug.Assert(BitOperations.LeadingZeroCount(divisor) == 0); 941Debug.Assert(rem < divisor); 942Debug.Assert(Math.BigMul(quo, divisor) + rem == (new UInt128(hi, lo))); 979Debug.Assert(chkHiUL <= uint.MaxValue); 985Debug.Assert(new UInt128(valHi, valMiLo) < new UInt128(chkHi, chkLo)); 997Debug.Assert(remainder < divisor); 998Debug.Assert(new UInt128(valHi, valMiLo) == new UInt128(chkHi, chkLo) + remainder);
src\runtime\src\libraries\System.Private.CoreLib\src\System\ValueTuple.cs (2)
2079Debug.Fail("Missed all cases for computing ValueTuple hash code"); 2154Debug.Fail("Missed all cases for computing ValueTuple hash code");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
86Debug.Assert(version != null); 176Debug.Assert(success); 206Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (1)
233Debug.Assert(this.GetType() != typeof(WeakReference));
src\runtime\src\libraries\System.Private.CoreLib\src\System\WeakReference.T.cs (1)
175Debug.Fail(" WeakReference<T> finalizer should never run");
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeName.cs (3)
231Debug.Fail("Pre-allocated full name should have been provided in the ctor"); 345Debug.Assert(_fullName is not null); 391Debug.Assert(rootTypeName._fullName is not null);
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParser.cs (2)
64Debug.Assert(parsedName.GetNodeCount() == recursiveDepth, $"Node count mismatch for '{typeName.ToString()}'"); 275Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
src\runtime\src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (7)
180Debug.Assert(rankOrModifier >= 2); 360Debug.Fail("Expected to be unreachable"); 371Debug.Fail("Expected to be unreachable"); 382Debug.Fail("Expected to be unreachable"); 393Debug.Fail("Expected to be unreachable"); 404Debug.Fail("Expected to be unreachable"); 415Debug.Fail("Expected to be unreachable");
System\ActivatorImplementation.cs (1)
125Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs);
System\Array.NativeAot.cs (20)
92Debug.Assert(arrayType.IsArray); 93Debug.Assert(arrayType.GetArrayRank() == rank); 132Debug.Assert(eeType->IsArray && !eeType->IsSzArray); 133Debug.Assert(rank == eeType->ArrayRank); 140Debug.Assert(rank != 1); 161Debug.Assert(eeType->NumVtableSlots != 0, "Compiler enforces we never have unconstructed MTs for multi-dim arrays since those can be template-constructed anytime"); 180Debug.Assert(pEEType->IsArray && !pEEType->IsSzArray); 181Debug.Assert(nDimensions > 0); 184Debug.Assert(pEEType->ArrayRank > 1); 188Debug.Assert(rank == nDimensions || 2 * rank == nDimensions); 213Debug.Assert(pEEType->IsArray); 214Debug.Assert(nDimensions > 0); 216Debug.Assert(pEEType->ArrayRank == 1); 226Debug.Assert(elementType->IsSzArray); 239Debug.Assert(rank == nDimensions || 2 * rank == nDimensions); 281Debug.Assert(!this.GetMethodTable()->IsSzArray); 381Debug.Assert((nuint)flattenedIndex < NativeLength); 395Debug.Assert(!pElementEEType->IsPointer && !pElementEEType->IsFunctionPointer); 402Debug.Assert((nuint)flattenedIndex < NativeLength); 414Debug.Assert(value == null || RuntimeImports.AreTypesAssignable(value.GetMethodTable(), pElementEEType));
System\Attribute.NativeAot.cs (3)
21Debug.Assert(index < 0); 43Debug.Assert(!fieldType->IsPointer && !fieldType->IsFunctionPointer); 70Debug.Assert(!fieldType->IsPointer && !fieldType->IsFunctionPointer);
System\CrashInfo.cs (4)
64Debug.Assert(success); 66Debug.Assert(success); 368Debug.Assert(success); // Should never fail because of the reservation 401Debug.Assert(size > 0);
System\Delegate.cs (3)
375Debug.Assert(delegateEEType != null); 376Debug.Assert(delegateEEType->IsCanonical); 685Debug.Assert(obj is Delegate, "Shouldn't have failed here since we already checked the types are the same!");
System\Diagnostics\StackFrame.NativeAot.cs (3)
72Debug.Assert(RuntimeImports.RhFindMethodStartAddress(_ipAddress) == startAddress); 85Debug.Assert(RuntimeImports.RhFindMethodStartAddress(_ipAddress) == methodStartAddress); 261Debug.Assert(_methodSignature == null);
System\Diagnostics\StackTrace.NativeAot.cs (3)
22Debug.Assert(frameCount >= 0); 25Debug.Assert(trueFrameCount == frameCount); 73Debug.Assert(outputFrameIndex == outputFrameCount);
System\EETypePtr.cs (1)
74Debug.Assert((byte)CorElementType.ELEMENT_TYPE_FNPTR == map[(int)EETypeElementType.FunctionPointer]);
System\Enum.NativeAot.cs (7)
26Debug.Assert(enumType != null); 27Debug.Assert(enumType.IsEnum); 37Debug.Assert(enumType != null); 38Debug.Assert(enumType.IsEnum); 39Debug.Assert( 57Debug.Assert(rt.IsActualEnum); 134Debug.Assert(enumType.IsActualEnum);
System\GC.NativeAot.cs (9)
341Debug.Assert(false); 354Debug.Assert(pWorkItem->scheduled); 445Debug.Assert(status == StartNoGCRegionStatus.Succeeded); 601Debug.Assert(PressureCount == 4, "GC.AddMemoryPressure contains unrolled loops which depend on the PressureCount"); 620Debug.Assert(rem != 0); 665Debug.Assert(name != null); 666Debug.Assert(configurationContext != null); 669Debug.Assert(context.Configurations != null); 910Debug.Assert(status == RefreshMemoryStatus.Succeeded);
System\InvokeUtils.cs (15)
53Debug.Assert(!dstEEType->IsByRefLike); 174Debug.Assert(CanPrimitiveWiden(dstType, srcType) && dstType != srcType); 201Debug.Fail("Expected to be unreachable"); 225Debug.Fail("Expected to be unreachable"); 253Debug.Fail("Expected to be unreachable"); 274Debug.Fail("Expected to be unreachable"); 292Debug.Fail("Expected to be unreachable"); 311Debug.Fail("Expected to be unreachable"); 326Debug.Fail("Expected to be unreachable"); 341Debug.Fail("Expected to be unreachable"); 353Debug.Fail("Expected to be unreachable"); 359Debug.Fail("Expected to be unreachable"); 367Debug.Assert(dstType is < EETypeElementType.ValueType and >= EETypeElementType.Boolean); 368Debug.Assert(srcType is < EETypeElementType.ValueType and >= EETypeElementType.Boolean); 424Debug.Fail("Unexpected CheckArgumentSemantics value: " + semantics);
System\Reflection\BinderBundle.cs (1)
20Debug.Assert(binder != null && binder != Type.DefaultBinder, "Not permitted to allocate a BinderBundle for the default Binder. Must pass a null BinderBundle instread.");
System\Reflection\DynamicInvokeInfo.cs (23)
82Debug.Assert(!argumentType.IsByRef); 88Debug.Assert(argumentType.IsValueType); 98Debug.Assert(argumentType.IsPointer); 104Debug.Assert(argumentType.IsFunctionPointer); 128Debug.Assert(!returnType.IsByRef); 134Debug.Assert(returnType.IsValueType); 155Debug.Assert(returnType.IsPointer); 163Debug.Assert(returnType.IsFunctionPointer); 201Debug.Assert(thisPtr != null); 269Debug.Assert(thisPtr != null); 327Debug.Assert(_argumentCount <= MaxStackAllocArgCount); 335Debug.Assert(thisPtr != null); 493Debug.Assert(_argumentCount <= MaxStackAllocArgCount); 525Debug.Assert(_argumentCount <= MaxStackAllocArgCount); 549Debug.Assert(_argumentCount <= MaxStackAllocArgCount); 690Debug.Assert(parameters.Length <= MaxStackAllocArgCount); 791Debug.Assert(type.IsPointer); 825Debug.Assert(type.IsPointer); 845Debug.Assert((_returnTransform & Transform.ByRef) != 0); 856Debug.Assert(type.IsPointer); 861Debug.Assert(Type.GetTypeFromMethodTable(_returnType).IsFunctionPointer); 866Debug.Assert((_returnTransform & Transform.ByRef) != 0); 871Debug.Assert((_returnTransform & (Transform.ByRef | Transform.Nullable)) != 0);
System\Reflection\EnumInfo.cs (3)
34Debug.Assert(values.Length == names.Length); 35Debug.Assert(Enum.AreSorted(values)); 47Debug.Assert(sizeof(TStorage) == sizeof(TResult));
System\Reflection\ModifiedType.NativeAot.cs (10)
9using Debug = System.Diagnostics.Debug; 37Debug.Assert(index == 0); 40Debug.Assert(index == 0); 43Debug.Assert(index == 0); 46Debug.Assert(index == 0); 55Debug.Assert(index <= functionSig.Parameters.Count); 65Debug.Assert(index < typeInst.GenericTypeArguments.Count); 73Debug.Fail(handle.HandleType.ToString()); 85Debug.Assert((int)Internal.Metadata.NativeFormat.SignatureCallingConvention.StdCall == (int)SignatureCallingConvention.StdCall); 86Debug.Assert((int)Internal.Metadata.NativeFormat.SignatureCallingConvention.Unmanaged == (int)SignatureCallingConvention.Unmanaged);
System\Reflection\Runtime\Assemblies\RuntimeAssemblyInfo.cs (1)
111Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (2)
29Debug.Assert(reflectedType.Equals(type)); // Constructor queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type. 60Debug.Fail("This code path should be unreachable.");
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (1)
39Debug.Assert(reflectedType.Equals(type)); // NestedType queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (6)
61Debug.Assert(index >= 0 && index < _totalCount); 69Debug.Assert(index >= 0 && index < _totalCount); 163Debug.Assert((allFlagsThatMustMatch & ~validBits) == 0); 164Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Public) == 0) != ((allFlagsThatMustMatch & BindingFlags.NonPublic) == 0)); 165Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Instance) == 0) != ((allFlagsThatMustMatch & BindingFlags.Static) == 0)); 166Debug.Assert((allFlagsThatMustMatch & BindingFlags.FlattenHierarchy) == 0 || (allFlagsThatMustMatch & BindingFlags.Static) != 0);
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (3)
25Debug.Assert(methodBase is not null); 26Debug.Assert(argumentTypes is not null); 68Debug.Assert((callConv & CallingConventions.VarArgs) != 0);
System\Reflection\Runtime\CustomAttributes\RuntimeCustomAttributeData.cs (1)
185Debug.Assert(value is string or (not IEnumerable));
System\Reflection\Runtime\Dispensers\DispenserFactory.cs (1)
43Debug.Assert(algorithm != DispenserAlgorithm.ReuseAsLongAsKeyIsAlive,
System\Reflection\Runtime\General\Assignability.cs (4)
186Debug.Assert(!(fromTypeInfo.IsArray || fromTypeInfo.IsByRef || fromTypeInfo.IsPointer || fromTypeInfo.IsGenericParameter)); 187Debug.Assert(!(toTypeInfo.IsArray || toTypeInfo.IsByRef || toTypeInfo.IsPointer || toTypeInfo.IsGenericParameter)); 348Debug.Assert(fromTypeInfo.IsArray); 349Debug.Assert(toTypeInfo.IsInterface);
System\Reflection\Runtime\General\Helpers.cs (3)
35Debug.Assert(type.IsGenericTypeDefinition); 60Debug.Assert(false); 120Debug.Assert(delegateType.IsDelegate);
System\Reflection\Runtime\General\Helpers.NativeFormat.cs (1)
16Debug.Assert(type is NativeFormatRuntimeNamedTypeInfo);
System\Reflection\Runtime\General\ListBuilder.cs (2)
28Debug.Assert(index < Count); 38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\Runtime\General\MetadataReaderExtensions.cs (1)
13using Debug = System.Diagnostics.Debug;
System\Reflection\Runtime\General\MetadataReaderExtensions.NativeFormat.cs (23)
78Debug.Assert(handleType == HandleType.TypeDefinition || handleType == HandleType.TypeReference || handleType == HandleType.TypeSpecification || handleType == HandleType.ModifiedType); 103Debug.Assert(handleType == HandleType.TypeDefinition || handleType == HandleType.TypeReference || handleType == HandleType.TypeSpecification || handleType == HandleType.ModifiedType); 667Debug.Assert(i == count); 680Debug.Assert(i == count); 693Debug.Assert(i == count); 706Debug.Assert(i == count); 719Debug.Assert(i == count); 731Debug.Assert(enumType.IsEnum); 743Debug.Assert(i == count); 755Debug.Assert(enumType.IsEnum); 767Debug.Assert(i == count); 779Debug.Assert(enumType.IsEnum); 791Debug.Assert(i == count); 803Debug.Assert(enumType.IsEnum); 815Debug.Assert(i == count); 827Debug.Assert(enumType.IsEnum); 839Debug.Assert(i == count); 851Debug.Assert(enumType.IsEnum); 863Debug.Assert(i == count); 875Debug.Assert(enumType.IsEnum); 887Debug.Assert(i == count); 899Debug.Assert(enumType.IsEnum); 911Debug.Assert(i == count);
System\Reflection\Runtime\General\QHandles.NativeFormat.cs (5)
25public MetadataReader NativeFormatReader { get { Debug.Assert(IsNativeFormatMetadataBased); return _reader as MetadataReader; } } 26public MethodHandle NativeFormatHandle { get { Debug.Assert(IsNativeFormatMetadataBased); return _handle.AsHandle().ToMethodHandle(NativeFormatReader); } } 45public MetadataReader NativeFormatReader { get { Debug.Assert(IsNativeFormatMetadataBased); return _reader as MetadataReader; } } 46public TypeDefinitionHandle NativeFormatHandle { get { Debug.Assert(IsNativeFormatMetadataBased); return _handle.AsHandle().ToTypeDefinitionHandle(NativeFormatReader); } } 66Debug.Assert(handle.IsTypeDefRefOrSpecHandle(reader));
System\Reflection\Runtime\General\QSignatureTypeHandle.NativeFormat.cs (1)
27Debug.Assert(handle.IsTypeDefRefSpecOrModifiedTypeHandle(reader));
System\Reflection\Runtime\General\ThunkedApis.cs (2)
207Debug.Assert(fullname != null); 216Debug.Assert(fullname.Equals(ns + "." + name));
System\Reflection\Runtime\General\TypeForwardInfo.cs (3)
12Debug.Assert(redirectedAssemblyName != null); 13Debug.Assert(namespaceName != null); 14Debug.Assert(typeName != null);
System\Reflection\Runtime\General\TypeUnifier.cs (4)
96Debug.Assert(multiDim || rank == 1); 110Debug.Assert(multiDim || rank == 1); 175Debug.Assert(rank > 0); 184Debug.Assert(multiDim || rank == 1);
System\Reflection\Runtime\MethodInfos\CustomMethodInvoker.cs (4)
73Debug.Assert(copyBackArguments is not null); 88Debug.Assert((_options & InvokerOptions.AllowNullThis) != 0); 95Debug.Assert((_options & InvokerOptions.AllowNullThis) != 0); 102Debug.Assert((_options & InvokerOptions.AllowNullThis) != 0);
System\Reflection\Runtime\MethodInfos\CustomMethodMapper.cs (1)
68Debug.Assert(methodBase == methodBase.MetadataDefinitionMethod);
System\Reflection\Runtime\MethodInfos\NativeFormat\NativeFormatMethodCommon.cs (1)
190Debug.Assert(genericArgs == null || genericArgs.Length > 0);
System\Reflection\Runtime\MethodInfos\RuntimeMethodInfo.cs (1)
310Debug.Assert(runtimeDelegateType.IsDelegate);
System\Reflection\Runtime\MethodInfos\RuntimeSyntheticMethodInfo.cs (1)
216Debug.Assert(ReflectedType.Equals(DeclaringType));
System\Reflection\Runtime\MethodInfos\VirtualRuntimeParameterInfoArray.cs (1)
24Debug.Assert(count >= 1);
System\Reflection\Runtime\Modules\RuntimeModule.cs (1)
77Debug.Assert(this.Equals(Assembly.ManifestModule)); // We only support single-module assemblies so we have to be the manifest module.
System\Reflection\Runtime\ParameterInfos\NativeFormat\NativeFormatMethodParameterInfo.cs (1)
33Debug.Assert(QualifiedParameterTypeHandle.Reader is MetadataReader);
System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeGenericParameterTypeInfoForMethods.cs (1)
22Debug.Assert(declaringRuntimeNamedMethodInfo.DeclaringType.IsTypeDefinition);
System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeNamedTypeInfo.cs (1)
209Debug.Assert(IsActualEnum);
System\Reflection\Runtime\TypeInfos\NativeFormat\NativeFormatRuntimeNamedTypeInfo.UnificationKey.cs (1)
58Debug.Assert(TypeHandle.Equals(other.TypeHandle));
System\Reflection\Runtime\TypeInfos\RuntimeArrayTypeInfo.cs (1)
26Debug.Assert(multiDim || rank == 1);
System\Reflection\Runtime\TypeInfos\RuntimeConstructedGenericTypeInfo.UnificationKey.cs (1)
60Debug.Assert(TypeHandle.Equals(other.TypeHandle));
System\Reflection\Runtime\TypeInfos\RuntimeFunctionPointerTypeInfo.UnificationKey.cs (1)
64Debug.Assert(TypeHandle.Equals(other.TypeHandle));
System\Reflection\Runtime\TypeInfos\RuntimeGenericParameterTypeInfo.cs (1)
107Debug.Fail("Since this class always returns null for FullName, this helper should be unreachable.");
System\Reflection\Runtime\TypeInfos\RuntimeHasElementTypeInfo.cs (1)
121Debug.Assert(IsByRef || IsPointer);
System\Reflection\Runtime\TypeInfos\RuntimeHasElementTypeInfo.UnificationKey.cs (1)
51Debug.Assert(TypeHandle.Equals(other.TypeHandle));
System\Reflection\Runtime\TypeInfos\RuntimeNamedTypeInfo.cs (3)
92Debug.Assert(!IsConstructedGenericType); 93Debug.Assert(!IsGenericParameter); 94Debug.Assert(!HasElementType);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.BindingFlags.cs (9)
16Debug.Assert(types != null); 57Debug.Assert(name != null); 63Debug.Assert(genericParameterCount == GenericParameterCountAny); 64Debug.Assert(binder == null); 65Debug.Assert(callConvention == CallingConventions.Any); 66Debug.Assert(modifiers == null); 103Debug.Assert(name != null); 109Debug.Assert(binder == null); 110Debug.Assert(modifiers == null);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.CoreGetDeclared.cs (2)
42Debug.Assert(object.ReferenceEquals(SyntheticConstructors, Array.Empty<RuntimeConstructorInfo>())); 65Debug.Assert(object.ReferenceEquals(SyntheticMethods, Array.Empty<RuntimeMethodInfo>()));
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.cs (10)
114Debug.Assert(!IsGenericParameter); 150Debug.Assert(!IsGenericParameter); 162Debug.Assert(!IsGenericParameter); 375Debug.Assert(!IsArray); 389Debug.Assert(!IsGenericParameter); 398Debug.Assert(!IsGenericTypeDefinition && !IsConstructedGenericType); 601Debug.Assert(!HasElementType); 613Debug.Assert(!IsConstructedGenericType); 656Debug.Assert(!(this is RuntimeNamedTypeInfo)); 779Debug.Assert(attribute.ConstructorArguments.Count == 1 && attribute.ConstructorArguments[0].Value is string);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.GetMember.cs (1)
92Debug.Assert(numCopied == numMatches);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.InvokeMember.cs (7)
125Debug.Assert(IsSetField); 172Debug.Assert(providedArgs != null); 243Debug.Assert(!IsSetField); 250Debug.Assert(isSetProperty); 252Debug.Assert(!IsGetField); 274Debug.Assert(semiFinalist != null); 302Debug.Assert(finalists == null || finalist != null);
System\Reflection\Runtime\TypeInfos\RuntimeTypeInfo.TypeComponentsCache.cs (2)
51Debug.Assert(obj is PerNameQueryCache<M>); 78Debug.Assert(result is QueriedMemberList<M>);
System\Reflection\RuntimeAssemblyName.cs (1)
22Debug.Assert(name != null);
System\Runtime\CompilerServices\ClassConstructorRunner.cs (7)
185Debug.Assert(unmarkCookie == -1); 207Debug.Assert(chainStepCount < Cctor.Count); 337Debug.Assert(resultArray[resultIndex]._pContext == default(StaticClassConstructionContext*)); 352Debug.Assert(s_cctorGlobalLock.IsHeldByCurrentThread); 454Debug.Assert(s_cctorGlobalLock.IsHeldByCurrentThread); 495Debug.WriteLine(format, ToHexString((IntPtr)pContext), ToHexString(threadId)); 505Debug.WriteLine(format, ToHexString((IntPtr)pContext), ToHexString(threadId));
System\Runtime\CompilerServices\RuntimeHelpers.NativeAot.cs (1)
15using Debug = System.Diagnostics.Debug;
System\Runtime\InteropServices\IDynamicInterfaceCastable.cs (5)
13using Debug = System.Diagnostics.Debug; 99Debug.Assert(result); 106Debug.Assert(result1); 109Debug.Assert(result2); 121Debug.Assert(result);
System\Runtime\InteropServices\Marshal.NativeAot.cs (1)
21Debug.Assert(throwIfNotMarshalable);
System\Runtime\InteropServices\PInvokeMarshal.cs (8)
16using Debug = System.Diagnostics.Debug; 141Debug.Assert(pTarget != IntPtr.Zero); 186Debug.Assert(s_thunkPoolHeap != null); 239Debug.Assert(pDelegateCreationStub != IntPtr.Zero); 255Debug.Assert(pContext != IntPtr.Zero); 263Debug.Assert(fnPtr != IntPtr.Zero); 280Debug.Assert(pContext != IntPtr.Zero); 524Debug.Assert(conversionStatus == OperationStatus.Done);
System\Runtime\InteropServices\TrackerObjectManager.NativeAot.cs (5)
33Debug.Assert(referenceTracker != IntPtr.Zero); 51Debug.Assert(!s_hasTrackingStarted); 52Debug.Assert(s_isGlobalPeggingOn); 60Debug.Assert(s_trackerManager != IntPtr.Zero); 85Debug.Assert(s_trackerManager != IntPtr.Zero);
System\Runtime\InteropServices\TypeMapLazyDictionary.NativeAot.cs (2)
52Debug.Fail("Expected exception stub to throw an exception."); 95Debug.Fail("Expected exception stub to throw an exception.");
System\Runtime\ThunkPool.cs (14)
95Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.PageSize) == 0); 99Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) == commonStubAddress); 129Debug.Assert(((nuint)(nint)thunkDataBlock % Constants.PageSize) == 0); 133Debug.Assert(*(IntPtr*)(thunkDataBlock + (int)(Constants.PageSize - IntPtr.Size)) == _commonStubAddress); 152Debug.Assert(_nextAvailableThunkPtr != IntPtr.Zero); 166Debug.Assert(nextNextAvailableThunkPtr != IntPtr.Zero); 171Debug.Assert(nextAvailableThunkPtr != IntPtr.Zero); 179Debug.Assert((thunkIndex % Constants.ThunkDataSize) == 0); 193Debug.Assert(dataAddress != IntPtr.Zero); 196Debug.Assert(IsThunkInHeap(thunkAddress)); 284Debug.Assert(dataAddress != IntPtr.Zero); 285Debug.Assert(IsThunkInHeap(thunkAddress)); 312Debug.Assert(nextThunksBlock != IntPtr.Zero); 336Debug.Assert(nextThunksBlock != IntPtr.Zero);
System\RuntimeType.NativeAot.cs (2)
18using Debug = System.Diagnostics.Debug; 40Debug.Assert(_pUnderlyingEEType == null);
System\String.NativeAot.cs (1)
33Debug.Assert(newStr._stringLength == length);
System\Threading\ManagedThreadId.cs (12)
58Debug.Assert(_left._size == ChildSize); 63Debug.Assert(_right._size == ChildSize); 67Debug.Assert(actualUsed == _used); 68Debug.Assert(_used <= _size); 75Debug.Assert((_size / 2) >= (BitsPerNode / 2)); 114Debug.Assert(ChildSize > 0); 130Debug.Assert(left._used < left._size); 135Debug.Assert(right._used < right._size); 146Debug.Assert(id < _size); 165Debug.Assert((bitmap & (uint)(1 << id)) != 0); 212Debug.Assert(s_idDispenser != null); 226Debug.Assert(id != IdNone);
System\Threading\ObjectHeader.NativeAot.cs (7)
70Debug.Assert(hashOrIndex != 0); 106Debug.Assert(hashOrIndex != 0); 142Debug.Assert(h != 0); 153Debug.Assert((oldBits & BIT_SBLK_IS_HASH_OR_SYNCBLKINDEX) == 0); 221Debug.Assert(SyncTable.s_lock.IsHeldByCurrentThread); 228Debug.Assert(!HasSyncEntryIndex(oldBits)); 491Debug.Assert(obj != null);
System\Threading\SyncTable.cs (13)
135Debug.Assert(s_unusedEntryIndex < s_entries.Length); 142Debug.Assert(!entry.Owner.IsAllocated); 143Debug.Assert(entry.Lock is null); 144Debug.Assert(entry.HashCode == 0); 175Debug.Assert(s_lock.IsHeldByCurrentThread); 195Debug.Assert(oldSize > 0); 196Debug.Assert(ObjectHeader.MASK_HASHCODE_INDEX < int.MaxValue); 207Debug.Assert(oldSize > 1); 240Debug.Assert((0 < syncIndex) && (syncIndex < s_unusedEntryIndex)); 263Debug.Assert(s_lock.IsHeldByCurrentThread); 264Debug.Assert((0 < syncIndex) && (syncIndex < s_unusedEntryIndex)); 274Debug.Assert(s_lock.IsHeldByCurrentThread); 275Debug.Assert((0 < syncIndex) && (syncIndex < s_unusedEntryIndex));
System\Threading\Thread.NativeAot.cs (11)
89Debug.Assert(t_currentThread == null); 92Debug.Assert(currentThread._threadState == (int)ThreadState.Unstarted); 272Debug.Assert((bit & ThreadState.Stopped) == 0, "ThreadState.Stopped bit may be stale; use GetThreadState instead."); 288Debug.Assert(this == CurrentThread); 289Debug.Assert(!GetThreadStateBit(ThreadState.WaitSleepJoin)); 296Debug.Assert(this == CurrentThread); 297Debug.Assert(GetThreadStateBit(ThreadState.WaitSleepJoin)); 328Debug.Assert(iterations <= SpinWaitCoopThreshold); 388Debug.Assert(!waitingForThreadStart, "Leaked threadHandle"); 403Debug.Assert(_startException == null); 440Debug.Assert(startHelper != null);
System\TypeUnificationKey.cs (1)
21Debug.Assert(type != null);
System\ValueType.cs (7)
19using Debug = System.Diagnostics.Debug; 46Debug.Assert(index == GetNumFields); 53Debug.Assert(numFields < 0); 55Debug.Assert(valueTypeSize <= (int)this.GetMethodTable()->ValueTypeSize); 73Debug.Assert(!this.GetMethodTable()->ContainsGCPointers); 127Debug.Assert(!type->ContainsGCPointers); 139Debug.Assert(!fieldType->IsPointer && !fieldType->IsFunctionPointer);
System.Private.CoreLib.Generators (8)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System.Private.DataContractSerialization (377)
src\runtime\src\libraries\Common\src\System\CodeDom\CodeTypeReference.cs (1)
247Debug.Assert(q.Count == 1, "We should have one and only one in the rank queue.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
System\Runtime\Serialization\ClassDataContract.cs (6)
189Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 219Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 385Debug.Assert(context != null); 959Debug.Assert(Members != null); 1107Debug.Assert(method.DeclaringType != null); 1124Debug.Assert(method.DeclaringType != null);
System\Runtime\Serialization\CodeGenerator.cs (9)
25Debug.Assert(s_getTypeFromHandle != null); 39Debug.Assert(s_objectEquals != null); 53Debug.Assert(s_arraySetValue != null); 67Debug.Assert(s_objectToString != null); 81Debug.Assert(s_stringFormat != null); 91Debug.Assert(typeof(Delegate).IsAssignableFrom(delegateType)); 361Debug.Assert(cmp == Cmp.GreaterThanOrEqualTo, "Unexpected cmp"); 694Debug.Fail("Data can only be stored into ArgBuilder or LocalBuilder."); 817Debug.Fail("Char is not a valid schema primitive and should be treated as int in DataContract");
System\Runtime\Serialization\CollectionDataContract.cs (10)
617Debug.Assert(KeyName != null); 618Debug.Assert(ValueName != null); 843Debug.Assert(Kind != CollectionKind.Array, "GetCollectionElementType should not be called on Arrays"); 844Debug.Assert(GetEnumeratorMethod != null, "GetEnumeratorMethod should be non-null for non-Arrays"); 1161Debug.Assert(knownInterfaceType != null); 1171Debug.Assert(getEnumeratorMethod != null); 1232Debug.Assert(addMethodTypeArray != null); 1237Debug.Assert(getEnumeratorMethod != null); 1561Debug.Assert(context != null); 1572Debug.Assert(context != null);
System\Runtime\Serialization\DataContract.cs (4)
427Debug.Fail("DataContract cache overflow"); 1050Debug.Assert(value != null); 1060Debug.Assert(value != null); 2451Debug.Assert(_paramGenericInfos != null);
System\Runtime\Serialization\EnumDataContract.cs (1)
112Debug.Assert(retVal != null); // Enums can only have certain base types. We shouldn't come up empty here.
System\Runtime\Serialization\ExtensionDataReader.cs (16)
340Debug.Fail("ExtensionDataReader in invalid state"); 355Debug.Fail("ExtensionDataReader Name property should only be called for IXmlSerializable"); 368Debug.Fail("ExtensionDataReader HasValue property should only be called for IXmlSerializable"); 381Debug.Fail("ExtensionDataReader BaseURI property should only be called for IXmlSerializable"); 394Debug.Fail("ExtensionDataReader NameTable property should only be called for IXmlSerializable"); 405Debug.Fail("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable"); 415Debug.Fail("ExtensionDataReader GetAttribute method should only be called for IXmlSerializable"); 425Debug.Fail("ExtensionDataReader MoveToAttribute method should only be called for IXmlSerializable"); 437Debug.Fail("ExtensionDataReader ResolveEntity method should only be called for IXmlSerializable"); 447Debug.Fail("ExtensionDataReader ReadAttributeValue method should only be called for IXmlSerializable"); 474Debug.Fail("Encountered invalid data node when deserializing unknown data"); 537Debug.Assert(_element != null); 556Debug.Assert(_element != null); 575Debug.Assert(_element != null); 610Debug.Assert(dataNode.OwnerDocument != null); // OwnerDocument is always set on initialized dataNodes 659Debug.Assert(dataNode.Value != null);
System\Runtime\Serialization\Json\JsonClassDataContract.cs (1)
108Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonCollectionDataContract.cs (2)
131Debug.Assert(context != null); 153Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonDataContract.cs (3)
133Debug.Assert(context != null); 142Debug.Assert(context != null); 204Debug.Fail("DataContract cache overflow");
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (6)
178Debug.Assert(_bytes != null); 179Debug.Assert(_chars != null); 254Debug.Assert(_bytes != null); 255Debug.Assert(_chars != null); 376Debug.Assert(_bytes != null); 440Debug.Assert(_bytes != null);
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (33)
90Debug.Assert(s_boxPointer != null); 103Debug.Assert(s_collectionItemNameProperty != null); 121Debug.Assert(s_ienumeratorGetCurrentMethod != null); 134Debug.Assert(s_getItemContractMethod != null); 147Debug.Assert(s_getJsonDataContractMethod != null); 160Debug.Assert(s_getJsonMemberIndexMethod != null); 173Debug.Assert(s_getRevisedItemContractMethod != null); 186Debug.Assert(s_getUninitializedObjectMethod != null); 199Debug.Assert(s_isStartElementMethod0 != null); 211Debug.Assert(s_isStartElementMethod2 != null); 223Debug.Assert(s_localNameProperty != null); 235Debug.Assert(s_namespaceProperty != null); 247Debug.Assert(s_ienumeratorMoveNextMethod != null); 259Debug.Assert(s_moveToContentMethod != null); 271Debug.Assert(s_nodeTypeProperty != null); 283Debug.Assert(s_onDeserializationMethod != null); 297Debug.Assert(s_readJsonValueMethod != null); 309Debug.Assert(s_serializationExceptionCtor != null); 322Debug.Assert(s_throwDuplicateMemberExceptionMethod != null); 334Debug.Assert(s_throwMissingRequiredMembersMethod != null); 346Debug.Assert(s_typeHandleProperty != null); 358Debug.Assert(s_unboxPointer != null); 370Debug.Assert(s_useSimpleDictionaryFormatReadProperty != null); 382Debug.Assert(s_useSimpleDictionaryFormatWriteProperty != null); 394Debug.Assert(s_writeAttributeStringMethod != null); 406Debug.Assert(s_writeEndElementMethod != null); 419Debug.Assert(s_writeJsonISerializableMethod != null); 431Debug.Assert(s_writeJsonNameWithMappingMethod != null); 444Debug.Assert(s_writeJsonValueMethod != null); 456Debug.Assert(s_writeStartElementMethod != null); 469Debug.Assert(s_writeStartElementStringMethod != null); 482Debug.Assert(s_parseEnumMethod != null); 495Debug.Assert(s_getJsonMemberNameMethod != null);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (4)
685Debug.Assert(growingCollection != null); 993Debug.Fail("Failed to create contract for KeyValuePair type"); 1010Debug.Assert(collectionContract.AddMethod != null); 1020Debug.Assert(collectionContract.AddMethod != null);
System\Runtime\Serialization\Json\JsonFormatWriterGenerator.cs (3)
339Debug.Assert(collectionContract.GetEnumeratorMethod != null); 426Debug.Assert(keyValueTypes != null); 437Debug.Assert(keyValueTypes != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatReader.cs (7)
25Debug.Assert(classDataContract != null); 34Debug.Assert(_classContract != null); 65Debug.Assert(jsonContext != null); 120Debug.Assert(jsonContext != null); 121Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary); 133Debug.Assert(jsonContext != null); 240Debug.Assert(dictionary != null);
System\Runtime\Serialization\Json\ReflectionJsonFormatWriter.cs (1)
204Debug.Assert(memberNames != null);
System\Runtime\Serialization\Json\XmlJsonReader.cs (2)
418Debug.Assert(_charactersToSkipOnNextRead != null); 1570Debug.Assert(i < val.Length, "Found that an '\' was the last character in a string. ReadServerTypeAttriute validates that the escape sequence is valid when it calls ReadQuotedText and ReadEscapedCharacter");
System\Runtime\Serialization\Json\XmlJsonWriter.cs (2)
434Debug.Assert(!(_isWritingDataTypeAttribute && _isWritingServerTypeAttribute), 603Debug.Assert((_nodeType == JsonNodeType.StandaloneText) || (_nodeType == JsonNodeType.EndElement),
System\Runtime\Serialization\KnownTypeDataContractResolver.cs (1)
17Debug.Assert(context != null, "KnownTypeDataContractResolver should not be instantiated with a null context");
System\Runtime\Serialization\ObjectReferenceStack.cs (2)
51Debug.Fail("Object reference stack in invalid state"); 78Debug.Fail("Object reference stack in invalid state");
System\Runtime\Serialization\ObjectToIdCache.cs (2)
84Debug.Fail("Object table overflow"); 119Debug.Fail("Object table overflow");
System\Runtime\Serialization\ReflectionClassWriter.cs (1)
53Debug.Assert(memberValue != null);
System\Runtime\Serialization\ReflectionReader.cs (4)
37Debug.Assert(context != null); 49Debug.Assert(memberNames != null); 229Debug.Assert(dataMember != null); 241Debug.Assert(memberInfo != null);
System\Runtime\Serialization\ReflectionXmlFormatReader.cs (4)
25Debug.Assert(classDataContract != null); 63Debug.Assert(memberNamespaces != null); 74Debug.Assert(reflectedMemberCount == memberCount, "The value returned by ReflectionGetMembers() should equal to memberCount."); 126Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary);
System\Runtime\Serialization\SchemaExporter.cs (2)
309Debug.Assert(genericArgumentCounts != null); 520Debug.Fail("XML data contract type name does not match schema name");
System\Runtime\Serialization\SchemaImporter.cs (6)
483Debug.Assert(dataContract != null); // Throws above if false 663Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 835Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 996Debug.Assert(dataContract.Members != null); // This method is only called from ImportClass() after that method has initialized the Members collection. 997Debug.Assert(memberName != null); // At this point, elements without a name should have been handled. 1059Debug.Assert(element.Name != null);
System\Runtime\Serialization\XmlFormatGeneratorStatics.cs (74)
23Debug.Assert(s_writeStartElementMethod2 != null); 37Debug.Assert(s_writeStartElementMethod3 != null); 51Debug.Assert(s_writeEndElementMethod != null); 65Debug.Assert(s_writeNamespaceDeclMethod != null); 83Debug.Assert(s_dictionaryEnumeratorCtor != null); 97Debug.Assert(s_ienumeratorMoveNextMethod != null); 111Debug.Assert(s_ienumeratorGetCurrentMethod != null); 126Debug.Assert(s_getItemContractMethod != null); 140Debug.Assert(s_isStartElementMethod2 != null); 154Debug.Assert(s_isStartElementMethod0 != null); 169Debug.Assert(s_getUninitializedObjectMethod != null); 183Debug.Assert(s_onDeserializationMethod != null); 199Debug.Assert(s_nodeTypeProperty != null); 219Debug.Assert(s_hashtableCtor != null); 233Debug.Assert(s_getStreamingContextMethod != null); 247Debug.Assert(s_getCollectionMemberMethod != null); 261Debug.Assert(s_storeCollectionMemberInfoMethod != null); 275Debug.Assert(s_resetCollectionMemberInfoMethod != null); 289Debug.Assert(s_storeIsGetOnlyCollectionMethod != null); 303Debug.Assert(s_resetIsGetOnlyCollection != null); 317Debug.Assert(s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod != null); 331Debug.Assert(s_throwArrayExceededSizeExceptionMethod != null); 345Debug.Assert(s_incrementItemCountMethod != null); 360Debug.Assert(s_internalDeserializeMethod != null); 374Debug.Assert(s_moveToNextElementMethod != null); 389Debug.Assert(s_getMemberIndexMethod != null); 404Debug.Assert(s_getMemberIndexWithRequiredMembersMethod != null); 418Debug.Assert(s_throwRequiredMemberMissingExceptionMethod != null); 432Debug.Assert(s_skipUnknownElementMethod != null); 447Debug.Assert(s_readIfNullOrRefMethod != null); 461Debug.Assert(s_readAttributesMethod != null); 475Debug.Assert(s_resetAttributesMethod != null); 489Debug.Assert(s_getObjectIdMethod != null); 503Debug.Assert(s_getArraySizeMethod != null); 517Debug.Assert(s_addNewObjectMethod != null); 531Debug.Assert(s_addNewObjectWithIdMethod != null); 545Debug.Assert(s_replaceDeserializedObjectMethod != null); 560Debug.Assert(s_getExistingObjectMethod != null); 574Debug.Assert(s_getRealObjectMethod != null); 588Debug.Assert(s_ensureArraySizeMethod != null); 602Debug.Assert(s_trimArraySizeMethod != null); 616Debug.Assert(s_checkEndOfArrayMethod != null); 630Debug.Assert(s_getArrayLengthMethod != null); 645Debug.Assert(s_readSerializationInfoMethod != null); 659Debug.Assert(s_createUnexpectedStateExceptionMethod != null); 674Debug.Assert(s_internalSerializeReferenceMethod != null); 689Debug.Assert(s_internalSerializeMethod != null); 704Debug.Assert(s_writeNullMethod != null); 718Debug.Assert(s_incrementArrayCountMethod != null); 732Debug.Assert(s_incrementCollectionCountMethod != null); 746Debug.Assert(s_incrementCollectionCountGenericMethod != null); 760Debug.Assert(s_getDefaultValueMethod != null); 782Debug.Assert(s_getNullableValueMethod != null); 796Debug.Assert(s_throwRequiredMemberMustBeEmittedMethod != null); 810Debug.Assert(s_getHasValueMethod != null); 825Debug.Assert(s_writeISerializableMethod != null); 847Debug.Assert(s_writeXmlValueMethod != null); 862Debug.Assert(s_readXmlValueMethod != null); 876Debug.Assert(s_namespaceProperty != null); 890Debug.Assert(s_contractNamespacesField != null); 904Debug.Assert(s_memberNamesField != null); 921Debug.Assert(s_childElementNamespacesProperty != null); 935Debug.Assert(s_collectionItemNameProperty != null); 950Debug.Assert(s_childElementNamespaceProperty != null); 964Debug.Assert(s_getDateTimeOffsetMethod != null); 978Debug.Assert(s_getDateTimeOffsetAdapterMethod != null); 992Debug.Assert(s_getMemoryStreamMethod != null); 1006Debug.Assert(s_getMemoryStreamAdapterMethod != null); 1020Debug.Assert(s_getTypeHandleMethod != null); 1034Debug.Assert(s_getTypeMethod != null); 1048Debug.Assert(s_throwInvalidDataContractExceptionMethod != null); 1062Debug.Assert(s_serializeReadOnlyTypesProperty != null); 1076Debug.Assert(s_classSerializationExceptionMessageProperty != null); 1090Debug.Assert(s_collectionSerializationExceptionMessageProperty != null);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (13)
292Debug.Assert(_objectLocal != null); 293Debug.Assert(_objectType != null); 309Debug.Assert(_objectLocal != null); 310Debug.Assert(_objectType != null); 331Debug.Assert(_objectLocal != null); 417Debug.Assert(_objectLocal != null); 418Debug.Assert(_objectType != null); 490Debug.Assert(_objectLocal != null); 491Debug.Assert(_objectType != null); 715Debug.Assert(growingCollection != null); 841Debug.Assert(_objectLocal != null); 915Debug.Assert(collectionContract.AddMethod != null); 922Debug.Fail("Failed to create contract for KeyValuePair type");
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
418Debug.Assert(collectionContract.GetEnumeratorMethod != null);
System\Runtime\Serialization\XmlObjectSerializer.cs (4)
142Debug.Fail("XmlObjectSerializer.InternalWriteStartObject should never get called"); 149Debug.Fail("XmlObjectSerializer.InternalWriteObjectContent should never get called"); 156Debug.Fail("XmlObjectSerializer.InternalWriteEndObject should never get called"); 337Debug.Fail("XmlObjectSerializer.InternalIsStartObject should never get called");
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (10)
151Debug.Assert(attributes != null); 294Debug.Assert(attributes != null); 325Debug.Assert(attributes != null); 337Debug.Assert(attributes != null); 590Debug.Assert(attributes != null); 711Debug.Assert(attributes != null); 766Debug.Assert(attributes != null); 808Debug.Assert(attributes != null); 865Debug.Assert(attributes != null); 1098Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
69Debug.Assert(_serializationSurrogateProvider != null); 129Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
145Debug.Assert(rootTypeDataContract != null); 601Debug.Assert(DataContractResolver != null);
System\Text\Base64Encoding.cs (5)
73Debug.Assert(pch + 4 <= pchMax); 133Debug.Assert(pch + 4 <= pchMax); 206Debug.Assert(pch + 4 <= pchMax); 331Debug.Assert(pb - pbMax == 3); 416Debug.Assert(pb - pbMax == 3);
System\Xml\EncodingStreamWrapper.cs (5)
596Debug.Assert(_bytes != null); 597Debug.Assert(_chars != null); 633Debug.Assert(_bytes != null); 695Debug.Assert(_bytes != null); 696Debug.Assert(_chars != null);
System\Xml\PrefixHandle.cs (4)
37Debug.Assert(type != PrefixHandleType.Buffer); 121Debug.Assert(type != PrefixHandleType.Buffer); 127Debug.Assert(index >= 0 && index < 26); 133Debug.Assert(type != PrefixHandleType.Buffer);
System\Xml\StringHandle.cs (9)
103Debug.Assert(_type == StringHandleType.UTF8); 117Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 131Debug.Assert(type == StringHandleType.EscapedUTF8, "Should be EscapedUTF8"); 160Debug.Assert(type == StringHandleType.EscapedUTF8); 197Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 208Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 219Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 230Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString); 243Debug.Assert(type == StringHandleType.EscapedUTF8 || type == StringHandleType.ConstString);
System\Xml\ValueHandle.cs (21)
511Debug.Assert(bytes != null); 542Debug.Assert(str[i] < 128); 690Debug.Assert(offset + count <= chars.Length, string.Format("offset '{0}' + count '{1}' MUST BE <= chars.Length '{2}'", offset, count, chars.Length)); 772Debug.Assert(byteOffset + actualByteCount < bytes.Length, 844Debug.Assert(_type == ValueHandleType.UTF8); 852Debug.Assert(_type == ValueHandleType.Unicode); 858Debug.Assert(_type == ValueHandleType.EscapedUTF8); 876Debug.Assert(_type == ValueHandleType.Char); 882Debug.Assert(_type == ValueHandleType.Int8); 888Debug.Assert(_type == ValueHandleType.Int16); 894Debug.Assert(_type == ValueHandleType.Int32); 900Debug.Assert(_type == ValueHandleType.Int64 || _type == ValueHandleType.TimeSpan || _type == ValueHandleType.DateTime); 906Debug.Assert(_type == ValueHandleType.UInt64); 912Debug.Assert(_type == ValueHandleType.Single); 918Debug.Assert(_type == ValueHandleType.Double); 924Debug.Assert(_type == ValueHandleType.Decimal); 930Debug.Assert(_type == ValueHandleType.UniqueId); 936Debug.Assert(_type == ValueHandleType.Guid); 942Debug.Assert(_type == ValueHandleType.Base64); 948Debug.Assert(_type == ValueHandleType.Dictionary); 954Debug.Assert(_type == ValueHandleType.QName);
System\Xml\XmlBaseReader.cs (23)
661Debug.Assert(qnameType == QNameType.Xmlns); 749Debug.Assert(qnameType == QNameType.Xmlns); 892Debug.Assert(qnameType == QNameType.Xmlns); 1068Debug.Assert(qnameType == QNameType.Xmlns); 1109Debug.Assert(qnameType == QNameType.Xmlns); 1423Debug.Assert(_trailBytes != null); 1930Debug.Assert(qnameType == QNameType.Xmlns); 2104public StringHandle LocalName { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _localName; } } 2105public PrefixHandle Prefix { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _prefix; } } 2110public ValueHandle Value { get { Debug.Assert(_qnameType != QNameType.Xmlns); return _value; } } 2206Debug.Assert(_qnameType == QNameType.Xmlns); 2219Debug.Assert(_qnameType == QNameType.Xmlns); 2232Debug.Assert(_qnameType == QNameType.Xmlns); 2245Debug.Assert(_qnameType == QNameType.Xmlns); 2258Debug.Assert(_qnameType == QNameType.Xmlns); 2271Debug.Assert(_qnameType == QNameType.Xmlns); 2284Debug.Assert(_qnameType == QNameType.Xmlns); 2297Debug.Assert(_qnameType == QNameType.Xmlns); 2311Debug.Assert(_qnameType == QNameType.Xmlns); 2325Debug.Assert(_qnameType == QNameType.Xmlns); 2340Debug.Assert(_qnameType == QNameType.Xmlns); 2681Debug.Assert(qnameType == QNameType.Xmlns); 3067Debug.Assert(s != null);
System\Xml\XmlBaseWriter.cs (3)
1745Debug.Assert(_trailBytes != null); 1761Debug.Assert(_trailBytes != null); 2373Debug.Assert(nsCount >= 1 && _namespaces![0].Prefix!.Length == 0 && _namespaces[0].Uri!.Length == 0);
System\Xml\XmlBinaryReader.cs (1)
415Debug.Assert(_arrayState == ArrayState.Element);
System\Xml\XmlBinaryWriter.cs (16)
38Debug.Assert(XmlBinaryNodeType.MaxAttribute < XmlBinaryNodeType.MinElement && 71Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0, "Invalid nodeType"); 87Debug.Assert(nodeType == XmlBinaryNodeType.Chars8Text || nodeType == XmlBinaryNodeType.Bytes8Text || nodeType == XmlBinaryNodeType.UnicodeChars8Text); 109Debug.Assert(offset >= 0 && offset + 1 + sizeof(T) <= buffer.Length, "WriteTextNodeRaw"); 124Debug.Assert(offset >= 0 && offset + sizeof(T) <= buffer.Length, "WriteRaw"); 228Debug.Assert(nodeType >= XmlBinaryNodeType.MinText && nodeType <= XmlBinaryNodeType.MaxText && ((byte)nodeType & 1) == 0); 357Debug.Assert(t.Dictionary == _dictionary); 406Debug.Assert(length < 128); 630Debug.Assert(charCount > 0); 666Debug.Assert(length <= byte.MaxValue); 779Debug.Assert(intsWritten == 4); 826Debug.Assert(!_inList); 837Debug.Assert(_inList); 962Debug.Assert(intsWritten == 4); 1066Debug.Assert(result); 1136Debug.Assert(result);
System\Xml\XmlBufferReader.cs (19)
193Debug.Assert(_offsetMax < _windowOffsetMax); 214Debug.Assert(_offset <= int.MaxValue - count); 225Debug.Assert(newOffsetMax <= _windowOffsetMax); 235Debug.Assert(needed > 0); 248Debug.Assert(_offset + count <= _offsetMax); 254Debug.Assert(_stream != null); 295Debug.Assert(value >= _offsetMin && value <= _offsetMax); 302Debug.Assert(count >= 0); 706Debug.Assert(buffer[offset + 0] == '&'); 707Debug.Assert(buffer[offset + 1] == '#'); 708Debug.Assert(buffer[offset + length - 1] == ';'); 725Debug.Assert(buffer[offset + 0] == '&'); 726Debug.Assert(buffer[offset + 1] == '#'); 727Debug.Assert(buffer[offset + 2] == 'x'); 728Debug.Assert(buffer[offset + length - 1] == ';'); 736Debug.Assert(digit >= 0 && digit < 16); 749Debug.Assert(buffer[offset] == '&'); 750Debug.Assert(buffer[offset + length - 1] == ';'); 1023Debug.Assert(nodeType != XmlBinaryNodeType.StartListText);
System\Xml\XmlCanonicalWriter.cs (3)
279Debug.Assert(_xmlnsBuffer != null); 623Debug.Assert(_xmlnsBuffer != null); 783Debug.Assert(attribute.nsOffset == 0 && attribute.nsLength == 0);
System\Xml\XmlConverter.cs (6)
706Debug.Assert(value >= int.MinValue && value <= int.MaxValue); 788Debug.Assert(s[i] < 128); 1004Debug.Assert(value >= 0 && value < 100); 1021Debug.Assert(value >= 0 && value < 10000); 1029Debug.Assert(value >= 0 && value < 10000000); 1140Debug.Assert(count == chars.Length);
System\Xml\XmlDictionaryAsyncCheckWriter.cs (1)
22Debug.Assert(writer is IXmlTextWriterInitializer);
System\Xml\XmlSigningNodeWriter.cs (5)
85Debug.Assert(prefix != null); 99Debug.Assert(prefix != null); 112Debug.Assert(prefix != null); 119Debug.Assert(prefix != null); 133Debug.Assert(prefix != null);
System\Xml\XmlStreamNodeWriter.cs (9)
69Debug.Assert(count >= 0 && count <= bufferLength); 81Debug.Assert(offset + count <= bufferLength); 93Debug.Assert(count >= 0 && count <= bufferLength); 105Debug.Assert(offset + count <= bufferLength); 116Debug.Assert(_offset + count <= bufferLength); 155Debug.Assert(ch < 0x80); 161Debug.Assert(ch < 0x80); 202Debug.Assert(ch1 < 0x80 && ch2 < 0x80); 208Debug.Assert(ch1 < 0x80 && ch2 < 0x80);
System\Xml\XmlUTF8TextReader.cs (2)
884Debug.Assert(buffer[offset] == 0xEF, "buffer[offset] MUST be 0xEF."); 1093Debug.Assert(BufferReader.GetByte() == '&');
System.Private.Reflection.Execution (99)
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.ManifestResources.cs (1)
88Debug.Assert(resourceInfo.Index >= 0 && resourceInfo.Length >= 0 && (uint)(resourceInfo.Index + resourceInfo.Length) <= cbBlob);
Internal\Reflection\Execution\ExecutionEnvironmentImplementation.MappingTables.cs (10)
22using Debug = System.Diagnostics.Debug; 70Debug.Assert(!RuntimeAugments.IsGenericType(runtimeTypeHandle)); 316Debug.Assert((methodInvokeMetadata.InvokeTableFlags & InvokeTableFlags.NeedsParameterInterpretation) == 0); 382Debug.Assert(false); 569Debug.Assert(entryParser.Reader == invokeMapParser.Reader); 620Debug.Assert(false); 636Debug.Assert((entryFlags & InvokeTableFlags.HasEntrypoint) != 0); 654Debug.Assert(entryMethodEntrypoint == canonOriginalLdFtnResult || 668Debug.Assert(success); 699Debug.Assert(!isAsyncVariant, "Async variants should not be visible to reflection");
Internal\Reflection\Execution\FieldAccessors\PointerTypeFieldAccessorForInstanceFields.cs (2)
30Debug.Assert(value.GetType() == typeof(UIntPtr) || value.GetType() == typeof(IntPtr)); 36Debug.Assert(value.GetType() == typeof(UIntPtr) || value.GetType() == typeof(IntPtr));
Internal\Reflection\Execution\FieldAccessors\PointerTypeFieldAccessorForStaticFields.cs (4)
9using Debug = System.Diagnostics.Debug; 32Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic); 39Debug.Assert(value.GetType() == typeof(UIntPtr) || value.GetType() == typeof(IntPtr)); 52Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic);
Internal\Reflection\Execution\FieldAccessors\ReferenceTypeFieldAccessorForStaticFields.cs (3)
9using Debug = System.Diagnostics.Debug; 32Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic); 51Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic);
Internal\Reflection\Execution\FieldAccessors\StaticFieldAccessor.cs (1)
61Debug.Fail("Cannot call Offset on a static field.");
Internal\Reflection\Execution\FieldAccessors\ValueTypeFieldAccessorForStaticFields.cs (3)
9using Debug = System.Diagnostics.Debug; 32Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic); 50Debug.Assert(FieldBase == FieldTableFlags.ThreadStatic);
Internal\Reflection\Execution\MetadataReaderExtensions.cs (2)
7using Debug = System.Diagnostics.Debug; 22Debug.Assert((HandleType)((uint)i >> 25) == HandleType.Method);
Internal\Reflection\Execution\ReflectionExecution.cs (3)
34using Debug = System.Diagnostics.Debug; 74Debug.Assert(qTypeDefinition.IsNativeFormatMetadataBased); 75Debug.Assert(qTypeDefinition.NativeFormatReader == qMethodDefinition.NativeFormatReader);
Internal\Reflection\Execution\TypeLoader\ConstraintValidator.cs (1)
8using Debug = global::System.Diagnostics.Debug;
Internal\Reflection\Execution\TypeLoader\ConstraintValidatorSupport.cs (33)
10using Debug = global::System.Diagnostics.Debug; 141public override Assembly Assembly { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 142public override string AssemblyQualifiedName { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 143public override string FullName { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 145public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 146public override object[] GetCustomAttributes(bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; } 147public override object[] GetCustomAttributes(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; } 149public override EventInfo GetEvent(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 151public override EventInfo[] GetEvents(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 153public override FieldInfo GetField(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 155public override FieldInfo[] GetFields(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 160public override Type GetInterface(string name, bool ignoreCase) { Debug.Assert(false); throw NotImplemented.ByDesign; } 162public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 164public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 166public override Type GetNestedType(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 168public override Type[] GetNestedTypes(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 170public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; } 171public override bool IsDefined(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; } 172public override Guid GUID { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 177public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { Debug.Assert(false); throw NotImplemented.ByDesign; } 178public override Module Module { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 179public override string Namespace { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 180public override string Name { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 181public override Type UnderlyingSystemType { get { Debug.Assert(false); throw NotImplemented.ByDesign; } } 184protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; } 186protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; } 188protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; } 189protected override bool IsCOMObjectImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; } 190protected override bool IsPrimitiveImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; } 191protected override bool HasElementTypeImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; } 212Debug.Assert(type.DeclaringType != null); 253Debug.Assert(type.IsNullable()); 256Debug.Assert(arguments.Length == 1);
Internal\Reflection\Execution\TypeLoader\TypeCast.cs (10)
9using Debug = System.Diagnostics.Debug; 30Debug.Assert(!pTargetType.IsArray, "did not expect array type"); 31Debug.Assert(pTargetType.IsInterface, "IsInstanceOfInterface called with non-interface MethodTable"); 91Debug.Assert(pInterfaceInstantiation.Length == 1, "arity mismatch for array generic interface"); 92Debug.Assert(pTargetInstantiation.Length == 1, "arity mismatch for array generic interface"); 146Debug.Assert(pSourceInstantiation.Length == pTargetInstantiation.Length, "arity mismatch between generic instantiations"); 148Debug.Assert(fForceCovariance || pTargetInstantiation.Length == pVarianceInfo.Length, "arity mismatch between generic instantiations"); 204Debug.Fail("unknown generic variance type"); 362Debug.Assert(!pBaseType.IsInterface, "did not expect interface type"); 392Debug.Assert(args1.Length == args2.Length);
Internal\Reflection\Extensions\NonPortable\DelegateMethodInfoRetriever.cs (1)
45System.Diagnostics.Debug.Assert(resolver->ResolverType == OpenMethodResolver.GVMResolve);
src\runtime\src\coreclr\tools\Common\Internal\LowLevelLinq\LowLevelEnumerable.cs (4)
14Debug.Assert(values != null); 22Debug.Assert(values != null); 31Debug.Assert(source != null); 32Debug.Assert(filter != null);
src\runtime\src\coreclr\tools\Common\Internal\LowLevelLinq\LowLevelEnumerable.ToArray.cs (1)
14Debug.Assert(values != null);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (7)
19Debug.Assert(false); 228Debug.Assert(base_ <= base_ + size); 244Debug.Assert((byte*)address >= _base); 245Debug.Assert((byte*)address <= _base + _size); 251Debug.Assert(offset < _size); 258Debug.Assert(false); 392Debug.Assert(value < _reader.Size);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.Primitives.cs (4)
105Debug.Assert(false); 150Debug.Assert(false); 173Debug.Assert(false); 196Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\runtime\src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
26Debug.Fail("SR::GetResourceString with empty resourceKey. Bug in caller, or weird recursive loading problem?"); 97Debug.Assert(s != null, $"Looking up resource '{key}' failed. Was your resource name misspelled? Did you rebuild after adding a resource?");
System.Private.StackTraceMetadata (25)
Internal\StackTraceMetadata\MethodNameFormatter.cs (5)
248Debug.Fail($"Type handle {typeHandle.HandleType} was not handled"); 446Debug.Assert(false); 461Debug.Assert(false); 502Debug.Assert(false); 508Debug.Assert(false);
Internal\StackTraceMetadata\StackTraceMetadata.cs (8)
18using Debug = System.Diagnostics.Debug; 67Debug.Assert(data.Name.IsNil && data.Signature.IsNil); 68Debug.Assert(isStackTraceHidden); 199Debug.Assert(data.Name.IsNil && data.Signature.IsNil); 446Debug.Assert((command & StackTraceDataCommand.IsStackTraceHidden) != 0 || 470Debug.Assert((nint)pMethod > handle.OsModuleBase); 487Debug.Assert(current == _stacktraceDatas.Length); 527Debug.Assert((value & IsHiddenFlag) == 0);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (7)
19Debug.Assert(false); 228Debug.Assert(base_ <= base_ + size); 244Debug.Assert((byte*)address >= _base); 245Debug.Assert((byte*)address <= _base + _size); 251Debug.Assert(offset < _size); 258Debug.Assert(false); 392Debug.Assert(value < _reader.Size);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.Primitives.cs (4)
105Debug.Assert(false); 150Debug.Assert(false); 173Debug.Assert(false); 196Debug.Assert(false);
src\runtime\src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
140Debug.Assert(hashCode == NameHashCode("System.Array`1"u8));
System.Private.TypeLoader (354)
Internal\Reflection\Execution\AssemblyBinderImplementation.cs (2)
110Debug.Assert(defName.Version != null); 111Debug.Assert(defName.CultureName != null);
Internal\Runtime\TypeLoader\EETypeCreator.cs (30)
54Debug.Assert(rtth.ToEETypePtr()->IsDynamicType && dictionarySlot < rtth.GetNumVtableSlots()); 91Debug.Assert(componentSize > 0); 92Debug.Assert(rtth.ToEETypePtr()->IsArray || rtth.ToEETypePtr()->IsString); 102Debug.Assert(val >= 0 && alignment >= 0); 105Debug.Assert(0 == (alignment & (alignment - 1))); 107Debug.Assert(result >= val); // check for overflow 138Debug.Assert(pTemplateEEType != null); 176Debug.Assert(pTemplateEEType->NumInterfaces == runtimeInterfacesLength); 267Debug.Assert(pEEType->ContainsGCPointers == (cbGCDesc != 0)); 309Debug.Assert(!state.HasStaticConstructor || (allocatedNonGCDataSize != 0)); 324Debug.Assert(nonGCStaticDataOffset <= allocatedNonGCDataSize); 351Debug.Assert(!state.HalfBakedRuntimeTypeHandle.IsNull()); 352Debug.Assert((state.Dictionary == null && state.HalfBakedDictionary == IntPtr.Zero) || (state.Dictionary != null && state.HalfBakedDictionary != IntPtr.Zero)); 404Debug.Assert(gcBitfield == null); 440Debug.Assert(gcBitfield == null); 456Debug.Assert(count > 0); 543Debug.Assert(!state.HalfBakedRuntimeTypeHandle.IsNull()); 548Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->NumFunctionPointerParameters == parameterHandles.Length); 561Debug.Assert(!state.HalfBakedRuntimeTypeHandle.IsNull()); 577Debug.Assert(!state.HalfBakedRuntimeTypeHandle.IsNull()); 584Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->ElementType == EETypeElementType.Pointer); 586Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->ParameterizedTypeShape == ParameterizedTypeShapeConstants.Pointer); 594Debug.Assert(type != null && state != null); 600Debug.Assert(0 == state.NonGcDataSize); 601Debug.Assert(!state.HasStaticConstructor); 602Debug.Assert(0 == state.GcDataSize); 603Debug.Assert(0 == state.ThreadStaticOffset); 604Debug.Assert(IntPtr.Zero == state.GcStaticDesc); 605Debug.Assert(IntPtr.Zero == state.ThreadStaticDesc); 623Debug.Assert(state.TemplateType != null && !state.TemplateType.RuntimeTypeHandle.IsNull());
Internal\Runtime\TypeLoader\GenericDictionary.cs (5)
9using Debug = System.Diagnostics.Debug; 20Debug.Assert(cells != null); 28Debug.Assert(_cells.Length == 0 || _addressOfFirstCellSlot != null); 46Debug.Assert(_addressOfFirstCellSlot == null); 66Debug.Assert(_addressOfFirstCellSlot == null);
Internal\Runtime\TypeLoader\GenericDictionaryCell.cs (7)
73Debug.Assert(Type.Instantiation.Length == 1); 172Debug.Assert(result != IntPtr.Zero); 208Debug.Assert(result != IntPtr.Zero); 272Debug.Assert(false); 316Debug.Assert(GenericMethod.RuntimeMethodDictionary != IntPtr.Zero); 456Debug.Assert(count > 0); 513Debug.Assert(genericMethod.Instantiation.Length > 0);
Internal\Runtime\TypeLoader\MetadataNameExtensions.cs (5)
11using Debug = System.Diagnostics.Debug; 121Debug.Assert(!typeDef.Name.IsNil); 148Debug.Assert(!currentHandle.IsNil); 193Debug.Assert(!typeRef.TypeName.IsNil); 220Debug.Assert(!currentHandle.IsNil);
Internal\Runtime\TypeLoader\ModuleList.cs (3)
258Debug.Assert(loadedModuleCount == loadedModuleCountUpdated); 354Debug.Assert(false); 375Debug.Assert(false);
Internal\Runtime\TypeLoader\NativeLayoutInfoLoadContext.cs (4)
69Debug.Assert(success); 91Debug.Assert(success); 155Debug.Assert((callConv & MethodCallingConvention.Generic) == 0); 199Debug.Assert(typeArguments.Length > 0);
Internal\Runtime\TypeLoader\NativeLayoutInterfacesAlgorithm.cs (2)
36Debug.Assert(!InterfaceInSet(interfaces, numInterfaces, baseInterface)); 75Debug.Assert(numInterfaces == totalInterfaces, "Unexpected number of interfaces");
Internal\Runtime\TypeLoader\TemplateLocator.cs (1)
111Debug.Assert(candidateTemplate.Instantiation.Length > 0);
Internal\Runtime\TypeLoader\TypeBuilder.cs (46)
184Debug.Assert(state.TemplateType == null || (state.TemplateType is DefType && !state.TemplateType.RuntimeTypeHandle.IsNull())); 208Debug.Assert(state.TemplateType != null && state.TemplateType is ArrayType && !state.TemplateType.RuntimeTypeHandle.IsNull()); 214Debug.Assert(typeAsArrayType.IsMdArray || typeAsArrayType.ElementType.IsPointer || typeAsArrayType.ElementType.IsFunctionPointer); 226Debug.Assert(false); 281Debug.Assert(method.Dictionary == null); 333Debug.Fail("Unexpected BagElementKind for generic method with name " + method.NameAndSignature.GetName() + "! Only BagElementKind.DictionaryLayout should appear."); 363Debug.Assert(baseTypeParser.IsNull); 408Debug.Assert(state.Dictionary == null); 447Debug.Assert(bitfield != null); 457Debug.Assert(MethodTable != null); 471Debug.Assert(!IsNone); 474Debug.Assert(_gcdesc != null ^ _bitfield != null); 482Debug.Assert(_gcdesc != null); 486Debug.Assert(count >= 0); 497Debug.Assert(len > 0); 498Debug.Assert(offs >= 0); 512Debug.Assert(type is DefType || type is ArrayType || type is PointerType || type is ByRefType || type is FunctionPointerType); 524Debug.Assert(method.RuntimeMethodDictionary == IntPtr.Zero && method.Dictionary != null); 540Debug.Assert(_finalTypeBuilding); 548Debug.Assert(!rtth.IsNull()); 609Debug.Assert(state.HalfBakedDictionary != IntPtr.Zero); 619Debug.Assert(!type.CanShareNormalGenericCode()); 629Debug.Assert(method.Dictionary != null); 667Debug.Assert(dictionaryEntry != IntPtr.Zero); 671Debug.Assert(dictionarySlot >= 0); 752Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->ParameterizedTypeShape == ParameterizedTypeShapeConstants.Pointer); 754Debug.Assert(state.HalfBakedRuntimeTypeHandle.ToEETypePtr()->ElementType == EETypeElementType.Pointer); 766Debug.Assert(halfBakedMethodTable->NumFunctionPointerParameters == sig.Length); 774Debug.Assert(false); 851Debug.Assert(method.UnboxingStub); 997Debug.Assert(!typeAsFunctionPointerType.RuntimeTypeHandle.IsNull()); 1003Debug.Assert(!typeAsParameterizedType.RuntimeTypeHandle.IsNull()); 1004Debug.Assert(!typeAsParameterizedType.ParameterType.RuntimeTypeHandle.IsNull()); 1014Debug.Assert(typeAsParameterizedType.RuntimeTypeHandle.ToEETypePtr()->IsByRef); 1020Debug.Assert(typeAsParameterizedType is PointerType); 1023Debug.Assert(typeAsParameterizedType.RuntimeTypeHandle.ToEETypePtr()->IsPointer); 1069Debug.Assert(false); 1106Debug.Assert(success); 1130Debug.Assert(false); 1186Debug.Assert(!genericTypeDefinitionHandle.IsNull() && genericTypeArgumentHandles != null && genericTypeArgumentHandles.Length > 0); 1199Debug.Assert(!runtimeTypeHandle.IsNull()); 1225Debug.Assert(!arrayTypeHandle.IsNull()); 1248Debug.Assert(pointerTypeHandle.ToEETypePtr()->IsPointer); 1268Debug.Assert(byRefTypeHandle.ToEETypePtr()->IsByRef); 1293Debug.Assert(runtimeTypeHandle.ToEETypePtr()->IsFunctionPointer); 1310Debug.Assert(methodDictionary != IntPtr.Zero);
Internal\Runtime\TypeLoader\TypeBuilderState.cs (10)
84Debug.Assert(_templateType == null || !_templateType.RuntimeTypeHandle.IsNull()); 146Debug.Assert(false); 223Debug.Assert(TemplateType != null); 270Debug.Assert(TypeBeingBuilt.IsTemplateCanonical()); 273Debug.Assert(templateType != null); 352Debug.Assert(TypeBeingBuilt.RetrieveRuntimeTypeHandleIfPossible() || 429Debug.Assert(!fieldType.IsByRef); 444Debug.Assert(fieldType.IsTemplateCanonical()); 448Debug.Assert(success); 476Debug.Assert(TypeBeingBuilt.IsMdArray);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericMethodsLookup.cs (3)
116Debug.Assert(value._methodDictionary != IntPtr.Zero); 301Debug.Assert(methodPointer != IntPtr.Zero); 343Debug.Assert(methodPointer != IntPtr.Zero && dictionaryPointer != IntPtr.Zero);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericsRegistration.cs (5)
61Debug.Assert(registeredTypesCount == registrationData.TypesToRegisterCount); 69Debug.Assert(methodEntry._methodDictionary != IntPtr.Zero); 83Debug.Assert(registeredMethodComponentsEntry == registeredMethodEntry); 88Debug.Assert(registeredMethodsCount == registrationData.MethodsToRegisterCount); 130Debug.Assert(_typeLoaderLock.IsHeldByCurrentThread);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.ConstructedGenericTypesLookup.cs (4)
101Debug.Assert(typeToLookup != null); 109Debug.Assert(genericTypeArgumentHandles != null); 219Debug.Assert(_typeLoaderLock.IsHeldByCurrentThread); 270Debug.Assert(RuntimeAugments.IsGenericType(runtimeTypeHandle));
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.cs (5)
19using Debug = System.Diagnostics.Debug; 190Debug.Assert(!type.RuntimeTypeHandle.IsNull()); 199Debug.Assert(!moduleHandle.IsNull); 473Debug.Assert(nonUnboxingTarget != functionPointerDescriptor->MethodFunctionPointer); 474Debug.Assert(nonUnboxingTarget == RuntimeAugments.GetCodeTarget(nonUnboxingTarget));
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.GVMResolution.cs (6)
70Debug.Assert(IsStaticMethodSignature(slotMethod.NameAndSignature)); 77Debug.Assert(lookForDefaultImplementations); 278Debug.Assert(nameAndSigToken == SpecialGVMInterfaceEntry.Reabstraction); 326Debug.Assert(interfaceImplType == null); 340Debug.Assert(interfaceImplType != null); 536Debug.Assert(targetMethodNameAndSignature != null);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.LdTokenResultLookup.cs (2)
18using Debug = System.Diagnostics.Debug; 63Debug.Assert(genericArgs == null || genericArgs.Length > 0);
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.Metadata.cs (7)
90Debug.Assert(false); 204Debug.Assert(isMdArray || rank == -1); 355Debug.Assert(!moduleHandle.IsNull); 556Debug.Assert(false); // This will only fail if the virtual invoke data is malformed as specifies that a type 564Debug.Assert(isGenericVirtualMethod == ((genericArgs != null) && genericArgs.Length > 0)); 720Debug.Assert(dictionary != IntPtr.Zero); 851Debug.Assert(IsMatchingOrCompatibleEntry());
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.SignatureParsing.cs (1)
19using Debug = System.Diagnostics.Debug;
Internal\Runtime\TypeLoader\TypeLoaderEnvironment.StaticsLookup.cs (6)
37Debug.Assert(typeAsEEType->IsDynamicType || typeAsEEType->IsGeneric); 51Debug.Assert(runtimeTypeHandle.IsDynamicType()); 76Debug.Assert(typeAsEEType->IsDynamicType || typeAsEEType->IsGeneric); 90Debug.Assert(runtimeTypeHandle.IsDynamicType()); 117Debug.Assert(typeAsEEType->IsDynamicType || typeAsEEType->IsGeneric); 166Debug.Assert(offsetValue != 0 && runtimeTypeHandle.IsDynamicType());
Internal\Runtime\TypeLoader\TypeLoaderLogger.cs (1)
31Debug.WriteLine("[" + hash.LowLevelToString() + "] " + message);
Internal\TypeSystem\InstantiatedMethod.Runtime.cs (2)
11using Debug = System.Diagnostics.Debug; 56Debug.Assert(rmd != IntPtr.Zero);
Internal\TypeSystem\MethodDesc.Runtime.cs (2)
9using Debug = System.Diagnostics.Debug; 19Debug.Assert(_functionPointer == IntPtr.Zero || _functionPointer == functionPointer);
Internal\TypeSystem\RuntimeNoMetadataType.cs (19)
16using Debug = System.Diagnostics.Debug; 85Debug.Assert(((_instantiation.Length > 0) && _genericTypeDefinition.ToEETypePtr()->IsGenericTypeDefinition) || 119Debug.Assert(false); 138Debug.Assert(_baseType != this); 163Debug.Assert(_baseType == this || _baseType == baseType); 193Debug.Assert(MethodTable->IsGenericTypeDefinition || 197Debug.Assert((int)EETypeElementType.Void == (int)TypeFlags.Void); 198Debug.Assert((int)EETypeElementType.Int32 == (int)TypeFlags.Int32); 199Debug.Assert((int)EETypeElementType.IntPtr == (int)TypeFlags.IntPtr); 200Debug.Assert((int)EETypeElementType.Double == (int)TypeFlags.Double); 201Debug.Assert((int)EETypeElementType.Pointer == (int)TypeFlags.Pointer); 202Debug.Assert((int)EETypeElementType.Class == (int)TypeFlags.Class); 203Debug.Assert((int)EETypeElementType.Nullable == (int)TypeFlags.Nullable); 317Debug.Assert((int)EETypeElementType.Void == (int)WellKnownType.Void); 318Debug.Assert((int)EETypeElementType.Int32 == (int)WellKnownType.Int32); 319Debug.Assert((int)EETypeElementType.IntPtr == (int)WellKnownType.IntPtr); 320Debug.Assert((int)EETypeElementType.Double == (int)WellKnownType.Double); 321Debug.Assert(elementType <= EETypeElementType.Double); 330Debug.Assert(!genericDefinitionHandle.IsNull());
Internal\TypeSystem\TypeDesc.Runtime.cs (6)
15using Debug = System.Diagnostics.Debug; 36Debug.Assert(!runtimeTypeHandle.IsNull()); 37Debug.Assert(_runtimeTypeHandle.IsNull() || runtimeTypeHandle.Equals(_runtimeTypeHandle)); 38Debug.Assert(runtimeTypeHandle.GetHashCode() == GetHashCode()); 159Debug.Assert(false); 179Debug.Assert(state != null);
Internal\TypeSystem\TypeSystemContext.Runtime.cs (4)
298Debug.Assert(_instantiation.Length == other._instantiation.Length); 439Debug.Assert(key._owningType.IsValueType); 464Debug.Assert(typeDef.Instantiation.IsNull || typeDef.Instantiation.Length == arguments.Length); 474Debug.Assert(RuntimeAugments.IsGenericTypeDefinition(nmTypeDef.RuntimeTypeHandle));
src\runtime\src\coreclr\nativeaot\Common\src\Internal\Runtime\MethodTable.cs (73)
11using Debug = System.Diagnostics.Debug; 114Debug.Assert(index <= _defaultEntryCount + _standardEntryCount); 120Debug.Assert(index <= _defaultStaticEntryCount + _standardStaticEntryCount); 190Debug.Assert(ExtendedFlags == 0); 196Debug.Assert(!HasComponentSize); 211Debug.Assert(HasComponentSize); 221Debug.Assert(IsGenericTypeDefinition); 227Debug.Assert(IsGenericTypeDefinition); 257Debug.Assert(!HasComponentSize); 258Debug.Assert(ExtendedFlags == 0); 282Debug.Assert(IsCanonical || IsArray); 409Debug.Assert(this.IsArray); 427Debug.Assert(this.IsArray); 440Debug.Assert(IsArray); 449Debug.Assert(HasComponentSize); 475Debug.Assert(IsGeneric); 487Debug.Assert(IsGeneric && IsDynamicType); 501Debug.Assert(IsGeneric && IsDynamicType); 510Debug.Assert(IsGeneric); 519Debug.Assert(IsGeneric); 546Debug.Assert(IsGeneric || IsGenericTypeDefinition); 628Debug.Assert(IsParameterizedType); 643Debug.Assert(IsFunctionPointer); 649Debug.Assert(IsFunctionPointer); 659Debug.Assert(IsFunctionPointer); 665Debug.Assert(IsFunctionPointer); 689Debug.Assert(IsFunctionPointer); 695Debug.Assert(IsDynamicType && IsFunctionPointer); 710Debug.Fail("RequiresAlign8 called for array or string"); 782Debug.Assert(IsValueType); 791Debug.Assert(IsValueType); 834Debug.Assert(IsDynamicType && HasDispatchMap); 845Debug.Assert(IsFinalizable); 857Debug.Assert(IsDynamicType && IsFinalizable); 880Debug.Assert(IsDynamicType); 881Debug.Assert(!IsParameterizedType); 882Debug.Assert(!IsFunctionPointer); 883Debug.Assert(IsCanonical); 893Debug.Assert(!IsArray, "array type not supported in NonArrayBaseType"); 894Debug.Assert(IsCanonical || IsGenericTypeDefinition, "we expect type definitions here"); 895Debug.Assert(!IsGenericTypeDefinition || _relatedType._pBaseType == null, "callers assume this would be null for a generic definition"); 904Debug.Assert(IsNullable); 905Debug.Assert(GenericArity == 1); 917Debug.Assert(IsNullable); 927Debug.Assert(IsParameterizedType); 933Debug.Assert(IsDynamicType && IsParameterizedType); 959Debug.Assert(HasSealedVTableEntries); 990Debug.Assert(IsDynamicType); 996Debug.Assert(IsDynamicType); 1014Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasGCStatics) != 0); 1020Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasGCStatics) != 0); 1030Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasNonGCStatics) != 0); 1036Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasNonGCStatics) != 0); 1046Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasThreadStatics) != 0); 1052Debug.Assert((DynamicTypeFlags & DynamicTypeFlags.HasThreadStatics) != 0); 1087Debug.Assert(IsDynamicType); 1112Debug.Assert(IsDynamicType); 1122Debug.Assert(IsDynamicType); 1128Debug.Assert(IsDynamicType); 1178Debug.Assert(HasDispatchMap); 1187Debug.Assert(IsFinalizable); 1203Debug.Assert(IsGeneric); 1213Debug.Assert(IsGeneric || (IsGenericTypeDefinition && HasGenericVariance)); 1223Debug.Assert(IsFunctionPointer); 1233Debug.Assert(IsDynamicType); 1242Debug.Assert(IsDynamicType); 1253Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasGCStatics) != 0); 1261Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasNonGCStatics) != 0); 1269Debug.Assert((dynamicTypeFlags & DynamicTypeFlags.HasThreadStatics) != 0); 1273Debug.Fail("Unknown MethodTable field type"); 1368Debug.Assert(((nint)pFirst & IsRelative) == 0); 1375Debug.Assert(((nint)pFirst & IsRelative) == 0); 1391Debug.Assert(((nint)_pFirst & IsRelative) == 0);
src\runtime\src\coreclr\tools\Common\Internal\Metadata\NativeFormat\MetadataTypeHashingAlgorithms.cs (5)
5using Debug = System.Diagnostics.Debug; 30Debug.Assert(parentHandleType == HandleType.ScopeDefinition); 31Debug.Assert(string.IsNullOrEmpty(reader.GetString(namespaceDefinition.Name)), "Root namespace with a name?"); 51Debug.Assert(parentHandleType == HandleType.ScopeReference); 52Debug.Assert(string.IsNullOrEmpty(reader.GetString(namespaceReference.Name)), "Root namespace with a name?");
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.cs (7)
19Debug.Assert(false); 228Debug.Assert(base_ <= base_ + size); 244Debug.Assert((byte*)address >= _base); 245Debug.Assert((byte*)address <= _base + _size); 251Debug.Assert(offset < _size); 258Debug.Assert(false); 392Debug.Assert(value < _reader.Size);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatReader.Primitives.cs (4)
105Debug.Assert(false); 150Debug.Assert(false); 173Debug.Assert(false); 196Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\Internal\NativeFormat\NativeFormatWriter.Primitives.cs (2)
168Debug.Assert(offset < _size); 181Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\System\Collections\Generic\ArrayBuilder.cs (4)
6using Debug = System.Diagnostics.Debug; 73Debug.Assert(length > 0); 74Debug.Assert(newItems.Length >= offset + length); 92Debug.Assert(numItems >= 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\CanonTypes.cs (2)
10using Debug = System.Diagnostics.Debug; 111Debug.Assert(kind == CanonicalFormKind.Specific);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\GenericParameterDesc.Canon.cs (3)
4using Debug = System.Diagnostics.Debug; 13Debug.Fail("IsCanonicalSubtype of an indefinite type"); 19Debug.Fail("ConvertToCanonFormImpl for an indefinite type");
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\InstantiatedMethod.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 66Debug.Fail("Invalid CanonicalFormKind: " + kind); 76Debug.Assert(_specificCanonCache == null || _specificCanonCache == value); 81Debug.Assert(_universalCanonCache == null || _universalCanonCache == value); 86Debug.Fail("Invalid CanonicalFormKind: " + kind);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\SignatureVariable.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 13Debug.Fail("IsCanonicalSubtype of an indefinite type"); 19Debug.Fail("ConvertToCanonFormImpl for an indefinite type"); 29Debug.Fail("IsCanonicalSubtype of an indefinite type"); 35Debug.Fail("ConvertToCanonFormImpl for an indefinite type");
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\StandardCanonicalizationAlgorithm.cs (2)
4using Debug = System.Diagnostics.Debug; 134Debug.Assert(false);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\TypeDesc.Canon.cs (5)
4using Debug = System.Diagnostics.Debug; 29Debug.Fail("Invalid CanonicalFormKind: " + kind); 39Debug.Assert(_specificCanonCache == null || _specificCanonCache == value); 44Debug.Assert(_universalCanonCache == null || _universalCanonCache == value); 49Debug.Fail("Invalid CanonicalFormKind: " + kind);
src\runtime\src\coreclr\tools\Common\TypeSystem\Canon\TypeSystemContext.Canon.cs (2)
5using Debug = System.Diagnostics.Debug; 61Debug.Assert(kind == CanonicalFormKind.Universal);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\AlignmentHelper.cs (4)
4using Debug = System.Diagnostics.Debug; 12Debug.Assert(val >= 0 && alignment >= 0); 15Debug.Assert(0 == (alignment & (alignment - 1))); 17Debug.Assert(result >= val); // check for overflow
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\CastingHelper.cs (6)
4using Debug = System.Diagnostics.Debug; 122Debug.Assert(fn1Ttype.IsFunctionPointer && fn2Type.IsFunctionPointer); 252Debug.Assert(thisType.IsDefType); 393Debug.Assert(!type.IsEnum); 496Debug.Assert(instantiationThis.Length == instantiationTarget.Length && 526Debug.Assert(variance == GenericVariance.None);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldDesc.cs (2)
7using Debug = System.Diagnostics.Debug; 30Debug.Assert(o is not FieldDesc || ReferenceEquals(((FieldDesc)o).Context, this.Context));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\FieldForInstantiatedType.cs (2)
8using Debug = System.Diagnostics.Debug; 22Debug.Assert(fieldDef.GetTypicalFieldDefinition() == fieldDef);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedMethod.cs (2)
21Debug.Assert(!(methodDef is InstantiatedMethod)); 24Debug.Assert(instantiation.Length > 0);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\InstantiatedType.cs (3)
22Debug.Assert(!(typeDef is InstantiatedType)); 25Debug.Assert(instantiation.Length > 0); 220Debug.Assert(typeInHierarchy is InstantiatedType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\LayoutInt.cs (3)
41Debug.Assert(output.IsIndeterminate); 153Debug.Assert(alignment._value <= target.MaximumAlignment); // Assert that the alignment handling for indeterminate types is safe 154Debug.Assert(alignment._value >= 1 || ((value._value == 0) && (alignment._value == 0))); // Alignment to less than one doesn't make sense, except for 0 to 0 alignment
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodDesc.cs (3)
77Debug.Assert(parameters != null, "Parameters must not be null"); 477Debug.Assert(hashcode == ComputeHashCode()); 506Debug.Assert(o is not MethodDesc || ReferenceEquals(((MethodDesc)o).Context, this.Context));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\MethodForInstantiatedType.cs (2)
8using Debug = System.Diagnostics.Debug; 21Debug.Assert(typicalMethodDef.GetTypicalMethodDefinition() == typicalMethodDef);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TargetDetails.cs (2)
5using Debug = System.Diagnostics.Debug; 349Debug.Assert(Architecture == TargetArchitecture.ARM ||
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\ThrowHelper.Common.cs (2)
6using Debug = System.Diagnostics.Debug; 72Debug.Fail("Multi-module assemblies");
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeDesc.cs (6)
29Debug.Assert(o is not TypeDesc || ReferenceEquals(((TypeDesc)o).Context, this.Context)); 37Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context)); 44Debug.Assert(left is null || right is null || ReferenceEquals(left.Context, right.Context)); 142Debug.Assert((flags & mask) != 0); 411Debug.Assert((flags >= TypeFlags.Array && flags <= TypeFlags.Pointer) == (this is ParameterizedType)); 424Debug.Assert(GetTypeFlags(TypeFlags.CategoryMask) <= TypeFlags.Interface == this is DefType);
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\TypeSystemContext.cs (5)
247Debug.Assert((signature.Flags & MethodSignatureFlags.UnmanagedCallingConventionMask) is 0 or MethodSignatureFlags.UnmanagedCallingConvention); 248Debug.Assert(!signature.HasEmbeddedSignatureData); 444Debug.Assert(!(methodDef is InstantiatedMethod)); 517Debug.Assert(!(typicalMethodDef is MethodForInstantiatedType)); 518Debug.Assert(!(typicalMethodDef is InstantiatedMethod));
src\runtime\src\coreclr\tools\Common\TypeSystem\Common\Utilities\TypeNameFormatter.cs (2)
6using Debug = System.Diagnostics.Debug; 42Debug.Assert(type.IsDefType);
src\runtime\src\libraries\Common\src\Internal\VersionResilientHashCode.cs (1)
140Debug.Assert(hashCode == NameHashCode("System.Array`1"u8));
src\runtime\src\libraries\System.Private.CoreLib\src\System\SR.cs (2)
26Debug.Fail("SR::GetResourceString with empty resourceKey. Bug in caller, or weird recursive loading problem?"); 97Debug.Assert(s != null, $"Looking up resource '{key}' failed. Was your resource name misspelled? Did you rebuild after adding a resource?");
System.Private.Uri (156)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\IPv4AddressHelper.Common.cs (10)
26Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 37Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 130Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 208Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 319Debug.Assert(parts[0] <= 0xFF); 326Debug.Assert(parts[0] <= 0xFF); 327Debug.Assert(parts[1] <= 0xFF); 334Debug.Assert(parts[0] <= 0xFF); 335Debug.Assert(parts[1] <= 0xFF); 336Debug.Assert(parts[2] <= 0xFF);
src\runtime\src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 127Debug.Assert(start < end); 316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\DomainNameHelper.cs (5)
61Debug.Assert(!str.AsSpan(start, index).Contains(':'), 75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index])); 220Debug.Assert(ReferenceEquals(hostname, UriHelper.StripBidiControlCharacters(hostname, hostname))); 254Debug.Assert(asciiSuccess, "TryGetAscii should always succeed with a 255-char buffer for valid IDN labels"); 286Debug.Assert(charsWritten == label.Length);
System\IPv4AddressHelper.cs (1)
18Debug.Assert(result != Invalid, $"Failed to parse after already validated: {str}");
System\IPv6AddressHelper.cs (6)
38Debug.Assert(success); 43Debug.Assert(success); 48Debug.Assert(success); 53Debug.Assert(success); 82Debug.Assert(success); 126Debug.Assert(name.StartsWith('['));
System\IriHelper.cs (2)
32Debug.Assert(char.IsHighSurrogate(highSurr)); 112Debug.Assert(charactersRead > 0);
System\PercentEncodingHelper.cs (15)
16Debug.Assert(input.Length >= 3); 17Debug.Assert(input[0] == '%'); 18Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) != Uri.c_DummyChar); 19Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) >= 128); 64Debug.Assert(totalCharsConsumed % 3 == 0); 65Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3 || bytesLeftInBuffer == 4); 66Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00000080 : 0x80000000)) != 0); 67Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00008000 : 0x00800000)) != 0); 68Debug.Assert(bytesLeftInBuffer < 3 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00800000 : 0x00008000)) != 0); 69Debug.Assert(bytesLeftInBuffer < 4 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x80000000 : 0x00000080)) != 0); 75Debug.Assert(bytesConsumed >= 2, $"Rune.DecodeFromUtf8 consumed {bytesConsumed} bytes, likely indicating input was modified concurrently during UnescapePercentEncodedUTF8Sequence's execution"); 91Debug.Assert(bytesConsumed > 0, $"Rune.DecodeFromUtf8 consumed {bytesConsumed} bytes when decoding {bytesLeftInBuffer} bytes"); 101Debug.Assert(bytesLeftInBuffer < 4); 106Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3); 149Debug.Assert(bytesLeftInBuffer == 0 || bytesLeftInBuffer == 1);
System\Uri.cs (58)
158Debug.Assert(InFact(Flags.MinimalUriInfoSet) == (_info is not null)); 162Debug.Assert(IsAbsoluteUri); 166Debug.Assert(offset.Scheme >= 0); 167Debug.Assert(offset.User >= 0 && offset.User >= offset.Scheme); 168Debug.Assert(offset.Host >= 0 && offset.Host >= offset.User); 169Debug.Assert(offset.Path >= 0); 170Debug.Assert(offset.End >= 0 && offset.End >= offset.Path); 174Debug.Assert(offset.Path >= offset.Host); 175Debug.Assert(offset.Query >= 0 && offset.Query >= offset.Path); 176Debug.Assert(offset.Fragment >= 0 && offset.Fragment >= offset.Query); 177Debug.Assert(offset.End >= offset.Fragment && offset.End <= _string.Length); 186Debug.Assert(offset.Path >= offset.Host); 197Debug.Assert(Ascii.IsValid(_string)); 205Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0); 258Debug.Assert(_syntax != null); 263Debug.Assert(sizeof(Flags) == sizeof(ulong)); 384Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 689Debug.Assert(err != ParsingError.None); 741Debug.Assert(IsAbsoluteUri); 995Debug.Assert(_info != null); 996Debug.Assert(_info.Host != null); 1917Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 1939Debug.Assert((err is ParsingError.None) == (syntax is not null)); 1957Debug.Assert(_syntax != null && !_syntax.IsSimple); 1958Debug.Assert((_flags & Flags.CustomParser_ParseMinimalAlreadyCalled) != 0); 1981Debug.Assert(_syntax != null); 1983Debug.Assert(ReferenceEquals(_string, OriginalString)); 2234Debug.Assert(str[idx] is '/' or '\\' && str[idx + 1] is '/' or '\\'); 2251Debug.Assert(str[idx - 1] == ':'); 2266Debug.Assert(IsDosPath); 2267Debug.Assert(char.IsAsciiLetter(str.AsSpan(idx).TrimStart(['/', '\\'])[0])); 2268Debug.Assert(str.AsSpan(idx).TrimStart(['/', '\\'])[1] is ':' or '|'); 2286Debug.Assert(_string.AsSpan(0, idx).SequenceEqual(OriginalString.AsSpan(0, idx))); 2297Debug.Assert(str.AsSpan(idx).Contains('@')); 2298Debug.Assert(str.IndexOf('@') == str.IndexOf('@', idx)); 2310Debug.Assert((uint)idx <= (uint)OriginalString.Length); 2324Debug.Assert(!IsUnc); 2628Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2667Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2737Debug.Assert(InFact(Flags.AllUriInfoSet)); 2867Debug.Assert(success); 3171Debug.Assert(str.StartsWith(_syntax.SchemeName, StringComparison.OrdinalIgnoreCase)); 3172Debug.Assert(str[_syntax.SchemeName.Length] == ':'); 3417Debug.Assert(InFact(Flags.HasUnicode)); 3418Debug.Assert(InFact(Flags.MinimalUriInfoSet)); 3419Debug.Assert(!InFact(Flags.UserDrivenParsing)); 3450Debug.Assert(!ReferenceEquals(_string, OriginalString)); 3484Debug.Assert(original.StartsWith('?')); 3518Debug.Assert(err == ParsingError.None); 3519Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 3613Debug.Assert(error == ParsingError.None); 3684Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 3685Debug.Assert((_flags & Flags.HasUserInfo) == 0 && (_flags & Flags.HostTypeMask) == 0); 3686Debug.Assert((uint)startOffset <= (uint)str.Length); 3777Debug.Assert(!hasUnicode); 4019Debug.Assert(delim is '@' or '/' or '?' or '#' or c_DummyChar or c_EOL); 4314Debug.Assert(slice.IsEmpty || slice.Overlaps(dest.RawChars)); 4381Debug.Assert(start <= dest.Length);
System\UriBuilder.cs (3)
271Debug.Assert(_uri is not null); 304Debug.Assert(_uri is not null); 387Debug.Assert(success);
System\UriExt.cs (13)
41Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 50Debug.Assert((err is ParsingError.None) == (_syntax is not null)); 74Debug.Assert(_syntax is not null); 157Debug.Assert(uriKind != UriKind.Absolute); 283Debug.Assert(result is null || result.IsAbsoluteUri); 507Debug.Assert(backingString is null || backingString.Length == charsToUnescape.Length); 576Debug.Assert(newLength <= charsToUnescape.Length); 591Debug.Assert(vsb.RawChars.Overlaps(destination)); 653Debug.Assert(result.Syntax is { IsSimple: false }, "A custom UriParser threw on InitializeAndValidate."); 665Debug.Assert(!baseUri.IsNotAbsoluteUri && !baseUri.UserDrivenParsing, "Uri::ResolveHelper()|baseUri is not Absolute or is controlled by User Parser."); 896Debug.Assert((otherUri._flags & Flags.Debug_LeftConstructor) != 0); 907Debug.Assert(!InFact(Flags.HasUnicode) || otherUri.IsNotAbsoluteUri); 928Debug.Fail("Uri failed to locate custom port at index: " + portIndex);
System\UriHelper.cs (18)
19Debug.Assert(charsWritten == buffer.Length); 170Debug.Assert(newLength > charsToEscape.Length); 185Debug.Assert(vsb.RawChars.Overlaps(destination)); 206Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 207Debug.Assert(backingString is null || backingString.Length == charsToEscape.Length); 233Debug.Assert(!noEscape.Contains('%'), "Need to treat % specially; it should be part of any escaped set"); 253Debug.Assert(!stringToEscape.IsEmpty && !noEscape.Contains(stringToEscape[0])); 269Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 270Debug.Assert(charsConsumed is 1 or 2); 312Debug.Assert(charsToCopy > 0); 353Debug.Assert(charactersRead > 0); 372Debug.Assert(unescapeMode != UnescapeMode.None); 489Debug.Assert(charactersRead > 0); 568Debug.Assert(backingString is null || strToClean.Length == backingString.Length); 612Debug.Assert(buffer.Length == destIndex); 748Debug.Assert(start >= readOffset && length > 0 && start + length <= span.Length); 752Debug.Assert(readOffset > writeOffset); 764Debug.Assert(readOffset > writeOffset);
System\UriScheme.cs (1)
77Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System\UriSyntax.cs (1)
266Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System.Private.Windows.Core (77)
System\Collections\Generic\ArrayBuilder.cs (4)
55Debug.Assert(_count == _items.Length); 58Debug.Assert(_items.Length > 0); 68Debug.Assert(_count == _maxCount); 69Debug.Assert(_count == _items.Length);
System\Private\Windows\BinaryFormat\BinaryFormatWriter.cs (2)
803Debug.WriteLine($"Failed to binary format: {ex.Message}"); 804Debug.Assert(ex is ArgumentException or SerializationException, "Unexpected write exception.");
System\Private\Windows\Nrbf\CoreNrbfSerializer.cs (1)
100Debug.Assert(s_knownTypes.Count == 60);
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
15Debug.Assert(!string.IsNullOrWhiteSpace(assemblyName)); 16Debug.Assert(!string.IsNullOrWhiteSpace(fullTypeName));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (2)
51Debug.Fail(ex.Message); 289Debug.Assert(record.RecordType is SerializationRecordType.MemberPrimitiveTyped);
System\Private\Windows\Ole\BinaryFormatUtilities.cs (3)
35Debug.Assert(data is not null); 52Debug.Fail($"Unexpected exception writing binary formatted data. {ex.Message}"); 92Debug.Assert(request.TypedRequest || typeof(T) == typeof(object), "Untyped requests should always be asking for object");
System\Private\Windows\Ole\ClipboardCore.cs (1)
283Debug.Assert(proxyDataObject.IsNull);
System\Private\Windows\Ole\Composition.NativeToManagedAdapter.cs (8)
389Debug.Assert(e is NotSupportedException, e.Message); 423Debug.WriteLineIf(hr == HRESULT.CLIPBRD_E_BAD_DATA, "CLIPBRD_E_BAD_DATA returned when trying to get clipboard data."); 424Debug.WriteLineIf(hr == HRESULT.DV_E_TYMED, "DV_E_TYMED returned when trying to get clipboard data."); 426Debug.WriteLineIf(hr == HRESULT.E_UNEXPECTED, "E_UNEXPECTED returned when trying to get clipboard data."); 427Debug.WriteLineIf(hr == HRESULT.COR_E_SERIALIZATION, 453Debug.WriteLine(ex.ToString()); 610Debug.Fail("All mapped formats must be either restricted or not restricted."); 675Debug.Assert(!nativeDataObject.IsNull, "You must have an innerData on all DataObjects");
System\Private\Windows\Ole\DataStore.cs (1)
49Debug.Assert(mappedFormat != format);
System\Private\Windows\Ole\FormatEnumerator.cs (1)
37Debug.WriteLine("IDataObject.GetFormats returned null.");
System\Private\Windows\Ole\TypeBinder.cs (4)
55Debug.Assert(request.TypedRequest || request.Resolver is null, "Untyped methods should not provide a resolver."); 56Debug.Assert(request.TypedRequest || rootType == typeof(object), "Untyped requests should always be asking for object"); 70Debug.Assert(CoreAppContextSwitches.ClipboardDragDropEnableUnsafeBinaryFormatterSerialization); 71Debug.Assert(FeatureSwitches.EnableUnsafeBinaryFormatterSerialization);
System\SpanHelpers.cs (1)
15Debug.Assert(!destination.IsEmpty);
System\SpanReader.cs (3)
260Debug.Assert((uint)count <= (uint)_unread.Length); 267Debug.Assert((uint)length <= (uint)span.Length); 278Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\SpanWriter.cs (2)
92Debug.Assert((uint)count <= (uint)_unwritten.Length); 99Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (6)
51Debug.Assert(value >= 0); 52Debug.Assert(value <= _chars.Length); 62Debug.Assert(capacity >= 0); 99Debug.Assert(index < _pos); 321Debug.Assert(additionalCapacityBeyondPos > 0); 322Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\TypeExtensions.cs (2)
29Debug.Assert(type is not null); 280Debug.Fail(e.Message);
System\Value.cs (3)
55Debug.Assert(type.IsArray); 68Debug.Fail($"Unexpected type {type.Name}."); 670Debug.Assert(Unsafe.SizeOf<T>() <= sizeof(ulong));
System\Value.PackedDateTimeOffset.cs (1)
57Debug.Assert(hours is >= 0 and <= 28);
Windows\Win32\Foundation\HRESULT.cs (3)
38Debug.Assert(IsNtStatus); 54Debug.WriteLine(ex); 58public void AssertSuccess() => Debug.Assert(Succeeded, $"Result failed: {this}");
Windows\Win32\Graphics\Gdi\ARGB.cs (2)
25Debug.Assert(BitConverter.IsLittleEndian); 35Debug.Assert(BitConverter.IsLittleEndian);
Windows\Win32\Graphics\Gdi\RegionScope.cs (1)
45Debug.Assert(result != -1, "GetClipRgn failed");
Windows\Win32\Graphics\GdiPlus\GdiPlusInitialization.cs (1)
15Debug.Assert(s_initToken == 0, "GdiplusInitialization: Initialize should not be called more than once!");
Windows\Win32\Graphics\GdiPlus\StatusExtensions.cs (4)
19Debug.Assert(status != Status.Ok, "Throwing an exception for an 'Ok' return code"); 62Debug.Fail("We should be special casing FontFamilyNotFound so we can provide the font name"); 66Debug.Fail("We should be special casing FontStyleNotFound so we can provide the font name"); 70Debug.Fail("We should be special casing NotTrueTypeFont so we can provide the font name");
Windows\Win32\PInvokeCore.GetSysColorBrush.cs (1)
27Debug.Assert(systemColor.IsSystemColor);
Windows\Win32\PInvokeCore.GetWindowText.cs (2)
31Debug.Fail($"GetWindowTextLength failed. Error: {new Win32Exception(error).Message}"); 50Debug.Fail($"GetWindowText failed. Error: {new Win32Exception().Message}");
Windows\Win32\System\Com\AgileComPointer.cs (2)
89Debug.Assert(count >= 0); 197Debug.Assert(hr.Succeeded);
Windows\Win32\System\Com\ComHelpers.cs (5)
113Debug.WriteLine($"Did not find IUnknown for {@object.GetType().Name}. {ex.Message}"); 153Debug.WriteLine($"{nameof(TryGetObjectForIUnknown)}: Found a manual CCW, but couldn't unwrap to {typeof(TWrapper).Name}"); 191Debug.Fail("How did we fail to query for IUnknown?"); 229Debug.WriteLine($"{nameof(TryGetObjectForIUnknown)}: Failed to get object for {typeof(TObject).Name}. {ex.Message}"); 237Debug.WriteLineIf(count > 0, $"{nameof(TryGetObjectForIUnknown)}: Count for {typeof(TObject).Name} is {count} after release.");
Windows\Win32\System\Com\GlobalInterfaceTable.cs (1)
66Debug.WriteLineIf(hr.Failed, $"{nameof(GlobalInterfaceTable)}: Failed to revoke interface.");
Windows\Win32\System\Com\GlobalInterfaceTable.UnknownStrategy.cs (1)
19Debug.Assert(_cookie == 0, "A cookie has already been generated for this instance.");
Windows\Win32\System\Com\IDispatch.cs (1)
60Debug.WriteLine($"""
Windows\Win32\System\Com\Lifetime.cs (1)
27Debug.Assert(lifetime->_refCount > 0);
Windows\Win32\System\Com\WinFormsComWrappers.cs (2)
28Debug.Fail("object does not implement IManagedWrapper"); 85Debug.Fail($"Exception thrown in UnwrapAndInvoke {ex.Message}.");
Windows\Win32\System\Variant\VARIANT.cs (3)
283Debug.Assert(hr == HRESULT.S_OK); 441Debug.Assert(hr == HRESULT.S_OK); 455Debug.Fail("The CLR should not support arrays with more than 32 dimensions.");
System.Private.Windows.GdiPlus (1)
Windows\Win32\PInvokeGdiPlus.cs (1)
25Debug.Assert(initialized);
System.Private.Xml (3189)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Xml\Base64Decoder.cs (5)
86Debug.Assert(buffer != null); 87Debug.Assert(count >= 0); 88Debug.Assert(index >= 0); 89Debug.Assert(buffer.Length - index >= count); 90Debug.Assert((buffer as byte[]) != null);
System\Xml\BinaryXml\SqlUtils.cs (17)
85Debug.Assert(rgulU.Length == s_cNumeMax); 92Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!"); 93Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero"); 94Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array"); 130Debug.Assert(bPrec <= s_maxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision"); 136Debug.Assert(uiDigit < 10); 250Debug.Assert(m_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid"); 251Debug.Assert(m_bScale <= m_bPrec, "m_bScale <= m_bPrec", "In AssertValid"); 252Debug.Assert(m_bScale >= 0, "m_bScale >= 0", "In AssertValid"); 253Debug.Assert(m_bPrec > 0, "m_bPrec > 0", "In AssertValid"); 254Debug.Assert(CLenFromPrec(m_bPrec) >= m_bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid"); 255Debug.Assert(m_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid"); 262Debug.Assert(m_bLen == 1, "m_bLen == 1", "In AssertValid"); 267Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid"); 323Debug.Assert(val >= 0 && val < 100); 329Debug.Assert(val > -10000 && val < 10000); 341Debug.Assert(val >= 0 && val < 1000);
System\Xml\BinaryXml\XmlBinaryReader.cs (50)
356Debug.Assert(len >= 2 && (data[0] == 0xdf && data[1] == 0xff)); 457Debug.Assert(_textXmlReader != null); 496Debug.Assert(_textXmlReader != null); 525Debug.Assert(_textXmlReader != null); 585Debug.Assert(_textXmlReader != null); 607Debug.Assert(_textXmlReader != null); 638Debug.Assert(_textXmlReader != null); 651Debug.Assert(_textXmlReader != null); 670Debug.Assert(_textXmlReader != null); 686Debug.Assert(_textXmlReader != null); 701Debug.Assert(_textXmlReader != null); 723Debug.Assert(_textXmlReader != null); 742Debug.Assert(_textXmlReader != null); 758Debug.Assert(_textXmlReader != null); 785Debug.Assert(_textXmlReader != null); 809Debug.Fail("Unexpected parent NodeType"); 817Debug.Assert(_textXmlReader != null); 866Debug.Assert(_textXmlReader != null); 904Debug.Assert(_textXmlReader != null); 911Debug.Assert(decl != null); 943Debug.Assert(_textXmlReader != null); 1124Debug.Fail("should never happen"); 1214Debug.Fail("should never happen"); 1309Debug.Fail("should never happen"); 1404Debug.Fail("should never happen"); 1499Debug.Fail("should never happen"); 1594Debug.Fail("should never happen"); 1689Debug.Fail("should never happen"); 1810Debug.Assert(_textXmlReader != null); 1850Debug.Assert(_textXmlReader != null); 2004Debug.Assert(_mark <= _end, "Mark should never be past End"); 2005Debug.Assert(_mark <= _pos, "Mark should never be after Pos"); 2025Debug.Assert((_attributes[i].contentPos >= 0) && (_attributes[i].contentPos <= (end))); 2032Debug.Assert(_attrCount == 0); 2049Debug.Assert((_pos + require) >= _end); 2089Debug.Assert(0 != (b & 0x80)); 2322Debug.Assert(pos >= 0 && cch >= 0); 2756Debug.Assert(_stringValue == null, "this.stringValue == null"); 2757Debug.Assert(_token == BinXmlToken.CData, "this.token == BinXmlToken.CData"); 2950Debug.Assert(_mark < 0); 3072Debug.Assert(_pos >= 3); 3077Debug.Assert(_pos >= 1); 3083Debug.Assert(_pos >= 2); 3179Debug.Assert(_prevNameInfo != null); 3231Debug.Assert(_textXmlReader != null); 3485Debug.Assert(_checkCharacters, "this.checkCharacters"); 3491Debug.Assert(data.Length % 2 == 0, "Data size should not be odd"); 3540Debug.Assert(!_checkCharacters, "!this.checkCharacters"); 3543Debug.Assert(0 == ((_pos - _tokDataPos) & 1), "Data size should not be odd"); 4393System.Diagnostics.Debug.WriteLine($"Unhandled token: {token}");
System\Xml\BinHexDecoder.cs (5)
90Debug.Assert(buffer != null); 91Debug.Assert(count >= 0); 92Debug.Assert(index >= 0); 93Debug.Assert(buffer.Length - index >= count); 94Debug.Assert((buffer as byte[]) != null);
System\Xml\BitStack.cs (2)
50Debug.Assert(_curr != 0x1, "Stack empty"); 71Debug.Assert(_curr != 0x1, "Stack empty");
System\Xml\Cache\XPathDocumentBuilder.cs (29)
153Debug.Assert(prefix != null && localName != null && ns != null && localName.Length != 0 && baseUri != null); 214Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 288Debug.Assert(namespaceName != null); 289Debug.Assert(prefix != null && !prefix.Equals("xmlns")); 290Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 291Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 308Debug.Assert(_pageSibling != null); 309Debug.Assert(_pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute); 320Debug.Assert(_idxParent != 0 && _pageParent != null, "ID attribute must have an element parent"); 322Debug.Assert(id != null); 482Debug.Assert(_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element); 494Debug.Assert(_idxSibling == 0 || (_pageSibling != null && _pageSibling[_idxSibling].NodeType == XPathNodeType.Attribute)); 495Debug.Assert(!prefix.Equals("xmlns") && !namespaceName.Equals(XmlReservedNs.NsXmlNs)); 496Debug.Assert(_idxParent == 0 || _idxNmsp != 0); 497Debug.Assert(_idxParent == 0 || (_pageParent != null && _pageParent[_idxParent].NodeType == XPathNodeType.Element)); 530Debug.Assert(pageOrig != null); 554Debug.Assert(prefix.Equals("xml"), "xmlns:xml namespace declaration should always be present in the list."); 569Debug.Assert(_pageParent != null); 632Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 662Debug.Assert(xptyp != XPathNodeType.Namespace); 705Debug.Assert(_lineInfo.HasLineInfo(), "HasLineInfo should have been checked before this."); 734Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 744Debug.Assert(_pageParent != null); 751Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 755Debug.Assert(_pageSibling != null); 773Debug.Assert(_textBldr.HasText || (_idxSibling == 0 && _idxParent == 0), "Cannot create empty text node unless it's a top-level text node."); 774Debug.Assert(_idxSibling == 0 || (_pageSibling != null && !_pageSibling[_idxSibling].IsText), "Cannot create adjacent text nodes."); 903Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 904Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
System\Xml\Cache\XPathDocumentNavigator.cs (18)
36Debug.Assert(pageCurrent != null && idxCurrent != 0); 37Debug.Assert((pageParent == null) == (idxParent == 0)); 84Debug.Fail("ReadStringValue() should have taken care of these node types."); 88Debug.Assert(_idxParent != 0 && _pageParent![_idxParent].HasCollapsedText, 97Debug.Assert(_pageCurrent[_idxCurrent].NodeType == XPathNodeType.Text); 100Debug.Assert(value != null); 120Debug.Assert(page[idx].NodeType == XPathNodeType.Element || page[idx].IsText); 122Debug.Assert(value != null); 373Debug.Assert(page != null); 434Debug.Assert(_pageCurrent != null); 454Debug.Assert(_pageParent != null); 494Debug.Assert(page != null); 496Debug.Assert(page[idx].NodeType == XPathNodeType.Element); 584Debug.Assert(_pageCurrent != null); 663Debug.Assert(_pageCurrent != null); 695Debug.Assert(page[idx].HasCollapsedText); 697Debug.Assert(_pageCurrent != null); 704Debug.Assert(page[idx].IsText);
System\Xml\Cache\XPathNode.cs (14)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true."); 173Debug.Assert(pageNode != null); 211Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 223Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized."); 361Debug.Assert(info != null && idxParent <= ushort.MaxValue); 372Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, $"Line number offset too large or small: {lineNumOffset}"); 373Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, $"Line position offset too large or small: {linePosOffset}"); 383Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, $"Collapsed text line position offset too large or small: {posOffset}"); 400Debug.Assert(NodeType == XPathNodeType.Element); 411Debug.Assert(NodeType == XPathNodeType.Element); 439Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= ushort.MaxValue, "Bad argument"); 440Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once."); 458Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= ushort.MaxValue, "Bad argument"); 459Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
System\Xml\Cache\XPathNodeHelper.cs (34)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 119Debug.Assert(idx != 0); 120Debug.Assert(page != null); 138Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 161Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 179Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 180Debug.Assert(idxNode <= ushort.MaxValue); 181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue); 194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 200Debug.Assert(idx != 0); 228Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 261Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 299Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 348Debug.Assert(pagePrec != null); 369Debug.Assert(idxAnc != 0 && pageAnc != null); 394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)"); 428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 454Debug.Assert(page != null); 527Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 528Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text."); 529Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case."); 566Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces."); 585Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)"); 586Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case."); 662Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild."); 663Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page."); 669Debug.Assert(pageNode != null);
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
124Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 294Debug.Assert(other != null); 295Debug.Assert((object?)_doc == (object?)other._doc); 296Debug.Assert(_pageInfo == null); 329Debug.Assert(_localName != null); 336Debug.Assert(_prefix != null);
System\Xml\Core\CharEntityEncoderFallback.cs (3)
35Debug.Assert(_textContentMarks != null); 128Debug.Assert(_charEntityIndex < _charEntity.Length); 141Debug.Assert(_charEntityIndex <= _charEntity.Length);
System\Xml\Core\HtmlEncodedRawTextWriter.cs (21)
50Debug.Assert(name != null && name.Length > 0); 97Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 103Debug.Assert(prefix.Length == 0); 143Debug.Assert(prefix.Length == 0); 168Debug.Assert(prefix.Length == 0); 288Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 292Debug.Assert(prefix.Length == 0); 356Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 378Debug.Assert(text != null); 413Debug.Assert(buffer != null); 414Debug.Assert(index >= 0); 415Debug.Assert(count >= 0 && index + count <= buffer.Length); 440Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 441Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 442Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 564Debug.Assert(pSrc <= pSrcEnd); 652Debug.Assert(pSrc <= pSrcEnd); 702Debug.Assert(_uriEscapingBuffer?.Length > 0); 816Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 824Debug.Assert(prefix.Length == 0); 880Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\HtmlUtf8RawTextWriter.cs (21)
45Debug.Assert(name != null && name.Length > 0); 90Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(prefix.Length == 0); 134Debug.Assert(prefix.Length == 0); 157Debug.Assert(prefix.Length == 0); 275Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 279Debug.Assert(prefix.Length == 0); 339Debug.Assert(!string.IsNullOrEmpty(target) && text != null); 359Debug.Assert(text != null); 392Debug.Assert(buffer != null); 393Debug.Assert(index >= 0); 394Debug.Assert(count >= 0 && index + count <= buffer.Length); 417Debug.Assert((int)ElementProperties.URI_PARENT == (int)AttributeProperties.URI); 418Debug.Assert((int)ElementProperties.BOOL_PARENT == (int)AttributeProperties.BOOLEAN); 419Debug.Assert((int)ElementProperties.NAME_PARENT == (int)AttributeProperties.NAME); 541Debug.Assert(pSrc <= pSrcEnd); 629Debug.Assert(pSrc <= pSrcEnd); 679Debug.Assert(_uriEscapingBuffer?.Length > 0); 788Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 794Debug.Assert(prefix.Length == 0); 850Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\IncrementalReadDecoders.cs (17)
63Debug.Assert(_buffer != null); 64Debug.Assert(chars != null); 65Debug.Assert(len >= 0); 66Debug.Assert(startPos >= 0); 67Debug.Assert(chars.Length - startPos >= len); 69Debug.Assert(len > 0); 85Debug.Assert(_buffer != null); 86Debug.Assert(str != null); 87Debug.Assert(len >= 0); 88Debug.Assert(startPos >= 0); 89Debug.Assert(str.Length - startPos >= len); 91Debug.Assert(len > 0); 111Debug.Assert(buffer != null); 112Debug.Assert(count >= 0); 113Debug.Assert(index >= 0); 114Debug.Assert(buffer.Length - index >= count); 116Debug.Assert((buffer as char[]) != null);
System\Xml\Core\QueryOutputWriter.cs (2)
138Debug.Assert(!_outputDocType); 351Debug.Assert(!_inCDataSection);
System\Xml\Core\QueryOutputWriterV1.cs (6)
128Debug.Assert(!_outputDocType); 161Debug.Assert(_qnameCData != null); 162Debug.Assert(_bitsCData != null); 178Debug.Assert(_bitsCData != null); 191Debug.Assert(_bitsCData != null); 319Debug.Assert(!_inCDataSection);
System\Xml\Core\ReadContentAsBinaryHelper.cs (11)
93Debug.Fail($"Unexpected state {_state}"); 97Debug.Assert(_state == State.InReadContent); 136Debug.Fail($"Unexpected state {_state}"); 140Debug.Assert(_state == State.InReadContent); 179Debug.Fail($"Unexpected state {_state}"); 183Debug.Assert(_state == State.InReadElementContent); 222Debug.Fail($"Unexpected state {_state}"); 226Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 330Debug.Assert(_decoder != null); 355Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (11)
44Debug.Fail($"Unexpected state {_state}"); 48Debug.Assert(_state == State.InReadContent); 88Debug.Fail($"Unexpected state {_state}"); 92Debug.Assert(_state == State.InReadContent); 132Debug.Fail($"Unexpected state {_state}"); 136Debug.Assert(_state == State.InReadElementContent); 176Debug.Fail($"Unexpected state {_state}"); 180Debug.Assert(_state == State.InReadElementContent); 224Debug.Assert(_reader.NodeType == XmlNodeType.Element); 252Debug.Assert(_decoder != null); 277Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\XmlAsyncCheckReader.cs (3)
36Debug.Assert(!(reader is IXmlSchemaInfo)); 41Debug.Assert(!(reader is IXmlSchemaInfo)); 44Debug.Assert(!(reader is IXmlSchemaInfo));
System\Xml\Core\XmlAutoDetectWriter.cs (6)
33Debug.Assert(writerSettings.OutputMethod == XmlOutputMethod.AutoDetect); 106Debug.Assert(_wrapped != null); 309Debug.Assert(_wrapped != null); 315Debug.Assert(_wrapped != null); 321Debug.Assert(_wrapped != null); 399Debug.Assert(_wrapped == null);
System\Xml\Core\XmlCharCheckingReader.cs (3)
51Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 188Debug.Fail($"Unexpected state {_state}"); 643Debug.Assert(readerAsNSResolver != null);
System\Xml\Core\XmlCharCheckingReaderAsync.cs (1)
50Debug.Fail($"Unexpected state {_state}");
System\Xml\Core\XmlCharCheckingWriter.cs (1)
33Debug.Assert(checkValues || replaceNewLines);
System\Xml\Core\XmlEncodedRawTextWriter.cs (45)
114Debug.Assert(writer != null && settings != null); 136Debug.Assert(stream != null && settings != null); 253Debug.Assert(name != null && name.Length > 0); 294Debug.Assert(localName != null && localName.Length > 0); 295Debug.Assert(prefix != null); 326Debug.Assert(localName != null && localName.Length > 0); 327Debug.Assert(prefix != null); 358Debug.Assert(localName != null && localName.Length > 0); 359Debug.Assert(prefix != null); 378Debug.Assert(localName != null && localName.Length > 0); 379Debug.Assert(prefix != null); 412Debug.Assert(prefix != null && namespaceName != null); 429Debug.Assert(prefix != null); 468Debug.Assert(text != null); 475Debug.Assert(_bufPos >= 4); 505Debug.Assert(text != null); 524Debug.Assert(name != null && name.Length > 0); 525Debug.Assert(text != null); 546Debug.Assert(name != null && name.Length > 0); 593Debug.Assert(ws != null); 615Debug.Assert(text != null); 652Debug.Assert(buffer != null); 653Debug.Assert(index >= 0); 654Debug.Assert(count >= 0 && index + count <= buffer.Length); 676Debug.Assert(buffer != null); 677Debug.Assert(index >= 0); 678Debug.Assert(count >= 0 && index + count <= buffer.Length); 694Debug.Assert(data != null); 791Debug.Assert(_stream != null || _writer != null); 811Debug.Assert(_textContentMarks![0] == 1); 872Debug.Assert(_bufPos == 1); 909Debug.Assert(pSrc <= pSrcEnd); 1032Debug.Assert(pSrc <= pSrcEnd); 1133Debug.Assert(s != null); 1163Debug.Assert(pSrc <= pSrcEnd); 1228Debug.Assert(pSrc <= pSrcEnd); 1348Debug.Assert(pSrc <= pSrcEnd); 1499Debug.Assert(pSrc <= pSrcEnd); 1607Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1633Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1634Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1683Debug.Assert(_inTextContent != value); 1684Debug.Assert(_inTextContent || ((_lastMarkPos & 1) == 0)); 1695Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1960Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEncodedRawTextWriterAsync.cs (42)
135Debug.Assert(name != null && name.Length > 0); 177Debug.Assert(localName != null && localName.Length > 0); 178Debug.Assert(prefix != null); 205Debug.Assert(localName != null && localName.Length > 0); 206Debug.Assert(prefix != null); 240Debug.Assert(localName != null && localName.Length > 0); 241Debug.Assert(prefix != null); 262Debug.Assert(localName != null && localName.Length > 0); 263Debug.Assert(prefix != null); 307Debug.Assert(prefix != null && namespaceName != null); 317Debug.Assert(prefix != null); 362Debug.Assert(text != null); 369Debug.Assert(_bufPos >= 4); 400Debug.Assert(text != null); 420Debug.Assert(name != null && name.Length > 0); 421Debug.Assert(text != null); 443Debug.Assert(name != null && name.Length > 0); 492Debug.Assert(ws != null); 511Debug.Assert(text != null); 548Debug.Assert(buffer != null); 549Debug.Assert(index >= 0); 550Debug.Assert(count >= 0 && index + count <= buffer.Length); 570Debug.Assert(buffer != null); 571Debug.Assert(index >= 0); 572Debug.Assert(count >= 0 && index + count <= buffer.Length); 586Debug.Assert(data != null); 623Debug.Assert(_stream != null || _writer != null); 643Debug.Assert(_textContentMarks![0] == 1); 704Debug.Assert(_bufPos == 1); 744Debug.Assert(pSrc <= pSrcEnd); 949Debug.Assert(pSrc <= pSrcEnd); 1189Debug.Assert(pSrc <= pSrcEnd); 1256Debug.Assert(text1 != null); 1257Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1258Debug.Assert(text3 != null || (text4 == null)); 1314Debug.Assert(text1 != null); 1315Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1316Debug.Assert(text3 != null || (text4 == null)); 1365Debug.Assert(pSrc <= pSrcEnd); 1567Debug.Assert(pSrc <= pSrcEnd); 1757Debug.Assert(pSrc <= pSrcEnd); 1919Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEventCache.cs (5)
125Debug.Assert(idxPage + 1 == _pages.Count); 241Debug.Fail($"Unknown event: {page[idxEvent].EventType}"); 247Debug.Fail("Unknown event should be added to end of event sequence."); 279Debug.Assert(idxPage + 1 == _pages.Count); 304Debug.Fail("Unknown event should be added to end of event sequence.");
System\Xml\Core\XmlRawWriter.cs (1)
309Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlRawWriterAsync.cs (1)
223Debug.Assert(_base64Encoder != null);
System\Xml\Core\XmlReader.cs (58)
964Debug.Assert(parentDepth == 0); 988Debug.Assert(NodeType == XmlNodeType.EndElement || NodeType == XmlNodeType.None || ReadState == ReadState.Error); 1005Debug.Assert(parentDepth == 0); 1030Debug.Assert(NodeType == XmlNodeType.EndElement); 1306Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.None))); 1307Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Element))); 1308Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Attribute))); 1309Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Text))); 1310Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.CDATA))); 1311Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EntityReference))); 1312Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Entity))); 1313Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1314Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Comment))); 1315Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Document))); 1316Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentType))); 1317Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1318Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Notation))); 1319Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.Whitespace))); 1320Debug.Assert(0 != (IsTextualNodeBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1321Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndElement))); 1322Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.EndEntity))); 1323Debug.Assert(0 == (IsTextualNodeBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1333Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.None))); 1334Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Element))); 1335Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Attribute))); 1336Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Text))); 1337Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.CDATA))); 1338Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EntityReference))); 1339Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Entity))); 1340Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1341Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Comment))); 1342Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Document))); 1343Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentType))); 1344Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1345Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Notation))); 1346Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.Whitespace))); 1347Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1348Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndElement))); 1349Debug.Assert(0 != (CanReadContentAsBitmap & (1 << (int)XmlNodeType.EndEntity))); 1350Debug.Assert(0 == (CanReadContentAsBitmap & (1 << (int)XmlNodeType.XmlDeclaration))); 1360Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.None))); 1361Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Element))); 1362Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Attribute))); 1363Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Text))); 1364Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.CDATA))); 1365Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EntityReference))); 1366Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Entity))); 1367Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.ProcessingInstruction))); 1368Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Comment))); 1369Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Document))); 1370Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.DocumentType))); 1371Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.DocumentFragment))); 1372Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.Notation))); 1373Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.Whitespace))); 1374Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.SignificantWhitespace))); 1375Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndElement))); 1376Debug.Assert(0 == (HasValueBitmap & (1 << (int)XmlNodeType.EndEntity))); 1377Debug.Assert(0 != (HasValueBitmap & (1 << (int)XmlNodeType.XmlDeclaration)));
System\Xml\Core\XmlReaderSettings.cs (1)
473Debug.Assert(_addValidationFunc != null);
System\Xml\Core\XmlSubtreeReader.cs (51)
432Debug.Assert(reader.NodeType == XmlNodeType.Element); 457Debug.Assert(_curNode.type == XmlNodeType.Attribute); 479Debug.Assert(reader.Depth >= _initialDepth); 489Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 533Debug.Fail($"Unexpected state {_state}"); 550Debug.Assert(reader.Depth >= _initialDepth); 587Debug.Assert(reader.Depth >= _initialDepth); 601Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 616Debug.Assert(reader.Depth >= _initialDepth); 652Debug.Fail($"Unexpected state {_state}"); 868Debug.Assert(_binDecoder != null); 875Debug.Assert(AttributeCount > 0); 878Debug.Fail($"Unexpected state {_state}"); 901Debug.Fail($"Unexpected state {_state}"); 958Debug.Fail($"Unexpected state {_state}"); 1006Debug.Assert(_binDecoder != null); 1013Debug.Assert(AttributeCount > 0); 1016Debug.Fail($"Unexpected state {_state}"); 1039Debug.Fail($"Unexpected state {_state}"); 1095Debug.Fail($"Unexpected state {_state}"); 1154Debug.Fail($"Unexpected state {_state}"); 1338Debug.Assert(_state == State.ClearNsAttributes || _state == State.Interactive || _state == State.PopNamespaceScope); 1366Debug.Assert(index >= 0 && index <= _nsAttrCount); 1399Debug.Assert(_state == State.Interactive); 1406Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 1440Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex); 1470Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Initial))); 1471Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.Interactive))); 1472Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Error))); 1473Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.EndOfFile))); 1474Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.Closed))); 1475Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.PopNamespaceScope))); 1476Debug.Assert(0 != (AttributeActiveStates & (1 << (int)State.ClearNsAttributes))); 1477Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1478Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1479Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBase64))); 1480Debug.Assert(0 == (AttributeActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1491Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Initial))); 1492Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.Interactive))); 1493Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Error))); 1494Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.EndOfFile))); 1495Debug.Assert(0 == (NamespaceActiveStates & (1 << (int)State.Closed))); 1496Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.PopNamespaceScope))); 1497Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ClearNsAttributes))); 1498Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBase64))); 1499Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadElementContentAsBinHex))); 1500Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBase64))); 1501Debug.Assert(0 != (NamespaceActiveStates & (1 << (int)State.ReadContentAsBinHex))); 1509Debug.Assert(_tmpNode.localName == string.Empty && _tmpNode.prefix == string.Empty && _tmpNode.name == string.Empty && _tmpNode.namespaceUri == string.Empty); 1552Debug.Fail($"Unexpected state {_state}"); 1560Debug.Assert(_state == State.Interactive ||
System\Xml\Core\XmlSubtreeReaderAsync.cs (21)
42Debug.Assert(reader.Depth >= _initialDepth); 52Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 96Debug.Fail($"Unexpected state {_state}"); 113Debug.Assert(reader.Depth >= _initialDepth); 127Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 142Debug.Assert(reader.Depth >= _initialDepth); 178Debug.Fail($"Unexpected state {_state}"); 274Debug.Assert(_binDecoder != null); 281Debug.Assert(AttributeCount > 0); 284Debug.Fail($"Unexpected state {_state}"); 307Debug.Fail($"Unexpected state {_state}"); 364Debug.Fail($"Unexpected state {_state}"); 412Debug.Assert(_binDecoder != null); 419Debug.Assert(AttributeCount > 0); 422Debug.Fail($"Unexpected state {_state}"); 445Debug.Fail($"Unexpected state {_state}"); 501Debug.Fail($"Unexpected state {_state}"); 552Debug.Fail($"Unexpected state {_state}"); 583Debug.Assert(_state == State.Interactive); 590Debug.Assert(_state == State.ReadElementContentAsBase64 || _state == State.ReadElementContentAsBinHex); 624Debug.Assert(_state == State.ReadContentAsBase64 || _state == State.ReadContentAsBinHex);
System\Xml\Core\XmlTextEncoder.cs (11)
74Debug.Assert(_attrValue != null); 88Debug.Assert(_attrValue != null); 120Debug.Assert(_attrValue != null); 208Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 228Debug.Assert(_attrValue != null); 247Debug.Assert(_attrValue != null); 364Debug.Assert((ch < 0x20 && !XmlCharType.IsWhiteSpace(ch)) || (ch > 0xFFFD)); 387Debug.Assert(_attrValue != null); 446Debug.Assert(_attrValue != null); 465Debug.Assert(_attrValue != null); 478Debug.Assert(_attrValue != null);
System\Xml\Core\XmlTextReaderImpl.cs (294)
317Debug.Assert(nt != null); 330Debug.Assert(_index == 0); 371Debug.Assert(!_nameTableFromSettings); 393Debug.Assert(_index == 0); 442Debug.Fail($"Unexpected conformance level {settings.ConformanceLevel}"); 601Debug.Assert(baseUri == null); 629Debug.Assert(_laterInitParam != null); 630Debug.Assert(_laterInitParam.inputUriResolver != null); 631Debug.Assert(_laterInitParam.inputbaseUri != null); 632Debug.Assert(_reportedBaseUri != null); 699Debug.Assert(baseUri == null); 730Debug.Assert(_laterInitParam != null); 731Debug.Assert(_laterInitParam.inputStream != null); 732Debug.Assert(_reportedBaseUri != null); 763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both"); 789Debug.Assert(_laterInitParam != null); 790Debug.Assert(_laterInitParam.inputTextReader != null); 791Debug.Assert(_reportedBaseUri != null); 812Debug.Assert(xmlFragment != null); 838default: Debug.Fail($"Unexpected fragment type {_fragmentType}"); goto case XmlNodeType.None; 1195Debug.Assert(_laterInitParam != null); 1210Debug.Fail("Invalid InitInputType"); 1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1237Debug.Assert(!_ps.appendMode); 1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1270Debug.Assert(_curNode.type == XmlNodeType.Element); 1334Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 1362Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 1394Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1395Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1415Debug.Assert(_namespaceManager != null); 1498Debug.Assert(_parsingMode == ParsingMode.Full); 1517Debug.Fail("Unexpected entity type"); 1543Debug.Fail("Unexpected entity type"); 1559Debug.Assert(value is XmlTextReader); 1578Debug.Assert(_outerReader is XmlTextReaderImpl); 1867Debug.Assert(_ps.chars != null); 1891Debug.Assert(_ps.chars != null); 1944Debug.Assert(_namespaceManager != null); 1952Debug.Assert(_namespaceManager != null); 1988Debug.Assert(_namespaceManager != null); 2008Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create."); 2013Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create."); 2041Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create."); 2046Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create."); 2066Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create."); 2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create."); 2123Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create."); 2137Debug.Assert(_namespaceManager != null); 2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create."); 2166Debug.Assert(_stringBuilder.Length == 0); 2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create."); 2207Debug.Assert(_outerReader is XmlTextReader); 2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create."); 2243Debug.Assert(_outerReader is XmlTextReader); 2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create."); 2277Debug.Assert(_outerReader is XmlTextReader); 2404Debug.Assert(value >= 0 && value <= _ps.charsUsed); 2490Debug.Assert(_parsingMode == ParsingMode.Full); 2578Debug.Assert(_parsingStatesStackTop == -1); 2579Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 2586Debug.Assert(_xmlResolver != null); 2598Debug.Assert(_ps.appendMode); 2614Debug.Assert(_parsingStatesStackTop == -1); 2615Debug.Assert(internalDtd != null); 2788Debug.Assert(InAttributeValueIterator); 2825Debug.Assert(baseUriStr != null); 2831Debug.Assert(baseUri != null); 2842Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 2843Debug.Assert(baseUriStr != null); 2844Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 2917Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 2918Debug.Assert(baseUriStr != null); 2946Debug.Assert(_ps.stream == null && _ps.textReader == null); 2947Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0); 2948Debug.Assert(baseUriStr != null); 2949Debug.Assert(str != null); 3004Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3008Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl); 3009Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 3034Debug.Assert(context != null && context.HasDtdInfo); 3048Debug.Fail("Unhandled DtdProcessing enumeration value."); 3056Debug.Assert(_url != null && _url.Length > 0); 3081Debug.Assert(_ps.stream != null); 3089Debug.Assert(_ps.bytes != null); 3090Debug.Assert(_ps.bytePos == 0); 3176Debug.Assert(_ps.charPos == 0); 3194Debug.Assert(_ps.encoding != null); 3195Debug.Assert(_ps.bytes != null); 3206Debug.Assert(_ps.encoding != null); 3209Debug.Assert(_ps.stream != null); 3221Debug.Assert(_ps.encoding != null); 3270Debug.Assert(newEncoding != null); 3271Debug.Assert(newEncoding.EncodingName != "UTF-8"); 3285Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3286Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false"); 3288Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range."); 3296Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos, 3305Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos, 3314Debug.Assert(_ps.encoding != null); 3315Debug.Assert(_ps.chars != null); 3358Debug.Assert(_ps.chars != null); 3381Debug.Assert(_ps.bytes != null); 3440Debug.Assert(_ps.bytes != null); 3455Debug.Assert(_ps.bytes != null); 3494Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3505Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3506Debug.Assert(_ps.chars != null); 3507Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3531Debug.Assert(maxCharsCount >= charsCount); 3546Debug.Assert(_ps.decoder != null); 3547Debug.Assert(_ps.bytes != null); 3548Debug.Assert(_ps.chars != null); 3554Debug.Fail("We should get an exception again."); 3596Debug.Assert(_ps.chars != null); 3626Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3670Debug.Assert(_ps.encoding != null); 3747Debug.Assert(attr != null); 3779Debug.Assert(attr != null); 3805Debug.Assert(attr != null); 3821Debug.Assert(attr != null); 3836Debug.Assert(!isTextDecl); 3842Debug.Assert(attr != null); 3848Debug.Fail($"Unexpected xmlDeclState {xmlDeclState}"); 3888Debug.Assert(_ps.encoding != null); 3912Debug.Assert(_ps.chars != null); 4094Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 4114Debug.Assert(_index == 0); 4137Debug.Assert(_ps.chars != null); 4311Debug.Assert(_ps.chars != null); 4377Debug.Assert(_namespaceManager != null); 4469Debug.Assert(_curNode.type == XmlNodeType.Element); 4470Debug.Assert(_dtdInfo != null); 4562Debug.Assert(_ps.chars != null); 4642Debug.Fail("We should never get to this point."); 4651Debug.Assert(_index > 0); 4656Debug.Assert(_curNode == startTagNode); 4673Debug.Assert(_ps.chars != null); 4683Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4692Debug.Assert(_ps.chars != null); 4696Debug.Assert(_attrCount == 0); 4745Debug.Assert(_curNode.type == XmlNodeType.Element); 4753Debug.Assert(_curNode.type == XmlNodeType.Element); 4857Debug.Assert(attrNameLineNo == _ps.LineNo); 4904Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 4979Debug.Assert(_curNode.type == XmlNodeType.Element); 5106Debug.Assert(_ps.chars != null); 5113Debug.Assert(_stringBuilder.Length == 0); 5268Debug.Assert(_ps.entity != null); 5322Debug.Fail("We should never get to this point."); 5325Debug.Assert(_ps.isEof); 5343Debug.Fail("no EndEntity reporting while parsing attributes"); 5383Debug.Assert(attr.nextAttrValueChunk == null); 5412Debug.Assert(_stringBuilder.Length == 0); 5428Debug.Assert(endPos - startPos > 0); 5429Debug.Assert(_ps.chars != null); 5452Debug.Assert(_stringBuilder.Length > 0); 5473Debug.Assert(endPos - startPos > 0); 5474Debug.Assert(_ps.chars != null); 5549Debug.Assert(_ps.chars != null); 5739Debug.Assert(_ps.isEof); 5781Debug.Assert(_stringBuilder.Length == 0); 5782Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 5796Debug.Assert(_stringBuilder.Length > 0); 5850Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 5860Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 5865Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5877Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 5882Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5910Debug.Assert(_stringBuilder.Length == 0); 5914Debug.Assert(_ps.chars != null); 5952Debug.Assert(_ps.chars != null); 5953Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5962Debug.Assert(_ps.chars != null); 5963Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5978Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 6056Debug.Assert(entity != null); 6132Debug.Fail($"Unexpected parsing states stack top {_parsingStatesStackTop}"); 6173Debug.Assert(_lastEntity != null); 6179Debug.Assert(_curNode.depth == _index); 6192Debug.Assert(_curNode.type == XmlNodeType.EntityReference); 6193Debug.Assert(_lastEntity != null); 6194Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName)); 6213Debug.Assert(_stringBuilder.Length == 0); 6217Debug.Assert(_ps.chars != null); 6240Debug.Assert(_ps.charPos < _ps.charsUsed); 6284Debug.Assert(_stringBuilder.Length == 0); 6318Debug.Assert(_ps.chars != null); 6340Debug.Assert(!_ps.eolNormalized); 6487Debug.Assert(_stringBuilder.Length == 0); 6490Debug.Assert(_ps.chars != null); 6523Debug.Assert(_ps.chars != null); 6547Debug.Assert(!_ps.eolNormalized); 6696Debug.Assert(_ps.chars != null); 6729Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 6761Debug.Assert(_ps.chars != null); 6858Debug.Assert(_ps.chars != null); 6877Debug.Assert(_ps.chars != null); 7055Debug.Fail("We should never get to this point."); 7058Debug.Assert(_ps.isEof); 7074Debug.Assert(_ps.chars != null); 7156Debug.Fail("We should never get to this point."); 7159Debug.Assert(_ps.isEof); 7168Debug.Assert(_ps.chars != null); 7169Debug.Assert(_ps.chars[startPos] == '&'); 7202Debug.Assert(_ps.chars != null); 7203Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7223Debug.Assert(_ps.chars != null); 7224Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7279Debug.Assert(badDigitExceptionString != null); 7331Debug.Assert(pos > 0); 7365Debug.Assert(_ps.chars != null); 7366Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7386Debug.Assert(startPos < _ps.charsUsed); 7387Debug.Assert(_ps.chars != null); 7388Debug.Assert(_ps.chars[startPos] == '&'); 7389Debug.Assert(_ps.chars[startPos + 1] != '#'); 7497Debug.Assert(pos > 0); 7522Debug.Assert(_ps.chars != null); 7585Debug.Assert(_ps.chars != null); 7618Debug.Assert(_ps.chars != null); 7633Debug.Assert(nodeIndex < _nodes.Length); 7634Debug.Assert(_nodes[_nodes.Length - 1] == null); 7647Debug.Assert(nodeIndex < _nodes.Length); 7654Debug.Assert(nodeIndex < _nodes.Length); 7671Debug.Assert(_ps.chars != null); 7724Debug.Assert(attr.type == XmlNodeType.Attribute); 7740Debug.Assert(_namespaceManager != null); 7759Debug.Assert(_ps.isEof); 7772Debug.Assert(_namespaceManager != null); 7810Debug.Assert(_namespaceManager != null); 7823Debug.Assert(_xmlContext.defaultNamespace == uri); 7860Debug.Assert(_curNode.xmlContextPushed); 7902Debug.Assert(_xmlResolver != null); 7960Debug.Assert(_xmlResolver != null); 7977Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 7997Debug.Assert(entity.IsExternal); 8001Debug.Assert(_xmlResolver != null); 8012Debug.Assert(_ps.appendMode); 8043Debug.Assert(!entity.IsExternal); 8109Debug.Assert(_parsingStatesStackTop == -1); 8125Debug.Assert(_parsingStatesStackTop >= 0); 8126Debug.Assert(_parsingStatesStack != null); 8173Debug.Assert(_incReadDecoder != null); 8183Debug.Assert(_incReadDecoder != null); 8184Debug.Assert(_ps.chars != null); 8233Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8241Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8249Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8271Debug.Fail($"Unexpected read state {_incReadState}"); 8274Debug.Assert(_incReadState == IncrementalReadState.Text || 8383Debug.Assert(_ps.charPos - pos == 0); 8384Debug.Assert(_ps.charPos - startPos == 0); 8423Debug.Assert(_ps.charPos - pos == 0); 8424Debug.Assert(_ps.charPos - startPos == 0); 8521Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full."); 8538Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!"); 8544Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8561Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8574Debug.Assert(_ps.chars != null); 8589Debug.Assert(_stringBuilder.Length == 0); 8600Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!"); 8655Debug.Fail("We should never get to this point."); 8713Debug.Fail("We should never get to this point."); 8793Debug.Assert(_ps.chars != null); 8806Debug.Assert(_ps.charPos < _ps.charsUsed); 8871Debug.Assert(_ps.chars != null); 8884Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 8900Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 8927Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 8928Debug.Assert(_curNode.type == XmlNodeType.Element); 9011Debug.Assert(context != null); 9032Debug.Assert(nt != null); 9033Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor."); 9049Debug.Assert(!_nameTableFromSettings); 9074Debug.Assert(_dtdInfo == null); 9132Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!"); 9234Debug.Assert(attr != null); 9255Debug.Assert(_namespaceManager != null); 9258Debug.Assert(prefix != null); 9276Debug.Assert(attr != null); 9308Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9326Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9327Debug.Assert(_namespaceManager != null); 9361Debug.Assert(_incReadDecoder != null); 9395Debug.Assert(_ps.chars != null); 9474Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9530Debug.Assert(characters >= 0); 9572Debug.Assert(startPos >= 0); 9573Debug.Assert(endPos < chars.Length); 9574Debug.Assert(startPos <= endPos); 9581Debug.Assert(startPos >= 0); 9582Debug.Assert(endPos < str.Length); 9583Debug.Assert(startPos <= endPos);
System\Xml\Core\XmlTextReaderImplAsync.cs (85)
69Debug.Fail("Invalid InitInputType"); 94Debug.Assert(_reportedBaseUri != null); 125Debug.Assert(_reportedBaseUri != null); 175Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 178Debug.Assert(!_ps.appendMode); 198Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 203Debug.Assert(_curNode.type == XmlNodeType.Element); 264Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 323Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 356Debug.Assert(_curNode.type == XmlNodeType.EndElement); 357Debug.Assert(_parsingFunction != ParsingFunction.Eof); 762Debug.Assert(_parsingMode == ParsingMode.Full); 828Debug.Assert(_parsingStatesStackTop == -1); 829Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0)); 846Debug.Assert(_ps.appendMode); 862Debug.Assert(baseUri != null); 868Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null); 869Debug.Assert(baseUriStr != null); 870Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr))); 944Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null); 945Debug.Assert(baseUriStr != null); 977Debug.Assert(context != null && context.HasDtdInfo); 991Debug.Fail("Unhandled DtdProcessing enumeration value."); 1003Debug.Assert(_ps.stream != null); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length); 1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1399Debug.Assert(!isTextDecl); 1410Debug.Fail($"Unexpected xmlDeclState {xmlDeclState}"); 1597Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 1712Debug.Assert(_index == 0); 2249Debug.Fail("We should never get to this point."); 2252Debug.Assert(_index > 0); 2257Debug.Assert(_curNode == startTagNode); 2299Debug.Assert(startTag.type == XmlNodeType.EntityReference); 2311Debug.Assert(_attrCount == 0); 2361Debug.Assert(_curNode.type == XmlNodeType.Element); 2369Debug.Assert(_curNode.type == XmlNodeType.Element); 2483Debug.Assert(attrNameLineNo == _ps.LineNo); 2530Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!"); 2613Debug.Assert(_stringBuilder.Length == 0); 2827Debug.Fail("We should never get to this point."); 2830Debug.Assert(_ps.isEof); 2849Debug.Fail("no EndEntity reporting while parsing attributes"); 2899Debug.Assert(_stringBuilder.Length == 0); 2929Debug.Assert(endPos - startPos > 0); 2967Debug.Assert(_stringBuilder.Length == 0); 2988Debug.Assert(endPos - startPos > 0); 3018Debug.Assert(_stringBuilder.Length > 0); 3039Debug.Assert(endPos - startPos > 0); 3475Debug.Assert(_ps.isEof); 3529Debug.Assert(_stringBuilder.Length == 0); 3530Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 3555Debug.Assert(_stringBuilder.Length > 0); 3609Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 3625Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 3630Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3644Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 3649Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 3677Debug.Assert(_stringBuilder.Length == 0); 3718Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3729Debug.Assert(_ps.chars[_ps.charPos] == '&'); 3749Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 3908Debug.Assert(_stringBuilder.Length == 0); 3934Debug.Assert(_ps.charPos < _ps.charsUsed); 3988Debug.Assert(_stringBuilder.Length == 0); 4053Debug.Assert(!_ps.eolNormalized); 4202Debug.Assert(_stringBuilder.Length == 0); 4279Debug.Assert(!_ps.eolNormalized); 4460Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 4788Debug.Fail("We should never get to this point."); 4791Debug.Assert(_ps.isEof); 4888Debug.Fail("We should never get to this point."); 4891Debug.Assert(_ps.isEof); 4920Debug.Assert(_ps.chars[_ps.charPos] == '&'); 4954Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5161Debug.Assert(_xmlResolver != null); 5178Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver"); 5197Debug.Assert(entity.IsExternal); 5211Debug.Assert(_ps.appendMode); 5255Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 5270Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 5296Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 5297Debug.Assert(_curNode.type == XmlNodeType.Element); 5359Debug.Assert(_incReadDecoder != null); 5473Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
System\Xml\Core\XmlTextReaderImplHelpers.cs (24)
285Debug.Assert(internalDtd != null); 418Debug.Assert(type == XmlNodeType.Element); 431Debug.Assert(type == XmlNodeType.Attribute); 448Debug.Assert(_valueStartPos >= 0 || _value != null, "Value not ready."); 452Debug.Assert(_chars != null); 463Debug.Assert(_chars != null); 468Debug.Assert(_value != null); 512Debug.Assert(value != null); 538Debug.Assert(localName != null); 539Debug.Assert(localName.Length > 0); 568Debug.Assert(_valueStartPos != -1); 569Debug.Assert(_chars != null); 579Debug.Assert(_valueStartPos != -1); 580Debug.Assert(_chars != null); 600Debug.Assert(_valueStartPos != -1); 601Debug.Assert(_chars != null); 626Debug.Assert(_valueStartPos != -1); 627Debug.Assert(_chars != null); 644Debug.Assert(_chars != null); 649Debug.Assert(_value != null); 669Debug.Assert(nameWPrefix == null); 704Debug.Fail("We should never get to this point."); 750Debug.Assert(x == null || x is NodeData || x is IDtdDefaultAttributeInfo); 751Debug.Assert(y == null || y is NodeData || y is IDtdDefaultAttributeInfo);
System\Xml\Core\XmlTextWriter.cs (10)
1008Debug.Fail($"Unexpected state {_currentState}"); 1471Debug.Assert(declared, "Unexpected situation!!"); 1481Debug.Fail("Should have never come here"); 1549Debug.Assert(_useNsHashtable); 1550Debug.Assert(_nsHashtable != null); 1565Debug.Assert(_useNsHashtable); 1566Debug.Assert(_nsHashtable != null); 1570Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 1607Debug.Assert(_nsHashtable != null); 1632Debug.Assert(_nsHashtable != null);
System\Xml\Core\XmlUtf8RawTextWriter.cs (40)
99Debug.Assert(stream != null && settings != null); 199Debug.Assert(name != null && name.Length > 0); 238Debug.Assert(localName != null && localName.Length > 0); 239Debug.Assert(prefix != null); 268Debug.Assert(localName != null && localName.Length > 0); 269Debug.Assert(prefix != null); 298Debug.Assert(localName != null && localName.Length > 0); 299Debug.Assert(prefix != null); 316Debug.Assert(localName != null && localName.Length > 0); 317Debug.Assert(prefix != null); 347Debug.Assert(prefix != null && namespaceName != null); 364Debug.Assert(prefix != null); 398Debug.Assert(text != null); 403Debug.Assert(_bufPos >= 4); 433Debug.Assert(text != null); 450Debug.Assert(name != null && name.Length > 0); 451Debug.Assert(text != null); 470Debug.Assert(name != null && name.Length > 0); 513Debug.Assert(ws != null); 533Debug.Assert(text != null); 567Debug.Assert(buffer != null); 568Debug.Assert(index >= 0); 569Debug.Assert(count >= 0 && index + count <= buffer.Length); 589Debug.Assert(buffer != null); 590Debug.Assert(index >= 0); 591Debug.Assert(count >= 0 && index + count <= buffer.Length); 605Debug.Assert(data != null); 672Debug.Assert(_stream != null); 731Debug.Assert(pSrc <= pSrcEnd); 853Debug.Assert(pSrc <= pSrcEnd); 953Debug.Assert(s != null); 983Debug.Assert(pSrc <= pSrcEnd); 1047Debug.Assert(pSrc <= pSrcEnd); 1166Debug.Assert(pSrc <= pSrcEnd); 1316Debug.Assert(pSrc <= pSrcEnd); 1430Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1463Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1464Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1519Debug.Assert(ch >= 0x80 && !XmlCharType.IsSurrogate(ch)); 1820Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlUtf8RawTextWriterAsync.cs (40)
113Debug.Assert(name != null && name.Length > 0); 153Debug.Assert(localName != null && localName.Length > 0); 154Debug.Assert(prefix != null); 179Debug.Assert(localName != null && localName.Length > 0); 180Debug.Assert(prefix != null); 212Debug.Assert(localName != null && localName.Length > 0); 213Debug.Assert(prefix != null); 232Debug.Assert(localName != null && localName.Length > 0); 233Debug.Assert(prefix != null); 273Debug.Assert(prefix != null && namespaceName != null); 283Debug.Assert(prefix != null); 322Debug.Assert(text != null); 327Debug.Assert(_bufPos >= 4); 358Debug.Assert(text != null); 376Debug.Assert(name != null && name.Length > 0); 377Debug.Assert(text != null); 397Debug.Assert(name != null && name.Length > 0); 442Debug.Assert(ws != null); 459Debug.Assert(text != null); 492Debug.Assert(buffer != null); 493Debug.Assert(index >= 0); 494Debug.Assert(count >= 0 && index + count <= buffer.Length); 512Debug.Assert(buffer != null); 513Debug.Assert(index >= 0); 514Debug.Assert(count >= 0 && index + count <= buffer.Length); 526Debug.Assert(data != null); 558Debug.Assert(_stream != null); 618Debug.Assert(pSrc <= pSrcEnd); 822Debug.Assert(pSrc <= pSrcEnd); 1061Debug.Assert(pSrc <= pSrcEnd); 1127Debug.Assert(text1 != null); 1128Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1129Debug.Assert(text3 != null || (text4 == null)); 1185Debug.Assert(text1 != null); 1186Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1187Debug.Assert(text3 != null || (text4 == null)); 1236Debug.Assert(pSrc <= pSrcEnd); 1437Debug.Assert(pSrc <= pSrcEnd); 1626Debug.Assert(pSrc <= pSrcEnd); 1787Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlValidatingReaderImpl.cs (5)
580Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 746Debug.Assert(value is XmlValidatingReader); 1013Debug.Assert(_parserContext != null); 1014Debug.Assert(_coreReaderImpl.DtdInfo == null); 1052Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlValidatingReaderImplAsync.cs (4)
68Debug.Fail($"Unexpected parsing function {_parsingFunction}"); 175Debug.Assert(_parserContext != null); 176Debug.Assert(_coreReaderImpl.DtdInfo == null); 193Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlWellFormedWriter.cs (25)
240Debug.Assert(writer != null); 241Debug.Assert(settings != null); 242Debug.Assert(MaxNamespacesWalkCount <= 3); 295Debug.Fail("Expected currentState <= State.Error "); 453Debug.Assert(prefix.Length == 0); 481Debug.Assert(_attrHashTable != null); 740Debug.Assert(_attrValueCache != null); 782Debug.Assert(_curDeclPrefix != null); 1259Debug.Assert(i >= 0); 1270Debug.Assert(i >= 0); 1534Debug.Fail("State.Attribute == currentState || State.RootLevelAttr == currentState"); 1578Debug.Assert(_stateTable == s_stateTableAuto); 1622Debug.Assert(prefix == "xmlns"); 1776Debug.Assert(_nsHashtable != null); 1792Debug.Assert(_nsHashtable != null); 1814Debug.Assert(_useNsHashtable); 1815Debug.Assert(_nsHashtable != null); 1816Debug.Assert(indexFrom <= indexTo); 1819Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 1948Debug.Fail("We should not get to this point."); 1975Debug.Fail($"We should never get to this point. State = {state}"); 2028Debug.Assert(ncname != null && ncname.Length > 0); 2120Debug.Assert(_attrHashTable.Count == 0); 2145Debug.Assert(_attrHashTable != null); 2163Debug.Assert(prev >= 0 && _attrStack[prev].localName == localName);
System\Xml\Core\XmlWellFormedWriterAsync.cs (4)
229Debug.Assert(prefix.Length == 0); 645Debug.Assert(_attrValueCache != null); 690Debug.Assert(_curDeclPrefix != null); 1368Debug.Fail("We should not get to this point.");
System\Xml\Core\XmlWellFormedWriterHelpers.cs (4)
96Debug.Assert(kind == NamespaceKind.NeedToWrite); 388Debug.Fail("Unexpected ItemType value."); 505Debug.Assert(_singleStringValue != null); 506Debug.Assert(_lastItem == -1);
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (2)
31Debug.Assert(kind == NamespaceKind.NeedToWrite); 99Debug.Fail("Unexpected ItemType value.");
System\Xml\Core\XmlWrappingReader.cs (1)
25Debug.Assert(baseReader != null);
System\Xml\Core\XmlWrappingWriter.cs (1)
23Debug.Assert(baseWriter != null);
System\Xml\Core\XmlWriter.cs (1)
488Debug.Fail($"Unexpected node type {nodeType}");
System\Xml\Core\XmlWriterAsync.cs (1)
488Debug.Fail($"Unexpected node type {nodeType}");
System\Xml\Core\XmlWriterSettings.cs (5)
367Debug.Assert(Encoding.UTF8.WebName == "utf-8"); 386Debug.Fail("Invalid XmlOutputMethod setting."); 408Debug.Fail("Invalid XmlOutputMethod setting."); 457Debug.Fail("Invalid XmlOutputMethod setting."); 603Debug.Assert(Encoding.Equals(Encoding.GetEncoding(Encoding.CodePage)), "Cannot serialize encoding correctly");
System\Xml\Core\XsdCachingReader.cs (8)
483Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 488Debug.Assert(endElementNode.NodeType == XmlNodeType.EndElement); 496Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement || (_coreReader.NodeType == XmlNodeType.Element && _coreReader.IsEmptyElement)); 561Debug.Assert(_cacheState == CachingReaderState.Replay); 591Debug.Assert(_cacheState == CachingReaderState.Replay); 653Debug.Assert(attIndex < _attributeEvents.Length); 671Debug.Assert(_contentIndex <= _contentEvents.Length); 692Debug.Assert(_coreReader.NodeType == XmlNodeType.Element);
System\Xml\Core\XsdCachingReaderAsync.cs (1)
127Debug.Assert(_cacheState == CachingReaderState.Replay);
System\Xml\Core\XsdValidatingReader.cs (50)
219Debug.Assert(_cachedNode != null); 243Debug.Assert(_cachedNode != null); 264Debug.Assert(_cachedNode != null); 279Debug.Assert(_cachedNode != null); 294Debug.Assert(_cachedNode != null); 323Debug.Assert(_cachedNode != null); 338Debug.Assert(_cachedNode != null); 425Debug.Assert(_xmlSchemaInfo.SchemaType!.Datatype != null); 434Debug.Assert(AttributeSchemaInfo.SchemaType!.Datatype != null); 1177Debug.Assert(attNode != null); 1208Debug.Assert(_readBinaryHelper != null); 1235Debug.Assert(_attributePSVI != null); 1263Debug.Assert(_readBinaryHelper != null); 1304Debug.Assert(_readBinaryHelper != null); 1342Debug.Assert(_readBinaryHelper != null); 1356Debug.Assert(moveTo); 1384Debug.Assert(_readBinaryHelper != null); 1456Debug.Assert(_readBinaryHelper != null); 1570Debug.Assert(_readBinaryHelper != null); 1579Debug.Assert(_cachedNode != null); 1617Debug.Assert(_readBinaryHelper != null); 1644Debug.Assert(_readBinaryHelper != null); 1671Debug.Assert(_readBinaryHelper != null); 1698Debug.Assert(_readBinaryHelper != null); 1927Debug.Assert(_nsManager != null); 1940Debug.Assert(_nsManager != null); 1953Debug.Assert(_nsManager != null); 1990Debug.Assert(_attributePSVI != null); 2072Debug.Assert(_nsManager != null); 2111Debug.Assert(_nsManager != null); 2137Debug.Assert(_atomicValue != null); 2140Debug.Assert(_cachingReader != null); 2148Debug.Assert(_nsManager != null); 2236Debug.Assert(_coreReaderNameTable.Get(localName) != null); 2237Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2281Debug.Assert(_coreReaderNameTable.Get(attrLocalName) != null); 2282Debug.Assert(_coreReaderNameTable.Get(ns) != null); 2304Debug.Assert(attIndex < _attributePSVINodes.Length); 2330Debug.Assert(_inlineSchemaParser != null); 2440Debug.Assert(this.NodeType == XmlNodeType.Element); 2552Debug.Assert(_nsManager != null); 2587Debug.Assert(_coreReader.NodeType == XmlNodeType.EndElement); 2598Debug.Fail("Should not happen as the caching reader does not cache elements in simple content"); 2626Debug.Assert(_cachingReader != null); 2646Debug.Assert(_cachingReader != null); 2659Debug.Fail("Should not happen as the caching reader does not cache elements in simple content"); 2709Debug.Assert(_cachingReader != null); 2723Debug.Assert(xmlType != null && xmlType.Datatype != null); 2727Debug.Assert(listType != null); 2740Debug.Assert(NodeType != XmlNodeType.Attribute);
System\Xml\Core\XsdValidatingReaderAsync.cs (20)
24Debug.Assert(_cachedNode != null); 156Debug.Fail($"{nameof(typedValue)} should never be null"); 321Debug.Assert(_readBinaryHelper != null); 400Debug.Assert(_readBinaryHelper != null); 427Debug.Assert(_readBinaryHelper != null); 454Debug.Assert(_readBinaryHelper != null); 481Debug.Assert(_readBinaryHelper != null); 571Debug.Assert(_nsManager != null); 609Debug.Assert(_nsManager != null); 635Debug.Assert(_atomicValue != null); 638Debug.Assert(_cachingReader != null); 646Debug.Assert(_nsManager != null); 653Debug.Assert(_inlineSchemaParser != null); 716Debug.Assert(_originalAtomicValueString != null); 735Debug.Assert(value != null); 737Debug.Assert(_originalAtomicValueString != null); 776Debug.Assert(this.NodeType == XmlNodeType.Element); 790Debug.Assert(_originalAtomicValueString != null); 816Debug.Assert(_originalAtomicValueString != null); 890Debug.Assert(_nsManager != null);
System\Xml\Dom\DocumentSchemaValidator.cs (15)
67Debug.Assert(schemas != null && schemas.Count > 0); 89Debug.Assert(nodeToValidate.SchemaInfo != null); 115Debug.Assert(schemaElement.ElementSchemaType == schemaInfo.SchemaType); 324Debug.Assert(elementNode != null); 338Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 339Debug.Assert(_nameTable.Get(attr.LocalName) != null); 435Debug.Assert(_attributeSchemaInfo != null); 447Debug.Assert(simpleValue != null); 485Debug.Assert(elementToValidate.ParentNode!.NodeType != XmlNodeType.Document); //Handle if it is the documentElement separately 608Debug.Assert(_nodeSequenceToValidate![0] == elementToValidate.ParentNode); 673Debug.Assert(elementNode != null); 687Debug.Assert(_nameTable.Get(attr.NamespaceURI) != null); 688Debug.Assert(_nameTable.Get(attr.LocalName) != null); 757Debug.Assert(child == childToStopAt); 791Debug.Assert(ex != null);
System\Xml\Dom\DocumentXmlWriter.cs (3)
433Debug.Assert(elem != null); 438Debug.Assert(attr != null); 449Debug.Assert(attr != null);
System\Xml\Dom\DocumentXPathNavigator.cs (40)
179Debug.Assert(_source.Value != null); 220Debug.Assert(value != null); 519Debug.Fail($"Unexpected scope {scope}"); 527Debug.Assert(attributes != null); 547Debug.Assert(attributes != null && attributes.parent != null); 578Debug.Assert(_namespaceParent != null); 632Debug.Fail($"Unexpected scope {scope}"); 640Debug.Assert(attributes != null); 641Debug.Assert(0 <= index && index < attributes.Count); 661Debug.Assert(attributes != null && attributes.parent != null); 724Debug.Assert(parent != null); 760Debug.Assert(parent != null); 788Debug.Assert(sibling != null); 1271Debug.Assert(ownerDocument != null); 1307Debug.Assert(node1 != null); 1308Debug.Assert(node2 != null); 1309Debug.Assert(node1 != node2, "Should be handled by ComparePosition()"); 1311Debug.Assert(OwnerNode(node1) == OwnerNode(node2)); 1317Debug.Assert(element != null); 1393Debug.Assert(node1 != node2); 1412Debug.Assert(node2 != null); 1427Debug.Assert(node1 != null); 1436Debug.Assert(node1 != node2); 1456Debug.Assert(this.NodeType != XPathNodeType.Attribute && this.NodeType != XPathNodeType.Namespace && this.NodeType != XPathNodeType.All); 1791Debug.Assert(node != null, "This method needs to be called with the beforehand check of NextSibling being not null from node to end"); 1833Debug.Assert(node != null, "Undefined navigator position"); 1834Debug.Assert(node == _document || node.OwnerDocument == _document, "Navigator switched documents"); 2257Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2270Debug.Assert(node != null); 2311Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2312Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2326Debug.Assert(node != null); 2327Debug.Assert(node.NodeType == XmlNodeType.Element); 2369Debug.Assert(((XmlNode)nav.UnderlyingObject).NodeType != XmlNodeType.Attribute); 2370Debug.Assert(Ref.Equal(nav.NameTable.Get(localNameAtom), localNameAtom)); 2371Debug.Assert(Ref.Equal(nav.NameTable.Get(nsAtom), nsAtom)); 2372Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_NoLocalName class for special magic value of localNameAtom 2391Debug.Assert(node != null); 2392Debug.Assert(node.NodeType == XmlNodeType.Element); 2402Debug.Assert(localNameAtom.Length > 0); // Use DocumentXPathNodeIterator_ElemChildren_AndSelf_NoLocalName if localName == String.Empty
System\Xml\Dom\DomNameTable.cs (1)
26Debug.Assert((_entries.Length & _mask) == 0); // entries.Length must be a power of two
System\Xml\Dom\XmlAttribute.cs (3)
21Debug.Assert(name != null); 22Debug.Assert(doc != null); 54Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlAttributeCollection.cs (10)
194Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 223Debug.Assert(offset != -1); // the if statement above guarantees that the ref node is in the collection 303Debug.Assert(retNode is XmlAttribute); 319Debug.Assert(retNode is XmlAttribute); 386Debug.Assert(parentElem != null); 388Debug.Assert(doc != null); 403Debug.Assert(parentElem != null); 405Debug.Assert(doc != null); 418Debug.Assert(-1 == FindNodeOffset(node)); 421Debug.Assert(retNode is XmlAttribute);
System\Xml\Dom\XmlCDataSection.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlCharacterData.cs (1)
201Debug.Assert(XmlDocument.IsTextNode(n.NodeType) || (n.ParentNode != null && n.ParentNode.NodeType == XmlNodeType.EntityReference));
System\Xml\Dom\XmlComment.cs (1)
37Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDeclaration.cs (1)
160Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlDocument.cs (12)
216Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 217Debug.Assert(n.LocalName == localName); 218Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 225Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 226Debug.Assert(n == null || n.LocalName == localName); 227Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 234Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 235Debug.Assert(xmlName.LocalName == localName); 236Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 973Debug.Assert(((XmlAttribute)node).Specified); 1038Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1768Debug.Assert(doc == this);
System\Xml\Dom\XmlDocumentFragment.cs (3)
109Debug.Assert(OwnerDocument != null); 155Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call 171Debug.Assert(newChild != null); //should be checked that newChild is not null before this function call
System\Xml\Dom\XmlDocumentType.cs (2)
28Debug.Assert(doc != null); 59Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlElement.cs (5)
23Debug.Assert(name != null); 54Debug.Assert(OwnerDocument != null); 481Debug.Assert(n != null); 495Debug.Assert(n != null); 503Debug.Assert(n != null);
System\Xml\Dom\XmlElementList.cs (11)
29Debug.Assert(parent != null); 30Debug.Assert(parent.NodeType == XmlNodeType.Element || parent.NodeType == XmlNodeType.Document); 32Debug.Assert(parent.Document != null); 72Debug.Assert(parent.Document != null); 74Debug.Assert(nt != null); 83Debug.Assert(parent.Document != null); 85Debug.Assert(nt != null); 108Debug.Assert(curNode != null); 135Debug.Assert(curNode != null); 183Debug.Assert(n != null); 197Debug.Assert(n != null);
System\Xml\Dom\XmlEntityReference.cs (1)
84Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlLoader.cs (19)
57Debug.Assert(_reader != null); 58Debug.Assert(parentDoc != null); 86Debug.Assert(n != null); 149Debug.Assert(parent.NodeType == XmlNodeType.Element); 168Debug.Assert(parent == null); 223Debug.Assert(node != null); 249Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 290Debug.Assert(node != null); 299Debug.Assert(_reader!.IsDefault); 348Debug.Assert(node != null); 356Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference); 379Debug.Assert(_reader!.NodeType == XmlNodeType.XmlDeclaration); 402Debug.Fail("Unknown reader name"); 417Debug.Assert(_reader!.NodeType == XmlNodeType.DocumentType); 492Debug.Assert(parent!.NodeType == XmlNodeType.Element); 547Debug.Assert(node != null); 747Debug.Assert(parentNode.NodeType != XmlNodeType.Document); 749Debug.Assert(_doc != null); 942Debug.Assert(tr.EntityHandling == EntityHandling.ExpandCharEntities);
System\Xml\Dom\XmlName.cs (2)
89Debug.Assert(_prefix != null); 109Debug.Assert(Ref.Equal(_name, ownerDoc.NameTable.Get(_name)));
System\Xml\Dom\XmlNamedNodeMap.SmallXmlNodeList.cs (1)
60Debug.Fail("Null was added to the collection which didn't expect it");
System\Xml\Dom\XmlNode.cs (10)
44Debug.Assert(doc != null); 56Debug.Assert(nodeIterator.Current != null); 128Debug.Assert(parentNode != null); 187Debug.Assert(parentNode != null); 791Debug.Assert(firstNode.NodeType == XmlNodeType.Text 809Debug.Assert(true, "shouldn't have fall through here."); 1433Debug.Assert(prevNode.IsText); 1434Debug.Assert(nextNode.IsText); 1441Debug.Assert(prevNode.IsText); 1442Debug.Assert(nextNode.IsText);
System\Xml\Dom\XmlNodeReader.cs (11)
110Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 131Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 136Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 214Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 215Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 235Debug.Assert(nt == XmlNodeType.XmlDeclaration || nt == XmlNodeType.DocumentType); 236Debug.Assert(_nAttrInd >= 0 && _nAttrInd < AttributeCount); 608Debug.Assert(IsOnDeclOrDocType); 1053Debug.Assert(_curNode.NodeType == XmlNodeType.XmlDeclaration || _curNode.NodeType == XmlNodeType.DocumentType); 1082Debug.Assert(_curNode != null); 1627Debug.Assert(_curDepth == 0);
System\Xml\Dom\XmlProcessingInstruction.cs (1)
82Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlSignificantWhiteSpace.cs (1)
72Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlText.cs (1)
76Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XmlWhitespace.cs (1)
88Debug.Assert(OwnerDocument != null);
System\Xml\Dom\XPathNodeList.cs (1)
49Debug.Assert(_nodeIterator.Current != null);
System\Xml\Ref.cs (1)
17Debug.Fail("Ref.Equal: Object comparison used for non-atomized string '" + strA + "'");
System\Xml\Resolvers\XmlPreloadedResolver.cs (2)
214Debug.Assert(s_rss091_Dtd.Length == 1); 349Debug.Assert(uri != null);
System\Xml\Schema\BaseProcessor.cs (2)
25Debug.Assert(nameTable != null); 146Debug.Assert(item is XmlSchemaElement);
System\Xml\Schema\BaseValidator.cs (6)
49Debug.Assert(schemaCollection == null || schemaCollection.NameTable == reader.NameTable); 171Debug.Assert(context != null); 191Debug.Assert(names.Count > 0); 209Debug.Assert(context != null); 232Debug.Assert(textString != null); 239Debug.Assert(textValue != null);
System\Xml\Schema\BitSet.cs (1)
73Debug.Assert(startFrom >= -1 && startFrom <= _count);
System\Xml\Schema\Chameleonkey.cs (1)
66Debug.Assert((chameleonLocation.OriginalString.Length == 0 && originalSchema != null)
System\Xml\Schema\CompiledidEntityConstraint.cs (1)
61Debug.Assert(fields.Count > 0);
System\Xml\Schema\ConstraintStruct.cs (6)
211Debug.Assert(_dstruct != null); 219Debug.Assert(_dstruct != null); 363Debug.Assert(arr1 != null); 378Debug.Assert(arr2 != null); 398Debug.Assert(dim > 0); 506Debug.Fail($"{nameof(other)} is not of type {nameof(KeySequence)}");
System\Xml\Schema\ContentValidator.cs (17)
86Debug.Assert(_particles.Count == _last + 1); 123Debug.Assert(_particles.Count == _last + 1); 138Debug.Assert(name != null); 910Debug.Assert(parent is SequenceNode); 911Debug.Assert(this == parent.RightChild); 1234Debug.Assert(ContentType == XmlSchemaContentType.ElementOnly || ContentType == XmlSchemaContentType.Mixed); 1243Debug.Assert(!IsOpen); 1328Debug.Assert(lrNode != null); 1346Debug.Assert(lrNode1 != null); 1394Debug.Assert(lrNode != null); 1463Debug.Assert(state == stateTable[statePosSet]); // just make sure that statePosSet is for correct state 1852Debug.Assert(_minMaxNodesCount != 0); 1951Debug.Assert(_minMaxNodesCount > 0); 1973Debug.Assert(lrNode != null); 2046Debug.Assert(runningPositions[i].curpos != null); 2089Debug.Assert(runningPositions[i].curpos != null); 2149Debug.Assert(_elements.Count > 0);
System\Xml\Schema\DataTypeImplementation.cs (13)
172Debug.Assert(qname != null && dataType != null); 188Debug.Assert(derivedType != null && baseType != null); 363Debug.Assert(currentType != null); 538Debug.Assert(typedValue != null); 559Debug.Assert(typedValue != null); 953Debug.Assert(arr1 != null && arr2 != null); 964Debug.Assert(atomicValues2 != null); 1030Debug.Assert(valuesToCheck != null); 1111Debug.Assert(unionTypedValue != null); 1128Debug.Assert(_itemType.ListValueType.GetElementType() == _itemType.ValueType); 1259Debug.Assert(typedValue != null); 1315Debug.Assert(memberType != null); 2627Debug.Assert(uri != null);
System\Xml\Schema\DtdParser.cs (37)
208Debug.Assert((int)Token.CDATA == (int)XmlTokenizedType.CDATA && (int)XmlTokenizedType.CDATA == 0); 209Debug.Assert((int)Token.ID == (int)XmlTokenizedType.ID && (int)XmlTokenizedType.ID == 1); 210Debug.Assert((int)Token.IDREF == (int)XmlTokenizedType.IDREF && (int)XmlTokenizedType.IDREF == 2); 211Debug.Assert((int)Token.IDREFS == (int)XmlTokenizedType.IDREFS && (int)XmlTokenizedType.IDREFS == 3); 212Debug.Assert((int)Token.ENTITY == (int)XmlTokenizedType.ENTITY && (int)XmlTokenizedType.ENTITY == 4); 213Debug.Assert((int)Token.ENTITIES == (int)XmlTokenizedType.ENTITIES && (int)XmlTokenizedType.ENTITIES == 5); 214Debug.Assert((int)Token.NMTOKEN == (int)XmlTokenizedType.NMTOKEN && (int)XmlTokenizedType.NMTOKEN == 6); 215Debug.Assert((int)Token.NMTOKENS == (int)XmlTokenizedType.NMTOKENS && (int)XmlTokenizedType.NMTOKENS == 7); 216Debug.Assert((int)Token.NOTATION == (int)XmlTokenizedType.NOTATION && (int)XmlTokenizedType.NOTATION == 8); 235Debug.Assert(readerAdapter != null); 492Debug.Assert(ParsingInternalSubset); 498Debug.Assert(_externalEntitiesDepth == 0); 519Debug.Assert(_readerAdapter.EntityStackLength == 0 || 589Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 601Debug.Assert(_readerAdapter.EntityStackLength == 0 || 621Debug.Fail($"Unexpected token {token}"); 625Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1494Debug.Assert(idTokenType == Token.PUBLIC); 1656Debug.Fail($"Unexpected scanning function {_scanningFunction}"); 2393Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2609Debug.Assert(_curPos - _tokenStartPos == 0); 3109Debug.Assert(_chars[_curPos] == 'P'); 3128Debug.Assert(_chars[_curPos] == 'S'); 3150Debug.Assert(_curPos - _tokenStartPos > 0); 3172Debug.Assert(_curPos - _tokenStartPos > 0); 3195Debug.Assert(_curPos == 0 || _chars[_curPos - 1] == '"' || _chars[_curPos - 1] == '\''); 3228Debug.Assert(_internalSubsetValueSb != null); 3244Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 3252Debug.Assert(_chars[_curPos - 1] == ';'); 3317Debug.Assert(!ParsingInternalSubset || _freeFloatingDtd); 3318Debug.Assert(_currentEntityId == 0); 3342Debug.Assert(_chars[_curPos - 1] == ';'); 3398Debug.Assert(_validate); 3404Debug.Assert(_validate); 3410Debug.Assert(_validate); 3447Debug.Fail("This is an unexpected error that should have been handled in the ScanXXX methods."); 3528Debug.Assert(startPos < _charsUsed);
System\Xml\Schema\DtdParserAsync.cs (17)
136Debug.Assert(ParsingInternalSubset); 142Debug.Assert(_externalEntitiesDepth == 0); 163Debug.Assert(_readerAdapter.EntityStackLength == 0 || 233Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 245Debug.Assert(_readerAdapter.EntityStackLength == 0 || 265Debug.Fail($"Unexpected token {token}"); 269Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 993Debug.Assert(_internalSubsetValueSb != null); 1021Debug.Assert(_internalSubsetValueSb != null); 1119Debug.Assert(idTokenType == Token.PUBLIC); 1283Debug.Fail($"Unexpected scanning function {_scanningFunction}"); 1839Debug.Assert(_chars[_curPos] == '"' || _chars[_curPos] == '\''); 2055Debug.Assert(_curPos - _tokenStartPos == 0); 2522Debug.Assert(_chars[_curPos] == 'P'); 2541Debug.Assert(_chars[_curPos] == 'S'); 2574Debug.Assert(_chars[_curPos] == '&' || _chars[_curPos] == '%'); 2582Debug.Assert(_chars[_curPos - 1] == ';');
System\Xml\Schema\DtdValidator.cs (2)
46Debug.Assert(reader != null); 149Debug.Assert(reader.NodeType == XmlNodeType.Element);
System\Xml\Schema\FacetChecker.cs (6)
464Debug.Fail($"Unexpected facet type {facet.FacetType}"); 1017Debug.Assert(restriction != null); 1500Debug.Assert(restriction != null); 1629Debug.Assert(values != null); 1675Debug.Assert(list != null); 1683Debug.Assert(enumValue != null);
System\Xml\Schema\Inference\Infer.cs (10)
253Debug.Assert(_rootSchema != null, "rootSchema is null"); 278Debug.Assert(compiledAttributes != null); //AttributeUses is never null 483Debug.Assert(targetNS == null || targetNS.Length > 0, "targetns for schema is empty"); 1003Debug.Assert(elem.ElementDecl == null); 1202Debug.Assert(_xtr!.NodeType == XmlNodeType.Attribute); 1242Debug.Assert(ct != null); 1253Debug.Assert(ct != null); //either the user-defined type itself is a complex type or we switched from a simple type to a complex type 1257Debug.Assert(sce != null); 1733Debug.Fail("Expected type not matched"); 2379Debug.Fail("Expected date, time or dateTime");
System\Xml\Schema\NamespaceList.cs (7)
29Debug.Assert(targetNamespace != null); 69Debug.Assert(_set != null); 112Debug.Fail($"Unexpected type {_type}"); 157Debug.Fail($"Unexpected type {_type}"); 179Debug.Assert(super._type == ListType.Set); 197Debug.Assert(o1 != o2); 315Debug.Assert(o1 != o2); //clause 1
System\Xml\Schema\Parser.cs (8)
89Debug.Assert(_schemaType == SchemaType.XDR); 137Debug.Fail($"Unexpected root type {rootType}"); 241Debug.Assert(_parentNode != null); 324Debug.Assert(currentNode != null); 325Debug.Assert(_parentNode != null); 333Debug.Assert(_reader!.NodeType == XmlNodeType.Element); 418Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 444Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference);
System\Xml\Schema\ParserAsync.cs (1)
50Debug.Assert(_schemaType == SchemaType.XDR);
System\Xml\Schema\Preprocessor.cs (4)
304Debug.Assert(import != null); 704Debug.Fail($"Unexpected compositor {external.Compositor}"); 823Debug.Assert(_currentSchema != null); 977Debug.Assert((currentSchemaObject as XmlSchema) == null); // The current object should not be schema
System\Xml\Schema\SchemaCollectionCompiler.cs (9)
54Debug.Assert(!members.Contains(element)); 514Debug.Assert(group.CanonicalParticle != null); 1030Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1403Debug.Fail("Unexpected particle"); 1859Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2252Debug.Assert(xe.ElementSchemaType != null); 2486Debug.Assert(particle == XmlSchemaParticle.Empty); 2531Debug.Assert(!p.IsEmpty); 2550Debug.Fail("Unexpected particle");
System\Xml\Schema\SchemaInfo.cs (1)
282Debug.Fail($"Unexpected match state {attributeMatchState}");
System\Xml\Schema\SchemaSetCompiler.cs (12)
128Debug.Assert(_schemaForSchema != null); 499Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 596Debug.Assert(group.CanonicalParticle != null); 1646Debug.Fail("Unexpected particle"); 2224Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2711Debug.Assert(xe.ElementSchemaType != null); 2730Debug.Assert(decl != null); 2912Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 2931Debug.Fail("Unexpected particle"); 3086Debug.Assert(baseFixedValue != null); 3093Debug.Assert(derivedFixedValue != null); 3109Debug.Assert(simpleFixedValue != null);
System\Xml\Schema\XdrBuilder.cs (1)
622Debug.Assert(_GroupDef != null);
System\Xml\Schema\XmlAtomicValue.cs (9)
169Debug.Assert(qname != null); //string representation is handled in a different overload 231default: Debug.Fail("Should never get here"); break; 253default: Debug.Fail("Should never get here"); break; 276default: Debug.Fail("Should never get here"); break; 300default: Debug.Fail("Should never get here"); break; 323default: Debug.Fail("Should never get here"); break; 346default: Debug.Fail("Should never get here"); break; 370default: Debug.Fail("Should never get here"); break; 392default: Debug.Fail("Should never get here"); break;
System\Xml\Schema\XmlSchema.cs (2)
224Debug.Assert(_isPreprocessed); 521Debug.Assert(extList != null && schema != null);
System\Xml\Schema\XmlSchemaComplexType.cs (1)
318System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaComplexType. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaElement.cs (1)
273System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaElement. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaException.cs (1)
83Debug.Assert(message == null || !message.StartsWith("Sch_", StringComparison.Ordinal), "Do not pass a resource here!");
System\Xml\Schema\XmlSchemaGroup.cs (1)
74System.Diagnostics.Debug.Fail("Should never call Clone() on XmlSchemaGroup. Call Clone(XmlSchema) instead.");
System\Xml\Schema\XmlSchemaObject.cs (4)
61get { Debug.Fail("Should not use base property"); return null; } 62set { Debug.Fail("Should not use base property"); } 71get { Debug.Fail("Should not use base property"); return null; } 72set { Debug.Fail("Should not use base property"); }
System\Xml\Schema\XmlSchemaObjectTable.cs (11)
21Debug.Assert(!_table.ContainsKey(name), "XmlSchemaObjectTable.Add: entry already exists"); 32Debug.Assert(oldValue != null); 34Debug.Assert(matchedIndex >= 0); 36Debug.Assert(_entries[matchedIndex].qname == name); 51Debug.Assert(oldValue != null); 53Debug.Assert(_entries[matchedIndex].qname == name); 71Debug.Assert(matchedIndex >= 0); 72Debug.Assert(_entries[matchedIndex].qname == name); 94Debug.Assert(_table.Count == _entries.Count); 195Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection"); 248Debug.Assert(array.Length >= _size, "array is not big enough to hold all the items in the ICollection");
System\Xml\Schema\XmlSchemaSet.cs (2)
857Debug.Assert(ns != null); 868Debug.Assert(schema.BaseUri!.Equals(schemaUri));
System\Xml\Schema\XmlSchemaSimpleType.cs (1)
15Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
System\Xml\Schema\XmlSchemaValidator.cs (40)
333Debug.Assert(_validatedNamespaces != null); 586Debug.Assert(_currentState == ValidatorState.TopLevelAttribute); //Re-set state back to start on error with partial validation type 596Debug.Assert(currentElementDecl != null); 598Debug.Assert(ct != null); 615Debug.Assert(attributeDef != null); 636Debug.Assert(simpleValue != null); 780Debug.Assert(names.Count > 0); 908Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 1057Debug.Assert(attSchemaInfo != null); 1280Debug.Assert(typedValue != null); 1427Debug.Assert(currentElementDecl.Datatype != null); 1488Debug.Assert(simpleValue != null); 1502Debug.Assert(decl != null && decl.SchemaType != null); 1552Debug.Assert(_validationStack.Length > 1); 1633Debug.Assert(_partialValidationType is XmlSchemaAttribute); 1671Debug.Assert(elementDecl.DefaultValueTyped != null); 1823Debug.Assert(elementDecl.ContentValidator!.ContentType == XmlSchemaContentType.Mixed && elementDecl.DefaultValueTyped != null); 1836Debug.Assert(decl != null); 1847Debug.Assert(_xmlResolver != null); 1939Debug.Assert(dtype != null); 1955Debug.Assert(typedValue != null); 1978Debug.Assert(dtype != null); 1987Debug.Assert(typedValue != null); 2100Debug.Assert(currentElementDecl != null); 2242Debug.WriteLine("Selector Match!"); 2243Debug.WriteLine($"Name: {localName}\t|\tURI: {namespaceUri}\n"); 2257Debug.WriteLine("Element Field Match!"); 2301Debug.WriteLine("Attribute Field Match!"); 2304Debug.WriteLine("Attribute Field Filling Value!"); 2305Debug.WriteLine($"Name: {name}\t|\tURI: {ns}\t|\tValue: {obj}\n"); 2314Debug.Assert(datatype != null); 2349Debug.WriteLine("Element Field Filling Value!"); 2350Debug.WriteLine($"Name: {localName}\t|\tURI: {namespaceUri}\t|\tValue: {typedValue}\n"); 2521Debug.Assert(contentValidator is DfaContentValidator || contentValidator is NfaContentValidator || contentValidator is RangeContentValidator || contentValidator is AllElementsContentValidator); 2545Debug.Assert(names.Count > 0); 2578Debug.Assert(schemaSet != null); 2597Debug.Assert(names.Count > 0); 2636Debug.Assert(builder.Length != 0); 2647Debug.Assert(nextParticle != null); 2747Debug.Assert(nsList.Length > 0);
System\Xml\Schema\XmlValueConverter.cs (9)
235Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null"); 242Debug.Assert(schemaType.Datatype!.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself"); 270Debug.Fail($"Type code {typeCode} is not supported."); 282Debug.Assert(_clrTypeDefault!.IsArray); 435Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType"); 2919Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null, 3051Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3079Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable"); 3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Schema\XsdBuilder.cs (7)
705Debug.Assert(_currentEntry.InitFunc != null); 708Debug.Assert(_xso != null); 967Debug.Fail($"State is {state}"); 1092Debug.Fail($"State is {state}"); 1333Debug.Fail($"Unexpected parent element {builder.ParentElement}"); 2376Debug.Fail($"Unexpected parent element {this.ParentElement}"); 2425Debug.Fail($"Unexpected parent element {this.ParentElement}");
System\Xml\Schema\XsdDateTime.cs (7)
152Debug.Assert(parser.minute == 0, "minute must be zero when hour is 24"); 153Debug.Assert(parser.second == 0, "second must be zero when hour is 24"); 154Debug.Assert(parser.fraction == 0, "fraction must be zero when hour is 24"); 198Debug.Assert(BitOperations.IsPow2((uint)kinds), "One and only one DateTime type code can be set."); 213Debug.Assert(dateTime.Kind == DateTimeKind.Local, $"Unknown DateTimeKind: {dateTime.Kind}"); 242Debug.Assert(BitOperations.IsPow2((uint)kinds), "Only one DateTime type code can be set."); 531Debug.Assert(success);
System\Xml\Schema\XsdDuration.cs (3)
117Debug.Assert(durationType == DurationType.Duration || durationType == DurationType.DayTimeDuration); 347Debug.Assert(success); 426Debug.Assert(successCopy);
System\Xml\Schema\XsdValidator.cs (9)
494Debug.Assert(attnDef.SchemaType != null); 926Debug.WriteLine("Selector Match!"); 927Debug.WriteLine($"Name: {reader.LocalName}\t|\tURI: {reader.NamespaceURI}\n"); 940Debug.WriteLine("Element Field Match!"); 985Debug.WriteLine("Attribute Field Match!"); 988Debug.WriteLine("Attribute Field Filling Value!"); 989Debug.WriteLine($"Name: {name}\t|\tURI: {ns}\t|\tValue: {obj}\n"); 1040Debug.WriteLine("Element Field Filling Value!"); 1041Debug.WriteLine($"Name: {reader.LocalName}\t|\tURI: {reader.NamespaceURI}\t|\tValue: {reader.TypedValueObject}\n");
System\Xml\Serialization\CodeGenerator.cs (36)
46System.Diagnostics.Debug.Assert(typeBuilder != null); 60Debug.Assert(iType.IsInterface); 66Debug.Fail("Interface not found"); 131System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 137System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 176System.Diagnostics.Debug.Fail("Variable not found"); 212Debug.Assert(_currentScope!.parent != null); 221Debug.Assert(_freeLocals != null); 243Debug.Assert(!_currentScope!.ContainsKey(name)); 259Debug.Assert(local.LocalType == type); 281Debug.Assert(forState != null); 308Debug.Assert(ICollection_get_Count.IsVirtual && !ICollection_get_Count.DeclaringType!.IsValueType); 402Debug.Assert(methodInfo != null); 411Debug.Assert(ctor != null); 417Debug.Assert(constructorInfo != null); 552System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 559System.Diagnostics.Debug.Assert(getMethod != null); 585System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 592System.Diagnostics.Debug.Assert(getMethod != null); 620System.Diagnostics.Debug.Assert(memberInfo is PropertyInfo); 626System.Diagnostics.Debug.Assert(setMethod != null); 788Debug.Fail("Char is not a valid schema primitive and should be treated as int in DataContract"); 958Debug.Assert(_currentScope!.ContainsKey(name)); 970Debug.Assert(local.LocalType == type); 981Debug.Assert(_currentScope!.ContainsKey(name)); 983Debug.Assert(local.LocalType == type); 1067Debug.Assert(!opCode.Equals(OpCodes.Nop)); 1274Debug.Assert(ifState != null); 1310Debug.Assert(_initElseIfStack == -1); 1320Debug.Assert(_initIfStack == -1); 1340Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1361Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1645Debug.Assert(this.MethodBuilder.ReturnType == returnType); 1646Debug.Assert(this.MethodBuilder.Attributes == attributes); 1647Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1650Debug.Assert(this.ParameterTypes[i] == parameterTypes[i]);
System\Xml\Serialization\CodeIdentifier.cs (1)
175Debug.Assert(ident != null);
System\Xml\Serialization\Compilation.cs (1)
483Debug.Assert(collectibleAssembly != null);
System\Xml\Serialization\Compiler.cs (1)
75Debug.Assert(originalAssemblyInfo != null);
System\Xml\Serialization\Globals.cs (1)
16System.Diagnostics.Debug.Fail(msg);
System\Xml\Serialization\Mappings.cs (4)
768Debug.Assert(a1 != null); 769Debug.Assert(a2 != null); 881Debug.Assert(m1 != null); 882Debug.Assert(m2 != null);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (6)
610Debug.Assert(o != null, "Object o should not be null"); 611Debug.Assert(!string.IsNullOrEmpty(memberName), "memberName must have a value"); 622Debug.Assert(memberInfo != null, "memberInfo could not be retrieved"); 1356Debug.Assert(!mapping.IsSoap, "mapping.IsSoap was true. Use WriteEnumMethodSoap for reading SOAP encoded enum value."); 2064Debug.Assert(xmlnsMember.XmlnsSource != null, "Xmlns member's source was not set."); 2256Debug.Assert(!typeof(TObj).IsValueType);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (6)
183Debug.Assert(a != null); 384Debug.Assert(o is byte[]); 890Debug.Assert(ai is byte[]); 1110Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code"); 1129Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code"); 1134Debug.Fail("https://github.com/dotnet/runtime/issues/18037: Add More Tests for Serialization Code");
System\Xml\Serialization\SourceInfo.cs (4)
117Debug.Assert(get_Item != null); 194Debug.Assert(match.Groups["arg"].Value == Arg); 195Debug.Assert(match.Groups["cast"].Value == CodeIdentifier.GetCSharpName(Type!)); 222System.Diagnostics.Debug.Assert(targetType == nullableType || targetType.IsAssignableFrom(nullableType.GetGenericArguments()[0]));
System\Xml\Serialization\Types.cs (3)
651Debug.Assert(s_primitiveNames[dataTypeName, XmlSchema.Namespace] != null); 1170Debug.Assert(propertyInfo != null); 1171Debug.Assert(typeDesc != null);
System\Xml\Serialization\XmlSerializationILGen.cs (5)
49System.Diagnostics.Debug.Assert(access == "public"); 64get { System.Diagnostics.Debug.Assert(_moduleBuilder != null); return _moduleBuilder; } 65set { System.Diagnostics.Debug.Assert(_moduleBuilder == null && value != null); _moduleBuilder = value; } 103System.Diagnostics.Debug.Assert(_methodBuilders.ContainsKey(methodName)); 581System.Diagnostics.Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationReaderILGen.cs (20)
262Debug.Assert(_idNameFields.ContainsKey(id)); 387Debug.Assert(node == "null" || node == "(object)p"); 756System.Diagnostics.Debug.Assert(source == "Reader.ReadElementString()" || source == "Reader.ReadString()" 866System.Diagnostics.Debug.Assert(source == "Reader.Value" || source == "Reader.ReadElementString()" || source == "vals[i]"); 984System.Diagnostics.Debug.Assert(source == "false"); 1128Debug.Assert(get_TableName != null); 1818System.Diagnostics.Debug.Assert(source == "Reader"); 2087System.Diagnostics.Debug.Assert(elseCall == "UnknownNode"); 2387Debug.Assert(anyText != null); 2747Debug.Assert(!soapRefs); 2827Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA2"].Value); 2828Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA3"].Value); 2829Debug.Assert(match.Groups["locI1"].Value == match.Groups["locI2"].Value); 2873System.Diagnostics.Debug.Assert(CodeGenerator.GetVariableType(ilg.GetVariable(match.Groups["a"].Value)).IsArray); 2897Debug.Assert(elementType != null && variable is LocalBuilder); 2907Debug.Assert(memberInfos.ContainsKey(source.Substring(3))); 2935Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType))); 2941Debug.Assert(Add != null); 2954System.Diagnostics.Debug.Assert(varType.IsArray); 3075Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationWriter.cs (2)
459Debug.Assert(tryFormatResult.Value, "Something goes wrong with formatting primitives to the buffer."); 463Debug.Assert(!span.Slice(0, charsWritten).ContainsAny(escapeChars), "Primitive value contains illegal xml char.");
System\Xml\Serialization\XmlSerializationWriterILGen.cs (11)
1042System.Diagnostics.Debug.Assert(xmlnsSource.StartsWith("o.@", StringComparison.Ordinal)); 1362System.Diagnostics.Debug.Assert(parent == "o" || parent == "p"); 2227Debug.Assert(!local.LocalType.IsValueType); 2409Debug.Assert(type.IsValueType); 2544Debug.Assert(initValue.MemberInfo != null); 2545Debug.Assert(initValue.MemberInfo.Name == initValue.Arg.Substring(3)); 2592Debug.Assert(typeName == arrayTypeDesc.CSharpName || typeName == $"{arrayTypeDesc.CSharpName}[]"); 2601Debug.Assert(type != null); 2602Debug.Assert(ilg != null); 2609Debug.Assert(arrayType != null); 2610Debug.Assert(ilg != null);
System\Xml\ValidateNames.cs (7)
38Debug.Assert(s != null && offset <= s.Length); 69Debug.Assert(s != null && offset <= s.Length); 107Debug.Assert(s != null && offset <= s.Length); 157Debug.Assert(s != null && offset <= s.Length); 376Debug.Assert(offsetBadChar < s.Length); 396Debug.Assert(offsetBadChar < s.Length); 453Debug.Assert(prefix != null && localName != null && ns != null);
System\Xml\XmlCharType.cs (7)
23Debug.Assert(PublicIdChars.Contains(c) == IsPubidChar(c)); 24Debug.Assert(AsciiCharDataChars.Contains(c) == IsCharData(c)); 25Debug.Assert(WhiteSpaceChars.Contains(c) == IsWhiteSpace(c)); 168Debug.Assert(str != null); 169Debug.Assert(startPos <= str.Length); 170Debug.Assert(startPos + len <= str.Length); 181Debug.Assert(start <= end);
System\Xml\XmlEncoding.cs (1)
408Debug.Assert(i == 1);
System\Xml\XmlException.cs (5)
92Debug.Assert(message == null || !message.StartsWith("Xml_", StringComparison.Ordinal), "Do not pass a resource here!"); 227Debug.Assert(invCharIndex < data.Length); 228Debug.Assert(invCharIndex < length); 229Debug.Assert(length <= data.Length); 294Debug.Assert(e != null, "Unexpected null exception");
System\Xml\XmlNamespacemanager.cs (18)
102Debug.Assert(_nsdecls != null); 108Debug.Assert(_hashTable != null); 113Debug.Assert(decl >= 2); 126Debug.Assert(_nameTable != null); 127Debug.Assert(_nsdecls != null); 170Debug.Assert(_hashTable != null); 177Debug.Assert(_hashTable == null); 193Debug.Assert(_nsdecls != null); 208Debug.Assert(_nsdecls != null); 226Debug.Assert(_nsdecls != null); 242Debug.Assert(i >= 2); 253Debug.Assert(prefix != null); 274Debug.Assert(_nsdecls != null); 281Debug.Assert(_nsdecls != null); 285Debug.Assert(_hashTable != null); 322Debug.Assert(_nsdecls != null); 341Debug.Assert(_nsdecls != null); 367Debug.Assert(_nsdecls != null);
System\Xml\XPath\Internal\AbsoluteQuery.cs (1)
16Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\AttributeQuery.cs (2)
42Debug.Assert(currentNode != null); 48Debug.Assert(!currentNode.NamespaceURI.Equals(XmlReservedNs.NsXmlNs));
System\Xml\XPath\Internal\Axis.cs (2)
39Debug.Assert(prefix != null); 40Debug.Assert(name != null);
System\Xml\XPath\Internal\BaseAxisQuery.cs (4)
34Debug.Assert(qyInput != null); 64Debug.Assert(context != null); 89Debug.Assert(_nsUri != null); 120Debug.Assert(this is AttributeQuery || this is ChildrenQuery);
System\Xml\XPath\Internal\BooleanExpr.cs (2)
19Debug.Assert(op == Operator.Op.AND || op == Operator.Op.OR); 20Debug.Assert(opnd1 != null && opnd2 != null);
System\Xml\XPath\Internal\BooleanFunctions.cs (2)
65Debug.Assert(result is XPathNavigator, "Unknown value type"); 79Debug.Assert(nodeIterator.Current != null);
System\Xml\XPath\Internal\CacheAxisQuery.cs (2)
40Debug.Assert(0 <= count && count <= outputBuffer.Count); 52Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CacheOutputQuery.cs (2)
51Debug.Assert(0 <= count && count <= outputBuffer.Count); 63Debug.Assert(0 <= count && count <= outputBuffer.Count);
System\Xml\XPath\Internal\CompiledXPathExpr.cs (2)
46Debug.Assert(_query != null, "In case of error in XPath we create ErrorXPathExpression"); 124Debug.Assert(prefix != null);
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (4)
63Debug.Assert(currentNode != null); 75Debug.Assert(currentNode != null); 86Debug.Assert(currentNode != null); 95Debug.Assert(result, "Algorithm error, We always should be able to move up if level > 0");
System\Xml\XPath\Internal\FilterQuery.cs (1)
71Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\ForwardPositionQuery.cs (1)
13Debug.Assert(input != null);
System\Xml\XPath\Internal\FunctionQuery.cs (3)
77Debug.Assert(nodeIterator.Current != null); 83Debug.Assert(_function != null); 87Debug.Assert(retVal != null);
System\Xml\XPath\Internal\IdQuery.cs (1)
18Debug.Assert(context.Current != null);
System\Xml\XPath\Internal\IteratorFilter.cs (1)
36Debug.Assert(_innerIterator.Current != null);
System\Xml\XPath\Internal\LogicalExpr.cs (8)
19Debug.Assert( 70Debug.Assert(cmp != null); 97Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 130Debug.Assert( 254Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE, 328Debug.Fail("Unexpected Operator.op code in cmpNumberNumber()"); 340Debug.Fail("Unexpected Operator.op code in cmpNumberNumber()"); 366Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE,
System\Xml\XPath\Internal\MergeFilterQuery.cs (1)
62Debug.Assert(current != null);
System\Xml\XPath\Internal\NamespaceQuery.cs (2)
58Debug.Assert(e.NodeType == XPathNodeType.Namespace); 61Debug.Assert(e.LocalName.Length == 0, "Only xmlns='' can have empty string as a value");
System\Xml\XPath\Internal\NumberFunctions.cs (5)
58Debug.Assert(nodeIterator!.Current != null); 86Debug.Assert(_arg != null); 98Debug.Assert(_arg != null); 104Debug.Assert(_arg != null); 110Debug.Assert(_arg != null);
System\Xml\XPath\Internal\NumericExpr.cs (3)
19Debug.Assert( 24Debug.Assert(opnd1 != null && opnd2 != null); 59Debug.Assert(op == Operator.Op.PLUS || op == Operator.Op.MINUS || op == Operator.Op.MOD || op == Operator.Op.DIV || op == Operator.Op.MUL);
System\Xml\XPath\Internal\Operator.cs (1)
49Debug.Assert(Op.EQ <= op && op <= Op.GE);
System\Xml\XPath\Internal\PrecedingQuery.cs (2)
85Debug.Assert(qyInput.Advance() == null, "we read all qyInput.Advance() already"); 96Debug.Fail("Algorithm error: we missed the sentinel node");
System\Xml\XPath\Internal\PreSiblingQuery.cs (2)
67Debug.Assert(test, "We just moved to parent, how we can not have first child?"); 76Debug.Fail("We managed to miss sentinel node (input)");
System\Xml\XPath\Internal\Query.cs (2)
147Debug.Assert(0 <= l && l < r); 191Debug.Assert(value is XPathNavigator, "Unknown value type");
System\Xml\XPath\Internal\QueryBuilder.cs (4)
420Debug.Assert(root.Prefix != null); 421Debug.Assert(root.Name != null); 464Debug.Assert(root != null); 494Debug.Fail("Unknown QueryType encountered!!");
System\Xml\XPath\Internal\SortQuery.cs (9)
22Debug.Assert(qyInput != null, "Sort Query needs an input query tree to work on"); 54Debug.Assert(numSorts > 0, "Why was the sort query created?"); 82Debug.Assert(0 <= count && count <= _results.Count); 94Debug.Assert(0 <= count && count <= _results.Count); 159Debug.Assert(_expressions.Length == _comparers.Length); 160Debug.Assert(0 < _expressions.Length); 161Debug.Assert(0 <= _numSorts && _numSorts <= _expressions.Length); 175Debug.Assert(_numSorts < _expressions.Length); 197Debug.Assert(x != null && y != null, "Oops!! what happened?");
System\Xml\XPath\Internal\StringFunctions.cs (11)
22Debug.Assert(argList != null, "Use 'new Query[]{}' instead."); 91Debug.Assert(GetXPathType(argVal) == XPathResultType.Number); 95Debug.Assert(nodeIterator.Current != null); 131Debug.Assert(_argList.Count > 1); 139Debug.Assert(_argList.Count > 1); 147Debug.Assert(_argList.Count > 1); 157Debug.Assert(_argList.Count > 1); 167Debug.Assert(_argList.Count > 0); 212Debug.Assert(nodeIterator!.Current != null); 225Debug.Assert(nodeIterator!.Current != null); 257Debug.Assert(_argList.Count > 2);
System\Xml\XPath\Internal\VariableQuery.cs (2)
48Debug.Assert(_variable != null); 52Debug.Assert(retVal != null);
System\Xml\XPath\Internal\XPathArrayIterator.cs (3)
35Debug.Assert(nodeIterator.Current != null); 54Debug.Assert(index <= list.Count); 69Debug.Assert(index <= list.Count);
System\Xml\XPath\Internal\XPathMultyIterator.cs (5)
26Debug.Assert(iterator != null); 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 74Debug.Assert(it.Current != null && itNext.Current != null); 127Debug.Assert(position != 0, "MoveNext() wasn't called"); 128Debug.Assert(firstNotEmpty < arr.Length, "MoveNext() returned false");
System\Xml\XPath\Internal\XPathParser.cs (5)
415Debug.Assert(nodeType != XPathNodeType.Root); 464Debug.Assert(IsPrimaryExpr); 498Debug.Assert(opnd != null, "IsPrimaryExpr() was true. We should recognize this lex."); 655Debug.Assert(_scanner.CanBeFunction); 867Debug.Assert(_scanner.Kind == XPathScanner.LexKind.Axe);
System\Xml\XPath\Internal\XPathScanner.cs (19)
43Debug.Assert(0 <= _xpathExprIndex && _xpathExprIndex <= _xpathExpr.Length); 64Debug.Assert(_kind == LexKind.Name || _kind == LexKind.Axe); 65Debug.Assert(_name != null); 74Debug.Assert(_kind == LexKind.Name); 75Debug.Assert(_prefix != null); 84Debug.Assert(_kind == LexKind.String); 85Debug.Assert(_stringValue != null); 94Debug.Assert(_kind == LexKind.Number); 95Debug.Assert(!double.IsNaN(_numberValue)); 106Debug.Assert(_kind == LexKind.Name); 122Debug.Assert(XmlCharType.IsWhiteSpace(CurrentChar)); 277Debug.Assert(CurrentChar == '.' || char.IsAsciiDigit(CurrentChar)); 297Debug.Assert(char.IsAsciiDigit(CurrentChar)); 299Debug.Assert(0 <= start && _xpathExpr[start] == '.'); 322Debug.Assert(CurrentChar == endChar); 331Debug.Assert(!span.IsEmpty); 332Debug.Assert(span[0] == CurrentChar); 333Debug.Assert(XmlCharType.IsStartNCNameSingleChar(span[0])); 334Debug.Assert(XmlCharType.IsNCNameSingleChar(span[0]));
System\Xml\XPath\Internal\XPathSingletonIterator.cs (1)
16Debug.Assert(nav != null);
System\Xml\XPath\XPathDocument.cs (5)
178Debug.Assert((object?)_nameTable.Get(string.Empty) == (object)string.Empty, "NameTable must contain atomized string.Empty"); 210Debug.Assert(reader.LocalName == "xmlns"); 215Debug.Assert(reader.Prefix == "xmlns"); 385Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element && pageNmsp[idxNmsp].NodeType == XPathNodeType.Namespace); 398Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
System\Xml\XPath\XPathNavigator.cs (11)
970Debug.Assert(CompareSiblings(n1.Clone(), n2.Clone()) != CompareSiblings(n2.Clone(), n1.Clone()), "IsSamePosition() on custom navigator returns inconsistent results"); 1039Debug.Assert(schemaType != null || this.NodeType == XPathNodeType.Root, "schemaType != null || this.NodeType == XPathNodeType.Root"); 1067Debug.Assert(schemas != null); 1091Debug.Assert(args != null); 1191Debug.Assert(context.Current != null); 1821Debug.Assert(!n1.IsSamePosition(n2)); 1823Debug.Assert(p1.MoveToParent() && p2.MoveToParent() && p1.IsSamePosition(p2)); 2055Debug.Assert(reader.LocalName == "xmlns"); 2060Debug.Assert(reader.Prefix == "xmlns"); 2116Debug.Assert(reader.LocalName == "xmlns"); 2121Debug.Assert(reader.Prefix == "xmlns");
System\Xml\XPath\XPathNavigatorReader.cs (6)
515Debug.Assert(value == null); 641Debug.Assert(XPathNodeType.Namespace == _nav.NodeType); 664Debug.Fail("Couldn't find Namespace Node! Should not happen!"); 1028Debug.Assert(_nav.NodeType == XPathNodeType.Element, $"{_nav.NodeType} == XPathNodeType.Element"); 1266Debug.Fail("This shouldn't be called."); 1277Debug.Fail("This shouldn't be called.");
System\Xml\XPath\XPathNodeIterator.cs (1)
66Debug.Assert(_current.Current != null);
System\Xml\Xsl\IlGen\GenerateHelper.cs (27)
116Debug.Assert(seqEmpty != null, "Field `Empty` could not be found"); 879Debug.Fail("Shouldn't be called"); 896Debug.Assert(clrTypeDst == typeof(object), "Invalid cast, since value types do not allow inheritance."); 902Debug.Assert(clrTypeSrc == typeof(object), "Invalid cast, since value types do not allow inheritance."); 910Debug.Assert(clrTypeSrc.IsAssignableFrom(clrTypeDst) || clrTypeDst.IsAssignableFrom(clrTypeSrc), 967default: Debug.Fail($"{opType} must be an arithmetic operation."); break; 980default: Debug.Fail($"{opType} must be an arithmetic operation."); break; 987Debug.Fail($"The {opType} arithmetic operation cannot be performed on values of type {code}."); 1002Debug.Fail($"Type {code} does not support the equals operation."); 1018Debug.Fail($"Type {code} does not support the equals operation."); 1098Debug.Assert(nameType == GenerateNameType.TagNameAndNamespace); 1134Debug.Assert(_locXOut != null); 1197default: Debug.Fail($"{nameType} is invalid here."); break; 1207default: Debug.Fail($"{nameType} is invalid here."); break; 1231default: Debug.Fail($"{nameType} is invalid here."); break; 1260default: Debug.Fail($"{nameType} is invalid here."); break; 1270default: Debug.Fail($"{nameType} is invalid here."); break; 1411Debug.Assert(keyType.IsAtomicValue, "Sort key must have atomic value type."); 1430Debug.Fail("Heterogenous sort key is not allowed."); 1434Debug.Fail($"Sorting over datatype {keyType.TypeCode} is not allowed."); 1468Debug.Assert(_isDebug && _lastSourceInfo != null); 1469Debug.Assert(sourceInfo != null); 1501Debug.Assert(_module.EmitSymbols); 1613Debug.Assert(opcode.OperandType == OperandType.InlineI || opcode.OperandType == OperandType.InlineVar); 1623Debug.Assert(opcode.OperandType == OperandType.InlineI8); 1633Debug.Assert(!opcode.Equals(OpCodes.Br) && !opcode.Equals(OpCodes.Br_S), "Use EmitUnconditionalBranch and be careful not to emit unverifiable code."); 1734Debug.Assert(opcode.Equals(OpCodes.Brtrue) || opcode.Equals(OpCodes.Brtrue_S) ||
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (10)
100Debug.Assert(loc.LocalType == itemStorageType || 117Debug.Assert(currentMethod.ReturnType == itemStorageType, 133Debug.Assert(methGlobal.ReturnType == itemStorageType || 337Debug.Assert(_hasNext); 406Debug.Assert(_storage.IsCached); 479Debug.Assert(brctxt != BranchingContext.None); 548Debug.Fail($"Invalid location: {_storage.Location}"); 577Debug.Fail($"Invalid location: {_storage.Location}"); 681Debug.Assert(_storage.ItemStorageType == typeof(XPathItem) || storageTypeDest == typeof(XPathItem), 725Debug.Assert(storageTypeDest == typeof(XPathItem), "Must be converting from XPathNavigator to XPathItem");
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (7)
209Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 217Debug.Fail("Cannot handle more than 2 arguments."); 236Debug.Assert(arg != null, $"There is no '{argNum}' argument."); 245Debug.Assert(Enum.IsDefined(pattern)); 246Debug.Assert((int)pattern < 32); 247Debug.Assert(!_isReadOnly, "This OptimizerPatterns instance is read-only."); 256Debug.Assert(Enum.IsDefined(pattern));
System\Xml\Xsl\IlGen\StaticDataManager.cs (2)
119Debug.Assert(ndNmspDecl != null); 120Debug.Assert(ndNmspDecl.Left is QilLiteral && ndNmspDecl.Right is QilLiteral);
System\Xml\Xsl\IlGen\TailCallAnalyzer.cs (1)
36Debug.Assert(XmlILConstructInfo.Read(nd).PushToWriterLast,
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (30)
129Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 142Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 155Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 168Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 181Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 194Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 195Debug.Assert(value); 218Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 219Debug.Assert(value); 242Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 243Debug.Assert(value); 267Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 296Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 310Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 324Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 338Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 352Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only."); 441Debug.Assert(ndContent != null); 490case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break; 491case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break; 492case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break; 496case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break; 500default: Debug.Fail($"{ndConstr.NodeType} is not handled by XmlILStateAnalyzer."); break; 714Debug.Assert(!typ.IsSingleton); 750Debug.Assert(!typ.IsSingleton); 800Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor); 838Debug.Assert(binaryNode != null); 857Debug.Assert(ndName != null); 1058Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl); 1094Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlILModule.cs (4)
79Debug.Assert(!(useLRE && emitSymbols)); 211Debug.Assert(!_useLRE, "Cannot create initialized data for an LRE module"); 220Debug.Assert(!_useLRE, "Cannot create field for an LRE module"); 229Debug.Assert(!_useLRE, "Cannot create type initializer for an LRE module");
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (6)
5297Debug.Assert(nd is QilLiteral, "All literals except True, False, and QName must use QilLiteral"); 5432Debug.Assert(left.XmlType == right.XmlType, $"Comparison is not defined between {left.XmlType} and {right.XmlType}"); 5469Debug.Fail($"Cannot fold this comparison operation: {opType}"); 5489Debug.Assert(left.NodeType == right.NodeType); 5581Debug.Fail($"Cannot fold this arithmetic operation: {opType}"); 5639Debug.Assert(nd.NodeType == QilNodeType.Let || nd.NodeType == QilNodeType.Parameter, "Unexpected type of a global");
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (90)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer."); 93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); 97Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed"); 149Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports parameters of type item*."); 193Debug.Assert(iter.NodeType == QilNodeType.Parameter, "Only parameters may not have a default value"); 223Debug.Assert(iter.NodeType == QilNodeType.Parameter); 253Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports default values in parameters of type item*."); 318Debug.Assert(nd.XmlType!.IsSingleton || CachesResult(nd) || _iterCurr.HasLabelNext, 336Debug.Fail($"Visit{parent.NodeType} should never be called"); 758Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 843Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 909Debug.Assert(info.ConstructMethod == XmlILConstructMethod.Iterator); 912Debug.Assert(ndCond.Left.XmlType!.TypeCode == XmlTypeCode.Boolean); 949Debug.Assert(!ndCond.Center.XmlType!.IsSingleton || !ndCond.Right.XmlType!.IsSingleton); 981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton"); 986Debug.Assert(itemStorageType == typeof(bool)); 1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst); 1144Debug.Assert(XmlILConstructInfo.Read(nd).PullFromIteratorFirst, "VisitEmpty should only be called if items are iterated"); 1165Debug.Assert(XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Iterator, "This method should only be called if items in list are pulled from a code iterator."); 1509Debug.Assert(!ndStrConcat.Values.XmlType!.IsSingleton, "Optimizer should have folded StrConcat of a singleton value"); 1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton); 1713Debug.Assert(ndComp.Left.XmlType!.IsAtomicValue && ndComp.Right.XmlType!.IsAtomicValue, "Operands to compare must be atomic values."); 1714Debug.Assert(ndComp.Left.XmlType.IsSingleton && ndComp.Right.XmlType.IsSingleton, "Operands to compare must be cardinality one."); 1715Debug.Assert(ndComp.Left.XmlType == ndComp.Right.XmlType, "Operands to compare may not be heterogenous."); 1753Debug.Assert(code != XmlTypeCode.QName, $"QName values do not support the {relOp} operation"); 1772Debug.Fail($"Comparisons for datatype {code} are invalid."); 2030Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2110Debug.Assert(ndIter != null); 2123Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter); 2124Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional)); 2141Debug.Assert(ndFor.XmlType!.IsSingleton); 2203Debug.Assert(!ndLet.XmlType!.IsSingleton); 2234Debug.Assert(ndIter != null); 2248Debug.Assert(ndIter.NodeType == QilNodeType.For); 2251Debug.Assert(locPos != null); 2265Debug.Assert(ndSort.Variable.NodeType == QilNodeType.For); 2286Debug.Assert(!_iterNested!.Storage.IsCached); 2330Debug.Assert(ndKey.Key.XmlType!.IsAtomicValue, "Sort key must be an atomic value."); 2437Debug.Assert(pattStep.MatchesPattern(OptimizerPatternName.Axis), "Dod patterns should only match if step is FilterElements or FilterKindTest or Axis"); 2474Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2500Debug.Fail($"Pattern {step.NodeType} should have been handled."); 2523Debug.Assert(_iterCurr.Storage.IsCached, "DodMerge pattern should only be matched when cached sequences are returned from loop"); 2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter); 2600Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument"); 2780Debug.Assert(XmlILConstructInfo.Read(ndElem).PushToWriterFirst, "Element construction should always be pushed to writer."); 2830Debug.Assert(XmlILConstructInfo.Read(ndAttr).PushToWriterFirst, "Attribute construction should always be pushed to writer."); 2864Debug.Assert(XmlILConstructInfo.Read(ndComment).PushToWriterFirst, "Comment construction should always be pushed to writer."); 2884Debug.Assert(XmlILConstructInfo.Read(ndPI).PushToWriterFirst, "PI construction should always be pushed to writer."); 2924Debug.Assert(info.PushToWriterFirst, "Text construction should always be pushed to writer."); 2984Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer."); 3007Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer."); 3137Debug.Fail($"Unexpected node type {ndProp.NodeType}"); 3181Debug.Assert(!typDerived!.NeverSubtypeOf(typBase), "Normalizer should have eliminated IsType where source can never be a subtype of destination type."); 3187Debug.Assert(_iterCurr.Storage.ItemStorageType == typeof(XPathItem), "If !IsNode, then storage type should be Item"); 3263Debug.Assert((typDerived.NodeKinds & kinds) != XmlNodeKindFlags.None, "Normalizer should have taken care of case where node kinds are disjoint."); 3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes."); 3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer); 3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg"); 3681Debug.Fail($"Internal Xslt library may not use parameters of type {clrTypeFormalArg}"); 3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst); 3751Debug.Assert(ndCopy.Left.XmlType!.IsNode); 3763Debug.Assert(ndCopy.Left.XmlType.IsNode); 3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer."); 3811Debug.Fail($"Conversion from {ndConv.Source.XmlType} to {ndConv.TargetType} is not supported."); 3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null); 4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type."); 4124Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, nodeType, ValidateNames.Flags.AllExceptPrefixMapping)); 4201Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4240Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4267Debug.Assert(ndSecond.NodeType == QilNodeType.NameOf); 4309default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4322default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4338default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4357default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break; 4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI); 4604Debug.Fail($"Cannot map QilNodeType {typ} to an XPathNodeType"); 4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element); 4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content); 4694Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None || 4772Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4786Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4805Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4815Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4825Debug.Assert(nd.XmlType!.IsSingleton && !XmlILConstructInfo.Read(nd).PushToWriterLast); 4839Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast); 4853Debug.Assert(_iterCurr.Storage.IsCached, "Expression result should be cached. CachesResult() might have a bug in it.");
System\Xml\Xsl\QIL\QilList.cs (1)
58Debug.Assert(!xt.IsDod, "Sequences do not preserve DocOrderDistinct");
System\Xml\Xsl\QIL\QilPatternFactory.cs (8)
26Debug.Assert(f != null); 228Debug.Assert(arg != null, "Argument shouldn't be null"); 229Debug.Assert(arg.XmlType!.TypeCode == XmlTypeCode.Boolean && arg.XmlType.IsSingleton, 595Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 600Debug.Assert(args.NodeType == QilNodeType.FormalParameterList); 606Debug.Assert(args.NodeType == QilNodeType.ActualParameterList); 607Debug.Assert(func.Arguments.Count == args.Count); 770Debug.Assert(t != null, "Type can't be null");
System\Xml\Xsl\QIL\QilReplaceVisitor.cs (1)
81Debug.Assert(newType.IsSubtypeOf(XmlQueryTypeFactory.AtMost(oldType, oldType.Cardinality)), "Replace shouldn't relax original type");
System\Xml\Xsl\QIL\QilValidationVisitor.cs (2)
36Debug.Assert(node != null); 185Debug.Fail(message);
System\Xml\Xsl\QIL\SubstitutionList.cs (1)
51Debug.Assert(_s.Count % 2 == 0);
System\Xml\Xsl\QIL\WhitespaceRule.cs (1)
77Debug.Assert(this.GetType() == typeof(WhitespaceRule), "Serialization of WhitespaceRule subclasses is not implemented");
System\Xml\Xsl\QueryReaderSettings.cs (1)
26Debug.Assert(xmlNameTable != null);
System\Xml\Xsl\Runtime\ContentIterators.cs (3)
116Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace); 418Debug.Fail($"Invalid IteratorState {_state}"); 440Debug.Assert(_state == IteratorState.HaveCurrentHaveNext);
System\Xml\Xsl\Runtime\DecimalFormatter.cs (3)
43Debug.Assert(formatPicture != null && decimalFormat != null); 266Debug.Assert(i + 1 < result.Length); 268Debug.Assert(char.IsAsciiDigit(ch) || ch == EscChar);
System\Xml\Xsl\Runtime\DocumentOrderComparer.cs (1)
40Debug.Assert(GetDocumentIndex(navThis) != GetDocumentIndex(navThat!));
System\Xml\Xsl\Runtime\DodSequenceMerge.cs (1)
94Debug.Assert(_sequencesToMerge.Count == 1, "While loop should terminate when count == 1");
System\Xml\Xsl\Runtime\EarlyBoundInfo.cs (2)
22Debug.Assert(namespaceUri != null && ebType != null); 28Debug.Assert(_constrInfo != null, $"The early bound object type {ebType.FullName} must have a public default constructor");
System\Xml\Xsl\Runtime\NumberFormatter.cs (3)
81Debug.Assert(1 <= val && val <= MaxAlphabeticValue); 82Debug.Assert(Math.Pow(totalChars, MaxAlphabeticLength) >= MaxAlphabeticValue); 104Debug.Assert(1 <= val && val <= MaxRomanValue);
System\Xml\Xsl\Runtime\SetIterators.cs (2)
213Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned."); 313Debug.Assert(nestedNavigator == null, "null is passed to MoveNext after IteratorState.HaveCurrent has been returned.");
System\Xml\Xsl\Runtime\StringConcat.cs (1)
55Debug.Assert(value != null);
System\Xml\Xsl\Runtime\TreeIterators.cs (4)
498Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 523Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 834Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 930Debug.Assert(_state == IteratorState.NoNext, $"Illegal state: {_state}");
System\Xml\Xsl\Runtime\WhitespaceRuleLookup.cs (7)
39Debug.Assert(rules != null); 89Debug.Assert(_nameTable != null && _ruleTemp != null); 90Debug.Assert(localName != null && (object?)_nameTable.Get(localName) == (object)localName); 91Debug.Assert(namespaceName != null && (object?)_nameTable.Get(namespaceName) == (object)namespaceName); 173Debug.Assert(obj is InternalWhitespaceRule); 176Debug.Assert(LocalName != null && that!.LocalName != null); 177Debug.Assert(NamespaceName != null && that.NamespaceName != null);
System\Xml\Xsl\Runtime\WhitespaceRuleReader.cs (1)
49Debug.Assert(wsRules != null);
System\Xml\Xsl\Runtime\XmlAttributeCache.cs (13)
86Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 95Debug.Assert(_numEntries != 0); 143Debug.Assert(text != null); 144Debug.Assert(_arrAttrs != null && _numEntries != 0); 155Debug.Assert(value is XmlAtomicValue, "value should always be an XmlAtomicValue, as XmlAttributeCache is only used by XmlQueryOutput"); 156Debug.Assert(_arrAttrs != null && _numEntries != 0); 175Debug.Fail("Should never be called on XmlAttributeCache."); 179Debug.Fail("Should never be called on XmlAttributeCache."); 183Debug.Fail("Should never be called on XmlAttributeCache."); 187Debug.Fail("Should never be called on XmlAttributeCache."); 191Debug.Fail("Should never be called on XmlAttributeCache."); 196Debug.Fail("Should never be called on XmlAttributeCache."); 360Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (3)
104Debug.Assert(((int)value & Mask) == 0); 156Debug.Assert(collationLiteral != null, "collation literal should not be null"); 379Debug.Assert(_cultInfo == null || _cultInfo.Equals(new CultureInfo(_cultInfo.Name)),
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (4)
221Debug.Assert(!methMatch.ContainsGenericParameters); 281Debug.Assert(_meth != null, "Must call Bind() before calling Invoke."); 282Debug.Assert(args.Length == _argClrTypes!.Length, "Mismatched number of actual and formal arguments."); 308Debug.Assert(that != null);
System\Xml\Xsl\Runtime\XmlILIndex.cs (1)
45Debug.Assert(navigator.ComparePosition(seq[seq.Count - 1]) >= 0, "Index nodes must be added in document order");
System\Xml\Xsl\Runtime\XmlNavigatorFilter.cs (2)
159Debug.Assert(s_typeFilters[(int)nodeType] != null); 168Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlNavigatorStack.cs (2)
53Debug.Assert(!IsEmpty); 62Debug.Assert(!IsEmpty);
System\Xml\Xsl\Runtime\XmlQueryContext.cs (3)
167Debug.Assert(dataSource != null, "GetType() below assumes dataSource is not null"); 199Debug.Assert(uriRelative != null, "Relative URI should not be null"); 301Debug.Fail($"This XmlTypeCode should never be inferred from a Clr type: {xmlTypeFormalArg.TypeCode}");
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (47)
161Debug.Assert(prefix != null && !string.IsNullOrEmpty(localName) && ns != null, "Invalid argument"); 162Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed"); 220Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument"); 230Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All)); 418Debug.Assert(_xstate == XmlState.WithinSequence, $"StartTree cannot be called in the {_xstate} state."); 429Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"EndTree cannot be called in the {_xstate} state."); 445Debug.Assert(_xstate == XmlState.WithinContent, $"WriteStartElement cannot be called in the {_xstate} state."); 468Debug.Assert(_xstate == XmlState.EnumAttrs, $"StartElementContent cannot be called in the {_xstate} state."); 483Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"WriteEndElement cannot be called in the {_xstate} state."); 503Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteStartAttribute cannot be called in the {_xstate} state."); 522Debug.Assert(_xstate == XmlState.WithinAttr, $"WriteEndAttribute cannot be called in the {_xstate} state."); 537Debug.Assert(prefix != null && ns != null); 538Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteNamespaceDeclaration cannot be called in the {_xstate} state."); 541Debug.Assert(prefix.Length == 0 || ns.Length != 0); 571Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlock cannot be called in the {_xstate} state."); 580Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlockNoEntities cannot be called in the {_xstate} state."); 594Debug.Assert(_depth == 0, "Root node can only be constructed at top-level."); 607Debug.Assert(_depth == 1, "Root node can only be constructed at top-level."); 698Debug.Assert(prefix != null && ns != null); 745Debug.Assert(prefix != null, "Invalid argument"); 761Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteNamespaceString cannot be called in the {_xstate} state."); 770Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteEndNamespace cannot be called in the {_xstate} state."); 800Debug.Assert(_xstate == XmlState.WithinComment, $"WriteCommentString cannot be called in the {_xstate} state."); 809Debug.Assert(_xstate == XmlState.WithinComment, $"WriteEndComment cannot be called in the {_xstate} state."); 843Debug.Assert(_xstate == XmlState.WithinPI, $"WriteProcessingInstructionString cannot be called in the {_xstate} state."); 852Debug.Assert(_xstate == XmlState.WithinPI, $"WriteEndProcessingInstruction cannot be called in the {_xstate} state."); 883Debug.Assert(_xstate == XmlState.WithinSequence, "Values can only be written at the top-level."); 937Debug.Assert(navigator.NodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 956Debug.Assert(navigator.NodeType == XPathNodeType.Root, "EndCopy should only be called for Element and Document nodes."); 979Debug.Assert(text != null, "Invalid argument"); 1020Debug.Fail($"Text cannot be output in the {_xstate} state."); 1036Debug.Assert(navigator != null); 1043Debug.Assert(nodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes."); 1174Debug.Assert(_xstate != XmlState.WithinSequence, "StartCopy should not called if state is WithinSequence"); 1191Debug.Fail($"Unexpected node type {navigator.NodeType}"); 1204Debug.Assert(navigator.NodeType == XPathNodeType.Element); 1205Debug.Assert(_xstate == XmlState.WithinContent, $"EndCopy cannot be called in the {_xstate} state."); 1218Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy"); 1223Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed"); 1256Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction); 1287Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace); 1318Debug.Assert(_nsmgr != null); 1339Debug.Fail($"{xstate} is not a valid XmlState."); 1350Debug.Assert(prefix.Length != 0 && ns.Length != 0); 1398Debug.Assert(prefix != null && !string.IsNullOrEmpty(ns)); 1504Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length); 1553Debug.Assert(_stkNames != null);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (22)
72Debug.Assert(data != null); 174Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 175Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 191Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed."); 192Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios."); 250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist"); 300Debug.Assert(IsGlobalComputed(index), "Cannot get the value of a global value until it has been computed."); 310Debug.Assert(!IsGlobalComputed(index), "Global value should only be set once."); 332Debug.Assert(_atomizedNames != null); 341Debug.Assert(_filters != null); 395Debug.Assert(_prefixMappingsList != null); 462Debug.Assert(_types != null); 480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), 483Debug.Assert(destinationType == typeof(object) || !destinationType.IsAssignableFrom(value.GetType()), 499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS, 558Debug.Assert(destinationType.IsAssignableFrom(value.GetType()), $"ChangeType from type {value.GetType().Name} to type {destinationType.Name} failed"); 680Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), $"Xml type {xmlType} is not represented in ILGen as {value.GetType().Name}"); 778Debug.Fail($"XmlTypeCode {code} was not fully handled."); 829Debug.Assert(_collations != null); 890Debug.Assert(context != null); 927Debug.Assert(context != null); 1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (2)
387Debug.Assert(keys.Length >= _size, "Number of keys must be >= number of items."); 582Debug.Assert(cmp == XmlNodeOrder.Before || cmp == XmlNodeOrder.Unknown);
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (2)
41Debug.Assert(defaultWriterSettings != null && staticData != null); 184Debug.Assert(formatVersion != CurrentFormatVersion || dataReader.Read() == -1, "Extra data at the end of the stream");
System\Xml\Xsl\Runtime\XmlSequenceWriter.cs (1)
319Debug.Fail($"Unexpected node type {nav.NodeType}");
System\Xml\Xsl\Runtime\XmlSortKey.cs (8)
70Debug.Assert(_nextKey != null && that._nextKey != null); 74Debug.Assert(_priority != that._priority); 85Debug.Assert(that != null && !(this is XmlEmptySortKey)); 125Debug.Assert(obj is XmlSortKey); 252Debug.Assert(that._sortKey != null, "Both keys must have non-null sortKey field"); 257Debug.Assert(_sortKeyBytes != null && that._sortKeyBytes != null, "Both keys must have non-null sortKeyBytes field"); 342Debug.Assert(_dblVal == double.NegativeInfinity || _dblVal == double.PositiveInfinity); 348Debug.Assert(that._dblVal == double.NegativeInfinity || that._dblVal == double.PositiveInfinity);
System\Xml\Xsl\Runtime\XslNumber.cs (10)
27Debug.Assert(isSeparator == (formatString != null), "AssertSeparator"); 33Debug.Assert(startIdx >= 0 && tokLen > 0); 50Debug.Assert(startIdx >= 0 && tokLen > 0); 128Debug.Assert(groupingSeparator.Length <= 1); 270Debug.Assert(item.ValueType == typeof(double), "Item must be either of type int, or double"); 274Debug.Assert(1 <= dblVal && dblVal < double.PositiveInfinity); 298Debug.Assert(CharUtil.IsDecimalDigitOne(startChar), $"Unexpected startChar: {startChar}"); 308Debug.Assert(val >= 0 && val == Math.Round(val), "ConvertToArabic operates on non-negative integer numbers only"); 319Debug.Assert(groupSeparator.Length == 1); 350Debug.Assert(newPos > 0, "Separator cannot be the first character");
System\Xml\Xsl\Runtime\XsltConvert.cs (4)
49Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic sequence {itemType}"); 93Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic sequence {itemType}"); 252Debug.Assert(destinationType.IsStrict && destinationType.IsAtomicValue, "Can only convert to strict atomic type."); 314Debug.Fail($"Conversion from {value.XmlType.QualifiedName.Name} to {destinationType} is not supported.");
System\Xml\Xsl\Runtime\XsltFunctions.cs (8)
69Debug.Assert(value.Length < startIndex || double.IsNaN(startIndex)); 91Debug.Assert(0 <= startIndex && startIndex <= endIndex && endIndex <= value.Length); 96Debug.Assert(endIndex <= startIndex || double.IsNaN(endIndex)); 283Debug.Assert(item is XPathNavigator); 302Debug.Fail($"Unexpected type: {o.GetType()}"); 340Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic value {itemType}"); 345Debug.Assert(stringValue != null); 536Debug.Assert(lang != null);
System\Xml\Xsl\Runtime\XsltLibrary.cs (13)
196Debug.Assert(_decimalFormatters != null && 0 <= idx && idx < _decimalFormatters.Count, "Value of decimalFormatterIndex is out of range"); 341Debug.Assert(!item.IsNode, "Atomic value expected"); 353Debug.Assert(itemType == typeof(bool), $"Unexpected type of atomic value {itemType}"); 361Debug.Assert(TypeCode.Boolean < TypeCode.Double && TypeCode.Double < TypeCode.String, "Cannot use the smallest TypeCode as a weakest one"); 384Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 391Debug.Assert(compType == TypeCode.Boolean); 399Debug.Assert(compType == TypeCode.Boolean || compType == TypeCode.Double || compType == TypeCode.String); 439Debug.Assert(op == ComparisonOperator.Eq || op == ComparisonOperator.Ne); 487Debug.Assert(ComparisonOperator.Lt <= op && op <= ComparisonOperator.Ge); 526Debug.Assert(XPathNodeType.SignificantWhitespace == XPathNodeType.Text + 1); 527Debug.Assert(XPathNodeType.Whitespace == XPathNodeType.Text + 2); 539Debug.Assert((object)nav1.NameTable == (object)nav2.NameTable, "Ref.Equal cannot be used if navigators have different name tables"); 573Debug.Fail("Invalid XSLT value");
System\Xml\Xsl\SourceLineInfo.cs (6)
70Debug.Assert(lineInfo.Start.Line == lineInfo.End.Line); 71Debug.Assert(lineInfo.Start.Pos == 0 && lineInfo.End.Pos == 0); 75Debug.Assert(0 < lineInfo.Start.Line && 0 < lineInfo.Start.Pos, "0 < start"); 76Debug.Assert(0 < lineInfo.End.Line && 0 < lineInfo.End.Pos, "0 < end"); 77Debug.Assert(lineInfo.Start.LessOrEqual(lineInfo.End), "start <= end"); 84Debug.Assert(uriString != null);
System\Xml\Xsl\XmlILCommand.cs (2)
29Debug.Assert(delExec != null && staticData != null); 83Debug.Assert(results != null);
System\Xml\Xsl\XmlIlGenerator.cs (3)
136Debug.Assert(_qil.Root != null); 210Debug.Assert(ndParam.NodeType == QilNodeType.Parameter); 341Debug.Assert(methInfo != null, "MethodInfo for global value should have been created previously.");
System\Xml\Xsl\XmlQueryCardinality.cs (1)
24Debug.Assert(0x00 <= value && value <= 0x07);
System\Xml\Xsl\XmlQueryType.cs (11)
487Debug.Assert(Count == 1 && IsSingleton, "This method should only be called for item types."); 488Debug.Assert(baseType.Count == 1 && baseType.IsSingleton, "This method should only be called for item types."); 489Debug.Assert(!IsDod && !baseType.IsDod, "Singleton types may not have DocOrderDistinct property"); 509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue); 528Debug.Assert(this.Count == 1 && this.IsSingleton, "this should be an item"); 529Debug.Assert(other.Count == 1 && other.IsSingleton, "other should be an item"); 562Debug.Assert(Count == 1, "Do not pass a Union type to this method."); 563Debug.Assert(IsSingleton, "Do not pass a Sequence type to this method."); 885Debug.Assert(count < 64, "BitMatrix currently only handles up to 64x64 matrix."); 903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range."); 908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (15)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union); 265Debug.Assert(itemType.IsSingleton, "All types should be prime."); 351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration, 437Debug.Assert(schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic, "List or Union Xsd types should have been handled by caller."); 470Debug.Assert(!isNillable); 504Debug.Assert(nameTest != null, "nameTest cannot be null"); 505Debug.Assert(schemaType != null, "schemaType cannot be null"); 513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic); 554Debug.Assert((object)this == (object)Create(_code, _isStrict), "Unknown type"); 741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types."); 749Debug.Assert(t.Cardinality == XmlQueryCardinality.One, "ChoiceType member types must be prime types."); 972Debug.Assert(prime != null, "SequenceType can only modify the cardinality of a non-null XmlQueryType."); 973Debug.Assert(prime.IsSingleton, "Prime type must have cardinality one."); 1182Debug.Fail($"Don't know how to serialize {type.GetType()}"); 1201Debug.Fail("Unexpected XmlQueryType's subtype id");
System\Xml\Xsl\XPath\XPathBuilder.cs (32)
46Debug.Fail("Must not be called"); 67Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 80Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 92Debug.Assert(numFixupCurrent >= 0, "Context fixup error"); 93Debug.Assert(numFixupPosition >= 0, "Context fixup error"); 94Debug.Assert(numFixupLast >= 0, "Context fixup error"); 115Debug.Assert(op != XPathOperator.Unknown); 118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null)); 129Debug.Fail($"{op} is not a valid XPathOperator"); 136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And); 147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String); 148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons"); 161Debug.Fail("Wrong operator type"); 169Debug.Assert(val.XmlType!.IsSingleton); 170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here"); 214Debug.Assert(op == XPathOperator.Eq || op == XPathOperator.Ne); 247Debug.Assert(op == XPathOperator.Lt || op == XPathOperator.Le || op == XPathOperator.Gt || op == XPathOperator.Ge); 278Debug.Assert(op == XPathOperator.UnaryMinus); 294Debug.Fail("Wrong operator type"); 301Debug.Assert(op == XPathOperator.Union); 414Debug.Fail("Invalid EnumValue 'XPathAxis'"); 457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct, 561Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 602Debug.Fail($"{func.id} is present in the function table, but absent from the switch"); 853Debug.Assert(current != null); 866Debug.Assert(environment != null); 890Debug.Assert(unknown.NodeType == QilNodeType.Unknown); 933Debug.Assert(_last != null); 938Debug.Assert(unknown != null); 988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs); 1024Debug.Assert(numArgs > maxArgs); 1046Debug.Assert(args.Count == 0 || argTypes != null);
System\Xml\Xsl\XPath\XPathParser.cs (6)
26Debug.Assert(_scanner == null && _builder == null); 27Debug.Assert(scanner != null && builder != null); 57Debug.Assert(_posInfo.Count == 0, "PushPosInfo() and PopPosInfo() calls have been unbalanced"); 262Debug.Assert(scanner.Name == "processing-instruction"); 509Debug.Assert(IsPrimaryExpr()); 536Debug.Assert(
System\Xml\Xsl\XPath\XPathQilFactory.cs (12)
41Debug.Assert(result == (xt.TypeCode == XmlTypeCode.Item || xt.TypeCode == XmlTypeCode.AnyAtomicType), "What else can it be?"); 48Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode, "Must be a singleton node"); 54Debug.Assert(n != null && n.XmlType!.IsNode, "Must be a node-set"); 60Debug.Assert(n != null && n.XmlType!.IsSingleton && n.XmlType.IsNode && n.XmlType.IsNotRtf, "Must be a singleton node and not an Rtf"); 66Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringX), "Must be a singleton string"); 72Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.StringXS), "Must be a sequence of strings"); 78Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.DoubleX), "Must be a singleton Double"); 84Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.BooleanX), "Must be a singleton Bool"); 133Debug.Assert(op == QilNodeType.Eq || op == QilNodeType.Ne); 149Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge); 170Debug.Assert(IsAnyType(n), $"Unexpected expression type: {n.XmlType}"); 182default: Debug.Fail($"Unexpected XmlTypeCode: {requiredType}"); return null;
System\Xml\Xsl\XPath\XPathScanner.cs (21)
78Debug.Assert(xpathExpr != null); 93Debug.Assert(0 <= index && index <= _xpathExpr.Length); 100Debug.Assert(-1 <= _curIndex && _curIndex < _xpathExpr.Length); 108Debug.Assert(_curIndex == _xpathExpr.Length); 117Debug.Assert(_kind == LexKind.Name); 118Debug.Assert(_name != null); 127Debug.Assert(_kind == LexKind.Name); 128Debug.Assert(_prefix != null); 152Debug.Assert(_kind == LexKind.String); 153Debug.Assert(_stringValue != null); 167Debug.Assert(_kind == LexKind.Name); 176Debug.Assert(_kind == LexKind.Axis); 177Debug.Assert(_axis != XPathAxis.Unknown); 424Debug.Assert(_prefix != null); 425Debug.Assert(_name != null); 485Debug.Assert(IsAsciiDigit(_curChar) || _curChar == '.'); 530Debug.Assert(XmlCharType.IsStartNCNameSingleChar(_curChar)); 554Debug.Assert(LexKind.FirstStringable <= t); 571Debug.Assert(LexKind.FirstStringable <= t); 575Debug.Assert("()[].@,*/$}".Contains((char)t)); 585Debug.Fail($"Unexpected LexKind: {t}");
System\Xml\Xsl\XPathConvert.cs (119)
163Debug.Assert(0 != (u & 0x80000000)); 224Debug.Assert(dec.MantissaSize > 0); 235Debug.Assert(dec[ib] > 0 && dec[ib] <= 9); 246Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 279Debug.Assert(exponent > 0 && exponent < 512); 296Debug.Assert(digit <= 9); 297Debug.Assert(0 != (_u2 & 0x80000000)); 301Debug.Assert(_exp >= 4); 351Debug.Assert(1 == rgu[4]); 378Debug.Assert(this.IsZero); 444Debug.Assert(0 != (_u2 & 0x80000000)); 445Debug.Assert(0 != (numOp._u2 & 0x80000000)); 459Debug.Assert(uHi < 0xFFFFFFFF); 464Debug.Assert(uHi < 0xFFFFFFFF); 472Debug.Assert(uHi < 0xFFFFFFFF); 480Debug.Assert(uHi < 0xFFFFFFFF); 488Debug.Assert(uHi < 0xFFFFFFFF); 494Debug.Assert(0 != uT); 496Debug.Assert(uHi < 0xFFFFFFFF); 504Debug.Assert(uHi < 0xFFFFFFFF); 512Debug.Assert(uHi < 0xFFFFFFFF); 521Debug.Assert(_error <= 2 || numOp._error <= 2); 545Debug.Assert(0 != (rgu5 & 0x40000000)); 568Debug.Assert(0 == rgu3); 569Debug.Assert(0 == rgu4); 570Debug.Assert(0 == rgu5); 596Debug.Assert(0 != (bn._u2 & 0x80000000)); 618Debug.Assert(wT >= 12 && wT < 32); 635Debug.Assert(wT > 0 && wT < 32); 673Debug.Assert(_exp <= 32); 683Debug.Assert(_error < 0xFFFFFFFF); 688Debug.Assert(0 == _u2 && 0 == _u1); 699Debug.Assert(_error < 0xFFFFFFFF); 735Debug.Assert(!IsSpecial(dbl)); 736Debug.Assert(0 < dbl); 813Debug.Assert(iT >= 0 && iT < 16); 817Debug.Assert(numHH._exp + tenPower._exp > 1); 826Debug.Assert(iT > 0 && iT <= 32); 828Debug.Assert(numHH._exp + tenPower._exp > 1); 837Debug.Assert(iT >= 0 && iT < 16); 841Debug.Assert(numHH._exp + tenPower._exp <= 32); 850Debug.Assert(iT > 0 && iT <= 32); 852Debug.Assert(numHH._exp + tenPower._exp <= 32); 859Debug.Assert(numHH._exp > 0 && numHH._exp < 32); 872Debug.Assert(uLL <= uLH && uLH <= uHL && uHL <= uHH); 900Debug.Assert(uHH >= uScale && uHH / uScale < 10); 904Debug.Assert(uLL <= uHH); 915Debug.Assert(0 != uHH || !numHH.IsZero); 948Debug.Assert(0 <= bLL && bLL < bHH && bHH <= 9); 992Debug.Assert(dblInt == Math.Floor(dblInt) && 1 <= dblInt && dblInt <= 9007199254740991.0d); 1011Debug.Assert(iT >= 0 && iT <= 15); 1012Debug.Assert(dblInt >= C10toN[iT] && dblInt < C10toN[iT + 1]); 1017Debug.Assert(iT >= 0); 1020Debug.Assert(dblInt == Math.Floor(dblInt) && 0 <= dblInt && dblInt < C10toN[iT]); 1035Debug.Assert(exponent == exponentPrec && mantissaSize == mantissaSizePrec); 1045Debug.Assert(equal, "DblToRgbFast and DblToRgbPrecise should give the same result"); 1083Debug.Assert(!IsSpecial(dbl)); 1084Debug.Assert(0 < dbl); 1098Debug.Assert(0 == (dblHi & 0x7FF00000)); 1108Debug.Assert(0 != (DblHi(dblT) & 0x7FF00000)); 1150Debug.Assert(1 <= dblT && dblT < 2); 1196Debug.Assert(0 == c5Den); 1217Debug.Assert(cu <= 2); 1234Debug.Assert(c2Num > 0 && c2Den > 0); 1241Debug.Assert(0 == (biDen[biDen.Length - 1] & 0xF0000000)); 1242Debug.Assert(0 != (biDen[biDen.Length - 1] & 0x08000000)); 1714Debug.Assert(0 <= idx && idx < _length); 1722Debug.Assert(_capacity >= InitCapacity); 1723Debug.Assert(_length >= 0 && _length <= _capacity); 1730Debug.Assert(0 == _length || 0 != _digits[_length - 1]); 1759Debug.Assert(cu >= 0); 1779Debug.Assert(2 <= _capacity); 1796Debug.Assert((object)this != (object)biSrc); 1810Debug.Assert(dec.MantissaSize >= 0); 1823Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 1833Debug.Assert(1 < uMul); 1843Debug.Assert(0 != uMul); 1867Debug.Assert(c5 >= 0); 1899Debug.Assert(cbit >= 0); 1966Debug.Assert(cu >= 0); 1987Debug.Assert(cbit >= 0); 2023Debug.Assert(obj != null); 2050Debug.Assert(idx >= 0 && idx < _length); 2051Debug.Assert(_digits[idx] != bi._digits[idx]); 2060Debug.Assert((object)this != (object)bi); 2114Debug.Assert((object)this != (object)bi); 2127Debug.Assert(0 == wCarry || 1 == wCarry); 2165Debug.Fail("Who's subtracting to negative?"); 2174Debug.Assert((object)this != (object)bi); 2182Debug.Assert(_length <= cu); 2190Debug.Assert(uQuo >= 0 && uQuo <= 9); 2205Debug.Assert(0 == wCarry || 1 == wCarry); 2217Debug.Assert(1 == wCarry); 2218Debug.Assert(idx == cu); 2241Debug.Assert(CompareTo(bi) < 0); 2342Debug.Assert(value <= MaxDigits); 2351Debug.Assert(0 <= ib && ib < _mantissaSize); 2370Debug.Assert(dbl == (double)this); 2375Debug.Assert(!this.Equals(decAfter)); 2380Debug.Assert(!this.Equals(decBefore)); 2472Debug.Assert(0 != mantissaSize && 0 != dec[0] && 0 != dec[mantissaSize - 1]); 2485Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2496Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2561Debug.Assert(dbl == dblLo); 2579Debug.Assert(dbl == (double)num); 2581Debug.Assert(dbl == dblLo || double.IsNaN(dblLo)); 2600Debug.Assert(double.IsNaN(dblLowPrec) || dblLowPrec == dbl); 2719Debug.Assert(c2Dbl < 32 || 0 != biDec[0]); 2737Debug.Assert(0 == c2Dbl || 0 == c2Dec); 2738Debug.Assert(0 == c5Dbl || 0 == c5Dec); 2857Debug.Assert(('0' & 0xF) == 0, "We use (char)(d |'0') to convert digit to char"); 2874Debug.Assert(double.IsInfinity(dbl)); 2880Debug.Assert(0 != dec.MantissaSize); 2921Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2939Debug.Assert(0 != cntDigits); 2940Debug.Assert(sizeFract == cntDigits || sizeFract > cntDigits && pch[-1] == '0'); 2950Debug.Assert(sizeFract == cntDigits); 2954Debug.Assert(dec[ib] >= 0 && dec[ib] <= 9); 2960Debug.Assert(0 == sizeInt && 0 == cntDigits);
System\Xml\Xsl\XslException.cs (2)
62Debug.Fail($"Resource string '{res}' was not found"); 164Debug.Assert(lineInfo == null || lineInfo.Uri != null);
System\Xml\Xsl\Xslt\Compiler.cs (14)
64Debug.Assert(CompilerErrorColl == null, "Compiler cannot be reused"); 78Debug.Assert(stylesheet != null); 79Debug.Assert(Root == null, "Compiler cannot be reused"); 119Debug.Assert(importPrecedence <= oldNsAlias.ImportPrecedence, "Stylesheets must be processed in the order of decreasing import precedence"); 163Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 201Debug.Assert(qname != null); 218Debug.Assert(nameTest != null); 235Debug.Assert(name != null); 279Debug.Assert(value <= ErrorCount); 291Debug.Assert(_savedErrorCount == -1, "Nested EnterForwardsCompatible calls"); 298Debug.Assert(_savedErrorCount != -1, "ExitForwardsCompatible without EnterForwardsCompatible"); 302Debug.Assert((_savedErrorCount = -1) < 0); 305Debug.Assert((_savedErrorCount = -1) < 0); 452Debug.Assert(characters.Length == 8);
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (13)
97Debug.Assert(_lastRecord == 0 && _lastScopes == 0, "PushScope() and PopScope() calls are unbalanced"); 111Debug.Assert(nsDecl.Prefix == null, "NS may be null only when prefix is null where it is used for extension-element-prefixes='#all'"); 149Debug.Assert(flag == (flag & ScopeFlags.ExclusiveFlags) && BitOperations.IsPow2((uint)flag), "One exclusive flag"); 150Debug.Assert(uri != null || ncName == null, "null, null means exclude '#all'"); 168Debug.Assert(flag == (flag & ScopeFlags.InheritedFlags) && BitOperations.IsPow2((uint)flag), "one inherited flag"); 193Debug.Assert((_records[_lastRecord].flags & ScopeFlags.CompatibilityFlags) != ScopeFlags.CompatibilityFlags, 201Debug.Assert(varName.LocalName != null && varName.NamespaceUri != null); 209Debug.Assert(prefix != null); 249Debug.Assert(nsUri != null); 257Debug.Assert(recPrefix == null); 301Debug.Assert(localName != null); 414Debug.Assert(LastPredefRecord <= _currentRecord && _currentRecord <= _scope._lastRecord, "MoveNext() either was not called or returned false"); 415Debug.Assert(_scope._records[_currentRecord].IsNamespace);
System\Xml\Xsl\Xslt\Focus.cs (11)
47Debug.Assert(focusType != SingletonFocusType.Iterator); 68Debug.Assert(_focusType != SingletonFocusType.None, "Focus is not set, call SetFocus first"); 79Debug.Assert(_focusType == SingletonFocusType.Iterator && _current != null, "Unexpected singleton focus type"); 104Debug.Assert(!IsFocusSet, "Focus was already set"); 109Debug.Assert(_current.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _current.Name.LocalName == "current"); 114Debug.Assert(_position.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _position.Name.LocalName == "position"); 119Debug.Assert(_last.Name!.NamespaceUri == XmlReservedNs.NsXslDebug && _last.Name.LocalName == "last"); 125Debug.Assert(IsFocusSet, "Focus was not set"); 136Debug.Assert(_current != null, "Naked current() is not expected in this function"); 142Debug.Assert(_position != null, "Naked position() is not expected in this function"); 148Debug.Assert(_last != null, "Naked last() is not expected in this function");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (8)
60Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()"); 61Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it"); 71Debug.Assert(formalArg.Name!.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug."); 86Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type"); 104Debug.Assert(argName != null); 132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list"); 133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already"); 151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (7)
29Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 41Debug.Assert(0 <= _depth && _depth <= 1, "this shouldn't happen"); 48Debug.Assert(base.numFixupLast == 0); 49Debug.Assert(base.numFixupPosition == 0); 77Debug.Assert(node != null); 78Debug.Assert(fixup != null); 110Debug.Assert(content.Child == _fixup, "Unexpected content node");
System\Xml\Xsl\Xslt\MatcherBuilder.cs (7)
135Debug.Assert( 234Debug.Assert(!double.IsNaN(x!._priority)); 235Debug.Assert(!double.IsNaN(y!._priority)); 398Debug.Assert(patternList.Count > 0); 423Debug.Assert((int)(QilLiteral)matcher == NoMatch); 450Debug.Assert(pattern.Priority > lastPriority); 522Debug.Assert(priority == branches.Length - 1);
System\Xml\Xsl\Xslt\OutputScopeManager.cs (4)
60Debug.Assert(prefix != null); 61Debug.Assert(uri != null); 142Debug.Assert(prefix != null); 149Debug.Assert(0 < record, "first record is lookup barrier, so we don't need to check this condition runtime");
System\Xml\Xsl\Xslt\QilGenerator.cs (56)
136Debug.Assert(compiler != null); 229Debug.Assert(IsDebug && _curLoop.IsFocusSet); 236Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus"); 436Debug.Assert(IsDebug, "This is debug only logic"); 440Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS)); 441Debug.Assert(var.Binding is QilList); 450Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl); 451Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl); 482Debug.Assert(tmpl != null && tmpl.Function == null); 483Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template); 512Debug.Assert(tmpl.NodeType == XslNodeType.Template); 606Debug.Assert((template != null) == (tmpl.SourceLine != null), "Templates must have line information, and attribute sets must not"); 614Debug.Assert(!IsDebug, "In debug mode we don't generate parumWithCalls functions. Otherwise focus flags should be adjusted"); 647Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown); 657Debug.Assert(tmpl is Template, "Only templates can have explicit arguments"); 660Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet"); 704Debug.Assert(instructions != null); 747default: Debug.Fail($"Unexpected type of AST node: {nodeType}"); result = null; break; 751Debug.Assert(result != null, "Result of compilation should not be null"); 987Debug.Assert(pos < source.Length); 1023Debug.Assert(i == source.Length || source[i] == '{'); 1077Debug.Assert(avt != null); 1129Debug.Assert(_curLoop.IsFocusSet); 1183Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1219Debug.Assert(node.NodeType == XslNodeType.ApplyImports); 1220Debug.Assert(!_curLoop.IsFocusSet, "xsl:apply-imports cannot be inside of xsl:for-each"); 1250Debug.Assert(tmpl.Function != null, "All templates should be already compiled"); 1285Debug.Assert(attSet.Function != null, "All templates should be already compiled"); 1421Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise); 1425Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose"); 1464Debug.Assert(node.NodeType == XslNodeType.Variable); 1474Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam); 1506Debug.Assert(varValue.SourceLine == null); 1512Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1722Debug.Assert(result.XmlType == T.StringX); 1730Debug.Assert(sort.NodeType == XslNodeType.Sort); 1822Debug.Assert(0 < list.Count, "Pattern should have at least one filter"); 1877Debug.Fail($"Unexpected NodeKind: {nodeKinds}"); 2123Debug.Assert(num.Level == NumberLevel.Any); 2143Debug.Assert(sheet.TemplateMatches.Count == 0); 2227Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2263Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2350Debug.Assert(expr != null); 2379Debug.Assert(pttrn != null); 2405Debug.Assert(pttrn != null); 2519Debug.Assert( 2585Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2666Debug.Assert(actualArgs[i].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()"); 2693Debug.Assert(actualArgs[0].Name == _nameCurrent, "Caller should always pass $current as a first argument to apply-* calls."); 2757Debug.Assert( 2798Debug.Assert(!IsDebug, "Attempt to override SourceLineInfo in debug mode"); 2804Debug.Assert(n.SourceLine == null); 2828Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS)); 2873Debug.Assert(let.NodeType == QilNodeType.Let); 2879Debug.Assert(0 <= varScope && varScope <= _vars.Count); 2890Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (11)
26Debug.Assert(args == null || args.Length == 0, "Error message must already be composed in res"); 32Debug.Fail("Should never get here"); 76Debug.Assert(ns != null); 103Debug.Assert(!args.IsReadOnly, "Writable collection expected"); 134Debug.Fail($"{func.id} is present in the function table, but absent from the switch"); 146Debug.Assert(ns != null); 253default: Debug.Fail($"This XmlTypeCode should never be inferred from a Clr type: {xmlTypeFormalArg.TypeCode}"); break; 411Debug.Assert(name.XmlType == T.StringX && key.XmlType == T.StringX); 441Debug.Assert(defList != null && defList.Count > 0); 458Debug.Assert(defList != null && defList.Count > 0); 669Debug.Assert(propValue.ValueType == typeof(double));
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (6)
28Debug.Assert(!_inUse); 46Debug.Assert(_inUse, "Reset() wasn't called"); 52Debug.Assert(_inUse, "Reset() wasn't called"); 58Debug.Assert(_inUse, "Reset() wasn't called"); 61Debug.Assert(value.XmlType!.TypeCode == XmlTypeCode.String); 76Debug.Assert(_inUse); // If we want allow multiple calls to ToQil() this logic should be changed
System\Xml\Xsl\Xslt\Stylesheet.cs (4)
86Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 87Debug.Assert(var.Name!.NamespaceUri != null, "Name must be resolved in XsltLoader"); 104Debug.Assert(template.ImportPrecedence == 0); 120Debug.Assert(template.ImportPrecedence <= old.ImportPrecedence, "Global objects are processed in order of decreasing import precedence");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (36)
28Debug.Assert(environment != null); 44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!"); 52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level"); 53Debug.Assert(filter.Variable.XmlType!.IsSubtypeOf(T.NodeNotRtf)); 54Debug.Assert(filter.Variable.Binding!.NodeType == QilNodeType.Unknown); // fixupNode 55Debug.Assert(filter.Body.XmlType!.IsSubtypeOf(T.Boolean)); 67Debug.Assert(_inTheBuild, "StartBuild() wasn't called"); 71Debug.Assert(_predicateEnvironment.numFixupCurrent >= 0, "Context fixup error"); 72Debug.Assert(_predicateEnvironment.numFixupPosition >= 0, "Context fixup error"); 73Debug.Assert(_predicateEnvironment.numFixupLast >= 0, "Context fixup error"); 80Debug.Assert(op == XPathOperator.Union); 81Debug.Assert(left != null); 82Debug.Assert(right != null); 84Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 92Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter"); 122Debug.Assert( 133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern"); 190Debug.Assert(left != null); 191Debug.Assert(right != null); 195Debug.Assert(nop.Child == _fixupNode); 199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step"); 200Debug.Assert(left.NodeType == QilNodeType.Filter); 209Debug.Assert(nop.Child != null); 213Debug.Assert(right.NodeType == QilNodeType.Filter); 215Debug.Assert(lastParent != null); 226Debug.Fail("Should not call to this function."); 291Debug.Assert(prefix.Length == 0); 297Debug.Assert( 305Debug.Assert(name == "key", "Unexpected function"); 306Debug.Assert( 355Debug.Assert(parent.NodeType == QilNodeType.Filter); 376Debug.Assert(context != null, "Predicate always has step so it can't have context == null"); 377Debug.Assert(context.Variable.NodeType == QilNodeType.For, "It shouldn't be Let, becaus predicates in PatternBuilder don't produce cached tuples."); 430Debug.Assert(current != null); 444Debug.Fail("GetPosition() must not be called"); 450Debug.Fail("GetLast() must not be called");
System\Xml\Xsl\Xslt\XPathPatternParser.cs (7)
27Debug.Assert(_scanner == null && _ptrnBuilder == null); 28Debug.Assert(scanner != null && ptrnBuilder != null); 124Debug.Assert(_scanner!.CanBeFunction); 125Debug.Assert(_scanner.Prefix.Length == 0); 126Debug.Assert(_scanner.Name == "id" || _scanner.Name == "key"); 258Debug.Assert(_scanner!.Kind == LexKind.LBracket); 261Debug.Assert(_scanner.Kind == LexKind.RBracket);
System\Xml\Xsl\Xslt\XslAst.cs (5)
68Debug.Assert(nsUri != null || Prefix == null); 119Debug.Assert(node != null); 162Debug.Assert(node != null && node.NodeType == XslNodeType.List); 250Debug.Assert(list != null && list.Count > 0); 265Debug.Assert(name != null);
System\Xml\Xsl\Xslt\XslAstAnalyzer.cs (19)
113Debug.Assert((v.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 121Debug.Assert((u.Flags & flag) == flag, "Flag was not set on an adjacent vertex"); 286Debug.Assert(tmpl.Match != null); 311Debug.Assert( 347Debug.Assert(_forEachDepth == 0, "xsl:apply-imports cannot be inside of xsl:for-each"); 348Debug.Assert(_currentTemplate is Template, "xsl:apply-imports can only occur within xsl:template"); 356Debug.Assert(node.Select != null, "Absent @select should be replaced with 'node()' in XsltLoader"); 408Debug.Assert(target != null); 429Debug.Assert(instr.NodeType == XslNodeType.WithParam); 807Debug.Assert((t.Flags & XslFlags.Stop) == 0, "Already visited this vertex"); 816Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 824Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 839Debug.Assert((u.Flags & XslFlags.SideEffects) == XslFlags.SideEffects, "Flag was not set on an adjacent vertex"); 1014Debug.Assert(op != XPathOperator.Unknown); 1174Debug.Fail($"Unexpected XmlQueryType for script function: {xt}"); 1409Debug.Assert(split > 0); 1438Debug.Assert(scoperecord.IsNamespace || scoperecord.ncName == null); 1439Debug.Assert(!Compiler.IsPhantomNamespace(scoperecord.nsUri!)); 1480Debug.Assert(parent.Content.Count == split + 1);
System\Xml\Xsl\Xslt\XsltInput.cs (37)
43Debug.Assert(reader != null); 44Debug.Assert(atoms != null); 77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities."); 201Debug.Assert( 244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference); 246Debug.Assert(local[0] == '#' || local == "lt" || local == "gt" || local == "quot" || local == "apos"); 258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace); 261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity); 273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute"); 323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value"); 332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference); 348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element."); 358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()"); 441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace); 488Debug.Assert(_reader.NodeType == XmlNodeType.Element); 518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute"); 524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute"); 554Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 566Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error."); 589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute"); 620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes"); 650Debug.Assert(IsKeyword(_atoms.Version)); 714Debug.Assert(NodeType == XmlNodeType.Element); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 750Debug.Assert(SS, "First we parse xsl:stylesheet element"); 843Debug.Assert(NodeType == XmlNodeType.Element); 921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace()); 948Debug.Assert(extensions ? IsKeyword(_atoms.ExtensionElementPrefixes) : IsKeyword(_atoms.ExcludeResultPrefixes)); 1001Debug.Assert(IsKeyword(_atoms.XPathDefaultNamespace)); 1013Debug.Assert(IsKeyword(_atoms.DefaultCollation)); 1095Debug.Assert(prefix != null); 1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized"); 1179Debug.Assert(input.NodeType == XmlNodeType.EndElement); 1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (42)
43Debug.Assert(compiler != null); 98Debug.Fail("Should never get here"); 102Debug.Assert(compiler.Root != null); 177Debug.Assert(_compiler.Version != 0, "Version should be already decided at this point"); 236Debug.Assert(!_documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import"); 298Debug.Assert(_input.NodeType == XmlNodeType.Element); 323Debug.Assert(!_input.IsXsltNamespace()); 324Debug.Assert(_curTemplate == null); 341Debug.Fail("AddTemplate() returned false for simplified stylesheet"); 355Debug.Assert(_input.IsXsltNamespace() && (_input.IsKeyword(_atoms.Stylesheet) || _input.IsKeyword(_atoms.Transform))); 468Debug.Assert(_input.NodeType == XmlNodeType.Text); 825Debug.Assert(attSet != null); 836Debug.Assert(attSet.CycleCheck == CycleCheck.Processing); 837Debug.Assert(attSet.Content[0].SourceLine != null); 957Debug.Assert(NumCharAttrs == DefaultValues.Length); 973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict."); 993Debug.Assert(name.Equals(format.Name)); 1067Debug.Assert(setName != null, "Required attribute always != null"); 1112Debug.Assert(_input.NodeType == XmlNodeType.Text); 1123Debug.Assert(_curTemplate == null); 1124Debug.Assert(!_input.CanHaveApplyImports); 1141Debug.Assert(_curTemplate == null); 1457Debug.Assert(_input.NodeType == XmlNodeType.Text); 1505Debug.Assert(_input.NodeType == XmlNodeType.Text); 1718Debug.Assert(_input.NodeType == XmlNodeType.Text); 1923Debug.Assert(nodeType != XslNodeType.Unknown); 2036Debug.Assert(_input.NodeType == XmlNodeType.Element); 2482Debug.Assert(_input.NodeType == XmlNodeType.Element); 2525Debug.Assert(content != null && withParam != null); 2526Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 2539Debug.Assert(content != null); 2548Debug.Assert(content != null); 2802Debug.Assert(_input.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute"); 2892Debug.Assert(_input.LocalName == "use-attribute-sets", "we are positioned on this attribute"); 2893Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()"); 2956Debug.Assert(!_input.IsRequiredAttribute(attNum), "All Yes/No attributes are optional."); 2976Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'type' attributes are optional."); 2985Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'validation' attributes are optional."); 3011Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional."); 3075Debug.Assert(node != null); 3082Debug.Assert(node != null); 3092Debug.Assert(to != null);
System\Xml\Xsl\Xslt\XsltQilFactory.cs (7)
28Debug.Assert(xt.IsSingleton && xt.IsStrict, "Xslt assumes that these types will always be singleton and strict"); 34Debug.Assert(IsDebug, "QName is reserved as the marker for missing values"); 37Debug.Assert(xt.IsNode, $"Unexpected expression type: {xt}"); 45Debug.Assert(n != null && n.XmlType!.IsSubtypeOf(T.QNameX), "Must be a singleton QName"); 121Debug.Assert(value != null && ( 140Debug.Assert(format != null); 153Debug.Assert(format != null);
System\Xml\Xsl\XsltOld\ActionFrame.cs (10)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length); 113Debug.Assert(!_withParams.Contains(name), "We should check duplicate params at compile time"); 129Debug.Assert(nodeSet != null); 136Debug.Assert(nodeSet != null); 143Debug.Assert(0 < sortarray.Count); 155Debug.Assert(proc.ActionStack.Peek() == this, "the trick we are doing with proc.Current will work only if this is topmost frame"); 184Debug.Assert(parent != null); 221Debug.Assert(_action is ContainerAction); 327Debug.Assert(index > 0, "MoveNext() wasn't called");
System\Xml\Xsl\XsltOld\ApplyImportsAction.cs (1)
29Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\ApplyTemplatesAction.cs (8)
32Debug.Assert(s_BuiltInRule != null); 45Debug.Assert(mode != null); 65Debug.Assert(_mode == null); 133Debug.Assert(processor != null && frame != null); 169Debug.Assert(frame.State == ProcessNextNode); 170Debug.Assert(frame.NewNodeSet != null); 184Debug.Assert(frame.State == PositionAdvanced); 196Debug.Fail("Invalid ApplyTemplatesAction execution state");
System\Xml\Xsl\XsltOld\AttributeAction.cs (2)
118Debug.Assert(processor != null && frame != null); 165Debug.Fail("Invalid ElementAction execution state");
System\Xml\Xsl\XsltOld\AttributeSetAction.cs (1)
34Debug.Assert(this.name == null);
System\Xml\Xsl\XsltOld\Avt.cs (6)
21Debug.Assert(constAvt != null); 27Debug.Assert(eventList != null); 45Debug.Assert(_constAvt != null); 50Debug.Assert(processor != null && frame != null); 65Debug.Assert(compiler != null); 66Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\AvtEvent.cs (2)
18Debug.Assert(key != Compiler.InvalidQueryKey); 24Debug.Assert(_key != Compiler.InvalidQueryKey);
System\Xml\Xsl\XsltOld\BeginEvent.cs (3)
26Debug.Assert(input != null); 27Debug.Assert(input.NodeType != XPathNodeType.Namespace); 46Debug.Assert(!_replaceNSAliasesDone, "Second attempt to replace NS aliases!. This bad.");
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
85Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.IsOnlyWhitespace(info.Value));
System\Xml\Xsl\XsltOld\CallTemplateAction.cs (3)
30Debug.Assert(_name == null); 84Debug.Assert(processor != null && frame != null); 112Debug.Fail("Invalid CallTemplateAction execution state");
System\Xml\Xsl\XsltOld\CommentAction.cs (2)
26Debug.Assert(processor != null && frame != null); 51Debug.Fail("Invalid IfAction execution state");
System\Xml\Xsl\XsltOld\Compiler.cs (42)
100Debug.Assert(_atoms != null); 123Debug.Assert(Document != null); 129Debug.Assert(Document != null); 135Debug.Assert(Document != null); 149Debug.Assert(_rootAction == null); 151Debug.Assert(_currentTemplate == null); 172Debug.Assert(input != null); 173Debug.Assert(xmlResolver != null); 174Debug.Assert(_input == null && _atoms == null); 186Debug.Assert(_input != null && _atoms != null); 216Debug.Assert(_rootAction != null); 217Debug.Assert(this.stylesheet != null); 218Debug.Assert(_queryStore != null); 219Debug.Assert(_input == null && _atoms == null); 321Debug.Assert(_rootAction != null); 326Debug.Assert(_currentTemplate != null); 327Debug.Assert(variable.VarType == VariableType.LocalVariable || variable.VarType == VariableType.LocalParameter || variable.VarType == VariableType.WithParameter); 464Debug.Assert(value != null); 465Debug.Assert((object)value == (object)Input!.Value); // this is always true. Why we passing value to this function. 551Debug.Assert(!_documentURIs.Contains(href), "Circular references must be checked while processing xsl:include and xsl:import"); 557Debug.Assert(_documentURIs.Contains(href), "Attempt to remove href that was not added"); 568Debug.Assert(_xmlResolver != null); 580Debug.Assert(_xmlResolver != null); 605Debug.Assert(newInput != null); 618Debug.Assert(_input != null); 619Debug.Assert(_input.Atoms == _atoms); 654Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 666Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 676Debug.Assert(this.stylesheet == _stylesheets!.Peek()); 682Debug.Assert(_currentTemplate != null); 690Debug.Assert(_currentTemplate != null); 709Debug.Assert(_queryStore != null); 781Debug.Assert( 805Debug.Assert(avt.Length != start, "Empty string not supposed here"); 806Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 845Debug.Assert(avt.Length != start, "Empty string not supposed here"); 846Debug.Assert(lex.Length == 0, "Builder should to be reset here"); 847Debug.Assert(avt[start] == '{', "We calling getXPathLex() only after we really meet {"); 898Debug.Assert(start <= avt.Length); 915Debug.Assert(saveStart < start, "We have to read something. Otherwise it's dead loop."); 922Debug.Assert(avtText != null); 944Debug.Assert(!constant || list.Count <= 1, "We can't have more then 1 text event if now {avt} found");
System\Xml\Xsl\XsltOld\ContainerAction.cs (9)
168Debug.Assert(compiler.Input.NodeType == XPathNodeType.Element); 230Debug.Assert(uri != null); 674Debug.Assert(Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)); 758Debug.Assert(action != null); 792Debug.Fail("Unexpected node type."); 854Debug.Assert((object)this == (object)compiler.RootAction); 953Debug.Assert(processor != null && frame != null); 974Debug.Fail("Invalid Container action execution state"); 981Debug.Assert(actionIndex == 0 || this.containedActions != null);
System\Xml\Xsl\XsltOld\CopyAction.cs (2)
52Debug.Assert(processor != null && frame != null); 116Debug.Fail("Invalid CopyAction execution state");
System\Xml\Xsl\XsltOld\CopyAttributesAction.cs (13)
22Debug.Assert(s_Action != null); 28Debug.Assert(processor != null && frame != null); 45Debug.Assert(frame.State == BeginEvent); 46Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 57Debug.Assert(frame.State == TextEvent); 58Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 69Debug.Assert(frame.State == EndEvent); 70Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 81Debug.Assert(frame.State == Advance); 82Debug.Assert(frame.Node!.NodeType == XPathNodeType.Attribute); 102Debug.Assert(node.NodeType == XPathNodeType.Attribute); 108Debug.Assert(node.NodeType == XPathNodeType.Attribute); 114Debug.Assert(node.NodeType == XPathNodeType.Attribute);
System\Xml\Xsl\XsltOld\CopyCodeAction.cs (6)
31Debug.Assert(copyEvents != null); 46Debug.Assert(processor != null && frame != null); 47Debug.Assert(_copyEvents != null && _copyEvents.Count > 0); 57Debug.Assert(frame.State == Outputting); 61Debug.Assert(frame.Counter < _copyEvents.Count); 78Debug.Fail("Invalid CopyCodeAction execution state");
System\Xml\Xsl\XsltOld\CopyNamespacesAction.cs (8)
19Debug.Assert(s_Action != null); 25Debug.Assert(processor != null && frame != null); 42Debug.Assert(frame.State == BeginEvent); 43Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 54Debug.Assert(frame.State == EndEvent); 55Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace); 66Debug.Assert(frame.State == Advance); 67Debug.Assert(frame.Node!.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\CopyNodeSetAction.cs (5)
24Debug.Assert(s_Action != null); 30Debug.Assert(processor != null && frame != null); 47Debug.Assert(frame.State == BeginEvent); 58Debug.Assert(frame.State == Contents); 97Debug.Assert(frame.State == EndEvent);
System\Xml\Xsl\XsltOld\CopyOfAction.cs (4)
44Debug.Assert(processor != null && frame != null); 49Debug.Assert(frame.NodeSet != null); 83Debug.Assert(frame.StoredOutput != null); 89Debug.Assert(frame.State == NodeSetCopied);
System\Xml\Xsl\XsltOld\DocumentScope.cs (4)
28Debug.Assert(prefix != null && prefix.Length > 0); 34Debug.Assert(scope.Uri != null); 44Debug.Assert(prefix != null && prefix.Length > 0); 50Debug.Assert(scope.Uri != null);
System\Xml\Xsl\XsltOld\ElementAction.cs (3)
70Debug.Assert(!_empty); 103Debug.Assert(processor != null && frame != null); 152Debug.Fail("Invalid ElementAction execution state");
System\Xml\Xsl\XsltOld\EndEvent.cs (1)
17Debug.Assert(nodeType != XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\ForEachAction.cs (4)
54Debug.Assert(processor != null && frame != null); 71Debug.Assert(processor.SortArray.Count != 0); 78Debug.Assert(frame.State == ProcessNextNode); 79Debug.Assert(frame.NewNodeSet != null);
System\Xml\Xsl\XsltOld\IfAction.cs (4)
65Debug.Assert(processor != null && frame != null); 72Debug.Assert(_testKey != Compiler.InvalidQueryKey); 88Debug.Assert(frame.Container != null); 96Debug.Fail("Invalid IfAction execution state");
System\Xml\Xsl\XsltOld\InputScope.cs (1)
92Debug.Assert(variable != null);
System\Xml\Xsl\XsltOld\InputScopeManager.cs (16)
32Debug.Assert(_scopeStack != null); 33Debug.Assert(_scopeStack.Parent != null); 59Debug.Assert(_scopeStack != null, "Push/Pop disbalance"); 75Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 76Debug.Assert(prefix != null); 77Debug.Assert(nspace != null); 95Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 96Debug.Assert(!string.IsNullOrEmpty(prefix)); 119Debug.Assert(prefix != null); 129Debug.Assert(prefix != null); 139Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 140Debug.Assert(nsList != null); 149Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 162Debug.Assert(_scopeStack != null, "PushScope wasn't called"); 163Debug.Assert(nsList != null); 172Debug.Assert(_scopeStack != null, "PushScope wasn't called");
System\Xml\Xsl\XsltOld\MessageAction.cs (3)
46Debug.Assert(processor != null && frame != null); 58Debug.Assert(recOutput != null); 68Debug.Fail("Invalid MessageAction execution state");
System\Xml\Xsl\XsltOld\NameSpaceEvent.cs (4)
18Debug.Assert(input != null); 19Debug.Assert(input.NodeType == XPathNodeType.Namespace); 44Debug.Assert(res); // Namespace node as any other attribute can't fail because it doesn't signal record change 46Debug.Assert(res);
System\Xml\Xsl\XsltOld\NavigatorInput.cs (2)
212Debug.Assert(navigator.NameTable != null); 237Debug.Assert(_Navigator != null);
System\Xml\Xsl\XsltOld\NavigatorOutput.cs (3)
28Debug.Assert(record != null); 40Debug.Assert(record.AttributeList[attrib] is BuilderInfo); 86Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}");
System\Xml\Xsl\XsltOld\newinstructionaction.cs (2)
51Debug.Assert(processor != null && frame != null); 72Debug.Fail("Invalid Container action execution state");
System\Xml\Xsl\XsltOld\NumberAction.cs (14)
84Debug.Assert(dblVal >= 1); 256Debug.Assert( 342Debug.Assert(nav.NodeType != XPathNodeType.Attribute && nav.NodeType != XPathNodeType.Namespace); 343Debug.Assert(MatchCountKey(processor, contextNode, nav)); 357Debug.Fail("We implementing preceding-sibling::node() and some how miss context node 'nav'"); 371Debug.Assert(!(value is int)); 394Debug.Assert(processor != null && frame != null); 399Debug.Assert(frame != null); 400Debug.Assert(frame.NodeSet != null); 445Debug.Assert(frame.StoredOutput != null); 454Debug.Fail("Invalid Number Action execution state"); 515Debug.Assert(prefix == null || prefix.isSeparator); 536Debug.Assert(thisSeparator.isSeparator); 541Debug.Assert(!thisFormat.isSeparator);
System\Xml\Xsl\XsltOld\OutKeywords.cs (3)
17Debug.Assert(nameTable != null); 115Debug.Assert(keyword != null); 116Debug.Assert((object)keyword == (object?)_NameTable.Get(keyword));
System\Xml\Xsl\XsltOld\OutputScope.cs (1)
85Debug.Assert(urn != null);
System\Xml\Xsl\XsltOld\OutputScopeManager.cs (14)
30Debug.Assert(_elementScopesStack.Peek() != null); // We adding rootElementScope to garantee this 47Debug.Assert(nameTable != null); 48Debug.Assert(atoms != null); 68Debug.Assert(prefix != null); 69Debug.Assert(nspace != null); 80Debug.Assert(name != null); 81Debug.Assert(nspace != null); 82Debug.Assert(prefix != null); 92Debug.Assert(elementScope != null); 100Debug.Assert(elementScope != null); // We're adding rootElementScope to guarantee this 115Debug.Assert(prefix != null); 135Debug.Assert(_elementScopesStack[i] is OutputScope); 152Debug.Assert(nspace != null); 155Debug.Assert(_elementScopesStack[i] is OutputScope);
System\Xml\Xsl\XsltOld\PrefixQName.cs (1)
36Debug.Assert(qname != null);
System\Xml\Xsl\XsltOld\ProcessingInstructionAction.cs (3)
61Debug.Assert(processor != null && frame != null); 88Debug.Assert(frame.StoredOutput != null); 108Debug.Fail("Invalid ElementAction execution state");
System\Xml\Xsl\XsltOld\Processor.cs (45)
127Debug.Assert(_execResult == ExecResult.Continue); 141Debug.Assert(_resolver != null, "Constructor should create it if null passed"); 150Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 201Debug.Assert(_sortArray != null, "InitSortArray() wasn't called"); 279Debug.Assert(!_stringBuilderLocked); 436Debug.Assert(_actionStack != null); 444Debug.Assert(_builder != null); 476Debug.Assert(frame != null); 505Debug.Assert(_templateLookup != null); 512Debug.Assert(key != Compiler.InvalidQueryKey); 518Debug.Assert(key != Compiler.InvalidQueryKey); 533Debug.Assert(key != Compiler.InvalidQueryKey); 602Debug.Assert(nav.NodeType == XPathNodeType.Element); 721Debug.Assert(_builder != null); 731Debug.Assert(_xsm != null); 745Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 746Debug.Assert(ExecutionResult == ExecResult.Continue); 750Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 762Debug.Fail("Unexpected result of RecordBuilder.BeginEvent()"); 774Debug.Assert(_xsm != null); 787Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 788Debug.Assert(ExecutionResult == ExecResult.Continue); 792Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 802Debug.Fail("Unexpected result of RecordBuilder.TextEvent()"); 809Debug.Assert(_xsm != null); 823Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 827Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State, 837Debug.Fail("Unexpected result of RecordBuilder.TextEvent()"); 865Debug.Fail("Invalid XPathNodeType in CopyBeginEvent"); 894Debug.Fail("Invalid XPathNodeType in CopyTextEvent"); 924Debug.Fail("Invalid XPathNodeType in CopyEndEvent"); 933Debug.Assert(navigator != null); 956Debug.Assert(output != null); 967Debug.Assert(_builder != null); 1016Debug.Assert(saveStackSize == _actionStack.Length); 1018Debug.Assert(result != null, "Variable was just calculated and result can't be null"); 1029Debug.Assert(1 < _actionStack.Length); 1042Debug.Assert(2 < _actionStack.Length); 1057Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1069Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1075Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1077Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called"); 1084Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger"); 1085Debug.Assert(2 <= _debuggerStack!.Length); 1091Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System\Xml\Xsl\XsltOld\ReaderOutput.cs (29)
43Debug.Assert(processor != null); 44Debug.Assert(processor.NameTable != null); 190Debug.Assert(ordinal >= 0); 195Debug.Assert(ordinal == -1); 205Debug.Assert(ordinal >= 0); 210Debug.Assert(ordinal == -1); 236Debug.Assert(ordinal >= 0); 242Debug.Assert(ordinal == -1); 252Debug.Assert(ordinal >= 0); 258Debug.Assert(ordinal == -1); 274Debug.Assert(_attributeCount == 0); 308Debug.Assert(_processor != null || _state == ReadState.Closed); 344Debug.Assert(Value.Length != 0, "It whould be Whitespace in this case"); 360Debug.Assert(_processor.ExecutionDone); 446Debug.Assert(_builder != null); 450Debug.Assert(NodeType == XmlNodeType.EndElement); 484Debug.Assert(_builder != null); 518Debug.Assert(_nameTable != null); 536Debug.Assert(NodeType != XmlNodeType.EntityReference); 604Debug.Assert(0 <= attrib && attrib < _attributeCount); 605Debug.Assert(0 <= attrib && attrib < _attributeList!.Count); 606Debug.Assert(_attributeList[attrib] is BuilderInfo); 617Debug.Assert(_attributeList![attrib] is BuilderInfo); 629Debug.Assert(_attributeList![index] is BuilderInfo); 649Debug.Assert(_attributeList![index] is BuilderInfo); 676Debug.Assert(_currentInfo != null); 677Debug.Assert(_attributeCount == 0 || _attributeList != null); 678Debug.Assert((_currentIndex == -1) == (_currentInfo == _mainNode)); 679Debug.Assert((_currentIndex == -1) || (_currentInfo == _attributeValue || _attributeList![_currentIndex] is BuilderInfo && _attributeList[_currentIndex] == _currentInfo));
System\Xml\Xsl\XsltOld\RecordBuilder.cs (24)
55Debug.Assert(output != null); 110Debug.Assert(_recordState != HaveRecord); 134Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 186Debug.Assert(_recordState == NoRecord || (state & StateMachine.BeginRecord) == 0); 257Debug.Assert(_attributeCount <= _attributeList.Count); 261Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 284Debug.Assert(_attributeCount == 0); 298Debug.Assert(_attributeCount == 0); 312Debug.Assert(_attributeCount == _attributeList.Count); 327Debug.Assert(_attributeList[attrib] != null && _attributeList[attrib] is BuilderInfo); 413Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 440Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 458Debug.Assert(_recordState == NoRecord || _recordState == SomeRecord); 476Debug.Assert(_mainNode != null); 487Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 491Debug.Assert(_attributeList[attr] is BuilderInfo); 512Debug.Assert(_mainNode.NodeType == XmlNodeType.Element); 562Debug.Assert(_attributeList[attr] is BuilderInfo); 614Debug.Assert(_mainNode.NodeType == XmlNodeType.Comment); 615Debug.Assert((object?)_currentInfo == (object)_mainNode); 667Debug.Assert(_mainNode.NodeType == XmlNodeType.ProcessingInstruction || _mainNode.NodeType == XmlNodeType.XmlDeclaration); 740Debug.Assert(_namespaceCount == _namespaceList.Count); 750Debug.Assert(_namespaceList[index] != null && _namespaceList[index] is BuilderInfo); 781Debug.Assert(prefix != null && prefix.Length > 0);
System\Xml\Xsl\XsltOld\RootAction.cs (6)
186Debug.Assert(mark == null); 251Debug.Assert(processor != null && frame != null); 268Debug.Assert(frame.State == QueryInitialized); 270Debug.Assert(Processor.IsRoot(frame.Node!)); 283Debug.Assert(frame.State == RootProcessed); 287Debug.Fail("Invalid RootAction execution state");
System\Xml\Xsl\XsltOld\SequentialOutput.cs (22)
109Debug.Assert(record.MainNode.NodeType == XmlNodeType.Element); 162Debug.Assert(!_isHtmlOutput || mainNode.Prefix != null, "Html can't have abbreviated elements"); 213Debug.Assert(i < node.TextInfoCount, "disableEscaping marker can't be last TextInfo record"); 232Debug.Assert(_outputDoctype, "It supposed to check this condition before actual call"); 233Debug.Assert(_output.DoctypeSystem != null || (_isHtmlOutput && _output.DoctypePublic != null), "We set outputDoctype == true only if"); 267Debug.Assert(_outputXmlDecl, "It supposed to check this condition before actual call"); 268Debug.Assert(_isXmlOutput && !_output.OmitXmlDeclaration, "We set outputXmlDecl == true only if"); 407Debug.Assert(_outputCache[record] is BuilderInfo); 436Debug.Fail("Should never get here"); 477Debug.Fail("Should never get here"); 485Debug.Fail("Should never get here"); 506Debug.Fail("Should never get here"); 536Debug.Assert(value != null); 542Debug.Assert(value != null); 574Debug.Assert(value != null); 575Debug.Assert(_isHtmlOutput); 630Debug.Assert(value != null); 631Debug.Assert(find.Length == replace.Length); 660Debug.Assert(0 <= i, "find char wasn't really find"); 681Debug.Assert(value != null); 687Debug.Assert(count <= list.Count); 690Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\SortAction.cs (2)
174Debug.Assert(processor != null && frame != null); 175Debug.Assert(frame.State == Initialized);
System\Xml\Xsl\XsltOld\StateMachine.cs (4)
100Debug.Assert(newState != Assrt); 107Debug.Assert(newState != Assrt); 119Debug.Assert(newState != Assrt); 126Debug.Assert(newState != Assrt);
System\Xml\Xsl\XsltOld\Stylesheet.cs (18)
150Debug.Assert(attributeSet.Name != null); 172Debug.Assert(_templateNameTable != null); 202Debug.Assert(_templates == null); 206Debug.Assert(manager != null); 220Debug.Assert(enumerator.Value is TemplateManager); 230Debug.Assert(_imports[importIndex] is Stylesheet); 232Debug.Assert(stylesheet != null); 283Debug.Assert(processor != null && navigator != null); 284Debug.Assert(mode != null); 296Debug.Assert(manager.Mode.Equals(mode)); 320Debug.Assert(_imports[importIndex] is Stylesheet); 322Debug.Assert(stylesheet != null); 342Debug.Assert(processor != null && navigator != null); 343Debug.Assert(_templates == null && _modeManagers == null || _templates == _modeManagers![XmlQualifiedName.Empty]); 388Debug.Assert(_imports[importIndex] is Stylesheet); 390Debug.Assert(stylesheet != null); 420Debug.Assert(_imports[importIndex] is Stylesheet); 422Debug.Assert(stylesheet != null);
System\Xml\Xsl\XsltOld\TemplateAction.cs (8)
48Debug.Assert(_templateId == 0); 96Debug.Assert(_matchKey == Compiler.InvalidQueryKey); 101Debug.Assert(_name == null); 106Debug.Assert(double.IsNaN(_priority)); 115Debug.Assert(_mode == null); 139Debug.Assert(!(union.qy2 is UnionExpr), "only qy1 can be union"); 225Debug.Assert(processor != null && frame != null); 248Debug.Fail("Invalid Container action execution state");
System\Xml\Xsl\XsltOld\TemplateLookupAction.cs (7)
25Debug.Assert(processor != null && frame != null); 26Debug.Assert(frame.State == Initialized); 59Debug.Assert(node != null); 98Debug.Assert(processor != null && frame != null); 99Debug.Assert(frame.State == Initialized); 100Debug.Assert(processor.Debugger != null); 108Debug.Assert(this.mode != Compiler.BuiltInMode);
System\Xml\Xsl\XsltOld\TemplateManager.cs (8)
22Debug.Assert(x != null && x is TemplateAction); 23Debug.Assert(y != null && y is TemplateAction); 28Debug.Assert(!double.IsNaN(tx.Priority)); 29Debug.Assert(!double.IsNaN(ty.Priority)); 33Debug.Assert(tx.TemplateId != ty.TemplateId || tx == ty); 58Debug.Assert(template != null); 59Debug.Assert( 82Debug.Assert(this.templates != null);
System\Xml\Xsl\XsltOld\TextAction.cs (2)
69Debug.Assert(processor != null && frame != null); 81Debug.Fail("Invalid execution state in TextAction");
System\Xml\Xsl\XsltOld\TextEvent.cs (2)
19Debug.Assert(text != null); 26Debug.Assert(input.NodeType == XPathNodeType.Text || input.NodeType == XPathNodeType.SignificantWhitespace);
System\Xml\Xsl\XsltOld\UseAttributeSetsAction.cs (3)
26Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); 29Debug.Assert(_useAttributeSets == null); 85Debug.Fail("Invalid Container action execution state");
System\Xml\Xsl\XsltOld\ValueOfAction.cs (11)
22Debug.Assert(s_BuiltInRule != null); 56Debug.Assert(processor != null && frame != null); 61Debug.Assert(frame != null); 62Debug.Assert(frame.NodeSet != null); 78Debug.Assert(frame.StoredOutput != null); 84Debug.Fail("Invalid ValueOfAction execution state"); 95Debug.Assert(processor != null && frame != null); 100Debug.Assert(frame != null); 101Debug.Assert(frame.NodeSet != null); 117Debug.Assert(frame.StoredOutput != null); 123Debug.Fail("Invalid BuiltInRuleTextAction execution state");
System\Xml\Xsl\XsltOld\VariableAction.cs (5)
98Debug.Assert(this.name == null && this.nameStr == null); 116Debug.Assert(processor != null && frame != null && frame.State != ValueCalculated); 169Debug.Assert(recOutput is NavigatorOutput); 174Debug.Assert(value != null); 180Debug.Fail("Invalid execution state inside VariableAction.Execute");
System\Xml\Xsl\XsltOld\WithParamAction.cs (3)
34Debug.Assert(processor != null && frame != null); 61Debug.Assert(recOutput is NavigatorOutput); 66Debug.Fail("Invalid execution state inside VariableAction.Execute");
System\Xml\Xsl\XsltOld\WriterOutput.cs (4)
46Debug.Fail("XSLT never gives us CDATA"); 75Debug.Fail($"Invalid NodeType on output: {mainNode.NodeType}"); 91Debug.Assert(list.Count >= count); 94Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (11)
255Debug.Assert(thisUri != null && baseUri != null); 329Debug.Assert( 344Debug.Assert( 656Debug.Assert(it != null); 736Debug.Fail("unexpected XPath type"); 920Debug.Assert(resultCollection.Count != 0); 921Debug.Assert(newList.Count != 0); 925Debug.Assert(resultCollection[0] is XPathNavigator); 962Debug.Assert(extension != null); 963Debug.Assert(method != null); 995Debug.Assert(args.Length <= this.Minargs, "We are checking this on resolve time");
System\Xml\Xsl\XsltOld\XsltOutput.cs (2)
147Debug.Assert(_encoding != null); 219Debug.Fail("Override invoked");
System\Xml\Xslt\XslTransform.cs (6)
112Debug.Assert(_QueryStore != null); 113Debug.Assert(_RootAction != null); 245Debug.Assert(stylesheet != null); 251Debug.Assert(compiler.CompiledStylesheet != null); 252Debug.Assert(compiler.QueryStore != null); 253Debug.Assert(compiler.RootAction != null);
System.Private.Xml.Linq (33)
src\runtime\src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System\Xml\Linq\XContainer.cs (4)
8using Debug = System.Diagnostics.Debug; 1059Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1175Debug.Assert(e != null, "EndElement received but the current container is not an element."); 1247Debug.Assert(content != null);
System\Xml\Linq\XElement.cs (1)
1982Debug.Assert(e != null);
System\Xml\Linq\XHashtable.cs (6)
7using Debug = System.Diagnostics.Debug; 147Debug.Assert(BitOperations.IsPow2(capacity), "capacity must be a power of 2"); 148Debug.Assert(extractKey != null, "extractKey may not be null"); 200Debug.Assert(entryIdx == EndOfList, "Resize() should only be called by one thread"); 232Debug.Assert(entryIdx == FullList, "Linked list should have been closed when it was counted"); 398Debug.Assert(key != null, "key should have been checked previously for null");
System\Xml\Linq\XHelper.cs (2)
5using Debug = System.Diagnostics.Debug; 13Debug.Assert(type != null);
System\Xml\Linq\XNamespace.cs (6)
5using Debug = System.Diagnostics.Debug; 217Debug.Assert(index >= 0 && index <= localName.Length, "Caller should have checked that index was in bounds"); 218Debug.Assert(count >= 0 && index + count <= localName.Length, "Caller should have checked that count was in bounds"); 235Debug.Assert(index >= 0 && index <= namespaceName.Length, "Caller should have checked that index was in bounds"); 236Debug.Assert(count >= 0 && index + count <= namespaceName.Length, "Caller should have checked that count was in bounds"); 274Debug.Assert(n != null, "Null name should never exist here");
System\Xml\Linq\XNode.cs (1)
62Debug.Assert(parent.content != null);
System\Xml\Linq\XNodeReader.cs (2)
4using Debug = System.Diagnostics.Debug; 1386Debug.Assert(_omitDuplicateNamespaces, "This method should only be called if we're omitting duplicate namespace attribute. For perf reason it's better to test this flag in the caller method.");
System\Xml\Linq\XObject.cs (2)
6using Debug = System.Diagnostics.Debug; 144Debug.Assert(type != null);
System\Xml\Schema\XNodeValidator.cs (6)
95Debug.Assert(sa.AttributeSchemaType != null); 98Debug.Assert(st.Datatype != null); 102Debug.Assert(st.Content != null); 108Debug.Assert(mt.Datatype != null); 109Debug.Assert(value != null); 313Debug.Assert(si.SchemaElement != null);
System\Xml\XPath\XNodeNavigator.cs (2)
883Debug.Assert(navigator.UnderlyingObject != null); 1032System.Diagnostics.Debug.Fail("Parent node doesn't contain itself.");
System.Reflection.Context (72)
System\Reflection\Context\Custom\AttributeUtils.cs (2)
156Debug.Assert(attributeFilterType.IsInstanceOfType(newAttribute)); 162Debug.Assert(attributeFilterType.IsAssignableFrom(attributeType));
System\Reflection\Context\Custom\CustomType.cs (2)
263Debug.Assert(types == null || types.Length == 0); 275Debug.Assert(getPropertySetter && types != null && types.Length == 1);
System\Reflection\Context\CustomReflectionContext.Projector.cs (16)
27Debug.Assert(ReflectionContext.SourceContext != null); 40Debug.Assert(ReflectionContext.SourceContext != null); 55Debug.Assert(NeedsProjection(value)); 66Debug.Assert(NeedsProjection(value)); 77Debug.Assert(NeedsProjection(value)); 88Debug.Assert(NeedsProjection(value)); 99Debug.Assert(NeedsProjection(value)); 110Debug.Assert(NeedsProjection(value)); 121Debug.Assert(NeedsProjection(value)); 149Debug.Assert(NeedsProjection(value)); 160Debug.Assert(NeedsProjection(value)); 171Debug.Assert(NeedsProjection(value)); 182Debug.Assert(NeedsProjection(value)); 193Debug.Assert(NeedsProjection(value)); 204Debug.Assert(NeedsProjection(value)); 215Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Delegation\DelegatingAssembly.cs (1)
20Debug.Assert(null != assembly);
System\Reflection\Context\Delegation\DelegatingConstructorInfo.cs (1)
14Debug.Assert(null != constructor);
System\Reflection\Context\Delegation\DelegatingCustomAttributeData.cs (1)
13Debug.Assert(null != attribute);
System\Reflection\Context\Delegation\DelegatingEventInfo.cs (1)
13Debug.Assert(null != @event);
System\Reflection\Context\Delegation\DelegatingExceptionHandlingClause.cs (1)
14Debug.Assert(clause != null);
System\Reflection\Context\Delegation\DelegatingFieldInfo.cs (1)
14Debug.Assert(null != field);
System\Reflection\Context\Delegation\DelegatingLocalVariableInfo.cs (1)
12Debug.Assert(variable != null);
System\Reflection\Context\Delegation\DelegatingManifestResourceInfo.cs (1)
13Debug.Assert(null != resource);
System\Reflection\Context\Delegation\DelegatingMethodBody.cs (1)
15Debug.Assert(null != body);
System\Reflection\Context\Delegation\DelegatingMethodInfo.cs (1)
16Debug.Assert(null != method);
System\Reflection\Context\Delegation\DelegatingModule.cs (1)
14Debug.Assert(null != module);
System\Reflection\Context\Delegation\DelegatingParameterInfo.cs (1)
13Debug.Assert(null != parameter);
System\Reflection\Context\Delegation\DelegatingPropertyInfo.cs (1)
14Debug.Assert(null != property);
System\Reflection\Context\Delegation\DelegatingType.cs (2)
18Debug.Assert(null != type); 398Debug.Assert(bindingAttr == (BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public));
System\Reflection\Context\Projection\ProjectingAssembly.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingConstructorInfo.cs (1)
16Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingCustomAttributeData.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingEventInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingExceptionHandlingClause.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingFieldInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingLocalVariableInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingManifestResourceInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodBody.cs (1)
18Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingMethodInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingModule.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingParameterInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingPropertyInfo.cs (1)
17Debug.Assert(null != projector);
System\Reflection\Context\Projection\ProjectingType.cs (2)
19Debug.Assert(null != projector); 255Debug.Assert(i == members.Length);
System\Reflection\Context\Projection\Projector.cs (5)
37Debug.Assert(!(value is IProjectable) || ((IProjectable)value).Projector != this); 107Debug.Assert(value != null); 125Debug.Assert(null != project); 126Debug.Assert(values != null && values.Count > 0); 134Debug.Assert(NeedsProjection(value));
System\Reflection\Context\Virtual\InheritedMethodInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseMethod.DeclaringType!)); 20Debug.Assert(baseMethod is VirtualMethodBase); 23Debug.Assert(baseMethod.ReflectedType!.Equals(baseMethod.DeclaringType));
System\Reflection\Context\Virtual\InheritedPropertyInfo.cs (4)
18Debug.Assert(reflectedType != null); 19Debug.Assert(reflectedType.IsSubclassOf(baseProperty.DeclaringType!)); 20Debug.Assert(baseProperty is VirtualPropertyBase); 23Debug.Assert(baseProperty.ReflectedType!.Equals(baseProperty.DeclaringType));
System\Reflection\Context\Virtual\VirtualParameter.cs (1)
16Debug.Assert(position >= -1);
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
28Debug.Assert(context != null); 87Debug.Assert(getMethod != null || setMethod != null); 218Debug.Assert(null != method);
System\Reflection\Context\Virtual\VirtualPropertyBase.FuncPropertyAccessorBase.cs (1)
14Debug.Assert(null != declaringProperty);
System\Reflection\Context\Virtual\VirtualPropertyInfo.cs (2)
47Debug.Assert(_getter == null || _getter.IsPublic); 54Debug.Assert(_setter == null || _setter.IsPublic);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertyGetter.cs (1)
21Debug.Assert(null != getter);
System\Reflection\Context\Virtual\VirtualPropertyInfo.PropertySetter.cs (1)
22Debug.Assert(null != setter);
System.Reflection.DispatchProxy (11)
System\Reflection\DispatchProxyGenerator.cs (11)
68Debug.Assert(baseType != null); 69Debug.Assert(interfaceType != null); 72Debug.Assert(alc != null); 302Debug.Assert(baseCtor != null); 411Debug.Assert(ei.EventHandlerType != null); 629Debug.Assert(!target.IsByRef); 635Debug.Assert(!isAddress); 646Debug.Assert(!opCode.Equals(OpCodes.Nop)); 651Debug.Assert(source.IsAssignableFrom(target)); 668Debug.Assert(source.IsAssignableFrom(target) || target.IsInterface || source.IsInterface); 728Debug.Assert(_paramTypes[i].IsByRef);
System.Reflection.Emit (31)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Reflection\Emit\TypeNameBuilder.cs (6)
37Debug.Assert(_instNesting != 0); 53Debug.Assert(_instNesting != 0); 69Debug.Assert(_instNesting != 0); 81Debug.Assert(name != null); 93Debug.Assert(rank > 0); 134Debug.Assert(_instNesting == 0);
System\Reflection\Emit\FieldBuilderImpl.cs (1)
59Debug.Assert(binaryAttribute.Length >= 6);
System\Reflection\Emit\ILGeneratorImpl.cs (5)
434Debug.Assert(opcode.Equals(OpCodes.Call) || 443Debug.Assert(opcode.Equals(OpCodes.Call) || 482Debug.Assert(labelStartDepth >= -1); 483Debug.Assert(targetDepth >= -1); 579Debug.Assert(opcode.Equals(OpCodes.Calli), "Unexpected opcode encountered for StackBehaviour VarPop.");
System\Reflection\Emit\ModuleBuilderImpl.cs (9)
157Debug.Assert(typeBuilder._handle.Equals(typeHandle)); 369Debug.Assert(method._handle == handle); 499Debug.Assert(previousNonHiddenStartColumn < 0); 577Debug.Assert(deltaLines != 0 || deltaColumns != 0 || sequencePoint.IsHidden); 587Debug.Assert(deltaLines > 0); 640Debug.Assert(field._handle == handle); 991Debug.Assert(tb.IsCreated()); 998Debug.Assert(eb._typeBuilder.IsCreated()); 1382Debug.Assert(blobBuilder.ToArray()[0] == (byte)SignatureTypeCode.FunctionPointer);
System\Reflection\Emit\PseudoCustomAttributesData.cs (10)
151Debug.Assert(_marshalArrayElementCount >= 0); 181Debug.Assert(_marshalArrayElementType >= 0); 241Debug.Assert(parameterIndex == null || parameterIndex >= 0 && parameterIndex <= MaxMarshalInteger); 249Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 250Debug.Assert(parameterIndex == null || parameterIndex >= 0); 260Debug.Assert(elementCount == null || elementCount >= 0 && elementCount <= MaxMarshalInteger); 261Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 270Debug.Assert(elementType == null || elementType >= 0 && (int)elementType <= MaxMarshalInteger); 279Debug.Assert(elementCount >= 0 && elementCount <= MaxMarshalInteger); 287Debug.Assert(type >= 0 && (int)type <= MaxMarshalInteger);
System.Reflection.Metadata (319)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
23Debug.Assert(name.Length != 0);
src\runtime\src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
66Debug.Assert(input.Length > 0);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Reflection\Internal\MemoryBlocks\ByteArrayMemoryProvider.cs (2)
19Debug.Assert(!array.IsDefault); 25Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\ExternalMemoryBlockProvider.cs (1)
38Debug.Assert(disposing);
System\Reflection\Internal\MemoryBlocks\StreamMemoryBlockProvider.cs (2)
40Debug.Assert(stream.CanSeek && stream.CanRead); 51Debug.Assert(disposing);
System\Reflection\Internal\Utilities\BitArithmetic.cs (3)
13Debug.Assert(BitOperations.PopCount(alignment) == 1); 26Debug.Assert(position >= 0 && alignment > 0); 27Debug.Assert(BitOperations.PopCount((uint)alignment) == 1);
System\Reflection\Internal\Utilities\BlobUtilities.cs (6)
15Debug.Assert(buffer.Length > 0); 61Debug.Assert(written); 66Debug.Assert(byteCount >= charCount); 78Debug.Assert(*charPtr <= 0x7f); 132Debug.Assert(ptr == bufferPtr + start + byteCount); 133Debug.Assert(charPtr == strEnd);
System\Reflection\Internal\Utilities\EncodingHelper.cs (2)
19Debug.Assert(utf8Decoder != null); 36Debug.Assert(utf8Decoder != null);
System\Reflection\Internal\Utilities\MemoryBlock.cs (9)
21Debug.Assert(length >= 0 && (buffer != null || length == 0)); 297Debug.Assert(terminator <= 0x7F); 316Debug.Assert(terminator <= 0x7f); 338Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 377Debug.Assert(result == FastComparisonResult.Inconclusive); 397Debug.Assert(terminator <= 0x7F); 460Debug.Assert(asciiPrefix[i] > 0 && asciiPrefix[i] <= 0x7f); 484Debug.Assert(asciiString[i] > 0 && asciiString[i] <= 0x7f); 848Debug.Assert(i == result.Length);
System\Reflection\Internal\Utilities\PooledStringBuilder.cs (2)
24Debug.Assert(pool != null); 67Debug.Assert(builder.Builder.Length == 0);
System\Reflection\Internal\Utilities\StreamExtensions.cs (1)
30Debug.Assert(count > 0);
System\Reflection\Metadata\BlobBuilder.cs (18)
124Debug.Assert(_buffer != null); 125Debug.Assert(Length >= 0 && Length <= _buffer.Length); 126Debug.Assert(_nextOrPrevious != null); 130Debug.Assert(_previousLengthOrFrozenSuffixLengthDelta >= 0); 136Debug.Assert(chunk.IsHead || chunk.Length > 0); 140Debug.Assert(totalLength == Count); 150Debug.Assert(IsHead); 155Debug.Assert(IsHead); 231Debug.Assert(leftStart == 0 || rightStart == 0); 283Debug.Assert(bufferStart >= chunkStart); 288Debug.Assert(bytesToCopy >= 0); 302Debug.Assert(bufferStart == bufferEnd); 603Debug.Assert(byteCount >= 0); 622Debug.Assert(byteCount <= MinChunkSize); 951Debug.Assert(unchecked((ushort)reference) == reference); 1083Debug.Assert(start >= 0); 1084Debug.Assert(length >= 0); 1085Debug.Assert(start + length <= str.Length);
System\Reflection\Metadata\BlobBuilder.Enumerators.cs (1)
22Debug.Assert(builder.IsHead);
System\Reflection\Metadata\BlobReader.cs (4)
40Debug.Assert(block.Length >= 0 && (block.Pointer != null || block.Length == 0)); 137Debug.Assert((alignment & (alignment - 1)) == 0, "Alignment must be a power of two."); 138Debug.Assert(remainder >= 0 && remainder < alignment); 514Debug.Assert(bytesRead == 4);
System\Reflection\Metadata\BlobWriter.cs (5)
41Debug.Assert(buffer != null); 42Debug.Assert(count >= 0); 43Debug.Assert(count <= buffer.Length - start); 110Debug.Assert(value >= 0); 360Debug.Assert(unchecked((ushort)reference) == reference);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
20Debug.Assert(value <= MaxCompressedIntegerValue);
System\Reflection\Metadata\Ecma335\BlobDictionary.cs (1)
58Debug.Assert(immutableKey.AsSpan().SequenceEqual(key));
System\Reflection\Metadata\Ecma335\Encoding\ControlFlowBuilder.cs (9)
119Debug.Assert(operandOffset >= 0); 120Debug.Assert(_branches.Count == 0 || operandOffset > _branches[_branches.Count - 1].OperandOffset); 126Debug.Assert(opCode.GetBranchOperandSize() == 1); 129Debug.Assert(opCode == ILOpCode.Switch || opCode.GetBranchOperandSize() == 4); 132Debug.Assert(instructionEndDisplacement > 4 && instructionEndDisplacement % 4 == 0 && opCode == ILOpCode.Switch); 141Debug.Assert(ilOffset >= 0); 295Debug.Assert(srcBlobOffset == 0); 316Debug.Assert( 404Debug.Assert(_lazyExceptionHandlers != null);
System\Reflection\Metadata\Ecma335\Encoding\ExceptionRegionEncoder.cs (2)
82Debug.Assert(exceptionRegionCount > 0); 99Debug.Assert(dataSize <= 0x00ffffff);
System\Reflection\Metadata\Ecma335\Encoding\LabelHandle.cs (1)
18Debug.Assert(id >= 1);
System\Reflection\Metadata\Ecma335\Encoding\SwitchInstructionEncoder.cs (1)
22Debug.Assert(encoder.ControlFlowBuilder is not null);
System\Reflection\Metadata\Ecma335\MetadataAggregator.cs (3)
68Debug.Assert(baseTableRowCounts != null); 272Debug.Assert(sizes[generation] == size); 305Debug.Assert(sizes[generation].AggregateInserts == rowId);
System\Reflection\Metadata\Ecma335\MetadataBuilder.cs (5)
17Debug.Assert(HeapIndex.UserString == 0); 18Debug.Assert((int)HeapIndex.String == 1); 19Debug.Assert((int)HeapIndex.Blob == 2); 20Debug.Assert((int)HeapIndex.Guid == 3); 94Debug.Assert(endOffset - startOffset == sizes.MetadataHeaderSize);
System\Reflection\Metadata\Ecma335\MetadataBuilder.Tables.cs (2)
1872Debug.Assert(metadataSizes.MetadataTableStreamSize == endPosition - startPosition); 1919Debug.Assert(metadataSizes.CalculateTableStreamHeaderSize() == endPosition - startPosition);
System\Reflection\Metadata\Ecma335\MetadataReaderExtensions.cs (2)
126Debug.Assert(reader != null); 227Debug.Assert(reader != null);
System\Reflection\Metadata\Ecma335\MetadataRootBuilder.cs (1)
62Debug.Assert(Encoding.UTF8.GetByteCount(DefaultMetadataVersionString) == DefaultMetadataVersionString.Length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (18)
128Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 130Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount); 156Debug.Assert((PresentTablesMask & ExternalTablesMask) == 0); 276Debug.Assert(rowCounts[(int)TableIndex.FieldPtr] == 0); 278Debug.Assert(rowCounts[(int)TableIndex.MethodPtr] == 0); 280Debug.Assert(rowCounts[(int)TableIndex.ParamPtr] == 0); 292Debug.Assert(rowCounts[(int)TableIndex.EventPtr] == 0); 295Debug.Assert(rowCounts[(int)TableIndex.PropertyPtr] == 0); 306Debug.Assert(rowCounts[(int)TableIndex.AssemblyProcessor] == 0); 307Debug.Assert(rowCounts[(int)TableIndex.AssemblyOS] == 0); 309Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefProcessor] == 0); 310Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefOS] == 0); 363Debug.Assert(RegularStreamHeaderSizes == 370Debug.Assert(EncDeltaMarkerStreamHeaderSize == GetMetadataStreamHeaderSize("#JTD"u8)); 371Debug.Assert(StandalonePdbStreamHeaderSize == GetMetadataStreamHeaderSize("#Pdb"u8)); 446Debug.Assert(result % StreamAlignment == 0); 481Debug.Assert(RowCounts[(int)table] == 0 || ExternalRowCounts[(int)table] == 0);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (3)
64Debug.Assert(Encoding.UTF8.GetByteCount(MetadataVersion) == MetadataVersion.Length); 117Debug.Assert(_serializedMetadata.Sizes.CalculateStandalonePdbStreamSize() == endPosition - startPosition); 151Debug.Assert(idWriter.RemainingBytes == 0);
System\Reflection\Metadata\Ecma335\SignatureDecoder.cs (1)
323Debug.Assert(handle.IsNil); // will fall through to throw in release.
System\Reflection\Metadata\EntityHandle.cs (1)
93Debug.Assert(!IsVirtual);
System\Reflection\Metadata\Handle.cs (9)
38Debug.Assert(value >= 0); 45Debug.Assert(IsHeapHandle && value <= HeapHandleType.OffsetMask || 54Debug.Assert(!IsHeapHandle); 64Debug.Assert(IsHeapHandle); 92Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 104Debug.Assert((_value & TokenTypeIds.RIDMask) == _value); 155Debug.Assert(IsEntityOrUserStringHandle); 156Debug.Assert(!IsVirtual); 157Debug.Assert((_value & TokenTypeIds.RIDMask) == _value);
System\Reflection\Metadata\IL\MethodBodyBlock.cs (1)
29Debug.Assert(!exceptionRegions.IsDefault);
System\Reflection\Metadata\Internal\MetadataWriterUtilities.cs (1)
19Debug.Assert(!value.GetType().GetTypeInfo().IsEnum);
System\Reflection\Metadata\Internal\NamespaceCache.cs (14)
21Debug.Assert(reader != null); 36Debug.Assert(!handle.HasFullName); // we should not hit the cache in this case. 44Debug.Assert(_rootNamespace != null); 78Debug.Assert(!handleContainingSegment.IsVirtual); 93Debug.Assert(lastFoundIndex >= 0 || currentSegment == 0); 178Debug.Assert(data.Namespaces!.Count == 0); 208Debug.Assert(realChild.HasFullName); 222Debug.Assert(child != null && parent != null); 223Debug.Assert(!child.Handle.IsNil); 236Debug.Assert(realChild.Handle.HasFullName); 316Debug.Assert(table != null); 348Debug.Assert(table != null); 366Debug.Assert(namespaceHandle.HasFullName); 386Debug.Assert(_namespaceTable != null);
System\Reflection\Metadata\Internal\StringHeap.cs (15)
116Debug.Assert(s_virtualValues[i] != null, $"Missing virtual value for StringHandle.VirtualIndex.{(StringHandle.VirtualIndex)i}"); 164Debug.Assert(handle.StringKind != StringKind.Virtual); 172Debug.Assert(handle.StringKind != StringKind.Virtual); 183Debug.Assert(handle.StringKind != StringKind.Virtual); 194Debug.Assert(handle.IsVirtual); 206Debug.Assert(handle.IsVirtual); 249Debug.Assert(value != null); 268Debug.Assert(value != null); 290Debug.Assert(!rawHandle.IsVirtual); 291Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 300Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 309Debug.Assert(!rawHandle.IsVirtual); 310Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported"); 319Debug.Assert(!rawHandle.IsVirtual); 320Debug.Assert(rawHandle.StringKind != StringKind.DotTerminated, "Not supported");
System\Reflection\Metadata\Internal\Tables.cs (11)
44Debug.Assert(NumberOfRows > 0); 50Debug.Assert(NumberOfRows > 0); 56Debug.Assert(NumberOfRows > 0); 62Debug.Assert(NumberOfRows > 0); 68Debug.Assert(NumberOfRows > 0); 1955Debug.Assert(NumberOfRows == 1); 1961Debug.Assert(NumberOfRows == 1); 1971Debug.Assert(NumberOfRows == 1); 1977Debug.Assert(NumberOfRows == 1); 1983Debug.Assert(NumberOfRows == 1); 1989Debug.Assert(NumberOfRows == 1);
System\Reflection\Metadata\MetadataReader.cs (5)
129Debug.Assert(AssemblyTable.NumberOfRows <= 1); 787Debug.Assert(local.Length == external.Length); 1448Debug.Assert(!enclosingClass.IsNil); 1462Debug.Assert(builder == groupedNestedTypes[enclosingClass]); 1485Debug.Assert(_lazyNestedTypesMap != null);
System\Reflection\Metadata\MetadataReader.WinMD.cs (10)
96Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 102Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 108Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 114Debug.Assert(s_projectionInfos != null && projectionIndex >= 0 && projectionIndex < s_projectionInfos.Length); 187Debug.Assert(k == keys.Length && v == keys.Length && k == v); 200Debug.Assert(string.CompareOrdinal(keys[i], keys[i + 1]) < 0); 223Debug.Assert(_metadataKind != MetadataKind.Ecma335); 320Debug.Assert(_metadataKind != MetadataKind.Ecma335); 513Debug.Assert(!namespaceHandle.IsVirtual && !nameHandle.IsVirtual); 667Debug.Assert(_metadataKind != MetadataKind.Ecma335);
System\Reflection\Metadata\MetadataReaderProvider.cs (2)
35Debug.Assert(metadataBlock != null); 41Debug.Assert(blockProvider != null);
System\Reflection\Metadata\MetadataStringComparer.cs (1)
54Debug.Assert(reader != null);
System\Reflection\Metadata\MetadataStringDecoder.cs (1)
70Debug.Assert(Encoding != null);
System\Reflection\Metadata\PortablePdb\DocumentNameBlobHandle.cs (1)
28Debug.Assert(HeapHandleType.IsValidHeapOffset((uint)heapOffset));
System\Reflection\Metadata\PortablePdb\HandleCollections.Debug.cs (8)
20Debug.Assert(reader != null); 119Debug.Assert(reader != null); 218Debug.Assert(reader != null); 426Debug.Assert(reader != null); 532Debug.Assert(reader != null); 638Debug.Assert(reader != null); 737Debug.Assert(reader != null); 746Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\Handles.Debug.cs (7)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 196Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 279Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId));
System\Reflection\Metadata\PortablePdb\ImportDefinition.cs (1)
24Debug.Assert(
System\Reflection\Metadata\PortablePdb\SequencePointCollection.cs (1)
101Debug.Assert(_previousNonHiddenStartColumn == 0);
System\Reflection\Metadata\TypeName.cs (3)
231Debug.Fail("Pre-allocated full name should have been provided in the ctor"); 345Debug.Assert(_fullName is not null); 391Debug.Assert(rootTypeName._fullName is not null);
System\Reflection\Metadata\TypeNameParser.cs (2)
64Debug.Assert(parsedName.GetNodeCount() == recursiveDepth, $"Node count mismatch for '{typeName.ToString()}'"); 275Debug.Assert(nestedNameLength > 0, "TryGetTypeNameInfo should return error on zero lengths");
System\Reflection\Metadata\TypeNameParserHelpers.cs (1)
180Debug.Assert(rankOrModifier >= 2);
System\Reflection\Metadata\TypeSystem\AssemblyDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (1)
169Debug.Fail("Unexpected virtual index value");
System\Reflection\Metadata\TypeSystem\CustomAttribute.cs (1)
138Debug.Fail($"Unexpected treatment {treatment}");
System\Reflection\Metadata\TypeSystem\HandleCollections.TypeSystem.cs (23)
237Debug.Assert(reader != null); 245Debug.Assert(reader != null); 357Debug.Assert(reader != null); 365Debug.Assert(reader != null); 366Debug.Assert(!handle.IsNil); 464Debug.Assert(reader != null); 472Debug.Assert(reader != null); 473Debug.Assert(!containingType.IsNil); 584Debug.Assert(reader != null); 592Debug.Assert(reader != null); 593Debug.Assert(!containingType.IsNil); 704Debug.Assert(reader != null); 712Debug.Assert(reader != null); 713Debug.Assert(!containingType.IsNil); 824Debug.Assert(reader != null); 832Debug.Assert(reader != null); 833Debug.Assert(!containingType.IsNil); 942Debug.Assert(reader != null); 1047Debug.Assert(reader != null); 1048Debug.Assert(!containingMethod.IsNil); 1159Debug.Assert(reader != null); 1160Debug.Assert(!implementingType.IsNil); 1660Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\Handles.TypeSystem.cs (43)
19Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 102Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 185Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 268Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 363Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 446Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 529Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 612Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 695Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 778Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 861Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 944Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1027Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1110Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1193Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1276Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1359Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1442Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1525Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1630Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1636Debug.Assert(virtualIndex < VirtualIndex.Count); 1726Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1809Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1892Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1975Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2058Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2150Debug.Assert((offset & 0xFF000000) == 0); 2300Debug.Assert((value & StringHandleType.TypeMask) == StringHandleType.String || 2315Debug.Assert(virtualIndex < VirtualIndex.Count); 2326Debug.Assert(StringKind == StringKind.Plain); 2332Debug.Assert(StringKind == StringKind.Plain); 2338Debug.Assert(StringKind == StringKind.Plain); 2339Debug.Assert(prefixByteLength >= 0); 2384Debug.Assert(!IsVirtual || StringKind == StringKind.WinRTPrefixed); 2390Debug.Assert(IsVirtual && StringKind != StringKind.WinRTPrefixed); 2396Debug.Assert(IsNil || IsVirtual && StringKind == StringKind.Virtual); 2463Debug.Assert(virtualIndex != 0); 2508Debug.Assert(!IsVirtual); 2519Debug.Assert(HasFullName); 2589Debug.Assert(virtualIndex < VirtualIndex.Count); 2597Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4); 2631Debug.Assert(!IsVirtual); 2637Debug.Assert(IsVirtual);
System\Reflection\Metadata\TypeSystem\ModuleDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\NamespaceDefinition.cs (1)
16Debug.Assert(data != null);
System\Reflection\Metadata\TypeSystem\TypeReference.cs (2)
109Debug.Fail("Unknown TypeRef treatment"); 137Debug.Fail("Unknown TypeRef treatment");
System\Reflection\PortableExecutable\DebugDirectory\CodeViewDebugDirectoryData.cs (1)
27Debug.Assert(path != null);
System\Reflection\PortableExecutable\DebugDirectory\PdbChecksumDebugDirectoryData.cs (2)
23Debug.Assert(!string.IsNullOrEmpty(algorithmName)); 24Debug.Assert(!checksum.IsDefaultOrEmpty);
System\Reflection\PortableExecutable\ManagedPEBuilder.cs (2)
187Debug.Assert(_nativeResourcesOpt != null); 207Debug.Assert(builder.Count == 0);
System\Reflection\PortableExecutable\ManagedTextSection.cs (12)
246Debug.Assert(builder.Count == 0); 247Debug.Assert(metadataBuilder.Count == MetadataSize); 248Debug.Assert(metadataBuilder.Count % 4 == 0); 249Debug.Assert(ilBuilder.Count == ILStreamSize); 250Debug.Assert((mappedFieldDataBuilderOpt?.Count ?? 0) == MappedFieldDataSize); 251Debug.Assert((resourceBuilderOpt?.Count ?? 0) == ResourceDataSize); 303Debug.Assert(builder.Count == ComputeSizeOfTextSection()); 325Debug.Assert(builder.Count - start == SizeOfImportAddressTable); 362Debug.Assert(builder.Count - start == SizeOfImportTable); 372Debug.Assert(builder.Count - start == SizeOfNameTable); 427Debug.Assert(builder.Count - start == CorHeaderSize); 428Debug.Assert(builder.Count % 4 == 0);
System\Reflection\PortableExecutable\PEBinaryReader.cs (4)
28Debug.Assert(size >= 0 && size <= (stream.Length - stream.Position)); 112Debug.Assert(count <= sizeof(long)); // Error message assumes we're trying to read constant small number of bytes. 113Debug.Assert(_reader.BaseStream.Position >= 0 && _maxOffset >= 0); 124Debug.Assert(startPosition >= 0 && _maxOffset >= 0);
System\Reflection\PortableExecutable\PEBuilder.cs (3)
119Debug.Assert(stampWriter.RemainingBytes == 0); 473Debug.Assert(peImage != null); 474Debug.Assert(signatureProvider != null);
System\Reflection\PortableExecutable\PEHeader.cs (1)
307Debug.Assert(magic == PEMagic.PE32);
System\Reflection\PortableExecutable\PEMemoryBlock.cs (2)
19Debug.Assert(block != null); 20Debug.Assert(offset >= 0 && offset <= block.Size);
System\Reflection\PortableExecutable\PEReader.cs (4)
320Debug.Assert(imageStart >= 0 && imageStart <= stream.Length); 381Debug.Assert(index >= 0 && index < PEHeaders.SectionHeaders.Length); 537Debug.Assert(PEHeaders.PEHeader != null); 761Debug.Assert(errorToReport is BadImageFormatException || errorToReport is IOException);
System.Reflection.MetadataLoadContext (153)
System\CoreRtBridge.cs (1)
21Debug.Assert(t.IsGenericTypeDefinition);
System\Reflection\DefaultBinder.cs (1)
234Debug.Assert(returnType != null);
System\Reflection\MetadataLoadContext.Resolving.cs (3)
27Debug.Assert(refName != null); 48Debug.Assert(refName != null); 59Debug.Assert(refName != null);
System\Reflection\PathAssemblyResolver.cs (1)
56Debug.Assert(assemblyName.Name != null);
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (2)
22Debug.Assert(reflectedType.Equals(type)); // Constructor queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type. 53Debug.Fail("This code path should be unreachable.");
System\Reflection\Runtime\BindingFlagSupport\MemberPolicies.cs (1)
221Debug.Fail("Unknown MemberInfo type.");
System\Reflection\Runtime\BindingFlagSupport\NestedTypePolicies.cs (1)
28Debug.Assert(reflectedType.Equals(type)); // NestedType queries are always performed as if BindingFlags.DeclaredOnly are set so the reflectedType should always be the declaring type.
System\Reflection\Runtime\BindingFlagSupport\QueriedMemberList.cs (6)
70Debug.Assert(index >= 0 && index < _totalCount); 78Debug.Assert(index >= 0 && index < _totalCount); 174Debug.Assert((allFlagsThatMustMatch & ~validBits) == 0); 175Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Public) == 0) != ((allFlagsThatMustMatch & BindingFlags.NonPublic) == 0)); 176Debug.Assert(((allFlagsThatMustMatch & BindingFlags.Instance) == 0) != ((allFlagsThatMustMatch & BindingFlags.Static) == 0)); 177Debug.Assert((allFlagsThatMustMatch & BindingFlags.FlattenHierarchy) == 0 || (allFlagsThatMustMatch & BindingFlags.Static) != 0);
System\Reflection\Runtime\BindingFlagSupport\Shared.cs (2)
25Debug.Assert(methodBase != null); 26Debug.Assert(argumentTypes != null);
System\Reflection\Runtime\General\ListBuilder.cs (2)
28Debug.Assert(index < Count); 38Debug.Assert(!_toArrayAlreadyCalled, "Cannot call ListBuilder.ToArray() a second time. Copy the one you already got.");
System\Reflection\Runtime\SignatureTypeExtensions.cs (3)
35Debug.Assert(pattern.IsSignatureType); 107Debug.Assert(signatureType.IsSignatureType); 113Debug.Assert(signatureType.IsSignatureType);
System\Reflection\TypeLoading\Assemblies\AssemblyFileInfo.cs (1)
16Debug.Assert(name != null);
System\Reflection\TypeLoading\Assemblies\Ecma\EcmaAssembly.cs (4)
22Debug.Assert(loader != null); 23Debug.Assert(peReader != null); 24Debug.Assert(reader != null); 25Debug.Assert(location != null);
System\Reflection\TypeLoading\Assemblies\RoAssembly.GetForwardedTypes.cs (1)
38Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
System\Reflection\TypeLoading\Assemblies\RoAssembly.Modules.cs (1)
108Debug.Assert(afi.RowIndex != 0); // Since we excluded the manifest module from the search.
System\Reflection\TypeLoading\Constructors\RoDefinitionConstructor.cs (2)
21Debug.Assert(declaringType != null); 51Debug.Assert(ReflectedType == other.ReflectedType);
System\Reflection\TypeLoading\Constructors\RoSyntheticConstructor.cs (1)
23Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\CustomAttributes\Ecma\EcmaCustomAttributeHelpers.cs (1)
166Debug.Fail("Invalid CustomAttributeNamedArgumentKind value: " + cang.Kind);
System\Reflection\TypeLoading\Events\Ecma\EcmaEvent.cs (4)
24Debug.Assert(!handle.IsNil); 25Debug.Assert(declaringType != null); 26Debug.Assert(reflectedType != null); 27Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Events\RoEvent.cs (2)
19Debug.Assert(declaringType != null); 20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Fields\Ecma\EcmaField.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Fields\RoField.cs (2)
21Debug.Assert(declaringType != null); 22Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\General\Assignability.cs (4)
184Debug.Assert(!(fromTypeInfo.IsArray || fromTypeInfo.IsByRef || fromTypeInfo.IsPointer || fromTypeInfo.IsGenericParameter)); 185Debug.Assert(!(toTypeInfo.IsArray || toTypeInfo.IsByRef || toTypeInfo.IsPointer || toTypeInfo.IsGenericParameter)); 335Debug.Assert(fromTypeInfo.IsArray); 336Debug.Assert(toTypeInfo.IsInterface);
System\Reflection\TypeLoading\General\CoreType.cs (1)
133Debug.Fail("Unexpected coreType passed to GetCoreTypeFullName: " + coreType);
System\Reflection\TypeLoading\General\Ecma\EcmaHelpers.cs (1)
54Debug.Fail("Unexpected PrimitiveTypeCode: " + typeCode);
System\Reflection\TypeLoading\General\Ecma\EcmaResolver.cs (10)
16Debug.Assert(!handle.IsNil); 17Debug.Assert(module != null); 30Debug.Assert(!handle.IsNil); 31Debug.Assert(module != null); 41Debug.Assert(!handle.IsNil); 42Debug.Assert(module != null); 120Debug.Assert(!handle.IsNil); 121Debug.Assert(module != null); 128Debug.Assert(!handle.IsNil); 129Debug.Assert(module != null);
System\Reflection\TypeLoading\General\Ecma\EcmaToStringHelpers.cs (3)
21Debug.Assert(!handle.IsNil); 22Debug.Assert(reader != null); 37Debug.Fail($"Invalid handle passed to ToTypeString: 0x{handle.GetToken():x8}");
System\Reflection\TypeLoading\General\Ecma\GuardedPEReader.cs (3)
29Debug.Assert(loader != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\General\Ecma\MetadataTable.cs (2)
31Debug.Assert(!handle.IsNil); 32Debug.Assert(factory != null);
System\Reflection\TypeLoading\General\Helpers.cs (5)
88Debug.Assert(rank == 1 || multiDim); 197Debug.Assert(fullName != null); 220Debug.Assert(ns != null, "For top level types, the namespace must be string.Empty, not null"); 221Debug.Assert(name != null); 303Debug.Assert(assembly is RoAssembly);
System\Reflection\TypeLoading\General\MethodSig.cs (3)
25Debug.Assert(parameterCount >= 0); 33Debug.Assert(position >= -1 && position < Parameters.Length); 39Debug.Assert(position >= -1 && position < Parameters.Length);
System\Reflection\TypeLoading\General\RoAssemblyName.cs (2)
38Debug.Assert(name != null); 54Debug.Assert(other is not null);
System\Reflection\TypeLoading\Methods\RoConstructedGenericMethod.cs (2)
21Debug.Assert(genericMethodDefinition != null); 22Debug.Assert(genericMethodArguments != null);
System\Reflection\TypeLoading\Methods\RoDefinitionMethod.cs (2)
19Debug.Assert(reflectedType != null); 39Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Methods\RoMethod.cs (1)
20Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\Methods\RoSyntheticMethod.cs (1)
24Debug.Assert(declaringType != null);
System\Reflection\TypeLoading\Modules\Ecma\EcmaModule.cs (4)
28Debug.Assert(assembly != null); 29Debug.Assert(fullyQualifiedName != null); 30Debug.Assert(peReader != null); 31Debug.Assert(reader != null);
System\Reflection\TypeLoading\Modules\GetTypeCoreCache.cs (7)
155Debug.Assert(newNextFreeEntry <= _nextFreeEntry); 177Debug.Assert(_nextFreeEntry >= 0 && _nextFreeEntry <= _entries.Length); 186Debug.Assert(walk1 >= 0 && walk1 < _nextFreeEntry); 187Debug.Assert(walk2 >= -1 && walk2 < _nextFreeEntry); 190Debug.Assert(storedBucket == bucket); 197Debug.Fail("Bucket " + bucket + " has a cycle in its linked list."); 202Debug.Assert(numEntriesEncountered <= _nextFreeEntry);
System\Reflection\TypeLoading\Modules\RoModule.cs (1)
25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Modules\RoResourceModule.cs (2)
24Debug.Assert(assembly != null); 25Debug.Assert(fullyQualifiedName != null);
System\Reflection\TypeLoading\Parameters\Ecma\EcmaFatMethodParameter.cs (4)
23Debug.Assert(roMethodBase != null); 24Debug.Assert(parameterType != null); 25Debug.Assert(!handle.IsNil); 28Debug.Assert(roMethodBase.MethodBase.Module is EcmaModule);
System\Reflection\TypeLoading\Parameters\RoFatMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoMethodParameter.cs (2)
19Debug.Assert(roMethodBase != null); 20Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Parameters\RoParameter.cs (1)
19Debug.Assert(member != null);
System\Reflection\TypeLoading\Parameters\RoPropertyIndexParameter.cs (2)
20Debug.Assert(member != null); 21Debug.Assert(backingParameter != null);
System\Reflection\TypeLoading\Parameters\RoThinMethodParameter.cs (2)
18Debug.Assert(roMethodBase != null); 19Debug.Assert(parameterType != null);
System\Reflection\TypeLoading\Properties\Ecma\EcmaProperty.cs (4)
23Debug.Assert(!handle.IsNil); 24Debug.Assert(declaringType != null); 25Debug.Assert(reflectedType != null); 26Debug.Assert(declaringType.Module is EcmaModule);
System\Reflection\TypeLoading\Properties\RoProperty.cs (2)
20Debug.Assert(declaringType != null); 21Debug.Assert(reflectedType != null);
System\Reflection\TypeLoading\RuntimeTypeInfo.BindingFlags.cs (9)
16Debug.Assert(types != null); 66Debug.Assert(name != null); 72Debug.Assert(genericParameterCount == GenericParameterCountAny); 73Debug.Assert(binder == null); 74Debug.Assert(callConvention == CallingConventions.Any); 75Debug.Assert(modifiers == null); 110Debug.Assert(name != null); 116Debug.Assert(binder == null); 117Debug.Assert(modifiers == null);
System\Reflection\TypeLoading\RuntimeTypeInfo.GetMember.cs (1)
83Debug.Assert(numCopied == numMatches);
System\Reflection\TypeLoading\Types\Ecma\EcmaDefinitionType.cs (2)
21Debug.Assert(module != null); 22Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericMethodParameterType.cs (1)
17Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\Ecma\EcmaGenericParameterType.cs (1)
20Debug.Assert(!handle.IsNil);
System\Reflection\TypeLoading\Types\RoArrayType.cs (2)
20Debug.Assert(elementType != null); 21Debug.Assert(multiDim || rank == 1);
System\Reflection\TypeLoading\Types\RoArrayType.Key.cs (1)
18Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoByRefType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.cs (2)
23Debug.Assert(genericTypeDefinition != null); 24Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoConstructedGenericType.Key.cs (2)
15Debug.Assert(genericTypeDefinition != null); 16Debug.Assert(genericTypeArguments != null);
System\Reflection\TypeLoading\Types\RoDefinitionType.cs (3)
38Debug.Assert(!IsConstructedGenericType); 39Debug.Assert(!IsGenericParameter); 40Debug.Assert(!HasElementType);
System\Reflection\TypeLoading\Types\RoFunctionPointerType.cs (1)
32Debug.Assert(module != null);
System\Reflection\TypeLoading\Types\RoHasElementType.cs (1)
21Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoModifiedFunctionPointerType.cs (1)
23Debug.Assert(functionPointerType.IsFunctionPointer);
System\Reflection\TypeLoading\Types\RoModifiedGenericType.cs (1)
18Debug.Assert(genericType.IsGenericType);
System\Reflection\TypeLoading\Types\RoModifiedHasElementType.cs (1)
18Debug.Assert(unmodifiedType.HasElementType);
System\Reflection\TypeLoading\Types\RoModifiedType.cs (2)
60Debug.Assert(_requiredModifiers == null); 67Debug.Assert(_optionalModifiers == null);
System\Reflection\TypeLoading\Types\RoPointerType.cs (1)
17Debug.Assert(elementType != null);
System\Reflection\TypeLoading\Types\RoWrappedType.cs (1)
16Debug.Assert(unmodifiedType != null);
System.Resources.Extensions (54)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (7)
137Debug.Assert(_resourceList != null); 276Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 370Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 381Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 407Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 499Debug.Assert(writer != null); 617Debug.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, $"ResourceReader: Unsupported ResourceTypeCode in .resources file! {typeCode}");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\PinnedBufferMemoryStream.cs (1)
19Debug.Assert(array != null, "Array can't be null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\FastResourceComparer.cs (5)
75Debug.Assert(a != null && bytes != null, "FastResourceComparer::CompareOrdinal must have non-null params"); 76Debug.Assert(bCharLength * 2 <= bytes.Length, "FastResourceComparer::CompareOrdinal - numChars is too big!"); 111Debug.Assert((byteLen & 1) == 0, "CompareOrdinal is expecting a UTF-16 string length, which must be even!"); 112Debug.Assert(a != null && b != null, "Null args not allowed."); 113Debug.Assert(byteLen >= 0, "byteLen must be non-negative.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?"); 191Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}"); 195Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled."); 200Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled."); 207Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}"); 211Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled."); 216Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled."); 252Debug.Assert(_store != null, "ResourceReader is closed!"); 333Debug.Assert(_store != null, "ResourceReader is closed!"); 334Debug.Assert(Monitor.IsEntered(this)); // uses _store 376Debug.Assert(_store != null, "ResourceReader is closed!"); 447Debug.Assert(_store != null, "ResourceReader is closed!"); 471Debug.Assert(_store != null, "ResourceReader is closed!"); 533Debug.Assert(_store != null, "ResourceReader is closed!"); 534Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!"); 535Debug.Assert(Monitor.IsEntered(this)); // uses _store 555Debug.Assert(Monitor.IsEntered(this)); // uses _store 615Debug.Assert(_store != null, "ResourceReader is closed!"); 616Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!"); 617Debug.Assert(Monitor.IsEntered(this)); // uses _store 637Debug.Assert(Monitor.IsEntered(this)); // uses _store 723Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)"); 775Debug.Assert(!Monitor.IsEntered(this)); // only called during init 776Debug.Assert(_store != null, "ResourceReader is closed!"); 798Debug.Assert(!Monitor.IsEntered(this)); // only called during init 987Debug.Assert(Monitor.IsEntered(this)); // uses _store 995Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!"); 1026Debug.Assert(typeCode >= 0, "can't be negative"); 1027Debug.Assert(Monitor.IsEntered(this)); // uses _store 1031Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers."); 1037Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!"); 1111Debug.Assert(!Monitor.IsEntered(_reader));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
277Debug.Assert(!Monitor.IsEntered(reader));
System\Resources\Extensions\BinaryFormat\BinaryFormattedObject.TypeResolver.cs (1)
40Debug.Assert(typeName.AssemblyName is not null);
System\Resources\Extensions\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
25Debug.Assert(arrayRecord.RecordType is not (SerializationRecordType.ArraySingleString or SerializationRecordType.ArraySinglePrimitive));
System\Resources\Extensions\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
48Debug.Assert(_fieldInfo is not null);
System\Resources\Extensions\BinaryFormat\Deserializer\Deserializer.cs (3)
158Debug.Fail("Completed dependencies should have been removed from the dictionary."); 266Debug.Assert(Options.SurrogateSelector is not null); 363Debug.Assert(_pendingUpdates is not null);
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
100Debug.Assert(primitiveValue.GetType() == primitiveType); 197Debug.Assert(record != null);
System.Resources.Writer (8)
src\runtime\src\libraries\Common\src\System\Resources\ResourceWriter.cs (7)
137Debug.Assert(_resourceList != null); 276Debug.Assert(resMgrHeaderBlob.Length > 0, "ResourceWriter: Expected non empty header"); 370Debug.Assert((bw.BaseStream.Position & 7) == 0, "ResourceWriter: Name hashes array won't be 8 byte aligned! Ack!"); 381Debug.Assert((bw.BaseStream.Position & 3) == 0, "ResourceWriter: Name positions array won't be 4 byte aligned! Ack!"); 407Debug.Assert(startOfDataSection == bw.Seek(0, SeekOrigin.Current), "ResourceWriter::Generate - start of data section is wrong!"); 499Debug.Assert(writer != null); 617Debug.Assert(typeCode >= ResourceTypeCode.StartOfUserTypes, $"ResourceReader: Unsupported ResourceTypeCode in .resources file! {typeCode}");
System\Resources\ResourceWriter.core.cs (1)
51Debug.Assert(data != null);
System.Runtime (1)
src\runtime\artifacts\obj\System.Runtime\Release\net11.0\System.Runtime.Forwards.cs (1)
159[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Diagnostics.Debug))]
System.Runtime.Caching (126)
System\Runtime\Caching\CacheExpires.cs (50)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 118Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 119Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 120Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 182Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 188Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 201Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 207Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 220Debug.Assert(list._head != -1, "list._head != -1"); 229Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 233Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 238Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 244Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 249Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 259Debug.Assert(list._head != -1, "list._head != -1"); 260Debug.Assert(list._tail != -1, "list._tail != -1"); 272Debug.Assert(list._head != -1, "list._head != -1"); 273Debug.Assert(list._tail != -1, "list._tail != -1"); 293Debug.Assert(capacity > 0, "capacity > 0"); 294Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 307Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 312Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 328Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 338Debug.Assert(((entries)[0]._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 349Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 370Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 371Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 372Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 386Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 387Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 392Debug.Assert(newLength > oldLength, "newLength > oldLength"); 439Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 440Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 441Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 476Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 486Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 488Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail"); 512Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid"); 522Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff"); 523Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 567Debug.WriteLine("CacheExpiresRemove", 594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry); 610Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 628Debug.Assert(!_blockReduce, "_blockReduce == false"); 695Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 709Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid"); 738Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
173Debug.Assert(SAMPLE_COUNT == 2);
System\Runtime\Caching\CacheUsage.cs (60)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex"); 28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)"); 29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0"); 52Debug.Assert(result > 0, "result > 0"); 62Debug.Assert(result < 0, "result < 0"); 148Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0"); 149Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0"); 150Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 151Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid"); 152Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid"); 153Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid"); 165Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 171Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1"); 184Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 190Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1"); 203Debug.Assert(list._head != -1, "list._head != -1"); 212Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)"); 216Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex"); 221Debug.Assert(list._head == pageIndex, "list._head == pageIndex"); 227Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex"); 232Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex"); 242Debug.Assert(list._head != -1, "list._head != -1"); 243Debug.Assert(list._tail != -1, "list._tail != -1"); 254Debug.Assert(list._head != -1, "list._head != -1"); 255Debug.Assert(list._tail != -1, "list._tail != -1"); 273Debug.Assert(capacity > 0, "capacity > 0"); 274Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0"); 287Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES"); 292Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null"); 308Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0"); 318Debug.Assert(((entries)[0]._ref1._next).IsInvalid, "FreeEntryHead(entries).IsInvalid"); 326Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 331Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null"); 355Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse"); 356Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1"); 357Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1"); 371Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength"); 372Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES"); 377Debug.Assert(newLength > oldLength, "newLength > oldLength"); 424Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1"); 425Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1"); 426Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 459Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0"); 469Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail"); 472Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail"); 478Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1"); 487Debug.Assert(prev != oldRef2, "prev != oldRef2"); 505Debug.Assert(next != oldRef1, "next != oldRef1"); 531Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 583Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1"); 682Debug.Assert(maxFlush > 0, $"maxFlush is not greater than 0, instead is {maxFlush}"); 683Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 700Debug.Assert(!_blockReduce, "_blockReduce == false"); 709Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0"); 723Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue"); 731Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1"); 761Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid"); 775Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid"); 801Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0"); 851Debug.Assert(bucket != 0xff, "bucket != 0xff");
System\Runtime\Caching\ChangeMonitor.cs (3)
145Debug.Assert(_flags[INITIALIZED], "It is critical that INITIALIZED is set before CHANGED is checked below"); 162Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below."); 208Debug.Assert(_flags[CHANGED], "It is critical that CHANGED is set before INITIALIZED is checked below.");
System\Runtime\Caching\Dbg.cs (1)
44Debug.WriteLine(output);
System\Runtime\Caching\MemoryCache.cs (1)
136Debug.Fail("Reason should never be CacheEntryRemovedReason.Evicted since the entry was inserted as NotRemovable.");
System\Runtime\Caching\MemoryCacheEntry.cs (1)
254Debug.Assert(_fields._dependents == null, "_fields._dependents == null");
System\Runtime\Caching\MemoryCacheEntryChangeMonitor.cs (1)
136Debug.Assert(keys != null && keys.Count > 0, "keys != null && keys.Count > 0");
System\Runtime\Caching\MemoryCacheKeyEqualityComparer.cs (2)
13Debug.Assert(x != null && x is MemoryCacheKey); 14Debug.Assert(y != null && y is MemoryCacheKey);
System\Runtime\Caching\MemoryCacheStore.cs (3)
112Debug.Assert(entry.State == EntryState.RemovingFromCache, "entry.State = EntryState.RemovingFromCache"); 279Debug.Assert(!_useInsertBlock, "_useInsertBlock == false"); 370Debug.Assert(percent <= 100, "percent <= 100");
System\Runtime\Caching\MemoryMonitor.cs (3)
61Debug.Assert(_pressureHigh > 0, "_pressureHigh > 0"); 62Debug.Assert(_pressureLow > 0, "_pressureLow > 0"); 63Debug.Assert(_pressureLow <= _pressureHigh, "_pressureLow <= _pressureHigh");
System.Runtime.InteropServices (3)
System\Runtime\InteropServices\Marshalling\ComObject.cs (3)
47Debug.Assert(Marshal.IsComObject(_runtimeCallableWrapper)); 144Debug.Assert(found); 165Debug.Assert(_runtimeCallableWrapper != null);
System.Runtime.Numerics (379)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\Number.Formatting.Common.cs (12)
144Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 724Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 758Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 828Debug.Assert(p >= spanPtr - 1, "Underflow"); 873Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 894Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 921Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 943Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 967Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte)); 1021Debug.Assert(sizeof(TChar) is sizeof(char) or sizeof(byte));
src\runtime\src\libraries\Common\src\System\Number.NumberBuffer.cs (7)
41Debug.Assert(digits != null); 49Debug.Assert(!digits.IsEmpty); 69Debug.Assert(Kind is NumberBufferKind.Integer or NumberBufferKind.Decimal or NumberBufferKind.FloatingPoint or NumberBufferKind.DecimalIeee754); 70Debug.Assert(Digits[0] != '0', "Leading zeros should never be stored in a Number"); 82Debug.Assert(char.IsAsciiDigit((char)digit), $"Unexpected character found in Number: {digit}"); 85Debug.Assert(numDigits == DigitsCount, "Null terminator found in unexpected location in Number"); 86Debug.Assert(numDigits < Digits.Length, "Null terminator not found in Number");
src\runtime\src\libraries\Common\src\System\Number.Parsing.Common.cs (13)
24Debug.Assert((str != null) || (str == strEnd)); 25Debug.Assert((strEnd != null) || (str == strEnd)); 26Debug.Assert(str <= strEnd); 27Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 36Debug.Assert(number.DigitsCount == 0); 37Debug.Assert(number.Scale == 0); 38Debug.Assert(!number.IsNegative); 39Debug.Assert(!number.HasNonZeroTail); 236Debug.Assert(numberOfTrailingZeros >= 0); 304Debug.Assert(info != null); 360Debug.Assert((p != null) || (p == pEnd)); 361Debug.Assert((pEnd != null) || (p == pEnd)); 362Debug.Assert(p <= pEnd);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder_1.cs (9)
23Debug.Assert((typeof(TChar) == typeof(Utf8Char)) || (typeof(TChar) == typeof(Utf16Char))); 32Debug.Assert((typeof(TChar) == typeof(Utf8Char)) || (typeof(TChar) == typeof(Utf16Char))); 44Debug.Assert(value >= 0); 45Debug.Assert(value <= _chars.Length); 55Debug.Assert(capacity >= 0); 91Debug.Assert(index < _pos); 110Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 286Debug.Assert(additionalCapacityBeyondPos > 0); 287Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (3)
25Debug.Assert(log2ToPow10.Length == 64); 54Debug.Assert((elementOffset + 1) <= powersOf10.Length); 102Debug.Assert(table.Length == 32, "Every result of uint.Log2(value) needs a long entry in the table.");
System\Number.BigInteger.cs (38)
337Debug.Assert(leading != 0); 430Debug.Assert(intDigits.Length % PowersOf1e9.MaxPartialDigits == 0); 439Debug.Assert(intDigits.Length == 0); 493Debug.Assert(bits.Trim((nuint)0).Length == 0); 494Debug.Assert(BigIntegerParseNaiveThresholdInRecursive > 1); 512Debug.Assert(multiplier1E9Length < base1E9.Length && base1E9.Length <= multiplier1E9Length * 2); 547Debug.Assert(bits[resultLength] == 0); 558Debug.Assert(bits[resultLength] == 0); 578Debug.Assert(bits[resultLength] == 0); 618Debug.Assert(format is 'x' or 'X'); 627Debug.Assert(success); 711Debug.Assert(success); 716Debug.Assert(!bytes.IsEmpty); 725Debug.Assert(arrayToReturnToPool is not null); 733Debug.Assert(digits < Array.MaxLength); 776Debug.Assert(sb.Length == charsIncludeDigits); 819Debug.Assert(formatString == null || formatString.Length == formatSpan.Length); 847Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 855Debug.Assert(formatString != null); 877Debug.Assert(BigInteger.MaxLength * digitRatio + 1 < Array.MaxLength); // won't overflow 919Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 986Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 1014Debug.Assert(base1E9Value[^1] != 0, "Leading zeros should be trimmed by caller."); 1035Debug.Assert(ToStringNaiveThreshold >= 2); 1050Debug.Assert(bits.Length == 0 || bits[^1] != 0); 1051Debug.Assert(powersIndex >= 0); 1078Debug.Assert(!upper.Trim((nuint)0).IsEmpty); 1091Debug.Assert(lower1E9Length >= lowerWritten); 1368Debug.Assert(pow1E9.Length >= 1); 1369Debug.Assert(Indexes[6] == LeadingPowers1E9.Length); 1383Debug.Assert(2 * src.Length - (Indexes[i + 1] - Indexes[i]) is 0 or 1); 1406Debug.Assert(toExclusive == pow1E9.Length || pow1E9[toExclusive] == 0); 1445Debug.Assert(size > 0); 1470Debug.Assert(trailingZeroCount >= 0); 1502Debug.Assert(fi + 1 < Indexes.Length); 1524Debug.Assert(Unsafe.AreSame(ref bits[0], ref powersOfTen2[0])); 1588Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 1599Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length);
System\Number.Polyfill.cs (1)
129Debug.Assert(typeof(TChar) == typeof(Utf16Char));
System\Numerics\BigInteger.cs (61)
173Debug.Assert(sign is +1 or -1); 181Debug.Assert(man < (1UL << 53)); 182Debug.Assert(exp <= 0 || man >= (1UL << 52)); 220Debug.Assert(0 <= cbit && cbit < bitsPerLimb); 221Debug.Assert(cu >= 1); 258Debug.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 593Debug.Assert((nint)value[length - 1] < 0); 933Debug.Assert(dividend._bits is not null); 948Debug.Assert(divisor._bits is not null); 1059Debug.Assert(right._bits is not null); 1067Debug.Assert(left._bits is not null); 1073Debug.Assert(left._bits is not null && right._bits is not null); 1082Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 1534Debug.Assert(mode is GetBytesMode.AllocateArray or GetBytesMode.Count or GetBytesMode.Span, $"Unexpected mode {mode}."); 1535Debug.Assert(mode == GetBytesMode.Span || destination.IsEmpty, $"If we're not in span mode, we shouldn't have been passed a destination."); 1589Debug.Assert(bits.Length > 0); 1590Debug.Assert(bits[^1] != 0); 1597Debug.Assert(highLimb <= nuint.MaxValue - 1); 1603Debug.Assert(sign == 1); 1714Debug.Assert(msbIndex >= 0 && msbIndex < bytesPerLimb); 1726Debug.Assert(isBigEndian || (!needExtraByte && curByte == length - 1) || (needExtraByte && curByte == length - 2)); 1727Debug.Assert(!isBigEndian || (!needExtraByte && curByte == 0) || (needExtraByte && curByte == 1)); 1746Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1894Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1900Debug.Assert(!rightBits.IsEmpty); 1911Debug.Assert(!leftBits.IsEmpty); 1922Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1933Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1963Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 1969Debug.Assert(!rightBits.IsEmpty); 1980Debug.Assert(!leftBits.IsEmpty); 2000Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 2067Debug.Assert(precision is > 0 and <= 53); 2186Debug.Assert((uint)bits.Length <= 64 / BigIntegerCalculator.BitsPerLimb); 2785Debug.Assert(bits.Length > 0); 2810Debug.Assert(carry == over); 2811Debug.Assert(z[^1] != 0); 2886Debug.Assert(bits.Length > 0); 2908Debug.Assert((uint)leastSignificant < (uint)zd.Length); 3040Debug.Assert(!(trivialLeft && trivialRight), "Trivial cases should be handled on the caller operator"); 3046Debug.Assert(!right.IsEmpty); 3057Debug.Assert(!left.IsEmpty); 3077Debug.Assert(!left.IsEmpty && !right.IsEmpty); 3109Debug.Assert(dividend._bits is not null); 3124Debug.Assert(dividend._bits is not null && divisor._bits is not null); 3163Debug.Assert(dividend._bits is not null); 3168Debug.Assert(dividend._bits is not null && divisor._bits is not null); 3307Debug.Assert(_sign is 1 or -1); 3309Debug.Assert(_bits.Length > 0); 3311Debug.Assert(_bits.Length > 1 || _bits[0] > int.MaxValue); 3313Debug.Assert(_bits[^1] != 0); 3315Debug.Assert(_bits.Length <= MaxLength); 3320Debug.Assert(_sign > int.MinValue); 3493Debug.Assert(bits.Length > 0); 3494Debug.Assert(Math.Abs(rotateLeftAmount) <= 0x80000000); 3705Debug.Assert(!Environment.Is64BitProcess); 3723Debug.Assert((uint)leadingZeroCount < (uint)zd.Length); 3870Debug.Assert(firstNonZero >= 0); 3940Debug.Assert(firstNonZero >= 0); 5433Debug.Assert(bits.Length > 0); 5444Debug.Assert(negLeadingZeroCount >= 0);
System\Numerics\BigIntegerCalculator.AddSub.cs (16)
26Debug.Assert(left.Length >= 1); 27Debug.Assert(bits.Length == left.Length + 1); 34Debug.Assert(right.Length >= 1); 35Debug.Assert(left.Length >= right.Length); 36Debug.Assert(bits.Length == left.Length + 1); 55Debug.Assert(left.Length >= right.Length); 77Debug.Assert(carry == 0); 82Debug.Assert(left.Length >= 1); 83Debug.Assert(left[0] >= right || left.Length >= 2); 84Debug.Assert(bits.Length == left.Length); 91Debug.Assert(right.Length >= 1); 92Debug.Assert(left.Length >= right.Length); 93Debug.Assert(CompareActual(left, right) >= 0); 94Debug.Assert(bits.Length == left.Length); 111Debug.Assert(left.Length >= right.Length); 133Debug.Assert(borrow == 0);
System\Numerics\BigIntegerCalculator.DivRem.cs (66)
35Debug.Assert(left.Length >= 1); 36Debug.Assert(quotient.Length == left.Length); 52Debug.Assert(left.Length >= 1); 66Debug.Assert(left.Length >= 1); 67Debug.Assert(right.Length >= 1); 68Debug.Assert(left.Length >= right.Length); 69Debug.Assert(quotient.Length == left.Length - right.Length + 1); 70Debug.Assert(remainder.Length == left.Length); 87Debug.Assert(left.Length >= 1); 88Debug.Assert(right.Length >= 1); 89Debug.Assert(left.Length >= right.Length); 90Debug.Assert(quotient.Length == left.Length - right.Length + 1); 114Debug.Assert(left.Length >= 1); 115Debug.Assert(right.Length >= 1); 116Debug.Assert(left.Length >= right.Length); 117Debug.Assert(remainder.Length == left.Length); 148Debug.Assert(left.Length >= 1); 149Debug.Assert(right.Length >= 1); 150Debug.Assert(left.Length >= right.Length); 151Debug.Assert(quotient.Length == left.Length - right.Length + 1 179Debug.Assert(left.Length >= 1); 180Debug.Assert(right.Length >= 1); 181Debug.Assert(left.Length >= right.Length); 182Debug.Assert( 245Debug.Assert(carry == t + 1); 251Debug.Assert(carry == 1); 270Debug.Assert(left.Length >= right.Length); 287Debug.Assert(left.Length >= right.Length); 315Debug.Assert(left.Length >= 1); 316Debug.Assert(right.Length >= 1); 317Debug.Assert(left.Length >= right.Length); 318Debug.Assert(quotient.Length == left.Length - right.Length + 1); 319Debug.Assert(remainder.Length == left.Length || remainder.Length == 0); 353Debug.Assert((uint)sigmaSmall <= BitsPerLimb); 354Debug.Assert(src.Length + sigmaDigit <= bits.Length); 374Debug.Assert(carry == 0); 383Debug.Assert(t < a.Length || (t == a.Length && (nint)a[^1] >= 0)); 398Debug.Assert(!q.Slice(quotientUpper.Length).ContainsAnyExcept(0u)); 422Debug.Assert(r[^1] == 0); 423Debug.Assert(!r.Slice(0, sigmaDigit).ContainsAnyExcept(0u)); 432Debug.Assert((uint)sigmaSmall <= BitsPerLimb); 443Debug.Assert(carry == 0); 459Debug.Assert(left.Length == 2 * right.Length); 460Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0); 461Debug.Assert(quotient.Length == right.Length); 462Debug.Assert(remainder.Length >= right.Length + 1); 463Debug.Assert(right[^1] > 0); 464Debug.Assert(right.Length < DivideBurnikelZieglerThreshold); 480Debug.Assert(quotient.Length + 1 == left.Length); 481Debug.Assert(left[^1] < right[0]); 516Debug.Assert(!r1.Slice(remainder.Length).ContainsAnyExcept(0u)); 527Debug.Assert(left.Length == 2 * right.Length); 528Debug.Assert(CompareActual(left.Slice(right.Length), right) < 0); 529Debug.Assert(quotient.Length == right.Length); 530Debug.Assert(remainder.Length >= right.Length + 1); 531Debug.Assert(right[^1] > 0); 552Debug.Assert(right.Length % 2 == 0); 553Debug.Assert(left12.Length == right.Length); 554Debug.Assert(2 * left3.Length == right.Length); 555Debug.Assert(2 * quotient.Length == right.Length); 556Debug.Assert(remainder.Length >= right.Length + 1); 557Debug.Assert(right[^1] > 0); 558Debug.Assert(CompareActual(left12, right) < 0); 577Debug.Assert(CompareActual(a1, b1) == 0); 598Debug.Assert((uint)qi < (uint)quotient.Length); 609Debug.Assert(bits.Length == left.Length + right.Length);
System\Numerics\BigIntegerCalculator.FastReducer.cs (10)
25Debug.Assert(!modulus.IsEmpty); 26Debug.Assert(r.Length == modulus.Length * 2 + 1); 27Debug.Assert(mu.Length == r.Length - modulus.Length + 1); 28Debug.Assert(q1.Length == modulus.Length * 2 + 2); 29Debug.Assert(q2.Length == modulus.Length * 2 + 2); 47Debug.Assert(value.Length <= _modulus.Length * 2); 73Debug.Assert(!right.IsEmpty); 74Debug.Assert(!bits.IsEmpty); 75Debug.Assert(bits.Length + k >= left.Length + right.Length); 118Debug.Assert(left.Length >= right.Length);
System\Numerics\BigIntegerCalculator.GcdInv.cs (24)
78Debug.Assert(left.Length >= 1); 79Debug.Assert(right != 0); 90Debug.Assert(left.Length >= 2); 91Debug.Assert(right.Length >= 2); 92Debug.Assert(CompareActual(left, right) >= 0); 93Debug.Assert(result.Length == left.Length); 107Debug.Assert(left.Length >= 2); 108Debug.Assert(right.Length >= 2); 109Debug.Assert(left.Length >= right.Length); 254Debug.Assert(buffer.Length >= 2); 271Debug.Assert(buffer.Length >= 1); 293Debug.Assert(xBuffer.Length >= 3); 294Debug.Assert(yBuffer.Length >= 3); 295Debug.Assert(xBuffer.Length >= yBuffer.Length); 339Debug.Assert(xBuffer.Length >= 2); 340Debug.Assert(yBuffer.Length >= 2); 341Debug.Assert(xBuffer.Length >= yBuffer.Length); 382Debug.Assert(x >= y); 390Debug.Assert(x.Length >= 1); 391Debug.Assert(y.Length >= 1); 392Debug.Assert(x.Length >= y.Length); 393Debug.Assert(a <= 0x7FFFFFFF && b <= 0x7FFFFFFF); 394Debug.Assert(c <= 0x7FFFFFFF && d <= 0x7FFFFFFF); 455Debug.Assert(bits.Length >= maxLength);
System\Numerics\BigIntegerCalculator.PowMod.cs (18)
23Debug.Assert(bits.Length == PowBound(power, value.Length)); 41Debug.Assert(value.Length >= valueLength); 42Debug.Assert(temp.Length == result.Length); 43Debug.Assert(value.Length == temp.Length); 69Debug.Assert(leftLength <= left.Length); 86Debug.Assert(valueLength <= value.Length); 87Debug.Assert(temp.Length >= valueLength + valueLength); 260Debug.Assert(!modulus.IsEmpty); 261Debug.Assert(bits.Length == modulus.Length + modulus.Length); 300Debug.Assert(!modulus.IsEmpty); 301Debug.Assert(bits.Length == modulus.Length + modulus.Length); 482Debug.Assert((modulus[0] & 1) != 0); 483Debug.Assert(bits.Length >= modulus.Length * 2); 631Debug.Assert(wValue >= 1 && (wValue & 1) == 1); 657Debug.Assert((n0 & 1) != 0); 679Debug.Assert(value.Length >= 2 * k); 716Debug.Assert(overflow <= 1); 730Debug.Assert(overflow >= borrow);
System\Numerics\BigIntegerCalculator.ShiftRot.cs (9)
14Debug.Assert(Math.Abs(rotateLeftAmount) <= 0x80000000); 43Debug.Assert(bits.Length > 0); 58Debug.Assert(bits.Length > 0); 73Debug.Assert(lowerLength > 0); 74Debug.Assert(lowerLength < bits.Length); 108Debug.Assert(lowerLength > 0); 109Debug.Assert(lowerLength < bits.Length); 142Debug.Assert((uint)shift < BitsPerLimb); 216Debug.Assert((uint)shift < BitsPerLimb);
System\Numerics\BigIntegerCalculator.SquMul.cs (73)
29Debug.Assert(bits.Length == value.Length + value.Length); 30Debug.Assert(!bits.ContainsAnyExcept(0u)); 56Debug.Assert(value.Length >= 3); 57Debug.Assert(bits.Length >= value.Length + value.Length); 58Debug.Assert(bits.Trim((nuint)0).IsEmpty); 94Debug.Assert(bits.Length == value.Length + value.Length); 95Debug.Assert(bits.Trim((nuint)0).IsEmpty); 146Debug.Assert(bits.Length == value.Length + value.Length); 147Debug.Assert(bits.Trim((nuint)0).IsEmpty); 206Debug.Assert(bits.Length == left.Length + 1); 222Debug.Assert(left.Length >= right.Length); 223Debug.Assert(right.Length >= 0); 224Debug.Assert(right.IsEmpty || bits.Length >= left.Length + right.Length); 225Debug.Assert(bits.Trim((nuint)0).IsEmpty); 226Debug.Assert(MultiplyKaratsubaThreshold >= 2); 227Debug.Assert(MultiplyToom3Threshold >= 9); 228Debug.Assert(MultiplyKaratsubaThreshold <= MultiplyToom3Threshold); 258Debug.Assert(left.Length >= 3); 259Debug.Assert(left.Length >= right.Length); 260Debug.Assert(bits.Length >= left.Length + right.Length); 261Debug.Assert(bits.Trim((nuint)0).IsEmpty); 270Debug.Assert(right.Length > n); 306Debug.Assert(3 * n - left.Length is 0 or 1 or 2); 307Debug.Assert(right.Length > n); 308Debug.Assert(right.Length <= 2 * n); 309Debug.Assert(bits.Length >= left.Length + right.Length); 310Debug.Assert(bits.Trim((nuint)0).IsEmpty); 383Debug.Assert(z2Sign >= 0); 421Debug.Assert(left.Length >= right.Length); 422Debug.Assert(bits.Length >= left.Length + right.Length); 423Debug.Assert(bits.Trim((nuint)0).IsEmpty); 426Debug.Assert(2 * n - left.Length is 0 or 1); 427Debug.Assert(right.Length > n); 441Debug.Assert(leftLow.Length >= leftHigh.Length); 442Debug.Assert(rightLow.Length >= rightHigh.Length); 443Debug.Assert(bitsLow.Length >= bitsHigh.Length); 475Debug.Assert(ActualLength(core) <= left.Length + 1); 485Debug.Assert(left.Length >= right.Length); 486Debug.Assert(2 * n - left.Length is 0 or 1); 487Debug.Assert(right.Length <= n); 488Debug.Assert(bits.Length >= left.Length + right.Length); 489Debug.Assert(bits.Trim((nuint)0).IsEmpty); 494Debug.Assert(leftLow.Length >= leftHigh.Length); 520Debug.Assert(right.Length < MultiplyKaratsubaThreshold); 557Debug.Assert(!buffer.ContainsAnyExcept(0u)); 558Debug.Assert(buffer.Length == 3 * (n + 1)); 559Debug.Assert(value.Length > n); 560Debug.Assert(value[^1] != 0); 599Debug.Assert(!pm2.ContainsAnyExcept(0u)); 600Debug.Assert(pm1.IsEmpty || pm1[^1] != 0); 601Debug.Assert(v0.IsEmpty || v0[^1] != 0); 602Debug.Assert(v2.IsEmpty || v2[^1] != 0); 611Debug.Assert(pm2[^1] < ((nuint)1 << (BitsPerLimb - 1))); 615Debug.Assert(pm2[^1] != nuint.MaxValue); 636Debug.Assert(!buffer.ContainsAnyExcept(0u)); 637Debug.Assert(cInf.Length >= right.cInf.Length); 690Debug.Assert(!buffer.ContainsAnyExcept(0u)); 691Debug.Assert(!cInf.IsEmpty); 756Debug.Assert(z1.IsEmpty || (z1[0] & 1) == 0); 770Debug.Assert(z3.IsEmpty || (z3[0] & 1) == 0); 790Debug.Assert(z1Sign >= 0); 791Debug.Assert(z2Sign >= 0); 792Debug.Assert(z3Sign >= 0); 826Debug.Assert(carry < 3); 860Debug.Assert(carry == 0); 865Debug.Assert(left.Length >= right.Length); 866Debug.Assert(core.Length >= left.Length); 938Debug.Assert(left.Length >= right.Length); 956Debug.Assert(left.Length >= right.Length); 962Debug.Assert(!left.ContainsAnyExcept(0u)); 995Debug.Assert(borrow == 0); 1002Debug.Assert(left.Length >= right.Length); 1039Debug.Assert(borrow == 0);
System\Numerics\BigIntegerCalculator.Utils.cs (6)
22Debug.Assert(left.Length <= right.Length || left.Slice(right.Length).ContainsAnyExcept(0u)); 23Debug.Assert(left.Length >= right.Length || right.Slice(left.Length).ContainsAnyExcept(0u)); 163Debug.Assert(hi < (ulong)divisor || divisor == 0); 220Debug.Assert(result.Length >= left.Length); 271Debug.Assert(result.Length >= left.Length); 326Debug.Assert(result.Length >= right.Length);
System\Numerics\Complex.cs (1)
876Debug.Assert(typeof(TChar) == typeof(Utf8Char) || typeof(TChar) == typeof(Utf16Char));
System\Numerics\Complex.Generic.cs (4)
374Debug.Assert((x >= T.Zero) || T.IsNaN(x)); 855Debug.Assert((x >= T.Zero) || T.IsNaN(x)); 856Debug.Assert((y >= T.Zero) || T.IsNaN(y)); 2082Debug.Assert(typeof(TChar) == typeof(Utf8Char) || typeof(TChar) == typeof(Utf16Char));
System.Runtime.Serialization.Formatters (54)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (3)
84Debug.Assert(MaxPrimeArrayLength == GetPrime(MaxPrimeArrayLength), "Invalid MaxPrimeArrayLength"); 103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Runtime\Serialization\FormatterServices.cs (4)
27Debug.Assert(type != null); 205Debug.Assert(fi != null); 344Debug.Assert(rank >= 1); 378Debug.Assert(innerSurrogate != null);
System\Runtime\Serialization\ObjectManager.cs (41)
89Debug.Assert(holder != null, "holder!=null"); 90Debug.Assert(holder._id >= 0, "holder.m_id>=0"); 176Debug.Assert(holder.RequiresSerInfoFixup, "[ObjectManager.FixupSpecialObject]holder.HasSurrogate||holder.HasISerializable"); 180Debug.Assert(surrogate != null, "surrogate!=null"); 181Debug.Assert(holder.SerializationInfo != null); 197Debug.Assert(holder.ObjectValue is ISerializable, "holder.m_object is ISerializable"); 224Debug.Assert(holder.IsIncompleteObjectReference); 243Debug.Assert(holder.ObjectValue != null); 284Debug.Assert(holder != null, "[TypedReferenceBuilder.ctor]holder!=null"); 285Debug.Assert(holder.RequiresValueTypeFixup, "[TypedReferenceBuilder.ctor]holder.RequiresValueTypeFixup"); 313Debug.Assert(tempHolder != null); 333Debug.Assert(currFixup.ParentIndex != null, "[ObjectManager.DoValueTypeFixup]currFixup.ParentIndex!=null"); 346Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]FixupObj!=null"); 362Debug.Assert(fixupObj != null, "[ObjectManager.DoValueTypeFixup]fixupObj!=null"); 408Debug.Assert(holder != null, "[ObjectManager.CompleteObject]holder.m_object!=null"); 437Debug.Assert(fixups._values[i]!._fixupType == FixupHolder.DelayedFixup, "fixups.m_values[i].m_fixupType==FixupHolder.DelayedFixup"); 443Debug.Assert(holderValue != null); 499Debug.Assert(holder.ObjectValue is Array); 510Debug.Assert(fixupInfo is MemberInfo); 596Debug.Assert(temp != null); 597Debug.Assert(temp.DirectlyDependentObjects > 0, "temp.m_missingElementsRemaining>0"); 654Debug.Assert(member == null || member is FieldInfo, "RegisterString - member is FieldInfo"); 859Debug.Assert(_fixupCount >= 0, "[ObjectManager.DoFixups]m_fixupCount>=0"); 1044Debug.Assert(objID >= 0, "objID>=0"); 1081Debug.Assert(objID >= 0, "objID>=0"); 1127Debug.Assert(_dependentObjects != null, "[ObjectHolder.RemoveDependency]m_dependentObjects!=null"); 1128Debug.Assert(id >= 0, "[ObjectHolder.RemoveDependency]id>=0"); 1168Debug.Assert(holder != null, "[ObjectHolder.UpdateTotalDependencyChain]holder!=null"); 1203Debug.Assert(obj != null, "obj!=null"); 1204Debug.Assert(_id > 0, "m_id>0"); 1390Debug.Assert(id > 0, "id>0"); 1391Debug.Assert(fixupInfo != null, "fixupInfo!=null"); 1392Debug.Assert(fixupType == ArrayFixup || fixupType == MemberFixup || fixupType == DelayedFixup, "fixupType==ArrayFixup || fixupType == MemberFixup || fixupType==DelayedFixup"); 1486Debug.Assert(_currentItem != -1, "[LongList.Current]m_currentItem!=-1"); 1487Debug.Assert(_values[_currentItem] != -1, "[LongList.Current]m_values[m_currentItem]!=-1"); 1537Debug.Assert(startingSize > 0 && startingSize < 0x1000, "startingSize>0 && startingSize<0x1000"); 1580Debug.Assert(list != null, "[ObjectHolderListEnumerator.ctor]list!=null"); 1589Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.MoveNext]m_startingVersion==m_list.Version"); 1606Debug.Assert(_currPos != -1, "[ObjectHolderListEnumerator.Current]m_currPos!=-1"); 1607Debug.Assert(_currPos < _list.Count, "[ObjectHolderListEnumerator.Current]m_currPos<m_list.Count"); 1608Debug.Assert(_startingVersion == _list.Version, "[ObjectHolderListEnumerator.Current]m_startingVersion==m_list.Version");
System\Runtime\Serialization\SerializationEventsCache.cs (1)
77Debug.Assert(obj != null, "object should have been initialized");
System\Runtime\Serialization\SerializationFieldInfo.cs (2)
17Debug.Assert(field != null); 18Debug.Assert(namePrefix != null);
System\Runtime\Serialization\SurrogateSelector.cs (3)
26Debug.Assert(selector != null, "[HasCycle]selector!=null"); 122Debug.Assert(tempPrev != null); 182Debug.Assert(type != null);
System.Runtime.Serialization.Schema (46)
System\Runtime\Serialization\Schema\CodeExporter.cs (43)
262Debug.Assert(classContract.Is(DataContractType.ClassDataContract)); 314Debug.Assert(contractCodeDomInfo.TypeReference != null); 496Debug.Assert(containingContractCodeDomInfo.TypeDeclaration != null, "Nested types have containing types by definition - types with declaration"); 513Debug.Assert(containingContractCodeDomInfo.TypeReference != null, "Nested types have containing types by definition - types with reference"); 530Debug.Assert(assemblyName.Name != null, $"Current executing assembly name is not expected to be null in {nameof(CodeExporter)}.{nameof(CreateTypeDeclaration)} scenario"); 587Debug.Assert(typeReference != null); 612Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 620Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract"); 643Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 644Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract"); 661Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 662Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract"); 674Debug.Assert(itemContract != null); 675Debug.Assert(itemContract.DataMembers.Count >= 2); 793Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 800Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 834Debug.Assert(baseContractCodeDomInfo.IsProcessed, "Cannot generate code for type if code for base type has not been generated"); 835Debug.Assert(baseContractCodeDomInfo.TypeReference != null, "Class data contracts should have non-null TypeReference"); 841Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 949Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 986Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 987Debug.Assert(classDataContract.KnownDataContracts != null); 999Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 1009Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1074Debug.Assert(enumDataContract.Is(DataContractType.EnumDataContract)); 1081Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1085Debug.Assert(enumDataContract.BaseContract != null, "BaseContract should not be null for EnumDataContract"); 1124Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 1138Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1171Debug.Assert(baseContractCodeDomInfo.TypeReference != null, "Class data contracts should have non-null TypeReference"); 1176Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 1186Debug.Assert(keyValueContract == null || keyValueContract.Is(DataContractType.ClassDataContract)); 1208Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 1223Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract"); 1255Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1256Debug.Assert(baseTypeReference != null, "Base type reference should not be null for Dictionary/List collection data contracts"); 1265Debug.Assert(itemName != null, "ItemName is never null for Collection contracts."); 1270Debug.Assert(keyName != null); 1271Debug.Assert(valueName != null); 1288Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1394Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1517Debug.Assert(clrNamespace != null); 1518Debug.Assert(codeNamespace != null);
System\Runtime\Serialization\Schema\ContractCodeDomInfo.cs (1)
62Debug.Assert(!names.Contains(memberName));
System\Runtime\Serialization\Schema\DiagnosticUtility.cs (1)
70Debug.Assert(condition, message);
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
140Debug.Assert(elementNames != null && elementNames.Count > 0);
System.Security.AccessControl (28)
System\Security\AccessControl\ACE.cs (5)
91Debug.Fail("Length > ushort.MaxValue"); 641Debug.Fail("OpaqueLength somehow managed to exceed MaxOpaqueLength"); 878Debug.Fail("Invalid ACE type"); 1211Debug.Fail("OpaqueLength somehow managed to exceed MaxOpaqueLength"); 1683Debug.Fail("OpaqueLength somehow managed to exceed MaxOpaqueLength");
System\Security\AccessControl\ACL.cs (7)
242Debug.Fail("aceLength % 4 != 0"); 344Debug.Fail("aceLength % 4 != 0"); 374Debug.Fail("aceLength % 4 != 0"); 1079Debug.Assert((ace.AccessMask & newAce.AccessMask) == newAce.AccessMask, "AceFlagsAreMergeable:: AccessMask of existing ace does not contain all access bits of new ace."); 1368Debug.Fail("Audit and alarm ACEs must have been stripped by remove-meaningless logic"); 1405Debug.Assert(ace != null, "How did a null ACE end up in a SACL?"); 1431Debug.Fail("Allow and deny ACEs must have been stripped by remove-meaningless logic");
System\Security\AccessControl\CommonObjectSecurity.cs (3)
251Debug.Fail("Invalid operation"); 292Debug.Fail("Invalid operation"); 310Debug.Fail("rule.AccessControlType unrecognized");
System\Security\AccessControl\NativeObjectSecurity.cs (2)
143Debug.Fail($"Win32GetSecurityInfo() failed with unexpected error code {error}"); 277Debug.Fail($"Unexpected error code {error}");
System\Security\AccessControl\ObjectSecurity.cs (1)
68Debug.Assert(newOne != null, "Must not supply a null parameter here");
System\Security\AccessControl\Privilege.cs (6)
112System.Diagnostics.Debug.Fail($"LookupPrivilegeValue() failed with unrecognized error code {error}"); 199System.Diagnostics.Debug.Assert(!_isImpersonating, "Incorrect isImpersonating state"); 262System.Diagnostics.Debug.Fail($"WindowsIdentity.GetCurrentThreadToken() failed with unrecognized error code {error}"); 348System.Diagnostics.Debug.Assert(!_needToRevert, "Must revert privileges that you alter!"); 455System.Diagnostics.Debug.Fail($"AdjustTokenPrivileges() failed with unrecognized error code {error}"); 520System.Diagnostics.Debug.Fail($"AdjustTokenPrivileges() failed with unrecognized error code {error}");
System\Security\AccessControl\SecurityDescriptor.cs (3)
184Debug.Fail("binaryForm produced invalid output"); 189Debug.Fail($"Win32.ConvertSdToSddl returned {error}"); 484Debug.Fail($"Unexpected error out of Win32.ConvertStringSdToSd: {error}");
System\Security\AccessControl\Win32.cs (1)
273Debug.Fail("Internal error: both name and handle are null");
System.Security.Cryptography (876)
Microsoft\Win32\SafeHandles\NCryptSafeHandles.cs (16)
110Debug.Assert((_ownershipState == OwnershipState.Duplicate && _holder != null) || 112Debug.Assert(_holder == null || _holder._ownershipState == OwnershipState.Holder); 120Debug.Assert(value.IsValidOpenState); 122Debug.Assert(_ownershipState != OwnershipState.Duplicate); 123Debug.Assert(value._ownershipState == OwnershipState.Holder); 213Debug.Assert(typeof(T) == this.GetType()); 222Debug.Assert(IsValidOpenState); 232Debug.Assert(IsValidOpenState); 234Debug.Assert(_ownershipState == OwnershipState.Duplicate); 248Debug.Assert(IsValidOpenState); 250Debug.Assert(_ownershipState == OwnershipState.Duplicate); 251Debug.Assert(typeof(T) == this.GetType()); 272Debug.Assert(IsValidOpenState); 274Debug.Assert(_ownershipState == OwnershipState.Owner); 275Debug.Assert(typeof(T) == this.GetType()); 352Debug.Assert(success);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeHashHandle.cs (4)
28Debug.Assert(_parent == null); 29Debug.Assert(!parent.IsClosed); 30Debug.Assert(!parent.IsInvalid); 54Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeKeyHandle.cs (4)
63Debug.Assert(_parent == null); 64Debug.Assert(!parent.IsClosed); 65Debug.Assert(!parent.IsInvalid); 89Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeProvHandle.cs (1)
119Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\BCryptAlgorithmCache.cs (2)
38Debug.Assert(hashSize > 0); 69Debug.Assert(hashSize > 0);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Cng.cs (3)
174Debug.Assert(_parentHandle == null); 175Debug.Assert(parentHandle != null); 176Debug.Assert(!parentHandle.IsInvalid);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptExportKey.cs (1)
72Debug.Fail("Written byte count does not match required byte count.");
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptSetProperty.cs (1)
24Debug.Assert(pszValue is not null);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.BCryptSignHash.cs (2)
113Debug.Assert(bytesWritten <= destination.Length); 149Debug.Assert(bytesWritten == destination.Length);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\Interop.Blobs.cs (7)
21Debug.Assert(blob != null); 22Debug.Assert(offset >= 0); 33Debug.Assert(blob != null); 34Debug.Assert(offset >= 0); 35Debug.Assert(count > 0); 50Debug.Assert(blob != null); 51Debug.Assert(offset >= 0);
src\runtime\src\libraries\Common\src\Interop\Windows\BCrypt\RC2BCryptModes.cs (1)
30Debug.Assert(effectiveKeyLength > 0);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.FindOidInfo.cs (1)
54Debug.Assert(key != null);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Properties.cs (2)
47Debug.Assert(cbResult == sizeof(byte)); 68Debug.Assert(cbResult == sizeof(int));
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (2)
25Debug.Assert(!parent.IsInvalid); 26Debug.Assert(!parent.IsClosed);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandleWithKeyContainerDeletion.cs (1)
81Debug.Assert(hProv == IntPtr.Zero);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (2)
32Debug.Assert(task.IsCompletedSuccessfully); 166Debug.Fail("Unable to load required type.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AeadCommon.Windows.cs (2)
48Debug.Assert(plaintext.Length == ciphertextBytesWritten); 93Debug.Assert(ciphertext.Length == plaintextBytesWritten);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AesGcm.cs (1)
313Debug.Assert(tagSizeInBytes.IsLegalSize(TagByteSizes));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (3)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about 82Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} bytes when {expectedOutputSize} was expected");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (5)
31Debug.Assert(input.Length % 2 == 0); 32Debug.Assert(input.Length > 1); 64Debug.Assert(destination.Length >= encodedSize); 94Debug.Fail($"A signature field was longer ({signatureField.Length}) than expected ({response.Length})"); 152Debug.Assert(payloadLength >= 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.cs (2)
63Debug.Assert(!ncryptHandle.IsInvalid); 119Debug.Assert(!ncryptHandle.IsInvalid);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngHelpers.SignVerify.cs (2)
66Debug.Assert(numBytesNeeded == destination.Length); 85Debug.Assert(bytesWritten <= signature.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CngPkcs8.cs (5)
28Debug.Assert(pbeParameters != null); 145Debug.Fail("TryEncode failed with a pre-allocated buffer"); 276Debug.Assert(pbeParameters != null); 335Debug.Assert(pbeParameters != null); 412Debug.Assert(destination.Length < 128);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsa.cs (7)
670Debug.Assert(read == source.Length); 865Debug.Assert(read == source.Length); 1517Debug.Fail("Max sized buffer was not large enough."); 1639Debug.Fail("Max sized buffer was not large enough."); 1841Debug.Assert(writer.GetEncodedLength() <= initialCapacity); 1930Debug.Assert(writer.GetEncodedLength() <= capacity); 1968Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaAlgorithm.cs (7)
49Debug.Assert(minPrivateKeySizeInBytes <= maxPrivateKeySizeInBytes); 50Debug.Assert(minPublicKeySizeInBytes <= maxPublicKeySizeInBytes); 51Debug.Assert(minSignatureSize <= maxSignatureSize); 389Debug.Assert(keySizeInBits % 8 == 0); 522Debug.Fail($"Unsupported OID: {oid}."); 555Debug.Assert(keySizeInBits % 8 == 0); 571Debug.Assert(payloadLength >= 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaCng.Windows.cs (5)
56Debug.Fail($"Unexpected parameter set {parameterSet}"); 95Debug.Fail("Buffer too small but caller should have already validated the buffer size."); 144Debug.Fail($"Private key size too large for buffer: {privateKey.Length} / {destination.Length}"); 212Debug.Fail($"Unknown algorithm {Algorithm.Name}."); 220Debug.Fail(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CompositeMLDsaImplementation.Windows.cs (8)
55Debug.Assert(SupportsAny()); 59Debug.Fail("Base class should have validated algorithm support."); 81Debug.Assert(SupportsAny()); 85Debug.Fail("Base class should have validated algorithm support."); 103Debug.Assert(SupportsAny()); 107Debug.Fail("Base class should have validated algorithm support."); 170Debug.Fail("Unsupported algorithm."); 178Debug.Fail(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
80Debug.Assert(attribute != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.cs (1)
65Debug.Assert(OperatingSystem.IsWindows());
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (9)
215Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB)}"); 225Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}"); 280Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}"); 290Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}"); 307Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}"); 363Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB)}"); 374Debug.Assert(magic == KeyBlobMagicNumber.BCRYPT_DSA_PUBLIC_MAGIC_V2 || magic == KeyBlobMagicNumber.BCRYPT_DSA_PRIVATE_MAGIC_V2); 395Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}"); 415Debug.Assert(offset == dsaBlob.Length, $"Expected offset = dsaBlob.Length, got {offset} != {dsaBlob.Length}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.SignVerify.cs (4)
61Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}"); 97Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}"); 114Debug.Assert(stackBuf.Length == WindowsMaxQSize); 126Debug.Assert(qLength <= WindowsMaxQSize);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.HashAlgorithm.cs (1)
81Debug.Fail($"Unknown curve {algorithm}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.cs (6)
17Debug.Assert(parameters.Curve.IsNamed); 36Debug.Assert(parameters.Curve.IsPrime); 112Debug.Assert(offset == blobSize); 281Debug.Assert(offset == blobSize); 403Debug.Assert(value == ECCurve.ECCurveType.Characteristic2 || 416Debug.Assert(curveType == ECCurve.ECCurveType.Characteristic2 ||
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECCng.ImportExport.NamedCurve.cs (5)
31Debug.Assert(x.Length == y.Length); 63Debug.Assert(x.Length == d?.Length); 68Debug.Assert(offset == blobSize); 121Debug.Assert(offset == ecBlob.Length); 136Debug.Assert(offset == ecBlob.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\ECDsaCng.SignVerify.cs (1)
63Debug.Fail($"Missing internal implementation handler for signature format {signatureFormat}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
61Debug.Assert(!integer.IsEmpty);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
175Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 176Debug.Assert(privateKeyLength > 0, "privateKey was empty");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
229Debug.Assert(cipher.BlockSize <= 128, $"Encountered unexpected block size: {cipher.BlockSize}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsa.cs (3)
1363Debug.Assert(read == source.Length); 1426Debug.Assert(read == source.Length); 2072Debug.Assert(writer.GetEncodedLength() <= capacity);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaCng.Windows.cs (12)
32Debug.Assert(key is not null); 33Debug.Assert(key.AlgorithmGroup == CngAlgorithmGroup.MLDsa); 34Debug.Assert(transferOwnership); 64Debug.Assert(key is not null); 88Debug.Fail($"Unexpected parameter set {parameterSet}"); 298Debug.Assert(hashAlgorithmIdentifier is not null); 299Debug.Assert(!insufficientCollisionResistance); 300Debug.Assert(hashLengthInBytes == hash.Length); 333Debug.Assert(hashAlgorithmIdentifier is not null); 334Debug.Assert(!insufficientCollisionResistance); 335Debug.Assert(hashLengthInBytes == hash.Length); 462Debug.Fail(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.cs (2)
29Debug.Assert(key is not MLDsaImplementation); 32Debug.Assert(alg.PrivateKeySizeInBytes > alg.PrivateSeedSizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLDsaImplementation.Windows.cs (12)
51Debug.Fail($"Expected {destination.Length} bytes, but {nameof(Interop.BCrypt.BCryptSignHashPqcPure)} wrote {written} bytes."); 75Debug.Assert(hashAlgorithmIdentifier is not null); 76Debug.Assert(!insufficientCollisionResistance); 77Debug.Assert(hashLengthInBytes == hash.Length); 93Debug.Assert(hashAlgorithmIdentifier is not null); 94Debug.Assert(!insufficientCollisionResistance); 95Debug.Assert(hashLengthInBytes == hash.Length); 108Debug.Assert(SupportsAny()); 129Debug.Assert(SupportsAny()); 145Debug.Assert(SupportsAny()); 161Debug.Assert(SupportsAny()); 245Debug.Fail(
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.cs (3)
1189Debug.Assert(read == source.Length); 1251Debug.Assert(read == source.Length); 1680Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKem.Windows.cs (1)
25Debug.Fail("dwMagic is not expected value");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemCng.Windows.cs (21)
24Debug.Assert(key is not null); 25Debug.Assert(key.AlgorithmGroup == CngAlgorithmGroup.MLKem); 26Debug.Assert(transferOwnership); 56Debug.Assert(key is not null); 80Debug.Fail($"Unexpected parameter set '{parameterSet}'."); 95Debug.Assert(IsSupported); 96Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 97Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 102Debug.Assert(written == (uint)sharedSecret.Length); 109Debug.Assert(IsSupported); 110Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 111Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 123Debug.Assert(sharedSecretWritten == (uint)sharedSecret.Length); 124Debug.Assert(ciphertextWritten == (uint)ciphertext.Length); 131Debug.Assert(IsSupported); 132Debug.Assert(destination.Length == Algorithm.PrivateSeedSizeInBytes); 147Debug.Assert(IsSupported); 148Debug.Assert(destination.Length == Algorithm.DecapsulationKeySizeInBytes); 163Debug.Assert(IsSupported); 164Debug.Assert(destination.Length == Algorithm.EncapsulationKeySizeInBytes); 223Debug.Assert(kind is KeyBlobMagicNumber.BCRYPT_MLKEM_PUBLIC_MAGIC or
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.cs (1)
19Debug.Assert(key is not (MLKemImplementation or MLKemOpenSsl));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\MLKemImplementation.Windows.cs (20)
37Debug.Assert(IsSupported); 57Debug.Assert(IsSupported); 58Debug.Assert(source.Length == algorithm.PrivateSeedSizeInBytes); 65Debug.Assert(IsSupported); 66Debug.Assert(source.Length == algorithm.DecapsulationKeySizeInBytes); 73Debug.Assert(IsSupported); 74Debug.Assert(source.Length == algorithm.EncapsulationKeySizeInBytes); 81Debug.Assert(IsSupported); 82Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 83Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 88Debug.Assert(written == (uint)sharedSecret.Length); 93Debug.Assert(IsSupported); 94Debug.Assert(ciphertext.Length == Algorithm.CiphertextSizeInBytes); 95Debug.Assert(sharedSecret.Length == Algorithm.SharedSecretSizeInBytes); 103Debug.Assert(sharedSecretWritten == (uint)sharedSecret.Length); 104Debug.Assert(ciphertextWritten == (uint)ciphertext.Length); 109Debug.Assert(destination.Length == Algorithm.PrivateSeedSizeInBytes); 117Debug.Assert(destination.Length == Algorithm.DecapsulationKeySizeInBytes); 125Debug.Assert(destination.Length == Algorithm.EncapsulationKeySizeInBytes); 188Debug.Assert(IsSupported);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (3)
49Debug.Assert(oidValue != null); 86Debug.Assert( 130Debug.Assert(oid is not null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (22)
42Debug.Assert(pbeParameters != null); 45Debug.Assert(pbeParameters.IterationCount > 0); 103Debug.Assert(destination.Length >= encryptedData.Length); 176Debug.Assert(digestAlgorithmName.Name != null); 177Debug.Assert(cipher != null); 229Debug.Assert(written == buf.Length); 266Debug.Assert(pbeParameters != null); 333Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 381Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 382Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 406Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 415Debug.Fail($"UTF-8 encoding size changed between GetByteCount and GetBytes"); 421Debug.Assert(pwdTmpBytes!.Length == 0); 434Debug.Assert(encryptor.CanTransformMultipleBlocks); 444Debug.Fail("TryEncode failed with a pre-allocated buffer"); 514Debug.Assert(written == buf.Length); 627Debug.Fail("Key-sized OID included in the if, but not the switch"); 785Debug.Fail($"No Specified Salt value is present, indicating a new choice was unhandled"); 915Debug.Fail( 982Debug.Assert(decryptor.CanTransformMultipleBlocks); 1037Debug.Fail("TryGetHashAndReset failed with pre-allocated input"); 1050Debug.Fail("TryGetHashAndReset failed with pre-allocated input");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PemKeyHelpers.Factory.cs (4)
80Debug.Fail("Base64 decoding failed on already validated contents."); 84Debug.Assert(bytesWritten == base64size); 145Debug.Fail("Base64 decoding failed on already validated contents."); 149Debug.Assert(bytesWritten == base64size);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (3)
184Debug.Fail("TryEncode failed with a pre-allocated buffer"); 197Debug.Assert(macKey.Length <= 128); 214Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macSpan.Length} bytes");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (6)
304Debug.Assert(target is not null); 324Debug.Assert(idx != -1); 419Debug.Assert(pbeParameters != null); 420Debug.Assert(pbeParameters.IterationCount >= 1); 503Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None); 559Debug.Fail($"No handler for {ConfidentialityMode}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
51Debug.Assert(algorithmId != null); 188Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span)); 219Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (8)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 185Debug.Fail($"Hash output wrote {bytesWritten} bytes when {hashBuf.Length} was expected"); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0); 283Debug.Fail($"Unexpected written byte count ({count} vs {fullCopyLen})"); 300Debug.Fail($"Partial copy wrote {count} bytes of {destination.Length} expected");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PqcBlobHelpers.cs (8)
46Debug.Fail($"Unknown MLDsaAlgorithm: {algorithm}"); 101Debug.Fail("Unknown blob type."); 125Debug.Fail("Unknown blob type."); 151Debug.Fail("Unknown blob type."); 174Debug.Fail("Unknown blob type."); 227Debug.Assert(index == blobBytes.Length); 273Debug.Fail($"Unknown MLKemAlgorithm: {algorithm.Name}"); 289Debug.Fail($"Unknown blob type '{other}'.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (2)
112Debug.Fail("TryEncode failed with a presized buffer"); 127Debug.Assert(copyFrom == null || pkcs1PrivateKey.IsEmpty);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (20)
102Debug.Fail("Unknown digest algorithm"); 182Debug.Assert(source.Length > 11); 206Debug.Assert(lenIfBad < 0); 234Debug.Assert((selector | (selector - 1)) == -1); 321Debug.Assert(hasher.HashLengthInBytes == hLen); 332Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 357Debug.Assert(hLen is >= 0 and <= 64); 370Debug.Fail("Bad exception produced from OAEP padding: " + e); 426Debug.Assert(hasher.HashLengthInBytes == hLen); 428Debug.Assert(hLen is >= 0 and <= 64); 441Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 486Debug.Assert(em.Length >= emLen); 526Debug.Assert(hasher.HashLengthInBytes == hLen); 564Debug.Assert(hLen is >= 0 and <= 64); 569Debug.Fail("TryGetHashAndReset failed with exact-size destination"); 605Debug.Fail($"TryGetHashAndReset failed with sufficient space"); 609Debug.Assert(bytesWritten == hLen); 614Debug.Assert(hLen is >= 0 and <= 64); 619Debug.Fail($"TryGetHashAndReset failed with sufficient space"); 623Debug.Assert(bytesWritten == hLen);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsa.cs (7)
655Debug.Assert(privateKeySizeInBytes is <= 128); 680Debug.Assert(writer.GetEncodedLength() <= capacity); 1226Debug.Assert(read == source.Length); 1305Debug.Assert(read == source.Length); 1869Debug.Assert(publicKeySizeInBytes is <= 64); 1890Debug.Assert(writer.GetEncodedLength() <= capacity); 1988Debug.Assert(algorithm is not null, "Algorithm identifier should have been pre-validated by KeyFormatHelper.");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SlhDsaImplementation.cs (2)
25Debug.Assert(key is not SlhDsaImplementation); 26Debug.Assert(key.Algorithm.PrivateKeySizeInBytes <= 128);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (6)
41Debug.Assert(destination.Length <= 0x1FFFFFFF); 42Debug.Assert(_hashAlgorithm.Name is not null); 82Debug.Fail("BCryptKeyDerivation resultLength != destination.Length"); 104Debug.Assert(destination.Length <= 0x1FFFFFFF); 165Debug.Assert(!keyHandle.IsInvalid); 211Debug.Fail($"Unexpected hash algorithm '{hashAlgorithmName}'");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellman.cs (6)
349Debug.Fail("Export unexpectedly failed to pre-sized buffer or wrote an unexpected number of bytes."); 376Debug.Fail("Export unexpectedly failed to pre-sized buffer or wrote an unexpected number of bytes."); 1013Debug.Assert(read == source.Length); 1081Debug.Assert(read == source.Length); 1450Debug.Assert(spkiPreamble.Length + PublicKeySizeInBytes == SpkiSizeInBytes); 1528Debug.Assert(pkcs8Preamble.Length + PrivateKeySizeInBytes == Pkcs8SizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanCng.Windows.cs (4)
54Debug.Assert(otherPartyPublicKey.Length == PublicKeySizeInBytes); 55Debug.Assert(destination.Length == SecretAgreementSizeInBytes); 131Debug.Assert(destination.Length == PublicKeySizeInBytes); 137Debug.Assert(destination.Length == PrivateKeySizeInBytes);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519DiffieHellmanImplementation.Windows.cs (11)
30Debug.Assert(_hasPrivate || _privatePreservation == 0); 31Debug.Assert(!_hasPrivate || _originalPublicKey is null); 39Debug.Assert(destination.Length == SecretAgreementSizeInBytes); 59Debug.Assert(otherPartyPublicKey.Length == PublicKeySizeInBytes); 60Debug.Assert(destination.Length == SecretAgreementSizeInBytes); 87Debug.Fail($"Unexpected number of bytes written: {written}."); 145Debug.Assert(IsSupported); 147Debug.Assert(!key.IsInvalid); 164Debug.Assert(!key.IsInvalid); 172Debug.Assert(!key.IsInvalid); 221Debug.Assert(IsSupported);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X25519WindowsHelpers.cs (6)
154Debug.Assert(publicKey.Length == PublicKeySizeInBytes); 155Debug.Assert(reduced.Length == PublicKeySizeInBytes); 185Debug.Assert(key.Length == PublicKeySizeInBytes); 186Debug.Assert((key[^1] & 0x80) == 0); 205Debug.Assert(key.Length == PublicKeySizeInBytes); 218Debug.Assert(borrow == 0);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (4)
68Debug.Fail($"{nameof(MLDsaCng)} should only give ML-DSA keys."); 132Debug.Assert(certificateContext != null); 133Debug.Assert(!certificateContext.IsClosed && !certificateContext.IsInvalid); 302Debug.Assert(string.IsNullOrEmpty(cngKey.KeyName));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
567Debug.Assert(rented is null != mapped is null); 641Debug.Assert(decoded.HasValue);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (12)
744Debug.Assert(OperatingSystem.IsWindows()); 979Debug.Assert(_decryptBuffer.Length >= upperBound); 988Debug.Assert(_decryptBuffer is not null); 989Debug.Assert(_decryptBuffer.Length - _decryptBufferOffset >= encryptedContent.Length); 1055Debug.Assert(_certBags is not null); 1064Debug.Assert(_keyBags is not null); 1084Debug.Assert(_keyBags is not null); 1172Debug.Assert(decrypted.Array is not null); 1173Debug.Assert(_keyDecryptBuffer.Length - _keyDecryptBufferOffset >= decrypted.Count); 1197Debug.Assert(_certBags is not null); 1198Debug.Assert(_keyBags is not null); 1263Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macKey.Length} bytes");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Security\Cryptography\Aes.cs (8)
376Debug.Assert(written == decrypt.Length); 438Debug.Assert(destination.Length == GetKeyWrapPaddedLength(source.Length)); 456Debug.Assert(written == buf.Length); 490Debug.Assert(source.Length % 8 == 0); 491Debug.Assert(source.Length >= 16); 492Debug.Assert(destination.Length == GetKeyWrapPaddedLength(source.Length)); 510Debug.Assert(written == B.Length); 550Debug.Assert(written == B.Length);
System\Security\Cryptography\AesCng.Windows.cs (1)
357Debug.Assert(cipherMode is CipherMode.ECB or CipherMode.CBC);
System\Security\Cryptography\AesImplementation.cs (2)
28Debug.Assert(_keyBox is not null); 313Debug.Assert(cipherMode is CipherMode.ECB or CipherMode.CBC);
System\Security\Cryptography\AesImplementation.Windows.cs (1)
51Debug.Assert(destination.Length == GetKeyWrapPaddedLength(source.Length));
System\Security\Cryptography\AsnFormatter.cs (2)
21Debug.Assert(sArray != null && sArray.Length != 0); 41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\AsymmetricSignatureDeformatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\AsymmetricSignatureFormatter.cs (1)
20Debug.Assert(hash.Hash != null);
System\Security\Cryptography\Base64Transforms.cs (11)
53Debug.Assert(status == OperationStatus.Done); 54Debug.Assert(consumed == input.Length); 55Debug.Assert(written == output.Length); 78Debug.Assert(written == output.Length); 79Debug.Assert(status == OperationStatus.Done); 80Debug.Assert(consumed == inputCount); 227Debug.Assert(written == outputSize); 296Debug.Assert(bytesToTransform >= 4); 301Debug.Assert(_inputIndex < _inputBuffer.Length); 309Debug.Assert(consumed == bytesToTransform); 317Debug.Assert(status == OperationStatus.InvalidData);
System\Security\Cryptography\BasicSymmetricCipherCsp.cs (4)
71Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 78Debug.Assert(numBytesWritten == input.Length); // Our implementation of Transform() guarantees this. 94Debug.Assert(input.Length > 0); 95Debug.Assert((input.Length % PaddingSizeInBytes) == 0);
System\Security\Cryptography\BasicSymmetricCipherLiteBCrypt.cs (4)
47Debug.Assert(input.Length > 0); 48Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 101Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 108Debug.Assert(numBytesWritten == input.Length); // Our implementation of Transform() guarantees this. See comment above.
System\Security\Cryptography\BasicSymmetricCipherLiteNCrypt.cs (4)
57Debug.Assert(input.Length > 0); 58Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 144Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 151Debug.Assert(numBytesWritten == input.Length); // Our implementation of Transform() guarantees this. See comment above.
System\Security\Cryptography\CapiHelper.DSA.Shared.cs (3)
132Debug.Assert(dsaParameters.Y != null); 162Debug.Assert(cspPublicBlob == null); 299Debug.Assert(dsaParameters.Y.Length > 0);
System\Security\Cryptography\CapiHelper.Windows.cs (19)
174Debug.Assert(cspParameters != null); 175Debug.Assert(cspParameters.KeyContainerName == null); 429Debug.Assert(cb > 0); 430Debug.Assert(pb[cb - 1] == 0); 436Debug.Fail($"Unexpected key param {keyParam}"); 446Debug.Assert(returnType == 0 || returnType == 1); 593Debug.Fail($"Unexpected key param {keyParam}"); 618Debug.Fail("Unknown param in SetKeyParameter"); 643Debug.Fail("Unknown param in SetKeyParameter"); 814Debug.Assert(encryptedData != null, "Encrypted Data is null"); 815Debug.Assert(encryptedDataLength >= 0, "Encrypted data length is less than 0"); 874Debug.Assert(pbKey != null, "pbKey is null"); 875Debug.Assert(cbKey >= 0, $"cbKey is less than 0 ({cbKey})"); 887Debug.Assert(cbEncryptedKey >= cbKey); 898Debug.Assert(cbKey == cbEncryptedKey); 920Debug.Assert(cbEncryptedData >= input.Length); 934Debug.Assert(encryptedDataLength == cbEncryptedData); 935Debug.Assert(outputCount <= output.Length); 1131Debug.Assert(oid != null);
System\Security\Cryptography\CngAlgorithm.cs (3)
57Debug.Assert(_algorithm != null); 74Debug.Assert(_algorithm != null); 80Debug.Assert(_algorithm != null);
System\Security\Cryptography\CngAlgorithmCore.cs (3)
68Debug.Assert(success); 89Debug.Assert(curve.HasValue); 137Debug.Assert(key != null);
System\Security\Cryptography\CngAlgorithmGroup.cs (3)
58Debug.Assert(_algorithmGroup != null); 75Debug.Assert(_algorithmGroup != null); 81Debug.Assert(_algorithmGroup != null);
System\Security\Cryptography\CngHelpers.cs (1)
218Debug.Assert(offset == blobSize);
System\Security\Cryptography\CngKey.cs (2)
19Debug.Assert(keyHandle != null && !keyHandle.IsInvalid && !keyHandle.IsClosed); 20Debug.Assert(providerHandle != null && !providerHandle.IsInvalid && !providerHandle.IsClosed);
System\Security\Cryptography\CngKey.EC.cs (1)
63Debug.Fail($"Unknown curve {algorithm}");
System\Security\Cryptography\CngKey.Export.cs (2)
57Debug.Assert(ret); 58Debug.Assert(allocated != null); // since `allocate: true`
System\Security\Cryptography\CngKeyBlobFormat.cs (3)
58Debug.Assert(_format != null); 75Debug.Assert(_format != null); 81Debug.Assert(_format != null);
System\Security\Cryptography\CngProvider.cs (3)
55Debug.Assert(_provider != null); 72Debug.Assert(_provider != null); 78Debug.Assert(_provider != null);
System\Security\Cryptography\CngSymmetricAlgorithmCore.cs (5)
55Debug.Assert(key is not null); 103Debug.Assert(_outer == null || _outer == outer); 240Debug.Assert(mode == CipherMode.CFB ? feedbackSizeInBits == 8 : true); 257Debug.Assert(mode == CipherMode.CFB ? feedbackSizeInBits == 8 : true); 272Debug.Assert(!KeyInPlainText);
System\Security\Cryptography\ConcurrentSafeKmac.cs (4)
70Debug.Assert(!hash.IsEmpty); 88Debug.Assert(written == hash.Length); 99Debug.Assert(!hash.IsEmpty); 117Debug.Assert(written == hash.Length);
System\Security\Cryptography\CryptoConfig.cs (4)
102Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 279Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity. 410Debug.Fail("Unsupported Dictionary value:" + retvalObj.ToString()); 608Debug.Assert(encodedOidNumsIndex == encodedOidNumsLength);
System\Security\Cryptography\CryptographicOperations.cs (25)
157Debug.Assert(hashAlgorithm.Name is not null); 161Debug.Assert(written == hashSizeInBytes); 226Debug.Assert(hashAlgorithm.Name is not null); 235Debug.Assert(bytesWritten == hashSizeInBytes); 268Debug.Assert(hashAlgorithm.Name is not null); 304Debug.Assert(hashAlgorithm.Name is not null); 308Debug.Assert(written == hashSizeInBytes); 354Debug.Assert(hashAlgorithm.Name is not null); 402Debug.Assert(hashAlgorithm.Name is not null); 461Debug.Assert(hashAlgorithm.Name is not null); 465Debug.Assert(written == hashSizeInBytes); 541Debug.Assert(hashAlgorithm.Name is not null); 550Debug.Assert(bytesWritten == hashSizeInBytes); 616Debug.Assert(hashAlgorithm.Name is not null); 654Debug.Assert(hashAlgorithm.Name is not null); 746Debug.Assert(hashAlgorithm.Name is not null); 792Debug.Assert(hashAlgorithm.Name is not null); 840Debug.Assert(hashAlgorithm.Name is not null); 847Debug.Fail($"Validated hash algorithm '{hashAlgorithm.Name}' size ({hashSizeInBytes}) exceeds stack alloc."); 852Debug.Assert(written == hashSizeInBytes); 932Debug.Assert(hashAlgorithm.Name is not null); 939Debug.Fail($"Validated hash algorithm '{hashAlgorithm.Name}' size ({hashSizeInBytes}) exceeds stack alloc."); 944Debug.Assert(written == hashSizeInBytes); 1027Debug.Assert(hashAlgorithm.Name is not null); 1049Debug.Assert(written == mac.Length);
System\Security\Cryptography\CryptoStream.cs (11)
144Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 265Debug.Assert(_outputBuffer != null); 296Debug.Assert(completedValueTask.IsCompleted); 328Debug.Assert(_outputBufferIndex == 0); 331Debug.Assert(_inputBufferIndex == 0); 543Debug.Assert(_inputBuffer != null); 563Debug.Assert(_outputBufferIndex == 0, "The output index can only ever be non-zero when in read mode."); 569Debug.Assert(_inputBuffer != null && _outputBuffer != null); 624Debug.Assert(_outputBuffer != null); 639Debug.Assert(_inputBuffer != null); 654Debug.Assert(segment.Array is not null);
System\Security\Cryptography\CspParameters.cs (1)
31Debug.Assert((CspProviderFlags.UseMachineKeyStore |
System\Security\Cryptography\DSA.cs (1)
883Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\DSA.Xml.cs (1)
106Debug.Assert(keyParameters.P != null);
System\Security\Cryptography\DSACng.cs (3)
46Debug.Assert(key is not null); 47Debug.Assert(key.AlgorithmGroup == CngAlgorithmGroup.Dsa); 48Debug.Assert(transferOwnership);
System\Security\Cryptography\DSACng.Key.cs (1)
31Debug.Assert(key != null);
System\Security\Cryptography\DSACryptoServiceProvider.Windows.cs (14)
87Debug.Assert(localHandle != null); 103Debug.Assert(hProv != null); 104Debug.Assert(!hProv.IsInvalid); 105Debug.Assert(!hProv.IsClosed); 156Debug.Assert(hKey != null); 157Debug.Assert(!hKey.IsInvalid); 158Debug.Assert(!hKey.IsClosed); 196Debug.Assert(localHandle != null); 447Debug.Assert(data != null); 448Debug.Assert(offset >= 0 && offset <= data.Length); 449Debug.Assert(count >= 0 && count <= data.Length - offset); 450Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 463Debug.Assert(data != null); 464Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name));
System\Security\Cryptography\DSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\EccKeyFormatHelper.cs (8)
148Debug.Assert(algId.HasParameters); 152Debug.Assert((x == null) == (y == null)); 517Debug.Assert(oid.FriendlyName != null); 525Debug.Assert(ecParameters.Curve.IsPrime || ecParameters.Curve.IsCharacteristic2); 567Debug.Assert(ecParameters.Curve.IsCharacteristic2); 593Debug.Assert(k2 < 0); 594Debug.Assert(k1 > 0); 832Debug.Assert(ecParameters.Q.Y != null);
System\Security\Cryptography\ECCng.ImportExport.cs (2)
162Debug.Assert(ecparams.Q.X.AsSpan().SequenceEqual(localParameters.Q.X)); 163Debug.Assert(ecparams.Q.Y.AsSpan().SequenceEqual(localParameters.Q.Y));
System\Security\Cryptography\ECCurve.cs (1)
242Debug.Assert(CurveType == ECCurveType.Implicit);
System\Security\Cryptography\ECDiffieHellmanCng.cs (3)
37Debug.Assert(key is not null); 38Debug.Assert(key.AlgorithmGroup == CngAlgorithmGroup.ECDiffieHellman); 39Debug.Assert(transferOwnership);
System\Security\Cryptography\ECDiffieHellmanCng.Derive.cs (1)
88Debug.Fail($"Unknown KDF ({KeyDerivationFunction})");
System\Security\Cryptography\ECDiffieHellmanCng.Key.cs (2)
80Debug.Fail($"Unknown algorithm {alg}"); 125Debug.Fail("Should not have invalid key size");
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
14Debug.Assert(wrapped != null); 175Debug.Assert(wrapped != null);
System\Security\Cryptography\ECDsa.cs (3)
158Debug.Fail($"GetMaxSignatureSize returned insufficient size for format {signatureFormat}"); 440Debug.Fail($"GetMaxSignatureSize returned insufficient size for format {signatureFormat}"); 1203Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\ECDsaCng.cs (3)
64Debug.Assert(key is not null); 65Debug.Assert(IsEccAlgorithmGroup(key.AlgorithmGroup)); 66Debug.Assert(transferOwnership);
System\Security\Cryptography\ECDsaCng.Key.cs (2)
69Debug.Fail($"Unknown algorithm {alg}"); 108Debug.Fail("Should not have invalid key size");
System\Security\Cryptography\ECDsaWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\HashProvider.cs (1)
45Debug.Assert(written == HashSizeInBytes);
System\Security\Cryptography\HashProviderCng.cs (5)
64Debug.Assert(_hHash != null); 80Debug.Assert(destination.Length >= _hashSize); 81Debug.Assert(_hHash != null); 100Debug.Assert(destination.Length >= _hashSize); 101Debug.Assert(_hHash != null);
System\Security\Cryptography\HashProviderDispenser.Windows.cs (6)
136Debug.Fail("Caller should have checked length."); 148Debug.Assert(Interop.BCrypt.PseudoHandlesSupported); 172Debug.Fail("Caller should have checked length."); 192Debug.Assert(isHmac ? true : key.IsEmpty); 265Debug.Fail("Unknown hash algorithm."); 271Debug.Fail("Caller should have checked length.");
System\Security\Cryptography\HashStatic.cs (2)
36Debug.Assert(written == buffer.Length); 60Debug.Assert(bytesWritten == THash.HashSizeInBytes);
System\Security\Cryptography\Helpers.cs (5)
130Debug.Assert(index < cbHex); 141Debug.Assert(index == cbHex); 183Debug.Fail("input.Overlaps(primitive) failed after TryReadPrimitiveOctetString succeeded"); 249Debug.Fail($"Missing match criteria for curve type {aCurve.CurveType}"); 335Debug.Fail("Contents do not overlap original span");
System\Security\Cryptography\HKDF.cs (2)
154Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 187Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation");
System\Security\Cryptography\HKDF.Windows.cs (5)
111Debug.Assert(!OperatingSystem.IsWindowsVersionAtLeast(10, 0, 17134) || openStatus == NTSTATUS.STATUS_SUCCESS); 123Debug.Assert(Interop.BCrypt.PseudoHandlesSupported); 124Debug.Assert(hashAlgorithmName.Name is not null); 180Debug.Assert(salt.IsEmpty); 223Debug.Fail("HKDF resultLength != destination.Length");
System\Security\Cryptography\HKDFManagedImplementation.cs (4)
15Debug.Assert(written == prk.Length, $"Bytes written is {written} bytes which does not match output length ({prk.Length} bytes)"); 20Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength); 68Debug.Assert(hashLength <= 512 / 8, "hashLength is larger than expected, consider increasing this value or using regular allocation"); 97Debug.Assert(written == output.Length, $"Bytes written is {written} bytes which does not match output length ({output.Length} bytes)");
System\Security\Cryptography\HMACCommon.cs (7)
30Debug.Assert(!string.IsNullOrEmpty(hashAlgorithmId)); 31Debug.Assert(blockSize > 0 || blockSize == -1); 44Debug.Assert(!string.IsNullOrEmpty(hashAlgorithmId)); 45Debug.Assert(blockSize is > 0 or -1); 83Debug.Assert(SHA3_256.IsSupported); 87Debug.Assert(SHA3_384.IsSupported); 91Debug.Assert(SHA3_512.IsSupported);
System\Security\Cryptography\HMACMD5.cs (1)
58Debug.Assert(HashSizeValue == HashSizeInBits);
System\Security\Cryptography\HMACSHA1.cs (1)
54Debug.Assert(HashSizeValue == HashSizeInBits);
System\Security\Cryptography\HMACSHA256.cs (1)
53Debug.Assert(HashSizeValue == HashSizeInBits);
System\Security\Cryptography\HMACSHA3_256.cs (1)
75Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits);
System\Security\Cryptography\HMACSHA3_384.cs (1)
75Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits);
System\Security\Cryptography\HMACSHA3_512.cs (1)
75Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits);
System\Security\Cryptography\HMACSHA384.cs (1)
52Debug.Assert(HashSizeValue == HashSizeInBits);
System\Security\Cryptography\HMACStatic.cs (5)
33Debug.Assert(written == THMAC.HashSizeInBytes); 54Debug.Assert(written == buffer.Length); 80Debug.Assert(bytesWritten == THMAC.HashSizeInBytes); 183Debug.Assert(written == THMAC.HashSizeInBytes); 233Debug.Assert(written == THMAC.HashSizeInBytes);
System\Security\Cryptography\IncrementalHash.cs (16)
30Debug.Assert(!string.IsNullOrEmpty(name.Name)); 31Debug.Assert(hash != null); 40Debug.Assert(!string.IsNullOrEmpty(name.Name)); 41Debug.Assert(hmac != null); 104Debug.Assert((_hash != null) ^ (_hmac != null)); 128Debug.Assert(written == HashLengthInBytes); 175Debug.Assert(destination.Length >= HashLengthInBytes); 177Debug.Assert((_hash != null) ^ (_hmac != null)); 200Debug.Assert(written == HashLengthInBytes); 265Debug.Assert(destination.Length >= HashLengthInBytes); 267Debug.Assert((_hash != null) ^ (_hmac != null)); 282Debug.Assert((_hash != null) ^ (_hmac != null)); 457Debug.Assert(!HMACSHA3_256.IsSupported); 460Debug.Assert(!HMACSHA3_384.IsSupported); 463Debug.Assert(!HMACSHA3_512.IsSupported); 494Debug.Assert(written == ih.HashLengthInBytes);
System\Security\Cryptography\Kmac128.cs (4)
119Debug.Assert(written == outputLength); 137Debug.Assert(written == destination.Length); 160Debug.Assert(written == outputLength); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\Kmac256.cs (4)
119Debug.Assert(written == outputLength); 137Debug.Assert(written == destination.Length); 160Debug.Assert(written == outputLength); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof128.cs (4)
119Debug.Assert(written == outputLength); 137Debug.Assert(written == destination.Length); 160Debug.Assert(written == outputLength); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof256.cs (4)
119Debug.Assert(written == outputLength); 137Debug.Assert(written == destination.Length); 160Debug.Assert(written == outputLength); 177Debug.Assert(written == destination.Length);
System\Security\Cryptography\LiteHash.Windows.cs (6)
90Debug.Fail($"Unexpected hash algorithm name '{algorithm}'."); 105Debug.Fail("Unexpectedly asked for the hash size of KMAC."); 210Debug.Fail($"Unexpected hash algorithm name '{algorithm}'."); 225Debug.Fail("Unexpectedly asked for the hash size of a XOF."); 360Debug.Assert(destination.Length >= _hashSizeInBytes, $"{destination.Length} >= {_hashSizeInBytes}"); 433Debug.Assert(destination.Length >= _hashSizeInBytes);
System\Security\Cryptography\LiteHashProvider.cs (3)
24Debug.Assert(written == hashSizeInBytes); 76Debug.Assert(written == hashSizeInBytes); 179Debug.Assert(written == result.Length);
System\Security\Cryptography\LiteHashProvider.Xof.cs (4)
17Debug.Assert(written == destination.Length); 25Debug.Assert(written == outputLength); 39Debug.Assert(written == destination.Length); 53Debug.Assert(written == outputLength);
System\Security\Cryptography\MD5CryptoServiceProvider.cs (1)
30Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\MLDsaOpenSsl.NotSupported.cs (12)
21Debug.Fail("Caller should have checked platform availability."); 27Debug.Fail("Caller should have checked platform availability."); 33Debug.Fail("Caller should have checked platform availability."); 39Debug.Fail("Caller should have checked platform availability."); 45Debug.Fail("Caller should have checked platform availability."); 51Debug.Fail("Caller should have checked platform availability."); 57Debug.Fail("Caller should have checked platform availability."); 63Debug.Fail("Caller should have checked platform availability."); 69Debug.Fail("Caller should have checked platform availability."); 75Debug.Fail("Caller should have checked platform availability."); 81Debug.Fail("Caller should have checked platform availability."); 87Debug.Fail("Caller should have checked platform availability.");
System\Security\Cryptography\MLKemOpenSsl.NotSupported.cs (8)
21Debug.Fail("Caller should have checked platform availability."); 27Debug.Fail("Caller should have checked platform availability."); 33Debug.Fail("Caller should have checked platform availability."); 39Debug.Fail("Caller should have checked platform availability."); 45Debug.Fail("Caller should have checked platform availability."); 51Debug.Fail("Caller should have checked platform availability."); 57Debug.Fail("Caller should have checked platform availability."); 63Debug.Fail("Caller should have checked platform availability.");
System\Security\Cryptography\Oid.cs (2)
140Debug.Assert(value != null); 141Debug.Assert(friendlyName != null);
System\Security\Cryptography\OidCollection.cs (1)
21Debug.Assert(initialCapacity >= 0);
System\Security\Cryptography\OidLookup.cs (2)
109Debug.Assert(s_friendlyNameToOid.Count == FriendlyNameToOidCount, 111Debug.Assert(s_oidToFriendlyName.Count == OidToFriendlyNameCount,
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
201Debug.Assert(_hash != null);
System\Security\Cryptography\Pbkdf2Implementation.Windows.cs (8)
27Debug.Assert(!destination.IsEmpty); 28Debug.Assert(iterations >= 0); 40Debug.Assert(hashAlgorithm.Name is not null); 77Debug.Fail("Preallocated buffer was too small."); 86Debug.Assert(symmetricKeyMaterial.Length > 0); 147Debug.Assert(!keyHandle.IsInvalid); 193Debug.Fail("PBKDF2 resultLength != destination.Length"); 218Debug.Fail($"Unexpected hash algorithm '{hashAlgorithmName}'");
System\Security\Cryptography\PemEncoding.cs (14)
235Debug.Assert(destination.Length >= size); 246Debug.Assert(startPosition <= str.Length); 389Debug.Assert(Utf16PemEncoder.PostEBPrefix.Length == Utf8PemEncoder.PostEBPrefix.Length); 390Debug.Assert(Utf16PemEncoder.PreEBPrefix.Length == Utf8PemEncoder.PreEBPrefix.Length); 391Debug.Assert(Utf16PemEncoder.Ending.Length == Utf8PemEncoder.Ending.Length); 472Debug.Assert(encodedSize == charsWritten); 535Debug.Assert(encodedSize == bytesWritten); 584Debug.Assert(byteWritten == encodedSize); 614Debug.Assert(remainingData.Length < BytesPerLine); 668Debug.Assert(charsWritten == encodedSize); 721Debug.Fail("WriteCore wrote the wrong amount of data"); 757Debug.Fail("Convert.TryToBase64Chars failed with a pre-sized buffer"); 788Debug.Fail("Base64.EncodeToUtf8 failed with a pre-sized buffer"); 792Debug.Assert(bytesConsumed == bytes.Length);
System\Security\Cryptography\PemKeyHelpers.cs (4)
146Debug.Fail("Base64 decoding failed on already validated contents."); 150Debug.Assert(bytesWritten == base64size); 232Debug.Fail("Base64 decoding failed on already validated contents."); 236Debug.Assert(bytesWritten == base64size);
System\Security\Cryptography\PKCS1MaskGenerationMethod.cs (1)
46Debug.Assert(hasher.Hash != null);
System\Security\Cryptography\RandomNumberGenerator.cs (2)
308Debug.Assert(!destination.IsEmpty); 351Debug.Assert(choices.Length > 0);
System\Security\Cryptography\RandomNumberGeneratorImplementation.Windows.cs (1)
12Debug.Assert(count > 0);
System\Security\Cryptography\RC2CryptoServiceProvider.Windows.cs (1)
106Debug.Assert(EffectiveKeySize == KeySize);
System\Security\Cryptography\RC2Implementation.cs (5)
78Debug.Assert(EffectiveKeySize == KeySize); 91Debug.Assert(EffectiveKeySize == KeySize); 115Debug.Assert(EffectiveKeySize == KeySize); 140Debug.Assert(EffectiveKeySize == KeySize); 165Debug.Assert(EffectiveKeySize == KeySize);
System\Security\Cryptography\Rfc2898DeriveBytes.cs (5)
185Debug.Assert(_blockSize > 0); 207Debug.Assert(_startIndex == 0 && _endIndex == 0, "Invalid start or end index in the internal buffer."); 290Debug.Assert(_blockSize == _buffer.Length); 300Debug.Assert(bytesWritten == _blockSize); 308Debug.Assert(bytesWritten == _blockSize);
System\Security\Cryptography\Rfc2898DeriveBytes.OneShot.cs (4)
268Debug.Assert(hashAlgorithm.Name is not null); 269Debug.Assert(iterations > 0); 309Debug.Assert(hashAlgorithm.Name is not null); 310Debug.Assert(iterations > 0);
System\Security\Cryptography\RijndaelImplementation.cs (1)
35Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RijndaelManaged.cs (1)
31Debug.Assert(BlockSizeValue == 128);
System\Security\Cryptography\RSABCrypt.cs (3)
47Debug.Assert(_key != null); 61Debug.Assert(!newKey.IsInvalid); 423Debug.Fail(
System\Security\Cryptography\RSACng.cs (3)
46Debug.Assert(key is not null); 47Debug.Assert(key.AlgorithmGroup == CngAlgorithmGroup.Rsa); 48Debug.Assert(transferOwnership);
System\Security\Cryptography\RSACng.Key.cs (1)
31Debug.Assert(key != null);
System\Security\Cryptography\RSACryptoServiceProvider.Windows.cs (10)
73Debug.Assert(localHandle != null); 89Debug.Assert(hProv != null); 90Debug.Assert(!hProv.IsInvalid); 91Debug.Assert(!hProv.IsClosed); 142Debug.Assert(hKey != null); 143Debug.Assert(!hKey.IsInvalid); 144Debug.Assert(!hKey.IsClosed); 182Debug.Assert(localHandle != null); 478Debug.Assert(rgbHash != null); 482Debug.Assert(localHandle != null);
System\Security\Cryptography\SHA1CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SHA256CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SHA384CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SHA512CryptoServiceProvider.cs (1)
33Debug.Fail("Reset expected a properly sized buffer.");
System\Security\Cryptography\SlhDsaOpenSsl.NotSupported.cs (9)
17Debug.Fail("Caller should have checked platform availability."); 23Debug.Fail("Caller should have checked platform availability."); 29Debug.Fail("Caller should have checked platform availability."); 35Debug.Fail("Caller should have checked platform availability."); 41Debug.Fail("Caller should have checked platform availability."); 47Debug.Fail("Caller should have checked platform availability."); 53Debug.Fail("Caller should have checked platform availability."); 59Debug.Fail("Caller should have checked platform availability."); 65Debug.Fail("Caller should have checked platform availability.");
System\Security\Cryptography\SP800108HmacCounterKdfImplementationCng.cs (1)
12Debug.Assert(hashAlgorithm.Name is not null);
System\Security\Cryptography\SymmetricPadding.cs (3)
13Debug.Assert(plaintextLength >= 0); 31Debug.Fail($"Unknown padding mode {paddingMode}."); 145Debug.Fail($"Unknown padding mode {padding}.");
System\Security\Cryptography\TripleDES.cs (4)
81Debug.Assert(start1 >= 0); 82Debug.Assert(start2 >= 0); 83Debug.Assert((start1 + count) <= rgbKey.Length); 84Debug.Assert((start2 + count) <= rgbKey.Length);
System\Security\Cryptography\UniversalCryptoDecryptor.cs (3)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length); 57Debug.Assert(inputBuffer.Length % InputBlockSize == 0, "Did not remove whole blocks for depadding"); 157Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoEncryptor.cs (3)
35Debug.Assert(!inputBuffer.Overlaps(outputBuffer)); 42Debug.Assert(padWritten == transformWritten); 52Debug.Assert(written == buffer.Length);
System\Security\Cryptography\UniversalCryptoOneShot.cs (4)
116Debug.Assert(input.Length > cipher.BlockSizeInBytes); 129Debug.Assert(paddedBlock.Length % cipher.BlockSizeInBytes == 0); 130Debug.Assert(paddedBlock.Length <= MaxInStackDecryptionBuffer); 231Debug.Assert(padWritten == bytesWritten);
System\Security\Cryptography\UniversalCryptoTransform.cs (1)
86Debug.Assert(numBytesWritten >= 0 && numBytesWritten <= inputCount);
System\Security\Cryptography\X25519DiffieHellmanOpenSsl.NotSupported.cs (6)
18Debug.Fail("Caller should have checked platform availability."); 24Debug.Fail("Caller should have checked platform availability."); 30Debug.Fail("Caller should have checked platform availability."); 36Debug.Fail("Caller should have checked platform availability."); 42Debug.Fail("Caller should have checked platform availability."); 48Debug.Fail("Caller should have checked platform availability.");
System\Security\Cryptography\X509Certificates\CertificateExtensionsCommon.cs (2)
42Debug.Fail("Expected GetExpectedOidValue() to have thrown before we got here."); 72Debug.Fail("Expected GetExpectedOidValue() to have thrown before we got here.");
System\Security\Cryptography\X509Certificates\CertificateHelpers.Windows.cs (2)
132Debug.Fail("RSA key did not open with KeyNumber 0 or AT_SIGNATURE"); 165Debug.Fail("DSA key did not open with KeyNumber 0 or AT_SIGNATURE");
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.cs (1)
553Debug.Assert(exported != null);
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.Import.cs (3)
25Debug.Assert(!rawData.IsEmpty || fileName != null); 26Debug.Assert(password != null); 83Debug.Assert(fileName is not null);
System\Security\Cryptography\X509Certificates\CertificatePal.Windows.PrivateKey.cs (1)
88Debug.Fail("CryptoApi does not support ML-DSA.");
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (2)
686Debug.Assert(_generator != null); 709Debug.Fail($"Key was of no known type: {_key?.GetType().FullName ?? "null"}");
System\Security\Cryptography\X509Certificates\CertificateRequest.Load.cs (2)
58Debug.Fail("Base64Decode failed, but PemEncoding said it was legal"); 415Debug.Fail(
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
31Debug.Assert(revoked != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
276Debug.Fail("Base64Decode failed, but PemEncoding said it was legal");
System\Security\Cryptography\X509Certificates\ChainPal.Windows.GetChainStatusInformation.cs (3)
24Debug.Assert(index < chainStatus.Length); 38Debug.Assert(index < chainStatus.Length); 47Debug.Assert(index == chainStatus.Length);
System\Security\Cryptography\X509Certificates\ECDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 100Debug.Assert(ecParameters.Q.X!.Length == ecParameters.Q.Y!.Length);
System\Security\Cryptography\X509Certificates\FindPal.cs (2)
32Debug.Assert(s_keyUsages.Count == NamedKeyUsageFlagsCount); 164Debug.Assert(findValue != null);
System\Security\Cryptography\X509Certificates\FindPal.Windows.cs (4)
134Debug.Assert(cbDecoded >= sizeof(CERT_NAME_VALUE)); 142Debug.Assert(cbDecoded >= sizeof(CERT_TEMPLATE_EXT)); 259Debug.Assert(cbDecoded >= sizeof(CERT_POLICIES_INFO)); 475Debug.Assert(dwNameType != Interop.Crypt32.CertNameType.CERT_NAME_ATTR_TYPE);
System\Security\Cryptography\X509Certificates\LegacyBasicConstraintsDecoder.Windows.cs (1)
26Debug.Assert(cbDecoded >= sizeof(CERT_BASIC_CONSTRAINTS_INFO));
System\Security\Cryptography\X509Certificates\MLDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 34Debug.Assert(writer.GetEncodedLength() <= InitialCapacity);
System\Security\Cryptography\X509Certificates\Pkcs10CertificationRequestInfo.cs (3)
40Debug.Assert(signatureGenerator != null); 41Debug.Assert(Subject != null); 42Debug.Assert(PublicKey != null);
System\Security\Cryptography\X509Certificates\RSAPkcs1X509SignatureGenerator.cs (1)
15Debug.Assert(key != null);
System\Security\Cryptography\X509Certificates\RSAPssX509SignatureGenerator.cs (3)
17Debug.Assert(key != null); 18Debug.Assert(padding != null); 19Debug.Assert(padding.Mode == RSASignaturePaddingMode.Pss);
System\Security\Cryptography\X509Certificates\SlhDsaX509SignatureGenerator.cs (2)
16Debug.Assert(key != null); 35Debug.Assert(writer.GetEncodedLength() <= InitialCapacity);
System\Security\Cryptography\X509Certificates\StorePal.cs (1)
58Debug.Assert(_coll is not null);
System\Security\Cryptography\X509Certificates\StorePal.Windows.cs (1)
40Debug.Assert(collection != null);
System\Security\Cryptography\X509Certificates\StorePal.Windows.Export.cs (4)
27Debug.Assert(password != null); 140Debug.Assert(exportParameters is null); 177Debug.Fail("Mac validation failed."); 198Debug.Fail($"Unknown confidentiality mode {safeContents.ConfidentialityMode}.");
System\Security\Cryptography\X509Certificates\StorePal.Windows.Import.cs (2)
25Debug.Assert(password != null); 71Debug.Assert(fileName is not null);
System\Security\Cryptography\X509Certificates\WindowsHelpers.cs (1)
61Debug.Assert(bytesWritten == oidString.Length);
System\Security\Cryptography\X509Certificates\WindowsInterop.crypt32.cs (1)
40Debug.Assert(buffer[cchCount - 1] == '\0');
System\Security\Cryptography\X509Certificates\X500DistinguishedName.cs (1)
144Debug.Fail("ValueAsnReader produced a span outside of the original bounds");
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
231Debug.Assert(written == 2);
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (2)
64Debug.Assert(overlaps, "ValueAsnReader.ReadEncodedValue returns a slice of the source"); 65Debug.Assert(offset > 0);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
179Debug.Assert(_decoded is not null);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
142Debug.Assert(pal != null);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (16)
799Debug.Assert(!OperatingSystem.IsBrowser()); 801Debug.Assert(publicKey is not null); // The precondition check should ensure this is not null. 903Debug.Assert(!OperatingSystem.IsBrowser()); 1004Debug.Assert(!OperatingSystem.IsBrowser()); 1064Debug.Assert(publicKey.Algorithm.PublicKeySizeInBytes <= MaxPublicKeySize); 1103Debug.Assert(!OperatingSystem.IsBrowser()); 1538Debug.Fail("The contents should have already been validated by the PEM reader."); 1744Debug.Assert(rawSAN.GetType() == typeof(X509Extension)); 1780Debug.Assert(firstDot != 0, "Leading periods should have been rejected."); 1999Debug.Assert(certificate.GetKeyAlgorithm() == Oids.EcPublicKey); 2020Debug.Fail("Preallocated buffer and validated data decoding failed."); 2025Debug.Assert(!decryptedPkcs8.HasValue); 2063Debug.Assert(certificate.GetKeyAlgorithm() == Oids.EcPublicKey); 2111Debug.Fail("Preallocated buffer and validated data decoding failed."); 2169Debug.Fail("Unexpected trailing data in PKCS#8 buffer."); 2186Debug.Fail("Unexpected trailing data in PKCS#8 buffer.");
System\Security\Cryptography\X509Certificates\X509Certificate2Collection.cs (4)
455Debug.Fail("The contents should have already been validated by the PEM reader."); 570Debug.Fail("Pre-allocated buffer was not the correct size."); 625Debug.Fail("Presized buffer is too small or did not write the correct amount."); 744Debug.Fail("Precomputed buffer was not large enough");
System\Security\Cryptography\X509Certificates\X509Certificate2Enumerator.cs (1)
16Debug.Assert(collection != null);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.netcore.cs (6)
26Debug.Assert(pal is not null); 35Debug.Assert(pal is not null); 48Debug.Assert(loaderLimits is not null); 72Debug.Assert(loaderLimits is not null); 132Debug.Assert(_pal is not null); 140Debug.Assert(_pal is not null);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Windows.cs (7)
98Debug.Assert(nextCert is not null); 99Debug.Assert(!nextCert.IsInvalid); 165Debug.Assert(nextCert is not null); 166Debug.Assert(!nextCert.IsInvalid); 180Debug.Assert(objectType != 0); 181Debug.Assert(pvObject != (void*)0); 282Debug.Assert((keyStorageFlags & KeyStorageFlagsAll) == keyStorageFlags);
System\Security\Cryptography\X509Certificates\X509Chain.cs (1)
31Debug.Assert(_pal != null);
System\Security\Cryptography\X509Certificates\X509ChainElementCollection.cs (1)
21Debug.Assert(chainElements != null);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.PublicKey.cs (5)
179Debug.Assert(ecBlob.Length >= sizeof(Interop.BCrypt.BCRYPT_ECCKEY_BLOB)); 295Debug.Assert(cbDecoded >= sizeof(DATA_BLOB)); 310Debug.Assert(cbDecoded >= sizeof(CERT_DSS_PARAMETERS)); 332Debug.Assert(!cryptHandle.IsInvalid); 349Debug.Assert(!cryptHandle.IsInvalid);
System\Security\Cryptography\X509Certificates\X509Pal.Windows.X500DistinguishedName.cs (2)
45Debug.Assert(distinguishedName != null); 109Debug.Assert((dwFlags & ~allFlags) == 0);
System\Security\Cryptography\X509Certificates\X509Store.cs (1)
82Debug.Assert(_storePal != null);
System\Security\Cryptography\X509Certificates\X509SubjectAlternativeNameExtension.cs (1)
100Debug.Assert(value.Length is 4 or 16);
System\Security\Cryptography\X509Certificates\X509SubjectKeyIdentifierExtension.cs (2)
174Debug.Assert(written == SHA1.HashSizeInBytes); 211Debug.Assert(written >= TruncateSize);
System\Security\Cryptography\XmlKeyHelper.cs (6)
79Debug.Assert(buf != null); 124Debug.Assert(name.Length > 0); 125Debug.Assert(value.Length > 0); 126Debug.Assert(builder != null); 148Debug.Fail($"Convert.TryToBase64Chars failed with {localLength} bytes to {StackChars} chars"); 247Debug.Fail("Original enumerator had elements, new one does not");
System.Security.Cryptography.Cose (47)
src\runtime\src\libraries\System.Formats.Cbor\src\System\Formats\Cbor\CborInitialByte.cs (2)
47Debug.Assert((byte)majorType < 8, "CBOR Major Type is out of range"); 48Debug.Assert((byte)additionalInfo < 32, "CBOR initial byte additional info is out of range");
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 377Debug.Assert(bytesWritten == ComputeEncodedSize(map, algHeaderValueToSlip));
System\Security\Cryptography\Cose\CoseKey.cs (18)
185Debug.Fail($"Unknown key type: {KeyType}"); 195Debug.Assert(_ecdsaKey != null); 198Debug.Assert(_rsaKey != null); 199Debug.Assert(HashAlgorithm != null); 200Debug.Assert(RSASignaturePadding != null); 204Debug.Assert(_mldsaKey != null); 210Debug.Fail("Unknown key type"); 219Debug.Fail("TrySignData failed with a pre-calculated destination"); 230Debug.Fail("TrySignData failed with a pre-calculated destination"); 243Debug.Assert(_ecdsaKey != null); 248Debug.Assert(_rsaKey != null); 249Debug.Assert(RSASignaturePadding != null); 250Debug.Assert(HashAlgorithm != null); 256Debug.Assert(_mldsaKey != null); 262Debug.Fail($"Unknown keyType: {KeyType}"); 270Debug.Assert(signaturePadding != null); 283Debug.Assert(signaturePadding == RSASignaturePadding.Pkcs1); 333Debug.Assert(HashAlgorithm != null);
System\Security\Cryptography\Cose\CoseMessage.cs (10)
161Debug.Assert(reader.BytesRemaining == 0); 246Debug.Assert(reader.BytesRemaining == 0); 329Debug.Fail("Unexpected ArgumentException from CoseHeaderMap.Add"); 424Debug.Assert(reader.BytesRemaining == 0); 520Debug.Assert(context == SigStructureContext.Signature1); 521Debug.Assert(signProtected.Length == 0); 532Debug.Assert(bytesWritten == ComputeToBeSignedEncodedSize(context, bodyProtected.Length, signProtected.Length, associatedData.Length, content.Length)); 551Debug.Assert(context == SigStructureContext.Signature1); 552Debug.Assert(signProtectedLength == 0); 635Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (5)
215Debug.Assert(expectedSize == bytesWritten); 283Debug.Assert(buffer.Length == bytesWritten); 357Debug.Assert(expectedSize == bytesWritten); 510Debug.Assert(protectedHeadersSize == 1); 625Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSign1Message.cs (6)
169Debug.Assert(contentStream == null || (isDetached && contentBytes.Length == 0)); 177Debug.Assert(expectedSize == bytesWritten); 226Debug.Assert(buffer.Length == bytesWritten); 288Debug.Assert(expectedSize == bytesWritten); 773Debug.Assert(contentStream == null || contentBytes.Length == 0); 1024Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSignature.cs (1)
63Debug.Assert(_message != null);
System\Security\Cryptography\Cose\CoseSigner.cs (1)
176Debug.Assert(alg.HasValue, "Algorithm (alg) is a known header and should have been validated in Set[Encoded]Value()");
System\Security\Cryptography\Cose\HashToBeSignedBuilder.cs (1)
36Debug.Assert(_incrementalHash.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512).
System\Security\Cryptography\Cose\PureDataToBeSignedBuilder.cs (1)
42Debug.Assert(_stream.Length <= int.MaxValue);
System.Security.Cryptography.Pkcs (181)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (2)
50Debug.Fail("Unknown SubjectIdentifierOrKey state"); 141Debug.Assert(asn.Parameters != null);
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (4)
35Debug.Assert(certificate != null); 58Debug.Fail($"TryGetPrimitiveOctetStringBytes returned false in DER mode"); 92Debug.Fail($"Unknown key type requested: {typeof(T).FullName}"); 163Debug.Assert(algorithmIdentifier != null);
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decode.cs (1)
73Debug.Fail($"{nameof(RecipientInfoAsn)} deserialized with an unknown recipient type");
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decrypt.cs (2)
43Debug.Assert((cert != null) ^ (privateKey != null)); 136Debug.Assert(encoded[0] == 0x04);
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (2)
99Debug.Assert(cert != null); 203Debug.Fail("TryDecrypt wanted more space than the key size");
Internal\Cryptography\Pal\Windows\DecryptorPalWindows.Decrypt.cs (6)
27Debug.Assert((cert != null) ^ (privateKey != null)); 75Debug.Assert(recipientInfo != null); 76Debug.Assert(cert != null); 77Debug.Assert(originatorCerts != null); 78Debug.Assert(extraStore != null); 110Debug.Fail($"Unexpected RecipientInfoType: {type}");
Internal\Cryptography\Pal\Windows\HelpersWindows.cs (4)
236Debug.Fail("Only the framework can construct SubjectIdentifier's so if we got a bad value here, that's our fault."); 384Debug.Fail("PP_PROVTYPE writes a DWORD - enum misalignment?"); 398Debug.Fail("PP_KEYSET_TYPE writes a DWORD - enum misalignment?"); 422Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows));
Internal\Cryptography\Pal\Windows\PkcsPalWindows.cs (5)
131Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 158Debug.Fail($"Unknown CNG key type request: {typeof(T).FullName}"); 171Debug.Assert(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)); 172Debug.Assert((cspParams.Flags & CspProviderFlags.UseExistingKey) != 0); 185Debug.Fail($"Unknown CAPI key type request: {typeof(T).FullName}");
Internal\Cryptography\Pal\Windows\PkcsPalWindows.Encrypt.cs (1)
423Debug.Fail($"Unexpected SubjectIdentifierType: {type}");
Internal\Cryptography\PkcsHelpers.cs (7)
32Debug.Assert(oid != null); 88Debug.Assert(arr != null); 89Debug.Assert(idx >= 0); 90Debug.Assert(idx < arr.Length); 209Debug.Fail($"Invalid recipientIdentifier type: {recipientIdentifierType}"); 286Debug.Assert((normalizedString.Length & 0x1) == 0); 310Debug.Fail($"Invalid hex character: {c}");
Microsoft\Win32\SafeHandles\SafeProvOrNCryptKeyHandleUwp.cs (2)
21Debug.Assert(parentHandle != null && !parentHandle.IsClosed && !parentHandle.IsInvalid); 24Debug.Assert(!IsInvalid);
src\runtime\src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (1)
193Debug.Fail("input.Overlaps(primitive) failed after TryReadPrimitiveOctetString succeeded");
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeHashHandle.cs (4)
28Debug.Assert(_parent == null); 29Debug.Assert(!parent.IsClosed); 30Debug.Assert(!parent.IsInvalid); 54Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeKeyHandle.cs (4)
63Debug.Assert(_parent == null); 64Debug.Assert(!parent.IsClosed); 65Debug.Assert(!parent.IsInvalid); 89Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\SafeProvHandle.cs (1)
119Debug.Assert(successfullyFreed);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CMSG_CMS_RECIPIENT_INFO.cs (2)
27Debug.Assert(dwRecipientChoice == CMsgCmsRecipientChoice.CMSG_KEY_TRANS_RECIPIENT); 36Debug.Assert(dwRecipientChoice == CMsgCmsRecipientChoice.CMSG_KEY_AGREE_RECIPIENT);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.CMSG_KEY_AGREE_RECIPIENT_INFO.cs (2)
29Debug.Assert(dwOriginatorChoice == CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_CERT); 38Debug.Assert(dwOriginatorChoice == CMsgKeyAgreeOriginatorChoice.CMSG_KEY_AGREE_ORIGINATOR_PUBLIC_KEY);
src\runtime\src\libraries\Common\src\Interop\Windows\Crypt32\Interop.FindOidInfo.cs (1)
54Debug.Assert(key != null);
src\runtime\src\libraries\Common\src\Interop\Windows\NCrypt\Interop.Properties.cs (2)
47Debug.Assert(cbResult == sizeof(byte)); 68Debug.Assert(cbResult == sizeof(int));
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (3)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about 82Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} bytes when {expectedOutputSize} was expected");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
80Debug.Assert(attribute != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\CryptoPool.cs (3)
17Debug.Assert(arraySegment.Array != null); 18Debug.Assert(arraySegment.Offset == 0); 25Debug.Assert(clearSize <= array.Length);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.cs (2)
175Debug.Assert(algorithmIdentifierLength > 0, "algorithmIdentifier was empty"); 176Debug.Assert(privateKeyLength > 0, "privateKey was empty");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\KeyFormatHelper.Encrypted.cs (1)
229Debug.Assert(cipher.BlockSize <= 128, $"Encountered unexpected block size: {cipher.BlockSize}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (3)
49Debug.Assert(oidValue != null); 86Debug.Assert( 130Debug.Assert(oid is not null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (22)
42Debug.Assert(pbeParameters != null); 45Debug.Assert(pbeParameters.IterationCount > 0); 103Debug.Assert(destination.Length >= encryptedData.Length); 176Debug.Assert(digestAlgorithmName.Name != null); 177Debug.Assert(cipher != null); 229Debug.Assert(written == buf.Length); 266Debug.Assert(pbeParameters != null); 333Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 381Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 382Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 406Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 415Debug.Fail($"UTF-8 encoding size changed between GetByteCount and GetBytes"); 421Debug.Assert(pwdTmpBytes!.Length == 0); 434Debug.Assert(encryptor.CanTransformMultipleBlocks); 444Debug.Fail("TryEncode failed with a pre-allocated buffer"); 514Debug.Assert(written == buf.Length); 627Debug.Fail("Key-sized OID included in the if, but not the switch"); 785Debug.Fail($"No Specified Salt value is present, indicating a new choice was unhandled"); 915Debug.Fail( 982Debug.Assert(decryptor.CanTransformMultipleBlocks); 1037Debug.Fail("TryGetHashAndReset failed with pre-allocated input"); 1050Debug.Fail("TryGetHashAndReset failed with pre-allocated input");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (3)
184Debug.Fail("TryEncode failed with a pre-allocated buffer"); 197Debug.Assert(macKey.Length <= 128); 214Debug.Fail($"TryGetHashAndReset wrote {bytesWritten} of {macSpan.Length} bytes");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (6)
304Debug.Assert(target is not null); 324Debug.Assert(idx != -1); 419Debug.Assert(pbeParameters != null); 420Debug.Assert(pbeParameters.IterationCount >= 1); 503Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None); 559Debug.Fail($"No handler for {ConfidentialityMode}");
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
51Debug.Assert(algorithmId != null); 188Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span)); 219Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span));
src\runtime\src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (8)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 185Debug.Fail($"Hash output wrote {bytesWritten} bytes when {hashBuf.Length} was expected"); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0); 283Debug.Fail($"Unexpected written byte count ({count} vs {fullCopyLen})"); 300Debug.Fail($"Partial copy wrote {count} bytes of {destination.Length} expected");
System\Security\Cryptography\Pkcs\CmsSignature.cs (5)
93Debug.Assert(processor is not null); 98Debug.Assert(processor is not null); 102Debug.Fail("Unhandled RSA signature padding."); 175Debug.Assert( 234Debug.Assert(
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (2)
65Debug.Assert(Helpers.IsDSASupported); 118Debug.Assert(Helpers.IsDSASupported);
System\Security\Cryptography\Pkcs\CmsSignature.RSA.cs (1)
381Debug.Assert(hashAlgorithmName == HashAlgorithmName.MD5, $"Unsupported digest algorithm '{hashAlgorithmName.Name}'");
System\Security\Cryptography\Pkcs\CmsSigner.cs (2)
218Debug.Assert(privateKey is null or AsymmetricAlgorithm or MLDsa or SlhDsa); 378Debug.Fail($"Unresolved SignerIdentifierType value: {SignerIdentifierType}");
System\Security\Cryptography\Pkcs\EnvelopedCms.cs (3)
72Debug.Assert(_decryptorPal != null); 76Debug.Fail($"Unexpected _lastCall value: {_lastCall}"); 285Debug.Fail($"Unexpected _lastCall value: {_lastCall}");
System\Security\Cryptography\Pkcs\PublicKeyInfo.cs (2)
13Debug.Assert(algorithm != null); 14Debug.Assert(keyValue != null);
System\Security\Cryptography\Pkcs\RecipientInfo.cs (3)
19Debug.Assert(pal is KeyTransRecipientInfoPal); 23Debug.Assert(pal is KeyAgreeRecipientInfoPal); 27Debug.Fail($"Illegal recipientInfoType: {type}");
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (3)
64Debug.Assert(status == Rfc3161RequestResponseStatus.Accepted); 69Debug.Fail($"AcceptResponse should have thrown or returned true (status={status})"); 386Debug.Assert(token != null);
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (8)
44Debug.Assert(_signerInfo != null, "_signerInfo != null"); 190Debug.Fail( 204Debug.Assert(tsaCertificate != null); 205Debug.Assert(signer != null); 206Debug.Assert(tokenInfo != null); 480Debug.Assert(signerCert != null); 481Debug.Assert(certId.HasValue || certId2.HasValue); 526Debug.Fail(
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (2)
66Debug.Fail("Unable to decode the data we encoded"); 161Debug.Assert(_tsaNameBytes.HasValue);
System\Security\Cryptography\Pkcs\SignedCms.cs (9)
142Debug.Assert(_signedData.EncapContentInfo.Content != null); 258Debug.Fail($"TryCopyOctetStringBytes failed with an array larger than the encoded value"); 280Debug.Assert(contentType != Oids.Pkcs7Data); 371Debug.Assert(_heldContent != null); 372Debug.Assert(_contentType == contentType); 411Debug.Assert(_heldContent.HasValue); 456Debug.Assert(_heldContent != null); 606Debug.Assert(signers != null); 632Debug.Assert(signers != null);
System\Security\Cryptography\Pkcs\SignerInfo.cs (2)
56Debug.Assert(_signedAttributes != null); 493Debug.Assert(_signatureAlgorithm == Oids.NoSignature);
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (3)
23Debug.Assert(signerInfos != null); 30Debug.Assert(signedDataSignerInfos != null); 81Debug.Assert(signer != null);
System\Security\Cryptography\Pkcs\SignerInfoEnumerator.cs (1)
16Debug.Assert(signerInfos != null);
System\Security\Cryptography\Pkcs\SubjectIdentifier.cs (7)
23Debug.Assert(value != null); 28Debug.Assert(value is X509IssuerSerial); 32Debug.Assert(value is string); 36Debug.Fail($"Illegal type passed to SubjectIdentifier: {type}"); 93Debug.Fail("Do not know how to decode value"); 131Debug.Fail($"Invalid SubjectIdentifierType: {Type}"); 166Debug.Fail($"No match logic for SubjectIdentifierType {Type}");
System\Security\Cryptography\Pkcs\SubjectIdentifierOrKey.cs (5)
14Debug.Assert(value != null); 19Debug.Assert(value is X509IssuerSerial); 23Debug.Assert(value is string); 27Debug.Assert(value is PublicKeyInfo); 31Debug.Fail($"Illegal type passed to SubjectIdentifierOrKey: {type}");
System\Security\Cryptography\Xml\X509IssuerSerial.cs (2)
14Debug.Assert(!string.IsNullOrEmpty(issuerName)); 15Debug.Assert(!string.IsNullOrEmpty(serialNumber));
System.Security.Cryptography.ProtectedData (8)
System\Security\Cryptography\ProtectedData.cs (8)
31Debug.Assert(result); 32Debug.Assert(outputData != null); 69Debug.Assert(result); 70Debug.Assert(outputData != null); 183Debug.Assert(result); 184Debug.Assert(outputData != null); 222Debug.Assert(result); 223Debug.Assert(outputData != null);
System.Security.Cryptography.Xml (67)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
System\Security\Cryptography\Xml\CryptoHelpers.cs (1)
99Debug.Assert(!typeof(Transform).IsAssignableFrom(typeof(T)));
System\Security\Cryptography\Xml\EncryptedType.cs (2)
81Debug.Assert(t_depth >= 0, "LoadXml current thread depth is negative."); 93Debug.Assert(t_depth > 0, "LoadXml current thread depth is already 0.");
System\Security\Cryptography\Xml\SignedXml.cs (5)
576System.Diagnostics.Debug.Assert(cloneElem != null); 810Debug.Assert(_refProcessed != null); 811Debug.Assert(_refLevelCache != null); 961System.Diagnostics.Debug.Assert(a != null); 962System.Diagnostics.Debug.Assert(b != null);
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (52)
212Debug.Assert(key != null, "key != null"); 255Debug.Assert(o != null, "o != null"); 265Debug.Assert(oid != null, "oid != null"); 281Debug.Assert(signedXml != null, "signedXml != null"); 282Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null"); 316Debug.Assert(signedXml != null, "signedXml != null"); 317Debug.Assert(formatValidator != null, "formatValidator != null"); 339Debug.Assert(signedXml != null, "signedXml != null"); 340Debug.Assert(signedInfo != null, " signedInfo != null"); 358Debug.Assert(signedXml != null, "signedXml != null"); 388Debug.Assert(signedXml != null, "signedXml != null"); 418Debug.Assert(signedXml != null, "signedXml != null"); 419Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null"); 443Debug.Assert(signedXml != null, "signedXml != null"); 462Debug.Assert(signedXml != null, "signedXml != null"); 463Debug.Assert(validAlgorithms != null, "validAlgorithms != null"); 501Debug.Assert(signedXml != null, "signedXml != null"); 502Debug.Assert(validC14nAlgorithms != null, "validC14nAlgorithms != null"); 503Debug.Assert(validTransformAlgorithms != null, "validTransformAlgorithms != null"); 544Debug.Assert(signedXml != null, "signedXml != null"); 635Debug.Assert(signedXml != null, "signedXml != null"); 636Debug.Assert(signatureDescription != null, "signatureDescription != null"); 637Debug.Assert(hash != null, "hash != null"); 638Debug.Assert(asymmetricSignatureFormatter != null, "asymmetricSignatureFormatter != null"); 663Debug.Assert(signedXml != null, "signedXml != null"); 664Debug.Assert(key != null, "key != null"); 687Debug.Assert(signedXml != null, "signedXml != null"); 688Debug.Assert(reference != null, "reference != null"); 738Debug.Assert(signedXml != null, "signedXml != null"); 739Debug.Assert(key != null, "key != null"); 764Debug.Assert(signedXml != null, "signedXml != null"); 765Debug.Assert(certificate != null, "certificate != null"); 789Debug.Assert(signedXml != null, "signedXml != null"); 790Debug.Assert(reference != null, "reference != null"); 821Debug.Assert(signedXml != null, "signedXml != null"); 822Debug.Assert(reference != null, "reference != null"); 823Debug.Assert(actualHash != null, "actualHash != null"); 824Debug.Assert(expectedHash != null, "expectedHash != null"); 864Debug.Assert(signedXml != null, "signedXml != null"); 865Debug.Assert(signatureDescription != null, "signatureDescription != null"); 866Debug.Assert(hashAlgorithm != null, "hashAlgorithm != null"); 867Debug.Assert(asymmetricSignatureDeformatter != null, "asymmetricSignatureDeformatter != null"); 910Debug.Assert(signedXml != null, "signedXml != null"); 911Debug.Assert(mac != null, "mac != null"); 946Debug.Assert(signedXml != null, "signedXml != null"); 947Debug.Assert(certificate != null, "certificate != null"); 948Debug.Assert(chain != null, "chain != null"); 1038Debug.Assert(signedXml != null, "signedXml != null"); 1039Debug.Assert(reference != null, "reference != null"); 1067Debug.Assert(source != null, "source != null"); 1068Debug.Assert(!string.IsNullOrEmpty(data), "!string.IsNullOrEmpty(data)"); 1069Debug.Assert(InformationLoggingEnabled, "InformationLoggingEnabled");
System\Security\Cryptography\Xml\Utils.cs (1)
120Debug.Assert(IsNamespaceNode(a) || IsXmlNamespaceNode(a));
System.Security.Principal.Windows (14)
src\runtime\src\libraries\Common\src\Interop\Windows\Advapi32\Interop.LsaLookupSids.cs (1)
48System.Diagnostics.Debug.Assert(bufferSize > 0);
System\Security\Principal\IRCollection.cs (3)
196Debug.Fail("Source type is an IdentityReference type which has not been included in translation logic."); 258Debug.Fail("Source type is an IdentityReference type which has not been included in translation logic."); 351Debug.Fail("Source type is an IdentityReference type which has not been included in translation logic.");
System\Security\Principal\NTAccount.cs (2)
238Debug.Fail("NTAccount::TranslateToSids - source account name is too long."); 287Debug.Fail($"Interop.LsaLookupNames(2) returned unrecognized error {win32ErrorCode}");
System\Security\Principal\SID.cs (5)
508Debug.Fail($"Win32.CreateSidFromString returned unrecognized error {error}"); 592Debug.Fail($"Win32.GetWindowsAccountDomainSid returned unrecognized error {error}"); 617Debug.Fail($"Win32.CreateWellKnownSid returned unrecognized error {error}"); 782Debug.Fail($"Win32.GetWindowsAccountDomainSid returned unrecognized error {error}"); 1012Debug.Fail($"Interop.LsaLookupSids returned {win32ErrorCode}");
System\Security\Principal\WindowsIdentity.cs (3)
242Debug.Assert(!string.IsNullOrEmpty(packageName)); 889Debug.Assert(!_safeTokenHandle.IsInvalid && !_safeTokenHandle.IsClosed, "!m_safeTokenHandle.IsInvalid && !m_safeTokenHandle.IsClosed"); 893Debug.Assert(information!.ByteLength >= (ulong)sizeof(T),
System.ServiceModel.Federation (1)
System\Runtime\OperationWithTimeoutAsyncResult.cs (1)
159Debug.Assert(_manualResetEvent == null, "No ManualResetEvent should be created for a synchronous AsyncResult.");
System.ServiceModel.Primitives (1)
Internals\System\Runtime\Fx.cs (1)
108Debug.Assert(false, description);
System.ServiceModel.Syndication (27)
System\ServiceModel\Syndication\Atom10FeedFormatter.cs (1)
568Debug.Assert(!FeedUtils.IsXmlns(attr.Name, attr.Namespace), "XML namespace attributes should not be added to the list.");
System\ServiceModel\Syndication\ServiceDocumentFormatter.cs (3)
36Debug.Assert(categories != null); 44Debug.Assert(collection != null); 52Debug.Assert(workspace != null);
System\ServiceModel\Syndication\SyndicationElementExtension.cs (8)
223Debug.Assert(_extensionDataWriter != null, "outer name is null only for datacontract and xmlserializer cases"); 238Debug.Assert(extensionData != null && dataContractSerializer != null, "null check"); 247Debug.Assert(extensionData != null && serializer != null, "null check"); 258Debug.Assert((_dataContractSerializer == null && _outerName == null && _outerNamespace == null), "Xml serializer cannot have outer name, ns"); 263Debug.Assert(_xmlSerializer == null, "Xml serializer cannot be configured"); 281Debug.Assert(_outerName == null, "All callers of this function should already check for a null outer name."); 284Debug.Assert(_xmlSerializer == null, "only one of xmlserializer or datacontract serializer can be present"); 300Debug.Assert(_dataContractSerializer == null, "only one of xmlserializer or datacontract serializer can be present");
System\ServiceModel\Syndication\SyndicationElementExtensionCollection.cs (4)
163Debug.Assert(_initialized, "The constructor should never clear the collection."); 183Debug.Assert(_initialized, "The constructor should never remove items from the collection."); 192Debug.Assert(_initialized, "The constructor should never set items in the collection."); 243Debug.Assert((dcSerializer == null) != (xmlSerializer == null), "exactly one serializer should be supplied");
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (5)
424Debug.Assert(item != null); 432Debug.Assert(category != null); 440Debug.Assert(link != null); 448Debug.Assert(person != null); 456Debug.Assert(reader != null, "reader != null");
System\ServiceModel\Syndication\TextSyndicationContent.cs (1)
31Debug.Assert(source != null, "The base constructor already checks if source is valid.");
System\ServiceModel\Syndication\UrlSyndicationContent.cs (1)
24Debug.Assert(source != null, "The base constructor already checks if source is valid.");
System\ServiceModel\Syndication\XmlSyndicationContent.cs (4)
80Debug.Assert(source != null, "The base constructor already checks if source is valid."); 113Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 134Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null"); 155Debug.Assert(_contentBuffer != null, "contentBuffer cannot be null");
System.ServiceProcess.ServiceController (6)
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System.Speech (204)
Internal\GrammarBuilding\TagElement.cs (1)
82System.Diagnostics.Debug.Assert(false);
Internal\ObjectToken\ObjectToken.cs (1)
288Debug.Fail("Cannot query for interface " + typeof(ISpObjectWithToken).GUID + " from COM class " + clsid);
Internal\ObjectToken\RegistryDataKey.cs (1)
132System.Diagnostics.Debug.Assert(tokenId is not null, "sapiToken is missing an ID");
Internal\PhonemeConverter.cs (2)
193System.Diagnostics.Debug.Assert(posPhone == pmCompressed._phones.Length); 194System.Diagnostics.Debug.Assert(posCp == pmCompressed._cps.Length);
Internal\RBList.cs (19)
119System.Diagnostics.Debug.Fail("We don't expect First to be called on empty graphs"); 141System.Diagnostics.Debug.Assert(node.Parent?.Parent != null, "Tree is not in the right state to have an uncle"); 187Debug.Assert(color == NodeColor.BLACK); 274Debug.Assert(successor != null && successor.Left == null); 345Debug.Assert(node.IsRed); 365Debug.Assert(IsBlack(node.Parent.Parent)); 383Debug.Assert(IsRed(node)); 384Debug.Assert(IsRed(node.Parent)); 411Debug.Assert(node.Parent == node.Parent.Parent!.Left); // From case 3 416Debug.Assert(node.Parent == node.Parent.Parent!.Right); // From case 3 424Debug.Assert(node.Left == null || node.Right == null); 429Debug.Assert(node.Parent == null || node.Parent.Left == onlyChild || node.Parent.Right == onlyChild); 430Debug.Assert(onlyChild == null || onlyChild.Parent == node.Parent); 461Debug.Assert(IsBlack(node)); 474Debug.Assert(sibling != null); 477Debug.Assert(sibling.Left != null && sibling.Right != null); 560Debug.Assert(IsBlack(sibling)); 566Debug.Assert(GetColor(sibling.Right) == NodeColor.RED); 572Debug.Assert(GetColor(sibling.Left) == NodeColor.RED);
Internal\SapiInterop\SapiProxy.cs (1)
132System.Diagnostics.Debug.Assert(_recognizer is not null);
Internal\SeekableReadStream.cs (2)
22Debug.Assert(baseStream.CanRead); 37Debug.Assert(!value || _cacheDataForSeeking);
Internal\SrgsCompiler\Arc.cs (2)
129System.Diagnostics.Debug.Assert(diff != 0); 243System.Diagnostics.Debug.Assert(_startTags != null, "Should not call this method if there are no tags associated");
Internal\SrgsCompiler\BackEnd.cs (27)
104System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.pszWords); 107System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.pszSymbols); 110System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.pRules); 118System.Diagnostics.Debug.Assert(_basePath != null, "cBasePath should only be positive when we have a _basePath"); 122System.Diagnostics.Debug.Assert(_basePath.Length + 1 == cBasePath); 134System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.pArcs); 146System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.pWeights); 149System.Diagnostics.Debug.Assert(pWeights is not null, "If we need a weight table, we should have gotten one"); 153System.Diagnostics.Debug.Assert(streamBuffer.Stream.Position - startStreamPosition == header.tags); 184System.Diagnostics.Debug.Assert(header.pScripts == 0 || streamBuffer.Stream.Position - startStreamPosition == header.pScripts); 346System.Diagnostics.Debug.Assert(dwSymbolOffset == 0 || _symbols[iWord] == sRule); 484System.Diagnostics.Debug.Assert(destFromState != null); 517System.Diagnostics.Debug.Assert(tags.Count == 0); 528System.Diagnostics.Debug.Assert(rule._firstState != null); 623System.Diagnostics.Debug.Assert(tags.Count == 0); 669System.Diagnostics.Debug.Assert(stateToDelete != null); 670System.Diagnostics.Debug.Assert(stateToDelete.InArcs.IsEmpty); 671System.Diagnostics.Debug.Assert(stateToDelete.OutArcs.IsEmpty); 731System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(sToken)); 802System.Diagnostics.Debug.Assert(header.pszWords != null, "ConvertCfgHeader should set includeAllGrammarData"); 803System.Diagnostics.Debug.Assert(header.pszSymbols != null, "ConvertCfgHeader should set includeAllGrammarData"); 804System.Diagnostics.Debug.Assert(header.arcs != null, "ConvertCfgHeader should set includeAllGrammarData"); 805System.Diagnostics.Debug.Assert(header.tags != null, "ConvertCfgHeader should set includeAllGrammarData"); 933System.Diagnostics.Debug.Assert(header.tags[iCurTag].StartArcIndex == k); 1100System.Diagnostics.Debug.Assert(ruleName is not null); 1121System.Diagnostics.Debug.Assert(apStateTable[firstArc] == null); 1162System.Diagnostics.Debug.Assert(!srcToDestHash.ContainsKey(srcToState));
Internal\SrgsCompiler\CFGGrammar.cs (2)
442System.Diagnostics.Debug.Assert(header.tags != null, "Including all grammar data should have populated the tags field"); 443System.Diagnostics.Debug.Assert(header.arcs != null, "Including all grammar data should have populated the arcs field");
Internal\SrgsCompiler\CfgSemanticTag.cs (1)
75System.Diagnostics.Debug.Fail("Unknown Semantic Tag type");
Internal\SrgsCompiler\GrammarElement.cs (1)
319System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(sRuleId));
Internal\SrgsCompiler\Graph.cs (16)
141System.Diagnostics.Debug.Assert(true); 170System.Diagnostics.Debug.Assert(srcState != null); 171System.Diagnostics.Debug.Assert(srcState != destState); 184System.Diagnostics.Debug.Assert(destState != null); 189System.Diagnostics.Debug.Assert(srcState != null); 191System.Diagnostics.Debug.Assert(srcState.OutArcs.IsEmpty); 216System.Diagnostics.Debug.Assert(srcState != null); 217System.Diagnostics.Debug.Assert((destState != null) && (destState != srcState)); 218System.Diagnostics.Debug.Assert(srcState.InArcs.IsEmpty); 229System.Diagnostics.Debug.Assert(srcState != null); 230System.Diagnostics.Debug.Assert(srcState.InArcs.IsEmpty); 738System.Diagnostics.Debug.Assert(startState != null); 770System.Diagnostics.Debug.Assert(arc.End != null); 813System.Diagnostics.Debug.Assert(arc.SemanticTagCount == 0); 816System.Diagnostics.Debug.Assert(arc.IsPropertylessTransition); 830System.Diagnostics.Debug.Assert(arcs.ContainsMoreThanOneItem);
Internal\SrgsCompiler\Item.cs (3)
81System.Diagnostics.Debug.Assert(_endArc?.Start != null); 92System.Diagnostics.Debug.Assert(newEndState.OutArcs.CountIsOne && Arc.CompareContent(_endArc, newEndState.OutArcs.First) == 0); 121System.Diagnostics.Debug.Assert(_endArc != null);
Internal\SrgsCompiler\OneOf.cs (2)
78System.Diagnostics.Debug.Assert(start.End == startEndState); 90System.Diagnostics.Debug.Assert(end.Start == endStartState);
Internal\SrgsCompiler\ParseElementCollection.cs (6)
106System.Diagnostics.Debug.Assert(startArc.End == startState); 110System.Diagnostics.Debug.Assert(startState.OutArcs.CountIsOne); 112System.Diagnostics.Debug.Assert(startArc.Start == startState); 139System.Diagnostics.Debug.Assert(endArc.Start == endState); 143System.Diagnostics.Debug.Assert(endState.InArcs.CountIsOne); 145System.Diagnostics.Debug.Assert(endArc.End == endState);
Internal\SrgsCompiler\PropertyTag.cs (1)
75System.Diagnostics.Debug.Assert(false);
Internal\SrgsCompiler\Rule.cs (2)
157System.Diagnostics.Debug.Assert(_startArc == null); 170System.Diagnostics.Debug.Assert(_startArc.End == _startArc.End);
Internal\SrgsCompiler\RuleRef.cs (2)
128System.Diagnostics.Debug.Fail("Unknown special ruleref type"); 143System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(sRuleId));
Internal\SrgsCompiler\ScriptRef.cs (1)
37System.Diagnostics.Debug.Assert(script._idRule != -1 && script._idMethod != -1);
Internal\SrgsCompiler\SRGSCompiler.cs (1)
31System.Diagnostics.Debug.Assert(!fOutputCfg || xmlReaders.Length == 1);
Internal\SrgsCompiler\SrgsElementCompilerFactory.cs (2)
223System.Diagnostics.Debug.Assert(parent is not null); 320System.Diagnostics.Debug.Assert(!string.IsNullOrEmpty(sToken));
Internal\SrgsCompiler\State.cs (1)
154System.Diagnostics.Debug.Assert(_next == null && _prev == null);
Internal\SrgsParser\SrgsDocumentParser.cs (3)
157System.Diagnostics.Debug.Assert(srgsRuleRef.Uri != null, "If it is not a special rule ref, the uri is not null"); 221System.Diagnostics.Debug.Assert((parent != null) && (!string.IsNullOrEmpty(sChars))); 350System.Diagnostics.Debug.Fail("Unsupported Srgs element");
Internal\SrgsParser\XmlParser.cs (2)
1037System.Diagnostics.Debug.Assert((parent != null) && (!string.IsNullOrEmpty(sChars))); 1060System.Diagnostics.Debug.Assert(_parser.Grammar.TagFormat == SrgsTagFormat.KeyValuePairs);
Internal\StringBlob.cs (4)
60System.Diagnostics.Debug.Assert(_strings.Count == _refStrings.Count); 114System.Diagnostics.Debug.Assert(offset > 0); 167System.Diagnostics.Debug.Assert(iEnd == 0 || iPos == SerializeSize()); 174System.Diagnostics.Debug.Assert(index <= _cWords);
Internal\Synthesis\AudioBase.cs (1)
412System.Diagnostics.Debug.Assert(cbSize == 0);
Internal\Synthesis\AudioDeviceOut.cs (8)
64System.Diagnostics.Debug.Assert(false); 104System.Diagnostics.Debug.Assert(false); 124System.Diagnostics.Debug.Assert(false); 136System.Diagnostics.Debug.Assert(false); 143System.Diagnostics.Debug.Assert(bufferSize % _blockAlign == 0); 197System.Diagnostics.Debug.Fail(((int)result).ToString(System.Globalization.CultureInfo.InvariantCulture)); 219System.Diagnostics.Debug.Assert(false); 270System.Diagnostics.Debug.Assert(false);
Internal\Synthesis\AudioFileOut.cs (3)
64System.Diagnostics.Debug.Assert(false); 91System.Diagnostics.Debug.Assert(false); 116System.Diagnostics.Debug.Assert(false);
Internal\Synthesis\PcmConverter.cs (3)
115System.Diagnostics.Debug.Fail("Invalid wave format"); 299System.Diagnostics.Debug.Assert(dCutOff > 0.0 && dCutOff < 0.5); 363System.Diagnostics.Debug.Assert(_eChunkStatus == Block.Last);
Internal\Synthesis\SpeechSeg.cs (2)
17System.Diagnostics.Debug.Assert(voice != null); 23System.Diagnostics.Debug.Assert(audio != null);
Internal\Synthesis\SSmlParser.cs (2)
197System.Diagnostics.Debug.Assert(culture != null); 625System.Diagnostics.Debug.Assert(reader.NodeType == XmlNodeType.EndElement);
Internal\Synthesis\TextWriterEngine.cs (1)
159System.Diagnostics.Debug.Assert(alphabet == AlphabetType.Ups || alphabet == AlphabetType.Sapi);
Internal\Synthesis\VoiceSynthesis.cs (7)
200System.Diagnostics.Debug.Assert(startInXml >= 0); 784System.Diagnostics.Debug.Assert(speakInfo != null); 806System.Diagnostics.Debug.Fail("Unknown Action!"); 920System.Diagnostics.Debug.Assert(speechSeg.Audio != null); 1015System.Diagnostics.Debug.Assert(State == SynthesizerState.Speaking || State == SynthesizerState.Paused); 1505Debug.WriteLine("ProcessPostData: post data is not a TTSEvent object"); 1520Debug.Assert(prompt != null);
Recognition\DictationGrammar.cs (1)
40Debug.Assert(Recognizer != null);
Recognition\Grammar.cs (11)
206System.Diagnostics.Debug.Assert(_recognizer != null, "Recognizer should have been set when not unloaded"); 227System.Diagnostics.Debug.Assert(_recognizer != null, "Recognizer should have been set when not unloaded"); 250System.Diagnostics.Debug.Assert(_recognizer != null, "Recognizer should have been set when not unloaded"); 306Debug.Assert(value >= GrammarState.Unloaded && value <= GrammarState.LoadFailed); 314Debug.Assert((_grammarState == GrammarState.Unloaded && (value == GrammarState.Unloaded || value == GrammarState.Loading || value == GrammarState.Loaded)) || 334Debug.Assert(_recognizer != null); // Must be set before changing state. 468Debug.Assert(eventArgs.Result.Grammar == this); 608Debug.Assert(!_loaded); 1005System.Diagnostics.Debug.Assert(_parameters != null); 1049System.Diagnostics.Debug.Assert(header.rules != null, "CFG header's rules should have been loaded"); 1050System.Diagnostics.Debug.Assert(header.pszSymbols != null, "Symbols should be loaded when loadSymbols: true is set");
Recognition\RecognizerBase.cs (46)
149Debug.Assert(grammarData._sapiGrammar != null); 190Debug.Assert(grammar != null); 191Debug.Assert(grammar.Recognizer == this); 197Debug.Assert(grammarData != null && grammarData._sapiGrammar != null); 218Debug.Assert(grammar != null); 219Debug.Assert(grammar.Recognizer == this); 227Debug.Assert(grammarData != null && grammarData._sapiGrammar != null); 248Debug.Assert(grammar != null); 249Debug.Assert(grammar.Recognizer == this); 257Debug.Assert(grammarData != null && grammarData._sapiGrammar != null); 286System.Diagnostics.Debug.Assert(grammarData != null, "Unloaded grammar should not be in _grammars"); 289Debug.Assert(grammar.State == GrammarState.Loaded && grammar.Recognizer == this); 539Debug.Assert(!_detectingBabbleTimeout); 540Debug.Assert(!_initialSilenceTimeoutReached); 541Debug.Assert(!_babbleTimeoutReached); 542Debug.Assert(!_isRecognizeCancelled); 543Debug.Assert(_lastResult == null); 544Debug.Assert(_lastException == null); 564Debug.WriteLine("Grammar loads completed, recognition started."); 568Debug.WriteLine("Problem starting recognition - sapi exception."); 573Debug.WriteLine("Problem starting recognition - unknown exception."); 720System.Diagnostics.Debug.Assert(internalData != null, "_grammars should not contain unloaded Grammars"); 1452System.Diagnostics.Debug.Assert(false); 1500System.Diagnostics.Debug.Assert(ids.Length == 2); 1699Debug.WriteLine("Loading grammar asynchronously."); 1708Debug.Assert(grammar.State == GrammarState.Loading); 1709Debug.Assert(grammar.Recognizer == this); 1710Debug.Assert(grammarData != null && grammarData._sapiGrammar != null); 1733Debug.WriteLine("Finished Loading grammar asynchronously."); 1743Debug.WriteLine("Failed to load grammar asynchronously."); 1762Debug.WriteLine("Raising LoadGrammarCompleted event."); 1786System.Diagnostics.Debug.Assert(internalData != null, "_grammars should not contain unloaded Grammars"); 2007Debug.WriteLine("Waiting for any pending grammar loads to complete."); 2026Debug.WriteLine("Problem loading grammars."); 2032Debug.Assert(_isRecognizing); 2037Debug.WriteLine("Recognition cancelled while waiting for grammars to load."); 2050Debug.WriteLine("Grammar loads completed, recognition started."); 2055Debug.WriteLine("Problem starting recognition - sapi exception."); 2060Debug.WriteLine("Problem starting recognition - unknown exception."); 2077Debug.WriteLine("Firing RecognizeCompleted because recognition didn't start as expected."); 2078Debug.Assert(eventArgs != null); 2083Debug.Assert(_isRecognizing); 2291Debug.Assert(result.Grammar.State == GrammarState.Loaded); 2469Debug.Assert(!(initialSilenceTimeoutReached && babbleTimeoutReached)); // Both timeouts should not be set 2712Debug.WriteLine("Added bookmark: " + bookmarkId + " " + userToken); 2768Debug.WriteLine("Fired bookmark: " + bookmarkId + " " + userToken);
Recognition\SrgsGrammar\SrgsGrammar.cs (1)
89System.Diagnostics.Debug.Fail("Unknown Tag Format!!!");
Recognition\SrgsGrammar\SrgsRule.cs (1)
339System.Diagnostics.Debug.Assert(false);
Result\RecognizedPhrase.cs (9)
103System.Diagnostics.Debug.Assert(replacement != null, "Non-negative iWordReplacement should yield a non-null replacement"); 335System.Diagnostics.Debug.Assert(legacyPhrase != null); 339System.Diagnostics.Debug.Assert(serializedPhrase != null); 596System.Diagnostics.Debug.Assert(semanticValue != null); 858System.Diagnostics.Debug.Assert(scripts != null); 909System.Diagnostics.Debug.Assert(scripts != null); 1004System.Diagnostics.Debug.Assert(onParse != null); 1038System.Diagnostics.Debug.Assert(root != null, "Document should have had an element added"); 1047System.Diagnostics.Debug.Assert(_semantics != null);
Synthesis\PromptBuilder.cs (2)
805System.Diagnostics.Debug.Assert(false); 884System.Diagnostics.Debug.Assert(element._text != null, "All SsmlMarkup elements should have a text value");
System.Text.Encoding.CodePages (186)
System\Text\BaseCodePageEncoding.cs (12)
105Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 143Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 145Debug.Assert(bytesRead == codePageIndex.Length); 189Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 191Debug.Assert(bytesRead == codePageHeader.Length); 230Debug.Assert(tableName != null, "table name can not be null"); 266Debug.Assert(m_codePageHeader != null && m_codePageHeader.Length == CODEPAGE_HEADER_SIZE, "m_codePageHeader expected to match in size the struct CodePageHeader"); 348Debug.Assert(pCodePageIndex->ByteCount == 1 || pCodePageIndex->ByteCount == 2, 370Debug.Assert(pNativeMemory != null); 385Debug.Assert(arrayUnicodeBestFit != null, "[BaseCodePageEncoding.GetBestFitUnicodeToBytesData]Expected non-null arrayUnicodeBestFit"); 396Debug.Assert(arrayBytesBestFit != null, "[BaseCodePageEncoding.GetBestFitBytesToUnicodeData]Expected non-null arrayBytesBestFit");
System\Text\BaseCodePageEncoding.netcoreapp.cs (2)
16Debug.Assert(stream is UnmanagedMemoryStream, "UnmanagedMemoryStream will read a full buffer on one call to Read."); 18Debug.Assert(bytesRead == codePageIndex.Length);
System\Text\DBCSCodePageEncoding.cs (39)
87Debug.Assert(m_codePageHeader?.Length > 0); 94Debug.Assert(pCodePage->CodePage == dataTableCodePage, 116Debug.Assert(_bytesUnknown == 0x3f, 139Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 179Debug.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100"); 251Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 392Debug.Assert((arrayTemp.Length / 2) < 20, 514Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative"); 515Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null"); 518Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 545Debug.Assert(char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate"); 546Debug.Assert(encoder != null, 610Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null"); 611Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative"); 612Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null"); 613Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative"); 616Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 636Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 651Debug.Assert(encoder != null, 684Debug.Assert(encoder == null, 707Debug.Assert(chars > charStart, 726Debug.Assert(chars > charStart, 759Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null"); 760Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative"); 776Debug.Assert(decoder == null || 796Debug.Assert(fallbackBuffer == null, 821Debug.Assert(fallbackBuffer == null, 896Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 908Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null"); 909Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative"); 910Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null"); 911Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative"); 929Debug.Assert(decoder == null || !decoder.m_throwOnOverflow || 950Debug.Assert(fallbackBuffer == null, 976Debug.Assert(fallbackBuffer == null, 1054Debug.Assert(bytes >= byteStart + byteBuffer.Length, 1068Debug.Assert(bytes > byteStart, 1073Debug.Assert(bytes > byteStart, 1099Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
System\Text\DecoderBestFitFallback.cs (3)
73Debug.Assert(iCount < 1, "[DecoderReplacementFallbackBuffer.Fallback] Calling fallback without a previously empty buffer"); 171Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 192Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\DecoderFallbackBufferHelper.cs (5)
25Debug.Assert(_fallbackBuffer != null); 46Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 47Debug.Assert(_fallbackBuffer != null); 102Debug.Assert(byteStart != null, "[DecoderFallback.InternalFallback]Used InternalFallback without calling InternalInitialize"); 103Debug.Assert(_fallbackBuffer != null);
System\Text\EncoderBestFitFallback.cs (4)
75Debug.Assert(_iCount < 1, $"[InternalEncoderBestFitFallbackBuffer.Fallback(non surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 97Debug.Assert(_iCount < 1, $"[InternalEncoderBestFitFallbackBuffer.Fallback(surrogate)] Fallback char {(int)_cBestFit:X4} caused recursive fallback"); 176Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length, 197Debug.Assert(index + 1 < _oFallback.arrayBestFit.Length,
System\Text\EncoderFallbackBufferHelper.cs (4)
34Debug.Assert(_fallbackBuffer != null); 56Debug.Assert(_fallbackBuffer != null); 74Debug.Assert(charStart != null, "[EncoderFallback.InternalFallbackBuffer]Fallback buffer is not initialized"); 75Debug.Assert(_fallbackBuffer != null);
System\Text\EncodingByteBuffer.cs (2)
50Debug.Assert(moreBytesExpected >= 0, "[EncodingByteBuffer.AddByte]expected non-negative moreBytesExpected"); 107Debug.Assert(_chars > _charStart || (bThrow && (_bytes == _byteStart)),
System\Text\EncodingCharBuffer.cs (2)
42Debug.Assert(_fallbackBuffer.Remaining == 0, 113Debug.Assert(_bytes < _byteEnd, "[EncodingCharBuffer.GetNextByte]Expected more date");
System\Text\EncodingTable.cs (7)
65Debug.Assert(encodingNameIndices.Length == CodePagesByName.Length + 1); 66Debug.Assert(encodingNameIndices[encodingNameIndices.Length - 1] == EncodingNames.Length); 76Debug.Assert(index < encodingNameIndices.Length - 1); 98Debug.Assert(left < encodingNameIndices.Length - 1); 137Debug.Assert(MappedCodePages.Length + 1 == indices.Length); 138Debug.Assert(indices[indices.Length - 1] == names.Length); 156Debug.Assert(i < indices.Length - 1);
System\Text\GB18030Encoding.cs (13)
166Debug.Assert(count4Byte <= GBLast4ByteCode, 186Debug.Assert(unicodeCount == 0, 190Debug.Assert(count4Byte == GBLast4ByteCode + 1, 217Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative"); 218Debug.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null"); 219Debug.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative"); 222Debug.Assert(EncoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback"); 244Debug.Assert(char.IsHighSurrogate(charLeftOver), 274Debug.Assert(offset < 0x6f, 324Debug.Assert(iBytes < 0x7e, 402Debug.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null"); 403Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative"); 405Debug.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
System\Text\ISCIIEncoding.cs (32)
60Debug.Assert(_defaultCodePage >= CodeDevanagari && _defaultCodePage <= CodePunjabi, 129Debug.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null"); 131Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetBytes]charCount >=0"); 132Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetBytes]byteCount >=0"); 228Debug.Assert(indicScript != 0, "[ISCIIEncoding.GetBytes]expected an indic script value"); 239Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 254Debug.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3, 318Debug.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null"); 319Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative"); 321Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative"); 352Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi, 372Debug.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) + 431Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode"); 432Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode"); 433Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode"); 434Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode"); 462Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode"); 463Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode"); 464Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode"); 465Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode"); 498Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode"); 499Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode"); 500Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode"); 501Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode"); 506Debug.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0, 528Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode"); 529Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode"); 530Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode"); 535Debug.Assert(!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR && 554Debug.Assert(currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1"); 600Debug.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt, 652Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\ISO2022Encoding.cs (24)
226Debug.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative"); 227Debug.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null"); 237Debug.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null"); 238Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative"); 239Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative"); 242Debug.Assert(EncoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback"); 277Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null"); 278Debug.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative"); 288Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null"); 289Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative"); 290Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative"); 314Debug.Fail("[ISO2022Encoding.GetChars] had unexpected code page"); 376Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate"); 437Debug.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221"); 617Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate"); 717Debug.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow, 763Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate"); 1086Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1180Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0"); 1385Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow, 1443Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetCharsCP52936]count >=0"); 1444Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null"); 1553Debug.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ"); 1677Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\SBCSCodePageEncoding.cs (37)
62Debug.Assert(m_codePageHeader?.Length > 0); 68Debug.Assert(pCodePage->CodePage == dataTableCodePage, 103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 156Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer."); 171Debug.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, $"[SBCSCodePageEncoding::ReadBestFitTable] Expected unallocated byte (not 0x{(int)arrayTemp[byteTemp]:X2}) for best fit byte at 0x{byteTemp:X2} for code page {CodePage}"); 270Debug.Assert(arrayTemp[iBestFitCount - 1] != (char)0, 290Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative"); 291Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null"); 294Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback"); 306Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 311Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 352Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver"); 405Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 415Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null"); 416Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative"); 417Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null"); 418Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative"); 421Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback"); 433Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver), 438Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer || 537Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver"); 596Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (fallback)"); 612Debug.Assert(fallbackBuffer == null || !fallbackHelper.bFallingBack, "[SBCSCodePageEncoding.GetBytes]Expected to NOT be falling back"); 615Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (normal)"); 640Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, "[SBCSEncoding.GetBytes]Expected Empty fallback buffer at end"); 649Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null"); 650Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative"); 669Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 727Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, 738Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null"); 739Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative"); 740Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null"); 741Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative"); 765Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer || 849Debug.Assert(bytes > byteStart, 868Debug.Assert(bytes > byteStart, 884Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
System.Text.Encodings.Web (45)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UnicodeDebug.cs (6)
15Debug.Fail($"The value {ToHexString(codePoint)} is not a valid BMP code point."); 24Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 high surrogate code point."); 33Debug.Fail($"The value {ToHexString(codePoint)} is not a valid UTF-16 low surrogate code point."); 42Debug.Fail($"The value {ToHexString(codePoint)} is not a valid Unicode code point."); 51Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid Unicode scalar value."); 60Debug.Fail($"The value {ToHexString(scalarValue)} is not a valid supplementary plane Unicode scalar value.");
System\IO\TextWriterExtensions.cs (2)
19Debug.Assert(writer != null); 20Debug.Assert(value != null);
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (2)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint)); 81Debug.Assert(thisAllowedCharactersBitmap.IsEmpty, "Both vectors should've been fully consumed.");
System\Text\Encodings\Web\AsciiByteMap.cs (2)
20Debug.Assert(key < BufferSize); 21Debug.Assert(value != 0);
System\Text\Encodings\Web\DefaultHtmlEncoder.cs (4)
107Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 114Debug.Fail("We should've had enough room to write 4 bytes."); 182Debug.Assert(4 <= idxOfSemicolon && idxOfSemicolon <= 9, "Expected '&#x0;'..'&#x10FFFF;'."); 191Debug.Fail("We should've had enough room to write 4 chars.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ascii.cs (2)
55Debug.Assert(encodedCharCount > 0 && encodedCharCount <= 6, "Inner encoder returned bad length."); 62Debug.Assert(thisChar <= 0x7F, "Inner encoder returned non-ASCII data.");
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (4)
36Debug.Assert(scalarEscaper != null); 119Debug.Assert(innerCharsWritten <= bufferLength, "Mustn't overflow the buffer."); 120Debug.Assert(innerCharsWritten != 0, "Inner escaper succeeded with 0-char output?"); 312Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtfXX should've set replacement character on failure
System\Text\Encodings\Web\TextEncoder.cs (6)
345Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtf8 should've performed substitution 467Debug.Assert(scalarValue == Rune.ReplacementChar); // should be replacement char 514Debug.Assert(output != null); 515Debug.Assert(!value.IsEmpty, "Caller should've special-cased 'no encoding needed'."); 578Debug.Assert(!string.IsNullOrEmpty(source)); 598Debug.Assert(unicodeScalar < ushort.MaxValue);
System\Text\Encodings\Web\ThrowHelper.cs (1)
25Debug.Assert(Enum.IsDefined(typeof(ExceptionArgument), argument),
System\Text\Unicode\UnicodeHelpers.cs (2)
29Debug.Assert(0x10000 <= scalar && scalar <= UNICODE_LAST_CODEPOINT); 45Debug.Assert(scalar <= UNICODE_LAST_CODEPOINT);
System\ThrowHelper.cs (2)
74Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 89Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
System.Text.Json (1543)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Net\ArrayBuffer.cs (10)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 105Debug.Assert(byteCount <= ActiveLength, $"Expected {byteCount} <= {ActiveLength}"); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\runtime\src\libraries\Common\src\System\Text\Json\PooledByteBufferWriter.cs (5)
44Debug.Assert(initialCapacity > 0); 45Debug.Assert(_buffer.ActiveLength == 0); 56Debug.Assert(sizeHint > 0); 64Debug.Assert(sizeHint > 0); 78Debug.Assert(_stream is not null);
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Marvin.cs (3)
55Debug.Assert(loopCount > 0, "Shouldn't reach this code path for small inputs."); 100Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4."); 113Debug.Assert(count >= 4, "Only should've gotten here if the original count was >= 4.");
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
158Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 186Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
18Debug.Assert(char.IsPunctuation(separator)); 26Debug.Assert(wordCasing is WordCasing.PascalCase); 101Debug.Fail($"Unexpected state {state}");
src\runtime\src\libraries\System.Text.Json\Common\ReflectionExtensions.cs (8)
49Debug.Assert(baseType.IsGenericType); 50Debug.Assert(!baseType.IsInterface); 51Debug.Assert(baseType == baseType.GetGenericTypeDefinition()); 86Debug.Assert(interfaceType.IsGenericType); 87Debug.Assert(interfaceType.IsInterface); 88Debug.Assert(interfaceType == interfaceType.GetGenericTypeDefinition()); 162Debug.Assert(type.IsImmutableDictionaryType()); 183Debug.Assert(type.IsImmutableEnumerableType());
System\ReflectionExtensions.cs (2)
199Debug.Fail("Unreachable code"); 229Debug.Assert(baseTypeDefinition.IsGenericTypeDefinition);
System\Text\Json\BitStack.cs (13)
80Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}"); 83Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}"); 92Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}"); 96Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 144Debug.Assert(_array is not null); 145Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}"); 149Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}"); 164Debug.Assert(_array is not null); 165Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}"); 166Debug.Assert(minSize >= 0 && minSize >= _array.Length); 169Debug.Assert(nextDouble > minSize); 179Debug.Assert(_currentDepth == 0, "Only call SetFirstBit when depth is 0"); 189Debug.Assert(_currentDepth == 0, "Only call ResetFirstBit when depth is 0");
System\Text\Json\Document\JsonDocument.cs (24)
44Debug.Assert(!utf8Json.IsEmpty); 47Debug.Assert(isDisposable || 51Debug.Assert(extraRentedArrayPoolBytes is null || extraPooledByteBufferWriter is null); 124Debug.Assert(!isPropertyName || row.TokenType is JsonTokenType.PropertyName); 194Debug.Fail( 255Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 317Debug.Assert(status != OperationStatus.DestinationTooSmall); 325Debug.Assert(status == OperationStatus.Done); 366Debug.Assert(idx != -1); 390Debug.Assert(row.TokenType is JsonTokenType.PropertyName); 412Debug.Assert(!segment.Contains(JsonConstants.BackSlash)); 764Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}"); 810Debug.Fail($"Unexpected encounter with JsonTokenType {row.TokenType}"); 816Debug.Assert(row.TokenType == JsonTokenType.String || row.TokenType == JsonTokenType.PropertyName); 847Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 901Debug.Assert(reader.TokenStartIndex <= int.MaxValue); 988Debug.Assert(tokenStart < int.MaxValue); 997Debug.Assert(!inArray); 1001Debug.Assert(tokenType is >= JsonTokenType.String and <= JsonTokenType.Null); 1013Debug.Assert(tokenStart < int.MaxValue); 1031Debug.Assert(reader.BytesConsumed == utf8JsonSpan.Length); 1045Debug.Assert(document.RootElement.ValueKind is JsonValueKind.Array or JsonValueKind.Object); 1105Debug.Fail($"Expected only complex children but got {curr.ValueKind}"); 1136Debug.Assert(readerOptions.CommentHandling >= 0 && readerOptions.CommentHandling <= JsonCommentHandling.Allow);
System\Text\Json\Document\JsonDocument.DbRow.cs (5)
57Debug.Assert(jsonTokenType is > JsonTokenType.None and <= JsonTokenType.Null); 58Debug.Assert((byte)jsonTokenType < 1 << 4); 59Debug.Assert(location >= 0); 60Debug.Assert(sizeOrLength >= UnknownSize); 61Debug.Assert(sizeof(DbRow) == Size);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (17)
159Debug.Assert(!_isLocked, "Dispose called on a locked database"); 178Debug.Assert(_data is not null); 219Debug.Assert( 235Debug.Assert(!_isLocked, "Appending to a locked database"); 262Debug.Assert(index >= 0); 263Debug.Assert(index <= Length - DbRow.Size, $"index {index} is out of bounds"); 264Debug.Assert(index % DbRow.Size == 0, $"index {index} is not at a record start position"); 270Debug.Assert(length >= 0); 278Debug.Assert(numberOfRows is >= 1 and <= 0x0FFFFFFF); 302Debug.Assert(lookupType is JsonTokenType.StartObject or JsonTokenType.StartArray); 321Debug.Fail($"Unable to find expected {lookupType} token"); 341Debug.Assert( 346Debug.Assert(endIndex <= Length); 354Debug.Assert( 360Debug.Assert( 366Debug.Assert( 388Debug.Assert(newDbInts[i] >= locationOffset);
System\Text\Json\Document\JsonDocument.Parse.cs (21)
127Debug.Assert(drained.Array is not null); 157Debug.Assert(utf8Json is not null); 160Debug.Assert(drained.Array is not null); 188Debug.Assert(json is not null); 224Debug.Assert(drained.Array is not null); 248Debug.Assert(drained.Array is not null); 291Debug.Assert(expectedByteCount == actualByteCount); 317Debug.Assert(expectedByteCount == actualByteCount); 441Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 442Debug.Assert(document is not null, "null document returned with shouldThrow: true."); 528Debug.Assert( 579Debug.Assert(payloadLength > 1); 583Debug.Assert( 587Debug.Assert( 607Debug.Assert( 611Debug.Assert( 623Debug.Assert(!reader.HasValueSequence); 703Debug.Assert(tokenType == JsonTokenType.Null); 760Debug.Assert( 824Debug.Assert(rented.Length >= utf8Bom.Length); 907Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Document\JsonDocument.PropertyNameSet.cs (3)
73Debug.Assert(dbRow.TokenType is JsonTokenType.PropertyName); 102Debug.Assert(_hashSet is not null); 126Debug.Assert(success, $"Property name {propertyName} should not already exist in the set.");
System\Text\Json\Document\JsonDocument.StackRow.cs (2)
23Debug.Assert(sizeOrLength >= 0); 24Debug.Assert(numberOfRows >= -1);
System\Text\Json\Document\JsonDocument.StackRowStack.cs (2)
55Debug.Assert(_rentedBuffer is not null); 56Debug.Assert(_topOfStack <= _rentedBuffer!.Length - StackRow.Size);
System\Text\Json\Document\JsonDocument.TryGetProperty.cs (7)
59Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 68Debug.Assert(row.NumberOfRows > 0); 73Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 150Debug.Assert(row.TokenType != JsonTokenType.PropertyName); 159Debug.Assert(row.NumberOfRows > 0); 164Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 175Debug.Assert(idx >= 0);
System\Text\Json\Document\JsonDocumentOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Document\JsonElement.ArrayEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartArray);
System\Text\Json\Document\JsonElement.cs (8)
28Debug.Assert(idx >= 0); 1307Debug.Assert(success, "enumerators must have matching length"); 1315Debug.Assert(!arrayEnumerator2.MoveNext()); 1319Debug.Assert(kind is JsonValueKind.Object); 1337Debug.Assert(success, "enumerators should have matching lengths"); 1356Debug.Assert(!objectEnumerator2.MoveNext()); 1664Debug.Assert(_parent is not null); 1673Debug.Fail($"No handler for {nameof(JsonTokenType)}.{TokenType}");
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\Document\JsonElement.Parse.cs (4)
51Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 52Debug.Assert(document is not null, "null document returned with shouldThrow: true."); 65Debug.Assert(ret, "TryParseValue returned false with shouldThrow: true."); 66Debug.Assert(document is not null, "null document returned with shouldThrow: true.");
System\Text\Json\JsonEncodedText.cs (2)
34Debug.Assert(utf8Value is not null); 91Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\JsonHelpers.cs (16)
24Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 50Debug.Assert(reader.AllowMultipleValues, "only supported by readers that support multiple values."); 51Debug.Assert(reader.CurrentDepth == 0, "should only invoked for top-level values."); 105Debug.Assert(tokenType == reader.TokenType); 174Debug.Assert(result); 184Debug.Assert(success, "The skipped value should have already been buffered."); 199Debug.Assert(dictionary.Comparer is IAlternateEqualityComparer<ReadOnlySpan<char>, string>); 277Debug.Assert(left.Length > 0 && right.Length > 0); 343Debug.Assert(leftFirst.Length == rightFirst.Length); 344Debug.Assert(leftMiddle.Length == rightMiddle.Length); 345Debug.Assert(leftLast.Length == rightLast.Length); 372Debug.Assert(span.Length > 0); 381Debug.Assert(char.IsDigit((char)span[0]), "leading plus not allowed in valid JSON numbers."); 414Debug.Assert(span[i] is (byte)'e' or (byte)'E'); 417Debug.Assert(span.Length >= 10); 432Debug.Assert(intg.Length == 1, "Leading zeros not permitted in JSON numbers.");
System\Text\Json\JsonHelpers.Date.cs (7)
146Debug.Assert(source.Length >= 10); 240Debug.Assert(source.Length >= 16); 273Debug.Assert(source.Length >= 19); 332Debug.Assert(sourceIndex <= source.Length); 386Debug.Assert(source.Length == 2); 504Debug.Assert(parseData.Year <= 9999); // All of our callers to date parse the year from fixed 4-digit fields so this value is trusted. 555Debug.Assert(parseData.Fraction >= 0 && parseData.Fraction <= JsonConstants.MaxDateTimeFraction); // All of our callers to date parse the fraction from fixed 7-digit fields so this value is trusted.
System\Text\Json\JsonHelpers.Escaping.cs (4)
33Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 34Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length); 61Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 62Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Nodes\JsonArray.cs (5)
126Debug.Fail("Impossible case"); 205Debug.Assert(element.ValueKind == JsonValueKind.Array); 248Debug.Assert(index >= 0); 254Debug.Assert(formatted); 303Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonObject.cs (4)
71Debug.Assert(element.ValueKind == JsonValueKind.Object); 245Debug.Fail("Impossible case"); 301Debug.Assert(index >= 0); 318Debug.Assert(_dictionary is not null, "Cannot have detachable nodes without a materialized dictionary.");
System\Text\Json\Nodes\JsonValue.cs (3)
156Debug.Assert(child is null); 163Debug.Assert(jsonTypeInfo.IsConfigured); 164Debug.Assert(value is not null);
System\Text\Json\Nodes\JsonValueOfElement.cs (3)
16Debug.Assert(value.ValueKind is JsonValueKind.False or JsonValueKind.True or JsonValueKind.Number or JsonValueKind.String); 145Debug.Assert(result is not null); 174Debug.Assert(result is not null);
System\Text\Json\Nodes\JsonValueOfJsonPrimitive.cs (3)
29Debug.Fail("Only primitives allowed."); 79Debug.Assert(result is not null); 111Debug.Assert(result is not null);
System\Text\Json\Nodes\JsonValueOfT.cs (4)
17Debug.Assert(value is not null); 18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 19Debug.Assert(value is not JsonNode); 65Debug.Assert(s_valueKind is not null, "Should only be invoked for types that are supported primitives.");
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (2)
22Debug.Assert(jsonTypeInfo.IsConfigured); 56Debug.Assert(success);
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (2)
20Debug.Assert(TypeIsSupportedPrimitive, $"The type {typeof(TValue)} is not a supported primitive."); 21Debug.Assert(converter is { IsInternalConverter: true, ConverterStrategy: ConverterStrategy.Value });
System\Text\Json\Reader\JsonReaderHelper.cs (13)
139Debug.Fail($"No mapping for token type {tokenType}"); 167Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 181Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 185Debug.Assert(written > 0); 188Debug.Assert(!sourceUnescaped.IsEmpty); 215Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 229Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 233Debug.Assert(written > 0); 236Debug.Assert(!sourceUnescaped.IsEmpty); 263Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 278Debug.Assert(source.Length <= JsonConstants.MaximumEscapedGuidLength); 282Debug.Assert(written > 0); 285Debug.Assert(!utf8Unescaped.IsEmpty);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (40)
23Debug.Assert(written > 0); 26Debug.Assert(!utf8Unescaped.IsEmpty); 53Debug.Assert(written > 0); 56Debug.Assert(!utf8Unescaped.IsEmpty); 80Debug.Assert(written > 0); 83Debug.Assert(propertyName.Length is not 0); 96Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 105Debug.Assert(written > 0); 108Debug.Assert(!utf8Unescaped.IsEmpty); 123Debug.Assert(!utf8Source.IsSingleSegment); 124Debug.Assert(utf8Source.Length >= other.Length && utf8Source.Length / JsonConstants.MaxExpansionFactorWhileEscaping <= other.Length); 143Debug.Assert(written > 0); 146Debug.Assert(!utf8Unescaped.IsEmpty); 152Debug.Assert(escapedArray is not null); 167Debug.Assert(index1 >= 0, "the first parameter is not escaped"); 168Debug.Assert(index2 >= 0, "the second parameter is not escaped"); 183Debug.Assert(!utf8Unescaped1.IsEmpty); 187Debug.Assert(!utf8Unescaped2.IsEmpty); 240Debug.Assert(bytesConsumed == utf8Unescaped.Length); 358Debug.Assert(destination.Length >= source.Length); 361Debug.Assert(idx >= 0); 364Debug.Assert(result); 369Debug.Assert(idx >= 0 && idx < source.Length); 370Debug.Assert(source[idx] == JsonConstants.BackSlash); 371Debug.Assert(destination.Length >= source.Length); 374Debug.Assert(result); 383Debug.Assert(idx >= 0); 393Debug.Assert(idx >= 0 && idx < source.Length); 394Debug.Assert(source[idx] == JsonConstants.BackSlash); 406Debug.Assert(source[idx] == JsonConstants.BackSlash); 440Debug.Assert(source[idx] == 'u', "invalid escape sequences must have already been caught by Utf8JsonReader.Read()"); 444Debug.Assert(source.Length >= idx + 5); 447Debug.Assert(result); 448Debug.Assert(bytesConsumed == 4); 459Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 470Debug.Assert(result); 471Debug.Assert(bytesConsumed == 4); 494Debug.Assert(bytesWritten <= 4); 518Debug.Assert(nextUnescapedSegmentLength > 0); 540Debug.Assert(idx == source.Length || source[idx] == JsonConstants.BackSlash);
System\Text\Json\Reader\JsonReaderOptions.cs (1)
32Debug.Assert(value >= 0);
System\Text\Json\Reader\Utf8JsonReader.cs (53)
84Debug.Assert(_totalConsumed == 0); 112Debug.Assert(readerDepth >= 1); 173Debug.Assert(_currentPosition.GetObject() is not null); 324Debug.Assert(_isFinalBlock); 331Debug.Assert(result); 342Debug.Assert(result); 398Debug.Assert(0 <= targetDepth && targetDepth <= CurrentDepth); 429Debug.Assert(targetDepth == CurrentDepth); 553Debug.Assert(status != OperationStatus.DestinationTooSmall); 561Debug.Assert(status == OperationStatus.Done); 576Debug.Assert(HasValueSequence); 585Debug.Assert(!localSequence.IsSingleSegment); 612Debug.Assert(!HasValueSequence); 621Debug.Assert(idx != -1); 633Debug.Assert(HasValueSequence); 634Debug.Assert(!ValueSequence.IsSingleSegment); 1078Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 1079Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 1123Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1170Debug.Assert(span.Length > 0); 1171Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 1187Debug.Assert(span.Length > 0 && span[0] == literal[0]); 1208Debug.Assert(indexOfFirstMismatch > 0 && indexOfFirstMismatch < literal.Length); 1232Debug.Assert(firstByte == 'n'); 1252Debug.Assert(IsLastSpan); 1263Debug.Assert( 1315Debug.Assert(_buffer.Length >= _consumed + 1); 1316Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 1360Debug.Assert(idx >= 0 && idx < data.Length); 1361Debug.Assert(data[idx] != JsonConstants.Quote); 1362Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1462Debug.Assert(data.Length > 0); 1473Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1476Debug.Assert(nextByte is >= (byte)'0' and <= (byte)'9'); 1490Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1506Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1515Debug.Assert(nextByte is (byte)'.' or (byte)'E' or (byte)'e'); 1530Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1539Debug.Assert(nextByte is (byte)'E' or (byte)'e'); 1548Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1561Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1601Debug.Assert(data[i] == (byte)'0'); 1774Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1874Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1875Debug.Assert(_tokenType == JsonTokenType.Comment); 1886Debug.Assert(_tokenType != JsonTokenType.Comment); 1916Debug.Assert(first != JsonConstants.Slash); 2038Debug.Assert(first != JsonConstants.CloseBrace); 2060Debug.Assert(first != JsonConstants.CloseBracket); 2077Debug.Assert(_tokenType is JsonTokenType.EndArray or JsonTokenType.EndObject); 2080Debug.Assert(first != JsonConstants.CloseBrace); 2097Debug.Assert(first != JsonConstants.CloseBracket); 2390Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn);
System\Text\Json\Reader\Utf8JsonReader.MultiSegment.cs (54)
94Debug.Assert(!_nextPosition.Equals(_currentPosition)); 229Debug.Assert(_isNotPrimitive && IsLastSpan); 303Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() is not null); 320Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() is not null); 404Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 405Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 455Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 513Debug.Assert(span.Length > 0); 514Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 540Debug.Assert(span.Length > 0 && span[0] == literal[0] && literal.Length <= JsonConstants.MaximumLiteralLength); 635Debug.Assert(span.Length > 0); 652Debug.Assert(indexOfFirstMismatch >= 0 && indexOfFirstMismatch < literal.Length); 671Debug.Assert(firstByte == 'n'); 690Debug.Assert(IsLastSpan); 701Debug.Assert( 753Debug.Assert(_buffer.Length >= _consumed + 1); 754Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 962Debug.Assert(idx >= 0 && idx < data.Length); 963Debug.Assert(data[idx] != JsonConstants.Quote); 964Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1127Debug.Assert(data.Length > 0); 1141Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1144Debug.Assert(nextByte is >= (byte)'0' and <= (byte)'9'); 1159Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1175Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1184Debug.Assert(nextByte is (byte)'.' or (byte)'E' or (byte)'e'); 1201Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1210Debug.Assert(nextByte is (byte)'E' or (byte)'e'); 1221Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1236Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1259Debug.Assert(i == 0); 1282Debug.Assert(i == 1); 1301Debug.Assert(data[i] == (byte)'0'); 1302Debug.Assert(i == 0 || i == 1); 1579Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1688Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1689Debug.Assert(_tokenType == JsonTokenType.Comment); 1700Debug.Assert(_tokenType != JsonTokenType.Comment); 1730Debug.Assert(first != JsonConstants.Slash); 1861Debug.Assert(first != JsonConstants.CloseBrace); 1885Debug.Assert(first != JsonConstants.CloseBracket); 1902Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 1905Debug.Assert(first != JsonConstants.CloseBrace); 1922Debug.Assert(first != JsonConstants.CloseBracket); 2193Debug.Assert( 2343Debug.Assert(dangerousLineSeparatorBytesConsumed is >= 0 and <= 2); 2357Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn); 2417Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2427Debug.Assert(dangerousLineSeparatorBytesConsumed >= 1 && dangerousLineSeparatorBytesConsumed <= 2 && localBuffer.Length <= 1); 2458Debug.Assert(localBuffer.Length < 2); 2467Debug.Assert(dangerousLineSeparatorBytesConsumed == 1 || dangerousLineSeparatorBytesConsumed == 2); 2521Debug.Assert(localBuffer.Length > 0); 2567Debug.Assert(marker == JsonConstants.CarriageReturn); 2601Debug.Assert(!localBuffer.IsEmpty);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (13)
46Debug.Assert(!span.Contains(JsonConstants.BackSlash)); 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 82Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 146Debug.Assert(_tokenType != JsonTokenType.Number || !ValueIsEscaped, "Numbers can't contain escape characters."); 161Debug.Assert(success); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 198Debug.Assert(ValueIsEscaped); 228Debug.Assert(bytesWritten < source.Length, "source buffer must contain at least one escape sequence"); 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 268Debug.Fail("Throw helper should have thrown an exception."); 271Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); 841Debug.Assert(!span.Contains(JsonConstants.BackSlash));
System\Text\Json\Schema\JsonSchema.cs (2)
265Debug.Assert(options.TransformSchemaNode is not null, "context should only be populated if a callback is present."); 305Debug.Assert(_trueOrFalse is null, "Schema is not mutable");
System\Text\Json\Schema\JsonSchemaExporter.cs (10)
69Debug.Assert(typeInfo.IsConfigured); 110Debug.Assert(derivedType.TypeDiscriminator is null or int or string); 191Debug.Assert(schema.AnyOf is not null, "IEEE floating-point types with AllowNamedFloatingPointLiterals should generate an anyOf schema."); 194Debug.Assert(anyOf.Exists(b => (b.Type & JsonSchemaType.Number) != 0), 208Debug.Assert(elementTypeInfo.Type.IsEnum, "The enum keyword should only be populated by schemas for enum types."); 284Debug.Assert(typeInfo.ElementTypeInfo is not null); 334Debug.Assert(typeInfo.ElementTypeInfo is not null); 420Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None); 506Debug.Assert(typeInfo.PolymorphismOptions is not null); 540Debug.Assert(CurrentDepth > 0);
System\Text\Json\Serialization\Converters\CastingConverter.cs (2)
27Debug.Assert(typeof(T).IsInSubtypeRelationshipWith(sourceConverter.Type!)); 28Debug.Assert(sourceConverter.SourceConverterForCastingConverter is null, "casting converters should not be layered.");
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableConverterFactory.cs (1)
25Debug.Assert(asyncEnumerableInterface is not null, $"{typeToConvert} not supported by converter.");
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (7)
77Debug.Assert(state.Current.AsyncEnumerator is IAsyncEnumerator<TElement>); 81Debug.Assert(state.PendingTask is Task<bool> && state.PendingTask.IsCompleted); 89Debug.Assert(state.Current.AsyncEnumerator is null); 90Debug.Assert(state.PendingTask is not null && state.PendingTask.IsCompleted); 97Debug.Assert(state.Current.AsyncEnumerator is IAsyncEnumerator<TElement>); 109Debug.Assert(moveNextTask.IsCompleted); 154Debug.Assert(state.PendingTask is null);
System\Text\Json\Serialization\Converters\Collection\ICollectionOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryConverter.cs (1)
111Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
59Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (2)
180Debug.Assert(typeof(IEnumerable).IsAssignableFrom(typeToConvert)); 203Debug.Assert(numberOfGenericArgs == 3);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactoryHelpers.cs (2)
72Debug.Assert(type.IsImmutableEnumerableType()); 85Debug.Assert(type.IsImmutableDictionaryType());
System\Text\Json\Serialization\Converters\Collection\IEnumerableDefaultConverter.cs (2)
19Debug.Assert(value is not null); 34Debug.Assert(state.Current.CollectionEnumerator is IEnumerator<TElement>);
System\Text\Json\Serialization\Converters\Collection\IListConverter.cs (1)
84Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IListOfTConverter.cs (1)
45Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\ImmutableDictionaryOfTKeyTValueConverter.cs (1)
45Debug.Assert(creator is not null);
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (1)
33Debug.Assert(creator is not null);
System\Text\Json\Serialization\Converters\Collection\IReadOnlySetOfTConverter.cs (1)
42Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
42Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (10)
41Debug.Assert(state.Current.ReturnValue is TCollection); 57Debug.Assert(state.Current.JsonPropertyInfo is not null); 166Debug.Assert(!IsValueType); 184Debug.Assert(state.ReferenceId is not null); 185Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 186Debug.Assert(state.Current.ReturnValue is TCollection); 266Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 269Debug.Assert(JsonSerializer.IsMetadataPropertyName(reader.GetUnescapedSpan(), (state.Current.BaseJsonTypeInfo ?? jsonTypeInfo).PolymorphicTypeResolver), "should only be hit if metadata property."); 271Debug.Assert(result, "Metadata reader must have buffered all contents."); 272Debug.Assert(reader.TokenType is JsonTokenType.EndObject);
System\Text\Json\Serialization\Converters\Collection\JsonDictionaryConverter.cs (8)
56Debug.Assert(state.Current.ReturnValue is TDictionary); 113Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 139Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 188Debug.Assert(!IsValueType); 207Debug.Assert(state.ReferenceId is not null); 208Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 209Debug.Assert(state.Current.ReturnValue is TDictionary); 246Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Collection\MemoryConverterFactory.cs (1)
26Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\Collection\RootLevelListConverter.cs (1)
28Debug.Assert(reader.AllowMultipleValues, "Can only be used by readers allowing trailing content.");
System\Text\Json\Serialization\Converters\Collection\StackOrQueueConverter.cs (2)
19Debug.Assert(addMethodDelegate is not null); 40Debug.Assert(typeInfo.AddMethodDelegate is not null);
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (3)
32Debug.Assert(CanConvert(typeToConvert)); 67Debug.Assert(objectFactory.CanConvert(typeToConvert)); 72Debug.Fail("Unrecognized F# type.");
System\Text\Json\Serialization\Converters\FSharp\FSharpUnionConverter.cs (6)
196Debug.Assert(reader.TokenType == JsonTokenType.StartObject); 212Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 297Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 342Debug.Assert(success, "Nested converter should not suspend since the union payload is fully buffered."); 436Debug.Assert(fieldValues.Length == caseInfo.Fields!.Length); 445Debug.Assert(success, "Nested converter should not suspend since the union payload is fully buffered.");
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
54Debug.Assert(jsonTypeInfo is JsonTypeInfo<T> typeInfo && typeInfo.SerializeHandler is not null);
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (2)
46Debug.Assert(reader.TokenType == JsonTokenType.StartArray); 62Debug.Fail("End array token not found.");
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (2)
53Debug.Assert(false); 74Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
33Debug.Assert(typeof(JsonNode) == typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (7)
26Debug.Assert(success); // Node converters are not resumable. 28Debug.Assert(obj is JsonObject); 31Debug.Assert(value is null || value is JsonNode); 46Debug.Assert(value is not null); 84Debug.Assert(reader.TokenType == JsonTokenType.StartObject); 98Debug.Fail("Property name expected."); 111Debug.Fail("End object token not found.");
System\Text\Json\Serialization\Converters\Node\JsonValueConverter.cs (1)
45Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.False or JsonTokenType.True or JsonTokenType.Number);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (2)
104Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode); 130Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode);
System\Text\Json\Serialization\Converters\Object\ObjectConverterFactory.cs (1)
33Debug.Assert(!typeof(IEnumerable).IsAssignableFrom(typeToConvert));
System\Text\Json\Serialization\Converters\Object\ObjectDefaultConverter.cs (15)
56Debug.Assert(obj is not null); 97Debug.Assert(!IsValueType); 133Debug.Assert(state.ReferenceId is not null); 134Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 148Debug.Assert(obj is not null); 178Debug.Assert(tokenType == JsonTokenType.PropertyName); 184Debug.Assert(options.AllowOutOfOrderMetadataProperties); 202Debug.Assert(state.Current.JsonPropertyInfo is not null); 263Debug.Assert(obj is not null); 296Debug.Assert(tokenType == JsonTokenType.PropertyName); 299Debug.Assert(!isAlreadyReadMetadataProperty, "Only possible for types that can read metadata, which do not call into the fast-path method."); 354Debug.Assert(success); 369Debug.Assert(success); 403Debug.Assert(jsonPropertyInfo.EffectiveConverter.ConverterStrategy != ConverterStrategy.Value); 481Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done.");
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (20)
75Debug.Assert(properties is not null); 94Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 104Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 154Debug.Assert(!IsValueType); 209Debug.Assert(state.ReferenceId is not null); 210Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 227Debug.Assert(jsonPropertyInfo.Set is not null); 236Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 277Debug.Assert(obj is not null); 316Debug.Assert(tokenType == JsonTokenType.PropertyName); 321Debug.Assert(options.AllowOutOfOrderMetadataProperties); 346Debug.Assert(success, "Serializer should guarantee sufficient read-ahead has been done."); 352Debug.Assert(jsonParameterInfo.MatchingProperty is not null); 426Debug.Assert(tokenType == JsonTokenType.PropertyName); 431Debug.Assert(options.AllowOutOfOrderMetadataProperties); 457Debug.Assert(jsonPropertyInfo is null); 554Debug.Assert(jsonPropertyInfo.CanDeserialize); 605Debug.Assert(state.Current.CtorArgumentState is not null); 620Debug.Assert(state.Current.JsonTypeInfo.Kind is JsonTypeInfoKind.Object); 621Debug.Assert(state.Current.CtorArgumentState is not null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (3)
19Debug.Assert(jsonParameterInfo.ShouldDeserialize); 38Debug.Assert(frame.CtorArgumentState is not null); 39Debug.Assert(frame.JsonTypeInfo.CreateObjectWithArgs is not null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (5)
30Debug.Assert(state.Current.CtorArgumentState!.Arguments is not null); 50Debug.Fail("More than 4 params: we should be in override for LargeObjectWithParameterizedConstructorConverter."); 63Debug.Assert(jsonParameterInfo.ShouldDeserialize); 93Debug.Assert(typeInfo.CreateObjectWithArgs is not null); 114Debug.Fail("More than 4 params: we should be in override for LargeObjectWithParameterizedConstructorConverter.");
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (1)
40Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\CharConverter.cs (1)
49Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateOnlyConverter.cs (3)
27Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 69Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); 77Debug.Assert(formattedSuccessfully && charsWritten == FormatLength);
System\Text\Json\Serialization\Converters\Value\DateTimeConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DateTimeOffsetConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DecimalConverter.cs (1)
39Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
42Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (15)
58Debug.Assert(EnumConverterFactory.Helpers.IsSupportedTypeCode(s_enumTypeCode)); 147Debug.Assert(s_isFlagsEnum, "Should only be entered by flags enums."); 207Debug.Assert(s_isFlagsEnum || dictionaryKeyPolicy is not null, "Should only be entered by flags enums or dictionary key policy."); 238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 368Debug.Assert(s_isSignedEnum); 398Debug.Assert(IsDefinedValueOrCombinationOfValues(key), "must only be invoked against valid enum values."); 399Debug.Assert( 432Debug.Assert(remainingBits == 0 && sb.Length > 0, "unexpected remaining bits or empty string."); 437Debug.Assert(dictionaryKeyPolicy is not null); 448Debug.Fail("should not have been reached."); 520Debug.Assert(allowsString || allowsNumber, "EnumConverter must allow strings, numbers, or both."); 540Debug.Assert(names.Length == values.Length); 619Debug.Assert(JsonName.Equals(other.JsonName, StringComparison.OrdinalIgnoreCase), "The conflicting entry must be equal up to case insensitivity."); 664Debug.Assert(input.Equals(JsonName.AsSpan(), StringComparison.OrdinalIgnoreCase), "Must equal the field name up to case insensitivity."); 674Debug.Assert(conflictingFields.Count > 0);
System\Text\Json\Serialization\Converters\Value\EnumConverterFactory.cs (1)
24Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\GuidConverter.cs (1)
24Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\HalfConverter.cs (3)
75Debug.Assert(!Half.IsNaN(result) && !Half.IsInfinity(result)); 88Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 234Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Ieee754FloatingPointConverter.cs (1)
65Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
79Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 136Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
41Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
41Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
40Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (3)
35Debug.Assert(schemaType is JsonSchemaType.Integer or JsonSchemaType.Number); 36Debug.Assert(!isIeeeFloatingPoint || schemaType is JsonSchemaType.Number); 38Debug.Assert(isIeeeFloatingPoint == (typeof(T) == typeof(double) || typeof(T) == typeof(float) || typeof(T) == typeof(Half) ||
System\Text\Json\Serialization\Converters\Value\NullableConverterFactory.cs (2)
21Debug.Assert(typeToConvert.IsNullableOfT()); 37Debug.Assert(valueTypeToConvert.IsValueType && !valueTypeToConvert.IsNullableOfT());
System\Text\Json\Serialization\Converters\Value\SByteConverter.cs (1)
40Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
43Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\StringConverter.cs (1)
32Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\TimeOnlyConverter.cs (5)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 75Debug.Assert(TimeOnly.MinValue.ToTimeSpan() <= timespan && timespan <= TimeOnly.MaxValue.ToTimeSpan()); 84Debug.Assert(result); 94Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\TimeSpanConverter.cs (4)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 35Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 82Debug.Assert(result); 92Debug.Assert(result);
System\Text\Json\Serialization\Converters\Value\UInt128Converter.cs (2)
79Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 136Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
41Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
41Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
40Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UnsupportedTypeConverterFactory.cs (1)
35Debug.Assert(CanConvert(type));
System\Text\Json\Serialization\Converters\Value\UriConverter.cs (1)
30Debug.Assert(reader.TokenType is JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\VersionConverter.cs (3)
34Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String); 110Debug.Assert(formattedSuccessfully); 129Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (2)
16Debug.Assert(_stackForCycleDetection is not null); 29Debug.Assert(!_stackForCycleDetection.Contains(wrappedValue));
System\Text\Json\Serialization\JsonConverter.cs (4)
112Debug.Fail("Should not be reachable."); 119Debug.Fail("Should not be reachable."); 126Debug.Assert(this is not JsonConverterFactory); 202Debug.Assert(state.FlushThreshold == 0 || (state.PipeWriter is { CanGetUnflushedBytes: true }),
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (26)
16Debug.Assert(!IsValueType); 17Debug.Assert(CanHaveMetadata); 18Debug.Assert((state.Current.MetadataPropertyNames & MetadataPropertyName.Type) != 0 || state.PolymorphicResolvedType is not null); 19Debug.Assert(state.Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 26Debug.Assert(!state.IsContinuation); 40Debug.Assert(state.PolymorphicTypeDiscriminator is not null); 41Debug.Assert(resolver.UsesTypeDiscriminators); 47Debug.Assert(Type!.IsAssignableFrom(resolvedType.Type)); 65Debug.Assert(Type!.IsAssignableFrom(polymorphicConverter.Type)); 69Debug.Assert(state.Current.PolymorphicJsonTypeInfo is null); 73Debug.Fail("Unexpected PolymorphicSerializationState."); 85Debug.Assert(!IsValueType); 86Debug.Assert(value is not null && Type!.IsAssignableFrom(value.GetType())); 87Debug.Assert(CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver is not null); 88Debug.Assert(state.PolymorphicTypeDiscriminator is null); 95Debug.Assert(!state.IsContinuation); 101Debug.Assert(Type == typeof(object)); 108Debug.Assert(jsonTypeInfo.Converter.CanHaveMetadata); 135Debug.Assert(state.IsContinuation); 137Debug.Assert(Type.IsAssignableFrom(polymorphicConverter.Type)); 141Debug.Assert(state.IsContinuation); 145Debug.Fail("Unexpected PolymorphicSerializationState."); 154Debug.Assert(!IsValueType); 155Debug.Assert(!state.IsContinuation); 156Debug.Assert(value is not null); 192Debug.Fail("Unexpected ReferenceHandlingStrategy.");
System\Text\Json\Serialization\JsonConverterFactory.cs (13)
37Debug.Assert(CanConvert(typeToConvert)); 55Debug.Fail("We should never get here."); 67Debug.Fail("We should never get here."); 79Debug.Fail("We should never get here."); 86Debug.Fail("We should never get here."); 93Debug.Fail("We should never get here."); 100Debug.Fail("We should never get here."); 107Debug.Fail("We should never get here."); 118Debug.Fail("We should never get here."); 129Debug.Fail("We should never get here."); 136Debug.Fail("We should never get here."); 150Debug.Fail("We should never get here."); 157Debug.Fail("We should never get here.");
System\Text\Json\Serialization\JsonConverterOfT.cs (24)
166Debug.Assert(!state.IsContinuation); 208Debug.Assert(IsInternalConverter); 220Debug.Assert(this is ObjectConverter); 222Debug.Assert(success); 235Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 241Debug.Assert(state.Current.OriginalTokenType == JsonTokenType.None); 244Debug.Assert(state.Current.OriginalDepth == 0); 277Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 344Debug.Assert(!state.IsContinuation); 361Debug.Assert(IsInternalConverter); 378Debug.Assert(jsonTypeInfo.Converter.Type == Type); 415Debug.Assert(Type == state.Current.JsonTypeInfo.Type); 421Debug.Assert(state.Current.OriginalDepth == 0); 440Debug.Assert(ReferenceEquals(originalJsonTypeInfo, state.Current.JsonTypeInfo)); 447Debug.Assert(value is not null); 462Debug.Assert(Type == typeof(Nodes.JsonObject)); 480Debug.Assert(state.Current.OriginalDepth == 0); 507Debug.Fail("Should not be reachable."); 517Debug.Assert(isValueConverter == (ConverterStrategy == ConverterStrategy.Value)); 546Debug.Assert(IsRootLevelMultiContentStreamingConverter); 569Debug.Assert(reader.TokenType == tokenType); 621Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 660Debug.Assert(!IsInternalConverter && Type == typeof(string)); 686Debug.Assert(defaultConverter != this);
System\Text\Json\Serialization\JsonConverterOfT.ReadCore.cs (1)
28Debug.Assert(!reader.AllowMultipleValues, "should not be entered by converters allowing multiple values.");
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (3)
37Debug.Assert(inputType != null); 57Debug.Assert(context is not null); 58Debug.Assert(inputType != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (16)
27Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); 28Debug.Assert(state.Current.CanContainMetadata); 104Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 120Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 207Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 248Debug.Assert(!allowOutOfOrderMetadata, "Object must have already been buffered in this mode."); 255Debug.Assert(state.Current.PropertyState == StackFramePropertyState.ReadValue); 288Debug.Assert(state.PolymorphicTypeDiscriminator is null); 316Debug.Assert(!isReadingAheadOfNonMetadataProperties, "must have already verified if non-metadata properties precede $values"); 331Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 332Debug.Assert(allowOutOfOrderMetadata, "should only be reached if reading ahead is required."); 519Debug.Assert(metadataValueKind != JsonValueKind.Undefined); 543Debug.Assert(state.Current.MetadataPropertyNames is MetadataPropertyName.None || state.Current.MetadataPropertyNames.HasFlag(MetadataPropertyName.Values)); 555Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 564Debug.Assert(!typeof(T).IsValueType); 565Debug.Assert(state.ReferenceId is not null);
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (11)
46Debug.Assert(jsonTypeInfo.ExtensionDataProperty is null, "jsonTypeInfo.Configure() should have caught conflicting configuration."); 58Debug.Assert(obj is not null, "obj is null"); 110Debug.Assert(jsonPropertyInfo is not null); 125Debug.Assert(underlyingIDictionaryType is not null); 128Debug.Assert(underlyingIDictionaryType.IsGenericType); 129Debug.Assert(genericArgs.Length == 2); 130Debug.Assert(genericArgs[0].UnderlyingSystemType == typeof(string)); 131Debug.Assert( 165Debug.Assert(jsonPropertyInfo.Set is not null); 185Debug.Assert(jsonPropertyInfo.Set is not null); 196Debug.Assert(jsonPropertyInfo.Set is not null);
System\Text\Json\Serialization\JsonSerializer.Read.Pipe.cs (2)
310Debug.Assert(jsonTypeInfo.IsConfigured); 332Debug.Assert(listTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (4)
137Debug.Assert(jsonTypeInfo.IsConfigured); 148Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues); 154Debug.Assert(jsonTypeInfo.IsConfigured); 165Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues);
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (2)
465Debug.Assert(jsonTypeInfo.IsConfigured); 487Debug.Assert(listTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
383Debug.Assert(jsonTypeInfo.IsConfigured); 414Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (11)
272Debug.Assert(jsonTypeInfo.IsConfigured); 297Debug.Assert(jsonTypeInfo.IsConfigured); 386Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 417Debug.Assert(payloadLength > 1); 421Debug.Assert( 425Debug.Assert( 441Debug.Assert( 445Debug.Assert( 474Debug.Assert(!valueSpan.IsEmpty ^ !valueSequence.IsEmpty); 475Debug.Assert(lineNumber >= 0); 476Debug.Assert(bytePositionInLine >= 0);
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (2)
131Debug.Assert(jsonTypeInfo.IsConfigured); 148Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (2)
124Debug.Assert(jsonTypeInfo.IsConfigured); 145Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (2)
125Debug.Assert(jsonTypeInfo.IsConfigured); 144Debug.Assert(options is not null);
System\Text\Json\Serialization\JsonSerializer.Write.HandleMetadata.cs (8)
22Debug.Assert(jsonConverter.CanHaveMetadata); 23Debug.Assert(!state.IsContinuation); 24Debug.Assert(state.CurrentContainsMetadata); 37Debug.Assert(state.PolymorphicTypeResolver is not null); 50Debug.Assert(discriminator is int); 58Debug.Assert(writtenMetadata != MetadataPropertyName.None); 79Debug.Assert(state.NewReferenceId is null); 82Debug.Assert(referenceId is not null);
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (2)
126Debug.Assert(jsonTypeInfo.IsConfigured); 144Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Pipe.cs (1)
263Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Stream.cs (1)
405Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (2)
148Debug.Assert(jsonTypeInfo.IsConfigured); 165Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
42Debug.Assert(!options.IsReadOnly); 54Debug.Assert(options is not null);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (11)
27Debug.Assert(IsReadOnly); 136Debug.Assert(!fallBackToNearestAncestorType || IsReadOnly, "ancestor resolution should only be invoked in read-only options."); 137Debug.Assert(ensureNotNull is null or true, "Explicitly passing false will result in invalid result annotation."); 191Debug.Assert(rootValue is not null); 217Debug.Assert(IsReadOnly); 304Debug.Assert(!entry.HasResult); 329Debug.Assert(!entry.HasResult); 431Debug.Assert(options.IsReadOnly, "Cannot create caching contexts for mutable JsonSerializerOptions instances"); 432Debug.Assert(options._typeInfoResolver is not null); 466Debug.Assert(!weakRef.TryGetTarget(out _)); 516Debug.Assert(left is not null && right is not null);
System\Text\Json\Serialization\JsonSerializerOptions.cs (7)
661Debug.Assert(value >= 0); 911Debug.Assert(IsReadOnly); 912Debug.Assert(TypeInfoResolver is not null); 982Debug.Assert(IsReadOnly); 1031Debug.Assert(_typeInfoResolver is not null); 1072Debug.Assert(_effectiveJsonTypeInfoResolver is null, "an effective resolver always returns metadata"); 1201Debug.Assert(item is not null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (5)
96Debug.Assert(converters.Count <= NumberOfSimpleConverters); 127Debug.Assert(converter is not null); 147Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 148Debug.Assert(typeToConvert != null); 229Debug.Assert(converter is not null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (15)
86Debug.Assert(!typeInfo.IsReadOnly); 414Debug.Assert(matchingBaseArgs.Length == baseTypeArgs.Length, 516Debug.Assert(!typeInfo.IsReadOnly); 517Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 579Debug.Assert(!typeInfo.IsReadOnly); 580Debug.Assert(currentType.IsAssignableFrom(typeInfo.Type)); 654Debug.Assert(jsonPropertyInfo.Name is not null); 738Debug.Assert(typeInfo.Converter.ConstructorInfo != null); 767Debug.Assert(typeInfo.Converter.ConstructorInfo.DeclaringType != null); 807Debug.Assert(jsonPropertyInfo.AttributeProvider is null); 821Debug.Fail("Only FieldInfo and PropertyInfo members are supported."); 890Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 910Debug.Assert(fieldInfo.IsPublic || useNonPublicAccessors); 922Debug.Fail($"Invalid MemberInfo type: {memberInfo.MemberType}"); 962Debug.Assert(propertyInfo.MemberType is MemberTypes.Field);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Union.cs (10)
22Debug.Assert(!typeInfo.IsReadOnly); 23Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Union); 64Debug.Assert(typeInfo.TypeClassifier is null, 100Debug.Assert(typeInfo.UnionCases.Count == 0, 145Debug.Assert(_caseEntries.Count > 0); 219Debug.Assert(typeInfo.UnionDeconstructor is null); 351Debug.Assert(typeInfo.UnionConstructor is null, 459Debug.Assert(Array.IndexOf(types, root) < 0); 464Debug.Assert(sortedTypesWithRoot.Length == types.Length + 1); 465Debug.Assert(sortedTypesWithRoot[0] == root);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (9)
101Debug.Assert(s_singletonInstance is not null, "should be initialized via a successful IsFSharpType call."); 110Debug.Assert(fsharpCoreAssembly.GetName().Name == "FSharp.Core"); 247Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 256Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 266Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 275Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 284Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 292Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 300Debug.Assert(typeof(TFSharpMap).GetGenericTypeDefinition() == _fsharpMapType);
System\Text\Json\Serialization\Metadata\JsonDerivedType.cs (1)
47Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\JsonMetadataServices.Helpers.cs (8)
90Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 151Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 152Debug.Assert(!typeInfo.IsReadOnly); 166Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 167Debug.Assert(!typeInfo.IsConfigured); 168Debug.Assert(typeInfo.Type != JsonTypeInfo.ObjectType); 169Debug.Assert(typeInfo.Converter.ElementType is null); 188Debug.Assert(jsonPropertyInfo.MemberName is not null, "MemberName is not set by source gen");
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (2)
17Debug.Assert(matchingProperty.PropertyType == parameterInfoValues.ParameterType); 98Debug.Assert(MatchingProperty.DeclaringTypeInfo is not null, "Declaring type metadata must have already been configured.");
System\Text\Json\Serialization\Metadata\JsonParameterInfoOfT.cs (2)
21Debug.Assert(parameterInfoValues.ParameterType == typeof(T)); 22Debug.Assert(!matchingPropertyInfo.IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (35)
29Debug.Assert(_effectiveConverter is not null); 140Debug.Assert(!IsConfigured); 371Debug.Assert(declaringTypeInfo is null || declaringType.IsAssignableFrom(declaringTypeInfo.Type)); 385Debug.Assert(!info.IsForTypeInfo); 386Debug.Assert(!info.CanSerialize); 387Debug.Assert(!info.CanDeserialize); 413Debug.Assert(DeclaringTypeInfo is not null); 414Debug.Assert(!IsConfigured); 458Debug.Assert(!IgnoreNullTokensOnRead); 472Debug.Assert(Name is not null); 501Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never); 523Debug.Assert(EffectiveConverter is not null, "Must have calculated the effective converter."); 527Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property); 560Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo"); 561Debug.Assert(!DeclaringTypeInfo.IsConfigured); 588Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo"); 589Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 590Debug.Assert(_jsonTypeInfo is not null, "Must have already been determined on configuration."); 615Debug.Assert(EffectiveConverter is not null, "Must have calculated the effective converter."); 616Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo"); 617Debug.Assert(!IsConfigured, "Should not be called post-configuration."); 657Debug.Assert(_jsonTypeInfo is not null); 658Debug.Assert(_jsonTypeInfo.IsConfigurationStarted); 704Debug.Assert(EffectiveConverter.ElementType != null); 756Debug.Assert(MemberType == MemberTypes.Property || MemberType == MemberTypes.Field || MemberType == default); 794Debug.Assert(_name is not null); 874Debug.Assert(propValue is Nodes.JsonObject); 889Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>); 916Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty); 959Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure"); 960Debug.Assert(state.Parent.ReturnValue is not null, "Parent object is null"); 961Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once"); 972Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true); 1069Debug.Assert(IsConfigured); 1074Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (18)
38Debug.Assert(getter is null or Func<object, object?> or Func<object, T>); 39Debug.Assert(!IsConfigured); 61Debug.Assert(setter is null or Action<object, object?> or Action<object, T>); 62Debug.Assert(!IsConfigured); 92Debug.Assert(predicate is null or Func<object, object?, bool> or Func<object, T?, bool>); 93Debug.Assert(!IsConfigured); 117Debug.Assert(!IsConfigured); 118Debug.Assert(AssociatedParameter is null); 135Debug.Assert(_typedEffectiveConverter is not null); 149Debug.Assert(jsonTypeInfo is JsonTypeInfo<T>); 167Debug.Assert(HasGetter); 190Debug.Assert(value is null); 210Debug.Assert(PropertyTypeCanBeNull); 287Debug.Assert(CanDeserialize || EffectiveObjectCreationHandling == JsonObjectCreationHandling.Populate); 311Debug.Assert(!state.IsContinuation); 312Debug.Assert(EffectiveObjectCreationHandling != JsonObjectCreationHandling.Populate, "Populating should not be possible for simple types"); 385Debug.Assert(!state.IsContinuation); 441Debug.Fail($"Unknown value of JsonIgnoreCondition '{ignoreCondition}'");
System\Text\Json\Serialization\Metadata\JsonTypeInfo.Cache.cs (7)
26Debug.Assert(IsConfigured && _parameterCache is not null); 35Debug.Assert(IsConfigured); 47Debug.Assert(IsConfigured && _propertyCache is not null); 59Debug.Assert(IsConfigured && _propertyIndex is not null); 78Debug.Assert(IsConfigured); 175Debug.Assert(frame.PropertyRefCacheBuilder is { Count: > 0 }); 183Debug.Assert(newCache.Length <= PropertyRefCacheBuilder.MaxCapacity);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (52)
275Debug.Assert(!IsReadOnly); 276Debug.Assert(_properties is null, "must not be set if a property list has been initialized."); 329Debug.Assert(!IsReadOnly); 330Debug.Assert(options.DeclaringTypeInfo is null || options.DeclaringTypeInfo == this); 491Debug.Assert(deconstructor is null or Func<object, (Type?, object?)>); 536Debug.Assert(constructor is null or Func<Type, object?, object>); 579Debug.Assert(!IsReadOnly); 593Debug.Assert(!IsReadOnly); 640Debug.Assert(IsConfigured); 641Debug.Assert(_elementTypeInfo is null or { IsConfigurationStarted: true }); 652Debug.Assert(!IsReadOnly); 653Debug.Assert(value is null || value.Type == ElementType); 666Debug.Assert(IsConfigured); 667Debug.Assert(_keyTypeInfo is null or { IsConfigurationStarted: true }); 678Debug.Assert(!IsReadOnly); 679Debug.Assert(value is null || value.Type == KeyType); 904Debug.Assert(!IsReadOnly); 987Debug.Assert(Monitor.IsEntered(Options.CacheContext), "Configure called directly, use EnsureConfigured which synchronizes access to this method"); 988Debug.Assert(Options.IsReadOnly); 989Debug.Assert(IsReadOnly); 1053Debug.Assert(Kind is JsonTypeInfoKind.Union); 1073Debug.Assert(Kind is JsonTypeInfoKind.Union); 1089Debug.Assert(Kind is JsonTypeInfoKind.Union || PolymorphismOptions is not null); 1104Debug.Assert(UnionCases.Count > 0); 1115Debug.Assert(polymorphismOptions is not null); 1259Debug.Assert(IsConfigured); 1260Debug.Assert(Type != typeof(object)); 1287Debug.Assert(IsReadOnly); 1288Debug.Assert(!IsConfigured); 1300Debug.Assert(property.IsConfigured); 1324Debug.Assert(IsCompatibleWithCurrentOptions); 1438Debug.Assert(jsonTypeInfo.Type == type); 1493Debug.Assert(jsonPropertyInfo.PropertyType == propertyType); 1535Debug.Assert(Kind == JsonTypeInfoKind.Object); 1536Debug.Assert(_propertyCache is null); 1537Debug.Assert(_propertyIndex is null); 1538Debug.Assert(ExtensionDataProperty is null); 1552Debug.Assert(property.DeclaringTypeInfo == this); 1628Debug.Assert( 1647Debug.Assert(Kind == JsonTypeInfoKind.Object); 1648Debug.Assert(DetermineUsesParameterizedConstructor()); 1649Debug.Assert(_propertyCache is not null); 1650Debug.Assert(_parameterCache is null); 1680Debug.Assert(ExtensionDataProperty.MemberName is not null, "Custom property info cannot be data extension property"); 1703Debug.Assert(!IsReadOnly); 1731Debug.Assert(!IsReadOnly); 1770Debug.Assert(IsConfigurationStarted); 1790Debug.Assert(converter is ObjectConverter); 1805Debug.Assert(converter is JsonConverterFactory); 1809Debug.Fail($"Unexpected class type: {converter.ConverterStrategy}"); 1852Debug.Assert(!_jsonTypeInfo.IsConfigured); 1853Debug.Assert(jsonPropertyInfo.MemberName is not null, "MemberName can be null in custom JsonPropertyInfo instances and should never be passed in this method");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (11)
60Debug.Assert(createObject is null or Func<object> or Func<T>); 66Debug.Assert(_createObject is null); 67Debug.Assert(_typedCreateObject is null); 73Debug.Assert(_createObject is null); 74Debug.Assert(_typedCreateObject is null); 93Debug.Assert(createObject is Func<object>); 146Debug.Assert(deconstructor is null or Func<object, (Type?, object?)> or Func<T, (Type?, object?)>); 162Debug.Assert(deconstructor is Func<object, (Type?, object?)>); 204Debug.Assert(constructor is null or Func<Type, object?, object> or Func<Type, object?, T>); 220Debug.Assert(constructor is Func<Type, object?, object>); 243Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (6)
20Debug.Assert(IsConfigured); 22Debug.Assert(success, "Should only return false for async deserialization"); 29Debug.Assert(IsConfigured); 73Debug.Assert(IsConfigured); 147Debug.Assert(reader.BytesConsumed <= bufferState.Bytes.Length); 148Debug.Assert(!bufferState.IsFinalBlock || reader.AllowMultipleValues || reader.BytesConsumed == bufferState.Bytes.Length,
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.WriteHelpers.cs (25)
24Debug.Assert(IsConfigured); 25Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 33Debug.Assert(SerializeHandler is not null); 34Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 47Debug.Assert(typeof(T) == typeof(object)); 57Debug.Assert(success); 92Debug.Assert(IsConfigured); 93Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 99Debug.Assert(SerializeHandler is not null); 100Debug.Assert(CanUseSerializeHandler); 101Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 143Debug.Assert(typeof(T) == typeof(object)); 176Debug.Assert(!isFinalBlock); 177Debug.Assert(state.PendingTask is not null); 222Debug.Assert(writer.BytesPending == 0); 252Debug.Assert(IsConfigured); 253Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 259Debug.Assert(SerializeHandler is not null); 260Debug.Assert(CanUseSerializeHandler); 261Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 287Debug.Assert(typeof(T) == typeof(object)); 300Debug.Assert(bufferWriter.CanGetUnflushedBytes); 315Debug.Assert(state.PendingTask is null); 323Debug.Assert(writer.BytesPending == 0); 365Debug.Assert(CanUseSerializeHandler);
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (1)
15Debug.Assert(modifiers.Length > 0);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (13)
37Debug.Assert(typeDiscriminator is null or int or string); 73Debug.Assert(_discriminatorIdtoType is not null, "Discriminator index must have been populated."); 143Debug.Assert(BaseType.IsAssignableFrom(runtimeType)); 187Debug.Assert(typeDiscriminator is int or string); 188Debug.Assert(UsesTypeDiscriminators); 189Debug.Assert(_discriminatorIdtoType is not null); 193Debug.Assert(typeDiscriminator.Equals(result.TypeDiscriminator)); 223Debug.Assert(!type.IsAbstract); 224Debug.Assert(BaseType.IsAssignableFrom(type)); 225Debug.Assert(UnknownDerivedTypeHandling == JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor); 237Debug.Assert(candidate != null); 278Debug.Assert(typeInfo.IsConfigured); 356Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\PropertyRef.cs (1)
75Debug.Assert(
System\Text\Json\Serialization\Metadata\PropertyRefCacheBuilder.cs (1)
28Debug.Assert(TotalCount < MaxCapacity, "Should have been checked by the caller.");
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (28)
23Debug.Assert(type != null); 24Debug.Assert(constructorInfo is null || constructorInfo.GetParameters().Length == 0); 47Debug.Assert(type.IsValueType); 78Debug.Assert(type != null); 79Debug.Assert(!type.IsAbstract); 80Debug.Assert(!constructor.IsStatic); 188Debug.Assert(type != null); 189Debug.Assert(!type.IsAbstract); 190Debug.Assert(!constructor.IsStatic); 193Debug.Assert(parameters.Length == 1); 196Debug.Assert(!parameterType.IsByRef); 248Debug.Assert(type != null); 249Debug.Assert(!type.IsAbstract); 250Debug.Assert(!constructor.IsStatic); 307Debug.Assert(index <= JsonConstants.UnboxedParameterCountThreshold); 418Debug.Assert(realMethod != null); 421Debug.Assert(declaringType != null); 448Debug.Assert(!runtimePropertyType.IsValueType); 461Debug.Assert(realMethod != null); 464Debug.Assert(propertyDeclaringType != null); 465Debug.Assert(propertyDeclaringType.IsAssignableFrom(declaringType)); 499Debug.Assert(!runtimePropertyType.IsValueType); 515Debug.Assert(realMethod != null); 518Debug.Assert(declaringType != null); 536Debug.Assert(!runtimePropertyType.IsValueType); 553Debug.Assert(declaringType != null); 587Debug.Assert(declaringType != null); 617Debug.Assert(entries.Count > 0, "Should not build a chained accessor for an empty entry list.");
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (11)
22Debug.Assert(type != null); 23Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 49Debug.Assert(!type.IsAbstract); 50Debug.Assert(constructor.DeclaringType == type && !constructor.IsStatic); 79Debug.Assert(!type.IsAbstract); 80Debug.Assert(constructor.DeclaringType == type && !constructor.IsStatic); 87Debug.Assert(parameterCount <= JsonConstants.UnboxedParameterCountThreshold); 105Debug.Fail("We shouldn't be here if there are more than 4 parameters."); 139Debug.Assert(!type.IsAbstract); 140Debug.Assert(constructor.DeclaringType == type && !constructor.IsStatic); 141Debug.Assert(constructor.GetParameters().Length == 1);
System\Text\Json\Serialization\PipeReadBufferState.cs (1)
55Debug.Assert(_sequence.Equals(ReadOnlySequence<byte>.Empty), "ReadAsync should only be called when the buffer is empty.");
System\Text\Json\Serialization\PreserveReferenceResolver.cs (3)
33Debug.Assert(_referenceIdToObjectMap is not null); 43Debug.Assert(_objectToReferenceIdMap is not null); 62Debug.Assert(_referenceIdToObjectMap is not null);
System\Text\Json\Serialization\ReadStack.cs (14)
29Debug.Assert(_count > 1); 30Debug.Assert(_stack is not null); 174Debug.Assert(_count > 0); 175Debug.Assert(JsonPath() is not null); 206Debug.Assert(_continuationCount == 0); 220Debug.Assert(!IsContinuation); 221Debug.Assert(Current.PolymorphicJsonTypeInfo is null); 222Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.None); 240Debug.Assert(Current.PolymorphicJsonTypeInfo is not null); 241Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 254Debug.Assert(Current.PolymorphicJsonTypeInfo is not null); 255Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntryStarted); 383Debug.Assert(!IsContinuation); 393Debug.Assert(Current.JsonTypeInfo.UsesParameterizedConstructor);
System\Text\Json\Serialization\ReadStackFrame.cs (3)
144Debug.Assert(AssignedProperties is null); 158Debug.Assert(AssignedProperties is not null); 159Debug.Assert(typeInfo.OptionalPropertiesMask is not null);
System\Text\Json\Serialization\StreamReadBufferState.cs (2)
124Debug.Assert(bytesConsumed <= _count); 180Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\WriteStack.cs (19)
34Debug.Assert(_count - _indexOffset > 0); 35Debug.Assert(_stack is not null); 144Debug.Assert(!supportAsync || supportContinuation, "supportAsync must imply supportContinuation"); 145Debug.Assert(!IsContinuation); 146Debug.Assert(CurrentDepth == 0); 157Debug.Assert(options.ReferenceHandler is not null); 174Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 180Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 184Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntrySuspended); 232Debug.Assert(_count > 0); 233Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 265Debug.Assert(_continuationCount == 0); 282Debug.Assert(Current.AsyncEnumerator is null); 291Debug.Assert(_stack[i].AsyncEnumerator is null); 296Debug.Assert(_stack[i].CollectionEnumerator is null || ReferenceEquals(Current.CollectionEnumerator, _stack[i].CollectionEnumerator)); 337Debug.Assert(_continuationCount == 0 || _count < _continuationCount); 345Debug.Assert(_stack[i].CollectionEnumerator is null || ReferenceEquals(Current.CollectionEnumerator, _stack[i].CollectionEnumerator)); 346Debug.Assert(_stack[i].AsyncEnumerator is null || ReferenceEquals(Current.AsyncEnumerator, _stack[i].AsyncEnumerator)); 361Debug.Assert(!(collectionEnumerator is not null && asyncEnumerator is not null));
System\Text\Json\Serialization\WriteStackFrame.cs (4)
119Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.None); 141Debug.Assert(PolymorphicSerializationState is PolymorphicSerializationState.None or PolymorphicSerializationState.PolymorphicReEntryStarted); 153Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 154Debug.Assert(PolymorphicTypeInfo is not null);
System\Text\Json\ThrowHelper.cs (12)
148Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 162Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 176Debug.Assert(value.Length > JsonConstants.MaxUnescapedTokenSize); 190Debug.Assert(value.Length > JsonConstants.MaxCharacterTokenSize); 205Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 214Debug.Assert(currentDepth >= maxDepth); 258Debug.Assert(propertyName.Length > JsonConstants.MaxCharacterTokenSize); 329Debug.Fail("Unknown encoding."); 510Debug.Fail($"The ExceptionResource enum value: {resource} is not part of the switch. Add the appropriate case and exception message."); 615Debug.Assert(token is JsonConstants.CloseBracket or JsonConstants.CloseBrace); 644Debug.Fail($"The ExceptionResource enum value: {resource} is not part of the switch. Add the appropriate case and exception message."); 684Debug.Fail($"The DataType enum value: {dataType} is not part of the switch. Add the appropriate case and exception message.");
System\Text\Json\ThrowHelper.Node.cs (1)
58Debug.Assert(supportedTypeNames.Length > 0);
System\Text\Json\ThrowHelper.Serialization.cs (11)
156Debug.Assert(propertyName is null); 160Debug.Assert(propertyName is not null); 169Debug.Assert(memberInfo == null); 173Debug.Assert(memberInfo != null); 449Debug.Assert(!jsonPropertyInfo.IsForTypeInfo); 494Debug.Assert(ex.Path is null); 527Debug.Assert(ex.Path is null); // do not overwrite existing path information 567Debug.Assert(ex.Path is null); // do not overwrite existing path information 636Debug.Assert(!message.Contains(" Path: ")); 664Debug.Assert(!message.Contains(" Path: ")); 854Debug.Assert(propertyInfo.DeclaringTypeInfo is not null, "We should not throw this exception when ParentTypeInfo is null");
System\Text\Json\ValueQueue.cs (2)
40Debug.Assert(_multiple is not null); 61Debug.Assert(_multiple is not null);
System\Text\Json\Writer\JsonWriterHelper.cs (6)
15Debug.Assert(buffer.Length >= indent); 158Debug.Assert(!utf8FormattedNumber.IsEmpty); 211Debug.Assert(i < utf8FormattedNumber.Length); 281Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall or OperationStatus.InvalidData); 282Debug.Assert(charsRead == source.Length || status is not OperationStatus.Done); 335Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length);
System\Text\Json\Writer\JsonWriterHelper.Date.cs (4)
19Debug.Assert(result); 28Debug.Assert(result); 51Debug.Assert(buffer.Length == maxDateTimeLength || 102Debug.Assert(buffer[maxDateTimeLength] == 'Z');
System\Text\Json\Writer\JsonWriterHelper.Escaping.cs (19)
53Debug.Assert(needsEscaping == JavaScriptEncoder.Default.WillEncode(i)); 54Debug.Assert(needsEscaping == !s_allowedBytes.Contains((byte)i)); 55Debug.Assert(needsEscaping == !s_allowedChars.Contains((char)i)); 121Debug.Assert(textLength > 0); 122Debug.Assert(firstIndexToEscape >= 0 && firstIndexToEscape < textLength); 128Debug.Assert(encoder is not null); 132Debug.Assert(result != OperationStatus.DestinationTooSmall); 133Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 140Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 151Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 237Debug.Assert(result); 238Debug.Assert(bytesWritten == 4); 252Debug.Assert(encoder is not null); 256Debug.Assert(result != OperationStatus.DestinationTooSmall); 257Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 264Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 275Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 324Debug.Assert(IsAsciiValue(value)); 364Debug.Assert(charsWritten == 4);
System\Text\Json\Writer\Utf8JsonWriter.cs (51)
125Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 128Debug.Assert(partialStringDataBytes.Length == 3); 131Debug.Assert(length < 4); 138Debug.Assert(value.Length <= 3); 154Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 157Debug.Assert(partialStringDataBytes.Length == 3); 160Debug.Assert(length is 2 or 0); 166Debug.Assert(value.Length <= 1); 182Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence); 185Debug.Assert(partialStringDataBytes.Length == 3); 188Debug.Assert(length < 3); 194Debug.Assert(value.Length < 3); 254Debug.Assert(options.NewLine is "\n" or "\r\n", "Invalid NewLine string."); 401Debug.Assert(_output is null && _stream is null && _arrayBufferWriter is null); 456Debug.Assert(_arrayBufferWriter is not null); 475Debug.Assert(_output is not null); 565Debug.Assert(_arrayBufferWriter is not null); 580Debug.Assert(_output is not null); 653Debug.Assert(_options.Indented || !_options.SkipValidation); 666Debug.Assert(!_options.SkipValidation); 692Debug.Assert(!HasPartialStringData); 696Debug.Assert(_tokenType != JsonTokenType.PropertyName); 697Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 702Debug.Assert(_tokenType != JsonTokenType.PropertyName); 703Debug.Assert(_tokenType != JsonTokenType.StartObject); 704Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 712Debug.Assert(indent <= _indentLength * _options.MaxDepth); 769Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 833Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 861Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 862Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 982Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 1010Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1011Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 1087Debug.Assert(_options.Indented || !_options.SkipValidation); 1099Debug.Assert(!_options.SkipValidation); 1121Debug.Assert(token == JsonConstants.CloseBrace); 1152Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1153Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1177Debug.Assert(_newLineLength is 1 or 2, "Invalid new line length."); 1200Debug.Assert(token == JsonConstants.OpenBrace); 1208Debug.Assert(requiredSize > 0); 1218Debug.Assert(BytesPending != 0); 1222Debug.Assert(_arrayBufferWriter is not null); 1229Debug.Assert(_memory.Length >= sizeHint); 1233Debug.Assert(_output is not null); 1250Debug.Assert(_memory.Length == 0); 1251Debug.Assert(BytesPending == 0); 1257Debug.Assert(_arrayBufferWriter is not null); 1259Debug.Assert(_memory.Length >= sizeHint); 1263Debug.Assert(_output is not null);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (15)
23Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 106Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 122Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 136Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 137Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 159Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 160Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 210Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - encodedLength - 6); 245Debug.Assert(escapedPropertyName.Length < int.MaxValue - encodedLength - 6); 280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 284Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 302Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 334Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (15)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 113Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 129Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 143Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 144Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 166Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 167Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 215Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth); 335Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 352Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (15)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 285Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 303Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 332Debug.Assert(indent <= _indentLength * _options.MaxDepth); 334Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 351Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDecimalLength - 4); 239Debug.Assert(result); 245Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDecimalLength - 4); 270Debug.Assert(result); 277Debug.Assert(indent <= _indentLength * _options.MaxDepth); 279Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 297Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 316Debug.Assert(result); 323Debug.Assert(indent <= _indentLength * _options.MaxDepth); 325Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 342Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 362Debug.Assert(result); 370Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 116Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 132Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 146Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 147Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 169Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 170Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 218Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDoubleLength - 4); 243Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDoubleLength - 4); 274Debug.Assert(result); 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 283Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 320Debug.Assert(result); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 329Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 366Debug.Assert(result); 375Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 116Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 132Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 146Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 147Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 169Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 170Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 218Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatSingleLength - 4); 243Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatSingleLength - 4); 274Debug.Assert(result); 281Debug.Assert(indent <= _indentLength * _options.MaxDepth); 283Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 301Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 320Debug.Assert(result); 327Debug.Assert(indent <= _indentLength * _options.MaxDepth); 329Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 346Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 366Debug.Assert(result); 374Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.FormattedNumber.cs (6)
86Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 102Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 116Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 117Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 140Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Guid.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 112Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 128Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 142Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 143Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 165Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 166Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 214Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatGuidLength - 6); 241Debug.Assert(result); 249Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatGuidLength - 6); 276Debug.Assert(result); 285Debug.Assert(indent <= _indentLength * _options.MaxDepth); 287Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 326Debug.Assert(result); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 376Debug.Assert(result); 386Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Helpers.cs (12)
42Debug.Assert(_tokenType != JsonTokenType.StartObject); 55Debug.Assert(_tokenType != JsonTokenType.StartObject); 71Debug.Assert(_enclosingContainer != EnclosingContainerType.Object || _tokenType == JsonTokenType.PropertyName); 77Debug.Assert(escapedPropertyName.Length < int.MaxValue - 5); 106Debug.Assert(indent <= _indentLength * _options.MaxDepth); 108Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 6 - _newLineLength); 125Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 149Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 5); 178Debug.Assert(indent <= _indentLength * _options.MaxDepth); 180Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 6 - _newLineLength); 198Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 223Debug.Assert(status == OperationStatus.Done);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Literal.cs (23)
38Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 51Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 231Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 247Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 261Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 262Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 284Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 285Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 333Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 334Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - value.Length - 4); 364Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 365Debug.Assert(escapedPropertyName.Length < int.MaxValue - value.Length - 4); 397Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 398Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - value.Length - 1); 424Debug.Assert(indent <= _indentLength * _options.MaxDepth); 426Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 427Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - value.Length - 5 - _newLineLength); 445Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 470Debug.Assert(indent <= _indentLength * _options.MaxDepth); 472Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 473Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - value.Length - 5 - _newLineLength); 490Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 518Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 185Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 201Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 215Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 216Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 238Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 239Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 287Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatInt64Length - 4); 312Debug.Assert(result); 318Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatInt64Length - 4); 343Debug.Assert(result); 350Debug.Assert(indent <= _indentLength * _options.MaxDepth); 352Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 370Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 389Debug.Assert(result); 396Debug.Assert(indent <= _indentLength * _options.MaxDepth); 398Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 415Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 435Debug.Assert(result); 447Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (76)
33Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 45Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 95Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 112Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 158Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 159Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.MaxExpansionFactorWhileTranscoding); 187Debug.Assert(indent <= _indentLength * _options.MaxDepth); 189Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 190Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding); 244Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 271Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 319Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 320Debug.Assert(escapedPropertyName.Length < int.MaxValue - 4); 349Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxEscapedTokenSize - 3); 350Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - 4); 375Debug.Assert(indent <= _indentLength * _options.MaxDepth); 377Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 378Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - _newLineLength); 395Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 428Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize && utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 595Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 601Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 682Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 688Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 769Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 775Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 841Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 847Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 896Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 897Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8Value.Length); 919Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 920Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < value.Length); 942Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 943Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < propertyName.Length); 965Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 966Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8PropertyName.Length); 991Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 992Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1010Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1011Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1029Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1030Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1048Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1049Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1064Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1065Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1124Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1125Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1184Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1244Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1245Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1357Debug.Assert(escapedValue.Length <= JsonConstants.MaxUnescapedTokenSize); 1358Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1392Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1393Debug.Assert(escapedPropertyName.Length < int.MaxValue - escapedValue.Length - 6); 1428Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1429Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1464Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1465Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1501Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1503Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1504Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1522Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1551Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1553Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1554Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - _newLineLength); 1571Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1602Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1604Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1605Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1623Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1653Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1655Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1656Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1674Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (20)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 194Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 210Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 224Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 225Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 247Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 248Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 296Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatUInt64Length - 4); 321Debug.Assert(result); 327Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatUInt64Length - 4); 352Debug.Assert(result); 359Debug.Assert(indent <= _indentLength * _options.MaxDepth); 361Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 379Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 398Debug.Assert(result); 405Debug.Assert(indent <= _indentLength * _options.MaxDepth); 407Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 424Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 444Debug.Assert(result); 456Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Bytes.cs (4)
62Debug.Assert(encodingLength <= int.MaxValue - 3); 67Debug.Assert((uint)maxRequired <= int.MaxValue); 91Debug.Assert(indent <= _indentLength * _options.MaxDepth); 107Debug.Assert((uint)maxRequired <= int.MaxValue - 3);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Comment.cs (8)
80Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 4); 97Debug.Assert(status != OperationStatus.DestinationTooSmall); 112Debug.Assert(indent <= _indentLength * _options.MaxDepth); 114Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 4 - _newLineLength); 138Debug.Assert(status != OperationStatus.DestinationTooSmall); 195Debug.Assert(utf8Value.Length < int.MaxValue - 4); 219Debug.Assert(indent <= _indentLength * _options.MaxDepth); 221Debug.Assert(utf8Value.Length < int.MaxValue - indent - 4 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTime.cs (1)
69Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.DateTimeOffset.cs (1)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Decimal.cs (4)
59Debug.Assert(result); 66Debug.Assert(indent <= _indentLength * _options.MaxDepth); 93Debug.Assert(result); 101Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Double.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Float.cs (4)
63Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 97Debug.Assert(result); 149Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.FormattedNumber.cs (2)
70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 72Debug.Assert(utf8Value.Length < int.MaxValue - indent - 1 - _newLineLength);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Guid.cs (3)
61Debug.Assert(result); 70Debug.Assert(indent <= _indentLength * _options.MaxDepth); 100Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Helpers.cs (15)
54Debug.Assert(!_options.SkipValidation); 61Debug.Assert(!HasPartialStringData); 65Debug.Assert(_tokenType != JsonTokenType.PropertyName); 66Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 71Debug.Assert(_tokenType != JsonTokenType.PropertyName); 72Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 79Debug.Assert(currentSegmentEncoding is EnclosingContainerType.Utf8StringSequence or EnclosingContainerType.Utf16StringSequence or EnclosingContainerType.Base64StringSequence); 101Debug.Assert(!HasPartialStringData); 105Debug.Assert(_tokenType != JsonTokenType.PropertyName); 106Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 111Debug.Assert(_tokenType != JsonTokenType.PropertyName); 112Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 124Debug.Assert(!HasPartialStringData); 132Debug.Assert(status == OperationStatus.Done); 133Debug.Assert(consumed == bytes.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Literal.cs (3)
66Debug.Assert(utf8Value.Length <= 5); 89Debug.Assert(indent <= _indentLength * _options.MaxDepth); 90Debug.Assert(utf8Value.Length <= 5);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.Raw.cs (2)
168Debug.Assert(utf8JsonLen < int.MaxValue); 241Debug.Assert(len < int.MaxValue);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.SignedNumber.cs (4)
72Debug.Assert(result); 79Debug.Assert(indent <= _indentLength * _options.MaxDepth); 106Debug.Assert(result); 114Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.String.cs (13)
21Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 86Debug.Assert(valueIdx >= -1 && valueIdx < value.Length); 119Debug.Assert(maxRequiredBytes is >= 0 and < int.MaxValue - 3); 146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 147Debug.Assert(maxRequiredBytes >= 0 && maxRequiredBytes < int.MaxValue - indent - 3 - _newLineLength); 183Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 184Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 235Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length); 267Debug.Assert(escapedValue.Length < int.MaxValue - 3); 295Debug.Assert(indent <= _indentLength * _options.MaxDepth); 297Debug.Assert(escapedValue.Length < int.MaxValue - indent - 3 - _newLineLength); 334Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 335Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (35)
66Debug.Assert(HasPartialStringData); 67Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf16StringSequence); 77Debug.Assert(value.Length + partialStringDataBuffer.Length < 2); 78Debug.Assert(charsConsumed == value.Length + partialStringDataBuffer.Length); 84Debug.Assert(charsConsumed > partialStringDataBuffer.Length); 85Debug.Assert(charsConsumed <= 2); 91Debug.Assert(charsConsumed >= partialStringDataBuffer.Length); 92Debug.Assert(charsConsumed <= 2); 98Debug.Fail("Unexpected OperationStatus return value."); 135Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 136Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 150Debug.Assert(consumed == value.Length || !isFinalSegment); 153Debug.Assert(!isFinalSegment); 154Debug.Assert(value.Length - consumed < 2); 166Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding)); 234Debug.Assert(HasPartialStringData); 235Debug.Assert(_enclosingContainer == EnclosingContainerType.Utf8StringSequence); 245Debug.Assert(utf8Value.Length + partialStringDataBuffer.Length < 4); 246Debug.Assert(bytesConsumed == utf8Value.Length + partialStringDataBuffer.Length); 252Debug.Assert(bytesConsumed > partialStringDataBuffer.Length); 253Debug.Assert(bytesConsumed <= 4); 259Debug.Assert(bytesConsumed >= partialStringDataBuffer.Length); 260Debug.Assert(bytesConsumed <= 4); 266Debug.Fail("Unexpected OperationStatus return value."); 304Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 305Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length); 316Debug.Assert(consumed == utf8Value.Length || !isFinalSegment); 319Debug.Assert(!isFinalSegment); 320Debug.Assert(utf8Value.Length - consumed < 4); 332Debug.Assert(escapedValue.Length < int.MaxValue - 3); 401Debug.Assert(HasPartialStringData); 402Debug.Assert(_enclosingContainer == EnclosingContainerType.Base64StringSequence); 416Debug.Assert(combinedBuffer.Length is 1 or 2); 418Debug.Assert(bytes.Length + partialStringDataBuffer.Length < 3); 476Debug.Assert(indent <= _indentLength * _options.MaxDepth);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.UnsignedNumber.cs (4)
74Debug.Assert(result); 81Debug.Assert(indent <= _indentLength * _options.MaxDepth); 108Debug.Assert(result); 116Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriterCache.cs (4)
66Debug.Assert(t_threadLocalState is not null); 73Debug.Assert((rentedWriters == 0) == (ReferenceEquals(state.BufferWriter, bufferWriter) && ReferenceEquals(state.Writer, writer))); 78Debug.Assert(t_threadLocalState is not null); 84Debug.Assert((rentedWriters == 0) == ReferenceEquals(state.Writer, writer));
System\ThrowHelper.cs (2)
74Debug.Fail("The enum value is not defined, please check the ExceptionArgument Enum."); 89Debug.Fail("The enum value is not defined, please check the ExceptionResource Enum.");
System.Text.Json.SourceGeneration (73)
Helpers\RoslynExtensions.cs (8)
26Debug.Assert(!type.IsArray, "Resolution logic only capable of handling named types."); 27Debug.Assert(type.FullName != null); 183Debug.Assert(baseTypeDefinition.IsGenericTypeDefinition()); 625Debug.Assert(member is IFieldSymbol or IPropertySymbol); 631Debug.Assert(member is IFieldSymbol or IPropertySymbol); 632Debug.Assert(otherMember is IFieldSymbol or IPropertySymbol); 687Debug.Fail("unexpected syntax kind"); 767Debug.Assert(inputType.IsNullableType());
JsonSourceGenerator.Emitter.cs (17)
102Debug.Assert(_typeIndex.Count == 0); 103Debug.Assert(_propertyNames.Count == 0); 104Debug.Assert(!_emitGetConverterForNullablePropertyMethod); 174Debug.Assert(contextClasses.Count > 0); 276Debug.Fail($"Unexpected class type {typeGenerationSpec.ClassType}"); 300Debug.Assert(typeMetadata.ConverterType != null); 321Debug.Assert(typeMetadata.NullableUnderlyingType != null); 378Debug.Assert(!(typeGenerationSpec.ClassType == ClassType.Dictionary && collectionKeyType == null)); 383Debug.Assert(collectionValueType != null); 425Debug.Assert(keyTypeFQN != null); 429Debug.Assert(keyTypeFQN != null); 475Debug.Assert(typeGenerationSpec.CollectionValueType != null); 527Debug.Assert(typeGenerationSpec.CollectionKeyType != null); 528Debug.Assert(typeGenerationSpec.CollectionValueType != null); 1473Debug.Assert(paramCount > 0 || parameters.Any(p => p.RefKind == RefKind.Out)); 1488Debug.Assert(spec.ArgsIndex >= 0); 1585Debug.Assert(!_propertyNames.TryGetValue(effectiveJsonPropertyName, out string? existingName) || existingName == propertyNameFieldName);
JsonSourceGenerator.Parser.cs (34)
67Debug.Assert(_contextClassLocation != null); 97Debug.Assert(_knownSymbols.JsonSerializerContextType != null); 100Debug.Assert(_typesToGenerate.Count == 0); 101Debug.Assert(_generatedTypes.Count == 0); 102Debug.Assert(_contextClassLocation is null); 105Debug.Assert(contextTypeSymbol != null); 108Debug.Assert(_contextClassLocation is not null); 137Debug.Assert(rootSerializableTypes.Count > 0); 172Debug.Assert(_generatedTypes.Count > 0); 216Debug.Assert(typeSymbol != null); 224Debug.Assert(typeDeclarations?.Count > 0); 323Debug.Assert(_knownSymbols.JsonSerializableAttributeType != null); 324Debug.Assert(_knownSymbols.JsonSourceGenerationOptionsAttributeType != null); 364Debug.Assert(_knownSymbols.JsonSerializableAttributeType != null); 440Debug.Assert(attributeData.ConstructorArguments.Length == 1 & attributeData.ConstructorArguments[0].Type?.Name is nameof(JsonSerializerDefaults)); 629Debug.Assert(attributeData.ConstructorArguments.Length == 1); 656Debug.Assert(attributeLocation != null); 676Debug.Assert(IsSymbolAccessibleWithin(typeToGenerate.Type, within: contextType), "should not generate metadata for inaccessible types."); 751Debug.Assert(_knownSymbols.JsonStringEnumConverterOfTType != null); 1063Debug.Assert(attributeData.ConstructorArguments.Length > 0); 1071Debug.Assert(typeDiscriminator is int or string); 1419Debug.Assert(matchingBaseArgs.Length == constructedBaseArgs.Length, 1744Debug.Assert(sortedTypesWithRoot.Length == caseTypes.Count + 1); 1745Debug.Assert(SymbolEqualityComparer.Default.Equals(sortedTypesWithRoot[0], root)); 2032Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.MemoryByteType)); 2040Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.ReadOnlyMemoryByteType)); 2062Debug.Assert(arraySymbol.Rank == 1, "multi-dimensional arrays should have been handled earlier."); 2431Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 2606Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 2795Debug.Fail("Method given an invalid symbol type."); 2831Debug.Assert(constructor != null); 2967Debug.Assert(_knownSymbols.JsonConverterAttributeType.IsAssignableFrom(attributeData.AttributeClass)); 2975Debug.Assert(attributeData.ConstructorArguments.Length == 1 && attributeData.ConstructorArguments[0].Value is null or ITypeSymbol); 3414Debug.Assert(type.IsGenericType);
src\runtime\src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Text.Json\Common\JsonHelpers.cs (2)
158Debug.Assert(childlessQueue.Count > 0, "The graph contains cycles."); 186Debug.Assert(idx == 0, "should have populated the entire sortedNodes array.");
src\runtime\src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (3)
18Debug.Assert(char.IsPunctuation(separator)); 26Debug.Assert(wordCasing is WordCasing.PascalCase); 101Debug.Fail($"Unexpected state {state}");
System.Text.RegularExpressions (605)
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Text\RegularExpressions\CaptureCollection.cs (2)
105Debug.Assert(_captures != null); 275Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\GroupCollection.cs (1)
397Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Match.cs (4)
164Debug.Assert(Text != null); 353Debug.Assert(mode != RegexRunnerMode.ExistenceRequired); 361Debug.Assert(_textbeg == 0); 382Debug.Assert(!_balancing);
System\Text\RegularExpressions\MatchCollection.cs (2)
190Debug.Assert(i >= 0, "i cannot be negative."); 358Debug.Assert(collection != null, "collection cannot be null.");
System\Text\RegularExpressions\Regex.Cache.cs (8)
96Debug.Assert(value >= 0); 124Debug.Assert(s_cacheList.Count == value); 125Debug.Assert(s_cacheDictionary.Count == value); 219Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 291Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 292Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 306Debug.Assert(pattern != null, "Pattern must be provided"); 307Debug.Assert(culture != null, "Culture must be provided");
System\Text\RegularExpressions\Regex.cs (6)
613Debug.Assert(mode <= RegexRunnerMode.BoundsRequired); 617Debug.Assert(startat <= input.Length); 679Debug.Assert(inputString is null || inputSpan.SequenceEqual(inputString)); 680Debug.Assert((uint)startat <= (uint)inputSpan.Length); 697Debug.Assert(match is not null); 762Debug.Assert(match is not null);
System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
System\Text\RegularExpressions\RegexCharClass.cs (22)
197Debug.Assert( 204Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})"); 210Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 244Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 282Debug.Assert(!set.IsEmpty); 300Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 474Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 574Debug.Assert(c != 0); 742Debug.Assert(count <= evaluated); 786Debug.Assert(set1Negated == set2Negated); 865Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 982Debug.Assert((uint)comparison <= char.MaxValue); 1029Debug.Assert(twoChars.Length >= 2); 1115Debug.Assert(!hasSubtraction); 1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1247Debug.Assert(ch < 128); 1265Debug.Assert(ch < 128); 1350Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1440Debug.Assert(curcat < 0); 1541Debug.Assert(chars[index] < chars[index + 1]); 1600Debug.Assert(i == span.Length); 1849Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (99)
381Debug.Assert(_pool != null); 382Debug.Assert(_local != null); 383Debug.Assert(!_pool.Contains(_local)); 392Debug.Assert(_regexTree != null); 413Debug.Assert(minRequiredLength >= 0); 491Debug.Fail($"Unexpected mode: {_regexTree.FindOptimizations.FindMode}"); 782Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingString_LeftToRight or 837Debug.Assert(!string.IsNullOrEmpty(prefix)); 869Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 943Debug.Assert(primarySet.Chars.Length > 0); 1125Debug.Assert(needLoop); 1141Debug.Assert(setIndex is 0 or 1); 1144Debug.Assert(needLoop); 1200Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1203Debug.Assert(set.Distance == 0); 1207Debug.Assert(!set.Negated); 1271Debug.Assert(_regexTree.FindOptimizations.LiteralAfterLoop is not null); 1274Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1275Debug.Assert(target.LoopNode.N == int.MaxValue); 1305Debug.Assert(target.Literal.StringComparison is StringComparison.Ordinal); 1451Debug.Assert(_regexTree != null); 1457Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1458Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1639Debug.Assert(requiredLength > 0); 1673Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1674Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1677Debug.Assert(childCount >= 2); 1684Debug.Assert(node.Parent is not null); 1885Debug.Assert(sliceStaticPos == 0); 1948Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 1953Debug.Assert(numChars != 0); 2028Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 2090Debug.Assert(sliceStaticPos == 0); 2095Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}"); 2105Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2295Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2296Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2394Debug.Assert(needsEndConditional); 2454Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2455Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2593Debug.Assert(resumeAt is not null); 2647Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2648Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2751Debug.Assert(startingCapturePos != null); 2773Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2774Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2817Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2818Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2941Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 3070Debug.Fail($"Unexpected node type: {node.Kind}"); 3076Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 3077Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 3120Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 3140Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 3141Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3211Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3214Debug.Assert(!rtl || offset is null); 3286Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.Kind}"); 3346Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3347Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3348Debug.Assert(sliceStaticPos >= 0); 3350Debug.Assert(sliceStaticPos >= 0); 3484Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3490Debug.Assert(str.Length >= 2); 3494Debug.Assert(emitLengthCheck); 3536Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3556Debug.Assert(node.M < node.N); 3811Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3828Debug.Assert(node.M < node.N); 4158Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4159Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4160Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4161Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4267Debug.Assert(sliceStaticPos == 0); 4347Debug.Assert(entriesPerIteration >= 1); 4506Debug.Assert(entriesPerIteration >= 1); 4530Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4680Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4696Debug.Assert(node.N > node.M); 4927Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4928Debug.Assert(node.M == 0 && node.N == 1); 5016Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 5017Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 5018Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 5019Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 5020Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 5054Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 5055Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 5056Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 5057Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 5179Debug.Assert(sliceStaticPos == 0); 5333Debug.Assert(startingStackpos is not null); 5488Debug.Assert(!negate, "Negation isn't appropriate for a multi"); 5587Debug.Fail("We should never get here. This method should only be called if CanEmitIndexOf returned true, and all of the same cases should be covered."); 5609Debug.Assert(count >= 1); 6028Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 6480Debug.Assert(chars.Length > 3, $"chars.Length == {chars.Length}"); 6519Debug.Assert(values is char[] or string[]); 6520Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexFindOptimizations.cs (15)
49Debug.Assert(!isLeadingPartial || !rightToLeft, "RightToLeft unexpected when isLeadingPartial"); 86Debug.Assert(maxLength >= MinRequiredLength, $"{maxLength} should have been greater than {MinRequiredLength} minimum"); 142Debug.Assert(!RegexCharClass.IsNegated(charClass)); 149Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 187Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 384Debug.Assert(chars is { Length: 1 }); 409Debug.Assert(LeadingAnchor != RegexNodeKind.Bol, "BOL isn't enabled for RTL"); 512Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch); 693Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 708Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 725Debug.Assert(LeadingStrings is not null); 819Debug.Assert(LiteralAfterLoop is not null); 822Debug.Assert(loopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 823Debug.Assert(loopNode.N == int.MaxValue); 865Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch, $"Unexpected FindMode {FindMode}");
System\Text\RegularExpressions\RegexInterpreter.cs (8)
39Debug.Assert(code != null, "code must not be null."); 300Debug.Assert(_culture != null, "If the pattern has backreferences and is IgnoreCase, then _culture must not be null."); 326Debug.Assert(runregex is not null); 327Debug.Assert(runtrack is not null); 328Debug.Assert(runstack is not null); 329Debug.Assert(runcrawl is not null); 1141Debug.Assert(!_rightToLeft, "UpdateBumpalongs aren't added for RTL"); 1152Debug.Fail($"Unimplemented state: {_operator:X8}");
System\Text\RegularExpressions\RegexInterpreterCode.cs (1)
117Debug.Fail($"Unknown opcode: {opcode}");
System\Text\RegularExpressions\RegexNode.cs (87)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 233Debug.Fail($"Unexpected type: {Kind}"); 243Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 256Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}"); 262Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 268Debug.Fail("All Group nodes should have been removed."); 298Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 307Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 311Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 315Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 320Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 324Debug.Fail($"Unexpected node type: {node.Kind}"); 332Debug.Assert(node.Str is not null, "Expect non-null multi string"); 333Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 355Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 372Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 373Debug.Assert(rootNode.Parent is null); 374Debug.Assert(rootNode.ChildCount() == 1); 589Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 594Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 659Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 676Debug.Assert(Kind == RegexNodeKind.Group); 681Debug.Assert(u.ChildCount() == 1); 704Debug.Assert(Kind == RegexNodeKind.Atomic); 705Debug.Assert(ChildCount() == 1); 754Debug.Assert(branches is not null && branches.Count != 0); 881Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1013Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 1014Debug.Assert(!string.IsNullOrEmpty(Str)); 1073Debug.Assert(Kind == RegexNodeKind.Alternate); 1241Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1341Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1342Debug.Assert(node.ChildCount() >= 2); 1384Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1419Debug.Assert(startingSpan.Length > 0); 1448Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1449Debug.Assert(startingNode.Str!.Length > 0); 1472Debug.Assert(startingSpan.Length > 0); 1495Debug.Assert(startingSpan.Length == 1); 1496Debug.Assert(startingSpan[0] == node.Ch); 1502Debug.Assert(node.Kind == RegexNodeKind.Multi); 1503Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1557Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1558Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1572Debug.Assert(Kind is RegexNodeKind.Alternate); 1573Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1608Debug.Assert(startingLiteralNode.IsSetFamily); 1687Debug.Assert(lowInclusive < highInclusive); 1723Debug.Assert(@string is not null); 1729Debug.Assert(setChars is not null); 1742Debug.Assert(Kind == RegexNodeKind.Concatenate); 1784Debug.Assert(Kind == RegexNodeKind.Concatenate); 1785Debug.Assert(Children is List<RegexNode>); 1867Debug.Assert(Kind == RegexNodeKind.Concatenate); 1868Debug.Assert(Children is List<RegexNode>); 1978Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 2050Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2076Debug.Assert(Children is List<RegexNode>); 2221Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 2222Debug.Assert(ChildCount() == 1); 2341Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 2342Debug.Assert(ChildCount() is 1 or 2); 2359Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2360Debug.Assert(ChildCount() is 2 or 3); 2402Debug.Assert(loopNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop); 2712Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2788Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation."); 2874Debug.Assert(childCount >= 2); 2907Debug.Assert(ChildCount() == 1); 2936Debug.Fail($"Unknown node: {Kind}"); 2991Debug.Assert(childCount >= 2); 3045Debug.Assert(ChildCount() == 1); 3073Debug.Fail($"Unknown node: {Kind}"); 3105Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 3241Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 3302Debug.Assert(max >= 2); 3347Debug.Assert(Children is List<RegexNode>); 3358Debug.Assert(Children != null); 3359Debug.Assert(index < ChildCount()); 3371Debug.Assert(Children != null); 3397Debug.Assert(Children is RegexNode);
System\Text\RegularExpressions\RegexParser.cs (7)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 444Debug.Fail($"Unexpected char {ch}"); 502Debug.Fail($"Unexpected char {ch}"); 1149Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1228Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 2152Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (9)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 521results.ForEach(r => Debug.Assert( 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1118Debug.Fail($"Unexpected node {node.Kind}"); 1153Debug.Assert(node.ChildCount() >= 2); 1199Debug.Assert( 1429Debug.Assert(leading);
System\Text\RegularExpressions\RegexReplacement.cs (6)
36Debug.Assert(concat.Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {concat.Kind}"); 77Debug.Fail($"Unexpected child kind {child.Kind}"); 215Debug.Assert(_rules.Length <= 1); 216Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1)); 259Debug.Assert(state.offsetAndCounts.Count % 2 == 0, $"{state.offsetAndCounts.Count}"); 260Debug.Assert(state.offsetAndCounts.Count >= 4, $"{state.offsetAndCounts.Count}");
System\Text\RegularExpressions\RegexTree.cs (9)
47Debug.Assert(captureNumberSparseMapping is null || captureNames is not null); 48Debug.Assert((captureNames is null) == (captureNameToNumberMapping is null)); 49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 50Debug.Assert(captureNumberSparseMapping is null || captureCount == captureNumberSparseMapping.Count); 51Debug.Assert(captureNameToNumberMapping is null || captureCount == captureNameToNumberMapping.Count); 54Debug.Assert(captureNameToNumberMapping is not null); 60Debug.Assert(captureNumber is not null); 65Debug.Assert(captureNumber is not null); 68Debug.Assert(captureNumber == i);
System\Text\RegularExpressions\RegexWriter.cs (3)
31Debug.Assert(!Enum.IsDefined(BeforeChild)); 32Debug.Assert(!Enum.IsDefined(AfterChild)); 447Debug.Fail($"Unexpected node: {nodeType}");
System\Text\RegularExpressions\Symbolic\BDD.cs (13)
68Debug.Assert((one is null) == (zero is null), "Neither or both children should be null."); 90Debug.Assert((One is null) == (Zero is null)); 112Debug.Assert(!set.IsEmpty); 174Debug.Assert(nodes[nodes.Length - 1] == this); 175Debug.Assert(nodes.Length <= (1 << 24)); 224Debug.Assert(v >= 0); 311Debug.Assert(serialized.AsSpan().Min() > 0); 341Debug.Assert(bytes.Length > 1, "All inputs are expected to be larger than a single byte, which would map to False or True."); 350Debug.Assert((bytes.Length - 1) % bytesPerLong == 0); 378Debug.Assert(oneId < i && zeroId < i); 379Debug.Assert(nodes[oneId] is not null); 380Debug.Assert(nodes[zeroId] is not null); 499Debug.Assert(leaf is not null, "this should never happen because there must exist another leaf besides False");
System\Text\RegularExpressions\Symbolic\BDDRangeConverter.cs (1)
101Debug.Assert(!set.IsLeaf);
System\Text\RegularExpressions\Symbolic\BitVector.cs (7)
32Debug.Assert(length > 0); 42Debug.Assert(length > 0); 73Debug.Assert(i >= 0 && i < Length); 81Debug.Assert(i >= 0 && i < Length); 89Debug.Assert(x.Length == y.Length); 106Debug.Assert(x.Length == y.Length); 123Debug.Assert(!bitVectors.IsEmpty);
System\Text\RegularExpressions\Symbolic\CharSetSolver.cs (5)
198Debug.Assert(!set.IsLeaf, "Did not expect multi-terminal"); 214Debug.Assert(op is BooleanOperation.Or or BooleanOperation.And or BooleanOperation.Xor); 248Debug.Assert(!set1.IsLeaf || !set2.IsLeaf, "Did not expect multi-terminal case"); 255Debug.Assert(!set2.IsLeaf); 355Debug.Assert(terminal >= 0);
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (6)
44Debug.Assert(_first is not null); 54Debug.Assert(other != this, "self append not allowed to avoid circularity"); 74Debug.Assert(_last is not null); 141Debug.Assert(_first is null && _last is null, "empty list"); 145Debug.Assert(_size > 0, "_size < 0 means that the list has been invalidated after Append"); 146Debug.Assert(_first is not null && _last is not null && _first.Prev is null && _last.Next is null, "non-empty list");
System\Text\RegularExpressions\Symbolic\MatchingState.cs (3)
58Debug.Assert(IsNullableFor(nextCharKind)); 59Debug.Assert(CharKind.IsValidCharKind(nextCharKind)); 107Debug.Assert(nextCharKind is >= 0 and < CharKind.CharKindCount);
System\Text\RegularExpressions\Symbolic\MatchReversal.cs (3)
14Debug.Assert(kind is MatchReversalKind.MatchStart or MatchReversalKind.FixedLength or MatchReversalKind.PartialFixedLength); 15Debug.Assert(fixedLength >= 0); 16Debug.Assert((adjustedStartState is not null) == (kind is MatchReversalKind.PartialFixedLength));
System\Text\RegularExpressions\Symbolic\MintermClassifier.cs (2)
37Debug.Assert(minterms.Length > 0, "Requires at least"); 107Debug.Assert(_intLookup is not null);
System\Text\RegularExpressions\Symbolic\MintermGenerator.cs (3)
73Debug.Assert(_right is null); 79Debug.Assert(_right is not null); 102Debug.Assert(node._left is not null && node._right is not null);
System\Text\RegularExpressions\Symbolic\RegexNodeConverter.cs (20)
31Debug.Assert(_builder is not null); 47Debug.Assert(childResults is null || childResults.Length != 0); 73Debug.Assert(str is not null); 90Debug.Assert(childResults is not null && childResults.Length == node.ChildCount()); 126Debug.Assert(set is not null); 196Debug.Fail(description); 204Debug.Assert(node.ChildCount() > 0); 205Debug.Assert(childResults is not null); 206Debug.Assert(childResults.Length == node.ChildCount()); 207Debug.Assert(result.Count == 0); 253Debug.Assert(childResults.Length == 1); 267Debug.Assert(node.Kind == RegexNodeKind.Capture && node.N == -1); 269Debug.Assert(childResults.Length == 1); 285Debug.Assert(rootResult.Count == 1 || root.Kind == RegexNodeKind.Concatenate || root.Kind == RegexNodeKind.Capture); 312Debug.Assert(node.Kind == RegexNodeKind.Set); 315Debug.Assert(set is not null); 378Debug.Assert(!Enum.IsDefined((UnicodeCategory)UnicodeCategoryCount)); 428Debug.Assert(cat >= 0 && cat < categoryCodes.Length, $"Expected {cat} to be in range [0, {categoryCodes.Length})."); 516Debug.Assert(result is not null); 523Debug.Assert(Enum.IsDefined(code) || code == (UnicodeCategory)(RegexCharClass.SpaceConst - 1), $"Unknown category: {code}");
System\Text\RegularExpressions\Symbolic\SparseIntMap.cs (4)
41Debug.Assert(entryKey < sparse.Length); 68Debug.Assert(0 <= index && index < _dense.Count); 69Debug.Assert(_dense[index].Key == key); 76Debug.Assert(newLength > _sparse.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexBuilder.cs (7)
225Debug.Assert(node._set is not null); 235Debug.Assert(node._left is not null); 315Debug.Assert(node._set is not null); 319Debug.Assert(node._left is not null); 323Debug.Assert(node._left is not null && node._right is not null); 347Debug.Assert(node._left is not null); 351Debug.Fail($"{nameof(Transform)}:{node._kind}");
System\Text\RegularExpressions\Symbolic\SymbolicRegexInfo.cs (5)
34Debug.Assert(!isAlwaysNullable || canBeNullable); 35Debug.Assert(!startsWithLineAnchor || containsLineAnchor); 36Debug.Assert(!startsWithLineAnchor || startsWithSomeAnchor); 37Debug.Assert(!containsLineAnchor || containsSomeAnchor); 38Debug.Assert(!startsWithSomeAnchor || containsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Automata.cs (16)
111Debug.Assert(newSize >= array.Length); 129Debug.Assert(Monitor.IsEntered(this)); 143Debug.Assert(Monitor.IsEntered(this)); 167Debug.Assert(Monitor.IsEntered(this)); 206Debug.Assert(left is not null); 236Debug.Assert(pos >= 0); 260Debug.Assert(_stateArray is not null); 295Debug.Assert(Monitor.IsEntered(this)); 296Debug.Assert(node.Kind != SymbolicRegexNodeKind.Alternate); 328Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 342Debug.Assert(stateId > 0); 344Debug.Assert(state is not null); 351Debug.Assert(nfaStateId < _nfaCoreIdArray.Length); 352Debug.Assert(_nfaCoreIdArray[nfaStateId] < _stateArray.Length); 360Debug.Assert(offset < _dfaDelta.Length); 389Debug.Assert(nfaOffset < _nfaDelta.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (40)
171Debug.Assert(builder._solver is UInt64Solver or BitVectorSolver, $"Unsupported solver: {builder._solver}"); 178Debug.Assert(solverMinterms is not null); 221Debug.Assert(CharKind.General == 0); 295Debug.Assert(Solver.IsEmpty(Solver.And(Solver.Not(_builder._wordLetterForBoundariesSet), minterm))); 340Debug.Assert(_checkTimeout); 356Debug.Assert(startat >= 0 && startat <= input.Length, $"{nameof(startat)} == {startat}, {nameof(input.Length)} == {input.Length}"); 357Debug.Assert(perThreadData is not null); 416Debug.Assert(matchEnd >= startat - 1); 462Debug.Fail($"Unexpected reversal kind: {_optimizedReversalInfo.Kind}"); 865Debug.Assert(i >= 0, $"{nameof(i)} == {i}"); 866Debug.Assert(matchStartBoundary >= 0 && matchStartBoundary <= input.Length, $"{nameof(matchStartBoundary)} == {matchStartBoundary}"); 867Debug.Assert(i >= matchStartBoundary, $"Expected {i} >= {matchStartBoundary}."); 888Debug.Assert(i >= matchStartBoundary); 894Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't."); 930Debug.Assert(lastStart != -1); 977Debug.Assert(lastStart != -1); 1021Debug.Assert(perThreadData.Current is not null && perThreadData.Next is not null); 1032Debug.Assert(next.Count == 0); 1061Debug.Assert(coreStateId != _deadStateId); 1082Debug.Assert(current.Count > 0); 1095Debug.Fail("No nullable state found in the set of end states"); 1159Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 1160Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1272Debug.Assert(dfaStateId > 0, $"Expected non-zero {nameof(dfaStateId)}."); 1344Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1345Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1441Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}."); 1442Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}."); 1453Debug.Assert(nextStates.Count == 0 || sourceStates.Count > 0); 1548Debug.Assert(matcher._findOpts is not null); 1560Debug.Assert(pos == input.Length); 1579Debug.Assert(matcher._findOpts is not null); 1580Debug.Assert(lookup is not null, $"{nameof(NoZAnchorFindOptimizationsInitialStateHandler)} must only be used with call sites that pass non-null {nameof(lookup)}."); 1591Debug.Assert(pos == input.Length); 1610Debug.Assert(!matcher._containsAnyAnchor); 1611Debug.Assert(matcher._findOpts is not null); 1612Debug.Assert(currentStateId == matcher._initialStateId, "There are no anchors, so the current state should be the sole initial state."); 1621Debug.Assert(pos == input.Length); 1659Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor); 1688Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Dgml.cs (1)
152Debug.Assert(deltas.Length == matcher._minterms.Length);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.Sample.cs (3)
53Debug.Assert(_minterms is not null); 148Debug.Assert(success); 187Debug.Assert(!bdd.IsEmpty);
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (142)
80Debug.Assert(kind != SymbolicRegexNodeKind.Singleton || set is not null); 114Debug.Assert(node.CanBeNullable); 128Debug.Assert(node._left is not null && node._right is not null); 141Debug.Assert(node._left is not null); 153Debug.Assert(node._kind is SymbolicRegexNodeKind.BeginningAnchor or 174Debug.Assert(_info.CanBeNullable || !_info.IsNullable); 187Debug.Assert(listKind is SymbolicRegexNodeKind.Concat or SymbolicRegexNodeKind.Alternate); 203Debug.Assert(node._left is not null && node._right is not null); 244Debug.Assert(context < CharKind.ContextLimit); 258Debug.Assert(_left is not null); 263Debug.Assert(_left is not null && _right is not null); 268Debug.Assert(_left is not null && _right is not null); 315Debug.Assert(_left is not null); 323Debug.Assert(_kind == SymbolicRegexNodeKind.EndAnchorZReverse); 339Debug.Assert(_left is not null); 342Debug.Assert(_left._set is not null); 355Debug.Assert(_set is not null); 392Debug.Assert(kind is 411Debug.Assert(lower >= 0 && lower <= upper); 416Debug.Assert(body._left is not null); 432Debug.Assert(node._left is not null && node._right is not null); 462Debug.Assert(right._kind is not SymbolicRegexNodeKind.Effect); 465Debug.Assert(left._left is not null && left._right is not null); 521Debug.Assert(current._left is not null && current._right is not null); 523Debug.Assert(current._left._kind != SymbolicRegexNodeKind.Alternate); 583Debug.Assert(left._kind != SymbolicRegexNodeKind.Alternate); 584Debug.Assert(deduplicated); 653Debug.Assert(left._left is not null && left._right is not null); 661Debug.Assert(right._left is not null && right._right is not null); 669Debug.Assert(left._left is not null && right._left is not null && right._right is not null); 673Debug.Assert(rl._left is not null); 683Debug.Assert(left._left is not null && left._right is not null); 687Debug.Assert(ll._left is not null); 696Debug.Assert(left._left is not null && left._right is not null); 715Debug.Assert(prefix._left is not null && prefix._right is not null); 719Debug.Assert(node._left is not null && node._right is not null); 731Debug.Assert(node._left is not null && node._right is not null); 752Debug.Assert(current._left is not null); 775Debug.Assert(right.Subsumes(builder, left)); 791Debug.Assert(left._left is not null && left._right is not null); 792Debug.Assert(right.Subsumes(builder, left._left)); 814Debug.Assert(right._left is not null && right._right is not null); 815Debug.Assert(right._left.Subsumes(builder, left)); 823Debug.Assert(right._left is not null && right._right is not null); 844Debug.Assert(suffix._left is not null && suffix._right is not null); 846Debug.Assert(suffix.Subsumes(builder, left)); 911Debug.Assert(_left is not null); 929Debug.Assert(_left is not null && _right is not null); 948Debug.Assert(_left is not null && _right is not null); 962Debug.Assert(_left is not null); 990Debug.Assert(_left is not null && _right is not null); 997Debug.Assert(_left is not null && _right is not null); 1013Debug.Assert(_lower == lengthSoFar); 1069Debug.Assert(_left is not null); 1103Debug.Assert(_left is not null && _right is not null); 1114Debug.Assert(_left is not null && _right is not null); 1145Debug.Assert(_left is not null && _right is not null); 1160Debug.Assert(loop.Kind == SymbolicRegexNodeKind.Loop && loop._left is not null); 1199Debug.Assert(loop._left.IsNullableFor(context)); 1214Debug.Assert(_kind == SymbolicRegexNodeKind.Loop && _left is not null); 1267Debug.Assert(_set is not null); 1285Debug.Assert(_left is not null && _right is not null); 1317Debug.Assert(_left is not null); 1318Debug.Assert(_upper > 0); 1338Debug.Assert(_left is not null && _right is not null); 1345Debug.Fail($"{nameof(CreateDerivative)}:{_kind}"); 1388Debug.Assert(_left is not null && _right is not null); 1394Debug.Assert(_left is not null && _right is not null); 1395Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1400Debug.Assert(_left is not null && _right is not null); 1415Debug.Assert(_left is not null); 1420Debug.Assert(_left is not null); 1425Debug.Fail($"{nameof(StripEffects)}:{_kind}"); 1473Debug.Assert(_left is not null && _right is not null); 1485Debug.Assert(_left is not null && _right is not null); 1486Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1500Debug.Assert(_left is not null && _right is not null); 1509Debug.Assert(_left is not null); 1526Debug.Assert(_left is not null); 1538Debug.Fail($"{nameof(StripAndMapEffects)}:{_kind}"); 1564Debug.Assert(_left is not null && _right is not null); 1565Debug.Assert(_left.IsNullableFor(context) && _right.IsNullableFor(context)); 1571Debug.Assert(_left is not null); 1575Debug.Assert(_left.IsNullableFor(context)); 1581Debug.Assert(_left is not null && _right is not null); 1590Debug.Assert(_right.IsNullableFor(context)); 1604Debug.Assert(_left is not null); 1671Debug.Assert(_left is not null && _right is not null); 1680Debug.Assert(_left is not null && _right is not null); 1691Debug.Assert(_set is not null); 1696Debug.Assert(_left is not null); 1755Debug.Assert(_left is not null && _right is not null); 1769Debug.Assert(_lower >= 0); 1775Debug.Assert(_lower >= 0); 1781Debug.Assert(_left is not null); 1786Debug.Fail($"{nameof(ToStringHelper)}:{_kind}"); 1876Debug.Assert(_set is not null); 1881Debug.Assert(_left is not null); 1886Debug.Assert(_left is not null && _right is not null); 1896Debug.Assert(conc._left is not null && conc._right is not null); 1904Debug.Assert(_left is not null); 1914Debug.Fail($"{nameof(CollectSets)}:{_kind}"); 1936Debug.Assert(_left is not null); 1941Debug.Assert(_left is not null && _right is not null); 1946Debug.Assert(rest._left is not null && rest._right is not null); 1957Debug.Assert(_left is not null && _right is not null); 1983Debug.Fail("Should only happen if a reversed regex is reversed again, which isn't expected"); 1987Debug.Assert(_left is not null); 2013Debug.Assert(_left is not null && _right is not null); 2017Debug.Assert(_left is not null && _right is not null); 2021Debug.Assert(_left is not null); 2034Debug.Assert(kind != SymbolicRegexNodeKind.Singleton); 2054Debug.Assert(left is not null); 2058Debug.Assert(left is not null && right is not null); 2062Debug.Assert(left is not null && right is not null); 2067Debug.Assert(left is not null); 2071Debug.Fail($"{nameof(ComputeStartSet)}:{kind}"); 2139Debug.Assert(_left is not null); 2147Debug.Assert(_left is not null && _right is not null); 2151Debug.Assert(left1 is not null && right1 is not null); 2159Debug.Assert(_left is not null && _right is not null); 2163Debug.Assert(left1 is not null && right1 is not null); 2171Debug.Assert(_left is not null && _right is not null); 2179Debug.Assert(_left is not null); 2199Debug.Assert(IsNullableFor(context)); 2213Debug.Assert(_left is not null && _right is not null); 2222Debug.Assert(_right.IsNullableFor(context)); 2227Debug.Assert(_left is not null && _right is not null); 2245Debug.Assert(_left is not null); 2247Debug.Assert(_left._kind is not SymbolicRegexNodeKind.DisableBacktrackingSimulation); 2259Debug.Assert(current._left is not null && current._right is not null); 2260Debug.Assert(current._left._kind is not SymbolicRegexNodeKind.Alternate); 2309Debug.Assert(_left is not null && _right is not null); 2314Debug.Assert(_left is not null && _right is null); 2315Debug.Assert(_lower >= 0 && _upper > 0 && _upper >= _lower); 2343Debug.Assert(_lower > 0); 2358Debug.Assert(_left is not null); 2362Debug.Assert(_left is null && _right is null); 2394Debug.Assert(current._left is not null && current._right is not null); 2401Debug.Assert(current._left is not null); 2413Debug.Assert(m >= 0 && n >= 0); 2420Debug.Assert(m >= 0 && n >= 0);
System\Text\RegularExpressions\Symbolic\SymbolicRegexRunnerFactory.cs (5)
17Debug.Assert((options & (RegexOptions.RightToLeft | RegexOptions.ECMAScript)) == 0); 27Debug.Assert(threshold > 0); 86Debug.Assert(pos.CaptureEnds != null); 87Debug.Assert(pos.CaptureStarts.Length == pos.CaptureEnds.Length); 92Debug.Assert(pos.CaptureEnds[cap] >= pos.CaptureStarts[cap]);
System\Text\RegularExpressions\Symbolic\UInt64Solver.cs (1)
17Debug.Assert(minterms.Length <= 64);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryConditions.cs (1)
28Debug.Assert(Enum.GetValues<UnicodeCategory>().Length == UnicodeCategoryValueCount);
System\Text\RegularExpressions\Symbolic\UnicodeCategoryRangesGenerator.cs (3)
23Debug.Assert(namespacename != null); 24Debug.Assert(classname != null); 25Debug.Assert(path != null);
System\Text\StructListBuilder.cs (1)
61Debug.Assert(array.Length == _count);
System.Text.RegularExpressions.Generator (263)
RegexGenerator.cs (1)
110Debug.Assert(state is Diagnostic or ValueTuple<RegexMethod, string, Diagnostic, CompilationData>);
RegexGenerator.Emitter.cs (93)
522Debug.Assert(chars.Length > 3); 864Debug.Assert(minRequiredLength >= 0); 918Debug.Fail($"Unexpected mode: {regexTree.FindOptimizations.FindMode}"); 1152Debug.Assert(!string.IsNullOrEmpty(substring)); 1159Debug.Assert(!string.IsNullOrEmpty(substring)); 1163Debug.Assert(!string.IsNullOrEmpty(regexTree.FindOptimizations.FixedDistanceLiteral.String)); 1173Debug.Fail($"Unexpected mode: {opts.FindMode}"); 1232Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingStrings_LeftToRight or FindNextStartingPositionMode.LeadingStrings_OrdinalIgnoreCase_LeftToRight); 1278Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1327Debug.Assert(primarySet.Chars.Length > 0); 1425Debug.Assert(setIndex is 0 or 1); 1431Debug.Assert(needLoop); 1466Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1469Debug.Assert(set.Distance == 0); 1476Debug.Assert(!set.Negated); 1500Debug.Assert(regexTree.FindOptimizations.LiteralAfterLoop is not null); 1503Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1504Debug.Assert(target.LoopNode.N == int.MaxValue); 1625Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 1626Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child"); 1775Debug.Assert(requiredLength > 0); 1807Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}"); 1808Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 1811Debug.Assert(childCount >= 2); 1818Debug.Assert(node.Parent is not null); 1891Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node."); 1897Debug.Assert(numChars != 0); 1978Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}"); 2198Debug.Assert(sliceStaticPos == 0); 2205Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}"); 2274Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}"); 2275Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}"); 2447Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 2448Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}"); 2627Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}"); 2628Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2720Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}"); 2721Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2761Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}"); 2762Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 2866Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced."); 3005Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0))); 3024Debug.Fail($"Unexpected node type: {node.Kind}"); 3030Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}"); 3031Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}"); 3033Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional || rm.Analysis.MayBacktrack(node.Child(0)), "Expected lookaround/conditional or a child that may backtrack"); 3060Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}"); 3072Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}"); 3073Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}"); 3202Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 3205Debug.Assert(!rtl || offset is null); 3206Debug.Assert(!rtl || !clauseOnly); 3246Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}"); 3286Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}"); 3287Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3288Debug.Assert(sliceStaticPos >= 0); 3352Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}"); 3353Debug.Assert(node.Str is not null); 3359Debug.Assert(str.Length >= 2); 3360Debug.Assert(!clauseOnly || (!emitLengthCheck && !rightToLeft)); 3364Debug.Assert(emitLengthCheck); 3401Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}"); 3421Debug.Assert(node.M < node.N); 3579Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}"); 3602Debug.Assert(node.M < node.N); 3826Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 3827Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 3828Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 3829Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 3921Debug.Assert(sliceStaticPos == 0); 3987Debug.Assert(entriesPerIteration >= 1); 4101Debug.Assert(entriesPerIteration >= 1); 4132Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}"); 4252Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4268Debug.Assert(node.N > node.M); 4384Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}"); 4385Debug.Assert(node.M == 0 && node.N == 1); 4422Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4423Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4424Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}"); 4425Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4426Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}"); 4442Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}"); 4443Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}"); 4444Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}"); 4445Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}"); 4560Debug.Assert(sliceStaticPos == 0); 4693Debug.Assert(startingStackpos is not null); 4824Debug.Assert(args.Length is >= 1); 4876Debug.Assert(args.Length is >= 1); 5066Debug.Assert(!negate, "Negation isn't appropriate for a multi"); 5312Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 5559Debug.Fail("This shouldn't happen, as we should only get to the point of emitting code if RegexOptions was valid.");
RegexGenerator.Parser.cs (1)
128Debug.Assert(regexMemberSymbol is IPropertySymbol);
src\runtime\src\libraries\Common\src\Polyfills\EncodingPolyfills.cs (1)
71Debug.Assert(charCount == charsWritten);
src\runtime\src\libraries\Common\src\System\Buffers\SearchValuesPolyfills.cs (1)
65Debug.Assert(_nonAscii.Length < 10, "Expected few non-ASCII characters at most.");
src\runtime\src\libraries\Common\src\System\Collections\Generic\ValueListBuilder.cs (8)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 94Debug.Assert(index == 0, "Implementation currently only supports index == 0"); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length); 208Debug.Assert(additionalCapacityBeyondPos > 0); 209Debug.Assert(_pos > _span.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCaseEquivalences.cs (4)
81Debug.Assert(cultureName[0] is >= 'a' and <= 'z'); 82Debug.Assert(cultureName[1] is >= 'a' and <= 'z'); 133Debug.Assert((c / CharactersPerRange) < 0xFF); 145Debug.Assert(((c % CharactersPerRange) + firstLevelLookupValue) < 0xFFFF);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (22)
197Debug.Assert( 204Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})"); 210Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 244Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge"); 282Debug.Assert(!set.IsEmpty); 300Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. "); 474Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class"); 574Debug.Assert(c != 0); 742Debug.Assert(count <= evaluated); 786Debug.Assert(set1Negated == set2Negated); 865Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 982Debug.Assert((uint)comparison <= char.MaxValue); 1029Debug.Assert(twoChars.Length >= 2); 1115Debug.Assert(!hasSubtraction); 1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters"); 1247Debug.Assert(ch < 128); 1265Debug.Assert(ch < 128); 1350Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed"); 1440Debug.Assert(curcat < 0); 1541Debug.Assert(chars[index] < chars[index + 1]); 1621Debug.Assert(i == span.Length); 1849Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (6)
49Debug.Assert(!isLeadingPartial || !rightToLeft, "RightToLeft unexpected when isLeadingPartial"); 86Debug.Assert(maxLength >= MinRequiredLength, $"{maxLength} should have been greater than {MinRequiredLength} minimum"); 142Debug.Assert(!RegexCharClass.IsNegated(charClass)); 149Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 187Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 384Debug.Assert(chars is { Length: 1 });
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (87)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 233Debug.Fail($"Unexpected type: {Kind}"); 243Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node"); 256Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}"); 262Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed."); 268Debug.Fail("All Group nodes should have been removed."); 298Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}."); 307Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}."); 311Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}"); 315Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}"); 320Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}."); 324Debug.Fail($"Unexpected node type: {node.Kind}"); 332Debug.Assert(node.Str is not null, "Expect non-null multi string"); 333Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters"); 340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}."); 344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\"."); 355Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase"); 372Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 373Debug.Assert(rootNode.Parent is null); 374Debug.Assert(rootNode.ChildCount() == 1); 589Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 594Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 659Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 676Debug.Assert(Kind == RegexNodeKind.Group); 681Debug.Assert(u.ChildCount() == 1); 704Debug.Assert(Kind == RegexNodeKind.Atomic); 705Debug.Assert(ChildCount() == 1); 754Debug.Assert(branches is not null && branches.Count != 0); 881Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1013Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 1014Debug.Assert(!string.IsNullOrEmpty(Str)); 1073Debug.Assert(Kind == RegexNodeKind.Alternate); 1241Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1341Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1342Debug.Assert(node.ChildCount() >= 2); 1384Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1419Debug.Assert(startingSpan.Length > 0); 1448Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1449Debug.Assert(startingNode.Str!.Length > 0); 1472Debug.Assert(startingSpan.Length > 0); 1495Debug.Assert(startingSpan.Length == 1); 1496Debug.Assert(startingSpan[0] == node.Ch); 1502Debug.Assert(node.Kind == RegexNodeKind.Multi); 1503Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1557Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1558Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1572Debug.Assert(Kind is RegexNodeKind.Alternate); 1573Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1608Debug.Assert(startingLiteralNode.IsSetFamily); 1687Debug.Assert(lowInclusive < highInclusive); 1723Debug.Assert(@string is not null); 1729Debug.Assert(setChars is not null); 1742Debug.Assert(Kind == RegexNodeKind.Concatenate); 1784Debug.Assert(Kind == RegexNodeKind.Concatenate); 1785Debug.Assert(Children is List<RegexNode>); 1867Debug.Assert(Kind == RegexNodeKind.Concatenate); 1868Debug.Assert(Children is List<RegexNode>); 1978Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 2050Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking"); 2076Debug.Assert(Children is List<RegexNode>); 2221Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 2222Debug.Assert(ChildCount() == 1); 2341Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 2342Debug.Assert(ChildCount() is 1 or 2); 2359Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2360Debug.Assert(ChildCount() is 2 or 3); 2402Debug.Assert(loopNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop); 2712Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list"); 2788Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation."); 2874Debug.Assert(childCount >= 2); 2907Debug.Assert(ChildCount() == 1); 2936Debug.Fail($"Unknown node: {Kind}"); 2991Debug.Assert(childCount >= 2); 3045Debug.Assert(ChildCount() == 1); 3073Debug.Fail($"Unknown node: {Kind}"); 3105Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 3241Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}"); 3302Debug.Assert(max >= 2); 3347Debug.Assert(Children is List<RegexNode>); 3358Debug.Assert(Children != null); 3359Debug.Assert(index < ChildCount()); 3371Debug.Assert(Children != null); 3397Debug.Assert(Children is RegexNode);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexParser.cs (7)
57Debug.Assert(pattern != null, "Pattern must be set"); 58Debug.Assert(culture != null, "Culture must be set"); 444Debug.Fail($"Unexpected char {ch}"); 502Debug.Fail($"Unexpected char {ch}"); 1149Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 1228Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern"); 2152Debug.Assert(_pos < _pattern.Length, "The current reading position must not be at the end of the pattern");
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (9)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 521results.ForEach(r => Debug.Assert( 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1118Debug.Fail($"Unexpected node {node.Kind}"); 1153Debug.Assert(node.ChildCount() >= 2); 1199Debug.Assert( 1429Debug.Assert(leading);
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexTree.cs (9)
47Debug.Assert(captureNumberSparseMapping is null || captureNames is not null); 48Debug.Assert((captureNames is null) == (captureNameToNumberMapping is null)); 49Debug.Assert(captureNames is null || captureCount == captureNames.Length); 50Debug.Assert(captureNumberSparseMapping is null || captureCount == captureNumberSparseMapping.Count); 51Debug.Assert(captureNameToNumberMapping is null || captureCount == captureNameToNumberMapping.Count); 54Debug.Assert(captureNameToNumberMapping is not null); 60Debug.Assert(captureNumber is not null); 65Debug.Assert(captureNumber is not null); 68Debug.Assert(captureNumber == i);
UpgradeToGeneratedRegexAnalyzer.cs (1)
78Debug.Assert(syntaxNodeForDiagnostic is not null);
UpgradeToGeneratedRegexCodeFixer.cs (1)
424Debug.Fail($"Unknown parameter: {parameterName}");
System.Threading (77)
System\Threading\Barrier.cs (2)
519Debug.Assert(result); 751Debug.Assert(phase < CurrentPhaseNumber);
System\Threading\CountdownEvent.cs (3)
176Debug.Assert(_event != null); 219Debug.Assert(_event != null); 249Debug.Assert(_currentCount >= 0, "latch was decremented below zero");
System\Threading\ReaderWriterLock.cs (72)
87Debug.Assert(threadLocalLockEntry._readerLevel == 0); 92Debug.Assert((_state & LockStates.ReadersMask) != 0); 105Debug.Assert(threadLocalLockEntry.IsFree); 202Debug.Assert(threadLocalLockEntry.HasLockID(_lockID)); 207Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 208Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 231Debug.Assert(readerEvent != null); 237Debug.Assert((_state & LockStates.ReadersMask) < LockStates.ReadersMask); 248Debug.Assert(threadLocalLockEntry.IsFree); 258Debug.Assert((knownState & LockStates.ReaderSignaled) != 0); 259Debug.Assert((knownState & LockStates.ReadersMask) < LockStates.ReadersMask); 272Debug.Assert((_state & LockStates.Writer) == 0); 273Debug.Assert((_state & LockStates.ReadersMask) != 0); 289Debug.Assert((_state & LockStates.ReadersMask) == 0); 373Debug.Assert((_state & LockStates.WriterSignaled) != 0); 389Debug.Assert(writerEvent != null); 408Debug.Assert((knownState & LockStates.WriterSignaled) != 0); 409Debug.Assert((knownState & LockStates.Writer) == 0); 413Debug.Assert(_writerLevel == 0); 430Debug.Assert((_state & LockStates.Writer) != 0); 431Debug.Assert((_state & LockStates.ReadersMask) == 0); 432Debug.Assert(_writerID == InvalidThreadID); 458Debug.Assert((_state & LockStates.Writer) == 0); 459Debug.Assert((_state & LockStates.ReadersMask) != 0); 460Debug.Assert(threadLocalLockEntry._readerLevel > 0); 494Debug.Assert(currentState != knownState); 519Debug.Assert(currentState != knownState); 531Debug.Assert((knownState & LockStates.Writer) == 0); 532Debug.Assert((knownState & LockStates.ReadersMask) != 0); 542Debug.Assert((_state & LockStates.WriterSignaled) != 0); 543Debug.Assert(writerEvent != null); 549Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 550Debug.Assert(readerEvent != null); 560Debug.Assert(threadLocalLockEntry.IsFree); 570Debug.Assert((_state & LockStates.ReadersMask) == 0); 571Debug.Assert((_state & LockStates.Writer) != 0); 572Debug.Assert(_writerLevel > 0); 614Debug.Assert(currentState != knownState); 628Debug.Assert(currentState != knownState); 639Debug.Assert((knownState & LockStates.ReadersMask) == 0); 640Debug.Assert((knownState & LockStates.Writer) != 0); 647Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 648Debug.Assert(readerEvent != null); 654Debug.Assert((_state & LockStates.WriterSignaled) != 0); 655Debug.Assert(writerEvent != null); 694Debug.Assert((_state & LockStates.ReadersMask) != 0); 695Debug.Assert(threadLocalLockEntry._readerLevel > 0); 707Debug.Assert(threadLocalLockEntry.IsFree); 770Debug.Assert(_writerLevel > 0); 804Debug.Assert(currentState != knownState); 810Debug.Assert((knownState & LockStates.ReadersMask) == 0); 817Debug.Assert((_state & LockStates.ReaderSignaled) != 0); 818Debug.Assert(readerEvent != null); 851Debug.Assert(_writerLevel > 0); 852Debug.Assert(_writerLevel > requestedWriterLevel); 865Debug.Assert((flags & LockCookieFlags.OwnedWriter) != 0 || _writerID != threadID); 897Debug.Assert((_state & LockStates.ReadersMask) != 0); 898Debug.Assert(threadLocalLockEntry._readerLevel > 0); 954Debug.Assert(threadLocalLockEntry.IsFree); 995Debug.Assert(threadLocalLockEntry != null); 1003Debug.Assert(threadID != InvalidThreadID); 1090Debug.Assert((_state & LockStates.CachingEvents) == LockStates.CachingEvents); 1225Debug.Assert(lockID != 0); 1226Debug.Assert(afterEntry != null); 1232Debug.Assert(currentEntry._lockID != lockID || currentEntry.IsFree); 1238Debug.Assert(lockID != 0); 1257Debug.Assert(lockID != 0); 1271Debug.Assert(lockID != 0); 1272Debug.Assert(headEntry == t_lockEntryHead); 1273Debug.Assert(headEntry == null || headEntry._lockID != lockID); 1319Debug.Assert(emptyEntry == headEntry); 1332Debug.Assert(entry._lockID == lockID);
System.Threading.AccessControl (4)
src\runtime\src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
System\Threading\EventWaitHandleAcl.cs (1)
104Debug.Assert(result != null, "result should be non-null on success");
System\Threading\MutexAcl.cs (1)
95Debug.Assert(result != null, "result should be non-null on success");
System\Threading\SemaphoreAcl.cs (1)
110Debug.Assert(result != null, "result should be non-null on success");
System.Threading.Channels (114)
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment is not null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
src\runtime\src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\Channels\AsyncOperation.cs (21)
17private static void AvailableSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation<>)}.{nameof(AvailableSentinel)} invoked with {s}"); 21private static void CompletedSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation<>)}.{nameof(CompletedSentinel)} invoked with {s}"); 106Debug.Assert(!pooled || !cancellationToken.CanBeCanceled); 114Debug.Assert(cancellationCallback is not null, "Expected a non-null cancellation callback when the token is cancelable"); 115Debug.Assert(!_pooled, "Cancelable operations can't be pooled"); 191Debug.Assert( 212Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel."); 213Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel."); 250Debug.Assert(ts is not null, "Expected a TaskScheduler"); 267Debug.Assert(_continuation is not null); 322Debug.Assert(_capturedContext is null); 382Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel."); 383Debug.Assert(IsCompleted, $"Expected IsCompleted"); 407Debug.Assert(capturedContext is ExecutionContext); 420Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}"); 421Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null"); 494Debug.Assert((object?)Next == null); 495Debug.Assert((object?)Previous == null); 496Debug.Assert(_continuationState == null); 497Debug.Assert(_capturedContext == null); 558Debug.Assert(_pooled, "Should only be used for pooled objects");
System\Threading\Channels\BoundedChannel.cs (18)
56Debug.Assert(bufferedCapacity > 0); 242Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 455Debug.Assert(waitingReadersHead is null); 460Debug.Assert(waitingReadersHead is not null); 630Debug.Assert(waitingReadersHead is null); 635Debug.Assert(waitingReadersHead is not null); 684Debug.Fail($"Unexpected operation: {state.Value}"); 695Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 696Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 700Debug.Assert(_blockedReadersHead is null, "There are items available, so there shouldn't be any blocked readers."); 701Debug.Assert(_waitingReadersHead is null, "There are items available, so there shouldn't be any waiting readers."); 706Debug.Assert(_blockedWritersHead is null, "There's space available, so there shouldn't be any blocked writers."); 707Debug.Assert(_waitingWritersHead is null, "There's space available, so there shouldn't be any waiting writers."); 712Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader."); 713Debug.Assert(_blockedWritersHead is null, "There shouldn't be any blocked writer if there's a blocked reader."); 718Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer."); 719Debug.Assert(_blockedReadersHead is null, "There shouldn't be any blocked readers if there's a blocked writer."); 724Debug.Assert(_doneWriting is not null, "We can only complete if we're done writing.");
System\Threading\Channels\ChannelUtilities.cs (23)
59Debug.Assert(error is not null); 100Debug.Assert(head.Previous is not null); 101Debug.Assert(head.Next is not null); 116Debug.Assert(op is not null); 127Debug.Assert(op.Next is null && op.Previous is null); 136Debug.Assert(last is not null); 151Debug.Assert(op is not null); 152Debug.Assert(op.Next is null == op.Previous is null); 160Debug.Assert(op.Previous is not null); 164Debug.Assert(op.Previous == op); 165Debug.Assert(head == op); 210Debug.Assert(current is not null); 213Debug.Assert(next is not null); 238Debug.Assert(current is not null); 241Debug.Assert(next is not null); 266Debug.Assert(current is not null); 269Debug.Assert(next is not null); 294Debug.Assert(error is not null); 301Debug.Assert(current is not null); 304Debug.Assert(next is not null); 329Debug.Assert(current is not null); 330Debug.Assert(condition(current), message); 351Debug.Assert(current is not null);
System\Threading\Channels\RendezvousChannel.cs (13)
172Debug.Assert(reader is null); 173Debug.Assert(waitingWriters is null); 179Debug.Assert(reader is not null); 412Debug.Assert(blockedReader is null); 423Debug.Assert(parent._dropWrites); 478Debug.Fail($"Unexpected operation: {state.Value}"); 492Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 493Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 497Debug.Assert(_blockedWritersHead is null, "There shouldn't be any blocked writer if there's a blocked reader."); 498Debug.Assert(_waitingWritersHead is null, "There shouldn't be any waiting writers if there's a blocked reader."); 503Debug.Assert(_blockedReadersHead is null, "There shouldn't be any blocked readers if there's a blocked writer."); 504Debug.Assert(_waitingReadersHead is null, "There shouldn't be any waiting readers if there's a blocked writer."); 509Debug.Assert(_doneWriting is not null, "We can only complete if we're done writing.");
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (3)
315Debug.Assert((blockedReader is not null) ^ (waitingReader is not null), "Expected either a blocked or waiting reader, but not both"); 329Debug.Assert(blockedReader is not null); 390Debug.Fail($"Unexpected operation: {state.Value}");
System\Threading\Channels\UnboundedChannel.cs (8)
333Debug.Fail($"Unexpected operation: {state.Value}"); 344Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 345Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 351Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers."); 352Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers."); 354Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 359Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available."); 364Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System\Threading\Channels\UnboundedPriorityChannel.cs (9)
138Debug.Assert(Monitor.IsEntered(parent.SyncObj)); 329Debug.Fail($"Unexpected operation: {state.Value}"); 340Debug.Assert(SyncObj is not null, "The sync obj must not be null."); 341Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock."); 347Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers."); 348Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers."); 350Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed."); 355Debug.Assert(_items.Count == 0, "There are blocked/waiting readers, so there shouldn't be any data available."); 360Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System.Threading.RateLimiting (42)
src\runtime\src\libraries\Common\src\System\Collections\Generic\Deque.cs (6)
52Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 68Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 74Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 85Debug.Assert(!IsEmpty); // caller's responsibility to make sure there are elements remaining 112Debug.Assert(_size == _array.Length); 113Debug.Assert(_head == _tail);
System\Threading\RateLimiting\ConcurrencyLimiter.cs (9)
141Debug.Assert(_options.QueueLimit >= _queueCount); 151Debug.Assert(_queueCount >= 0); 185Debug.Assert(_queueCount <= _options.QueueLimit); 212Debug.Assert(_permitCount >= 0); 240Debug.Assert(_permitCount <= _options.PermitLimit); 278Debug.Assert(_permitCount >= 0); 303Debug.Assert(_queueCount >= 0); 313Debug.Assert(_idleSince is null); 379Debug.Assert(count == 0 ? limiter is null : true);
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (8)
167Debug.Assert(_options.QueueLimit >= _queueCount); 177Debug.Assert(_queueCount >= 0); 211Debug.Assert(_queueCount <= _options.QueueLimit); 253Debug.Assert(_permitCount >= 0); 284Debug.Assert(limiter is not null); 349Debug.Assert(_permitCount >= 0); 372Debug.Assert(_queueCount >= 0); 383Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (9)
171Debug.Assert(_options.QueueLimit >= _queueCount); 181Debug.Assert(_queueCount >= 0); 215Debug.Assert(_queueCount <= _options.QueueLimit); 243Debug.Assert(_permitCount >= 0); 276Debug.Assert(limiter is not null); 315Debug.Assert(_permitCount <= _options.PermitLimit); 347Debug.Assert(_permitCount >= 0); 371Debug.Assert(_queueCount >= 0); 382Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (10)
164Debug.Assert(_options.QueueLimit >= _queueCount); 174Debug.Assert(_queueCount >= 0); 208Debug.Assert(_queueCount <= _options.QueueLimit); 219Debug.Assert(_options.TokensPerPeriod > 0); 246Debug.Assert(_tokenCount >= 0); 277Debug.Assert(limiter is not null); 321Debug.Assert(_tokenCount <= _options.TokenLimit); 349Debug.Assert(_tokenCount >= 0); 372Debug.Assert(_queueCount >= 0); 383Debug.Assert(_idleSince is null);
System.Threading.Tasks.Dataflow (414)
Base\DataflowBlock.cs (53)
108Debug.Assert(source != null, "Filtered link requires a source to filter on."); 109Debug.Assert(target != null, "Filtered link requires a target to filter to."); 110Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with."); 123Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required."); 155Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 164Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed."); 210Debug.Assert(filter != null, "Need a filter with which to construct the debug view."); 312Debug.Fail("A message should never be postponed when no source has been provided"); 316Debug.Fail("The message should never be missed, as it's offered to only this one target"); 334Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed."); 390Debug.Assert(target != null, "A valid target to send to is required."); 494Debug.Assert(completionAction != null, "Completion action to run is required."); 503Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration), 543Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE, 584Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING, 596Debug.Fail("The message should never be missed, as it's offered to only this one target"); 639Debug.Assert( 740Debug.Assert(source != null, "Need a source with which to construct the debug view."); 974Debug.Assert(source != null, "Need a source from which to receive."); 1228Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right."); 1310Debug.Fail("Invalid linking cleanup reason specified."); 1527Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage."); 1528Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage."); 1622Debug.Assert(propagator != null, "Need a block with which to construct the debug view."); 1825Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1826Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1827Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1828Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1872Debug.Assert(source != null, "Expected a non-null source"); 1873Debug.Assert(action != null, "Expected a non-null action"); 1874Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)"); 1875Debug.Assert(scheduler != null, "Expected a non-null scheduler"); 1910Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null."); 1911Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null."); 1912Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null."); 1913Debug.Assert(dataflowBlockOptions != null, "Options are required."); 1961Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID"); 1962Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch."); 1965else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch"); 2087Debug.Assert(completed != null, "Requires a shared target to complete."); 2184Debug.Assert(source != null, "Requires a source for which to retrieve the observable."); 2202Debug.Assert(source != null, "The observable requires a source to wrap."); 2248Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target."); 2273Debug.Assert(observer != null, "Expected an observer."); 2279Debug.Assert(currentState != null, "Observer state should never be null."); 2307Debug.Assert(currentState != null, "Observer state should never be null."); 2308Debug.Assert(currentState.Unlinker != null, "The target should be linked."); 2309Debug.Assert(currentState.Canceler != null, "The target should have set up continuations."); 2341Debug.Assert(observable != null, "Need a block with which to construct the debug view."); 2376Debug.Assert(observable != null, "Observe state must be mapped to a source observable."); 2470Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion."); 2539Debug.Assert(target != null, "A target to observe is required.");
Base\DataflowBlockOptions.cs (9)
113Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 125Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 136Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 156Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 175Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 291Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 314Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 423Debug.Assert(this != Default, "Default instance is supposed to be immutable."); 434Debug.Assert(this != Default, "Default instance is supposed to be immutable.");
Base\DataflowLinkOptions.cs (3)
85Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 96Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable."); 108Debug.Assert(this != Default && this != UnlinkAfterOneAndPropagateCompletion, "Default and UnlinkAfterOneAndPropagateCompletion instances are supposed to be immutable.");
Blocks\ActionBlock.cs (11)
106Debug.Assert(asyncAction != null, "action is of incorrect delegate type"); 122Debug.Assert((_spscTarget != null) ^ (_defaultTarget != null), "One and only one of the two targets must be non-null after construction"); 130Debug.Assert(_defaultTarget != null); 153Debug.Assert(action != null, "action needed for processing"); 154Debug.Assert(_defaultTarget != null); 198Debug.Assert(completed != null, "Need completed task for processing"); 199Debug.Assert(completed.IsCompleted, "The task to be processed must be completed by now."); 200Debug.Assert(_defaultTarget != null); 226Debug.Assert(_spscTarget != null); 242Debug.Assert(_spscTarget != null); 327Debug.Assert(actionBlock != null, "Need a block with which to construct the debug view.");
Blocks\BatchBlock.cs (34)
84Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 199Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view"); 290Debug.Assert(batchSize > 0, "A positive batch size is required"); 306Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block."); 307Debug.Assert(batchSize >= 1, "Batch sizes must be positive."); 308Debug.Assert(batchCompletedAction != null, "Completion action must be specified."); 309Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block."); 378Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 406Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode."); 458Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null, 619Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 634Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing."); 663Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 752Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 753Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 770Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode"); 782Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize, 816Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch."); 869Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 870Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 871Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode."); 899Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check."); 928Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch."); 978Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode."); 979Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 980Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1028Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode."); 1029Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1030Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized."); 1031Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode."); 1083Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode."); 1084Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized"); 1114Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 1125Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\BatchedJoinBlock.cs (21)
102Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 149Debug.Assert(_target1 != null, "_target1 not initialized"); 150Debug.Assert(_target2 != null, "_target2 not initialized"); 161Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 162Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 163Debug.Assert(_source != null, "_source not initialized"); 227Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 351Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 401Debug.Assert(_target1 != null, "_target1 not initialized"); 402Debug.Assert(_target2 != null, "_target2 not initialized"); 403Debug.Assert(_target3 != null, "_target3 not initialized"); 415Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 416Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized"); 417Debug.Assert(_source != null, "_source not initialized"); 482Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view."); 540Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate."); 580Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 643Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view."); 676Debug.Assert(batchSize >= 1, "A positive batch size is required."); 677Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch."); 678Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (26)
76Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 91Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 121Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 136Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 188Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 203Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 218Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed."); 229Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 244Debug.Assert(_boundingState != null, "Must be in bounded mode."); 279Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 281Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 325Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 327Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 458Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view."); 547Debug.Assert(owningSource != null, "Must be associated with a broadcast block."); 548Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block."); 668Debug.Assert(target != null, "Target required to offer messages to."); 705else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed."); 738Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue."); 810Debug.Fail("Messages from a Broadcast should never be missed."); 938Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks."); 939Debug.Assert( 1150Debug.Assert(exception != null, "An exception to add is required."); 1151Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 1162Debug.Assert(exceptions != null, "A list of exceptions to add is required."); 1163Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
Blocks\BufferBlock.cs (13)
73Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 116Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 132Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 156Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 171Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 219Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required."); 230Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0, 245Debug.Assert(_boundingState != null, "Must be in bounded mode."); 281Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 283Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 327Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null, 329Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId, 442Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
95Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 133Debug.Assert(_target1 != null, "_target1 not initialized"); 134Debug.Assert(_target2 != null, "_target2 not initialized"); 145Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 146Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 205Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 314Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 352Debug.Assert(_target1 != null, "_target1 not initialized"); 353Debug.Assert(_target2 != null, "_target2 not initialized"); 354Debug.Assert(_target3 != null, "_target3 not initialized"); 366Debug.Assert(_sharedResources != null, "_sharedResources not initialized"); 367Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized"); 429Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view."); 502Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate."); 518Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 519Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point."); 524Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point."); 549Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode"); 584Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode"); 601Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 608Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode"); 641Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode"); 642Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message"); 668Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message"); 683Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode"); 684Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode"); 768Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode."); 779Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null, 843Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 867Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode."); 898Debug.Assert(_messages != null, "_messages must be initialized in greedy mode."); 962Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view."); 1028Debug.Assert(ownerJoin != null, "Resources must be associated with a join."); 1029Debug.Assert(targets != null, "Resources must be shared between multiple targets."); 1030Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided."); 1031Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided."); 1032Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources."); 1262Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing."); 1343Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode"); 1382Debug.Assert(_targets.Length > 0, "A join must have targets."); 1409Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive."); 1420Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformBlock.cs (7)
98Debug.Assert(transformSync == null ^ transformAsync == null, "Exactly one of transformSync and transformAsync must be null."); 129Debug.Assert(transformAsync != null, "Incorrect delegate type."); 154Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 225Debug.Assert(transform != null, "Function to invoke is required."); 270Debug.Assert(completed != null, "Completed task is required."); 271Debug.Assert(completed.IsCompleted, "Task must be completed to be here."); 417Debug.Assert(transformBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.cs (11)
153Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion."); 256Debug.Assert(completed != null, "A task should have been provided."); 257Debug.Assert(completed.IsCompleted, "The task should have been in a final state."); 295Debug.Fail("The task should have been in a final state."); 350Debug.Assert(_reorderingBuffer != null, "Expected a reordering buffer"); 351Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 438Debug.Assert(_reorderingBuffer == null, "Expected not to have a reordering buffer"); 439Debug.Assert(outputItems is TOutput[] || outputItems is List<TOutput>, "outputItems must be a list we've already vetted as trusted"); 538Debug.Assert(_target.IsBounded, "Expected to be in bounding mode."); 541else Debug.Assert(count == 1, "Count shouldn't be negative."); 626Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Blocks\TransformManyBlock.netstandard21.cs (3)
40t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default); 119Debug.Assert(_reorderingBuffer is not null, "Expected a reordering buffer"); 120Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
Blocks\WriteOnceBlock.cs (6)
111Debug.Assert(_decliningPermanently, "We may get here only after we have started to decline permanently."); 112Debug.Assert(_completionReserved, "We may get here only after we have reserved completion."); 170Debug.Assert(_lazyCompletionTaskSource == null || !_lazyCompletionTaskSource.Task.IsCompleted, "The task completion source must not be completed. This must be the only thread that ever completes the block."); 221Debug.Assert(exception != null || !storeExceptionEvenIfAlreadyCompleting, 430Debug.Assert(_header.IsValid, "A valid header is required."); 527Debug.Assert(writeOnceBlock != null, "Need a block with which to construct the debug view.");
Internal\ActionOnDispose.cs (4)
33Debug.Assert(action != null, "Non-null disposer action required."); 48Debug.Assert(action != null, "Non-null disposer action required."); 76Debug.Assert(action != null, "Non-null action needed for disposable"); 117Debug.Assert(action != null, "Non-null action needed for disposable");
Internal\Common.cs (40)
48Debug.Assert(syncObj != null, "The monitor object to check must be provided."); 49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed."); 71Debug.Assert(predicate != null, "Non-null predicate to execute is required."); 95Debug.Assert(wr != null, "Expected a WeakReference<T> as the state argument"); 104Debug.Assert(block != null, "Block required to extract an Id."); 120Debug.Assert(block != null, "Should only be used with valid objects being displayed in the debugger."); 121Debug.Assert(options == null || options.NameFormat != null, "If options are provided, NameFormat must be valid."); 152Debug.Assert(exception != null, "An exception to check for cancellation must be provided."); 178Debug.Assert(completionTask != null, "A task to wire up for completion is needed."); 179Debug.Assert(completeAction != null, "An action to invoke upon cancellation is required."); 214Debug.Assert(exception != null && exception.StackTrace == null, 230Debug.Assert(exc != null, "The exception into which data should be stored must be provided."); 274Debug.Assert(exception != null, "An exception is needed to store the data into."); 275Debug.Assert(key != null, "A key into the exception's data collection is needed."); 276Debug.Assert(value != null, "The value to store must be provided."); 313Debug.Assert(exception != null, "An exception to add is required."); 314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null, 374Debug.Assert(cancellationToken.IsCancellationRequested, 377Debug.Assert(t.IsCanceled, "Task's constructor should cancel the task synchronously in the ctor."); 386Debug.Assert(block != null, "We need a block from which to retrieve a cancellation task."); 407Debug.Assert(outgoingLock != null, "Monitor object needed to protect the operation."); 408Debug.Assert(targetRegistry != null, "Registry from which to remove is required."); 409Debug.Assert(targetBlock != null, "Target block to unlink is required."); 454Debug.Assert(task != null, "Task to start is required."); 455Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 472Debug.Assert(task != null, "Task to start is needed."); 473Debug.Assert(scheduler != null, "Scheduler on which to start the task is required."); 484Debug.Assert(task.IsFaulted, "The task should have been faulted if it failed to start."); 501Debug.Assert(target != null, "There must be a subject target."); 502Debug.Assert(postponedMessages != null, "The stacked map of postponed messages must exist."); 519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source."); 533Debug.Assert(processedCount == initialCount, 548Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 549Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 550Debug.Assert(sourceCompletionTask.IsCompleted, "sourceCompletionTask must be completed in order to propagate its completion."); 571Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 572Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 582Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null."); 583Debug.Assert(target != null, "The target where completion is to be propagated may not be null."); 628Debug.Assert(boundedCapacity > 0, "Bounded is only supported with positive values.");
Internal\DataflowEtwProvider.cs (11)
63Debug.Assert(block != null, "Block needed for the ETW event."); 64Debug.Assert(dataflowBlockOptions != null, "Options needed for the ETW event."); 91Debug.Assert(block != null, "Block needed for the ETW event."); 92Debug.Assert(task != null, "Task needed for the ETW event."); 93Debug.Assert(reason == TaskLaunchedReason.ProcessingInputMessages || reason == TaskLaunchedReason.OfferingOutputMessages, 127Debug.Assert(block != null, "Block needed for the ETW event."); 132Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid."); 178Debug.Assert(source != null, "Source needed for the ETW event."); 179Debug.Assert(target != null, "Target needed for the ETW event."); 200Debug.Assert(source != null, "Source needed for the ETW event."); 201Debug.Assert(target != null, "Target needed for the ETW event.");
Internal\EnumerableDebugView.cs (1)
29Debug.Assert(enumerable != null, "Expected a non-null enumerable.");
Internal\ImmutableArray.cs (1)
41Debug.Assert(elements != null, "Requires an array to wrap.");
Internal\QueuedMap.cs (11)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range."); 93Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 99Debug.Assert(_tailIndex != TERMINATOR_INDEX, "If head does not indicate empty, neither should tail."); 116Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail."); 122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range."); 140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range."); 144Debug.Assert(idx != index, "Index should not belong to the list of free slots."); 211Debug.Assert(items != null, "Requires non-null array to store into."); 212Debug.Assert(count >= 0 && arrayOffset >= 0, "Count and offset must be non-negative"); 213Debug.Assert(arrayOffset + count >= 0, "Offset plus count overflowed"); 214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\ReorderingBuffer.cs (7)
59Debug.Assert(owningSource != null, "Buffer must be associated with a source."); 60Debug.Assert(outputAction != null, "Action required for when items are to be released."); 71Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 86Debug.Assert((ulong)id > (ulong)_nextReorderedIdToOutput, "Duplicate id."); 97Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 123Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out."); 188Debug.Assert(buffer != null, "Need a buffer with which to construct the debug view.");
Internal\SourceCore.cs (21)
108Debug.Assert(owningSource != null, "Core must be associated with a source."); 109Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 110Debug.Assert(completeAction != null, "Action to invoke on completion is required."); 258Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation"); 365Debug.Assert(items != null); 406Debug.Assert(items != null, "Items list must be valid."); 456Debug.Assert(exception != null, "Valid exception must be provided to be added."); 457Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 468Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added."); 469Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 483Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap."); 484Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions."); 573Debug.Assert(linkToTarget != null, "Must have a valid target to offer to."); 622Debug.Fail("The target did not follow the protocol."); 667Debug.Assert(target != null, "Valid target to offer to is required."); 672Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed."); 690Debug.Assert(result == DataflowMessageStatus.Postponed, 735Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty, 794Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 852Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId, 906Debug.Assert(
Internal\SpscTargetCore.cs (7)
77Debug.Assert(owningTarget != null, "Expected non-null owningTarget"); 78Debug.Assert(action != null, "Expected non-null action"); 79Debug.Assert(dataflowBlockOptions != null, "Expected non-null dataflowBlockOptions"); 193Debug.Assert( 256Debug.Assert(previousConsumer != null && previousConsumer.Id == Task.CurrentId, 324Debug.Assert(_completionReserved, "Should only invoke once completion has been reserved."); 341Debug.Assert(result, "Expected completion task to not yet be completed");
Internal\TargetCore.cs (30)
114Debug.Assert(owningTarget != null, "Core must be associated with a target block."); 115Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core."); 116Debug.Assert(callAction != null, "Action to invoke for each item is required."); 129Debug.Assert(_dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor"); 143Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState, 153Debug.Assert(_numberOfOutstandingOperations > 0 || !storeExceptionEvenIfAlreadyCompleting, 168Debug.Assert(_numberOfOutstandingOperations > 0 && (!UsesAsyncCompletion || _numberOfOutstandingServiceTasks > 0), 208Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true."); 218Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 227Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null, 259Debug.Assert(_numberOfOutstandingOperations > 0, "Operations may only be completed if any are outstanding."); 265Debug.Assert(boundingCountChange <= 0 && _boundingState.CurrentCount + boundingCountChange >= 0, 295Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 296Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 297Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 311Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative."); 312Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative."); 313Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations."); 354Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously."); 424Debug.Assert( 495Debug.Assert(_numberOfOutstandingOperations > 0, "Expected a positive number of outstanding operations, since we're completing one here."); 502Debug.Assert(_numberOfOutstandingServiceTasks > 0, "Expected a positive number of outstanding service tasks, since we're completing one here."); 523Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode."); 615Debug.Assert( 660Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid."); 664Debug.Assert(_boundingState.OutstandingTransfers >= 0, "Expected TryConsumePostponedMessage to not be negative."); 730Debug.Assert((_decliningPermanently && _messages.IsEmpty) || CanceledOrFaulted, "There must be no more messages."); 758lock (IncomingLock) Debug.Assert(_numberOfOutstandingOperations == 0, "Everything must be done by now."); 811Debug.Assert(count != 0, "Should only be called when the count is actually changing."); 817Debug.Assert(count > 0 || (count < 0 && _boundingState.CurrentCount + count >= 0),
Internal\TargetRegistry.cs (29)
37Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 38Debug.Assert(linkOptions != null, "The linkOptions must not be null."); 74Debug.Assert(owningSource != null, "The TargetRegistry instance must be owned by a source block."); 85Debug.Assert(target != null, "The target that is supposed to be linked must not be null."); 86Debug.Assert(linkOptions != null, "The link options must not be null."); 97Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 121Debug.Assert(target != null, "Target to remove is required."); 124Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 138Debug.Assert(target != null, "Target to remove is required."); 141Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 142Debug.Assert(!onlyIfReachedMaxMessages || _linksWithRemainingMessages > 0, "We shouldn't have ended on the slow path."); 148Debug.Assert(node != null, "The LinkedTargetInfo node referenced in the Dictionary must be non-null."); 159Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 169Debug.Assert(node.RemainingMessages > 1, "The target should have been removed, because there are no remaining messages."); 184Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time."); 194Debug.Assert(_owningSource.Completion.IsCompleted, "The owning source must have completed before propagating completion."); 214Debug.Assert(node != null, "Requires a node to be added."); 223Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must either be null or non-null."); 224Debug.Assert(_lastTarget.Next == null, "The last node must not have a successor."); 225Debug.Assert(_firstTarget.Previous == null, "The first node must not have a predecessor."); 243Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null after AddToList."); 250Debug.Assert(node != null, "Node to remove is required."); 251Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null before RemoveFromList."); 273Debug.Assert((_firstTarget != null) == (_lastTarget != null), "Both first and last node must either be null or non-null after RemoveFromList."); 312Debug.Assert(owningSource != null, "Propagator must be associated with a source."); 313Debug.Assert(target != null, "Target to propagate to is required."); 323Debug.Assert(source == _owningSource, "Only valid to be used with the source for which it was created."); 378Debug.Assert(passthrough != null, "Need a propagator with which to construct the debug view."); 398Debug.Assert(registry != null, "Need a registry with which to construct the debug view.");
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0."); 68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2"); 69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum."); 70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur."); 102Debug.Assert(segment is not null, "Expected a non-null segment."); 112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow."); 179Debug.Assert(segment is not null, "Expected a non-null segment."); 180Debug.Assert(array is not null, "Expected a non-null item array."); 253Debug.Assert(segment is not null, "Expected a non-null segment."); 254Debug.Assert(array is not null, "Expected a non-null item array."); 368Debug.Assert(syncObj is not null, "The syncObj parameter is null."); 390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2"); 429Debug.Assert(queue is not null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (44)
System\Threading\Tasks\Parallel.cs (17)
918Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 919Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + (bodyWithLocal == null ? 0 : 1)) == 1, 921Debug.Assert(bodyWithLocal != null || (localInit == null && localFinally == null), 1019Debug.Assert(sharedPStateFlags != null); 1024Debug.Assert(sharedPStateFlags != null); 1640Debug.Assert(((body == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 1643Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 1698Debug.Assert(array != null); 1699Debug.Assert(parallelOptions != null, "ForEachWorker(array): parallelOptions is null"); 1757Debug.Assert(list != null); 1758Debug.Assert(parallelOptions != null, "ForEachWorker(list): parallelOptions is null"); 2512Debug.Assert(((simpleBody == null ? 0 : 1) + (bodyWithState == null ? 0 : 1) + 2515Debug.Assert((bodyWithStateAndLocal != null) || (bodyWithEverything != null) || (localInit == null && localFinally == null), 2519Debug.Assert((orderedSource != null) || (bodyWithStateAndIndex == null && bodyWithEverything == null), 2700Debug.Fail("PartitionerForEach: illegal body type in Partitioner handler"); 2815Debug.Assert(exObj is Exception); 2827Debug.Assert(first is OperationCanceledException);
System\Threading\Tasks\Parallel.ForEachAsync.cs (16)
80Debug.Assert(fromInclusive != null); 81Debug.Assert(toExclusive != null); 82Debug.Assert(scheduler != null); 83Debug.Assert(body != null); 249Debug.Assert(source != null); 250Debug.Assert(scheduler != null); 251Debug.Assert(body != null); 404Debug.Assert(source != null); 405Debug.Assert(scheduler != null); 406Debug.Assert(body != null); 601Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 608Debug.Assert(_lock is not null, "Should only be invoked when _lock is non-null"); 641Debug.Assert(_completionRefCount == 0, $"Expected {nameof(_completionRefCount)} == 0, got {_completionRefCount}"); 653Debug.Assert(!Cancellation.IsCancellationRequested); 665Debug.Assert(taskSet, "Complete should only be called once."); 671Debug.Assert(_scheduler == TaskScheduler.Default, $"Expected {nameof(_scheduler)} == TaskScheduler.Default, got {_scheduler}");
System\Threading\Tasks\ParallelLoopState.cs (6)
43Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 100Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 148Debug.Fail(SR.ParallelState_NotSupportedException_UnsupportedMethod); 186Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 237Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 365Debug.Assert(typeof(TInt) == typeof(long));
System\Threading\Tasks\ParallelRangeManager.cs (5)
178Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 182Debug.Assert( 241Debug.Assert((uSpan / uRangeSize) < int.MaxValue); 275Debug.Assert(i == nNumRanges - 1); 291Debug.Assert(_indexRanges != null && _indexRanges.Length != 0);
System.Transactions.Local (226)
System\Transactions\CommittableTransaction.cs (6)
64Debug.Assert(_internalTransaction.State != null); 98Debug.Assert(_internalTransaction.State != null); 133Debug.Assert(_internalTransaction.State != null); 173Debug.Assert(_internalTransaction.State != null); 203Debug.Assert(_internalTransaction.State != null); 223Debug.Assert(_internalTransaction.State != null);
System\Transactions\DependentTransaction.cs (2)
20Debug.Assert(_internalTransaction.State != null); 51Debug.Assert(_internalTransaction.State != null);
System\Transactions\DtcProxyShim\DtcProxyShimFactory.cs (1)
130Debug.Assert(pcbUsed == tmpWhereabouts.Length);
System\Transactions\DurableEnlistmentState.cs (8)
182Debug.Assert(enlistment.Transaction.State != null); 192Debug.Assert(enlistment.Transaction.State != null); 202Debug.Assert(enlistment.Transaction.State != null); 214Debug.Assert(enlistment.Transaction.State != null); 231Debug.Assert(enlistment.PromotableSinglePhaseNotification != null); 239Debug.Assert(enlistment.Transaction.State != null); 251Debug.Assert(enlistment.Transaction.State != null); 263Debug.Assert(enlistment.Transaction.State != null);
System\Transactions\Enlistment.cs (13)
93Debug.Assert(this is RecoveringInternalEnlistment); 103Debug.Assert(this is PromotableInternalEnlistment); 142Debug.Assert(_twoPhaseState != null); 164Debug.Assert(_transaction != null, "this.transaction != null"); 177Debug.Fail("PromotableSinglePhaseNotification called for a non promotable enlistment."); 234Debug.Assert(Transaction._phase0Volatiles._preparedVolatileEnlistments <= 249Debug.Fail("ResourceManagerIdentifier called for non durable enlistment"); 260Debug.Assert(_singlePhaseNotifications != null); 275Debug.Assert(_twoPhaseNotifications != null); 282Debug.Assert(_twoPhaseNotifications != null); 289Debug.Assert(_twoPhaseNotifications != null); 296Debug.Assert(_twoPhaseNotifications != null); 388Debug.Assert(_transaction._phase1Volatiles._preparedVolatileEnlistments <=
System\Transactions\EnlistmentState.cs (15)
59Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 65Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 71Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 77Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 83Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 89Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 95Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 101Debug.Fail($"Invalid Event for InternalEnlistment State; Current State: {GetType()}"); 118Debug.Assert(enlistment.PromotedEnlistment != null); 132Debug.Assert(enlistment.PromotedEnlistment != null); 146Debug.Assert(enlistment.PromotedEnlistment != null); 160Debug.Assert(enlistment.PromotedEnlistment != null); 174Debug.Assert(enlistment.PromotedEnlistment != null); 188Debug.Assert(enlistment.PromotedEnlistment != null); 202Debug.Assert(enlistment.PromotedEnlistment != null);
System\Transactions\InternalTransaction.cs (5)
129Debug.Assert(_promotedTransaction == null, "A transaction can only be promoted once!"); 300Debug.Assert(tx.PromotedTransaction != null); 304Debug.Assert(tx.State! != null); 327Debug.Fail("InternalTransaction.DistributedTransactionOutcome - Unexpected TransactionStatus"); 355Debug.Assert(_committableTransaction != null);
System\Transactions\Oletx\OletxCommittableTransaction.cs (1)
45Debug.Assert(0 == Disposed, "OletxTransction object is disposed");
System\Transactions\Oletx\OletxDependentTransaction.cs (1)
41Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
System\Transactions\Oletx\OletxEnlistment.cs (3)
99Debug.Assert(prepareInfoByteArray != null, 276Debug.Assert(_proxyPrepareInfoByteArray == null, "Unexpected value in this.proxyPrepareInfoByteArray"); 1184Debug.Fail("this.prepareInfoByteArray == null in RecoveryInformation()");
System\Transactions\Oletx\OletxResourceManager.cs (6)
54Debug.Assert(transactionManager != null, "Argument is null"); 152Debug.Assert(value == null, "set_ResourceManagerShim, value not null"); 264Debug.Assert(oletxTransaction != null, "Argument is null"); 265Debug.Assert(enlistmentNotification != null, "Argument is null"); 602Debug.Assert(localResourceManagerShim != null, "ReenlistThread - localResourceManagerShim is null"); 607Debug.Fail("this.prepareInfoByteArray == null in RecoveryInformation()");
System\Transactions\Oletx\OletxTransaction.cs (12)
174Debug.Assert(returnValue != null, "OletxTransaction.GetRealObject - GetTxFromPropToken returned null"); 242Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 262Debug.Assert(singlePhaseNotification != null, "Argument is null"); 263Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 293Debug.Assert(enlistmentNotification != null, "Argument is null"); 294Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 329Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 371Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 448Debug.Assert(Disposed == 0, "OletxTransction object is disposed"); 794Debug.Assert(Phase1EnlistVolatilementContainer == null, 939Debug.Assert(Phase1EnlistVolatilementContainer == null, 1091Debug.Assert(localCount >= 0, "RealOletxTransction.undisposedOletxTransationCount < 0");
System\Transactions\Oletx\OletxVolatileEnlistment.cs (31)
17Debug.Assert(realOletxTransaction != null, "Argument is null"); 97Debug.Assert(enlistment != null, "Argument is null"); 142Debug.Assert(IncompleteDependentClones >= 0, "OletxPhase0VolatileEnlistmentContainer.DependentCloneCompleted - incompleteDependentClones < 0"); 238Debug.Assert(OutstandingNotifications >= 0, "OletxPhase0VolatileEnlistmentContainer.DecrementOutstandingNotifications - outstandingNotifications < 0"); 311Debug.Fail("OletxPhase0VolatileEnlistmentContainer.OutcomeFromTransaction, outcome is not Commited or Aborted or InDoubt"); 323Debug.Assert(Phase == 0 && OutstandingNotifications == 0); 339Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Committed, enlistmentList element is not an OletxVolatileEnlistment."); 371Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Aborted, enlistmentList element is not an OletxVolatileEnlistment."); 403Debug.Fail("OletxPhase1VolatileEnlistmentContainer.InDoubt, enlistmentList element is not an OletxVolatileEnlistment."); 499Debug.Fail("OletxPhase0VolatileEnlistmentContainer.Phase0Request, phase != -1"); 523Debug.Fail("OletxPhase0VolatileEnlistmentContainer.Phase0Request, enlistmentList element is not an OletxVolatileEnlistment."); 528Debug.Assert(enlistment.EnlistDuringPrepareRequired, "OletxPhase0VolatileEnlistmentContainer.Phase0Request, enlistmentList element not marked as EnlistmentDuringPrepareRequired."); 529Debug.Assert(!abortHint, "OletxPhase0VolatileEnlistmentContainer.Phase0Request, abortingHint is true just before sending Prepares."); 569Debug.Assert(enlistment != null, "Argument is null"); 616Debug.Assert(OutstandingNotifications >= 0, "OletxPhase1VolatileEnlistmentContainer.DependentCloneCompleted - DependentCloneCompleted < 0"); 722Debug.Assert(OutstandingNotifications >= 0, "OletxPhase1VolatileEnlistmentContainer.DecrementOutstandingNotifications - outstandingNotifications < 0"); 803Debug.Fail("OletxPhase1VolatileEnlistmentContainer.OutcomeFromTransaction, outcome is not Aborted or InDoubt"); 842Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Committed, enlistmentList element is not an OletxVolatileEnlistment."); 872Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Aborted, enlistmentList element is not an OletxVolatileEnlistment."); 902Debug.Fail("OletxPhase1VolatileEnlistmentContainer.InDoubt, enlistmentList element is not an OletxVolatileEnlistment."); 969Debug.Fail("OletxPhase1VolatileEnlistmentContainer.VoteRequest, enlistmentList element is not an OletxVolatileEnlistment."); 1075Debug.Fail("OletxVolatileEnlistment.Prepare, no enlistmentNotification member."); 1110Debug.Fail("OletxVolatileEnlistment.Prepare, invalid state."); 1156Debug.Fail("OletxVolatileEnlistment.Commit, no enlistmentNotification member."); 1172Debug.Fail("OletxVolatileEnlistment.Commit, invalid state."); 1239Debug.Fail("OletxVolatileEnlistment.Rollback, invalid state."); 1291Debug.Fail("OletxVolatileEnlistment.InDoubt, no enlistmentNotification member."); 1307Debug.Fail("OletxVolatileEnlistment.InDoubt, invalid state."); 1387Debug.Fail("OletxVolatileEnlistment.Prepared, no container member."); 1422Debug.Fail("OletxVolatileEnlistment.Prepared, invalid pending outcome value."); 1463Debug.Fail("OletxVolatileEnlistment.ForceRollback, no container member.");
System\Transactions\Transaction.cs (12)
461Debug.Assert(_internalTransaction.State != null); 502Debug.Assert(_internalTransaction.State != null); 550Debug.Assert(_internalTransaction.State != null); 576Debug.Assert(_internalTransaction.State != null); 600Debug.Assert(_internalTransaction.State != null); 637Debug.Assert(_internalTransaction.State != null); 676Debug.Assert(_internalTransaction.State != null); 797Debug.Assert(_internalTransaction.State != null); 919Debug.Assert(_internalTransaction.State != null); 964Debug.Assert(_internalTransaction.State != null); 1002Debug.Assert(_internalTransaction.State != null); 1019Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionInformation.cs (2)
59Debug.Assert(_internalTransaction.State != null); 88Debug.Assert(_internalTransaction.State != null);
System\Transactions\TransactionInterop.cs (1)
27Debug.Assert(oletxTx != null, "transaction.Promote returned null instead of throwing.");
System\Transactions\TransactionScope.cs (8)
538Debug.Assert(_threadContextData != null); 559Debug.Assert(rollbackTransaction != null); 792Debug.Assert(rollbackTransaction != null); 804Debug.Assert(null != _dependentTransaction, "null != this.dependentTransaction"); 818Debug.Assert(_expectedCurrent != null); 938Debug.Assert(ContextKey != null); 985Debug.Assert(_savedCurrentScope.ContextKey != null); 1027Debug.Assert(_threadContextData != null);
System\Transactions\TransactionsEtwProvider.cs (7)
265Debug.Assert(transaction != null, "Transaction needed for the ETW event."); 589Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 614Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 639Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 664Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 690Debug.Assert(enlistment != null, "Enlistment needed for the ETW event."); 715Debug.Assert(enlistment != null, "Enlistment needed for the ETW event.");
System\Transactions\TransactionState.cs (70)
163Debug.Assert(tx.State != this, "Changing to the same state."); 185Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 299Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 311Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 323Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 335Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 347Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 359Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 371Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 383Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 395Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 411Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 417Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 423Debug.Fail($"Invalid Event for State; Current State: {GetType()}"); 615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0); 618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 664Debug.Assert(tx.promotedToken != null); 788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize"); 835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive"); 845Debug.Assert(tx._promoter != null); 1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize"); 1183Debug.Assert(tx._committableTransaction != null); 1266Debug.Assert(tx._phase1Volatiles._volatileEnlistmentCount == 1, 1668Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1697Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1727Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1768Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1803Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 1879Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 1893Debug.Assert(tx._phase0WaveDependentCloneCount >= 0); 1927Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 1934Debug.Assert(0 <= tx._abortingDependentCloneCount); 1969Debug.Assert(tx.PromotedTransaction != null); 1991Debug.Assert(tx.PromotedTransaction != null); 2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2065Debug.Assert(tx.PromotedTransaction != null); 2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc"); 2255Debug.Assert(tx.PromotedTransaction != null); 2271Debug.Assert(tx.PromotedTransaction != null); 2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2300Debug.Assert(tx.State != null); 2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2641Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted."); 2646Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2763Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2774Debug.Assert(tx.PromotedTransaction != null); 2798Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist."); 2805Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2861Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction."); 2891Debug.Assert(tx.PromotedTransaction != null); 3361Debug.Assert(tx._durableEnlistment != null); 3491Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction"); 3532Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 3551Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 3630Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes."); 3743Debug.Assert(tx._committableTransaction != null); 3844Debug.Assert(tx._durableEnlistment != null); 4262Debug.Assert((distributedTx == null), "PSPEPromote for non-MSDTC promotion returned a distributed transaction."); 4263Debug.Assert((tx.promotedToken != null), "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken."); 4304Debug.Assert(tx.PromotedTransaction != null); 4348Debug.Assert(tx.State == TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive"); 4375Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0"); 4398Debug.Assert(returnState == TransactionStateDelegated || 4419Debug.Assert(tx._promoter != null); 4613Debug.Assert(tx._durableEnlistment != null); 4649Debug.Assert(tx._durableEnlistment != null);
System\Transactions\TransactionTable.cs (3)
332Debug.Assert(lastBucketSet != null); 374Debug.Assert(tx._tableBucket != null); 668Debug.Assert(transactionCount == _index, "Index changed timing out transactions");
System\Transactions\VolatileEnlistmentMultiplexing.cs (9)
258Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 285Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 295Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 305Debug.Assert(_transaction.State != null); 349Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 377Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 388Debug.Assert(_promotedEnlistment != null && _transaction.State != null); 399Debug.Assert(_transaction.State != null); 454Debug.Assert(_volatileDemux == null, "volatileDemux can only be set once.");
System\Transactions\VolatileEnlistmentState.cs (10)
147Debug.Assert(enlistment.EnlistmentNotification != null); 179Debug.Assert(enlistment.Transaction.State != null); 222Debug.Assert(enlistment.SinglePhaseNotification != null); 241Debug.Assert(enlistment.Transaction.State != null); 248Debug.Assert(enlistment.Transaction.State != null); 256Debug.Assert(enlistment.Transaction.State != null); 266Debug.Assert(enlistment.Transaction.State != null); 372Debug.Assert(enlistment.EnlistmentNotification != null); 415Debug.Assert(enlistment.EnlistmentNotification != null); 449Debug.Assert(enlistment.EnlistmentNotification != null);
System.Web.HttpUtility (13)
src\runtime\src\libraries\Common\src\System\HexConverter.cs (6)
189Debug.Assert(utf8Destination.Length >= (source.Length * 2)); 206Debug.Assert(destination.Length >= (source.Length * 2)); 458Debug.Assert((utf8Source.Length % 2) == 0, "Un-even number of characters provided"); 459Debug.Assert((utf8Source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters"); 493Debug.Assert((source.Length % 2) == 0, "Un-even number of characters provided"); 494Debug.Assert((source.Length / 2) == destination.Length, "Target buffer not right-sized for provided characters");
src\runtime\src\libraries\Common\src\System\Text\ValueStringBuilder.cs (6)
39Debug.Assert(value >= 0); 40Debug.Assert(value <= _chars.Length); 50Debug.Assert(capacity >= 0); 82Debug.Assert(index < _pos); 252Debug.Assert(additionalCapacityBeyondPos > 0); 253Debug.Assert(_pos > _chars.Length - additionalCapacityBeyondPos, "Grow called incorrectly, no resize is needed.");
System\Web\Util\HttpEncoder.cs (1)
633Debug.Assert(!_byteBuffer.IsEmpty);
System.Windows.Controls.Ribbon (79)
Microsoft\Windows\Controls\KeyTipAdorner.cs (1)
92Debug.Assert(_keyTipControl == null && keyTipControl.KeyTipAdorner == null);
Microsoft\Windows\Controls\KeyTipService.cs (3)
240Debug.Assert(element != null); 1111Debug.Assert(_currentGlobalScope != null); 1175Debug.Assert(_scopeStack.Count > 0);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryCategoriesPanel.cs (1)
139Debug.Assert(IsScrolling);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryItemsPanel.cs (1)
330Debug.Assert(maxColumnCount >= minColumnCount);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (4)
436Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0)); 474Debug.Assert(index >= 0 && index < starInfoList.Count); 501Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count); 502Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarOverflowPanel.cs (2)
24Debug.Assert(child != null, "child not expected to be null"); 25Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(child), "child expected to have IsOverflowItem == true");
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (16)
183Debug.Assert(generatedChild != null); 222Debug.Assert(overflowPanel.Children.Count >= overflowIndex, "overflowIndex should never get above overflowPanel.Children.Count"); 305Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 307Debug.Assert(QAT.OverflowPanel.Children.Count == numItemsExpectedInOverflowPanel); 313Debug.Assert(object.ReferenceEquals(InternalChildren[j], GeneratedChildren[j])); 315Debug.Assert(currentChild != null); 316Debug.Assert(!RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild)); 317Debug.Assert(this.Children.Contains(currentChild)); 318Debug.Assert(!QAT.OverflowPanel.Children.Contains(currentChild)); 319Debug.Assert(currentChild.IsVisible == this.IsVisible); 320Debug.Assert(currentChild.DesiredSize.Width > 0.0); 327Debug.Assert(object.ReferenceEquals(QAT.OverflowPanel.Children[overflowPanelIndex], GeneratedChildren[k])); 329Debug.Assert(currentChild != null); 330Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild)); 331Debug.Assert(!this.Children.Contains(currentChild)); 332Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (3)
246Debug.Assert(ribbon.TabDisplayIndexToIndexMap.ContainsKey(i)); 248Debug.Assert(children.Count > index && index >= 0); 729Debug.Assert(child != null);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonWindowSmallIconConverter.cs (2)
88Debug.Assert(size.Width != 0, "input param width should not be zero"); 89Debug.Assert(size.Height != 0, "input param height should not be zero");
Microsoft\Windows\Controls\Ribbon\Ribbon.cs (1)
1639Debug.Assert(ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated, "Expected: containers should be generated before calling this method.");
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
616Debug.Assert(_editableTextBoxSite == sender);
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (1)
233Debug.Assert(unit == RibbonControlLengthUnitType.Pixel || unit == RibbonControlLengthUnitType.Item ||
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (10)
103Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 111Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 1039Debug.Assert(selectedItem != null, "Must have a selectedItem to synchronize with."); 1080Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We should add currency change listeners only when IsSynchronizedWithCurrentItemInternal is true"); 1158Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1181Debug.Assert(IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false"); 1489Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2350Debug.Assert(gallery.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated); 2644Debug.Assert(e.RoutedEvent == Mouse.MouseMoveEvent || e.RoutedEvent == Mouse.MouseLeaveEvent); 2645Debug.Assert(_localMousePosition.HasValue);
Microsoft\Windows\Controls\Ribbon\RibbonGalleryCategory.cs (1)
507Debug.Assert(RibbonGallery == null || RibbonGallery.IsSynchronizedWithCurrentItemInternal, "We shouldn't be listening for currency changes if IsSynchronizedWithCurrentItemInternal is false");
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
1163Debug.Assert(groupSizeDefinition != null && groupSizeDefinition.IsCollapsed);
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (16)
206Debug.Assert(property != null); 212Debug.Assert(d != null); 213Debug.Assert(property != null); 214Debug.Assert(v != null); 779Debug.Assert(category.RibbonGallery == gallery, "The reference RibbongalleryItem and the RibbonGallery must be related."); 942Debug.Assert(element != null, "Element must not be null"); 943Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 967Debug.Assert(element != null, "Element must not be null"); 968Debug.Assert(routedEvent != null, "RoutedEvent must not be null"); 996Debug.Assert(element != null); 1361Debug.Assert(starLayoutProvider != null); 2113Debug.Assert(clone is ButtonBase, 2146Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2184Debug.Assert(clone is ButtonBase || clone is RibbonMenuButton, 2204Debug.Assert(clone is RibbonMenuButton, 2471Debug.Assert(parentItemsControl != null);
Microsoft\Windows\Controls\Ribbon\RibbonKeyTipAndContentSyncHelper.cs (5)
31Debug.Assert(element != null); 73Debug.Assert(element != null); 93Debug.Assert(element != null); 118Debug.Assert(element != null); 137Debug.Assert(element != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (3)
1469Debug.Assert(GetType().IsSubclassOf(type)); // RibbonMenuButton is a subclass of MenuBase 1473Debug.Assert(property != null); 1478Debug.Assert(method != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuItem.cs (2)
1161Debug.Assert(timer != null, "timer should not be null."); 1162Debug.Assert(!timer.IsEnabled, "timer should not be running.");
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
450Debug.Assert(resizeStatusCount > 0);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (2)
337Debug.Assert(_textBlock1 != null && _textBlock2 != null); 371Debug.Assert(_textBlock1 != null && _textBlock2 != null);
Microsoft\Windows\Controls\TextSearchInternal.cs (2)
801Debug.Assert(_attachedTo != null); 816Debug.Assert(_attachedTo != null);
System.Windows.Extensions (11)
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeCertContextHandle.cs (2)
25Debug.Assert(!parent.IsInvalid); 26Debug.Assert(!parent.IsClosed);
src\runtime\src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (3)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null); 53Debug.Assert(!isCachedInvalidHandle || handle.IsInvalid, "The cached invalid handle must still be invalid.");
System\Media\SoundPlayer.cs (6)
139Debug.Assert(_stream == null, "we can't have a stream and a path at the same time"); 191Debug.Assert(_stream == null, "we can't have a stream and a path at the same time"); 232Debug.Assert(_streamData != null); 246Debug.Assert((_uri == null || !_uri.IsFile), "we only load streams"); 502Debug.Assert(_stream != null); 534Debug.Assert(_asyncOperation != null);
System.Windows.Forms (2476)
misc\ImageListUtils.cs (2)
34Debug.Fail("A property specified in the path is null or not yet instantiated at this time"); 41Debug.Fail("The path specified to the property is wrong");
System\Resources\ResXDataNode.cs (7)
157Debug.Assert(_name is not null || _nodeInfo?.Name is not null); 176Debug.Assert(FileRefType is not null); 308Debug.Fail($"Unexpected exception writing binary formatted data. {ex.Message}"); 343Debug.Assert(_value is string, "Resource entries with no Type or MimeType must be encoded as strings"); 365Debug.WriteLine($"Converter for {type.FullName} doesn't support string conversion"); 441Debug.Fail($"Unexpected exception getting binary formatted data."); 489Debug.Assert(FileRef is not null);
System\Resources\ResXResourceReader.cs (6)
235Debug.Assert(_resData is null && _resMetadata is null); 259Debug.Assert(contentReader is not null); 338Debug.Assert(_resData is not null); 339Debug.Assert(_resMetadata is not null); 524Debug.Assert(_resData is not null); 525Debug.Assert(_resMetadata is not null);
System\Resources\ResXResourceWriter.cs (1)
165Debug.Assert(_fileName is not null, "Nothing to output to");
System\Windows\Forms\Accessibility\AccessibleObject.cs (15)
434Debug.Assert(child is not null, $"GetChild({index}) returned null!"); 458Debug.Assert(result == HRESULT.DISP_E_MEMBERNOTFOUND, $"{nameof(GetSystemIAccessibleFocus)} failed with {result}"); 502Debug.Assert(child is not null, $"GetChild({index}) returned null!"); 526Debug.Assert(result == HRESULT.DISP_E_MEMBERNOTFOUND, $"{nameof(TryGetSystemIAccessibleSelection)} failed with {result}"); 545Debug.Assert(child is not null, $"GetChild({index}) returned null!"); 592Debug.Fail(message); 785Debug.Fail("Not implemented. DocumentRangeInternal property should be overridden."); 802Debug.Fail("Not implemented. SupportedTextSelectionInternal property should be overridden."); 1019Debug.Assert(result.IsEmpty || result.vt == VARENUM.VT_I4); 1860Debug.Assert( 2265Debug.Assert( 2842Debug.Fail($"{nameof(TryGetAccessibleObject)} got a child id of {id}"); 2850Debug.Fail($"{nameof(TryGetAccessibleObject)} got a multi selection"); 2870Debug.Fail("This should never happen"); 3296internal virtual void ScrollIntoView() => Debug.Fail($"{nameof(ScrollIntoView)}() is not overridden");
System\Windows\Forms\Accessibility\AccessibleObject.EnumVariantObject.cs (2)
19Debug.Assert(owner is not null, "Cannot create EnumVariantObject with a null owner"); 25Debug.Assert(owner is not null, "Cannot create EnumVariantObject with a null owner");
System\Windows\Forms\Accessibility\AccessibleObjectExtensions.cs (12)
42Debug.Assert( 62Debug.Assert( 96Debug.Assert( 116Debug.Assert( 136Debug.Assert( 156Debug.Assert(result.Succeeded, $"{nameof(TryGetName)}: get_accName call failed with {result}"); 178Debug.WriteLineIf(result.Failed, $"{nameof(TrySetName)}: put_accName call failed with {result}"); 195Debug.Assert(result.Succeeded, $"{nameof(TryGetRole)}: get_accRole call failed with {result}"); 214Debug.Assert( 232Debug.Assert( 253Debug.Assert( 268Debug.Assert(
System\Windows\Forms\Accessibility\LabelEditUiaTextProvider.cs (3)
256Debug.Fail("Label edit control cannot have a child element."); 316Debug.Fail("SetSelection start is out of text range."); 322Debug.Fail("SetSelection end is out of text range.");
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (15)
67Debug.WriteLine($"No proxy for {name}, returning null"); 184Debug.Fail("onlyNext && onlyPrevious are both set"); 190Debug.Fail("GC_WCH_FONLYNEXT or FONLYPREV used with CONTAINER or CONTAINED"); 200Debug.Fail("Bad GC_WCH"); 333Debug.Assert(_parent.Site is null, "Parent is sited but we could not find IContainer"); 351Debug.Assert(_components is not null); 377Debug.Assert(_components is not null); 388Debug.Assert( 459Debug.Fail("Control is calling OnInPlaceDeactivate by itself"); 466Debug.Assert(_siteUIActive is null || _siteUIActive == site, "Deactivating when not active"); 501Debug.Assert(_siteUIActive is null, "Object did not call OnUIDeactivate"); 583Debug.Assert(_parent is not null); 629Debug.Assert(_controlInEditMode is null || _controlInEditMode == ctl, "who is exiting edit mode?"); 667Debug.Assert(hr.Succeeded); 676Debug.Fail($"control {_controlInEditMode} did not reset its edit mode to null");
System\Windows\Forms\ActiveX\AxHost.AxPerPropertyBrowsingEnum.cs (4)
78Debug.Assert(_cookies is not null && _names is not null, "An item array is null"); 88Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies"); 98Debug.Fail($"Bad IPerPropertyBrowsing item [{i}], name={_names?[i] ?? "(unknown)"}"); 122Debug.Fail($"Failed to build IPerPropertyBrowsing editor. {ex.GetType().Name}, {ex.Message}");
System\Windows\Forms\ActiveX\AxHost.AxPropertyDescriptor.cs (2)
151Debug.Fail(t.ToString()); 302Debug.Fail($"IPerPropertyBrowsing::GetPredefinedStrings(dispid={dispid}) failed: {hr}");
System\Windows\Forms\ActiveX\AxHost.ConnectionPointCookie.cs (1)
53Debug.Fail(ex.Message);
System\Windows\Forms\ActiveX\AxHost.cs (46)
1028Debug.Assert(!Visible, "If we were visible we would not be need a fake window."); 1045Debug.Assert(!IsHandleCreated, "if we need a fake window, we can't have a real one"); 1260Debug.Assert(!OwnWindow(), "Why are we here if we own our window?"); 1301Debug.Fail("how did we ever get into the open state?"); 1324Debug.Assert(GetOcState() == OC_LOADED, " failed transition"); 1329Debug.Assert(GetOcState() == OC_PASSIVE, " failed transition"); 1333Debug.Fail("bad state"); 1363Debug.Assert(GetOcState() == OC_LOADED, " failed transition"); 1368Debug.Assert(GetOcState() == OC_RUNNING, " failed transition"); 1380Debug.Assert(!_axState[s_fOwnWindow], "If we are invis at runtime, we should never be going beyond OC_RUNNING"); 1429Debug.Assert(GetOcState() == OC_UIACTIVE, " failed transition"); 1433Debug.Fail("bad state"); 1457Debug.Fail(t.ToString()); 1482Debug.Assert(CanUIActivate, "we have to be able to uiactivate"); 1491Debug.Assert(_axState[s_fFakingWindow], "have to be faking it in order to destroy it..."); 1525Debug.Fail("extremely naughty ctl is refusing to give us an hWnd... giving up..."); 1574Debug.Assert(!_axState[s_fFakingWindow], "if we were visible, we could not have had a fake window..."); 1604Debug.Fail(t.ToString()); 1618Debug.Assert(!_axState[s_fOwnWindow], "can't own our window when hiding"); 1619Debug.Assert(IsHandleCreated, "gotta have a window to hide"); 1620Debug.Assert(GetOcState() >= OC_INPLACE, "have to be in place in order to hide."); 1625Debug.Assert(!IsHandleCreated, "if we are inplace deactivated we should not have a window."); 1778Debug.Fail($"error in processMnemonic: {t}"); 1822Debug.Assert(!_axState[s_disposed], "we could not be asking for the object when we are axState[disposed]..."); 1839Debug.Fail("Trying to reload with a OcxState that is of a different type."); 1895Debug.Fail("we got to have an old state which holds out scribble storage..."); 1914Debug.Fail("unknown storage type."); 2013Debug.Assert(_storageType != StorageType.Unknown, "if we are loaded, out storage type must be set!"); 2052Debug.Fail("unknown storage type"); 2177Debug.Assert(_freezeCount >= 0, "invalid freeze count!"); 2300Debug.Assert(_instance is null, "instance must be null"); 2304Debug.Assert(_instance is not null, "w/o an exception being thrown we must have an object..."); 2386Debug.Assert(selectionStyle is >= 0 and <= 2, "Invalid selection style"); 2402Debug.Assert((_flags & AxFlags.PreventEditMode) == 0, "edit mode should have been disabled"); 2589Debug.Assert(baseProps[i] is not null, $"Null base prop at location: {i}"); 2625Debug.Assert(propDesc is not null, $"Cannot find cached entry for: {propName}"); 2629Debug.Fail($"Duplicate property with same name: {propName}"); 2707Debug.Assert(dispid != PInvokeCore.DISPID_UNKNOWN, "Wrong dispid sent to GetPropertyDescriptorFromDispid"); 2774Debug.Fail("no implemented persistence interfaces on object"); 2841Debug.Fail("unknown storage type."); 2879Debug.Fail(t.ToString()); 2896Debug.Fail(t.ToString()); 2959Debug.Fail($"Failed to get instance in {nameof(ShowPropertyPageForDispid)}."); 3231Debug.Assert(IsHandleCreated, "we got to have a handle to be here..."); 3375Debug.Fail(t.ToString()); 3393Debug.Fail(ex.Message);
System\Windows\Forms\ActiveX\AxHost.OleInterfaces.cs (3)
226Debug.Assert(!_host.GetAxState(s_siteProcessedInputKey), "Re-entering IOleControlSite.TranslateAccelerator!!!"); 283Debug.Fail("we can't be in showobject if we own our window..."); 528Debug.Fail(ex.ToString());
System\Windows\Forms\ActiveX\AxHost.PropertyBagStream.cs (3)
39Debug.WriteLine($"PropertyBagStream: {nameof(NrbfDecoder)} failed with {ex.Message}"); 53Debug.Fail($"PropertyBagStream: {nameof(BinaryFormatter)} failed with {inner.Message}"); 114Debug.WriteLine($"PropertyBagStream.Save: {nameof(NrbfDecoder)} failed with {ex.Message}");
System\Windows\Forms\ActiveX\AxHost.State.cs (7)
106Debug.Fail($"failure: {e}"); 122Debug.Fail($"failure: {e}"); 136Debug.Assert(_storage is null, "but we already have a storage!"); 205Debug.Assert(_buffer is not null); 257Debug.Assert(_storage is not null, "how can we not have a storage object?"); 258Debug.Assert(_lockBytes is not null, "how can we have a storage w/o ILockBytes?"); 337Debug.Assert(_length == 0, "if we have no data, then our length has to be 0");
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (2)
79Debug.Assert(ActiveXInstance.EventsFrozen == bFreeze, "Failed to set EventsFrozen correctly"); 538Debug.Assert(hr.Succeeded);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (14)
602Debug.WriteLine($"Failed to get property for dispid {dispid}: {hr}"); 867Debug.Assert(_activeXState[s_inPlaceVisible], "Failed to set inplacevisible"); 894Debug.Assert(_inPlaceFrame is not null, "Setting us to visible should have created the in place frame"); 1105Debug.Fail("Unexpected failure reading property", ex.ToString()); 1120Debug.Fail($"Couldn't convert {currentProperty.Name} to string."); 1166Debug.Assert( 1204Debug.Fail($"No ambient property for dispid {dispid}"); 1250Debug.Fail($"There is no property change notification for: {propName} on Control."); 1428Debug.WriteLineIf(hr.Failed, $"Failed to advise with {eventInterface.Name}."); 1468Debug.Assert(hr.Succeeded, "Stream should be non-null."); 1525Debug.Fail($"Failed to write with BinaryFormatWriter: {ex.Message}"); 1550Debug.Assert( 1706Debug.Assert(_clientSite is not null, "How can we setextent before we are sited??"); 1947Debug.Assert(_inPlaceFrame is not null, "No inplace frame -- how did we go UI active?");
System\Windows\Forms\ActiveX\Control.ActiveXImpl.PropertyBagStream.cs (3)
39Debug.Fail(e.Message); 63Debug.Assert(_bag[name] is string); 75Debug.Assert(pVar->vt == VARENUM.VT_BSTR);
System\Windows\Forms\ActiveX\Control.ActiveXVerbEnum.cs (1)
36Debug.Fail("Caller of IEnumOLEVERB requested celt > 1, but clr marshalling does not support this.");
System\Windows\Forms\Application.ComponentThreadContext.cs (3)
142Debug.Assert(_componentID != s_invalidId, "Our ID sentinel was returned as a valid ID"); 149Debug.Assert(result, 182Debug.Fail($"Unexpected exception thrown during Dispose: {ex.Message}");
System\Windows\Forms\Application.cs (7)
413Debug.Assert(success); 1134Debug.Assert(UseVisualStyles, "Enable Visual Styles failed"); 1324Debug.Assert( 1386Debug.Assert(PInvoke.IsWindow(handle), "Handle being parked is not a valid window handle"); 1387Debug.Assert( 1458Debug.Assert(process is not null); 1464Debug.Assert(arguments is not null && arguments.Length > 0);
System\Windows\Forms\Application.LightThreadContext.cs (1)
32Debug.Assert(uReason != msoloop.FocusWait);
System\Windows\Forms\Application.ParkingWindow.cs (3)
47Debug.Fail("How did parkingwindow childcount go negative???"); 58Debug.Fail("How did parkingwindow childcount go negative???"); 127Debug.Assert(
System\Windows\Forms\Application.ThreadContext.cs (8)
111Debug.WriteLine("Creating parking form!"); 112Debug.WriteLine(CoreSwitches.PerfTrack.Enabled, Environment.StackTrace); 143Debug.Assert(_parkingWindows.Count == 1, "parkingWindows count can not be > 1 for legacy OS/target framework versions"); 186Debug.WriteLine("Creating marshalling control!"); 187Debug.WriteLine(CoreSwitches.PerfTrack.Enabled, Environment.StackTrace); 277Debug.Assert(!disposing, "Shouldn't be getting dispose from another thread."); 415Debug.Assert(_debugModalCounter >= 0, "Mis-matched calls to Application.BeginModalMessageLoop() and Application.EndModalMessageLoop()"); 503Debug.Assert(context._id == id);
System\Windows\Forms\ApplicationContext.cs (1)
132Debug.Assert(sender is Form);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormatWriter.cs (1)
23Debug.Assert(success);
System\Windows\Forms\ComponentModel\COM2Interop\Com2AboutBoxPropertyDescriptor.AboutBoxUITypeEditor.cs (1)
34Debug.Assert(hr.Succeeded, $"Failed to launch about box. {hr}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2ColorConverter.cs (1)
37Debug.Fail($"Don't know how to set type: {managedValue.GetType().Name}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2FontConverter.cs (4)
27Debug.Assert(nativeValue.IsEmpty, $"Expected IUnknown, got {nativeValue.Type}"); 34Debug.Fail($"Failed to get IFont: {hr}"); 82Debug.Assert(nativeValue.IsEmpty, $"Expected IUnknown, got {nativeValue.Type}"); 100Debug.Fail($"Failed to get IFont: {hr}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (11)
64Debug.Assert(typeNames.Length == values.Length, "Mismatched parameter and attribute name length"); 107Debug.Fail("No dot in class name?"); 118Debug.Fail($"Failed load attribute '{typeName}{assemblyName}'. It's Type could not be found."); 122Debug.Assert(typeof(Attribute).IsAssignableFrom(type), $"Attribute type {type.FullName} does not derive from Attribute"); 138Debug.Fail($"Couldn't load field '{fieldName}' from type '{typeName[..lastDot]}'. It does not exist or is not static"); 142Debug.Assert(typeof(Attribute).IsAssignableFrom(type), $"Attribute type {type.FullName} does not derive from Attribute"); 170Debug.Fail($"Attribute {type.FullName} did not have a initializer specified and has no default constructor"); 188Debug.Fail($"Attribute {type.FullName} did not have a initializer specified and has no default constructor"); 216Debug.Fail("Failed to free BSTR array memory", ex.ToString()); 234Debug.Fail($"Failed to marshal component attribute VARIANT {i}", ex.ToString()); 244Debug.Fail("Failed to free VARIANT array memory", ex.ToString());
System\Windows\Forms\ComponentModel\COM2Interop\Com2IPerPropertyBrowsingHandler.Com2IPerPropertyBrowsingEnum.cs (4)
74Debug.Assert(_cookies is not null && _names is not null, "An item array is null"); 84Debug.Assert(_cookies.Length == _names.Length, "Got uneven names and cookies"); 101Debug.Fail($"Bad IPerPropertyBrowsing item [{i}], name={_names?[i] ?? "(unknown)"}"); 152Debug.Fail($"Failed to build IPerPropertyBrowsing editor. {ex.GetType().Name}, {ex.Message}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2IPerPropertyBrowsingHandler.cs (1)
112Debug.Fail($"IPerPropertyBrowsing::GetPredefinedStrings(dispid={sender.DISPID}) failed.");
System\Windows\Forms\ComponentModel\COM2Interop\COM2IProvidePropertyBuilderHandler.cs (1)
30Debug.Fail("Property Browser doesn't support standard builders -- NYI");
System\Windows\Forms\ComponentModel\COM2Interop\COM2IVsPerPropertyBrowsingHandler.cs (8)
59Debug.Assert(sender.TargetObject is null); 76Debug.Assert(sender.TargetObject is null); 113Debug.Assert(sender.TargetObject is null); 130Debug.Assert(sender.TargetObject is null); 148Debug.Assert(sender.TargetObject is null); 166Debug.Assert(sender.TargetObject is null); 187Debug.Assert(sender.TargetObject is null); 205Debug.Assert(sender.TargetObject is null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PictureConverter.cs (4)
37Debug.Assert(nativeValue.IsEmpty, $"Expected IUnknown, got {nativeValue.Type}"); 45Debug.Fail($"Failed to get IPicture: {hr}"); 74Debug.Fail("Unknown picture type"); 116Debug.Fail($"Unknown Image type: {managedValue.GetType().Name}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2Properties.cs (2)
94Debug.Assert(_defaultPropertyIndex < _properties.Length, "Whoops! default index is > props.Length"); 170Debug.WriteLine($"Adding browsing handler type {handler.GetType().Name} to object.");
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyBuilderUITypeEditor.cs (2)
50Debug.Assert(hr.Succeeded, $"Failed to get IProvidePropertyBuilder: {hr}"); 69Debug.Fail($"Failed to show property frame: {hr}");
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (5)
152Debug.Assert(_baseAttributes is not null); 504Debug.Fail($"Failed to create TypeConverter of type '{attribute.ConverterTypeName}' from Attribute", ex.ToString()); 544Debug.Fail($"Failed to create editor of type '{attribute.EditorTypeName}' from Attribute", ex.ToString()); 624Debug.Fail($"Failed to get property: {hr}"); 652Debug.Fail($"Could not convert the native value to a .NET object: {ex.Message}");
System\Windows\Forms\ComponentModel\COM2Interop\Com2PropertyDescriptor.ValidityScope.cs (1)
23Debug.Assert(properties is not null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (1)
48Debug.Assert(instance is not null);
System\Windows\Forms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (8)
333Debug.Assert(typeDesc.Anonymous.hreftype != 0u, "typeDesc doesn't contain an hreftype!"); 339Debug.Assert(typeDesc.Anonymous.lptdesc is not null, "typeDesc doesn't contain an refTypeDesc!"); 416Debug.Fail($"ProcessFunctions failed with hr={ex.ErrorCode}, message={ex}"); 426Debug.Fail($"ProcessVariables failed with hr={ex.ErrorCode}, message={ex}"); 500Debug.Fail($"ITypeInfo::GetDocumentation didn't return a name for DISPID 0x{dispid:X} but returned SUCCEEDED(hr)"); 648Debug.Assert(functionDescription->lprgelemdescParam is not null, "ELEMDESC param is null!"); 766Debug.Assert(!name.IsEmpty, "No name for VARDESC member, but GetDocumentation returned S_OK!"); 812Debug.Fail($"Failed to process type info enum. {ex.Message}");
System\Windows\Forms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (2)
158Debug.Fail(ex.Message); 316Debug.Fail("Failed to find Com2 properties key on dispose.");
System\Windows\Forms\Control.ControlCollection.cs (1)
349Debug.Assert(control is not null, "Why are we returning null controls from a valid index?");
System\Windows\Forms\Control.cs (33)
542Debug.Assert(accessibleObject is not null, "Failed to create accessibility object"); 561Debug.Assert(ncAccessibleObject is not null, "Failed to create NON-CLIENT accessibility object"); 813Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle"); 1833Debug.Assert(s_defaultFont is not null, "defaultFont wasn't set!"); 2130Debug.Assert( 2718Debug.Assert(Margin == value, "Error detected while setting Margin."); 2742Debug.Assert(MaximumSize == DefaultMaximumSize, "Error detected while resetting MaximumSize."); 2748Debug.Assert(MaximumSize == value, "Error detected while setting MaximumSize."); 2767Debug.Assert(MinimumSize == value, "Error detected while setting MinimumSize."); 4815Debug.Assert((cp.ExStyle & (int)WINDOW_EX_STYLE.WS_EX_MDICHILD) == 0, "Can't put MDI child forms on the parking form"); 5264Debug.Assert(this == entry._caller, "Called BeginInvoke on one control, and the corresponding EndInvoke on a different control"); 5280Debug.Assert(asyncResult.IsCompleted, "Why isn't this asyncResult done yet?"); 5359Debug.Assert(c.IsHandleCreated, "FindMarshalingControl chose a bad control."); 6011Debug.Assert(window is not null, "window is null in Control.GetSafeHandle"); 6128Debug.Assert(region.GetPointer() != null); 6395Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback"); 6400Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback"); 7119Debug.Fail($"Unexpected {nameof(VisualStylesModeChangeImpact)}: {impact}"); 9096Debug.Fail($"Unknown PaintLayer {layer}"); 9170Debug.Assert(args is not null, "This method should never be called with null args."); 9518Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hDC) == OBJ_TYPE.OBJ_ENHMETADC, 9520Debug.Assert((lParam & (long)PInvoke.PRF_CHILDREN) != 0, 9530Debug.Assert(success, "GetViewportOrgEx() failed."); 9538Debug.Assert(!hClippingRegion.IsNull, "CreateRectRgn() failed."); 9542Debug.Assert( 9560Debug.Assert(success, "GetWindowRect() failed."); 9962Debug.WriteLineIf( 10991Debug.Assert(value != -1, "Outdated call to SetParentHandle"); 10999Debug.Assert(Handle != value, "Cycle created in SetParentHandle"); 11515Debug.Assert(LayoutSuspendCount > 0, "SuspendLayout: layoutSuspendCount overflowed."); 11531Debug.Assert(scaledFont is not null); 12636Debug.WriteLine("Could not create buffered graphics, will paint in the surface directly"); 13478Debug.Assert(sizeProperty is not null && locationProperty is not null, "Error retrieving Size/Location properties on Control.");
System\Windows\Forms\Control.FontHandleWrapper.cs (1)
23Debug.Assert(!_handle.IsNull, "FontHandleWrapper disposed, but still being accessed");
System\Windows\Forms\Control.Ime.cs (8)
111Debug.Assert(val >= 0, "Counter underflow."); 451Debug.Assert(ImeSupported, "WARNING: Attempting to update ImeMode properties on IME-Unaware control!"); 452Debug.Assert(!DesignMode, "Shouldn't be updating cached ime mode at design-time"); 483Debug.Assert(ImeSupported, "ImeModeChanged should not be raised on an Ime-Unaware control."); 781Debug.Assert(countryTable is not null, "countryTable is null"); 839Debug.Assert(imeMode != ImeMode.Inherit, "ImeMode.Inherit is an invalid argument to ImeContext.SetImeStatus"); 937Debug.Assert(succeeded, "Could not set the IME open status."); 942Debug.Assert(succeeded, "Could not release IME context.");
System\Windows\Forms\Control.MetafileDCWrapper.cs (4)
30Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hOriginalDC) == OBJ_TYPE.OBJ_ENHMETADC, 65Debug.Assert(success, "DICopy() failed."); 68Debug.Assert(success, "DeleteObject() failed."); 70Debug.Assert(success, "DeleteObject() failed.");
System\Windows\Forms\Control.SuspendLayoutScope.cs (1)
32Debug.Assert(_control is null || _layoutSuspendCount == _control.LayoutSuspendCount, "Suspend/Resume layout mismatch!");
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (8)
397Debug.Assert(_image is null, "We expect to be returning null."); 952Debug.Assert(GetStyle(ControlStyles.UserPaint), "Shouldn't be in PaintControl when control is not UserPaint style"); 1003Debug.Fail($"Unsupported FlatStyle: \"{FlatStyle}\""); 1016Debug.Fail("Derived classes need to provide a meaningful implementation."); 1022Debug.Fail("Derived classes need to provide a meaningful implementation."); 1028Debug.Fail("Derived classes need to provide a meaningful implementation."); 1059Debug.Fail("Adapter not expected to be null at this point"); 1070Debug.Fail("Adapter not expected to be null at this point");
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutData.cs (1)
27Debug.Assert(options is not null, "must have options");
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (2)
146Debug.Fail(string.Format(SR.InvalidArgument, nameof(composition), composition.ToString())); 177Debug.Fail(string.Format(SR.InvalidArgument, nameof(composition), composition.ToString()));
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonPopupAdapter.cs (3)
142Debug.Assert( 170Debug.Assert( 186Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
210Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckableControlBaseAdapter.cs (1)
55Debug.Fail($"Unexpected control type '{Control.GetType().FullName}'");
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
190Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
123Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ModernButtonColorMath.cs (1)
49Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (1)
99Debug.Assert(!hdc.IsNull, "Calling DrawAndFillEllipse with null wg");
System\Windows\Forms\Controls\ComboBox\ComboBox.ACNativeWindow.cs (2)
20Debug.Assert(!s_acWindows.ContainsKey(acHandle)); 73Debug.Assert(s_acWindows.ContainsKey(HWND));
System\Windows\Forms\Controls\ComboBox\ComboBox.ChildAccessibleObject.cs (1)
16Debug.Assert(owner.IsHandleCreated, "ComboBox's handle hasn't been created");
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxAccessibleObject.cs (1)
134Debug.Assert(index < entries.Count);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (4)
35Debug.Assert(_owningComboBox.IsHandleCreated); 323Debug.Fail("Text edit control cannot have a child element."); 389Debug.Fail("SetSelection start is out of text range."); 395Debug.Fail("SetSelection end is out of text range.");
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (13)
649Debug.Assert(IsHandleCreated, "Handle should be created at this point"); 2102Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2120Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2241Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2251Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2281Debug.Assert(actualLength != PInvoke.LB_ERR, "Should have validated the index above"); 2292Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2299Debug.Assert(insertIndex == index, $"NativeComboBox inserted at {insertIndex} not the requested index of {index}"); 2308Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 2360Debug.Assert(_childEdit is null, "Child edit window already attached"); 2361Debug.Assert(_childListBox is null, "Child listbox window already attached"); 2948Debug.Assert(DisplayMember.Equals(string.Empty), "if this list is sorted it means that dataSource was null when Sorted first became true. at that point DisplayMember had to be String.Empty"); 3276Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList);
System\Windows\Forms\Controls\ComboBox\ComboBox.ObjectCollection.cs (1)
134Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert");
System\Windows\Forms\Controls\DataGridView\DataGridView.AccessibleObject.cs (1)
66Debug.Assert(GetChildCount() == 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (48)
1134Debug.Assert(dataGridViewCell is not null); 1227Debug.Fail("Unexpected this.advancedCellBorderStyle.All value in CellBorderStyle.get"); 1712Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.Y >= 0); 1713Debug.Assert(_ptCurrentCell.X < Columns.Count); 1714Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1781Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count); 1782Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1784Debug.Assert(dataGridViewRow is not null); 1786Debug.Assert(IsSharedCellVisible(dataGridViewCell, _ptCurrentCell.Y)); 1800Debug.Assert(_ptCurrentCell.Y != -1); 1818Debug.Assert(_ptCurrentCell.Y != -1); 1836Debug.Assert(_ptCurrentCell.Y != -1); 1854Debug.Assert(_ptCurrentCell.Y >= 0); 1855Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2308Debug.Assert(firstDisplayedCell.RowIndex >= 0 2344Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows == 0); 2352Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == -1); 2353Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows == 0); 2354Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows == 0); 2406Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol == -1); 2409Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg1 || !Visible || DisplayedBandsInfo.Dirty); 2410Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg2 || DisplayedBandsInfo.Dirty); 2478Debug.Assert(totalVisibleFrozenWidth > 0); 2508Debug.Assert(success); 2510Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 2511Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol == value 2558Debug.Assert(totalVisibleFrozenHeight > 0); 2583Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 2588Debug.Assert(rowsToScroll != 0); 2598Debug.Assert(success); 2763Debug.Assert(Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, oldFirstVisibleScrollingCol)); 2808Debug.Assert(_horizontalOffset == 0); 2924Debug.Assert(dataGridViewCell is not null); 2925Debug.Assert(rowIndex >= 0); 2935Debug.Assert(dataGridViewCell is not null); 2936Debug.Assert(rowIndex >= 0); 2945Debug.Assert(dataGridViewCell is not null); 2946Debug.Assert(rowIndex >= 0); 3027Debug.Assert(value >= 0); 3115Debug.Assert(_individualReadOnlyCells.Count == 0); 3118Debug.Assert(!Columns[columnIndex].ReadOnly); 3124Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.ReadOnly) == 0); 3406Debug.Assert(_rowHeaderWidth != value); 3407Debug.Assert(value >= MinimumRowHeadersWidth); 3606Debug.Assert(HorizontalOffset == 0); 3607Debug.Assert(VerticalOffset == 0); 3894Debug.Assert(_ptCurrentCell.Y >= 0); 3902Debug.Assert(_ptCurrentCell.Y >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (41)
148Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_cancellingRowEdit]); 163Debug.Assert(CurrencyManager.AllowAdd, "why did we call AddNew on the currency manager when the currency manager does not allow new rows?"); 274Debug.Assert(_props is not null); 311Debug.Assert(sortProperty is null); 327Debug.Assert(_props is not null); 341Debug.Assert(DataBoundRowsCount() == CurrencyManager!.List!.Count || (_owner.Columns.Count == 0 && dataGridViewRowsCount == 0), 348Debug.Assert(sender == CurrencyManager, "did we forget to unregister our ListChanged event handler?"); 388Debug.Assert(!_dataConnectionState[DATACONNECTIONSTATE_inAddNew] || !_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew], 414Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start the add new transaction when the AllowUserToAddRowsInternal is false?"); 474Debug.Assert(CurrencyManager?.List is not null); 488Debug.Assert(DataBoundRowsCount() != -1, "the data bound data grid view rows count should be at least 0"); 492Debug.Assert(CurrencyManager?.List is not null); 508Debug.Assert(CurrencyManager.List.Count == 1); 513Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew]); 529Debug.Assert(CurrencyManager!.List!.Count == 0, "we deleted the row that the Child table forcefully added"); 551Debug.Assert(CurrencyManager?.List is not null); 603Debug.Fail("fail in debug builds so we can catch this situation in the check in suites"); 616Debug.Assert(e.OldIndex > -1, "the currency manager should have taken care of this case"); 617Debug.Assert(e.NewIndex > -1, "how can we move an item outside of the list?"); 623Debug.Assert(e.NewIndex != -1, "the item changed event does not cover changes to the entire list"); 678Debug.Assert(sender == CurrencyManager, "did we forget to unregister our events?"); 681Debug.Assert(_owner.CurrentCellAddress.X == -1); 736Debug.Assert(CurrencyManager?.List is not null); 766Debug.Assert(_owner.NewRowIndex != -1, "the NewRowIndex is -1 only when AllowUserToAddRows is false"); 783Debug.Assert(sender == DataSource); 784Debug.Assert(DataSource is ISupportInitializeNotification); 785Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_dataSourceInitializedHookedUp]); 798Debug.Assert(CurrencyManager is not null); 805Debug.Assert(CurrencyManager is not null); 826Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start an add new row transaction if the dataGridView control has AllowUserToAddRows == false?"); 828Debug.Assert(CurrencyManager?.List is not null); 837Debug.Assert(_owner.NewRowIndex == CurrencyManager.List.Count - 1); 890Debug.Fail("we only care about which data fields are read only when we are data bound"); 1141Debug.Assert(rowIndex >= 0); 1174Debug.Assert(rowIndex >= 0); 1207Debug.Assert(!_props[i].IsBrowsable || typeof(IList).IsAssignableFrom(_props[i].PropertyType), "if the DGV does not have any columns then the properties in the currency manager should be Browsable(false) or point to sub lists"); 1222Debug.Assert(dataGridViewColumn is not null); 1229Debug.Assert(rowIndex >= -1); 1394Debug.Assert(DataBoundRowsCount() == CurrencyManager.List!.Count, "if the back end was changed while in AddNew the DGV should have updated its rows collection"); 1541Debug.Assert(dataGridViewColumn.IsDataBound && dataGridViewColumn.BoundColumnIndex != -1, "we need a bound column index to perform the sort"); 1542Debug.Assert(List is IBindingList, "you should have checked by now that we are bound to an IBindingList");
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (784)
71Debug.Assert(NewRowIndex == -1); 299Debug.Assert(rowIndex > -1); 300Debug.Assert(rowIndex < Rows.Count); 333Debug.Assert(_noAutoSizeCount > 0); 342Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None); 343Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0); 369Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count); 370Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 371Debug.Assert(_autoSizeRowsMode is DataGridViewAutoSizeRowsMode.DisplayedHeaders 388Debug.Assert(columnIndex == -1); 389Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0); 393Debug.Assert(RowHeadersWidth > 0); 394Debug.Assert(RowHeadersVisible); 409Debug.Assert(preferredThickness >= minimumHeight); 417Debug.Assert(_autoSizeRowsMode != DataGridViewAutoSizeRowsMode.None); 466Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0); 470Debug.Assert(RowHeadersWidth > 0); 471Debug.Assert(RowHeadersVisible); 493Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0); 534Debug.Assert(dataGridViewColumn.Visible); 535Debug.Assert(!dataGridViewColumn.Frozen); 536Debug.Assert(dataGridViewColumn.MinimumWidth <= width); 537Debug.Assert(dataGridViewColumn.InheritedAutoSizeMode == DataGridViewAutoSizeColumnMode.Fill); 538Debug.Assert(!_layout._dirty); 544Debug.Assert(dataGridViewColumn.MinimumWidth == dataGridViewColumn.Width); 569Debug.Assert(!dataGridViewColumnTmp.Frozen); 695Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 714Debug.Assert(!dataGridViewColumnTmp.Frozen); 758Debug.Assert(newWeightSum > 0); 862Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 907Debug.Assert(!dataGridViewColumn.Frozen); 925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0)); 991Debug.Assert(weightSum > 0); 1166Debug.Assert(oldDesiredWidth >= mostDeservingDataGridViewColumn.DesiredFillWidth); 1178Debug.Assert(widthLoss >= 0); 1197Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F); 1256Debug.Assert(Math.Abs(dataGridViewColumnTmp.UsedFillWeight * _availableWidthForFillColumns - weightSum * dataGridViewColumnTmp.Width) / weightSum / dataGridViewColumnTmp.Width <= 1.25F / dataGridViewColumnTmp.Width); 1278Debug.Assert(widthSum == _availableWidthForFillColumns); 1319Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0); 1479Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 1504Debug.Fail("DataGridView.AreAllCellsSelected - Shouldn't reach this code"); 1617Debug.Assert(clonedColumn.IsDataBound); 1634Debug.Assert(finalClonedColumns.Length == 0); 1635Debug.Assert(clonedColumnsCount == 0); 1648Debug.Assert(dataGridViewColumn.IsDataBound); 1656Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None); 1657Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0); 1792Debug.Assert(_noAutoSizeCount > 0); 1857Debug.Assert(_noAutoSizeCount > 0); 1864Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header 1869Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 1915Debug.Assert(_noAutoSizeCount > 0); 2090Debug.Fail("Unexpected rowHeadersWidthSizeMode value in AutoResizeRowHeadersWidth"); 2107Debug.Assert(_noAutoSizeCount > 0); 2252Debug.Fail("Unexpected rowHeadersWidthSizeMode value in AutoResizeRowHeadersWidth"); 2269Debug.Assert(_noAutoSizeCount > 0); 2276Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 2277Debug.Assert(((DataGridViewAutoSizeRowCriteriaInternal)autoSizeRowMode & InvalidDataGridViewAutoSizeRowCriteriaInternalMask) == 0); 2331Debug.Assert(_noAutoSizeCount > 0); 2443Debug.Assert(_lastRowSplitBar == -1); 2578Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count); 2579Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 2580Debug.Assert(!IsCurrentCellInEditMode); 2608Debug.Assert(!IsCurrentCellInEditMode); 2661Debug.Assert(((IDataGridViewEditingControl)EditingControl).EditingControlDataGridView == this); 2665Debug.Assert(EditingControl is null); 2667Debug.Assert(EditingControl is not null); 2674Debug.Assert(EditingControl is not null); 2688Debug.Assert(EditingControl is not null); 2689Debug.Assert(_editingPanel is not null); 2692Debug.Assert(dgvese.CellStyle is not null); 2759Debug.Assert(_lastColSplitBar == -1); 2782Debug.Assert(_lastRowSplitBar == -1); 2789Debug.Assert(inheritedCellStyle is not null); 2795Debug.Assert(cellStyle is not null); 2799Debug.Assert(columnHeadersStyle is not null); 2802Debug.Assert(dataGridViewStyle is not null); 2920Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2934Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 3040Debug.Assert(_ptCurrentCell.Y != -1); 3073Debug.Assert(success); 3089Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3091Debug.Assert(dataGridViewEditingCell is not null); 3124Debug.Assert(dataGridViewEditingCell is not null); 3132Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3149Debug.Assert(success); 3177Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3209Debug.Assert(Rows.GetFirstRow(DataGridViewElementStates.Visible) == 0); 3250Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3315Debug.Assert(dataGridViewCurrentCell.OwningColumn is not null); 3442Debug.Assert(_noDimensionChangeCount >= 0); 3580Debug.Assert(_noDimensionChangeCount >= 0); 3591Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count, $"Invalid columnIndex: {columnIndex}"); 3607Debug.Assert(firstVisibleFrozenColumn is not null); 3613Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index)); 3646Debug.Assert(hti._col != -1); 3697Debug.Assert(hti._col != -1); 3757Debug.Assert(_ptCurrentCell.X > -1); 3861Debug.Assert(((EditingControl is not null && ((IDataGridViewEditingControl)EditingControl).EditingControlValueChanged) 3872Debug.Assert(_ptCurrentCell.X > -1); 3905Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3943Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 4019Debug.Assert(_ptCurrentCell.X > -1); 4142Debug.Assert(columnIndex < Columns.Count); 4165Debug.Assert(success); 4183Debug.Assert(dataGridViewRow is not null); 4243Debug.Assert(cx <= _horizontalOffset); 4332Debug.Assert(rowIndex < DisplayedBandsInfo.FirstDisplayedScrollingRow); 4388Debug.Assert(insideLeft.Height >= 0); 4410Debug.Assert(insideLeft.Width >= 0); 4429Debug.Assert(colHeaders.Width >= 0); 4471Debug.Assert(newLayout.Data.X >= 0); 4472Debug.Assert(newLayout.Data.Y >= 0); 4473Debug.Assert(newLayout.Data.Width >= 0); 4474Debug.Assert(newLayout.Data.Height >= 0); 4482Debug.Assert(!_layout._dirty); 4516Debug.Assert(oldNumTotallyVisibleFrozenRows == DisplayedBandsInfo.NumTotallyDisplayedFrozenRows); 4517Debug.Assert(oldNumVisibleScrollingRows == DisplayedBandsInfo.NumDisplayedScrollingRows); 4518Debug.Assert(oldNumTotallyVisibleScrollingRows == DisplayedBandsInfo.NumTotallyDisplayedScrollingRows); 4519Debug.Assert(oldFirstVisibleScrollingRow == DisplayedBandsInfo.FirstDisplayedScrollingRow); 4525Debug.Assert(newFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4530Debug.Assert(oldLastTotallyVisibleScrollingCol == DisplayedBandsInfo.LastTotallyDisplayedScrollingCol); 4531Debug.Assert(oldFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4542Debug.Assert(_vertScrollBar.Maximum > 0); 4557Debug.Assert(VerticalScrollingOffset == _vertScrollBar.Value); 4609Debug.Assert(cx <= Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 4652Debug.Assert(firstDisplayedScrollingCol >= 0); 4674Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4694Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4700Debug.Assert(dataGridViewColumn.Thickness > displayWidth - cx); 4707Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == GetNegOffsetFromHorizontalOffset(_horizontalOffset)); 4711Debug.Assert(numVisibleScrollingCols <= visibleScrollingColumnsTmp, "the number of displayed columns can only grow"); 4727Debug.Assert(jumpFromFirstVisibleScrollingCol >= -1); 4735Debug.Assert(firstDisplayedScrollingCol >= 0); 4758Debug.Assert((DisplayedBandsInfo.NumDisplayedScrollingCols > 0 && DisplayedBandsInfo.FirstDisplayedScrollingCol != -1) 4788Debug.Assert(cy < displayHeight); 4882Debug.Assert(lastDisplayedScrollingRow == -1); 4891Debug.Assert(firstDisplayedFrozenRow < nRows, "firstDisplayedFrozenRow larger than number of rows"); 4892Debug.Assert(lastDisplayedFrozenRow < nRows, "lastDisplayedFrozenRow larger than number of rows"); 4893Debug.Assert(lastDisplayedScrollingRow < nRows, "lastDisplayedScrollingRow larger than number of rows"); 4901Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows >= 0, "the number of visible frozen rows can't be negative"); 4902Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows >= 0, "the number of visible scrolling rows can't be negative"); 4903Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows >= 0, "the number of totally visible scrolling rows can't be negative"); 4904Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow < nRows, "firstDisplayedScrollingRow larger than number of rows"); 4934Debug.Assert(dataGridViewColumn.DataGridView is null); 4935Debug.Assert(dataGridViewColumn.Index >= 0); 4936Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4953Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 4968Debug.Assert(dataGridViewColumn.DataGridView == this); 4970Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4987Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 5002Debug.Assert(anticipatedColumnIndex >= 0 && anticipatedColumnIndex <= Columns.Count); 5011Debug.Assert(dataGridViewColumn.DisplayIndex >= 0 && dataGridViewColumn.DisplayIndex <= Columns.Count); 5131Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 5132Debug.Assert(!_dataGridViewOper[OperationInDisplayIndexAdjustments]); 5194Debug.Assert(Columns[columnIndex].Index == columnIndex); 5201Debug.Assert(insertionCount > 0); 5212Debug.Assert(CurrentCellInternal is not null); 5219Debug.Assert(dataGridViewRow is not null); 5220Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5286Debug.Assert(dataGridViewRow is not null); 5347Debug.Assert(rowIndexDeleted >= 0); 5355Debug.Assert(dataGridViewRow.Index == rowIndex); 5372Debug.Assert(rowIndexInserted >= 0); 5373Debug.Assert(insertionCount > 0); 5381Debug.Assert(dataGridViewRow.Index == rowIndex); 5449Debug.Assert(Rows.Count > 1); 5450Debug.Assert(NewRowIndex != -1); 5460Debug.Assert(NewRowIndex == Rows.Count - 1); 5463Debug.Assert(dataGridViewRow.Index == -1); 5468Debug.Assert(NewRowIndex == -1); 5473Debug.Assert((Rows.GetRowState(NewRowIndex) & DataGridViewElementStates.Visible) != 0); 5474Debug.Assert(_ptCurrentCell.Y == NewRowIndex); 5544Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 5610Debug.Assert(NoSelectionChangeCount == 0); 5733Debug.Assert(_editingPanel is not null); 5734Debug.Assert(_ptCurrentCell.X != -1); 5946Debug.Assert(sender == EditingControl || sender == _editingPanel); 5947Debug.Assert(_ptCurrentCell.X != -1); 5956Debug.Assert(sender == EditingControl || sender == _editingPanel); 5957Debug.Assert(_ptCurrentCell.X != -1); 5966Debug.Assert(sender == EditingControl || sender == _editingPanel); 5972Debug.Assert(sender == EditingControl || sender == _editingPanel); 5978Debug.Assert(sender == EditingControl || sender == _editingPanel); 5984Debug.Assert(sender == EditingControl || sender == _editingPanel); 5987Debug.Assert(EditingControl is not null); 5988Debug.Assert(!_dataGridViewState1[State1_CustomCursorSet]); 6004Debug.Assert(sender == EditingControl || sender == _editingPanel); 6007Debug.Assert(EditingControl is not null); 6026Debug.Assert(sender == EditingControl || sender == _editingPanel); 6032Debug.Assert(sender == EditingControl || sender == _editingPanel); 6122Debug.Assert(proposed >= Columns[_trackColumn].MinimumThickness); 6123Debug.Assert(proposed <= DataGridViewBand.MaxBandThickness); 6234Debug.Assert(_editingPanel is null || _editingPanel.Controls.Count == 0); 6248Debug.Assert(success); 6261Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 6338Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 6390Debug.Assert(rowIndex >= 0); 6391Debug.Assert(rowIndex < Rows.Count); 6392Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 6393Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Frozen) == 0); 6429Debug.Assert(numDisplayedScrollingRows > 0); 6432Debug.Assert(rowIndexTmp != -1); 6445Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 6473Debug.Assert(rowIndexTmp != -1); 6497Debug.Assert(firstDisplayedFrozenRowIndex != -1); 6612Debug.Fail("Unexpected Displayed state for row"); 6633Debug.Assert(numDisplayedScrollingCols > 0); 6637Debug.Assert(dataGridViewColumnTmp is not null); 6650Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol != -1); 6678Debug.Assert(dataGridViewColumnTmp is not null); 6762Debug.Fail("Unexpected Displayed state for column"); 6979Debug.Assert(rowIndex >= 0); 6980Debug.Assert(dataGridViewCell.OwningColumn is not null); 7102Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count); 7103Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 7107Debug.Assert(dataGridViewRow is not null); 7288Debug.Assert(rowIndex != -1); 7815Debug.Assert(firstVisibleColumn is not null); 7816Debug.Assert(lastVisibleColumn is not null); 7840Debug.Assert(firstVisibleRowIndex != -1); 7841Debug.Assert(lastVisibleRowIndex != -1); 7889Debug.Assert(lRowIndex != -1); 7890Debug.Assert(uRowIndex != -1); 7891Debug.Assert(lColumn is not null); 7892Debug.Assert(uColumn is not null); 7893Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index)); 7894Debug.Assert(lRowIndex <= uRowIndex); 7919Debug.Assert(prevDataGridViewColumn is not null); 7982Debug.Assert(nextDataGridViewColumn is not null); 8011Debug.Assert(rowIndex != -1); 8017Debug.Assert(nextRowIndex != -1); 8034Debug.Assert(prevDataGridViewColumn is not null); 8104Debug.Assert(nextDataGridViewColumn is not null); 8183Debug.Assert(destinationBytes[97] == '<'); 8184Debug.Assert(destinationBytes[bytecountEndOfHtml - 1] == '>'); 8185Debug.Assert(destinationBytes[133] == '<'); 8186Debug.Assert(destinationBytes[bytecountEndOfFragment] == '<'); 8200Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 8322Debug.Assert(RightToLeftInternal || (x >= data.X - 1 && x < data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 8323Debug.Assert(!RightToLeftInternal || (x >= data.X && x <= data.Right), "x must be inside the horizontal bounds of this.layout.Data"); 8382Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 8415Debug.Assert(xOffset > 0); 8450Debug.Assert(index < Columns.Count); 8451Debug.Assert(Columns[index].Visible); 8492Debug.Assert(dataGridViewColumn!.Visible && !dataGridViewColumn.Frozen); 8542Debug.Fail("Could not find column in GetColumnXFromIndex"); 8569Debug.Assert(!_vertScrollBar.Enabled 8602Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8638Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8649Debug.Assert(mouseY > rectScrollingArea.Bottom); 8694Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 8745Debug.Assert((!RightToLeftInternal && mouseX > rectScrollingArea.Right) || (RightToLeftInternal && mouseX < rectScrollingArea.Left)); 8819Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8861Debug.Assert(mouseY >= rectScrollingArea.Top && mouseY <= rectScrollingArea.Bottom); 8962Debug.Assert(mouseX >= rectScrollingArea.Left && mouseX <= rectScrollingArea.Right); 9030Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9108Debug.Assert(y >= data.Y - 1 && y < data.Bottom, "y must be inside the vertical bounds of the data area."); 9138Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9162Debug.Assert(yOffset > 0); 9195Debug.Assert(index >= 0 && index < Rows.Count); 9196Debug.Assert((Rows.GetRowState(index) & DataGridViewElementStates.Visible) != 0); 9232Debug.Assert(indexTmp != -1); 9237Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9254Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 9271Debug.Fail("Could not find row in GetRowYFromIndex"); 9344Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9418Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9485Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9486Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9606Debug.Assert(rowIndex >= 0); 9627Debug.Assert(_dataGridViewOper[OperationTrackColSelect] || _dataGridViewOper[OperationTrackCellSelect]); 9638Debug.Assert(_horizScrollTimer is not null); 9693Debug.Assert(_ptCurrentCell.X == dataGridViewCell.ColumnIndex); 9721Debug.Assert(EditingControl is not null); 9772Debug.Assert(dataGridViewCell.DataGridView == this); 9812Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 9856Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9884Debug.Assert(lo <= hi); 9885Debug.Assert(lo < Rows.Count); 9886Debug.Assert(hi < Rows.Count); 9916Debug.Assert(lo <= hi); 9917Debug.Assert(lo > -1); 10175Debug.Assert(_layout.Data.Height >= 0); 10198Debug.Assert(_layout.RowHeaders.Height >= 0); 10219Debug.Assert(_layout.Data.Width >= 0); 10228Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10265Debug.Assert(_layout.Data.Height >= 0); 10276Debug.Assert(_layout.Data.Width >= 0); 10285Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10314Debug.Assert(_horizScrollBar.Maximum > 0); 10356Debug.Assert(_vertScrollBar.Maximum > 0); 10398Debug.Assert(success); 10419Debug.Fail("Unexpected autoSizeRowsMode value in MapAutoSizeRowsModeToRowMode"); 10447Debug.Assert(DataSource is not null, "this method should only be called when we have a data connection"); 10448Debug.Assert(dataGridViewColumn.DataPropertyName.Length != 0, "this method should be called only for columns which have DataPropertyName set"); 10530Debug.Assert(dataGridViewColumn.Index >= 0); 10531Debug.Assert(dataGridViewColumn.DataGridView == this); 10550Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 10583Debug.Assert(rowIndex >= 0); 10589Debug.Assert(rowIndex == Rows.Count - 1); 10599Debug.Assert(!dataGridViewCell.Selected); 10600Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue); 10610Debug.Assert(dataGridViewCell.OwningColumn is not null); 10621Debug.Assert(rowIndex >= 0); 10835Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 10849Debug.Assert(weightSum <= ushort.MaxValue); 10852Debug.Assert(dataGridViewColumns is not null); 10914Debug.Assert(weightSum <= ushort.MaxValue); 10937Debug.Assert(dataGridViewColumn.CellType is not null); 10955Debug.Assert(dataGridViewColumn.CellType is not null); 11032Debug.Assert(dataGridViewRows is not null); 11072Debug.Assert(!AllowUserToAddRowsInternal); 11162Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11245Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11301Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11732Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11750Debug.Assert(_noDimensionChangeCount >= 0); 11756Debug.Assert(dataGridViewCell.RowIndex >= -1); 11757Debug.Assert(dataGridViewCell.ColumnIndex >= -1); 11772Debug.Assert(columnIndex >= 0); 11773Debug.Assert(rowIndex >= 0); 11820Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11838Debug.Assert(_noDimensionChangeCount >= 0); 11903Debug.Assert(hti.Type is not DataGridViewHitTestType.None 11906Debug.Assert(_ptMouseDownCell.X == hti._col); 11907Debug.Assert(_ptMouseDownCell.Y == hti._row); 11955Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 12062Debug.Assert(hti.Type == DataGridViewHitTestType.Cell); 12139Debug.Assert(MultiSelect || _individualSelectedCells.Count <= 1); 12188Debug.Assert(success); 12211Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12267Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 12277Debug.Assert(success); 12294Debug.Assert(_selectedBandIndexes.Count <= 1); 12367Debug.Assert(_selectedBandIndexes.Count <= 1); 12389Debug.Assert(success); 12414Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12465Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 12472Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 12482Debug.Assert(success); 12500Debug.Assert(_selectedBandIndexes.Count <= 1); 12573Debug.Assert(_selectedBandIndexes.Count <= 1); 12684Debug.Assert(hti.Type is not DataGridViewHitTestType.None 12696Debug.Assert(!_dataGridViewState2[State2_MessageFromEditingCtrls]); 12761Debug.Assert(MultiSelect); 12795Debug.Assert(success); 12811Debug.Assert(dataGridViewCell.RowIndex >= 0); 12855Debug.Assert(dataGridViewCellStyle is not null); 13056Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13078Debug.Assert(_noDimensionChangeCount >= 0); 13102Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13128Debug.Assert(_noDimensionChangeCount >= 0); 13363Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 13421Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13423Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 13431Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13534Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 13613Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.None); 13614Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Fill); 13647Debug.Assert(SortOrder != SortOrder.None); 13673Debug.Assert(hti.Type == DataGridViewHitTestType.ColumnHeader); 13773Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 13803Debug.Assert(_individualSelectedCells.Count == 0); 13847Debug.Assert(success); 13859Debug.Assert(success); 13870Debug.Assert(success); 13875Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 13880Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 14034Debug.Assert(dataGridViewColumn.Width == minimumWidth); 14114Debug.Assert(dataGridViewColumn.DataGridView is null); 14123Debug.Assert(hti._col >= 0); 14124Debug.Assert(MultiSelect); 14221Debug.Assert(success); 14334Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol)); 14387Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 14583Debug.Assert(AllowUserToAddRowsInternal); 14748Debug.Assert(!ReadOnly); 14769Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging"); 14785Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 14789Debug.Assert(DataConnection is not null); 14790Debug.Assert(DataConnection.CurrencyManager is not null); 14791Debug.Assert(DataConnection.CurrencyManager.Position == _ptCurrentCell.Y); 14831Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging"); 14849Debug.Assert(!Columns[dataGridViewCell.ColumnIndex].ReadOnly); 14850Debug.Assert(!Rows[dataGridViewCell.RowIndex].ReadOnly); 14851Debug.Assert(!ReadOnly); 14872Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging"); 14878Debug.Fail("Unexpected DataGridViewElement type in DataGridView.OnDataGridViewElementStateChanging"); 15271Debug.Assert(_ptCurrentCell.X == -1); 15280Debug.Assert(success); 15286Debug.Assert(rowIndex >= 0); 15287Debug.Assert(insertionCount > 0); 15301Debug.Assert(rowIndex >= 0); 15309Debug.Assert(_ptCurrentCell.X == -1); 15318Debug.Assert(success); 15324Debug.Assert(rowIndex >= 0); 15325Debug.Assert(dataGridViewRows is not null); 15326Debug.Assert(dataGridViewRows.Length > 0); 15340Debug.Assert(dataGridViewRows is not null); 15341Debug.Assert(dataGridViewRows.Length > 0); 15349Debug.Assert(_ptCurrentCell.X == -1); 15358Debug.Assert(success); 15469Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 15542Debug.Assert(success); 15608Debug.Assert(dataGridViewRows is not null); 15917Debug.Assert(dgvcme is not null); 15928Debug.Assert(dgvcme is not null); 15985Debug.Assert(dgvcme is not null); 16008Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 16028Debug.Assert(_columnHeadersHeightSizeMode == DataGridViewColumnHeadersHeightSizeMode.EnableResizing); 16035Debug.Assert(dgvcme is not null); 16058Debug.Assert(Rows[rowIndex].Resizable == DataGridViewTriState.True); 16078Debug.Assert(_rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing); 16105Debug.Assert(_ptMouseDownCell.Y != -2); 16325Debug.Assert(_vertScrollTimer is null || !_vertScrollTimer.Enabled); 16326Debug.Assert(_horizScrollTimer is null || !_horizScrollTimer.Enabled); 16479Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA); 16480Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA); 16481Debug.Assert(_cumulativeHorizontalWheelDelta > -PInvoke.WHEEL_DELTA); 16482Debug.Assert(_cumulativeHorizontalWheelDelta < PInvoke.WHEEL_DELTA); 16580Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16589Debug.Assert(totalVisibleFrozenHeight == Rows.GetRowsHeight(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 16590Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16722Debug.Fail($"DataGridView.OnPaint exception: {ex.Message} stack trace {ex.StackTrace}"); 16870Debug.Assert(dataGridViewColumn.Index >= 0); 16871Debug.Assert(dataGridViewColumn.DataGridView is null); 16896Debug.Assert(_ptCurrentCell.X == -1); 16905Debug.Assert(success); 16921Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 16947Debug.Assert(_ptCurrentCell.X == -1); 16956Debug.Assert(success); 17023Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count); 17074Debug.Assert(success); 17087Debug.Assert(success); 17103Debug.Assert(columnIndex == 0); 17146Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 17147Debug.Assert(Columns[i].HeaderCell.SortGlyphDirection == dataGridViewColumn.HeaderCell.SortGlyphDirection, "DataBound columns should have the same SortGlyphDirection as the one on the DataGridView"); 17186Debug.Assert(_horizontalOffset >= dataGridViewColumn.Thickness); 17237Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17260Debug.Assert(NewRowIndex != -1); 17261Debug.Assert(NewRowIndex == Rows.Count - 1); 17275Debug.Assert(rowIndexDeleted < _ptCurrentCell.Y); 17289Debug.Assert(success); 17302Debug.Assert(success); 17559Debug.Assert(rowIndex >= 0); 17652Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 17694Debug.Assert(NewRowIndex == -1, "newRowIndex and AllowUserToAddRowsInternal became out of sync"); 17725Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 17746Debug.Assert(_noDimensionChangeCount >= 0); 17769Debug.Assert(rowIndex >= 0); 17925Debug.Assert(hti.Type == DataGridViewHitTestType.RowHeader); 18030Debug.Assert(success); 18055Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 18085Debug.Assert(_individualSelectedCells.Count == 0); 18115Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 18131Debug.Assert(success); 18138Debug.Assert(success); 18149Debug.Assert(success); 18154Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 18159Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 18298Debug.Assert(rowIndex != -1); 18299Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 18319Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 18332Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18353Debug.Assert(_noDimensionChangeCount >= 0); 18399Debug.Assert(hti._row >= 0); 18400Debug.Assert(MultiSelect); 18493Debug.Assert(success); 18553Debug.Assert(rowIndex >= -1); 18755Debug.Assert(_noDimensionChangeCount >= 0); 18779Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18800Debug.Assert(_noDimensionChangeCount >= 0); 18936Debug.Assert(dataGridViewColumnHeaderCell is not null); 18960Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time"); 18988Debug.Assert(success); 19095Debug.Assert(success); 19105Debug.Assert(success); 19135Debug.Assert(rowIndexTmp != -1); 19142Debug.Assert(rowIndexTmp != -1); 19143Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19163Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Visible) != 0); 19165Debug.Assert(numDisplayedScrollingRows > 0); 19168Debug.Assert(rowIndexTmp != -1); 19175Debug.Assert(rowIndexTmp != -1); 19176Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19274Debug.Assert(bounds.Left == 0); 19275Debug.Assert(bounds.Top == 0); 19328Debug.Fail("DataGridView.PaintBorder - Unexpected BorderStyle value."); 19360Debug.Assert(cellBounds.Width > 0); 19429Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 19438Debug.Assert(cellBounds.Width > 0); 19477Debug.Assert(clipRegion is not null); 19538Debug.Assert(_dataGridViewOper[OperationTrackColHeadersResize] || _dataGridViewOper[OperationTrackRowResize]); 19543Debug.Assert(_dataGridViewOper[OperationTrackRowHeadersResize] 19618Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Frozen) == 0); 19619Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0); 19761Debug.Assert(_inPerformLayoutCount >= 0); 19790Debug.Assert(EditingControl is not null); 19800Debug.Assert(dataGridViewCell.ColumnIndex == _ptCurrentCell.X); 19801Debug.Assert(dataGridViewCell.RowIndex == _ptCurrentCell.Y || dataGridViewCell.RowIndex == -1); 19945Debug.Assert(rowIndex >= 0); 19970Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync in AddNewTransaction when the user did not type in the 'add new row'"); 19978Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync"); 20011Debug.Assert(dataGridViewRow.Index == -1); 20023Debug.Assert(dataGridViewRow.Index == -1); 20180Debug.Assert(success); 20206Debug.Assert(_ptAnchorCell.Y >= 0); 20258Debug.Assert(success); 20303Debug.Assert(success); 20373Debug.Assert(success); 20433Debug.Assert(success); 20462Debug.Assert(_ptAnchorCell.Y >= 0); 20500Debug.Assert(success); 20545Debug.Assert(success); 20614Debug.Assert(success); 20669Debug.Assert(success); 20691Debug.Assert(_ptAnchorCell.Y >= 0); 20761Debug.Assert(success); 20815Debug.Assert(success); 20913Debug.Assert(success); 20975Debug.Assert(success); 21015Debug.Assert(success); 21500Debug.Assert(_ptCurrentCell.Y != -1); 21501Debug.Assert(CurrentCellInternal is not null); 21502Debug.Assert(EditMode != DataGridViewEditMode.EditOnEnter 21511Debug.Assert(success); 21900Debug.Assert(success); 22111Debug.Assert(success); 22118Debug.Assert(success); 22139Debug.Assert(_ptAnchorCell.X >= 0); 22162Debug.Assert(success); 22172Debug.Assert(success); 22179Debug.Assert(success); 22201Debug.Assert(success); 22222Debug.Assert(success); 22229Debug.Assert(success); 22271Debug.Assert(success); 22281Debug.Assert(success); 22288Debug.Assert(success); 22310Debug.Assert(success); 22331Debug.Assert(success); 22338Debug.Assert(success); 22406Debug.Assert(success); 22416Debug.Assert(success); 22423Debug.Assert(success); 22454Debug.Assert(success); 22473Debug.Assert(success); 22480Debug.Assert(success); 22500Debug.Assert(success); 22535Debug.Assert(success); 22542Debug.Assert(success); 22553Debug.Assert(_ptAnchorCell.X >= 0); 22574Debug.Assert(success); 22596Debug.Assert(success); 22607Debug.Assert(success); 22619Debug.Assert(success); 22641Debug.Assert(success); 22655Debug.Assert(success); 22667Debug.Assert(success); 22684Debug.Assert(_ptAnchorCell.X >= 0); 22687Debug.Assert(success); 22704Debug.Assert(success); 22715Debug.Assert(success); 22722Debug.Assert(success); 22739Debug.Assert(success); 22753Debug.Assert(success); 22760Debug.Assert(success); 22776Debug.Assert(_ptAnchorCell.X >= 0); 22796Debug.Assert(success); 22822Debug.Assert(success); 22833Debug.Assert(success); 22840Debug.Assert(success); 22866Debug.Assert(success); 22878Debug.Assert(success); 22885Debug.Assert(success); 22900Debug.Assert(success); 22946Debug.Assert(firstDisplayedScrollingRowIndex != -1); 22966Debug.Assert(nextScreenVisibleRowIndexTmp != -1); 23004Debug.Assert(success); 23030Debug.Assert(_ptAnchorCell.Y >= 0); 23053Debug.Assert(success); 23070Debug.Assert(_ptAnchorCell.Y >= 0); 23106Debug.Assert(_ptAnchorCell.Y >= 0); 23212Debug.Assert(previousScreenVisibleRowIndexTmp != -1); 23240Debug.Assert(previousScreenVisibleRowIndex != -1); 23289Debug.Assert(_ptAnchorCell.Y >= 0); 23328Debug.Assert(_ptAnchorCell.Y >= 0); 23364Debug.Assert(_ptAnchorCell.Y >= 0); 23490Debug.Assert(success); 23497Debug.Assert(success); 23540Debug.Assert(success); 23550Debug.Assert(success); 23557Debug.Assert(success); 23579Debug.Assert(success); 23600Debug.Assert(success); 23607Debug.Assert(success); 23649Debug.Assert(success); 23659Debug.Assert(success); 23666Debug.Assert(success); 23688Debug.Assert(success); 23709Debug.Assert(success); 23716Debug.Assert(success); 23786Debug.Assert(success); 23796Debug.Assert(success); 23803Debug.Assert(success); 23834Debug.Assert(success); 23853Debug.Assert(success); 23860Debug.Assert(success); 23880Debug.Assert(success); 23915Debug.Assert(success); 23922Debug.Assert(success); 23938Debug.Assert(_ptAnchorCell.X >= 0); 23954Debug.Assert(success); 23961Debug.Assert(success); 23972Debug.Assert(success); 23979Debug.Assert(success); 23996Debug.Assert(success); 24010Debug.Assert(success); 24017Debug.Assert(success); 24039Debug.Assert(_ptAnchorCell.X >= 0); 24042Debug.Assert(success); 24049Debug.Assert(success); 24060Debug.Assert(success); 24067Debug.Assert(success); 24084Debug.Assert(success); 24098Debug.Assert(success); 24105Debug.Assert(success); 24121Debug.Assert(_ptAnchorCell.X >= 0); 24146Debug.Assert(success); 24162Debug.Assert(success); 24173Debug.Assert(success); 24180Debug.Assert(success); 24206Debug.Assert(success); 24218Debug.Assert(success); 24225Debug.Assert(success); 24240Debug.Assert(success); 24271Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24289Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.X)); 24298Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24316Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.Y)); 24581Debug.Assert(_ptAnchorCell.Y >= 0); 24678Debug.Assert(_ptAnchorCell.Y >= 0); 24780Debug.Assert(_ptAnchorCell.Y >= 0); 24963Debug.Assert(_ptAnchorCell.Y >= 0); 25278Debug.Assert(success); 25289Debug.Assert(dataGridViewCurrentCell is not null); 25302Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25304Debug.Assert(dataGridViewEditingCell is not null); 25333Debug.Assert(NewRowIndex == Rows.Count - 1); 25342Debug.Assert(IsCurrentCellInEditMode); 25396Debug.Assert(dgvcme.Clicks == 1); 25472Debug.Assert(_ptCurrentCell.Y != -1); 25494Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25498Debug.Assert(dataGridViewEditingCell is not null); 25553Debug.Assert(list.Count == rowsCount); 25670Debug.Assert(_noSelectionChangeCount > 0); 25697Debug.Assert(_noSelectionChangeCount > 0); 25719Debug.Assert(dataGridViewCell.ColumnIndex != columnIndexException || dataGridViewCell.RowIndex != rowIndexException); 25738Debug.Assert(_noSelectionChangeCount > 0); 25790Debug.Assert(_noSelectionChangeCount > 0); 25954Debug.Assert(rowIndex >= 0); 25955Debug.Assert(rowIndex < Rows.Count); 26000Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26132Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26149Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26199Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26200Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingCol < Columns.Count); 26201Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= -1 && DisplayedBandsInfo.LastTotallyDisplayedScrollingCol < Columns.Count); 26202Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26203Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26204Debug.Assert(Columns[columnIndex].Visible); 26205Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 26262Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26292Debug.Assert(firstDisplayedScrollingRow != -1); 26317Debug.Assert(rowCount != 0); 26318Debug.Assert(deltaY != 0); 26319Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 26341Debug.Assert(rowsRect.X > 0); 26348Debug.Assert(rowsRect.Height >= 0); 26352Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow > -1); 26377Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26379Debug.Assert(firstVisibleScrollingRow != -1); 26381Debug.Assert(newScrolledOffRowCount >= rowCount); 26388Debug.Assert(rows != 0); 26389Debug.Assert((rows > 0 && (scrollEventType == ScrollEventType.SmallIncrement || scrollEventType == ScrollEventType.LargeIncrement)) 26393Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26404Debug.Assert(newFirstVisibleScrollingRow != -1); 26422Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == oldFirstVisibleScrollingRow); 26445Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == newFirstVisibleScrollingRow); 26459Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26485Debug.Assert(newFirstVisibleScrollingRow != -1); 26611Debug.Assert(_noDimensionChangeCount >= 0); 26612Debug.Assert(_noSelectionChangeCount >= 0); 26639Debug.Assert(index >= 0); 26713Debug.Assert(_columnHeadersHeight != columnHeadersHeight); 26714Debug.Assert(columnHeadersHeight >= MinimumColumnHeadersHeight); 26715Debug.Assert(columnHeadersHeight <= MaxHeadersThickness); 26781Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26849Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 26850Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 26947Debug.Assert(oldCurrentCellY >= 0); 27055Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 27056Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 27111Debug.Assert(oldCurrentCellY >= 0); 27143Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27144Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27145Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27146Debug.Assert(rowIndexFrom <= rowIndexTo); 27147Debug.Assert(_noSelectionChangeCount > 0); 27230Debug.Assert(_noSelectionChangeCount > 0); 27265Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27266Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27267Debug.Assert(_noSelectionChangeCount > 0); 27281Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27308Debug.Assert(_selectedBandIndexes.Contains(columnIndexTo)); 27316Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27317Debug.Assert(rowIndexFrom <= rowIndexTo); 27318Debug.Assert(_noSelectionChangeCount > 0); 27337Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 27346Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27468Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27541Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 27577Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27638Debug.Assert(_individualSelectedCells.Contains(dataGridViewCell)); 27656Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27692Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27757Debug.Assert(_individualSelectedCells.Count <= 1); 27771Debug.Assert(_selectedBandIndexes.Count <= 1); 27809Debug.Assert(_selectedBandIndexes.Count <= 1); 27826Debug.Assert(_selectedBandIndexes.Count <= 1); 27851Debug.Assert(_selectedBandIndexes.Count <= 1); 27869Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27878Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27893Debug.Assert(_selectedBandIndexes.Count <= 1); 27910Debug.Assert(_selectedBandIndexes.Count <= 1); 27938Debug.Assert(success); 27959Debug.Assert(!_selectedBandIndexes.Contains(columnIndex)); 27965Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27978Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 27990Debug.Assert(_selectedBandIndexes.Count <= 1); 28078Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 28085Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 28098Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 28110Debug.Assert(_selectedBandIndexes.Count <= 1); 28216Debug.Assert(!(comparer is not null && DataSource is not null)); 28217Debug.Assert(direction is ListSortDirection.Ascending or ListSortDirection.Descending); 28242Debug.Assert(rowVFIndex != -1); 28244Debug.Assert(Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) == 0); 28306Debug.Assert(rowVIndex != -1); 28310Debug.Assert(rowVIndex != -1); 28321Debug.Assert(_dataGridViewOper[OperationInSort]); 28342Debug.Assert(rowIndex1 != NewRowIndex); 28343Debug.Assert(rowIndex2 != NewRowIndex); 28428Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28452Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28680Debug.Assert(lastVisibleRowIndex != -1); 28817Debug.Assert(_editingPanel is not null); 28828Debug.Assert(EditingControl is not null); 28892Debug.Assert(dataGridViewColumnTmp is not null); 28896Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 28909Debug.Assert(numDisplayedScrollingCols > 0); 28913Debug.Assert(dataGridViewColumnTmp is not null); 28917Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 29053Debug.Assert(rowVisible); 29115Debug.Assert(rowIndexTmp != -1); 29131Debug.Assert(numDisplayedScrollingRows > 0); 29134Debug.Assert(rowIndexTmp != -1); 29214Debug.Assert(anchorColumnIndex >= 0); 29215Debug.Assert(anchorRowIndex >= 0); 29216Debug.Assert(newEdgeColumnIndex >= 0); 29217Debug.Assert(newEdgeRowIndex >= 0); 29218Debug.Assert(_noSelectionChangeCount > 0); 29400Debug.Assert(oldEdgeRowIndex < anchorRowIndex); 29445Debug.Assert(oldEdgeRowIndex <= anchorRowIndex); 29628Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29776Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29862Debug.Assert(_dataGridViewOper[OperationTrackRowSelect] || _dataGridViewOper[OperationTrackCellSelect]); 29915Debug.Assert(_editingPanel is not null); 29926Debug.Assert(EditingControl is not null); 29980Debug.Assert(hti._row == -1); 29984Debug.Assert(hti._col == -1); 29988Debug.Assert(hti._row == -1); 29989Debug.Assert(hti._col == -1);
System\Windows\Forms\Controls\DataGridView\DataGridView.TopRowAccessibleObject.cs (1)
123Debug.Assert(index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewBand.cs (22)
141Debug.Assert(!IsRow); 146Debug.Assert(value != Displayed); 184Debug.Assert(!IsRow); 245Debug.Assert(dataGridViewColumnHeaderCell is not null); 287Debug.Assert(value.OwningRow is null); 305Debug.Assert(dataGridViewColumnHeaderCell.SortGlyphDirection == SortOrder.None); 306Debug.Assert(value.OwningColumn is null); 310Debug.Assert(value.DataGridView is null); 386Debug.Assert(!IsRow); 415Debug.Assert(Index >= 0); 452Debug.Assert(value != ReadOnly); 462Debug.Assert(DataGridView is not null); 472Debug.Assert(!IsRow); 526Debug.Assert(!IsRow); 548Debug.Assert(Index >= 0); 567Debug.Assert(value != Selected); 658Debug.Assert(_thickness != value); 659Debug.Assert(value >= _minimumThickness); 660Debug.Assert(value <= MaxBandThickness); 672Debug.Assert(!IsRow); 768Debug.Assert(IsRow); 773Debug.Assert(rowIndex > -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (14)
45Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 76Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 201Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 270Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 502Debug.Assert(RowIndex >= 0); // Cell is not in a shared row. 516Debug.Assert(DataGridView.CellMouseDownInContentBounds); 652Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 653Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 654Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 655Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 656Debug.Assert(cellStyle is not null); 795Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style"); 872Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 925Debug.Assert(FlatStyle == FlatStyle.Popup, "FlatStyle.Popup is the last flat style");
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (73)
155Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 174Debug.Assert(RowIndex >= -1); 220Debug.Assert(RowIndex >= -1); 257Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 436Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 451Debug.Assert(ColumnIndex >= 0); 506Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 538Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 553Debug.Assert(ColumnIndex >= 0); 568Debug.Assert(value != Selected); 685Debug.Assert(RowIndex >= -1); 690Debug.Assert(RowIndex >= -1); 743Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 880Debug.Assert(DataGridView is not null); 881Debug.Assert(ColumnIndex >= 0); 950Debug.Assert(DataGridView is not null); 971Debug.Assert(rowIndex == -1); 972Debug.Assert(this is DataGridViewColumnHeaderCell, "if the row index == -1 and we have an owning column this should be a column header cell"); 984Debug.Assert(this is DataGridViewRowHeaderCell); 995Debug.Assert(OwningColumn is null); 996Debug.Assert(OwningRow is null); 997Debug.Assert(rowIndex == -1); 1063Debug.Assert(dataGridView.EditingControl.ParentInternal == dataGridView.EditingPanel); 1064Debug.Assert(dataGridView.EditingPanel.Controls.Contains(dataGridView.EditingControl)); 1066Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1079Debug.Assert(dataGridView.EditingPanel.ParentInternal == dataGridView); 1080Debug.Assert(dataGridView.Controls.Contains(dataGridView.EditingPanel)); 1082Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1085Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1086Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1087Debug.Assert(dataGridView.EditingPanel.Controls.Count == 0); 1109Debug.Assert(DataGridView?.EditingControl is not null); 1361Debug.Assert(csv); 1420Debug.Assert(DataGridView is not null); 1475Debug.Assert(DataGridView is not null); 1708Debug.Assert(OwningRow is not null); 1724Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1767Debug.Assert(RowIndex == -1); 1789Debug.Assert(OwningColumn is not null); 1790Debug.Assert(OwningRow is not null); 1791Debug.Assert(ColumnIndex >= 0); 1854Debug.Assert(state == stateDebug || DataGridView.Rows.SharedRow(rowIndex).Index == -1); 1874Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1897Debug.Assert(cellStyle is not null); 1904Debug.Assert(rowStyle is not null); 1911Debug.Assert(columnStyle is not null); 1915Debug.Assert(dataGridViewStyle is not null); 2179Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2206Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 2270Debug.Assert(width > 0); 2308Debug.Assert(maxWidth > 0); 2325Debug.Assert(height > 0); 2349Debug.Assert(OwningColumn is not null); 2350Debug.Assert(OwningRow is not null); 2412Debug.Assert(ColumnIndex < dataGridView.Columns.Count); 2441Debug.Assert(rowIndex >= 0); 2442Debug.Assert(ColumnIndex >= 0); 2466Debug.Assert(!dgv.EditingPanel.ContainsFocus); 2468Debug.Assert(dgv.EditingPanel.ParentInternal is null); 2471Debug.Assert(dgv.IsSharedCellVisible(this, rowIndex)); 2474Debug.Assert(dgv.EditingControl.ParentInternal == dgv.EditingPanel); 2475Debug.Assert(dgv.EditingPanel.ParentInternal == dgv); 2648Debug.Assert(textSize.Height <= maxHeight); 2690Debug.Assert(DataGridView is not null); 2703Debug.Assert(DataGridView.IsCurrentCellInEditMode); 2737Debug.Assert(this is DataGridViewHeaderCell); 2797Debug.Assert(!string.IsNullOrEmpty(errorText), "if we entered the cell error area then an error was painted, so we should have an error"); 2953Debug.Assert(false, "there are only three possible choices for the CurrentMouseLocation"); 2969Debug.Assert(CurrentMouseLocation != FlagAreaNotSet); 3000Debug.Fail("there are only three choices for CurrentMouseLocation"); 3629Debug.Assert(DataGridView is not null); 3925Debug.Assert(rowIndex >= 0); 3926Debug.Assert(ColumnIndex >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (9)
280Debug.Assert(dataGridView.CurrentCell == dataGridViewCell, "the result of selecting the cell should have made this cell the current cell"); 496Debug.Assert(_owner is not null); 497Debug.Assert(_owner.DataGridView is not null); 498Debug.Assert(_owner.OwningColumn is not null); 499Debug.Assert(_owner.OwningRow is not null); 533Debug.Assert(_owner is not null); 534Debug.Assert(_owner.DataGridView is not null); 535Debug.Assert(_owner.OwningColumn is not null); 536Debug.Assert(_owner.OwningRow is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellCollection.cs (6)
56Debug.Assert(dataGridViewRow is not null); 173Debug.Assert(!dataGridViewCell.Selected); 227Debug.Assert(!dataGridViewCell.Selected); 277Debug.Assert(!dataGridViewCell.ReadOnly); 278Debug.Assert(!dataGridViewCell.Selected); 286Debug.Assert(!dataGridViewCell.Selected);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedList.cs (5)
65Debug.Assert(_headElement is not null); 72Debug.Assert(dataGridViewCell is not null); 73Debug.Assert(dataGridViewCell.DataGridView!.SelectionMode == DataGridViewSelectionMode.CellSelect || 98Debug.Assert(dataGridViewCell is not null); 119Debug.Assert(dataGridViewCell is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedListElement.cs (1)
15Debug.Assert(dataGridViewCell is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellLinkedListEnumerator.cs (3)
27Debug.Assert(_current is not null); // Since this is for internal use only. 36Debug.Assert(_current is null); 42Debug.Assert(_current is not null); // Since this is for internal use only.
System\Windows\Forms\Controls\DataGridView\DataGridViewCellPaintingEventArgs.cs (2)
50Debug.Assert(dataGridView is not null); 185Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellStyle.cs (8)
97Debug.Assert(Enum.IsDefined(value)); 270Debug.Assert(value.All < -1); 290Debug.Assert(value.Left >= 0); 291Debug.Assert(value.Right >= 0); 292Debug.Assert(value.Top >= 0); 293Debug.Assert(value.Bottom >= 0); 359Debug.Assert(value is >= DataGridViewTriState.NotSet and <= DataGridViewTriState.False); 451Debug.Assert(dgvcs is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCellValueEventArgs.cs (2)
31Debug.Assert(columnIndex >= -1); 32Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxCell.cs (19)
187Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 251Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 431Debug.Assert(DataGridView is not null); 490Debug.Assert(checkBoxBoundsDebug.Equals(checkBoxBounds)); 626Debug.Assert(retCheckState == CheckState.Indeterminate); 766Debug.Assert(DataGridView is not null); 777Debug.Assert(DataGridView is not null); 855Debug.Assert(RowIndex >= 0); // Cell is not in a shared row. 869Debug.Assert(DataGridView.CellMouseDownInContentBounds); 1057Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 1058Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 1059Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 1060Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 1061Debug.Assert(cellStyle is not null); 1079Debug.Assert(DataGridView is not null); 1387Debug.Assert(FlatStyle == FlatStyle.Popup); 1553Debug.Assert(valBounds.Width < checkBoxSize.Width || valBounds.Height < checkBoxSize.Height, "the bounds are empty"); 1571Debug.Assert(formattedValue is null || FormattedValueType is null || FormattedValueType.IsAssignableFrom(formattedValue.GetType())); 1704Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewCheckBoxColumn.cs (1)
287Debug.Fail("we can't compute the default cell style w/o a template cell");
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (11)
308Debug.Assert(value >= -1); 309Debug.Assert(value < int.MaxValue); 360Debug.Assert(value > 0); 435Debug.Assert(columnStyle is not null); 445Debug.Assert(dataGridViewStyle is not null); 534Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 544Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 781Debug.Assert(value > 0); 912Debug.Assert(dataGridView is null || Index > -1); 920Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header 928Debug.Assert(dataGridView.ColumnHeadersVisible || autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Header);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.ColumnOrderComparer.cs (2)
16Debug.Assert(x is not null); 17Debug.Assert(y is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnCollection.cs (38)
145Debug.Assert(DataGridView is not null); 169Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 178Debug.Assert(DataGridView is not null); 223Debug.Assert(smallestIndex >= 0); 261Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 309Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 386Debug.Fail("no column found in GetColumnAtDisplayIndex"); 475Debug.Assert((includeFilter & ~(DataGridViewElementStates.Displayed | DataGridViewElementStates.Frozen | DataGridViewElementStates.Resizable | 477Debug.Assert((includeFilter & DataGridViewElementStates.Resizable) == 0); 478Debug.Assert(DisplayInOrder(fromColumnIndex, toColumnIndex)); 479Debug.Assert(_items[toColumnIndex].StateIncludes(includeFilter)); 489Debug.Assert(dataGridViewColumn is not null); 501Debug.Assert(dataGridViewColumn is not null); 502Debug.Assert(_itemsSorted is not null); 503Debug.Assert(_lastAccessedSortedIndex == -1 || 507Debug.Assert(VerifyColumnOrderCache()); 532Debug.Assert((includeFilter & ~(DataGridViewElementStates.Displayed | DataGridViewElementStates.Frozen | DataGridViewElementStates.Resizable | 610Debug.Assert(VerifyColumnOrderCache()); 654Debug.Assert(VerifyColumnOrderCache()); 694Debug.Assert(VerifyColumnOrderCache()); 737Debug.Assert(VerifyColumnOrderCache()); 810Debug.Assert(VerifyColumnOrderCache()); 866Debug.Assert(DataGridView is not null); 905Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 911Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 934Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 958Debug.Assert(VerifyColumnDisplayIndexes()); 967Debug.Assert(DataGridView is not null); 973Debug.Assert(DataGridView is not null); 1003Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 1009Debug.Fail("Column should have been found in DataGridViewColumnCollection.Remove"); 1050Debug.Assert(_itemsSorted is null || VerifyColumnOrderCache()); 1058Debug.Assert(index >= 0 && index < Count); 1059Debug.Assert(DataGridView is not null); 1060Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 1061Debug.Assert(!DataGridView.InDisplayIndexAdjustments); 1108Debug.Assert(columnWidthIncrement != 0); 1116Debug.Assert(columnWidthIncrement != 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnEventArgs.cs (1)
12Debug.Assert(dataGridViewColumn.Index >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.cs (14)
90Debug.Assert(value is >= SortOrder.None and <= SortOrder.Descending); 136Debug.Assert(inFirstRow); 184Debug.Assert(csv); 260Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 290Debug.Assert(cellStyle is not null); 294Debug.Assert(columnHeadersStyle is not null); 297Debug.Assert(dataGridViewStyle is not null); 429Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 443Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 755Debug.Assert(cellStyle is not null); 772Debug.Assert(DataGridView is not null); 805Debug.Assert(ButtonState == ButtonState.Pushed); 1093Debug.Assert(SortGlyphDirection == SortOrder.Descending); 1182Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumnHeaderCell.DataGridViewColumnHeaderCellAccessibleObject.cs (2)
162Debug.Assert(Owner is not null); 184Debug.Assert(Owner is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.cs (37)
163Debug.Assert(DisplayMember is not null && DisplayMember.Length > 0); 173Debug.Assert(ValueMember is not null && ValueMember.Length > 0); 261Debug.Assert(value is >= DataGridViewComboBoxDisplayStyle.ComboBox and <= DataGridViewComboBoxDisplayStyle.Nothing); 363Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 514Debug.Assert(DataGridView is not null); 520Debug.Assert(DataGridView is not null); 521Debug.Assert(EditingComboBox is not null); 581Debug.Assert(DataGridView is not null); 582Debug.Assert(EditingComboBox is not null); 617Debug.Assert(s_cachedDropDownWidth >= 1); 685Debug.Assert(sender == DataSource, "How can we get dispose notification from anything other than our DataSource?"); 691Debug.Assert(sender == DataSource); 692Debug.Assert(DataSource is ISupportInitializeNotification); 693Debug.Assert(_flags.HasFlag(DataGridViewComboBoxCellFlags.DataSourceInitializedHookedUp)); 784Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 887Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 1044Debug.Assert(item is not null); 1228Debug.Assert(EditingComboBox is not null); 1231Debug.Assert(rowIndex > -1); 1250Debug.Assert(DataGridView is not null && 1252Debug.Assert(!ReadOnly); 1412Debug.Assert(property is not null); 1413Debug.Assert(DataManager is not null); 1444Debug.Assert(!string.IsNullOrEmpty(field)); 1533Debug.Assert(value is not null); 1534Debug.Assert(ValueMemberProperty is not null || DisplayMemberProperty is not null || 1577Debug.Assert(DisplayMemberProperty is not null || ValueMemberProperty is not null || 1633Debug.Assert(TemplateComboBoxColumn.CellTemplate == this); 1665Debug.Assert(e.ColumnIndex == ColumnIndex); 1871Debug.Assert(paint || computeContentBounds || computeErrorIconBounds || computeDropDownButtonRect); 1872Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect); 1873Debug.Assert(!paint || !computeContentBounds || !computeDropDownButtonRect || !computeErrorIconBounds); 1874Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint || !computeDropDownButtonRect); 1875Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect || !paint); 1876Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds || !computeDropDownButtonRect); 1877Debug.Assert(!computeErrorIconBounds || !paint || !computeDropDownButtonRect || !computeContentBounds); 1878Debug.Assert(cellStyle is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewComboBoxCell.ObjectCollection.cs (1)
23Debug.Assert(owner is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewHeaderCell.cs (6)
335Debug.Assert(state == stateDebug); 491Debug.Assert(ButtonState == ButtonState.Pushed); 492Debug.Assert(ColumnIndex == DataGridView.MouseDownCellAddress.X); 493Debug.Assert(rowIndex == DataGridView.MouseDownCellAddress.Y); 563Debug.Assert(DataGridView is not null); 564Debug.Assert(Enum.IsDefined(newButtonState));
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (13)
115Debug.Assert(value is >= DataGridViewImageCellLayout.NotSet and <= DataGridViewImageCellLayout.Zoom); 164Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 279Debug.Assert(imgBoundsDebug.Equals(imgBounds)); 344Debug.Assert(errBoundsDebug.Equals(errBounds)); 576Debug.Assert(imageLayout != DataGridViewImageCellLayout.Stretch); 668Debug.Assert( 732Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 733Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 734Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 735Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 736Debug.Assert(cellStyle is not null); 760Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0); 805Debug.Assert(imageLayout != DataGridViewImageCellLayout.NotSet);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (1)
261Debug.Fail("we can't compute the default cell style w/o a template cell");
System\Windows\Forms\Controls\DataGridView\DataGridViewIntLinkedList.cs (4)
29Debug.Assert(source is not null); 71Debug.Assert(index >= 0); 75Debug.Assert(index == _lastAccessedIndex); 88Debug.Assert(_headElement is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewIntLinkedListEnumerator.cs (3)
27Debug.Assert(_current is not null); // Since this is for internal use only. 36Debug.Assert(_current is null); 42Debug.Assert(_current is not null); // Since this is for internal use only.
System\Windows\Forms\Controls\DataGridView\DataGridViewLinkCell.cs (8)
143Debug.Assert(value is >= LinkBehavior.SystemDefault and <= LinkBehavior.NeverUnderline); 474Debug.Assert(linkBoundsDebug.Equals(linkBounds)); 888Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 889Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 890Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 891Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 892Debug.Assert(cellStyle is not null); 964Debug.Assert(computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (27)
145Debug.Assert(Index >= -1); 600Debug.Assert(inheritedCellStyle is not null); 606Debug.Assert(cellStyle is not null); 610Debug.Assert(rowHeadersStyle is not null); 613Debug.Assert(dataGridViewStyle is not null); 742Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 756Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 794Debug.Assert(inheritedRowStyle is not null); 795Debug.Assert(rowIndex >= 0); 801Debug.Assert(rowStyle is not null); 805Debug.Assert(dataGridViewStyle is not null); 808Debug.Assert(rowsDefaultCellStyle is not null); 811Debug.Assert(alternatingRowsDefaultCellStyle is not null); 983Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 1001Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 1129Debug.Assert(Cells.Count == dataGridView.Columns.Count); 1169Debug.Assert(Index == -1); 1170Debug.Assert(!Selected); 1273Debug.Assert(rowIndex >= -1); 1397Debug.Assert(DataGridView is not null); 1405Debug.Assert(DataGridView is not null); 1527Debug.Assert(cellBounds.Width > 0); 1606Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 1617Debug.Assert(cellBounds.Width > 0); 1704Debug.Assert(cellBounds.Width > 0); 1752Debug.Assert(Index == -1); 1794Debug.Assert(values is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (1)
275Debug.Assert(index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewSelectedRowCellsAccessibleObject.cs (1)
61Debug.Assert(false, "we should have found already the selected cell");
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (109)
192Debug.Assert(DataGridView is not null); 205Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 208Debug.Assert(values is null); 210Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 226Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 227Debug.Assert(DataGridView.NewRowIndex == Count - 1); 241Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 254Debug.Assert((rowState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 264Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 274Debug.Assert(DataGridView is not null); 321Debug.Assert(DataGridView is not null); 349Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 351Debug.Assert((rowTemplateState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 357Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 370Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 371Debug.Assert(DataGridView.NewRowIndex == Count - 1); 382Debug.Assert(DataGridView is not null); 408Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 409Debug.Assert(DataGridView.NewRowIndex == Count - 1); 416Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 423Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 440Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 442Debug.Assert(_rowStates.Count == SharedList.Count); 453Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 481Debug.Assert(DataGridView is not null); 485Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 486Debug.Assert(DataGridView.NewRowIndex == Count - 1); 487Debug.Assert(!newRow); 502Debug.Assert(DataGridView is not null); 550Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 551Debug.Assert(DataGridView.NewRowIndex == Count - 1); 671Debug.Assert(DataGridView is not null); 704Debug.Assert(dataGridViewRow.Index == -1); 716Debug.Assert(DataGridView is not null); 730Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 731Debug.Assert(DataGridView.NewRowIndex == Count - 1); 748Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 753Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 766Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 774Debug.Assert(dataGridViewRow.State == SharedRowState(index)); 778Debug.Assert(_rowStates.Count == SharedList.Count); 855Debug.Assert(visibleRowIndex < GetRowCount(DataGridViewElementStates.Visible)); 874Debug.Assert(false, "we should have found the row already"); 886Debug.Assert(_cachedRowCountsAccessAllowed); 942Debug.Assert(_cachedRowCountsAccessAllowed); 986Debug.Assert(_cachedRowCountsAccessAllowed); 1024Debug.Assert(skipRows >= 0); 1147Debug.Assert(_cachedRowCountsAccessAllowed); 1220Debug.Assert(toRowIndex >= fromRowIndex); 1221Debug.Assert((GetRowState(toRowIndex) & includeFilter) == includeFilter); 1243Debug.Assert(_cachedRowHeightsAccessAllowed); 1290Debug.Assert(toRowIndex >= fromRowIndex); 1291Debug.Assert((GetRowState(toRowIndex) & includeFilter) == includeFilter); 1308Debug.Assert(toRowIndex >= fromRowIndex); 1309Debug.Assert(toRowIndex == _items.Count || (GetRowState(toRowIndex) & includeFilter) == includeFilter); 1341Debug.Assert(dataGridViewRow.Index == rowIndex); 1353Debug.Assert(DataGridView is not null); 1425Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1430Debug.Assert(rowTemplate.Cells.Count == DataGridView.Columns.Count); 1432Debug.Assert((rowTemplateState & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1438Debug.Assert(dataGridViewCell.OwningRow == rowTemplate); 1454Debug.Assert(DataGridView is not null); 1470Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1494Debug.Assert(DataGridView is not null); 1495Debug.Assert(rowIndex >= 0 && rowIndex <= Count); 1496Debug.Assert(dataGridViewRow is not null); 1497Debug.Assert(dataGridViewRow.DataGridView is null); 1498Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 1499Debug.Assert(DataGridView.NewRowIndex == -1 || rowIndex != Count); 1500Debug.Assert(!dataGridViewRow.Selected); 1518Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1525Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1541Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1543Debug.Assert(_rowStates.Count == SharedList.Count); 1554Debug.Assert(dataGridViewRow.State == SharedRowState(rowIndex)); 1582Debug.Assert(DataGridView is not null); 1602Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1654Debug.Assert(_rowStates.Count == SharedList.Count); 1683Debug.Assert(_rowStates.Count == SharedList.Count); 1710Debug.Assert(DataGridView is not null); 1733Debug.Assert(dataGridViewRow.Index == -1); 1736Debug.Assert(_rowStates.Count == SharedList.Count); 1749Debug.Assert(DataGridView is not null); 1772Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 1794Debug.Assert(dataGridViewRow.Cells.Count == DataGridView.Columns.Count); 1799Debug.Assert(dataGridViewCell.OwningRow == dataGridViewRow); 1815Debug.Assert((dataGridViewRow.State & (DataGridViewElementStates.Selected | DataGridViewElementStates.Displayed)) == 0); 1817Debug.Assert(_rowStates.Count == SharedList.Count); 1825Debug.Assert(dataGridViewRow.State == SharedRowState(rowIndexInserted)); 1837Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 1872Debug.Assert(includeFilter is DataGridViewElementStates.Displayed 1910Debug.Assert(e.Action != CollectionChangeAction.Remove); 1963Debug.Assert(DataGridView is not null); 2023Debug.Assert(rowCount == 1); 2075Debug.Fail("Unexpected cca value in DataGridViewRowCollection.OnCollectionChanged"); 2093Debug.Assert(DataGridView is not null); 2170Debug.Assert(DataGridView.AllowUserToAddRowsInternal); 2211Debug.Assert(index >= 0 && index < Count); 2212Debug.Assert(DataGridView is not null); 2213Debug.Assert(!DataGridView.NoDimensionChangeAllowed); 2223Debug.Assert(DataGridView is not null); 2242Debug.Assert(dataGridViewRow is not null); 2243Debug.Assert(dataGridViewRow.Index == -1); 2259Debug.Assert(index >= 0); 2260Debug.Assert(index < Count); 2284Debug.Assert(state is DataGridViewElementStates.Displayed 2357Debug.Fail("Unexpected DataGridViewElementStates parameter in DataGridViewRowCollection.SetRowState."); 2451Debug.Assert(rowHeightIncrement != 0); 2464Debug.Assert(rowHeightIncrement != 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowComparer.cs (8)
27Debug.Assert(customComparer is not null); 43Debug.Assert(_dataGridView.AllowUserToAddRowsInternal); 53Debug.Assert(dataGridViewRow is not null); 54Debug.Assert(_sortedColumnIndex >= 0); 132Debug.Assert(value1 is DataGridViewRow); 133Debug.Assert(value2 is DataGridViewRow); 134Debug.Assert(value1 is not null); 135Debug.Assert(value2 is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.RowList.cs (3)
20Debug.Assert(rowComparer is not null); 21Debug.Assert(Count > 0); 62Debug.Assert(i >= left && j <= right, "(i>=left && j<=right) Sort failed - Is your IComparer bogus?");
System\Windows\Forms\Controls\DataGridView\DataGridViewRowErrorTextNeededEventArgs.cs (1)
10Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (19)
106Debug.Assert((!DataGridView.RightToLeftInternal && firstCell) || (DataGridView.RightToLeftInternal && lastCell)); 156Debug.Assert(csv); 236Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 307Debug.Assert(DataGridView is not null); 315Debug.Assert(cellStyle is not null); 319Debug.Assert(rowHeadersStyle is not null); 322Debug.Assert(dataGridViewStyle is not null); 454Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 468Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 521Debug.Assert(OwningRow is not null); 629Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 630Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 631Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 632Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 633Debug.Assert(cellStyle is not null); 687Debug.Assert(ButtonState == ButtonState.Pushed); 840Debug.Assert(valBounds.Width >= 0); 841Debug.Assert(valBounds.Height >= 0); 1028Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.DataGridViewRowHeaderCellAccessibleObject.cs (1)
182Debug.Assert(Owner.DataGridView.TopLeftHeaderCell.AccessibilityObject == Owner.DataGridView.AccessibilityObject.GetChild(0)!.GetChild(0));
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeightInfoNeededEventArgs.cs (4)
57Debug.Assert(rowIndex >= -1); 58Debug.Assert(height > 0); 59Debug.Assert(minimumHeight > 0); 60Debug.Assert(height >= minimumHeight);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeightInfoPushedEventArgs.cs (1)
12Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPostPaintEventArgs.cs (2)
38Debug.Assert(dataGridView is not null); 179Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowPrePaintEventArgs.cs (2)
41Debug.Assert(dataGridView is not null); 196Debug.Assert(graphics is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewSelectedCellCollection.cs (3)
92Debug.Assert(!Contains(dataGridViewCell)); 101Debug.Assert(dataGridViewCells is not null); 104Debug.Assert(!Contains(dataGridViewCell));
System\Windows\Forms\Controls\DataGridView\DataGridViewSortCompareEventArgs.cs (2)
17Debug.Assert(dataGridViewColumn is not null); 18Debug.Assert(dataGridViewColumn.Index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewTextBoxCell.cs (14)
139Debug.Assert(cellStyle.WrapMode != DataGridViewTriState.NotSet); 140Debug.Assert(DataGridView is not null); 310Debug.Assert(textBoundsDebug.Equals(textBounds)); 379Debug.Assert(errorBoundsDebug.Equals(errorBounds)); 507Debug.Assert(DataGridView is not null && 509Debug.Assert(!ReadOnly); 574Debug.Assert(e.ColumnIndex == ColumnIndex); 655Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 656Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 657Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 658Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 659Debug.Assert(cellStyle is not null); 768Debug.Assert(cellEdited || formattedString is null); 769Debug.Assert(paint || computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.cs (9)
77Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 128Debug.Assert(errorBoundsDebug.Equals(errorBounds)); 221Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 222Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 223Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 224Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 225Debug.Assert(cellStyle is not null); 250Debug.Assert(ButtonState == ButtonState.Pushed); 339Debug.Assert(computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewTopLeftHeaderCell.DataGridViewTopLeftHeaderCellAccessibleObject.cs (1)
159Debug.Assert(Owner.DataGridView.RowHeadersVisible, "if the row headers are not visible how did you get the top left header cell acc object?");
System\Windows\Forms\Controls\DataGridView\DataGridViewUtilities.cs (1)
437Debug.Assert(cellStyle.Alignment == DataGridViewContentAlignment.NotSet, "this is the only alignment left");
System\Windows\Forms\Controls\DateTimePicker\DateTimePicker.cs (1)
225Debug.Assert(_calendarFontHandleWrapper is null, "font handle out of sync with Font");
System\Windows\Forms\Controls\GroupBox\GroupBoxRenderer.cs (1)
235Debug.Assert(textBounds.Y <= boxBounds.Y, "if text below box, need to render area of box above text");
System\Windows\Forms\Controls\ImageList\ImageList.cs (10)
352Debug.Assert(HandleCreated, "Calling AddIconToHandle when there is no handle"); 371Debug.Assert(HandleCreated, "Calling AddToHandle when there is no handle"); 401Debug.Assert(_nativeImageList is null, "Handle already created, this may be a source of temporary GDI leaks"); 422Debug.Fail("Unknown color depth in ImageList"); 436Debug.Assert(_originals is not null, "Handle not yet created, yet original images are gone"); 551Debug.Assert(Image.GetPixelFormatSize(sourceData.PixelFormat) == 32); 552Debug.Assert(Image.GetPixelFormatSize(sourceData.PixelFormat) == Image.GetPixelFormatSize(targetData.PixelFormat)); 553Debug.Assert(targetData.Width == sourceData.Width); 554Debug.Assert(targetData.Height == sourceData.Height); 555Debug.Assert(targetData.Stride == targetData.Width * 4);
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (5)
74Debug.Assert(_owner is not null, "ImageCollection has no owner (ImageList)"); 75Debug.Assert((_owner._originals is null) == (_owner.HandleCreated), " Either we should have the original images, or the handle should be created"); 83Debug.Assert(_owner is not null, "ImageCollection has no owner (ImageList)"); 229Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal."); 247Debug.Assert((Count == _imageInfoCollection.Count), "The count of these two collections should be equal.");
System\Windows\Forms\Controls\ImageList\ImageList.NativeImageList.cs (3)
27Debug.Assert(hr.Succeeded); 57Debug.Fail($"{nameof(NativeImageList)} could not be created. Originating stack:\n{_callStack}"); 107Debug.Fail($"{nameof(NativeImageList)} could not be duplicated. Originating stack:\n{_callStack}");
System\Windows\Forms\Controls\ImageList\ImageList.Original.cs (1)
42Debug.Assert(customTransparentColor.Equals(Color.Transparent), "Specified a custom transparent color then told us to ignore it");
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (2)
44Debug.Assert(written == length - HeaderMagic.Length, "RLE compression failure"); 64Debug.Assert(written == length, "RLE decompression failure");
System\Windows\Forms\Controls\Labels\Label.cs (1)
1398Debug.Assert(!AutoSize || (AutoSize && !SelfSizing) || Size == PreferredSize,
System\Windows\Forms\Controls\Labels\Label.LabelImageIndexer.cs (2)
18Debug.Assert(owner is not null, $"{nameof(owner)} should not be null."); 25set { Debug.Assert(false, "Setting the image list in this class is not supported"); }
System\Windows\Forms\Controls\Labels\LinkLabel.cs (10)
496Debug.Assert(text is not null, "string should not be null"); 523Debug.Assert(g is not null); 565Debug.Assert(regionIndex == (textRegions.Length - 1), "Failed to consume all link label visual regions"); 988Debug.Assert(Text.Length == 0); 1028Debug.Assert((_linkFont is null && _hoverLinkFont is null) 1245Debug.Assert(g is not null, "Must pass valid graphics"); 1246Debug.Assert(foreBrush is not null, "Must pass valid foreBrush"); 1247Debug.Assert(linkBrush is not null, "Must pass valid linkBrush"); 1335Debug.Assert(focusRectangle != RectangleF.Empty, "focusRectangle should be initialized"); 1738Debug.Assert(CanUseTextRenderer || base.UseCompatibleTextRendering, "Using GDI text rendering when CanUseTextRenderer reported false.");
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (1)
153Debug.Assert(!isChecked || !isIndeterminate, "Can't be both checked and indeterminate. Somebody broke our state.");
System\Windows\Forms\Controls\ListBoxes\ListBox.AccessibleObject.cs (1)
260Debug.Assert(child is not null, $"GetChild({index}) returned null");
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (9)
1533Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1557Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1577Debug.Assert(actualLength != PInvoke.LB_ERR, "Should have validated the index above"); 1588Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1605Debug.Assert(insertIndex == index, $"NativeListBox inserted at {insertIndex} not the requested index of {index}"); 1614Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created."); 1634Debug.Assert(IsHandleCreated, "Should only call Native methods after the handle has been created"); 1635Debug.Assert(_selectionMode != SelectionMode.None, "Guard against setting selection for None selection mode outside this code."); 1654Debug.Assert(IsHandleCreated, "Should only call native methods if handle is created");
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
47Debug.Assert(id.Length >= 3);
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (2)
120Debug.Assert(index >= 0 && index <= Count, "Wrong index for insert"); 181Debug.Assert(items is not null);
System\Windows\Forms\Controls\ListControl\ListControl.cs (1)
261Debug.Assert(dataManager is not null);
System\Windows\Forms\Controls\ListView\ColumnHeader.ColumnHeaderImageListIndexer.cs (1)
25Debug.Assert(false, "We should never set the image list");
System\Windows\Forms\Controls\ListView\ListView.ColumnHeaderCollection.cs (1)
537Debug.Assert(columnCount >= 1, "Column mismatch");
System\Windows\Forms\Controls\ListView\ListView.cs (52)
851Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 852Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 859Debug.Assert(!value || View == View.SmallIcon, "we need this bit only in SmallIcon view"); 860Debug.Assert(!value || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0"); 1692Debug.Assert(result != 0, "LVM_SETTILEVIEWINFO failed"); 2414Debug.Assert(Columns[i].DisplayIndex > -1 && Columns[i].DisplayIndex < Columns.Count, "display indices out of whack"); 2418Debug.Assert(sumOfDisplayIndices == (colsCount - 1) * colsCount / 2, "display indices out of whack"); 2471Debug.Assert(_listItemSorter is not null, "null sorter!"); 2770Debug.Assert(item is not null, "Item was null in ITEMPREPAINT"); 2935Debug.Fail("Exception occurred attempting to setup custom draw. Disabling custom draw for this control", e.ToString()); 2973Debug.Fail("ListView sunk dispose event from unknown component"); 3103Debug.Assert(fi.Exists, "who deleted our temp file?"); 3128Debug.Assert(fi.Exists, "who deleted our temp file?"); 3268Debug.Assert(false, "these are all the search directions"); 3407Debug.Assert(item._listView == this, "Can't GetDisplayIndex if the list item doesn't belong to us"); 3408Debug.Assert(item._id != -1, "ListViewItem has no ID yet"); 3431Debug.Assert(displayIndex != -1, "This item is in the list view -- why can't we find a display index for it?"); 3438Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 3569Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 3940Debug.Assert(_groups is not null && _groups.Count > 0, "this method should be used only when the user adds a group, not when we add our own DefaultGroup"); 3941Debug.Assert(group != DefaultGroup, "this method should be used only when the user adds a group, not when we add our own DefaultGroup"); 3978Debug.Assert(lvItem.iGroupId != -1, "there is a list view item which is not parented"); 3987Debug.Assert(IsHandleCreated, "InsertGroupNative precondition: list-view handle must be created"); 3988Debug.Assert(group == DefaultGroup || Groups.Contains(group), "Make sure ListView.Groups contains this group before adding the native LVGROUP. Otherwise, custom-drawing may break."); 3991Debug.Assert(result != -1, "Failed to insert group"); 4027Debug.Assert(itemList is not null, "In Begin/EndUpdate with no delayed array!"); 4054Debug.Assert(!_listItemsTable.ContainsKey(itemID), "internal hash table inconsistent -- inserting item, but it's already in the hash table"); 4063Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 4087Debug.Assert(!FlipViewToLargeIconAndSmallIcon, "if we added even 1 item then we should have been done w/ FlipViewToLargeIconAndSmallIcon"); 4102Debug.Assert(IsHandleCreated, "InsertItemsNative precondition: list-view handle must be created"); 4127Debug.Assert(Items.Contains(li), "Make sure ListView.Items contains this item before adding the native LVITEM. Otherwise, custom-drawing may break."); 4148Debug.Assert(result != IntPtr.Zero, "Groups not enabled"); 4150Debug.Assert(result != IntPtr.Zero, $"Doesn't contain group id: {lvItem.iGroupId}"); 4736Debug.Assert(_listViewItems is null, "listItemsArray not null, even though handle created"); 5042Debug.Assert(retval != 0); 5148Debug.Assert(IsHandleCreated, "RemoveGroupNative precondition: list-view handle must be created"); 5245Debug.Assert((mask & ~(LVCOLUMNW_MASK.LVCF_FMT | LVCOLUMNW_MASK.LVCF_TEXT | LVCOLUMNW_MASK.LVCF_IMAGE)) == 0, "Unsupported mask in setColumnInfo"); 5406Debug.Assert(_savedCheckedItems.Contains(item), "somehow we lost track of one item"); 5478Debug.Assert(IsHandleCreated, "How did we add items without a handle?"); 5515Debug.Assert(IsHandleCreated, "SetItemText with no handle"); 5746Debug.Assert(IsHandleCreated, "UpdateGroupNative precondition: list-view handle must be created"); 5749Debug.Assert(result != -1); 5855Debug.Assert(retval != -1, "Error enabling group view"); 5862Debug.Assert(Application.ComCtlSupportsVisualStyles, "this function works only when ComCtl 6.0 and higher is loaded"); 5863Debug.Assert(_viewStyle == View.Tile, "this function should be called only in Tile view"); 5876Debug.Assert(retval != 0, "LVM_SETTILEVIEWINFO failed"); 6091Debug.Fail("Exception occurred attempting to setup header custom draw. Disabling custom draw for the column header", e.ToString()); 6213Debug.Assert(_listViewState[LISTVIEWSTATE_headerControlTracking], "HDN_ENDTRACK and HDN_BEGINTRACK are out of sync."); 6360Debug.Assert(header->iItem == 0, "we only need to compensate for the first column resize"); 6361Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for"); 6475Debug.Assert(_labelEdit is null, 6531Debug.Assert(_labelEdit is not null, "There is no active label edit to end");
System\Windows\Forms\Controls\ListView\ListView.ListViewItemCollection.cs (1)
35Debug.Assert(innerList is not null, "Can't pass in null innerList");
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (15)
91Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 105Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 140Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 192Debug.Assert(!_owner.VirtualMode, "in virtual mode, this method does not make any sense"); 235Debug.Assert(item is not null, $"Failed to get item at index {i}"); 259Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created"); 273Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon, "we only set this when comctl 6.0 is loaded"); 289Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 317Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created"); 342Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 366Debug.Assert(!_owner.VirtualMode, "in virtual mode, this function does not make any sense"); 382Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 405Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item."); 420Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created"); 428Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
System\Windows\Forms\Controls\ListView\ListView.SelectedIndexCollection.cs (3)
76Debug.Assert(_owner._savedSelectedItems is not null || count == 0, "if the count of selectedItems is greater than 0 then the selectedItems should have been saved by now"); 111Debug.Assert(fidx != -1, "Invalid index returned from LVM_GETNEXTITEM"); 118Debug.Assert(_owner._savedSelectedItems is not null, "Null selected items collection");
System\Windows\Forms\Controls\ListView\ListView.SelectedListViewItemCollection.cs (2)
135Debug.Assert(fidx != -1, "Invalid index returned from LVM_GETNEXTITEM"); 142Debug.Assert(_owner._savedSelectedItems is not null, "Null selected items collection");
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
111Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewGroupCollection.cs (1)
267Debug.Assert(_listView.IsHandleCreated, "MoveGroupItems pre-condition: listView handle must be created");
System\Windows\Forms\Controls\ListView\ListViewGroupConverter.cs (1)
96Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\ListView\ListViewGroupImageIndexer.cs (1)
31set => Debug.Fail("We should never set the image list");
System\Windows\Forms\Controls\ListView\ListViewInsertionMark.cs (1)
128Debug.Assert(_listView.IsHandleCreated, "ApplySavedState Precondition: List-view handle must be created");
System\Windows\Forms\Controls\ListView\ListViewItem.cs (10)
455Debug.Assert(_group == value, "BUG: group member variable wasn't updated!"); 997Debug.Assert(_listView is null || !_listView.VirtualMode, "ListViewItem::Host can't be used w/ a virtual item"); 998Debug.Assert(parent is null || !parent.VirtualMode, "ListViewItem::Host can't be used w/ a virtual list"); 1037Debug.Assert(_listView is not null, "This method is used only when items are parented in a list view"); 1038Debug.Assert(!_listView.VirtualMode, "we need to update the group only when the user specifies the list view items in localizable forms"); 1063Debug.Assert(_listView!.IsHandleCreated, "Should only invoke UpdateStateToListView when handle is created."); 1100Debug.Assert(!updateOwner || result != 0, "Groups not enabled"); 1102Debug.Assert(!updateOwner || result != 0, $"Doesn't contain group id: {lvItem.iGroupId}"); 1297Debug.Assert(listView is not null && listView.VirtualMode, "ListViewItem::SetItemIndex should be used only when the list is virtual"); 1298Debug.Assert(index > -1, "can't set the index on a virtual list view item to -1");
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemBaseAccessibleObject.cs (1)
208Debug.Assert(id.Length >= 2);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewItemImageAccessibleObject.cs (1)
46Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.cs (3)
114Debug.Assert(style is not null, "Should have checked CustomStyle"); 123Debug.Assert(style is not null, "Should have checked CustomStyle"); 132Debug.Assert(style is not null, "Should have checked CustomStyle");
System\Windows\Forms\Controls\ListView\ListViewItem.ListViewSubItem.ListViewSubItemAccessibleObject.cs (1)
109Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\ListView\ListViewItemConverter.cs (8)
56Debug.Assert(ctor is not null, "Expected the constructor to exist."); 64Debug.Assert(ctor is not null, "Expected the constructor to exist."); 92Debug.Assert(ctor is not null, "Expected the constructor to exist."); 112Debug.Assert(ctor is not null, "Expected the constructor to exist."); 128Debug.Assert(ctor is not null, "Expected the constructor to exist."); 142Debug.Assert(ctor is not null, "Expected the constructor to exist."); 152Debug.Assert(ctor is not null, "Expected the constructor to exist."); 165Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\ListView\ListViewItemImageIndexer.cs (1)
30set => Debug.Fail("We should never set the image list");
System\Windows\Forms\Controls\ListView\ListViewSubItemConverter.cs (2)
43Debug.Assert(ctor is not null, "Expected the constructor to exist."); 56Debug.Assert(ctor is not null, "Expected the constructor to exist.");
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarAccessibleObject.cs (1)
42Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarBodyAccessibleObject.cs (2)
50Debug.Assert(OsVersion.IsWindows8OrGreater()); 172Debug.Fail($"{nameof(row.WeekNumberCellAccessibleObject)} must not be null if ShowWeekNumbers is true in the Month view!");
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarRowAccessibleObject.cs (1)
94Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.cs (5)
863Debug.Assert(result != 0, "MCM_GETTODAY failed"); 1807Debug.Assert(_mcCurView == MONTH_CALDENDAR_MESSAGES_VIEW.MCMV_MONTH, "This logic should work only in the Month view."); 1871Debug.Assert(lower.Ticks <= upper.Ticks, "lower must be less than upper"); 2109Debug.Fail($"NotifyWinEvent failed: {ex.Message}"); 2130Debug.Assert(_mcCurView == nmmcvm->dwOldView, "Calendar view mode is out of sync with native control");
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
80Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\PictureBox\PictureBox.cs (1)
373Debug.Fail($"Unsupported PictureBoxSizeMode value: {mode}");
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (17)
245Debug.Fail(ex.ToString()); 1176Debug.Assert(_selectedTab is not null, "Invalid tab selection!"); 1511Debug.Assert(_tabs[i] is not null, "Null item in tab array!"); 1598Debug.Fail("Bad tab. We're going to remove it.", e.ToString()); 1692Debug.Fail($"{nameof(CreatePropertyTab)} failed. {exception.Message}"); 1729Debug.Fail($"Failed to create {nameof(PropertyTab)}. {exception.Message}"); 1848Debug.Assert( 2080Debug.Fail("Bad Tab. Disable for now.", e.ToString()); 2158Debug.Fail($"Failed to add a large property grid toolstrip button, {ex}"); 3552Debug.Fail("Bad Tab. It's going away.", e.ToString()); 3593Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!"); 3608Debug.Assert(_tabs.Count > 0, "Tab array destroyed!"); 3688Debug.Assert(oldObject is not null && newObject is not null && oldObject.GetType() == newObject.GetType()); 3746Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!"); 3750Debug.Fail("Failed to find the tab!"); 3836Debug.Assert(view < _viewSortButtons.Length, "Can't select view type > 1"); 3976Debug.Fail(ex.ToString());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\ArrayElementGridEntry.cs (2)
30Debug.Assert(owner is Array, "Owner is not array type!"); 36Debug.Assert(owner is Array, "Owner is not array type!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\AttributeTypeSorter.cs (1)
37Debug.Fail($"Attribute '{attribute.GetType().FullName}' does not have a typeid.");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\DetailsButton.DetailsButtonAccessibleObject.cs (1)
22Debug.Assert(_ownerItem is not null, "AccessibleObject owner cannot be null");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (10)
76Debug.Assert(OwnerGrid is not null, "GridEntry w/o PropertyGrid owner, text rendering will fail."); 181Debug.Assert(value is null || !Disposed, "Why are we putting new children in after we are disposed?"); 681Debug.Assert(value != this, "how can we be our own parent?"); 917Debug.Assert(!Disposed, "Why are we creating children after we are disposed?"); 1271Debug.Assert(ownerTab is not null, "No current tab!"); 1371Debug.Assert(!s_pbrsAssertPropsSwitch.Enabled, $"Bad property '{PropertyLabel}.{property.Name}': {w}"); 1400Debug.Fail($"Failed to get properties: {e.GetType().Name},{e.Message}\n{e.StackTrace}"); 1444Debug.Fail($"Bad Type Converter! {t.GetType().Name}, {t.Message},{converter}", t.ToString()); 1977Debug.Assert(gridHost is not null, "No prop entry host!"); 2212Debug.Assert(o is not null, "Collection contains a null element.");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.GridEntryAccessibleObject.cs (2)
22Debug.Assert(owner is not null, "GridEntryAccessibleObject must have a valid owner GridEntry"); 97Debug.Assert(Parent is not null, "GridEntry AO does not have a parent AO");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridToolTip.cs (1)
134Debug.Fail($"TTM_ADDTOOL failed for {control.GetType().Name}");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MergePropertyDescriptor.cs (5)
86Debug.Assert(component is Array, "MergePropertyDescriptor::CanResetValue called with non-array value"); 196Debug.Assert(component is Array, "MergePropertyDescriptor::GetValue called with non-array value"); 266Debug.Assert(component is Array, "MergePropertyDescriptor::ResetValue called with non-array value"); 307Debug.Assert(component is Array, "MergePropertyDescriptor::SetValue called with non-array value"); 325Debug.Assert(component is Array, "MergePropertyDescriptor::ShouldSerializeValue called with non-array value");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\MultiPropertyDescriptorGridEntry.cs (3)
147Debug.Fail(e.Message); 308Debug.Assert(PropertyDescriptor is MergePropertyDescriptor, "Did not get a MergePropertyDescriptor!!!"); 309Debug.Assert(owner is object[], "Did not get an array of objects!!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyDescriptorGridEntry.PropertyDescriptorGridEntryAccessibleObject.cs (5)
27Debug.Assert(index >= 0); 163Debug.Assert(child is not null); 238Debug.Assert(child is not null); 243Debug.Assert(index <= lastChildIndex); 251Debug.Assert(child is not null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.cs (18)
901Debug.Assert(control is not null, "Null control passed to CommonEditorUse"); 973Debug.Fail(e.ToString()); 1159Debug.Fail(ex.ToString()); 1204Debug.Fail(ex.ToString()); 1710Debug.Fail(ex.ToString()); 1776Debug.Fail(e.ToString()); 1885Debug.Fail("We have a bad client width!"); 3167Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too small"); 3168Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA, "cumulativeVerticalWheelDelta is too big"); 3210Debug.Assert(_scrollBar is not null); 3375Debug.Fail(ex.Message); 3402Debug.Fail(ex.Message); 3443Debug.Assert(gridEntry.Expandable, "non-expandable IPE firing outline click"); 3560Debug.Assert(parentIndex != -1, "parent GridEntry not found in allGridEntries"); 3589Debug.Assert(childCount == e.NewChildCount, $"parent reports {childCount} new children, event reports {e.NewChildCount}"); 4650Debug.Fail("Committing with no selected row!"); 4762Debug.Fail("Committing with no selected row!"); 5366Debug.Assert(_editTextBox is not null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.DropDownHolder.cs (1)
335Debug.Assert(editor is not null, "How do we have a link without the InstanceCreationEditor?");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.MouseHook.cs (2)
101Debug.Assert(!_mouseHookHandle.IsNull, "Failed to install mouse hook"); 168Debug.Assert(_thisProcessId != 0, "Didn't get our process id!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\PropertyGridView.PropertyGridViewAccessibleObject.cs (2)
269Debug.Fail(ex.ToString()); 300Debug.Fail(ex.ToString());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\SingleSelectRootGridEntry.cs (1)
35Debug.Assert(target is not null, "Can't browse a null object!");
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStrip.PropertyGridToolStripAccessibleObject.cs (1)
75Debug.Assert(target is not null);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (7)
274Debug.Assert(versionInfo is not null && !string.IsNullOrEmpty(versionInfo.ProductVersion), "Couldn't get the version info for the richedit dll"); 1677Debug.Assert(cb % 2 == 0, "EditStreamProc call out of cycle. Expected to always get character boundary calls"); 1773Debug.Fail("Failed to edit proc operation.", e.ToString()); 2941Debug.Assert(data is not null, "StreamIn passed a null stream"); 3119Debug.Assert(IsHandleCreated); 3275Debug.Assert((c.cpMax - c.cpMin) > 0, "CHARRANGE was null or negative - can't do it!"); 3291Debug.Assert(len != 0, "CHARRANGE from RichTextBox was bad! - impossible?");
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (1)
51Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\TabControl\TabControl.cs (1)
1800Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\TabControl\TabPage.cs (2)
669Debug.Assert(_externalToolTip == toolTip, "RemoveToolTip should remove a toolTip that was set."); 681Debug.Fail("RemoveToolTip should remove a toolTip that was set.");
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (25)
146Debug.Assert(maskedTextProvider is not null, "Initializing from a null MaskProvider ref."); 572Debug.Fail("Invalid InsertKeyMode. This code path should have never been executed."); 1086Debug.Fail("Could not get IME input context."); 1223Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1499Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1500Debug.Assert(keyCode is Keys.Delete or Keys.Back, $"Delete called with keyCode == {keyCode}"); 1501Debug.Assert(startPosition >= 0 && ((startPosition + selectionLen) <= _maskedTextProvider.Length), "Invalid position range."); 1694Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 1772Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2058Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2158Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2159Debug.Assert(text is not null, "text is null."); 2277Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2381Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2492Debug.Assert(newProvider is not null, "Initializing from a null MaskProvider ref."); 2541Debug.Assert(srcPos != MaskedTextProvider.InvalidIndex, "InvalidIndex unexpected at this time."); 2696Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2715Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2753Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2759Debug.Assert(ImeMode == ImeMode.Disable, "IME enabled when in RO or Pwd mode."); 2802Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2859Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 2876Debug.Fail(ex.ToString()); 2997Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided."); 3016Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (3)
1172Debug.Assert(end <= len, 2262Debug.Assert(IsHandleCreated, "Don't call this method until the handle is created."); 2592Debug.Assert(result != 0);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (5)
88Debug.Fail("Text edit control cannot have a child element."); 417Debug.Fail("SetSelection start is out of text range."); 423Debug.Fail("SetSelection end is out of text range."); 437Debug.Assert(Owner.IsHandleCreated); 453Debug.Assert(Owner.IsHandleCreated);
System\Windows\Forms\Controls\ToolStrips\ToolStrip.ToolStripAccessibleObject.cs (1)
96Debug.Fail("No item matched the index??");
System\Windows\Forms\Controls\ToolStrips\ToolStripComboBox.ToolStripComboBoxControl.ToolStripComboBoxFlatComboAdapter.cs (1)
24Debug.Assert(comboBox is ToolStripComboBoxControl, "Why are we here and not a toolstrip combo?");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.cs (5)
687Debug.Fail("You can't set this except on ToolStripDropDownMenu"); 1740Debug.Assert(reason != ToolStripDropDownCloseReason.ItemClicked, 1884Debug.Assert(_countDropDownItemsAssignedTo > 0, "dropdown assignment underflow"); 1916Debug.Fail($"Why are we being activated when we're not visible? Deactivating thing is {WindowsFormsUtils.GetControlInformation((HWND)(nint)m.LParamInternal)}"); 2029Debug.Assert(start is not null, "Who is passing null to GetFirstDropDown?");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.ToolStripDropDownAccessibleObject.cs (1)
55Debug.Assert(owner is not null);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownButton.cs (2)
141Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 155Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItem.cs (1)
662Debug.Fail("Why are we here");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownItemAccessibleObject.cs (1)
189Debug.Fail("No item matched the index?");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDownMenu.cs (3)
732Debug.Fail("Why wasn't 'UpdateScrollButtonStatus called'? We don't have the item to scroll by"); 743Debug.Fail("We're trying to scroll up, but the top item is displayed!!!"); 758Debug.Fail("We're trying to scroll down, but the last item is displayed!!!");
System\Windows\Forms\Controls\ToolStrips\ToolStripDropTargetManager.cs (1)
152Debug.Assert(false, "Why is lastDropTarget null?");
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (6)
2099Debug.Assert(Owner.Items.Contains(this), "How can there be a owner and not be in the collection?"); 2320Debug.Assert(false, "Invalid event type."); 2589Debug.Assert(deltaTicks >= 0, "why are delta ticks less than zero? that's some mighty fast clicking"); 3486Debug.Assert((toPointType == ToolStripPointType.ToolStripCoords), "why are we here! - investigate"); 3577Debug.Assert(i < count, "Item has a parent set but the parent doesn't own the item"); 3598Debug.Assert(ParentInternal is not null, "Tool Strip Item Parent is null");
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemAccessibleObject.cs (1)
343Debug.Fail("No item matched the index?");
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.ToolStripItemImageIndexer.cs (2)
14Debug.Assert(item is not null, $"{nameof(item)} should not be null."); 21set => Debug.Assert(false, "We should never set the image list");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.cs (5)
186Debug.Fail("passed in bogus toolstrip, why?"); 215Debug.Assert(toolStrip is not null, "passed in bogus toolstrip, why?"); 216Debug.Assert(start is not null, "passed in bogus start, why?"); 325Debug.Assert(start is not null, "why is null passed here?"); 955Debug.Fail("why are we passing null to GetMainMenuStrip?");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (1)
128Debug.Assert(!InMenuMode, "How did we get here if we're already in menu mode?");
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.HostedWindowsFormsMessageHook.cs (2)
32Debug.Assert( 77Debug.Assert(_messageHookHandle != IntPtr.Zero, "Failed to install mouse hook");
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.cs (6)
587Debug.Fail("why were we called to fetch native menu item info with nothing assigned?"); 607Debug.Fail("why were we called to fetch native menu item info with nothing assigned?"); 659Debug.Fail("Why were we called to fetch native menu item info with nothing assigned?"); 874Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 882Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 897Debug.Assert(ParentInternal is not null, "Why is parent null");
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (1)
126Debug.Assert(image is not null);
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.cs (5)
774Debug.Fail("Move called on immovable object."); 1060Debug.Fail($"ToolStripPanelRow has not been assigned! Should be set to {i}."); 1064Debug.Fail($"Detected orphan cell! {cell.Control.Name} is in row {goodRowIndex}. It shouldn't have a cell in {i}! \r\n\r\nTurn on DEBUG_PAINT in ToolStripPanel and ToolStripPanelRow to investigate."); 1070Debug.Fail("why do we have a cell with a null control in this row?"); 1104Debug.Fail($@"OVERLAP detection:
System\Windows\Forms\Controls\ToolStrips\ToolStripPanel.FeedbackRectangle.FeedbackDropDown.cs (1)
64Debug.Fail("Somehow we've gotten ourself in a situation where we're pumping an unreasonable number of paint messages, investigate.");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelCell.cs (1)
68Debug.Assert(_cachedBounds.X >= 0 && _cachedBounds.Y >= 0, "cached bounds are outside of the client area, investigate");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.cs (1)
257Debug.Write(_thisRowID.ToString(CultureInfo.CurrentCulture));
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.HorizontalRowManager.cs (2)
301Debug.Assert(cell is not null, "Don't expect cell to be null here, what's going on?"); 529Debug.Assert(ctg.ToolStripPanelRow == Row, "we should now be in the new panel row.");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowControlCollection.ToolStripPanelCellToControlEnumerator.cs (1)
29Debug.Assert(cell is not null, $"Expected ToolStripPanel cells only!!!{_arrayListEnumerator.Current.GetType()}");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.ToolStripPanelRowManager.cs (2)
120Debug.Fail("why was a negative number given to growControlsAfter?"); 152Debug.Fail("why was a negative number given to growControlsAfter?");
System\Windows\Forms\Controls\ToolStrips\ToolStripPanelRow.VerticalRowManager.cs (1)
539Debug.Assert(ctg.ToolStripPanelRow == Row, "we should now be in the new panel row.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.cs (1)
223Debug.Assert(!itemLocationHash.ContainsKey(item.Name), "WARNING: ToolStripItem name not unique.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSettingsManager.SettingsStub.cs (1)
38Debug.Assert(!string.IsNullOrEmpty(ToolStripPanelName), "ToolStrip was parented to a panel, but we couldn't figure out its name.");
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitButton.cs (3)
427Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 454Debug.Assert(ParentInternal is not null, "Parent is null here, not going to get accurate ID"); 477Debug.Assert(deltaTicks >= 0, "why are deltaticks less than zero? thats some mighty fast clicking");
System\Windows\Forms\Controls\ToolStrips\ToolStripSplitStackDragDropHandler.cs (1)
229Debug.Fail("Could not calculate the relative position for AllowItemReorder");
System\Windows\Forms\Controls\ToolStrips\ToolStripSystemDarkModeRenderer.cs (1)
564Debug.Assert(e.Item is not null, "The ToolStripItem should not be null on rendering the Arrow.");
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (5)
736Debug.Assert(_minimum <= _maximum, "Minimum should be <= Maximum"); 799Debug.Assert((bool)(BOOL)lresult); 861Debug.Assert(_autoDrawTicks == ShouldAutoDrawTicks()); 936Debug.Assert(_cumulativeWheelData > -PInvoke.WHEEL_DELTA, "cumulativeWheelData is too small"); 937Debug.Assert(_cumulativeWheelData < PInvoke.WHEEL_DELTA, "cumulativeWheelData is too big");
System\Windows\Forms\Controls\TreeView\ArraySubsetEnumerator.cs (2)
16Debug.Assert(count == 0 || array is not null, "if array is null, count should be 0"); 17Debug.Assert(array is null || count <= array.Length, "Trying to enumerate more than the array contains");
System\Windows\Forms\Controls\TreeView\TreeNode.cs (7)
338Debug.Assert( 1226Debug.Assert(min != -1, "Bad sorting"); 1260Debug.Assert(min != -1, "Bad sorting"); 1600Debug.Assert(num > 0, "required capacity can not be less than 1"); 2022Debug.Assert(tv.IsHandleCreated, "nonexistent handle"); 2098Debug.Assert(_parent is not null, "toggle on virtual root"); 2131Debug.Assert(tv is not null, "TreeNode has handle but no TreeView");
System\Windows\Forms\Controls\TreeView\TreeNode.TreeNodeImageIndexer.cs (2)
18Debug.Assert(node is not null, $"{nameof(node)} should not be null."); 43set { Debug.Assert(false, "We should never set the image list"); }
System\Windows\Forms\Controls\TreeView\TreeNodeCollection.cs (1)
333Debug.Assert(delta == 0, "delta should be 0");
System\Windows\Forms\Controls\TreeView\TreeView.cs (6)
1237Debug.Assert(_selectedNode is null || _selectedNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1439Debug.Assert(_topNode is null || _topNode.TreeView != this, "handle is created, but we're still caching selectedNode"); 1922Debug.Assert(_internalStateImageList is not null, "Why are changing images when the Imagelist is null?"); 2772Debug.Assert(_labelEdit is null, 2921Debug.Assert(nmtvcd->nmcd.dwItemSpec != 0, "Invalid node handle in ITEMPREPAINT"); 3016Debug.Assert(nmtvcd->nmcd.dwItemSpec != 0, "Invalid node handle in ITEMPOSTPAINT");
System\Windows\Forms\Controls\UpDown\DomainUpDown.cs (4)
383Debug.Assert(_domainItems is not null, "Domain values array is null"); 384Debug.Assert(index < _domainItems.Count && index >= -1, "SelectValue: index out of range"); 403Debug.Assert(_domainIndex >= 0 || UserEdit, $"UserEdit should be true when domainIndex < 0 {UserEdit}"); 420Debug.Assert(_sorted, "Sorted == false");
System\Windows\Forms\Controls\UpDown\NumericUpDown.cs (8)
186Debug.Assert(_maximum == value, "Maximum != what we just set it to!"); 213Debug.Assert(_minimum.Equals(value), "Minimum != what we just set it to!"); 360Debug.Assert(_minimum <= _maximum, 531Debug.Assert(UserEdit, "ParseEditText() - UserEdit == false"); 708Debug.Assert(text == text.ToUpper(CultureInfo.InvariantCulture), "GetPreferredSize assumes hex digits to be uppercase."); 746Debug.Assert(_minimum <= _currentValue && _currentValue <= _maximum, 750Debug.Assert(!ChangingText, "ChangingText should have been set to false"); 861Debug.Assert(largestDigit != -1 && digitWidth != -1, "Failed to find largest digit.");
System\Windows\Forms\Controls\UpDown\UpDownBase.cs (3)
740Debug.Assert(!UserEdit, "OnTextBoxTextChanged() - UserEdit == true"); 833Debug.Assert(_wheelDelta > -PInvoke.WHEEL_DELTA, "wheelDelta is too small"); 834Debug.Assert(_wheelDelta < PInvoke.WHEEL_DELTA, "wheelDelta is too big");
System\Windows\Forms\Controls\UpDown\UpDownBase.UpDownButtons.cs (3)
175Debug.Assert( 243Debug.Assert( 262Debug.Assert(
System\Windows\Forms\Controls\WebBrowser\HtmlDocument.cs (1)
38Debug.Assert(NativeHtmlDocument2 is not null, "The document should implement IHtmlDocument2");
System\Windows\Forms\Controls\WebBrowser\HtmlElement.cs (1)
52Debug.Assert(NativeHtmlElement is not null, "The element object should implement IHTMLElement");
System\Windows\Forms\Controls\WebBrowser\HtmlElementCollection.cs (1)
34Debug.Assert(NativeHtmlElementCollection is not null, "The element collection object should implement IHTMLElementCollection");
System\Windows\Forms\Controls\WebBrowser\HtmlElementEventArgs.cs (1)
16Debug.Assert(NativeHTMLEventObj is not null, "The event object should implement IHTMLEventObj");
System\Windows\Forms\Controls\WebBrowser\HtmlHistory.cs (1)
17Debug.Assert(NativeOmHistory is not null, "The history object should implement IOmHistory");
System\Windows\Forms\Controls\WebBrowser\HtmlShimManager.cs (2)
148Debug.Assert(addedShim is not null, "Why are we calling this with a null shim?"); 165Debug.Assert(unloadedWindow is not null, "Why are we calling this with a null window?");
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.cs (1)
32Debug.Assert(NativeHtmlWindow is not null, "The window object should implement IHTMLWindow2");
System\Windows\Forms\Controls\WebBrowser\HtmlWindow.HtmlWindowShim.cs (1)
52Debug.Assert(result, "failed to add event");
System\Windows\Forms\Controls\WebBrowser\HtmlWindowCollection.cs (1)
26Debug.Assert(NativeHTMLFramesCollection2 is not null, "The window collection object should implement IHTMLFramesCollection2");
System\Windows\Forms\Controls\WebBrowser\WebBrowser.cs (3)
268Debug.Assert(psi is not null, "Object isn't an IPersistStreamInit!"); 356Debug.Assert(!htmlDocument2.IsNull, "The HtmlDocument object must implement IHTMLDocument2."); 381Debug.Assert(!htmlDocument2.IsNull, "The HtmlDocument object must implement IHTMLDocument2.");
System\Windows\Forms\Controls\WebBrowser\WebBrowser.WebBrowserEvent.cs (7)
47Debug.Assert(_parent is not null, "Parent should have been set"); 51Debug.Assert(urlObject is null or string, "invalid url type"); 52Debug.Assert(targetFrameName is null or string, "invalid targetFrameName type"); 53Debug.Assert(headers is null or string, "invalid headers type"); 76Debug.Assert(urlObject is null or string, "invalid url"); 84Debug.Assert(psi is not null, "The Document does not implement IPersistStreamInit"); 114Debug.Assert(urlObject is null or string, "invalid url type");
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (25)
351Debug.Fail($"error in processMnemonic: {ex}"); 600Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition"); 604Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition"); 608Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition"); 612Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Failed transition"); 615Debug.Fail("bad state"); 641Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition"); 645Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition"); 649Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition"); 653Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Failed transition"); 656Debug.Fail("bad state"); 674Debug.Assert(hr.Succeeded, $"DoVerb call failed for verb 0x{verb}"); 829Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Wrong start state to transition from"); 833Debug.Assert(_activeXInstance is null, "activeXInstance must be null"); 846Debug.Assert(_activeXInstance is not null, "w/o an exception being thrown we must have an object..."); 858Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from"); 887Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from"); 912Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from"); 931Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from"); 953Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from"); 974Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from"); 994Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Wrong start state to transition from"); 998Debug.Assert(hr.Succeeded, "Failed to UIDeactivate"); 1010Debug.Assert(_activeXInstance is not null, "The native control is null"); 1170Debug.Assert(!result.Failed, $"{result}");
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (7)
50Debug.Assert(_parent is not null); 116Debug.Fail($"Control {_controlInEditMode} did not reset its edit mode to null."); 193Debug.Assert(rval is null || _associatedContainer is null || rval == _associatedContainer, 224Debug.Assert(_parent.Site is null, "Parent is sited but we could not find IContainer!!!"); 371Debug.Assert(_siteUIActive is null, "Object did not call OnUIDeactivate"); 385Debug.Assert(_siteUIActive == site, "deactivating when not active..."); 407Debug.Assert(_controlInEditMode is null || _controlInEditMode == ctl, "who is exiting edit mode?");
System\Windows\Forms\Controls\WebBrowser\WebBrowserHelper.cs (1)
98Debug.Assert(selectionService is not null, "service must implement ISelectionService");
System\Windows\Forms\Controls\WebBrowser\WebBrowserSiteBase.cs (2)
139Debug.Assert(!Host.GetAXHostState(WebBrowserHelper.s_siteProcessedInputKey), "Re-entering IOleControlSite.TranslateAccelerator!!!"); 342Debug.Fail(t.ToString());
System\Windows\Forms\DataBinding\Binding.BindToObject.cs (5)
26Debug.Assert(_owner.DataSource is not null, "how can we determine if DataSource is initialized or not if we have no data source?"); 54Debug.Assert(owner is not null); 61Debug.Assert(sender == _owner.DataSource, "data source should not change"); 62Debug.Assert(_owner.DataSource is ISupportInitializeNotification, "data source should not change on the BindToObject"); 63Debug.Assert(_waitingOnDataSource);
System\Windows\Forms\DataBinding\Binding.cs (3)
195Debug.Assert(sender == BindableComponent, "which other control can send us the Load event?"); 469Debug.Assert(sender == _bindingManagerBase, "we should only receive notification from our binding manager base"); 673Debug.Assert(type is not null);
System\Windows\Forms\DataBinding\BindingContext.cs (2)
292Debug.Assert(newBindingContext is not null, "Always called with a non-null BindingContext"); 293Debug.Assert(propBinding is not null, "Always called with a non-null Binding.");
System\Windows\Forms\DataBinding\BindingSource.cs (7)
560Debug.Assert(sender == _currencyManager, "only receive notifications from the currency manager"); 758Debug.Assert(index >= 0, "BindingSource.ListItem_PropertyChanged - no current item."); 759Debug.Assert(index == ((IList)this).IndexOf(sender), "BindingSource.ListItem_PropertyChanged - unexpected current item."); 1148Debug.Fail("BindingSource.SetList() was called with illegal <null> list argument!"); 1233Debug.Assert(_currentItemHookedForItemChange is null, "BindingSource trying to hook new current item before unhooking old current item!"); 1263Debug.Assert(cm is not null); 1274Debug.Assert(cm is not null);
System\Windows\Forms\DataBinding\Command.cs (3)
37Debug.Assert(s_cmds.Length > 0, "why is cmds.Length zero?"); 38Debug.Assert(s_icmdTry >= 0, "why is icmdTry negative?"); 103Debug.Assert(cmd._id is >= IdMin and < IdLim, "generated command id out of range");
System\Windows\Forms\DataBinding\ControlBindingsCollection.cs (1)
191Debug.Assert(!string.IsNullOrEmpty(binding.PropertyName), "The caller should check for this.");
System\Windows\Forms\DataBinding\CurrencyManager.cs (2)
622Debug.Assert(_lastGoodKnownRow == -1 || _lastGoodKnownRow == listposition, "if we have a valid lastGoodKnownRow, then it should equal the position in the list"); 819Debug.Assert(_lastGoodKnownRow == -1 || listposition == _lastGoodKnownRow, "how did they get out of sync?");
System\Windows\Forms\DataBinding\ListBindingConverter.cs (1)
154Debug.Assert(ctor is not null, "Failed to find Binding ctor for types!");
System\Windows\Forms\DataBinding\ListBindingHelper.cs (1)
448Debug.Assert(listAccessors is not null);
System\Windows\Forms\DataBinding\ListManagerBindingsCollection.cs (1)
22Debug.Assert(bindingManagerBase is not null, "How could a ListManagerBindingsCollection not have a BindingManagerBase associated with it!");
System\Windows\Forms\DataBinding\RelatedCurrencyManager.cs (1)
29Debug.Assert(parentManager is not null, "How could this be a null parentManager.");
System\Windows\Forms\DataBinding\RelatedPropertyManager.cs (1)
24Debug.Assert(parentManager is not null, "How could this be a null parentManager.");
System\Windows\Forms\Design\ComponentEditorForm.ComponentEditorPageSite.cs (1)
42Debug.Fail(e.ToString());
System\Windows\Forms\Design\ComponentEditorForm.cs (2)
383Debug.Assert((newPage >= 0) && (newPage < _pageSites.Length), 470Debug.Assert(_activePage != -1);
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (3)
55Debug.Assert(_hbrushDither.IsNull, "Brush should not be recreated."); 70Debug.Assert( 78Debug.Assert(
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.cs (2)
632Debug.Assert(!extensions[j].StartsWith('.'), 634Debug.Assert(currentExtension.Length == 0 || currentExtension[0] == '.',
System\Windows\Forms\Dialogs\CommonDialogs\FileDialog.Vista.cs (1)
106Debug.Assert((UnexpectedOptions & _fileNameFlags) == 0, "Unexpected FileDialog options");
System\Windows\Forms\Dialogs\CommonDialogs\FontDialog.cs (1)
408Debug.Assert(cf.nSizeMin <= cf.nSizeMax, "min and max font sizes are the wrong way around");
System\Windows\Forms\Dialogs\CommonDialogs\OpenFileDialog.cs (1)
174Debug.Assert(hr.Succeeded);
System\Windows\Forms\Dialogs\CommonDialogs\SaveFileDialog.cs (1)
172Debug.Assert(hr.Succeeded);
System\Windows\Forms\Dialogs\CommonDialogs\SpecialFolderEnumConverter.cs (1)
40Debug.Assert(currentItem is not null);
System\Windows\Forms\Dialogs\MessageBox.cs (1)
81Debug.Fail("Why are we being called when there's nothing to pop?");
System\Windows\Forms\Dialogs\TaskDialog\TaskDialog.cs (5)
650Debug.Assert(_handle == IntPtr.Zero); 914Debug.Assert(_boundPage is not null); 970Debug.Assert(!_raisedPageCreated); 1167Debug.Assert(linkHref is not null); 1517Debug.Assert(currentPtr == (long)ptrTaskDialogConfig + sizeToAllocate);
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogProgressBar.cs (1)
343Debug.Assert(BoundPage is not null);
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.ControlItemAccessibleObject.cs (1)
132Debug.Assert(id.Length >= 3);
System\Windows\Forms\ErrorProvider\ErrorProvider.ControlItem.cs (1)
192Debug.Fail("Unknown ErrorIconAlignment value");
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (4)
440Debug.Assert(sender == _errorManager, "who else can send us messages?"); 638Debug.Assert(dsInit is not null, "ErrorProvider: ISupportInitializeNotification.Initialized event received, but current DataSource does not support ISupportInitializeNotification!"); 639Debug.Assert(dsInit.IsInitialized, "ErrorProvider: DataSource sent ISupportInitializeNotification.Initialized event but before it had finished initializing."); 783Debug.Assert(_errorCount >= 0, "Error count should not be less than zero");
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (2)
217Debug.Assert(_timer is not null); 243Debug.Assert(shownTooltips <= 1);
System\Windows\Forms\Form.cs (36)
183Debug.Assert(_formState[s_formStateAllowTransparency] == 0, "Failed to set formState[FormStateAllowTransparency]"); 184Debug.Assert(_formState[s_formStateBorderStyle] == (int)FormBorderStyle.Sizable, "Failed to set formState[FormStateBorderStyle]"); 185Debug.Assert(_formState[s_formStateTaskBar] == 1, "Failed to set formState[FormStateTaskBar]"); 186Debug.Assert(_formState[s_formStateControlBox] == 1, "Failed to set formState[FormStateControlBox]"); 187Debug.Assert(_formState[s_formStateKeyPreview] == 0, "Failed to set formState[FormStateKeyPreview]"); 188Debug.Assert(_formState[s_formStateLayered] == 0, "Failed to set formState[FormStateLayered]"); 189Debug.Assert(_formState[s_formStateMaximizeBox] == 1, "Failed to set formState[FormStateMaximizeBox]"); 190Debug.Assert(_formState[s_formStateMinimizeBox] == 1, "Failed to set formState[FormStateMinimizeBox]"); 191Debug.Assert(_formState[s_formStateHelpButton] == 0, "Failed to set formState[FormStateHelpButton]"); 192Debug.Assert(_formState[s_formStateStartPos] == (int)FormStartPosition.WindowsDefaultLocation, "Failed to set formState[FormStateStartPos]"); 193Debug.Assert(_formState[s_formStateWindowState] == (int)FormWindowState.Normal, "Failed to set formState[FormStateWindowState]"); 194Debug.Assert(_formState[s_formStateShowWindowOnCreate] == 0, "Failed to set formState[FormStateShowWindowOnCreate]"); 195Debug.Assert(_formState[s_formStateAutoScaling] == 1, "Failed to set formState[FormStateAutoScaling]"); 196Debug.Assert(_formState[s_formStateSetClientSize] == 0, "Failed to set formState[FormStateSetClientSize]"); 197Debug.Assert(_formState[s_formStateTopMost] == 0, "Failed to set formState[FormStateTopMost]"); 198Debug.Assert(_formState[s_formStateSWCalled] == 0, "Failed to set formState[FormStateSWCalled]"); 199Debug.Assert(_formState[s_formStateMdiChildMax] == 0, "Failed to set formState[FormStateMdiChildMax]"); 200Debug.Assert(_formState[s_formStateRenderSizeGrip] == 0, "Failed to set formState[FormStateRenderSizeGrip]"); 201Debug.Assert(_formState[s_formStateSizeGripStyle] == 0, "Failed to set formState[FormStateSizeGripStyle]"); 202Debug.Assert(_formState[s_formStateIsWindowActivated] == 0, "Failed to set formState[FormStateIsWindowActivated]"); 203Debug.Assert(_formState[s_formStateIsTextEmpty] == 0, "Failed to set formState[FormStateIsTextEmpty]"); 204Debug.Assert(_formState[s_formStateIsActive] == 0, "Failed to set formState[FormStateIsActive]"); 205Debug.Assert(_formState[s_formStateIconSet] == 0, "Failed to set formState[FormStateIconSet]"); 461Debug.Assert(!DesignMode, "Form designer should not allow base size set in design mode."); 510Debug.Assert(AutoSize == value, "Error detected setting Form.AutoSize."); 1104Debug.Assert(_ctlClient is null, "why isn't ctlClient null"); 1110Debug.Assert(_ctlClient is not null, "why is ctlClient null"); 3761Debug.Assert(IsHandleCreated, "Attempt to set focus to a form that has not yet created its handle."); 4610Debug.WriteLine($"AutoScaleFactor computed for new DPI = {autoScaleFactor.Width} - {autoScaleFactor.Height}"); 4923Debug.Assert(result); 4967Debug.Assert(result); 6102Debug.Assert(containerControl is not null); 6195Debug.Assert(IsMdiContainer, "Not an MDI container!"); 6355Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count, "Calling RevertMerge modified the mdiwindowlistitem"); 6955Debug.Assert(Properties.ContainsKey(s_propFormMdiParent), "how is formMdiParent null?"); 6956Debug.Assert(IsHandleCreated, "how is handle 0?");
System\Windows\Forms\Form.EnumThreadWindowsCallback.cs (1)
45Debug.Assert(oldValue == (nint)_formHandle.Value);
System\Windows\Forms\Help\Help.cs (1)
176Debug.Fail($"Cannot handle HTML parameter of type: {htmlParam!.GetType()}");
System\Windows\Forms\Input\Cursor.cs (1)
401Debug.Assert(stream is not null, "Stream should be validated before this method is called.");
System\Windows\Forms\Input\CursorConverter.cs (1)
168Debug.Assert(prop.GetValue(null, tempIndex) is not null, $"Property {prop.Name} returned NULL");
System\Windows\Forms\Input\InputLanguage.cs (1)
158Debug.Assert(subKeyName.Length == 8, $"unexpected key length in registry: {subKey.Name}");
System\Windows\Forms\Input\InputLanguageCollection.cs (2)
19Debug.Assert(value is not null); 20Debug.Assert(Array.IndexOf(value, null!) == -1, "Should not contain null");
System\Windows\Forms\Internal\ItemArray.cs (1)
71Debug.Assert(s_lastMask > mask, "We have overflowed our state mask.");
System\Windows\Forms\Internal\WinFormsUtils.cs (1)
320Debug.Assert(component is not null, "component passed here cannot be null");
System\Windows\Forms\Layout\ArrangedElement.cs (2)
74Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting margin negative?"); 86Debug.Assert((value.Right >= 0 && value.Left >= 0 && value.Top >= 0 && value.Bottom >= 0), "who's setting padding negative?");
System\Windows\Forms\Layout\CommonProperties.cs (28)
167Debug.Assert(value != GetAutoSize(element), "PERF: Caller should guard against setting AutoSize to original value."); 178Debug.Assert(GetAutoSize(element) == value, "Error detected setting AutoSize."); 186Debug.Assert(value != GetMargin(element), "PERF: Caller should guard against setting Margin to original value."); 190Debug.Assert(GetMargin(element) == value, "Error detected setting Margin."); 200Debug.Assert(value != GetMaximumSize(element, new Size(-7109, -7107)), 214Debug.Assert(GetMaximumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MaximumSize."); 222Debug.Assert(value != GetMinimumSize(element, new Size(-7109, -7107)), 236Debug.Assert(GetMinimumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MinimumSize."); 250Debug.Assert(value != GetPadding(element, new Padding(-7105)), 256Debug.Assert(GetPadding(element, new Padding(-7105)) == value, "Error detected setting Padding."); 348Debug.Assert(xGetPreferredSizeCache(element) == Size.Empty, "Error detected in xClearPreferredSizeCache."); 390Debug.Assert( 394Debug.Assert(xGetPreferredSizeCache(element) == value, "Error detected in xGetPreferredSizeCache."); 423Debug.Assert( 441Debug.Assert( 458Debug.Assert(((xGetDock(element) != DockStyle.None) && element.ParticipatesInLayout) == result, 519Debug.Assert(value != GetSelfAutoSizeInDefaultLayout(element), "PERF: Caller should guard against setting AutoSize to original value."); 525Debug.Assert(GetSelfAutoSizeInDefaultLayout(element) == value, "Error detected setting AutoSize."); 541Debug.Assert(mode == DockAnchorMode.Anchor || value == DefaultAnchor, "xGetAnchor needs to return DefaultAnchor when docked."); 559Debug.Assert(result == (GetAutoSize(element) && xGetDock(element) == DockStyle.None), 578Debug.Assert(mode == DockAnchorMode.Dock || value == DefaultDock, 589Debug.Assert(value != xGetAnchor(element), "PERF: Caller should guard against setting Anchor to original value."); 599Debug.Assert(GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Anchor, 608Debug.Assert(value != xGetDock(element), "PERF: Caller should guard against setting Dock to original value."); 618Debug.Assert(xGetDock(element) == value, "Error detected setting Dock."); 619Debug.Assert((GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Dock) 652Debug.Assert(value != GetFlowBreak(element), "PERF: Caller should guard against setting FlowBreak to original value."); 660Debug.Assert(GetFlowBreak(element) == value, "Error detected setting SetFlowBreak.");
System\Windows\Forms\Layout\Containers\ContainerControl.cs (5)
467Debug.Assert(control is not null); 535Debug.Assert(value is null || (value.ParentInternal is not null && this == value.ParentInternal.GetContainerControl())); 622Debug.WriteLineIf(_activeControl is not null 1277Debug.Assert(count <= 999, "Infinite loop trying to find controls which can ProcessMnemonic()!!!"); 1661Debug.Assert(_activeControl is null || _activeControl.ParentInternal.GetContainerControl() == this);
System\Windows\Forms\Layout\Containers\SplitContainer.cs (2)
930Debug.Assert(Enabled, "SplitContainer.OnKeyDown should not be called if the button is disabled"); 1571Debug.Fail($"{nameof(RepaintSplitterRect)} failed with hr={ex.ErrorCode}, message={ex}");
System\Windows\Forms\Layout\DefaultLayout.cs (21)
83Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.Width), 100Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || newBounds.Contains(oldBounds), "How did we resize in such a way we no longer contain our old bounds?"); 137Debug.Assert((growthDirection & GrowthDirection.Left) == GrowthDirection.None 140Debug.Assert((growthDirection & GrowthDirection.Upward) == GrowthDirection.None 175Debug.WriteLineIf(width < 0 || height < 0, $"\t\t'{element}' destination bounds resulted in negative"); 373Debug.Assert(GetAnchorInfo(element) is not null, "AnchorInfo should be initialized before LayoutAnchorControls()."); 380Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list."); 395Debug.Assert(element.Bounds == GetCachedBounds(element), "Why do we have cachedBounds for a docked element?"); 456Debug.Assert(mdiClient is null, "How did we end up with multiple MdiClients?"); 469Debug.Fail("Unsupported value for dock."); 532Debug.Assert( 553Debug.Assert((measureOnly && (newSize.Width >= remainingSize.Width)) || (newSize.Width == remainingSize.Width), 570Debug.Assert((measureOnly && (newSize.Height >= remainingSize.Height)) || (newSize.Height == remainingSize.Height), 590Debug.Assert(desiredSize.Width >= 0 && desiredSize.Height >= 0, "Error detected in xGetDockSize: Element size was negative."); 716Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list."); 840Debug.Assert(AppContextSwitches.AnchorLayoutV2, $"AnchorLayoutV2 should be called only when {AppContextSwitches.AnchorLayoutV2SwitchName} is enabled."); 942Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list."); 977Debug.Assert(GetDock(element) == value, "Error setting Dock value."); 1059Debug.Assert(element.Container == container, "We have non-children in our containers cached bounds store."); 1100Debug.Assert(specified == BoundsSpecified.None || GetCachedBounds(element) == element.Bounds, 1112Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list.");
System\Windows\Forms\Layout\FlowLayout.cs (17)
81Debug.Assert(wrapContents || breakIndex == container.Children.Count, 128Debug.Assert(dummy == endIndex, "EndIndex / BreakIndex mismatch."); 165Debug.Assert(startIndex < endIndex, "Loop should be in forward Z-order."); 289Debug.Assert(GetWrapContents(container) == value, "GetWrapContents should return the same value as we set"); 301Debug.Assert(GetFlowDirection(container) == value, "GetFlowDirection should return the same value as we set"); 322Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y); 323Debug.Assert(container.Children[0].Bounds.X == margin.Left + container.DisplayRectangle.X); 326Debug.Assert(container.Children[0].Bounds.X == container.DisplayRectangle.X + container.DisplayRectangle.Width - container.Children[0].Bounds.Width - margin.Right); 327Debug.Assert(container.Children[0].Bounds.Y == margin.Top + container.DisplayRectangle.Y); 330Debug.Assert(container.Children[0].Bounds.Y == container.DisplayRectangle.Y + container.DisplayRectangle.Height - container.Children[0].Bounds.Height - margin.Bottom); 331Debug.Assert(container.Children[0].Bounds.X == margin.Left + container.DisplayRectangle.X); 343Debug.Assert(collection[i].Bounds.Y >= container.DisplayRectangle.Y); 344Debug.Assert(collection[i].Bounds.X >= container.DisplayRectangle.X); 347Debug.Assert(collection[i].Bounds.Y >= container.DisplayRectangle.Y); 348Debug.Assert(collection[i].Bounds.X + collection[i].Bounds.Width <= container.DisplayRectangle.X + container.DisplayRectangle.Width); 351Debug.Assert(collection[i].Bounds.Y + collection[i].Bounds.Height <= container.DisplayRectangle.Y + container.DisplayRectangle.Height); 352Debug.Assert(collection[i].Bounds.X >= container.DisplayRectangle.X);
System\Windows\Forms\Layout\FlowLayout.ElementProxy.cs (1)
63Debug.Assert(Element == value, "Element should be the same as we set it to");
System\Windows\Forms\Layout\LayoutTransaction.cs (2)
64Debug.Assert(_controlToLayout is null || _controlToLayout.LayoutSuspendCount == _layoutSuspendCount, "Suspend/Resume layout mismatch!"); 96Debug.Assert(elementCausingLayout is not null, "LayoutTransaction.DoLayout - elementCausingLayout is null, no layout performed - did you mix up your parameters?");
System\Windows\Forms\Layout\LayoutUtils.cs (24)
89Debug.Assert((topBits != 0 && (middleBits == 0 && bottomBits == 0)) 99Debug.Assert(result is >= 0x00 and <= 0x0A, "ContentAlignmentToIndex result out of range."); 100Debug.Assert(result != 0x00 || alignment == ContentAlignment.TopLeft, "Error detected in ContentAlignmentToIndex."); 101Debug.Assert(result != 0x01 || alignment == ContentAlignment.TopCenter, "Error detected in ContentAlignmentToIndex."); 102Debug.Assert(result != 0x02 || alignment == ContentAlignment.TopRight, "Error detected in ContentAlignmentToIndex."); 103Debug.Assert(result != 0x03, "Error detected in ContentAlignmentToIndex."); 104Debug.Assert(result != 0x04 || alignment == ContentAlignment.MiddleLeft, "Error detected in ContentAlignmentToIndex."); 105Debug.Assert(result != 0x05 || alignment == ContentAlignment.MiddleCenter, "Error detected in ContentAlignmentToIndex."); 106Debug.Assert(result != 0x06 || alignment == ContentAlignment.MiddleRight, "Error detected in ContentAlignmentToIndex."); 107Debug.Assert(result != 0x07, "Error detected in ContentAlignmentToIndex."); 108Debug.Assert(result != 0x08 || alignment == ContentAlignment.BottomLeft, "Error detected in ContentAlignmentToIndex."); 109Debug.Assert(result != 0x09 || alignment == ContentAlignment.BottomCenter, "Error detected in ContentAlignmentToIndex."); 110Debug.Assert(result != 0x0A || alignment == ContentAlignment.BottomRight, "Error detected in ContentAlignmentToIndex."); 118Debug.Assert(threeBitFlag is >= 0x00 and <= 0x04 and not 0x03, "threeBitFlag out of range."); 120Debug.Assert((result & 0x03) == result, "Result out of range."); 478Debug.Assert(align != ContentAlignment.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter."); 529Debug.Fail("Unsupported value for region1Align."); 533Debug.Assert(Rectangle.Union(region1, region2) == bounds, 543Debug.Assert(region1.Right == region2.Left, "Adjacency error."); 548Debug.Assert(region2.Right == region1.Left, "Adjacency error."); 553Debug.Assert(region1.Bottom == region2.Top, "Adjacency error."); 558Debug.Assert(region2.Bottom == region1.Top, "Adjacency error."); 563Debug.Fail("Unsupported value for region1Align."); 567Debug.Assert(Rectangle.Union(region1, region2) == bounds, "region1 and region2 do not add up to bounds.");
System\Windows\Forms\Layout\TableLayout.ContainerInfo.cs (6)
83Debug.Assert(_cols.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 97Debug.Assert(_rows.Length != value.Length, "PERF: should not allocate strips, we've already got an array"); 144Debug.Assert(ChildInfoValid, "Fetching invalid information"); 154Debug.Assert(ChildInfoValid, "Fetching invalid information"); 164Debug.Assert(ChildInfoValid, "Fetching invalid information"); 294Debug.Assert(ChildInfoValid, "Fetched invalid information");
System\Windows\Forms\Layout\TableLayout.cs (21)
320Debug.Assert(maxColumns > 0, "maxColumn must be positive"); 450Debug.Assert(numRows <= maxRows, "number of rows allocated shouldn't exceed max number of rows"); 451Debug.Assert(numColumns <= maxColumns, "number of columns allocated shouldn't exceed max number of columns"); 512Debug.Assert(fixedLayoutInfo.IsAbsolutelyPositioned, "should only check for those elements which are absolutely positioned"); 1036Debug.Assert((strip.MinSize == style.Size), "absolutely sized strip's size should be set before we call ApplyStyles"); 1169Debug.Assert((dontHonorConstraint || (usedSpace == SumStrips(strips, 0, strips.Length))), "Error computing usedSpace."); 1201Debug.Assert(currentRow <= layoutInfo.RowStart, "RowStart should increase in forward Z-order."); 1214Debug.Assert(currentCol <= layoutInfo.ColumnStart, "ColumnStart should increase in forward Z-order."); 1364Debug.Assert(GetLayoutInfo(element) == value, "GetLayoutInfo should return the same value as we set it to"); 1428Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length, 1430Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length, 1435Debug.Assert(layoutInfo.Equals(oldLayoutInfo[layoutInfo.Element]), 1481Debug.Assert(!cellsOccupied1.IntersectsWith(cellsOccupied2), "controls overlap in the same cell"); 1486Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo1.ColumnSpan, "length of column style too short"); 1487Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo2.ColumnSpan, "length of column style too short"); 1490Debug.Assert(containerInfo.ColumnStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized"); 1495Debug.Assert(containerInfo.ColumnStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized"); 1503Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo1.RowStart + layoutInfo1.RowSpan, "length of row style too short"); 1504Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo2.RowStart + layoutInfo2.RowSpan, "length of row style too short"); 1507Debug.Assert(containerInfo.RowStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized"); 1512Debug.Assert(containerInfo.RowStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized");
System\Windows\Forms\Layout\TableLayout.ReservationGrid.cs (2)
33Debug.Assert(!IsReserved(column, rowOffset), "we should not be reserving already reserved space."); 50Debug.Assert(IsReserved(column, rowOffset), "IsReserved/Reserved mismatch.");
System\Windows\Forms\MDI\MDIClient.cs (1)
251Debug.Assert(result);
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
97Debug.Assert(Items.Count <= 4, "Too many items in the MDIControlStrip. How did we get into this situation?");
System\Windows\Forms\MDI\MDIWindowDialog.cs (1)
35Debug.Assert(item is not null, "No item selected!");
System\Windows\Forms\NativeWindow.cs (10)
238Debug.Assert(!handle.IsNull, "Should never insert a zero handle into the hash"); 258Debug.Assert( 299Debug.Assert(!hwnd.IsNull); 304Debug.Assert(_priorWindowProcHandle is not null); 315Debug.Assert(_priorWindowProcHandle != _windowProcHandle, "Uh oh! Subclassed ourselves!!!"); 466Debug.WriteLineIf( 484Debug.Assert(DpiAwarenessContext.IsEquivalent(controlHandleDpiContext), 503Debug.Fail($"Can't find a default window procedure for message {m} on class {GetType().Name}"); 609Debug.Assert(DefaultWindowProc != IntPtr.Zero, "We have active windows but no user window proc?"); 704Debug.Assert(!hwnd.IsNull);
System\Windows\Forms\NativeWindow.WindowClass.cs (3)
44Debug.Assert(!hwnd.IsNull, "Windows called us with an HWND of 0"); 49Debug.Assert(_targetWindow is not null); 109Debug.Assert(string.Equals(
System\Windows\Forms\NotifyIcon.NotifyIconNativeWindow.cs (1)
65Debug.Assert(_reference is not null, "NotifyIcon was garbage collected while it was still visible. How did we let that happen?");
System\Windows\Forms\OLE\Clipboard.cs (1)
63Debug.Assert(dataObject is null);
System\Windows\Forms\OLE\DropTarget.cs (1)
108Debug.Assert(pDataObj is not null, "OleDragEnter didn't give us a valid data object.");
System\Windows\Forms\OLE\WinFormsOleServices.cs (1)
100Debug.WriteLineIf(result == HRESULT.CLIPBRD_E_BAD_DATA, "CLIPBRD_E_BAD_DATA returned when trying to get clipboard data.");
System\Windows\Forms\OLE\WrappingDataObject.cs (1)
16Debug.Assert(data is not DataObject);
System\Windows\Forms\OwnerDrawPropertyBag.cs (1)
53Debug.Assert(Font is not null);
System\Windows\Forms\Panels\FlowLayoutPanel.cs (2)
35Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it"); 49Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
System\Windows\Forms\Panels\FlowLayoutSettings.cs (2)
28Debug.Assert(FlowDirection == value, "FlowDirection should be the same as we set it"); 41Debug.Assert(WrapContents == value, "WrapContents should be the same as we set it");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutPanel.cs (7)
69Debug.Assert(BorderStyle == value, "BorderStyle should be the same as we set it"); 91Debug.Assert(CellBorderStyle == value, "CellBorderStyle should be the same as we set it"); 117Debug.Assert(ColumnCount == value, "ColumnCount should be the same as we set it"); 190Debug.Assert(GetColumnSpan(control) == value, "GetColumnSpan should be the same as we set it"); 203Debug.Assert(GetRowSpan(control) == value, "GetRowSpan should be the same as we set it"); 218Debug.Assert(GetRow(control) == row, "GetRow should be the same as we set it"); 246Debug.Assert(GetColumn(control) == column, "GetColumn should be the same as we set it");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutSettings.cs (7)
78Debug.Assert(CellBorderStyle == value, "CellBorderStyle should be the same as we set"); 107Debug.Assert(ColumnCount == value, "the max columns should equal to the value we set it to"); 133Debug.Assert(RowCount == value, "the max rows should equal to the value we set it to"); 268Debug.Assert(GetColumnSpan(element) == value, "column span should equal to the value we set"); 306Debug.Assert(GetRowSpan(element) == value, "row span should equal to the value we set"); 447Debug.Assert(!colSpecified || GetColumn(element) == column, "column position should equal to what we set"); 448Debug.Assert(!rowSpecified || GetRow(element) == row, "row position should equal to what we set");
System\Windows\Forms\Panels\TableLayoutPanel\TableLayoutStyle.cs (1)
74Debug.Assert(size >= 0);
System\Windows\Forms\Printing\PrintDialog.cs (3)
260Debug.Assert(dialogSettings->hDevMode.IsNull && dialogSettings->hDevNames.IsNull); 305Debug.Fail($"PrintDlg returned non zero error code: {extendedResult}"); 374Debug.Assert(dialogSettings.hDevMode.IsNull && dialogSettings.hDevNames.IsNull);
System\Windows\Forms\Printing\PrintPreviewControl.cs (2)
475Debug.Assert(_pageInfo is not null, "Must call ComputePreview first"); 526Debug.Assert(_pageInfo is not null, $"{nameof(PreviewPrintController)} did not give us preview info.");
System\Windows\Forms\PropertyStore.cs (1)
220Debug.Assert(sizeof(T) > 8);
System\Windows\Forms\Rendering\ControlPaint.cs (6)
297Debug.Assert(data.Scan0 != 0, "BitmapData.Scan0 is null; check marshalling"); 388Debug.Fail("border style has no corresponding dash style"); 434Debug.Fail("Unsupported border style."); 1130Debug.Assert(style == ButtonBorderStyle.Outset, "Caller should have known how to use us."); 2505Debug.Assert(replaceBlack.A == 255); 2506Debug.Assert(replaceWhite.A == 255);
System\Windows\Forms\Rendering\DCMapping.cs (6)
42Debug.Assert(success, "GetViewportOrgEx() failed."); 51Debug.Assert(!clippingRegion.IsNull, "CreateRectRgn() failed."); 63Debug.Assert(success, "SetViewportOrgEx() failed."); 71Debug.Assert( 85Debug.Assert( 98Debug.Assert(
System\Windows\Forms\Rendering\DpiChangedEventArgs.cs (1)
21Debug.Assert((short)m.WParamInternal.HIWORD == DeviceDpiNew, "Non-square pixels!");
System\Windows\Forms\Rendering\DrawingEventArgs.cs (4)
55Debug.Assert(type is OBJ_TYPE.OBJ_DC 99Debug.Assert(!_hdc.IsNull); 161Debug.Assert(offset.IsEmpty, "transform has been modified"); 162Debug.Assert(isInfinite, "clipping as been applied");
System\Windows\Forms\Rendering\FontCache.Data.cs (3)
41Debug.Assert(PInvoke.GetMapMode(hdc) == HDC_MAP_MODE.MM_TEXT); 78Debug.Assert(font.SizeInPoints > 0.0f, "size has a negative value."); 120Debug.Assert(!hfont.IsNull);
System\Windows\Forms\Rendering\GdiCache.cs (1)
93Debug.Assert(font is not null);
System\Windows\Forms\Rendering\PaintEventArgs.cs (1)
116Debug.Fail("Called ResetGraphics more than once?");
System\Windows\Forms\Rendering\ScreenDcCache.cs (8)
34Debug.Assert(cacheSpace >= 0); 103Debug.Assert(PInvoke.GetClipRgn(hdc, hrgn) == 0, "Should not have a clipping region"); 108Debug.Assert(point.IsEmpty, "Viewport origin shouldn't be shifted"); 109Debug.Assert(PInvoke.GetMapMode(hdc) == HDC_MAP_MODE.MM_TEXT); 110Debug.Assert(PInvoke.GetROP2(hdc) == R2_MODE.R2_COPYPEN); 111Debug.Assert(PInvoke.GetBkMode(hdc) == BACKGROUND_MODE.OPAQUE); 114Debug.Assert(PInvokeCore.GetWorldTransform(hdc, (XFORM*)(void*)&matrix)); 115Debug.Assert(matrix.IsIdentity);
System\Windows\Forms\Rendering\TextExtensions.cs (1)
21Debug.Assert(((uint)flags & GdiUnsupportedFlagMask) == 0,
System\Windows\Forms\Rendering\TextRenderer.cs (2)
635Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.Clipping) 640Debug.Assert(apply.HasFlag(ApplyGraphicsProperties.TranslateTransform)
System\Windows\Forms\Scrolling\ScrollableControl.cs (1)
785Debug.Assert(IsHandleCreated, "Handle is not created");
System\Windows\Forms\SendKeys\SendKeys.SendKeysHookProc.cs (1)
53Debug.Assert(
System\Windows\Forms\SystemVisualSettingsTracker.cs (1)
164Debug.Fail($"Unable to query the Windows accent color: {ex.Message}");
System\Windows\Forms\Timer.cs (4)
230Debug.Assert(!HWND.IsNull, "Could not create timer HWND."); 325Debug.Assert(_timerID == 0, "Destroying handle with timerID still set."); 338Debug.Assert(_timerID == 0, "Destroying handle with timerID still set."); 344Debug.Assert(m.HWND == HWND && !HWND.IsNull, "Timer getting messages for other windows?");
System\Windows\Forms\ToolTip\ToolTip.cs (1)
1735Debug.Fail("The passed in control is disposed.");
System\Windows\Forms\WinCategoryAttribute.cs (1)
35Debug.Assert(localizedValue is not null, $"All Windows Forms category attributes should have localized strings. Category '{value}' not found.");
System\Windows\Forms\WindowsFormsSynchronizationContext.cs (2)
31Debug.Assert(_controlToSendTo.IsHandleCreated, "Marshaling control should have created its handle in its ctor."); 38Debug.Assert(
System\Windows\Forms\WindowSubclassHandler.cs (2)
110Debug.Assert(_originalWindowProc != _windowProcDelegatePtr); 271Debug.Assert(hWnd == _handle);
System.Windows.Forms.Design (566)
System\ComponentModel\Design\BinaryEditor.cs (3)
66Debug.Fail($"No conversion from {value?.GetType().FullName ?? "null"} to byte[]"); 91Debug.Fail($"No conversion from byte[] to {value?.GetType().FullName ?? "null"}"); 134Debug.Fail("Unable to get IHelpService.");
System\ComponentModel\Design\ByteViewer.cs (3)
128Debug.Assert(success && charCount == 8); 185Debug.Assert(charsBuffer.Length >= lineBuffer.Length); 207Debug.Assert(charsBuffer.Length >= lineBuffer.Length * 3 + 1);
System\ComponentModel\Design\CollectionEditor.CollectionEditorCollectionForm.cs (2)
947Debug.Assert(_suspendEnabledCount >= 0, "Mismatch suspend/resume enabled"); 1142Debug.Assert(collection.Count > 0, "We should only be wrapped if there is a selection");
System\ComponentModel\Design\CollectionEditor.cs (2)
353Debug.Assert(Context is not null); 366Debug.Assert(Context is not null);
System\ComponentModel\Design\ComponentDesigner.cs (2)
364Debug.Assert( 503Debug.Assert(Component.Site is not null);
System\ComponentModel\Design\DesignerActionPanel.cs (4)
342Debug.Assert(false); // should never get here 433Debug.Assert(TopLevelControl is Form, "DesignerActionPanel must be hosted on a Form."); 605Debug.Assert(relatedComponent is not null); 877Debug.Assert(newLine.GetType() == newLineInfo.LineType);
System\ComponentModel\Design\DesignerActionPanel.MethodLine.cs (1)
57Debug.Assert(!ActionPanel.InMethodInvoke, "Nested method invocation");
System\ComponentModel\Design\DesignerActionPanel.PanelHeaderLine.cs (1)
51Debug.Fail("Should never try to focus a PanelHeaderLine");
System\ComponentModel\Design\DesignerActionPanel.SeparatorLine.cs (1)
22public sealed override void Focus() => Debug.Fail("Should never try to focus a SeparatorLine");
System\ComponentModel\Design\DesignerActionPanel.TextLine.cs (1)
35Debug.Fail("Should never try to focus a TextLine");
System\ComponentModel\Design\DesignerActionUI.cs (7)
60Debug.Fail("Either BehaviorService or ISelectionService is null, cannot continue."); 336Debug.Assert(behaviorWithPanelToRegen.RelatedComponent is not null, "could not find related component for this refresh"); 417Debug.Fail("related object is not an IComponent, something is wrong here..."); 431Debug.Fail("How can we add a DesignerAction glyphs when it's related object is not an IComponent?"); 600Debug.Assert(_lastPanelComponent is not null, "last panel component should not be null here... " + 627Debug.Assert(_designerActionKeyboardBehavior is not null, $"why is {nameof(_designerActionKeyboardBehavior)} null?"); 629Debug.Assert(popBehavior is DesignerActionKeyboardBehavior, "behavior returned is of the wrong kind?");
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (1)
138Debug.Assert(relatedGlyph is not null, "related glyph cannot be null");
System\ComponentModel\Design\DesignerActionUIService.cs (1)
23Debug.Assert(_designerActionService is not null, "we should have created and registered the DAService first");
System\ComponentModel\Design\DesignerEventService.cs (4)
44Debug.Assert(host is not null, "Design surface did not provide us with a designer host"); 119Debug.Assert(surface is not null, "DesignerApplication should not pass null here"); 121Debug.Assert(host is not null, "Design surface did not provide us with a designer host"); 147Debug.Assert(host is not null, "Design surface removed host too early in dispose");
System\ComponentModel\Design\DesignerHost.cs (5)
96Debug.Fail("DesignerHost: Ctor needs a service provider that provides IServiceContainer"); 372Debug.Assert(component is not null, "Caller should have guarded against a null component"); 465Debug.Fail("DesignerHost: Ctor needs a service provider that provides IServiceContainer"); 779Debug.Fail("There are open transactions at unload"); 1106Debug.Fail($"Exception thrown on LoadComplete event handler. You should not throw here : {ex}");
System\ComponentModel\Design\DesignerHost.Site.cs (2)
39Debug.Assert(nc is not null, "We failed to resolve a nested container."); 41Debug.Assert(sc is not null, "We failed to resolve a service container from the nested container.");
System\ComponentModel\Design\DesignSurface.cs (1)
429Debug.Assert(serviceType == typeof(IReferenceService), $"Demand created service not supported: {serviceType.Name}");
System\ComponentModel\Design\DesignSurfaceManager.cs (5)
300Debug.Fail($"Demand created service not supported: {serviceType.Name}"); 310Debug.Assert(_activeDesignSurfaceChanged is not null, "Should have detached this event handler."); 326Debug.Assert(_designSurfaceCreated is not null, "Should have detached this event handler."); 344Debug.Assert(_designSurfaceDisposed is not null, "Should have detached this event handler."); 362Debug.Assert(_selectionChanged is not null, "Should have detached this event handler.");
System\ComponentModel\Design\EventBindingService.cs (1)
241Debug.Assert(_showCodeComponent is null && _showCodeEventDescriptor is null && _showCodeMethodName is null, "show code already pending");
System\ComponentModel\Design\InheritanceService.cs (8)
98Debug.Assert(!field.IsStatic, "Instance binding shouldn't have found this field"); 116Debug.Assert(fieldAttrs.Length == 1, "Non-inheritable attribute has more than one copy"); 117Debug.Assert(fieldAttrs[0] is AccessedThroughPropertyAttribute, "Reflection bug: GetCustomAttributes(type) didn't discriminate by type"); 122Debug.Assert(fieldProp is not null, "Field declared with AccessedThroughPropertyAttribute has no associated property"); 123Debug.Assert(fieldProp.PropertyType == field.FieldType, "Field declared with AccessedThroughPropertyAttribute is associated with a property with a different return type."); 134Debug.Assert(member is not null, "GetGetMethod for property didn't return a method, but CanRead is true"); 150Debug.Assert(value is IComponent, "Value of inherited field is not IComponent. How did this value get into the datatype?"); 242Debug.Fail("Unknown member type passed to IgnoreInheritedMember");
System\ComponentModel\Design\InheritedPropertyDescriptor.cs (2)
25Debug.Assert(propertyDescriptor is not InheritedPropertyDescriptor, $"Recursive inheritance propertyDescriptor {propertyDescriptor}"); 126Debug.Assert(value is not InheritedPropertyDescriptor, $"Recursive inheritance propertyDescriptor {_propertyDescriptor}");
System\ComponentModel\Design\MultilineStringEditor.MultilineStringEditorUI.cs (2)
117Debug.Assert( 345Debug.Assert(index != -1, "We should have found a Ctrl+Enter in the string");
System\ComponentModel\Design\MultilineStringEditor.OleCallback.cs (2)
43Debug.Assert(hr.Succeeded); 119Debug.Assert(success);
System\ComponentModel\Design\ReferenceService.cs (9)
70Debug.Assert(cs is not null, "Reference service relies on IComponentChangeService"); 80Debug.Fail("Reference service cannot operate without IContainer"); 317Debug.Assert(trailingName is not null, "Expected a trailing name"); 318Debug.Assert(reference is not null, "Expected a reference"); 319Debug.Assert(sitedComponent is not null, "Expected a sited component"); 320Debug.Assert(sitedComponent.Site is not null, $"Sited component is not really sited: {sitedComponent}"); 321Debug.Assert(TypeDescriptor.GetComponentName(sitedComponent) is not null, $"Sited component has no name: {sitedComponent}"); 350Debug.Assert(SitedComponent.Site is not null, $"Sited component is not really sited: {SitedComponent}"); 351Debug.Assert(siteName is not null, $"Sited component has no name: {SitedComponent}");
System\ComponentModel\Design\SelectionService.cs (1)
215Debug.Assert(_selection is not null, "Should be impossible to update the help context before configuring the selection hash");
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (3)
295Debug.Assert(host is not null, "designer loader was asked to flush after it has been disposed."); 734Debug.Assert(mgr is not null && thisSurface is not null); 853Debug.Assert(lastError is not null, "Someone embedded a null in the error collection");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.ComponentListCodeDomSerializer.cs (6)
59Debug.Fail($"No case for {data.GetType().Name}"); 213Debug.Assert(curIndex > 0, "ResolvedNestedName accepts only nested names!"); 264Debug.Fail($"Unable to resolve nested component: {name}"); 396Debug.Fail($"No statements or instance for name and no lone expressions: {name}"); 439Debug.Assert(state is MemberAttributes, "Attempting to deserialize a null modifier"); 621Debug.Assert(prop.GetValue(data._value) is null, "ShouldSerializeValue and GetValue are differing");
System\ComponentModel\Design\Serialization\CodeDomComponentSerializationService.CodeDomSerializationStore.cs (2)
161Debug.Assert(_resourceStream is null, "Attempting to close a serialization store with already serialized resources"); 264Debug.Assert(instance is not null, $"Failed to deserialize object {name}");
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.cs (9)
149Debug.WriteLine(line); 190Debug.Assert(manager is not null, "Should pass a serialization manager into EnsureDocument"); 195Debug.Assert(_documentType is null && _documentNamespace is null, "We have no compile unit but we still have a type or namespace. Our state is inconsistent."); 739Debug.Fail("Called to create unknown service."); 792Debug.Assert(_rootSerializer is not null || _typeSerializer is not null, $"What are we saving right now? Base component has no serializer: {LoaderHost.RootComponent.GetType().FullName}"); 797Debug.Assert(typeDeclaration is not null, "Root CodeDom serializer must return a CodeTypeDeclaration"); 825Debug.Assert(_documentType is not null, "EnsureDocument didn't create a document type"); 826Debug.Assert(_documentNamespace is not null, "EnsureDocument didn't create a document namespace"); 827Debug.Assert(_rootSerializer is not null || _typeSerializer is not null, "EnsureDocument didn't create a root serializer");
System\ComponentModel\Design\Serialization\CodeDomDesignerLoader.ModifiersInheritedExtenderProvider.cs (1)
78Debug.Assert(baseComponent is not null, "Root component was null");
System\ComponentModel\Design\Serialization\CodeDomSerializer.cs (4)
86Debug.Fail("CodeDomSerializer::Deserialize requires a CodeExpression, CodeStatement or CodeStatementCollection to parse"); 217Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 279Debug.Assert(manager.Context.Current == abs, "Serializer added a context it didn't remove."); 361Debug.Assert(false, e.Message);
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (33)
145Debug.Fail("GetReflectionTypeFromTypeHelper does not accept null arguments."); 195Debug.Fail("GetReflectionTypeHelper does not accept null arguments."); 214Debug.Fail("GetPropertiesHelper does not accept null arguments."); 246Debug.Fail("GetEventsHelper does not accept null arguments."); 278Debug.Fail("GetAttributesHelper does not accept null arguments."); 300Debug.Fail("GetAttributesFromTypeHelper does not accept null arguments."); 360Debug.Assert(resourceName is not null, "non-string keys in dictionary entry"); 465Debug.Assert(manager.Context.Current == statement, "Someone corrupted the context stack"); 994Debug.Assert(o is IConvertible, $"Array size expression could not be resolved to IConvertible: {(o.GetType().Name)}"); 1165Debug.Fail($"Unrecognized expression type: {result.GetType().Name}"); 1181Debug.Assert(targetObject is not null, "Failed to get target object for event attach"); 1182Debug.Assert(eventName is not null, "Failed to get eventName for event attach"); 1202Debug.Fail("Encountered delegate object create with more or less than 1 parameter?"); 1278Debug.Fail($"Unsupported binary operator type: {op}"); 1325Debug.Fail("Could not convert left or right side to binary-compatible value."); 1460Debug.Fail("Should never get here!"); 1477Debug.Fail("Addition operator not supported for this type"); 1482Debug.Fail("Math operators are not supported"); 1693Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?"); 1952Debug.Assert(argumentValues is not null && parameters is not null, "These should have been allocated when the argument array was created."); 1973Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 2012Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments"); 2018Debug.Assert(arguments.Length == 0, "Field serialization does not support arguments"); 2025Debug.Fail($"Unrecognized reflection type in instance descriptor: {descriptor.MemberInfo.GetType().Name}"); 2118Debug.Assert(manager.Context.Current == descriptor, "Context stack corrupted."); 2159Debug.Assert(manager.Context.Current == inheritance, "Somebody messed up our context stack."); 2227Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 2235Debug.Assert(manager.Context.Current == statements, "Context stack corrupted."); 2263Debug.Assert(manager.Context.Current == propertyToSerialize, "Context stack corrupted."); 2370Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2402Debug.Assert(saveStatements != statements, "The serializer returned the same collection that exists on the context stack."); 2563Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted."); 2769Debug.Assert(className is not null, "FillStatementTable expected a valid className but received null");
System\ComponentModel\Design\Serialization\CollectionCodeDomSerializer.cs (8)
43Debug.Fail($"Collection of type {modified.GetType().FullName} doesn't return an enumerator"); 219Debug.Fail($"Collection serializer invoked for non-collection: {(value is null ? "(null)" : value.GetType().Name)}"); 272Debug.Assert(candidateType!.IsAssignableFrom(type) || type.IsAssignableFrom(candidateType), "These two types are not related, how were they chosen based on the base type"); 435Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted."); 501Debug.Assert(genCode, "Why didn't GetCollectionDelta calculate the same thing?"); 529Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted."); 583Debug.Assert(genCode, "Why didn't GetCollectionDelta calculate the same thing?"); 605Debug.Assert(manager.Context.Current == newContext, "Context stack corrupted.");
System\ComponentModel\Design\Serialization\ComponentCodeDomSerializer.cs (4)
112Debug.Fail("Serialize is being called twice for the same component"); 278Debug.Assert(isCompleteOld == isComplete, "CCDS Differing"); 454Debug.Assert(manager.Context.Current == entry, "Context stack corrupted"); 496Debug.Assert(manager.Context.Current == statements, "Context stack corrupted");
System\ComponentModel\Design\Serialization\DesignerSerializationManager.cs (1)
760Debug.Assert(instance is not null, "instance should not be null here");
System\ComponentModel\Design\Serialization\EnumCodeDomSerializer.cs (1)
29Debug.Fail("Enum serializer called for non-enum object.");
System\ComponentModel\Design\Serialization\LocalizationCodeDomSerializer.cs (2)
130Debug.Assert(resourceManager is not null, "No resource manager available in context."); 132Debug.Assert(rmExpression is not null, "No expression available for resource manager.");
System\ComponentModel\Design\Serialization\PropertyMemberCodeDomSerializer.cs (3)
200Debug.Assert(manager.Context.Current == tree, "Serializer added a context it didn't remove."); 260Debug.Assert(manager.Context.Current == tree, "Context stack corrupted."); 341Debug.Assert(manager.Context.Current == tree, "Context stack corrupted.");
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.cs (3)
110Debug.Fail("ResourceCodeDomSerializer::Deserialize requires a CodeExpression, CodeStatement or CodeStatementCollection to parse"); 428Debug.Assert(manager.Context.Current == re.ExpressionContext, "Someone corrupted the context stack"); 430Debug.Assert(manager.Context.Current == re.PropertyDescriptor, "Someone corrupted the context stack");
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (20)
125Debug.Fail("We expected to get IResourceService -- no resource serialization will be available"); 209Debug.Assert(name is not null, "name is null"); 219Debug.Assert(culture.Parent != culture, "should have returned when culture = InvariantCulture"); 364Debug.Assert(_manager is not null, "This resource manager object has been destroyed."); 390Debug.Assert(culture is not null, "null parameter"); 463Debug.Assert(invariantWriter is not null, "GetResourceWriter returned null for the InvariantCulture"); 468Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 470Debug.Assert(resourceSet is not null, "ResourceSet for the InvariantCulture not loaded, but it's considered dirty?"); 481Debug.Assert(_metadata is not null, "No metadata, but it's dirty?"); 491Debug.Fail("Metadata not supported, but it's dirty?"); 503Debug.Fail("Couldn't find IResourceService"); 518Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}"); 568Debug.Assert(metadata is not null, "Don't know where to push metadata."); 603Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}"); 620Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?"); 648Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 650Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?"); 686Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct"); 688Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?"); 697Debug.Fail($"Unknown CompareValue {comparison}");
System\ComponentModel\Design\Serialization\ResourcePropertyMemberCodeDomSerializer.cs (1)
69Debug.Assert(manager is not null, "manager should not be null!");
System\ComponentModel\Design\Serialization\TypeCodeDomSerializer.cs (4)
202Debug.Assert(manager.Context.Current == rootCtx, "Context stack corrupted"); 252Debug.Fail("Unrecognized code object in nametable."); 374Debug.Assert(_nameTable is not null, "OnResolveName called and we are not deserializing!"); 465Debug.Assert(manager.Context.Current == statementCtx, "Somebody messed up our context stack");
System\ComponentModel\Design\UndoEngine.UndoUnit.ChangeUndoEvent.cs (2)
110Debug.Assert(_after is null, "Change undo saving state twice."); 154Debug.Assert(_savedAfterState, "After state not saved. BeforeUndo was not called?");
System\ComponentModel\Design\UndoEngine.UndoUnit.cs (3)
236Debug.Fail("UndoEngine: GetName is failing on successive calls"); 463Debug.Assert(idx >= groupEndIdx, "We're going backwards"); 515Debug.Assert(idx <= groupEndIdx, "We're going backwards");
System\Drawing\Design\ColorEditor.CustomColorDialog.cs (4)
36Debug.Assert(_hInstance != IntPtr.Zero, "Dialog has been disposed"); 122Debug.Assert(!success, "Couldn't find dialog member COLOR_RED"); 125Debug.Assert(!success, "Couldn't find dialog member COLOR_GREEN"); 128Debug.Assert(!success, "Couldn't find dialog member COLOR_BLUE");
System\Drawing\Design\CursorEditor.CursorUI.cs (1)
30Debug.Assert(
System\Drawing\Design\IconEditor.cs (1)
68Debug.Assert(s_imageExtenders.Length <= 0, "Why does IconEditor have subclasses if Icon doesn't?");
System\Drawing\Design\ToolboxItem.cs (1)
641Debug.Assert(type is not null);
System\Windows\Forms\Design\BaseContextMenuStrip.cs (1)
86Debug.Assert(root is not null, "Null root component. Will be unable to build selection menu");
System\Windows\Forms\Design\Behavior\BehaviorService.AdornerWindow.MouseHook.cs (6)
50Debug.Assert( 63Debug.Assert(s_adornerWindowList.Count > 0, "No AdornerWindow available to create the mouse hook"); 87Debug.Assert(_isHooked, "Failed to install mouse hook."); 124Debug.Assert(_isHooked, "How did we get here when we are disposed?"); 136Debug.Fail("Failed to remove mouse hook."); 165Debug.Assert(_thisProcessID != 0, "Didn't get our process id!");
System\Windows\Forms\Design\Behavior\BehaviorService.cs (2)
397Debug.Assert(false, $"Could not find the behavior to pop - did it already get popped off? {behavior}"); 410Debug.Assert(_captureBehavior is null, "OnLostCapture should have cleared captureBehavior");
System\Windows\Forms\Design\Behavior\ContainerSelectorBehavior.cs (2)
54Debug.Fail("Could not get the BehaviorService from ContainerSelectorBehavior!"); 211Debug.Fail("Can't drag this Container! Either SelectionService is null or DesignerHost is null");
System\Windows\Forms\Design\Behavior\DesignerActionBehavior.cs (1)
75Debug.Fail("Why are we trying to 'showui' on a glyph that's not a DesignerActionGlyph?");
System\Windows\Forms\Design\Behavior\DesignerActionKeyboardBehavior.cs (1)
22Debug.Assert(_menuService is not null, "we should have found a menu service here...");
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (4)
151Debug.Fail("Cannot get DesignerHost or BehaviorService"); 842Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingRight); 866Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingBottom); 986Debug.Fail("Unknown snapline filter type");
System\Windows\Forms\Design\Behavior\DropSourceBehavior.cs (12)
83Debug.Fail("DragBehavior could not be created because the source ServiceProvider was not found"); 90Debug.Fail("DragBehavior could not be created because the BehaviorService was not found"); 96Debug.Fail("There are no component to drag!"); 103Debug.Fail("DragBehavior could not be created because the srcHost could not be found"); 304Debug.Fail("EndDragDrop - how can serviceProviderTarget be null?"); 308Debug.Fail("EndDragDrop - how can serviceProviderTarget be null?"); 315Debug.Fail("EndDragDrop - how can destHost be null?"); 319Debug.Fail("EndDragDrop - how can destHost be null?"); 326Debug.Fail("EndDragDrop - how can behaviorServiceTarget be null?"); 330Debug.Fail("EndDragDrop - how can behaviorServiceTarget be null?"); 415Debug.Fail("Couldn't create copies of the controls we are dragging."); 989Debug.Assert(_primaryComponentIndex != -1, "primaryComponentIndex was not set!");
System\Windows\Forms\Design\Behavior\GrabHandleGlyph.cs (1)
101Debug.Assert(false, "GrabHandleGlyph was called with a bad GrabHandleGlyphType.");
System\Windows\Forms\Design\Behavior\ResizeBehavior.cs (4)
224Debug.Fail($"Initiating resize. Could not get the designer for {_resizeComponents[i].resizeControl}"); 371Debug.Assert(BehaviorService is not null, "We should have a behavior service."); 411Debug.Assert(!_dragging, "How can we be dragging without pushing a behavior?"); 798Debug.Assert(i == 0, "The first control in the Selection should be the target control");
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
137Debug.Assert(_currentSelectionBounds is not null);
System\Windows\Forms\Design\Behavior\TableLayoutPanelBehavior.cs (5)
39Debug.Fail("BehaviorService could not be found!"); 103Debug.Assert(_resizeProp is not null, "Unable to get the resize property for tableGlyph's Style"); 133Debug.Assert(_leftStyle.styleProp is not null && _rightStyle.styleProp is not null, "Couldn't find property descriptor for width or height"); 193Debug.Fail($"Can't find style {moveIndex}"); 352Debug.Fail("Can't resize - no propertyescriptor for column");
System\Windows\Forms\Design\BorderSidesEditor.BorderSidesEditorUI.cs (1)
365Debug.Assert(edSvc is not null);
System\Windows\Forms\Design\ButtonBaseDesigner.cs (4)
132Debug.Fail("Unknown FlatStyle"); 153Debug.Fail("Unknown FlatStyle"); 184Debug.Fail("Unknown FlatStyle"); 213Debug.Fail("Unknown FlatStyle");
System\Windows\Forms\Design\ChangeToolStripParentVerb.cs (1)
23Debug.Assert(designer is not null, "Can't have a StandardMenuStripVerb without an associated designer");
System\Windows\Forms\Design\CollectionEditVerbManager.cs (5)
29Debug.Assert(designer is not null, "Can't have a CollectionEditVerbManager without an associated designer"); 41Debug.Assert(_targetProperty is not null, "Need PropertyDescriptor for ICollection property to associate collection editor with."); 153Debug.Fail("NOTIMPL"); 162Debug.Fail("NOTIMPL"); 197Debug.Assert(itemsEditor is not null, $"Didn't get a collection editor for type '{_targetProperty.PropertyType.FullName}'");
System\Windows\Forms\Design\CommandSet.CommandSetItem.StatusState.cs (1)
41Debug.Assert(!_statusFlags.HasFlag(StatusFlag.NeedsUpdate), "Updating item when StatusState is not valid.");
System\Windows\Forms\Design\CommandSet.cs (17)
201Debug.Assert(SelectionService is not null, "CommandSet relies on the selection service, which is unavailable."); 218Debug.Assert(ds is not null, "No dictionary service"); 300Debug.Fail("non-CLS compliant exception"); 541Debug.Fail("Commands may be disabled, the location property was not accessible", e.ToString()); 774Debug.Fail($"Unknown command mapped to OnKeyMove: {cmd}"); 1082Debug.Fail($"Unrecognized command: {id}"); 1399Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard"); 1444Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard"); 2192Debug.Assert(SelectionService is not null, "We need the SelectionService, but we can't find it!"); 2308Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2389Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2414Debug.Assert(sizeProp is not null, "No size property on component"); 2415Debug.Assert(locProp is not null, "No location property on component"); 2464Debug.Assert(false, "Invoking pbrs command failed"); 2548Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this"); 2895Debug.Assert(designerHost is not null, "Failed to get designer host"); 3081Debug.Assert(attr is not null, "Type descriptor gave us a null attribute -- problem in type descriptor");
System\Windows\Forms\Design\ComponentTray.cs (29)
87Debug.Assert(es is not null, "Component tray wants an extender provider service, but there isn't one."); 102Debug.Assert(_menucmdArrangeIcons is null, "Non-Null Menu Command for ArrangeIcons"); 103Debug.Assert(_menucmdLineupIcons is null, "Non-Null Menu Command for LineupIcons"); 104Debug.Assert(_menucmdLargeIcons is null, "Non-Null Menu Command for LargeIcons"); 528Debug.Fail("Don't know how to add component!"); 543Debug.Fail("component is not IComponent"); 746Debug.Assert(host is not null, "Service object could not provide us with a designer host."); 873Debug.Assert(_menucmdArrangeIcons is not null, "Null Menu Command for ArrangeIcons"); 874Debug.Assert(_menucmdLineupIcons is not null, "Null Menu Command for LineupIcons"); 875Debug.Assert(_menucmdLargeIcons is not null, "Null Menu Command for LargeIcons"); 973Debug.Fail("Anything we're extending should have a component view."); 988Debug.Assert(_serviceProvider is not null, "Trying to access services too late or too early."); 1114Debug.Assert((de.AllowedEffect & (DragDropEffects.Move | DragDropEffects.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?"); 1148Debug.Assert((de.AllowedEffect & DragDropEffects.Copy) != 0, "DragDropEffect.Move isn't allowed?"); 1553Debug.Fail("Anything we're extending should have a component view."); 1740Debug.Assert(c.Visible, $"TrayControl for {c.Component} should not be positioned"); 1759Debug.Assert(index >= 1, "Got the wrong index, how could that be?"); 1781Debug.Assert(index >= 1, "Got the wrong index, how could that be?"); 1795Debug.Assert(_controls.IndexOf(c) != -1, "Add control to the list of controls before autoarranging.!!!"); 1796Debug.Assert(Visible == c.Visible, $"TrayControl for {((TrayControl)c).Component} should not be positioned"); 1805Debug.Assert(c.Visible, $"TrayControl for {c.Component} should not be positioned"); 1808Debug.Assert(_selectionUISvc is not null, "No SelectionUIService available for tray."); 1824Debug.Assert(comp is not null, "Component for the TrayControl is null"); 1859Debug.Assert(comp is not null, "Component for the TrayControl is null"); 1922Debug.Assert(ds is not null, "ComponentTray relies on IDictionaryService, which is not available."); 2075Debug.Assert(host is not null, "Component tray does not have access to designer host."); 2119Debug.Assert(_tray._selectionUISvc is not null, "We shouldn't be able to begin a drag without this"); 2362Debug.Fail(e.Message); 2752Debug.Assert(o1 is not null && o2 is not null, "Null objects sent for comparison!!!");
System\Windows\Forms\Design\ContextMenuStripActionList.cs (2)
24Debug.Assert(getProperty is not null, "Could not find given property in control."); 37Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ControlCodeDomSerializer.cs (4)
55Debug.Fail("Unable to find a CodeDom serializer for 'Component'. Has someone tampered with the serialization providers?"); 154Debug.Fail("Unable to find a CodeDom serializer for 'Component'. Has someone tampered with the serialization providers?"); 267Debug.Assert(value is not IComponent { Site: not null }, "Unnamed, sited control in hierarchy"); 384Debug.Fail($"Unsupported statement ordering: {ordering}");
System\Windows\Forms\Design\ControlCommandSet.cs (7)
470Debug.Assert(directionOffsetY == 0, "Can only resize in one direction at a time using the keyboard"); 493Debug.Assert(directionOffsetX == 0, "Can only resize in one direction at a time using the keyboard"); 591Debug.Fail($"Unknown command mapped to OnKeySize: {cmd}"); 924Debug.Assert(_tabOrder is not null, "Tab order and menu enabling are out of sync"); 963Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command"); 1104Debug.Assert(ccs is not null && controlsProp is not null, "Wrong parent in parent list"); 1299Debug.Assert(SelectionService is not null, "Need SelectionService for sizing command");
System\Windows\Forms\Design\ControlDesigner.ChildSubClass.cs (1)
50Debug.Assert(m.HWnd == Handle, "Message handle differs from target handle");
System\Windows\Forms\Design\ControlDesigner.ChildWindowTarget.cs (1)
79Debug.Assert(_handle != IntPtr.Zero, "Handle for control not created");
System\Windows\Forms\Design\ControlDesigner.cs (6)
216Debug.Assert(_host is not null); 374Debug.Assert(Component is not null, "this.component needs to be set before this method is valid."); 535Debug.Assert(ctl.DataBindings.Count > 0, "we should not be notified if the control has no dataBindings"); 913Debug.Assert(child is not null); 917Debug.Assert(child.IsHandleCreated); 1747Debug.Assert(!s_inContextMenu, "Recursively hitting live region for context menu!!!");
System\Windows\Forms\Design\DataGridViewAddColumnDialog.cs (6)
519Debug.Assert(_initialDataGridViewColumnsCount != -1, "did you forget to set the initialDataGridViewColumnsCount when you started the dialog?"); 562Debug.Assert(_initialDataGridViewColumnsCount == -1, "did you forget to reset the _initialDataGridViewColumnsCount when you started the dialog?"); 598Debug.Assert(_unboundColumnRadioButton.Checked, "we only have 2 radio buttons"); 619Debug.Assert(_dataColumns.Enabled, "dataColumns list box and dataBoundColumnRadioButton should be enabled / disabled in sync"); 624Debug.Assert(_unboundColumnRadioButton.Checked, "We only have 2 radio buttons"); 845Debug.Fail("we should have found a type by now");
System\Windows\Forms\Design\DataGridViewCellStyleBuilder.cs (2)
320Debug.Assert(e.Cell == _sampleDataGridView.Rows[0].Cells[0], "the sample data grid view has only one cell"); 321Debug.Assert(sender == _sampleDataGridView, "did we forget to unhook notification");
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (8)
111Debug.Assert(typeof(DataGridViewColumn).IsAssignableFrom(newType), "we should only have types that can be assigned to a DataGridViewColumn"); 112Debug.Assert(_selectedColumns.SelectedItem == item, "we must have lost track of what item is in the property grid"); 660Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 680Debug.Assert(_columnsPrivateCopy[i].Frozen, "MOVE_DOWN : all the columns up to the one we moved should be frozen"); 706Debug.Assert(selectedIndex > 0); 822Debug.Assert(_selectedColumns.SelectedIndex != -1); 901Debug.Assert(selectedIndex != -1, "we forgot to take away the selected object from the property grid"); 1344Debug.Assert(component is ListBoxItem, "this property descriptor only relates to the data grid view column class");
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (3)
145Debug.Assert(_selectionService is not null); 177Debug.Assert(_behavior is not null); 193Debug.Assert(_behavior is not null);
System\Windows\Forms\Design\DataGridViewColumnTypeEditor.Picker.cs (1)
135Debug.Assert(false, "we should have found a type by now");
System\Windows\Forms\Design\DataGridViewDesigner.cs (3)
246Debug.Assert(string.IsNullOrEmpty(dataGridView.DataMember), "in the designer we can't set DataSource and DataMember at the same time. Did you forget to set AutoGenerateColumns to false at a previous stage?"); 375Debug.Assert(dataGridView.DataSource is null || _currencyManager is not null, "if we have a data source we should also have a currency manager by now"); 552Debug.Assert(dataGridView.DataSource is null || _currencyManager is not null, "if we have a data source we should also have a currency manager by now");
System\Windows\Forms\Design\DataGridViewRowCollectionCodeDomSerializer.cs (2)
34Debug.Assert(rowCollection.Count == 1, " we should have only the add new row"); 36Debug.Assert(dataGridView.AllowUserToAddRows, "we only have the add new row when the data grid view allows users to add rows");
System\Windows\Forms\Design\DesignBindingPicker.cs (4)
843Debug.Assert(nodes.Count == 0, "We only add data member content sub-nodes once."); 1704Debug.Fail("Failed to select new project-level data source in DesignBindingPicker tree."); 2263Debug.Assert(false, "DesignBindingPicker failed to add custom image to image list."); 2279Debug.Assert(!_subNodesFilled && value, "we can only set this bit to true once");
System\Windows\Forms\Design\DesignerActionVerbItem.cs (1)
13Debug.Assert(verb is not null, "All callers check whether the verb is null.");
System\Windows\Forms\Design\DesignerFrame.cs (3)
417Debug.Assert(_overlayList.IndexOf(control) == -1, $"Duplicate overlay in overlay service: {control.GetType().FullName}"); 435Debug.Assert(_overlayList.IndexOf(control) != -1, $"Control is not in overlay service: {control.GetType().FullName}"); 446Debug.Assert(_overlayList.IndexOf(control) == -1, $"Duplicate overlay in overlay service: {control.GetType().FullName}");
System\Windows\Forms\Design\DesignerUtils.cs (4)
735Debug.Fail("Invalid parameter passed to DesignerUtils.CopyObjects."); 745Debug.Assert(css is not null, "No component serialization service -- we cannot copy the objects"); 746Debug.Assert(host is not null, "No host -- we cannot copy the objects"); 778Debug.Assert(newObjects.Count == objects.Count, "Why is the count of the copied objects not the same?");
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (15)
63Debug.Assert(host is not null, "Designer host is null"); 88Debug.Assert(tlbRef is not null, $"Null reference returned by AddActiveX (tlbimp) by the project system for: {_clsid}"); 98Debug.Assert(axRef is not null, $"Null reference returned by AddActiveX (aximp) by the project system for: {_clsid}"); 137Debug.Fail($"Could not create type: {e}"); 141Debug.Assert(comps[0] is not null, "Could not create instance of ActiveX control wrappers!!!"); 175Debug.Assert(trs is not null, "No type resolution service found."); 178Debug.Assert(a is not null, $"No assembly found at {fullPath}"); 200Debug.Assert(attrs is not null && attrs.Length == 1, $"Invalid number of GuidAttributes found on: {t.FullName}"); 231Debug.Assert(project is not null, $"No DTE Project for the current project item: {name}"); 234Debug.Assert(vsproject is not null, $"No VS Project for the current project item: {name}"); 237Debug.Assert(references is not null, $"No References for the current project item: {name}"); 261Debug.Assert(verKey is not null, $"No version registry key found for: {controlKey}"); 280Debug.Assert(majorVer > 0 && minorVer >= 0, $"No Major version number found for: {controlKey}"); 287Debug.Assert(!tlbGuid.Equals(Guid.Empty), $"No valid Guid found for: {controlKey}"); 306Debug.Assert(inprocServer is not null, $"No valid InprocServer32 found for: {controlKey}");
System\Windows\Forms\Design\DocumentDesigner.cs (9)
74Debug.Fail("AutoScaleDimensions should not be shadowed on non-ContainerControl objects."); 99Debug.Fail("AutoScaleMode should not be shadowed on non-ContainerControl objects."); 330Debug.Assert(host is not null, "Must have a designer host on dispose"); 378Debug.Assert(toolbox is not null, "No toolbox service available"); 580Debug.Assert(sel is Control, "Our logic is flawed - sel should be a Control"); 732Debug.Assert(component.Site is not null, "Designer host should have given us a site by now."); 993Debug.Fail($"Called back to create a service we don't know how to create: {serviceType.Name}"); 1005Debug.Fail("Toolbox service didn't pass us a data object; that should never happen"); 1074Debug.Assert(ss.PrimarySelection == Component, "Bug in selection service: form should have primary selection.");
System\Windows\Forms\Design\DocumentDesigner.DocumentInheritanceService.cs (1)
50Debug.Fail("Unknown member type passed to IgnoreInheritedMember");
System\Windows\Forms\Design\EditorServiceContext.cs (5)
34Debug.Assert(_targetProperty is not null, "Need PropertyDescriptor for ICollection property to associate collection editor with."); 39Debug.Assert(!string.IsNullOrEmpty(newVerbText), "newVerbText cannot be null or empty"); 113Debug.Fail("NOTIMPL"); 119Debug.Fail("NOTIMPL"); 149Debug.Assert(itemsEditor is not null, $"Didn't get a collection editor for type '{_targetProperty!.PropertyType.FullName}'");
System\Windows\Forms\Design\EventHandlerService.cs (1)
55Debug.Assert(_handlers.Count > 0, "Should have handlers to look through.");
System\Windows\Forms\Design\FlowLayoutPanelDesigner .cs (2)
242Debug.Assert(currentMinTopLeft > 0 && currentMaxBottomRight > 0, "How can we not have a min/max value?"); 273Debug.Assert(currentMinTopLeft > 0 && currentMaxBottomRight > 0, "How can we not have a min/max value?");
System\Windows\Forms\Design\FormatControl.cs (8)
93Debug.Assert(customFormatType is not null); 102Debug.Assert(item is not null); 111Debug.Assert(item is not null); 123Debug.Assert(item is not null); 185Debug.Assert(decimalPlacesUpDown.Visible); 197Debug.Assert(dateTimeFormatsListBox.Visible); 209Debug.Assert(_customStringTextBox.Visible); 405Debug.Assert(item is not null);
System\Windows\Forms\Design\FormatControl.CurrencyFormatType.cs (2)
52Debug.Fail("decimalPlacesUpDown should allow only up to 6 digits"); 74Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.DateTimeFormatType.cs (1)
67Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.NumericFormatType.cs (2)
52Debug.Fail("decimalPlacesUpDown should allow only up to 6 digits"); 73Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatControl.ScientificFormatType.cs (2)
52Debug.Fail("decimalPlacesUpDown should allow only up to 6 digits"); 74Debug.Assert(Parse(formatString), "we only push valid strings");
System\Windows\Forms\Design\FormatStringDialog.cs (1)
130Debug.Assert(_listControl is not null, "we check this everywhere, but it does not hurt to check it again");
System\Windows\Forms\Design\FormatStringEditor.cs (1)
26Debug.Assert(
System\Windows\Forms\Design\FormDocumentDesigner.cs (3)
193Debug.Fail("why did base.AddPaddingSnapLines return null?"); 290Debug.Assert(host is not null, "Must have a designer host on dispose"); 333Debug.Assert(component is Form, "FormDocumentDesigner expects its component to be a form.");
System\Windows\Forms\Design\ImageCollectionCodeDomSerializer.cs (1)
29Debug.Fail("Unable to find a CodeDom serializer for 'Component'. Has someone tampered with the serialization providers?");
System\Windows\Forms\Design\ImageIndexEditor.cs (2)
158Debug.Fail("A property specified in the path is null or not yet instantiated at this time."); 165Debug.Fail("The path specified to the property is wrong.");
System\Windows\Forms\Design\ImageListDesigner.OriginalImageCollection.cs (2)
30Debug.Assert(_owner is not null, "OriginalImageCollection has no owner (ImageListDesigner)"); 31Debug.Assert(_items is not null, "OriginalImageCollection has no list (ImageListDesigner)");
System\Windows\Forms\Design\InheritanceUI.cs (1)
54Debug.Assert(level != InheritanceLevel.NotInherited, "This should only be called for inherited components.");
System\Windows\Forms\Design\LabelDesigner.cs (3)
88Debug.Fail("Who removed GetLeadingTextPaddingFromTextFormatFlags from Label?"); 112Debug.Fail("Unknown BorderStyle"); 128Debug.Fail("Unknown BorderStyle");
System\Windows\Forms\Design\MaskDescriptorComparer.cs (3)
33Debug.Fail("One or more parameters invalid"); 43Debug.Fail("Invalid SortType, defaulting to SortType.ByName"); 74Debug.Fail("Null maskDescriptor passed.");
System\Windows\Forms\Design\MaskDesignerDialog.cs (8)
46Debug.Fail("Null masked text box, creating default."); 343Debug.Assert(maskDescriptor is not null, "Null mask descriptor."); 344Debug.Assert(maskDescriptor.Name is not null, "Mask descriptor should either be valid or equal to _customMaskDescriptor"); 350Debug.Assert(descriptor is not null, "Null mask descriptor in the collection."); 411Debug.Fail("Could not find mask descriptor."); 442Debug.Fail("Could not find custom mask descriptor."); 516Debug.Assert(success, "BadBad: Could not add MaskDescriptor.Sample even it was validated, something is wrong!"); 667Debug.Fail("Unable to get IHelpService.");
System\Windows\Forms\Design\MaskedTextBoxDesigner.cs (5)
126Debug.Fail("Unknown RejectionHint, defaulting to InvalidInput..."); 210Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 228Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 247Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox."); 260Debug.Assert(maskedTextBox is not null, "Designed control is not a MaskedTextBox.");
System\Windows\Forms\Design\MaskedTextBoxDesignerActionList.cs (1)
35Debug.Fail("could not get either ITypeDiscoveryService or IUIService");
System\Windows\Forms\Design\MaskPropertyEditor.cs (1)
29Debug.Assert(instance is not null, "Null masked text box.");
System\Windows\Forms\Design\OleDragDropHandler.ComponentDataObject.cs (1)
47Debug.Assert(_components[i] is IComponent, $"Item {_components[i].GetType().Name} is not an IComponent");
System\Windows\Forms\Design\OleDragDropHandler.cs (7)
329Debug.Fail("selectionHandler should not be null"); 554Debug.Assert(selectionUISvc is not null, "Unable to get selection ui service when adding child control"); 599Debug.Fail("selectionHandler should not be null"); 709Debug.Fail("data object didn't return any data, so how did we allow the drop?"); 725Debug.Assert(container is not null, "Didn't get a container from the site!"); 836Debug.Assert(selectionUISvc is not null, "Unable to get selection ui service when adding child control"); 1009Debug.Fail("selectionHandler should not be null");
System\Windows\Forms\Design\ParentControlDesigner.cs (10)
339Debug.Fail("why did base.SnapLines return null?"); 1243Debug.Fail("Couldn't get the parent instance from 'defaultValues'"); 1249Debug.Fail("Failed to IDesignerHost"); 1255Debug.Fail($"Could not get ParentControlDesigner for {parent}"); 1350Debug.Assert(_suspendChanging > 0, "Unbalanced SuspendChangingEvents\\ResumeChangingEvents"); 1356Debug.Assert(_suspendChanging >= 0, "Unbalanced SuspendChangingEvents\\ResumeChangingEvents"); 1615Debug.Assert((de.AllowedEffect & (DragDropEffects.Move | DragDropEffects.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?"); 1668Debug.Assert(tabCommand is not null, "Missing tab order command"); 1688Debug.Assert((de.AllowedEffect & DragDropEffects.Copy) != 0, "DragDropEffect.Move isn't allowed?"); 1762Debug.Assert(_graphics is null);
System\Windows\Forms\Design\SelectionUIHandler.cs (6)
46Debug.Assert(components[i] is IComponent, "Selection UI handler only deals with IComponents"); 48Debug.Assert(_dragControls[i] is not null, "Everyone must have a control"); 60Debug.Assert(bounds is not null && controls is not null && bounds.Length == controls.Length, "bounds->controls mismatch"); 101Debug.Assert(_originalCoordinates is not null, "We are keying off of originalCoords, but MoveControls didn't set it"); 242Debug.Assert(controls[i] == GetControl((IComponent)components[i]), "Control->Component mapping is out of sync"); 307Debug.Assert(host is not null, "No designer host");
System\Windows\Forms\Design\SelectionUIService.cs (9)
343Debug.Assert(!RecreatingHandle, "Perf hit: we are recreating the docwin handle"); 493Debug.Assert(selComp is not null, "Illegal selection on double-click"); 917Debug.Fail("A component may have only one selection UI handler."); 949Debug.Fail("Caller is starting a drag, but there is already one in progress -- we cannot nest these!"); 955Debug.Fail("Caller is starting requesting a drag with no drag rules."); 1029Debug.Fail("Drag handler threw during BeginDrag -- bad handler!", e.ToString()); 1063Debug.Assert(_dragComponents is not null, "We should have a set of drag controls here"); 1133Debug.Fail(e.ToString()); 1222Debug.Fail("The component is not currently selected.");
System\Windows\Forms\Design\SelectionUIService.SelectionUIItem.cs (4)
269Debug.Assert(!(pt.X >= _outerRect.X && pt.X <= _innerRect.X), "Should be handled by left top check"); 287Debug.Assert(!(pt.Y >= _outerRect.Y && pt.Y <= _innerRect.Y), "Should be handled by top right check"); 305Debug.Assert(!(pt.X >= _outerRect.X && pt.X <= _innerRect.X), "Should be handled by left bottom check"); 307Debug.Assert(!(pt.X >= _innerRect.X + _innerRect.Width && pt.X <= _outerRect.X + _outerRect.Width), "Should be handled by right bottom check");
System\Windows\Forms\Design\ShortcutKeysEditor.ShortcutKeysUI.cs (3)
56Debug.Assert(s_validKeys.Distinct().Count() == s_validKeys.Length); 240Debug.Assert((keyCode & Keys.KeyCode) == keyCode); 323Debug.Assert(!_updateCurrentValue);
System\Windows\Forms\Design\SplitContainerDesigner.cs (1)
232Debug.Assert(_splitContainer is not null, $"Component must be a non-null SplitContainer, it is a: {component.GetType().FullName}");
System\Windows\Forms\Design\StandardMenuStripVerb.cs (6)
95Debug.Assert(host is not null, "can't create standard menu without designer _host."); 178Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 262Debug.Assert(host is not null, "can't create standard menu without designer _host."); 318Debug.Assert(displayStyleProperty is not null, "Could not find 'Text' property in ToolStripItem."); 322Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 338Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem.");
System\Windows\Forms\Design\StyleEditorForm.cs (1)
795Debug.Fail("Unsupported SizeType");
System\Windows\Forms\Design\TabControlDesigner.cs (2)
204Debug.Assert(control is not null, "Component must be a tab control, it is a: " + component.GetType().FullName); 267Debug.Assert(textProperty is not null, "Could not find 'Text' property in TabPage.");
System\Windows\Forms\Design\TableLayoutPanelCodeDomSerializer.cs (1)
42Debug.Assert(panel is not null, "Huh? We were expecting to be serializing a TableLayoutPanel here.");
System\Windows\Forms\Design\TableLayoutPanelDesigner.cs (8)
501Debug.Assert(existingControl is null, "We shouldn't be able to do a local copy of a cell with an existing control"); 1110Debug.Assert(Table.ColumnStyles[i] is not null, "Table's ColumnStyle[" + i + "] is null!"); 1136Debug.Assert(Table.RowStyles[i] is not null, $"Table's RowStyle[{i}] is null!"); 1238Debug.Assert(fullTable || (_droppedCellPosition != InvalidPoint), "Why is neither fullTable or droppedCellPosition set?"); 1605Debug.Fail("Unknown SizeType!"); 1801Debug.Assert(currentIndex != index); 1953Debug.Fail("Our indices are outta whack, how did that happen?"); 1998Debug.Fail("Unknown SizeType!");
System\Windows\Forms\Design\TabOrder.cs (4)
72Debug.Assert(os is not null, "No overlay service -- tab order UI cannot be shown"); 257Debug.Assert(_tabGlyphs is not null, "tabGlyps should not be null here."); 499Debug.Assert(mcs is not null, "No menu command service, can't get out of tab order UI"); 503Debug.Assert(mc is not null, "No tab order menu command, can't get out of tab order UI");
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (5)
66Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 95Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 102Debug.Assert(dispProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 106Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 110Debug.Assert(dummyIndex != -1, "Why is the index of the Item negative?");
System\Windows\Forms\Design\TextBoxBaseDesigner.cs (1)
51Debug.Fail("Unknown borderstyle");
System\Windows\Forms\Design\TextBoxDesigner.cs (2)
76Debug.Assert(tb is not null, "Designed control is not a TextBox."); 90Debug.Assert(tb is not null, "Designed control is not a TextBox.");
System\Windows\Forms\Design\ToolStripActionList.cs (2)
55Debug.Assert(getProperty is not null, "Could not find given property in control."); 63Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ToolStripCodeDomSerializer.cs (1)
14Debug.Fail("why were we passed a non winbar?");
System\Windows\Forms\Design\ToolStripCollectionEditor.ToolStripItemEditorForm.cs (3)
664Debug.Fail("Unexpected list box item painted!"); 683Debug.Fail("Unexpected combo box item!"); 692Debug.Fail("Unexpected sender calling DrawItem");
System\Windows\Forms\Design\ToolStripDesigner.cs (12)
476Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 525Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 526Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?"); 559Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 578Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 585Debug.Assert(displayProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 589Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 969Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1077Debug.Assert(_host is not null, "Why didn't we get a designer host?"); 1078Debug.Assert(_pendingTransaction is null, "Removing item with pending transaction?"); 1697Debug.Assert(defaultName is not null && defaultName.Length > 0, "Couldn't create default name for item"); 2449Debug.Assert(NewItemTransaction is null, "NewItemTransaction should have been nulled out and cancelled by now.");
System\Windows\Forms\Design\ToolStripDesignerUtils.cs (2)
208Debug.Assert(toolStrip is not null, "why werent we handed a toolstrip here? returning default list"); 255Debug.Assert(currentToolStripVisibility != ToolStripItemDesignerAvailability.None, "Why is GetDesignerVisibility returning None?");
System\Windows\Forms\Design\ToolStripInSituService.cs (2)
32Debug.Assert(_designerHost is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 36Debug.Assert(_componentChangeService is not null, "ToolStripKeyboardHandlingService relies on the componentChange service, which is unavailable.");
System\Windows\Forms\Design\ToolStripItemBehavior.cs (10)
113Debug.Assert(item is not null, "Item passed is null, SelectionService cannot be obtained"); 117Debug.Assert(selSvc is not null, "Failed to get Selection Service!"); 127Debug.Assert(item is not null, "Item passed is null, BehaviorService cannot be obtained"); 131Debug.Assert(behaviorSvc is not null, "Failed to get Behavior Service!"); 141Debug.Assert(item is not null, "Item passed is null, ToolStripKeyBoardHandlingService cannot be obtained"); 145Debug.Assert(keyBoardSvc is not null, "Failed to get ToolStripKeyboardHandlingService!"); 294Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 545Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 649Debug.Assert(designerHost is not null, "Invalid DesignerHost"); 963Debug.Assert(designerHost is not null, "Invalid DesignerHost");
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (14)
255Debug.Assert(item is not null, "Why is item null?"); 259Debug.Assert(propertyName is not null, "Why is propertyName null?"); 271Debug.Assert(item is not null, "Why is item null?"); 275Debug.Assert(desc is not null, "Why is desc null?"); 373Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 435Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 448Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 474Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 487Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 513Debug.Assert(designerHost is not null, "Why didn't we get a designer host?"); 544Debug.Assert(dummyIndex != -1, "Why is item index negative?"); 569Debug.Assert(getProperty is not null, "Could not find given property in control."); 585Debug.Assert(getProperty is not null, "Could not find given property in control."); 603Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System\Windows\Forms\Design\ToolStripItemDesigner.cs (6)
697Debug.Fail("Couldn't get designer host!"); 804Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem."); 811Debug.Assert(dispProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 815Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem."); 1036Debug.Fail("Couldn't get designer host!"); 1194Debug.Assert(parent is not null, "ImmediateParent is null for the current ToolStripItem !!");
System\Windows\Forms\Design\ToolStripKeyboardHandlingService.cs (4)
55Debug.Assert(_selectionService is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 63Debug.Assert(_designerHost is not null, "ToolStripKeyboardHandlingService relies on the selection service, which is unavailable."); 67Debug.Assert(_componentChangeService is not null, "ToolStripKeyboardHandlingService relies on the componentChange service, which is unavailable."); 1826Debug.WriteLineIf(item is DesignerToolStripControlHost, " Why are we here for non DesignerMenuItem??");
System\Windows\Forms\Design\ToolStripMenuItemDesigner.cs (10)
754Debug.Fail("Couldn't get designer host!"); 826Debug.Fail("Couldn't get designer host!"); 876Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem."); 1823Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1832Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1941Debug.Assert(_designerHost is not null, "Why didn't we get a designer host?"); 1942Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?"); 2094Debug.Assert(selectionSvc is not null, "No Selection Service !!"); 2301Debug.Assert(index != -1, "Invalid Index"); 2639Debug.Assert(ownerItem is not null, "How can ownerItem be null for a menu item on a dropdown?");
System\Windows\Forms\Design\ToolStripTemplateNode.cs (2)
1080Debug.Assert(_centerTextBox.Control is not null, "The TextBox is null"); 1403Debug.Assert(_addItemButton.DropDownItems.Count > 0);
System\Windows\Forms\Design\TreeNodeCollectionEditor.cs (2)
110Debug.Assert(false, "TreeNodeCollectionEditor couldn't find the TreeView being designed"); 123Debug.Assert(dictionaryService is not null, "TreeNodeCollectionEditor relies on IDictionaryService, which is not available.");
System\Windows\Forms\Design\TreeViewDesigner.cs (1)
62Debug.Assert(_treeView is not null, "TreeView is null in TreeViewDesigner");
System.Windows.Forms.Primitives (39)
System\Diagnostics\TraceSwitchExtensions.cs (2)
17Debug.WriteLine(message); 26Debug.WriteLine(message.ToStringAndClear());
System\Drawing\ImageExtensions.cs (1)
54Debug.Fail($"Invalid image type {type}");
System\Windows\Forms\Automation\UiaTextRange.cs (3)
120Debug.Assert(!typeof(UiaTextRange).IsAssignableTo(typeof(IDisposable))); 290Debug.Fail("Invalid text range argument. 'text' should not be null."); 297Debug.Fail("Invalid text range argument. 'text' length should be more than 0.");
System\Windows\Forms\DeviceContextExtensions.cs (4)
45Debug.Assert(!hbrush.IsNull); 82Debug.Assert((lines.Length % 4) == 0); 154Debug.Assert(!hbrush.IsNull, "HBRUSH is null"); 190Debug.Assert(!create, "Couldn't get Graphics");
System\Windows\Forms\Internals\ScaleHelper.cs (4)
91Debug.Assert(result.Succeeded, $"Failed to get ProcessDpi HRESULT: {result}"); 92Debug.Assert(Enum.IsDefined(processDpiAwareness)); 314Debug.Assert(dpi >= 96); 465Debug.Fail("Unexpected DPI state.");
System\Windows\Forms\Internals\ScaleHelper.DpiAwarenessScope.cs (1)
33Debug.Fail("Full support for DPI_AWARENESS_CONTEXT and mixed mode DPI_HOSTING_BEHAVIOR on the thread is only available after the RS4 OS release");
System\Windows\Forms\Internals\ThemingScope.cs (2)
34Debug.Assert(success); 43Debug.Assert(success);
System\Windows\Forms\Padding.cs (4)
196Debug.Assert(ShouldSerializeAll(), "_all is true, but ShouldSerializeAll() is false."); 197Debug.Assert(All == Left && Left == Top && Top == Right && Right == Bottom, "_all is true, but All/Left/Top/Right/Bottom inconsistent."); 201Debug.Assert(All == -1, "_all is false, but All != -1."); 202Debug.Assert(!ShouldSerializeAll(), "ShouldSerializeAll() should not be true when all flag is not set.");
System\Windows\Forms\RefCountedCache.CacheEntry.cs (1)
49Debug.Assert(refCount >= 0);
System\Windows\Forms\RefCountedCache.cs (3)
40Debug.Assert(softLimit > 0 && hardLimit > 0); 41Debug.Assert(softLimit <= hardLimit); 169Debug.Assert(removed != 0 || _softLimit < 20);
System\Windows\Forms\RefCountedCache.Scope.cs (1)
40Debug.Assert(entry is not null);
System\Windows\Forms\SinglyLinkedList.cs (5)
52Debug.Assert(First is not null && Last is not null); 157Debug.Assert(_previous is not null); 165Debug.Assert(_previous is not null); 197Debug.Assert(_previous is not null); 202Debug.Assert(_list.Last == _current);
System\Windows\Forms\SystemDrawingExtensions.cs (1)
56Debug.Assert((lines.Length % 4) == 0);
Windows\Win32\PInvoke.GetModuleFileNameLongPath.cs (1)
37Debug.Fail($"Module File Name is greater than {short.MaxValue}.");
Windows\Win32\PInvoke.LoadLibrary.cs (1)
18Debug.Assert(Path.IsPathFullyQualified(customPath));
Windows\Win32\PInvoke.PrintDlg.cs (1)
16Debug.Assert(RuntimeInformation.ProcessArchitecture == Architecture.X86);
Windows\Win32\PInvoke.UiaDisconnectProvider.cs (2)
21Debug.WriteLine($"UiaDisconnectProvider failed with {result}"); 24Debug.Assert(result == HRESULT.S_OK || result == HRESULT.E_INVALIDARG, $"UiaDisconnectProvider failed with {result}");
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (2)
51Debug.WriteLine($"Already found name {name}"); 190Debug.Assert(!bindingFlags.HasFlag(BindingFlags.NonPublic));
System.Windows.Input.Manipulations (115)
System\Windows\Input\Manipulations\Exceptions.cs (12)
101Debug.Assert(paramName1 != null); 102Debug.Assert(paramName2 != null); 119Debug.Assert(paramName1 != null); 120Debug.Assert(paramName2 != null); 139Debug.Assert(paramName1 != null); 140Debug.Assert(paramName2a != null); 141Debug.Assert(paramName2b != null); 199Debug.Assert(paramName != null); 200Debug.Assert(messageFormat != null); 218Debug.Assert(paramName != null); 219Debug.Assert(paramName.Length > 0); 238Debug.Assert(format != null);
System\Windows\Input\Manipulations\InertiaParameters2D.cs (3)
29Debug.Assert(isEqual != null); 30Debug.Assert(setNewValue != null); 31Debug.Assert(paramName != null);
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (42)
318Debug.Assert(!result, "Complete method is supposed to raise Completed event."); 348Debug.Fail("Unsupported parameters"); 360Debug.Assert(!IsRunning); 413Debug.Assert(handler != null); 608Debug.Assert(double.IsNaN(this.desiredDeceleration), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 619Debug.Assert(double.IsNaN(this.desiredDisplacement), "desiredDisplacement and desiredDeceleration are mutually exclusive."); 665Debug.Assert( 680Debug.Assert(!DoubleUtil.IsZero(state.InitialVelocity)); 720Debug.Assert(state.Duration >= 0); 721Debug.Assert(!double.IsNaN(state.Deceleration)); 722Debug.Assert(!double.IsNaN(state.Offset)); 740Debug.Assert(this.processorState == ProcessorState.Running); 755Debug.WriteLine("Too long extrapolation, stop it."); 788Debug.Assert(this.expansion.InitialValue > 0 && 833Debug.Assert(this.expansion.InitialValue > 0 && 841Debug.Assert(!DoubleUtil.IsZero(previousExpansionValue)); 900Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialValue)); 901Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialVelocity)); 902Debug.Assert(!double.IsNaN(deceleration) && !double.IsInfinity(deceleration)); 903Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 917Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 951Debug.Assert(!double.IsNaN(resultValue) && !double.IsInfinity(resultValue), "Calculation error, value should be a finite number."); 1004Debug.Assert(false); 1038Debug.Assert(!double.IsInfinity(value)); 1056Debug.Assert(!double.IsNaN(length) && length >= 0 && !double.IsInfinity(length)); 1057Debug.Assert(!double.IsInfinity(baseVector.X)); 1058Debug.Assert(!double.IsInfinity(baseVector.Y)); 1225Debug.Assert(initialState != null); 1226Debug.Assert(initialState.AbsoluteDeceleration >= 0 || double.IsNaN(initialState.AbsoluteDeceleration)); 1227Debug.Assert(initialState.AbsoluteOffset >= 0 || double.IsNaN(initialState.AbsoluteOffset)); 1247Debug.Assert(elapsedTimeSinceInitialTimestamp >= 0); 1259Debug.Assert(Validations.IsFinite((float)result)); 1285Debug.Assert(this.ExtrapolationResult == ExtrapolationResult.Skip); 1289Debug.Assert(!double.IsNaN(this.InitialValue) && !double.IsInfinity(this.InitialValue)); 1290Debug.Assert(!double.IsNaN(this.InitialVelocity) && !double.IsInfinity(this.InitialVelocity)); 1291Debug.Assert(!double.IsNaN(this.Offset)); // can be infinity 1292Debug.Assert(!double.IsNaN(this.AbsoluteDeceleration) && this.AbsoluteDeceleration >= 0 && !double.IsInfinity(this.InitialVelocity)); 1293Debug.Assert(!double.IsNaN(this.Duration) && this.Duration >= 0); // can be infinity 1294Debug.Assert(!double.IsNaN(this.FinalValue)); // can be infinity 1333Debug.Assert(!double.IsNaN(value) && !double.IsInfinity(value)); 1334Debug.Assert(!double.IsNaN(delta) && !double.IsInfinity(delta)); 1335Debug.Assert(!double.IsNaN(total) && !double.IsInfinity(total));
System\Windows\Input\Manipulations\Lazy.cs (1)
31Debug.Assert(getValue != null);
System\Windows\Input\Manipulations\Manipulation2DCompletedEventArgs.cs (4)
37Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 38Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 39Debug.Assert(velocities != null, "velocities should not be null"); 40Debug.Assert(total != null, "total should not be null");
System\Windows\Input\Manipulations\Manipulation2DDeltaEventArgs.cs (5)
40Debug.Assert(Validations.IsFinite(originX), "originX should be finite"); 41Debug.Assert(Validations.IsFinite(originY), "originY should be finite"); 42Debug.Assert(velocities != null, "velocities should not be null"); 43Debug.Assert(delta != null, "delta should not be null"); 44Debug.Assert(cumulative != null, "cumulative should not be null");
System\Windows\Input\Manipulations\Manipulation2DStartedEventArgs.cs (2)
41Debug.Assert(Validations.IsFinite(originX)); 42Debug.Assert(Validations.IsFinite(originY));
System\Windows\Input\Manipulations\ManipulationDelta2D.cs (7)
104Debug.Assert(Validations.IsFinite(translationX), "translationX should be finite"); 105Debug.Assert(Validations.IsFinite(translationY), "translationY should be finite"); 106Debug.Assert(Validations.IsFinite(rotation), "rotation should be finite"); 107Debug.Assert(Validations.IsFiniteNonNegative(scaleX), "scaleX should be finite and not negative"); 108Debug.Assert(Validations.IsFiniteNonNegative(scaleY), "scaleY should be finite and not negative"); 109Debug.Assert(Validations.IsFinite(expansionX), "expansionX should be finite"); 110Debug.Assert(Validations.IsFinite(expansionY), "expansionY should be finite");
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (1)
141Debug.Assert(processor != null);
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (4)
326Debug.Assert(sender != null); 327Debug.Assert(this.currentManipulation == null, "Manipulation was already in progress"); 349Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation)); 363Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation));
System\Windows\Input\Manipulations\ManipulationSequence.cs (24)
275Debug.Assert(!float.IsNaN(result) && !float.IsInfinity(result)); 425Debug.Assert(this.processorState == ProcessorState.Manipulating, "Wrong state."); 507Debug.Assert(Started != null, "Processor hasn't registered for Started event"); 514Debug.Assert(Delta != null, "Processor hasn't registered for Delta event"); 574Debug.Assert(Completed != null, "Processor hasn't registered for Completed event"); 592Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log 660Debug.Assert(this.processorState == ProcessorState.Manipulating, "Invalid state."); 751Debug.Assert(!double.IsNaN(value)); 795Debug.Assert(this.manipulatorStates != null); 829Debug.Assert(!float.IsNaN(smoothedRotation) && !float.IsInfinity(smoothedRotation)); 835Debug.Assert(!float.IsNaN(smoothedExpansion) && !float.IsInfinity(smoothedExpansion)); 841Debug.Assert(!float.IsNaN(smoothedScale) && !float.IsInfinity(smoothedScale)); 942Debug.Assert(settings.Pivot != null, "don't call unless we have a settings.Pivot"); 943Debug.Assert(settings.Pivot.HasPosition, "don't call unless there's a settings.Pivot location"); 1010Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1031Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1070Debug.Assert(queue != null); 1094Debug.Assert(timeDelta >= ManipulationProcessor2D.TimestampTicksPerMillisecond, 1132Debug.Assert(queue != null); 1549Debug.Assert(!float.IsNaN(position.X) && !float.IsNaN(position.Y)); 1550Debug.Assert(!float.IsInfinity(position.Y) && !float.IsInfinity(position.Y)); 1551Debug.Assert(!float.IsNaN(scale) && !float.IsInfinity(scale) && scale > 0); 1552Debug.Assert(!float.IsNaN(expansion) && !float.IsInfinity(expansion)); 1553Debug.Assert(!float.IsNaN(orientation) && !float.IsInfinity(orientation));
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (8)
85Debug.Assert(Validations.IsFinite(linearVelocityX)); 86Debug.Assert(Validations.IsFinite(linearVelocityY)); 87Debug.Assert(Validations.IsFinite(angularVelocity)); 88Debug.Assert(Validations.IsFinite(expansionVelocity)); 109Debug.Assert(getLinearVelocityX != null, "getLinearVelocityX should not be null"); 110Debug.Assert(getLinearVelocityY != null, "getLinearVelocityX should not be null"); 111Debug.Assert(getAngularVelocity != null, "getLinearVelocityX should not be null"); 112Debug.Assert(getExpansionVelocity != null, "getLinearVelocityX should not be null");
System\Windows\Input\Manipulations\Validations.cs (2)
30Debug.Assert(paramName != null); 54Debug.Assert(paramName != null);
System.Xaml (185)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
266Debug.Assert(target is not null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
26Debug.Assert(CurrentFrame is not null); 27Debug.Assert(CurrentFrame.Depth == Depth); 84Debug.Assert(iteratorFrame is not null); 110Debug.Assert(CurrentFrame.Depth == Depth); 123Debug.Assert(CurrentFrame.Depth == Depth);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlFrame.cs (1)
40Debug.Assert(_depth != -1, "Context Frame is uninitialized");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (4)
183Debug.Assert(start >= _previousEnd, "Arguments out of order during Compact"); 184Debug.Assert(_validItemCount + end - start <= _newCount, "Too many items copied during Compact"); 1295Debug.Assert(collection is not null); 1303Debug.Assert(collection is not null);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\ReflectionHelper.cs (3)
128Debug.Assert(type is not null, "Type passed to IsInternalType is null"); 149Debug.Assert(type is not null, "Type passed to IsPublicType is null"); 443Debug.Assert(!assemblyPath.EndsWith(string.Empty + Path.DirectorySeparatorChar, StringComparison.Ordinal), "the assembly path should be a full file path containing file extension");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\TypeConverterHelper.cs (1)
110Debug.Assert(type is not null, "Null passed for type to GetConverterType");
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
34Debug.Assert( baseReader is not null);
System\Xaml\Context\ContextServices.cs (1)
17Debug.Assert(xamlContext.ParentProperty is not null);
System\Xaml\Context\NameFixupGraph.cs (8)
56Debug.Assert(fixupToken.Target.Instance is null && 59Debug.Assert(_deferredRootProvideValue is null); 69Debug.Assert(parentObject is not null); 75Debug.Assert(fixupToken.FixupType == FixupType.UnresolvedChildren || 79Debug.Assert(!_dependenciesByChildObject.ContainsKey(fixupToken.ReferencedObject)); 85Debug.Assert(fixupToken.FixupType != FixupType.UnresolvedChildren && 451Debug.Assert(outEdge.FixupType == FixupType.UnresolvedChildren); 465Debug.Assert(parentDependencies.Contains(token));
System\Xaml\Context\NameFixupToken.cs (1)
130Debug.Assert(_runtime is null);
System\Xaml\Context\ObjectWriterContext.cs (7)
70Debug.Assert(rootNameScope is null, "Cannot pass a new namescope in to a reparse context"); 132Debug.Assert(!_nameResolutionComplete || value); 420Debug.Assert(frame is not null); 461Debug.Assert(frame is not null); 828Debug.Assert(frame.NameScopeDictionary is not null || frame.Depth == 0); 842Debug.Assert(nameScopeDictionary is not null); 878Debug.Assert(rootFrame.Depth == 1);
System\Xaml\Context\XamlContext.cs (3)
266Debug.Assert(typeName is not null, "typeName cannot be null and should have been checked before now"); 267Debug.Assert(typeName.Name is not null, "typeName.Name cannot be null and should have been checked before now"); 268Debug.Assert(typeName.Namespace is not null);
System\Xaml\InfosetObjects\DeferredWriter.cs (2)
148Debug.Assert(!property.IsDirective && !property.IsUnknown); 200Debug.Assert(_deferredTreeDepth == 0);
System\Xaml\InfosetObjects\XamlNodes.cs (7)
50Debug.Fail("XamlNode Ctor missing data argument"); 65Debug.Assert(data is XamlType, "XamlNode ctor, StartObject data is not a XamlType"); 69Debug.Assert(data is XamlMember, "XamlNode ctor, StartMember data is not a XamlMember"); 73Debug.Assert(data is NamespaceDeclaration, "XamlNode ctor, NamespaceDeclaration data is not a NamespaceDeclaration"); 83Debug.Assert(data is null, "XamlNode ctor, Internal XamlNode data must be null for this Node type"); 87Debug.Fail("XamlNode ctor, incorrect ctor called."); 98Debug.Assert(internalNodeType == InternalNodeType.EndOfAttributes ||
System\Xaml\InfosetObjects\XamlObjectWriter.cs (22)
148Debug.Assert(_context.SourceBamlUri is null || _context.BaseUri is null || _context.SourceBamlUri == _context.BaseUri, 400Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 432Debug.Assert(_context.LiveDepth > 0); 510Debug.Assert(_context.LiveDepth > 1); 616Debug.Assert(_context.LiveDepth > 0); 831Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 1196Debug.Assert(inst is not null); // runtime throws before it returns null. 1429Debug.Assert(ctx.ParentProperty == XamlLanguage.Key); 1643Debug.Assert(inst == ctx.ParentInstance); 1731Debug.Assert(parentInstance is not null || (parentProperty is not null && parentProperty.IsDirective) || ctx.LiveDepth == 1); 1777Debug.Assert(ctx.LiveDepth > 1); 1852Debug.Assert(ctx.ParentType.IsCollection, "Logic_WillParentCollectionAdd called on a non-collection"); 1900Debug.WriteLine(SR.Format(SR.DictionaryFirstChanceException, ctx.ParentType, key, ctx.ParentType.KeyType)); 1915Debug.Assert(ctx.CurrentProperty is null); 2134Debug.Assert(token.Target.Property == XamlLanguage.Key); 2396Debug.Assert(!_inNameResolution); 2399Debug.Assert(_nameFixupGraph is not null); 2489Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete); 2586Debug.Assert(token.FixupType == FixupType.MarkupExtensionFirstRun && _lastInstance == token.ReferencedObject); 2613Debug.Assert(token.Target.KeyHolder.Key == token); 2623Debug.Assert(pendingAdd.Key == token); 2633Debug.Assert(pendingAdd.Item == token);
System\Xaml\InfosetObjects\XamlXmlReader.cs (1)
263Debug.Assert(_current.IsEof, "Xaml Parser returned an illegal internal XamlNode");
System\Xaml\MS\Impl\XmlNsInfo.cs (1)
130Debug.Assert(Assembly is not null, "RefOnly assemblies shouldn't be GCed");
System\Xaml\Parser\GenericTypeNameParser.cs (4)
166Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.NAME); 197Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.OPEN); 229Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.COMMA); 240Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.SUBSCRIPT);
System\Xaml\Parser\GenericTypeNameScanner.cs (3)
310Debug.Assert(_multiCharTokenStartIdx == -1 && _multiCharTokenLength == 0); 318Debug.Assert(_multiCharTokenStartIdx != -1 && _multiCharTokenLength > 0); 372Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (1)
563Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\NodeStreamSorter.cs (6)
576Debug.Assert(deepestIdx != -1); 584Debug.Assert(_sortingInfoArray[start].XamlNodeType == XamlNodeType.StartMember); 610Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 632Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 668Debug.Fail("Missing End Object in node sorter"); 684Debug.Assert(length1 > 0 && length2 > 0);
System\Xaml\Parser\XamlScanner.cs (5)
246Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 283Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 428Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 787Debug.Assert(prop.IsUnknown); 844Debug.Assert(_accumulatedText is not null, "Creating unnecessary XamlText objects");
System\Xaml\Parser\XamlScannerStack.cs (2)
74Debug.Assert(_stack.Count != 0); 84Debug.Assert(_stack.Count != 0);
System\Xaml\Parser\XamlText.cs (2)
270Debug.Assert(start > 0); 271Debug.Assert(end < text.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
132Debug.Assert(schemaContext is not null); 133Debug.Assert(accessLevel is not null);
System\Xaml\Schema\Reflector.cs (9)
115Debug.Fail($"Unexpected attribute type requested: {attributeType.Name}"); 161Debug.Fail($"Unexpected attribute type requested: {attributeType.Name}"); 195Debug.Fail($"Unexpected attribute type requested: {attributeType.Name}"); 242Debug.Fail($"Unexpected attribute type requested: {attributeType.Name}"); 273Debug.Assert(attributeType == typeof(XamlDeferLoadAttribute)); 274Debug.Assert(count == 2); 330Debug.Fail($"Unexpected attribute type requested: {attributeType.Name}"); 378Debug.Assert((flagMask & 0xFFFF) == flagMask, "flagMask should only use lower 16 bits of int"); 387Debug.Assert(value || (bitMask & bitToSet) == 0);
System\Xaml\Schema\TypeReflector.cs (13)
314Debug.Assert(_positionalParameterTypes is not null, "TryGetPositionalParameters should have been called first"); 357Debug.Assert(!IsUnknown); 441Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 453Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 467Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 468Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 480Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 481Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this"); 708Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 725Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 986Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null"); 987Debug.Assert(_attachableMemberCache is not null, "AttachableMembers property should have been invoked before this"); 1147Debug.Assert(value);
System\Xaml\Schema\XamlDirective.cs (2)
22Debug.Assert(immutableXamlNamespaces is not null); 25Debug.Assert(ns is not null);
System\Xaml\Schema\XamlNamespace.cs (4)
99Debug.Assert(typeArgs.Length > 0, "This method should only be called for generic types."); 159Debug.Assert(typeArgs[n] is not null); 160Debug.Assert(typeArgs[n].UnderlyingType is not null); 180Debug.Assert(_assemblyNamespaces.Length == 1);
System\Xaml\XamlBackgroundReader.cs (1)
157Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlMember.cs (4)
350Debug.Assert(_declaringType is not null, "XamlDirective should not call base.ToString"); 983Debug.Fail("Enum out of range"); 1045Debug.Assert(DeclaringType is not null, "XamlDirective should not call into base.GetHashCode"); 1073Debug.Assert(xamlMember2.IsDirective);
System\Xaml\XamlNodeList.cs (1)
78Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlNodeQueue.cs (1)
69Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlObjectReader.cs (3)
295Debug.Assert(false); // should never reach here 1770Debug.Assert(Object is not null); 3304Debug.Fail("Invalid enum value");
System\Xaml\XamlType.cs (26)
201Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsDictionary"); 220Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 241Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 261Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsCollection"); 337Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsMarkupExtension"); 523Debug.Assert(_reflector is not null, "_reflector should have been initialized by ItemType"); 597Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind"); 824Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 861Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 955Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 969Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1030Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1208Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1222Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1233Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1267Debug.Assert(typeArgs.Length == 1); 1280Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1309Debug.Assert(typeArgs.Length == 1); 1324Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1343Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1423Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized"); 1673Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties"); 1782Debug.Fail("Enum out of range"); 1811Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable"); 1930Debug.Assert(xamlType1.IsUnknown); 1931Debug.Assert(xamlType2.IsUnknown);
System\Xaml\XamlXmlWriter.cs (26)
345Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartMember); 386Debug.Assert(ns is not null); 387Debug.Assert(prefix is not null); 506Debug.Assert(objectFrame.AllocatingNodeType == XamlNodeType.StartObject || 529Debug.Assert(frame.AllocatingNodeType == nodeType); 813Debug.Assert(writer.namespaceScopes.Count > 1); 816Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 831Debug.Assert(writer.namespaceScopes.Count > 1); 834Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 954Debug.Assert(writer.namespaceScopes.Count == 1); 1000Debug.Assert(writer.namespaceScopes.Count > 0); 1087Debug.Assert(writer.namespaceScopes.Count > 0); 1159Debug.Assert(writer.namespaceScopes.Count > 0); 1160Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartObject || 1236Debug.Assert(writer.namespaceScopes.Count > 0); 1371Debug.Assert(writer.namespaceScopes.Count > 0); 1435Debug.Assert(writer.namespaceScopes.Count > 0); 1437Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1568Debug.Assert(writer.namespaceScopes.Count > 0); 1570Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1759Debug.Assert(value is not null); 1903Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartObject); 1906Debug.Assert(objectXamlType is not null); 1947Debug.Assert(member is not null); 2076Debug.Assert(writer.ppStateInfo.CurrentDepth != 0); 2077Debug.Assert(writer.ppStateInfo.NodesList.Count != 0);
testhost (1)
src\vstest\src\testhost.x86\TestHostTraceListener.cs (1)
57if (!debugMethodFound && (declaringType == typeof(Debug) || declaringType == typeof(Trace)))
testhost.arm64 (1)
src\vstest\src\testhost.x86\TestHostTraceListener.cs (1)
57if (!debugMethodFound && (declaringType == typeof(Debug) || declaringType == typeof(Trace)))
testhost.x86 (1)
TestHostTraceListener.cs (1)
57if (!debugMethodFound && (declaringType == typeof(Debug) || declaringType == typeof(Trace)))
UIAutomationClient (38)
MS\Internal\Automation\Accessible.cs (1)
17Debug.Assert(acc != null, "null IAccessible");
MS\Internal\Automation\CacheHelper.cs (4)
69Debug.Assert(response.RequestedData == null, "both RequestedData and TreeStructure should be null or non-null"); 99Debug.Fail("Internal error: got malformed tree description string (extra chars at end)"); 105Debug.Fail("Internal error: mismatch between count of property buckets and nodes claiming them"); 225Debug.Fail("Internal error: Got malformed tree description string, missing closing paren");
MS\Internal\Automation\ClientEventManager.cs (1)
461Debug.Fail("GetNewRootTracker internal error: Unexpected Tracker value!");
MS\Internal\Automation\FocusTracker.cs (1)
82Debug.Assert(acc != null, "HandleFocusChange got hwnd and null IAccessible");
MS\Internal\Automation\HwndProxyElementProvider.cs (5)
39Debug.Assert( hwnd != NativeMethods.HWND.NULL ); 375Debug.Fail("unexpected switch() case:"); 1418Debug.Fail("too many children or inf loop?"); 1876Debug.Fail("too many children or inf loop?"); 2115Debug.Assert(provider is IRawElementProviderFragment, "Expecting a fragment provider");
MS\Internal\Automation\MenuTracker.cs (1)
74Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\Misc.cs (1)
149Debug.Fail("missing client-side pattern wrapper");
MS\Internal\Automation\ProxyManager.cs (1)
681Debug.Fail("unexpected switch() case:");
MS\Internal\Automation\QueueProcessor.cs (3)
76Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 86Debug.Assert(!_quitting, "Can't add items to queue when quitting"); 140Debug.Assert(_quitting, "MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\Automation\Schema.cs (3)
56Debug.Assert( false, "GetPropertyInfo failed " + id ); 68Debug.Fail("GetDefaultValue was passed an unknown property"); 104Debug.Assert( false, "GetAttributeInfo failed " + id );
MS\Internal\Automation\SelectionPatternProviderSideWrapper.cs (1)
26Debug.Assert(target != null);
MS\Internal\Automation\UiaCoreApi.cs (6)
240Debug.Fail("unsupported property should not have made it this far"); 451Debug.Assert(offsets == null && treeStructures == null, "if nothin found, all out params shoud be null"); 455Debug.Assert(offsets.Length == treeStructures.Length); 643Debug.Fail("Got unknown eventId from core: " + args._eventId); 661Debug.Fail("Got unknown propertyId from core: " + pcargs._propertyId); 702Debug.Fail("Unknown event type from core:" + args._type);
MS\Internal\Automation\WindowHideOrCloseTracker.cs (1)
88Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WindowShowOrOpenTracker.cs (1)
85Debug.Assert(handlers.Length <= 1, "handlers.Length");
MS\Internal\Automation\WinEventWrap.cs (1)
32Debug.Assert(eventIds != null && eventIds.Length > 0, "eventIds is invalid");
System\Windows\Automation\AutomationElement.cs (1)
755Debug.Assert(responses.Length == 1);
System\Windows\Automation\BasePattern.cs (1)
25Debug.Assert(el != null);
System\Windows\Automation\CacheRequest.cs (1)
549Debug.Assert( _request != null );
System\Windows\Automation\Text\TextRange.cs (2)
57Debug.Assert(!hTextRange.IsInvalid); 58Debug.Assert(pattern != null);
System\Windows\Automation\TextPattern.cs (2)
32Debug.Assert(el != null); 33Debug.Assert(!hPattern.IsInvalid);
UIAutomationClientSideProviders (95)
MS\Internal\AutomationProxies\Accessible.cs (14)
143Debug.Assert(acc != null, "null IAccessible"); 316Debug.Assert(parent != null); 327Debug.Assert(false); 343Debug.Assert(parent != null); 354Debug.Assert(false); 685Debug.Assert( false, "Need to handle Accessible.accFocus case!" ); 728Debug.Assert(_idChild == NativeMethods.CHILD_SELF); 773Debug.Assert(false); 916System.Diagnostics.Debug.Fail("Call to AccessibleChildren() returned E_INVALIDARG."); 979Debug.Assert(_accessibleChildrenIndex < 0); 1158Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected exception thrown for AccessibleChildren: {0}", e)); 1166Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected hresult from AccessibleChildren: {0} count is {1} and actualCount is {2}", hr, count, actualCount)); 1370Debug.Fail(string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message)); 1387Debug.Fail(string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\CommonGetThemePartSize.cs (1)
95System.Diagnostics.Debug.Assert (false, "Unsupport Type");
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
94System.Diagnostics.Debug.Assert(remoteTextArea.ToInt32() == remoteTextArea.ToInt64());
MS\Internal\AutomationProxies\EventManager.cs (1)
119System.Diagnostics.Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected idProp {0} for idOject 0x{1:x8} on element {2} for event {3}", idProp, idObject, el, eventId));
MS\Internal\AutomationProxies\Misc.cs (2)
1970Debug.Assert(System.Environment.OSVersion.Version.Major < 6); 2041Debug.Assert(System.Environment.OSVersion.Version.Major >= 6);
MS\Internal\AutomationProxies\MSAAEventDispatcher.cs (4)
124Debug.Assert(refcount >= 0); 151Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "ERROR: AdviseEventRemoved called for {0} and event/property {1} without matching AdviseEventAdded.", hwnd, key), "NativeMsaaProxy"); 157Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "ERROR: AdviseEventRemoved called for {0} without matching AdviseEventAdded.", hwnd), "NativeMsaaProxy"); 361Debug.Assert(eventId == NativeMethods.EVENT_OBJECT_REORDER);
MS\Internal\AutomationProxies\MSAANativeProvider.cs (6)
51Debug.Assert(acc != null, "acc"); 52Debug.Assert(hwnd != IntPtr.Zero); 224Debug.Assert(_hwnd == UnsafeNativeMethods.WindowFromPhysicalPoint((int)x, (int)y)); 340Debug.Assert(false); 1024Debug.Assert(!IsRoot); 1077Debug.Assert(_hwnd != IntPtr.Zero);
MS\Internal\AutomationProxies\NonClientArea.cs (1)
108System.Diagnostics.Debug.Assert(idChild == 0, string.Format(CultureInfo.CurrentCulture, "Invalid Child Id, idChild == {2}\n\rClassName: \"{0}\"\n\rhwnd = 0x{1:x8}", Misc.ProxyGetClassName(hwnd), hwnd.ToInt32(), idChild));
MS\Internal\AutomationProxies\ProxyFragment.cs (3)
122System.Diagnostics.Debug.Assert(this is ProxyHwnd, "Invalid method called ElementProviderFromPoint"); 209System.Diagnostics.Debug.Assert(fragment != null, "DrillDownFragment: starting point is null"); 214System.Diagnostics.Debug.Assert(fromPoint != null, @"DrillDownFragment: calling ElementProviderFromPoint on Fragment should not return null");
MS\Internal\AutomationProxies\ProxySimple.cs (2)
244System.Diagnostics.Debug.Assert(_sAutomationId != null, "_sAutomationId is null!"); 443System.Diagnostics.Debug.Assert(_parent != null, "Navigate: Leaf element does not have parent");
MS\Internal\AutomationProxies\QueueProcessor.cs (1)
127Debug.Fail("MsgWaitForMultipleObjects failed while WaitForWork");
MS\Internal\AutomationProxies\WindowsEditBox.cs (17)
436Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range."); 437Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range."); 514Debug.Assert(!IsMultiline); 521Debug.Assert(IsMultiline); 551Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT"); 556Debug.Fail("WindowsEditBox.GetObject unexpected return value"); 677Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index."); 678Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range."); 739Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index."); 740Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range."); 743Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds."); 798Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start."); 799Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range."); 800Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end."); 801Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range."); 961Debug.Assert(floor >= 0); 972Debug.Assert(i >= floor);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
39Debug.Assert(provider != null);
MS\Internal\AutomationProxies\WindowsIPAddress.cs (1)
104System.Diagnostics.Debug.Assert (index != -1, "GetOverrideProviderForHwnd: cannot find child hwnd index");
MS\Internal\AutomationProxies\WindowsListBox.cs (3)
594System.Diagnostics.Debug.Assert (IsMultipleSelection (), "Calling ClearAll on single-selected listbox"); 910System.Diagnostics.Debug.Assert (_parent is WindowsListBox, "Invalid Parent for a Listbox Item"); 1178System.Diagnostics.Debug.Assert (_listBox.IsMultipleSelection (), "Calling UnSelect on single-selected listbox");
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1960System.Diagnostics.Debug.Assert(el is ListViewItemCheckbox);
MS\Internal\AutomationProxies\WindowsListViewGroup.cs (2)
552System.Diagnostics.Debug.Assert (!WindowsListView.IsDetailMode (hwnd), "GetColumnCountExternal: called when lv is in Detail mode"); 802System.Diagnostics.Debug.Assert (false, "GetCountOfItemsInDimension: failed to get item rect");
MS\Internal\AutomationProxies\WindowsListViewGroupHelper.cs (3)
411System.Diagnostics.Debug.Fail("Cannot add item to the needed group"); 436System.Diagnostics.Debug.Fail("Cannot add item to the needed group"); 800System.Diagnostics.Debug.Assert(min <= _items.Length, "EnsureCapacity: min is > _items.Length");
MS\Internal\AutomationProxies\WindowsListViewItem.cs (2)
500System.Diagnostics.Debug.Assert (parent != null, "Hit null while looking for the SelectionContainer"); 729System.Diagnostics.Debug.Assert (WindowsListView.IsGroupViewEnabled (hwnd), "GetGroupID: called when lv does not have groups");
MS\Internal\AutomationProxies\WindowsListViewItemStartMenu.cs (2)
47System.Diagnostics.Debug.Fail("The listview item on the Start Menu has an unexpected IAccessible role!"); 85System.Diagnostics.Debug.Assert(AccessibleObject != null, "Failed to get a valid IAccessible!");
MS\Internal\AutomationProxies\WindowsMenu.cs (3)
115System.Diagnostics.Debug.Assert(idObject == NativeMethods.OBJID_MENU || idObject == NativeMethods.OBJID_SYSMENU, "Unexpected idObject"); 1350System.Diagnostics.Debug.Fail("Cannot find back the accelerator in the menu!"); 2695System.Diagnostics.Debug.Assert (name.Length > hotKeyStart + 1, "Unexpected end of string");
MS\Internal\AutomationProxies\WindowsRichEdit.cs (4)
226Debug.Assert(_document != null); 266Debug.Assert(_document != null); 273Debug.Assert(range.Start == range.End); 309Debug.Assert(_document != null);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (11)
23Debug.Assert(range != null); 24Debug.Assert(pattern != null); 240Debug.Assert(text == null || text.Length == maxLength); 1116Debug.Assert(charMoved == 0 || charMoved == 1); 1119Debug.Assert(paraMoved == 0 || paraMoved == 1); 1145Debug.Assert(charMoved == 0 || charMoved == -1); 1148Debug.Assert(paraMoved == 0 || paraMoved == -1); 1174Debug.Assert(charMoved == 0 || charMoved == 1); 1177Debug.Assert(paraMoved == 0 || paraMoved == 1); 1203Debug.Assert(charMoved == 0 || charMoved == -1); 1206Debug.Assert(paraMoved == 0 || paraMoved == -1);
MS\Internal\AutomationProxies\WindowsTab.cs (2)
1177System.Diagnostics.Debug.Fail("XSendMessage.GetItem() failed!"); 1191System.Diagnostics.Debug.Assert(_parent is WindowsTab, "Invalid Parent for a Tab Item");
MS\Internal\AutomationProxies\WindowsToolbarAsMenu.cs (1)
47System.Diagnostics.Debug.Fail("Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsToolbarItemAsMenuItem.cs (1)
41System.Diagnostics.Debug.Fail("Unexpected role " + role);
MS\Internal\AutomationProxies\WindowsTreeView.cs (1)
1058System.Diagnostics.Debug.Assert (topLevelParent is WindowsTreeView, "Invalid Parent for a TreeView Item");
MS\Internal\AutomationProxies\WinEventTracker.cs (3)
264Debug.Fail("Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 309Debug.Fail("Exception raising event " + eventId + " for prop " + ecp._idProp + " on hwnd " + hwnd + "\n" + e.Message); 448Debug.Assert (hwnd == IntPtr.Zero, @"BuildEventsList: event is global but hwnd is not null");
MS\Win32\UnsafeNativeMethods.cs (1)
395Debug.WriteLine("GetWindowLong failed. Error = " + error);
UIAutomationTypes (12)
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
16Debug.Assert((0xFFFF0000 & errorCode) == 0);
src\wpf\src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\UnsafeNativeMethodsCLR.cs (7)
250Debug.WriteLine("CloseHandle failed. Error = " + error); 273Debug.WriteLine("UnmapViewOfFile failed. Error = " + error); 334Debug.WriteLine("GetCursorPos failed!"); 903Debug.WriteLine("DestroyIcon failed. Error = " + error); 924Debug.WriteLine("DeleteObject failed. Error = " + error); 963Debug.WriteLine("CreateBitmap failed. Error = " + error); 978Debug.WriteLine("CreateIconIndirect failed. Error = " + error);
System\Windows\Automation\AutomationIdentifier.cs (4)
46Debug.Assert(id != 0); 124Debug.Assert(obj != null, "Null obj!"); 128Debug.Assert(obj is AutomationIdentifier, "CompareTo called with unexpected type"); 168default: Debug.Fail("Invalid type specified for AutomationIdentifier");
vbc (12)
src\roslyn\src\Compilers\Shared\BuildClient.cs (4)
155Debug.Assert(serverResult.Value.RanOnServer); 238Debug.Assert(buildResponse != null); 273Debug.Assert(false); 353Debug.Assert(PlatformInformation.IsWindows);
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
73Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 85Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server"); 506Debug.Assert(reason is object);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
79Debug.Assert(workingDirectory is object); 199Debug.Assert(pipeName is object); 833Debug.Assert(Stream is null); 871Debug.Assert(Stream is not null);
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
VBCSCompiler (29)
src\roslyn\src\Compilers\Server\VBCSCompiler\CompilationCache.cs (1)
153Debug.Assert(outputTimestampUtc.Kind == DateTimeKind.Utc);
src\roslyn\src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
75Debug.Assert(fileKey.HasValue);
src\roslyn\src\Compilers\Server\VBCSCompiler\NamedPipeClientConnectionHost.cs (9)
27Debug.Assert(connection is null || exception is null); 54Debug.Assert(_cancellationTokenSource is null); 55Debug.Assert(_listenTasks is null); 56Debug.Assert(_queue is null); 85Debug.Assert(_cancellationTokenSource is object); 86Debug.Assert(_queue is object); 87Debug.Assert(_listenTasks is object); 142Debug.Assert(_cancellationTokenSource is object); 143Debug.Assert(_queue is object);
src\roslyn\src\Compilers\Server\VBCSCompiler\ServerDispatcher.cs (6)
148Debug.Assert(_gcTask is null); 149Debug.Assert(_timeoutTask is null); 222Debug.Assert(_state == State.Running); 223Debug.Assert(_clientConnectionHost.IsListening); 251Debug.Assert(_listenTask != null); 285Debug.Assert(current.Status == TaskStatus.RanToCompletion);
src\roslyn\src\Compilers\Shared\BuildClient.cs (4)
155Debug.Assert(serverResult.Value.RanOnServer); 238Debug.Assert(buildResponse != null); 273Debug.Assert(false); 353Debug.Assert(PlatformInformation.IsWindows);
src\roslyn\src\Compilers\Shared\BuildProtocol.cs (3)
73Debug.Assert(!string.IsNullOrWhiteSpace(CompilerHash), "A hash value is required to communicate with the server"); 85Debug.Assert(!string.IsNullOrWhiteSpace(compilerHash), "CompilerHash is required to send request to the build server"); 506Debug.Assert(reason is object);
src\roslyn\src\Compilers\Shared\BuildServerConnection.cs (4)
79Debug.Assert(workingDirectory is object); 199Debug.Assert(pipeName is object); 833Debug.Assert(Stream is null); 871Debug.Assert(Stream is not null);
src\roslyn\src\Compilers\Shared\CompilerServerLogger.cs (1)
138Debug.Assert(false, e.Message);
vstest.console (7)
Internal\MSBuildLogger.cs (3)
172Debug.WriteLine(">>>>ERR:" + result.ErrorMessage); 173Debug.WriteLine(">>>>STK:" + result.ErrorStackTrace); 246Debug.WriteLine($"MSBUILDLOGGER: {message}");
NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
vstest.console.arm64 (7)
src\vstest\src\vstest.console\Internal\MSBuildLogger.cs (3)
172Debug.WriteLine(">>>>ERR:" + result.ErrorMessage); 173Debug.WriteLine(">>>>STK:" + result.ErrorStackTrace); 246Debug.WriteLine($"MSBUILDLOGGER: {message}");
src\vstest\src\vstest.console\NullableHelpers.cs (4)
33/// <inheritdoc cref="Debug.Assert(bool)"/> 36=> Debug.Assert(b); 38/// <inheritdoc cref="Debug.Assert(bool, string)"/> 41=> Debug.Assert(b, message);
WindowsFormsIntegration (26)
System\Windows\Integration\ApplicationInterop.cs (2)
144Debug.Assert(processedState == SWF.PreProcessControlState.MessageNotNeeded, "invalid state"); 216Debug.Assert(windowFilter != null);
System\Windows\Integration\ElementHost.cs (16)
119Debug.WriteLineIf(_traceLayout.TraceInfo, String.Format(CultureInfo.CurrentCulture, "AvalonAdapter({0}): MeasureOverride (constraint={1},result={2})", this.Name, proposedSize, prefSize)); 638Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside SyncHwndSrcImeStatus(), this = " + this); 639Debug.Indent(); 658Debug.Unindent(); 675Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Verbose, "SetChildElementsIsImeEnabled, element = " + element); 696Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside OnHwndSrcWmInputLangChange(), this = " + this); 697Debug.Indent(); 716Debug.Unindent(); 725Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside OnHwndSrcWmImeNotify(), this = " + this); 726Debug.Indent(); 748Debug.Unindent(); 756Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Verbose, "Inside OnHwndSourceMsgNotifyElementHost()"); 757Debug.Indent(); 761Debug.Unindent(); 1581Debug.Assert(request != null, "request was null!"); 1600Debug.Fail("Unknown FocusNavigationDirection");
System\Windows\Integration\WindowsFormsHost.cs (8)
89Debug.WriteLineIf(HostUtils.ImeMode.Level >= TraceLevel.Info, "Inside SyncChildImeEnabledContext(), this = " + this); 90Debug.Indent(); 108Debug.Unindent(); 469Debug.WriteLineIf(_traceHandle.TraceVerbose, String.Format(CultureInfo.CurrentCulture, "WindowsFormsHost({0}): BuildWindowCore (parent=0x{1:x8})", this.Name, hwndParent.Handle.ToInt32())); 862Debug.Fail("Unknown FocusNavigationDirection"); 960Debug.Assert(uiAction == NativeMethods.UIS_INITIALIZE || uiAction == NativeMethods.UIS_SET, "Unexpected uiAction"); 1025Debug.WriteLineIf(WindowsFormsHost._traceLayout.TraceInfo, String.Format(CultureInfo.CurrentCulture, "WindowsFormsHost({0}): Layout invalidated (control='{1}',property='{2}')", _host.Name, compName, e.AffectedProperty)); 1087Debug.Assert(methodInfo != null, "Couldn't find OnParentRightToLeftChanged method!");