35959 references to Assert
Aspire.Components.Common.Tests (1)
FileUtil.cs (1)
14Debug.Assert(!string.IsNullOrWhiteSpace(command));
Aspire.Confluent.Kafka (2)
KafkaConsumerSettings.cs (1)
50Debug.Assert(Config is not null);
KafkaProducerSettings.cs (1)
50Debug.Assert(Config is not null);
Aspire.Dashboard (5)
Components\Controls\Chart\ChartBase.cs (2)
487Debug.Assert(InstrumentViewModel.MatchedDimensions != null); 488Debug.Assert(InstrumentViewModel.Instrument != null);
Components\Controls\ResourceDetails.razor.cs (1)
231Debug.Assert(_isMaskAllChecked != null);
Components\Pages\ConsoleLogs.razor.cs (1)
194Debug.Assert(_resources is not null);
Components\Pages\TraceDetail.razor.cs (1)
80Debug.Assert(_spanWaterfallViewModels != null);
Aspire.Hosting (5)
ApplicationModel\ResourceLoggerService.cs (3)
436Debug.Assert(Monitor.IsEntered(_lock)); 447Debug.Assert(Monitor.IsEntered(_lock)); 462Debug.Assert(Monitor.IsEntered(_lock));
Dcp\DcpExecutor.cs (1)
1409Debug.Assert(ea.IsProxied);
Utils\PasswordGenerator.cs (1)
84Debug.Assert(destination.Length >= minValues);
Aspire.Hosting.Azure (2)
AzureProvisioningResource.cs (1)
42Debug.Assert(compilation.Count == 1);
Provisioning\Provisioners\BicepProvisioner.cs (1)
412Debug.Assert(!string.IsNullOrWhiteSpace(command));
Aspire.Hosting.Azure.ServiceBus (1)
src\Aspire.Hosting\Utils\PasswordGenerator.cs (1)
84Debug.Assert(destination.Length >= minValues);
Aspire.Playground.Tests (2)
src\Aspire.Hosting\Utils\PasswordGenerator.cs (1)
84Debug.Assert(destination.Length >= minValues);
tests\Aspire.Components.Common.Tests\FileUtil.cs (1)
14Debug.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);
BuildActionTelemetryTable (2)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
BuildBoss (1)
CompilerNuGetCheckerUtil.cs (1)
342Debug.Assert(string.IsNullOrEmpty(folderRelativePath) || folderRelativePath[0] != '\\');
BuildValidator (11)
CompilationDiff.cs (8)
77Debug.Assert(_message is object); 236Debug.Assert(_localReferenceResolver is object); 257Debug.Assert(Result == RebuildResult.BinaryDifference); 258Debug.Assert(_originalPortableExecutableBytes is object); 259Debug.Assert(_originalPdbReader is object); 260Debug.Assert(_rebuildPortableExecutableBytes is object); 261Debug.Assert(_rebuildPdbReader is object); 262Debug.Assert(_rebuildCompilation is object);
PEReaderExtensions.cs (2)
22Debug.Assert(peReader.PEHeaders is object); 23Debug.Assert(peReader.PEHeaders.PEHeader is object);
Util.cs (1)
75Debug.Assert(memberRef.Parent.Kind == HandleKind.TypeReference);
ClientSample (3)
Tcp\SocketAwaitable.cs (1)
36Debug.Assert(ReferenceEquals(_callback, _callbackCompleted));
Tcp\SocketSender.cs (2)
82Debug.Assert(!buffer.IsEmpty); 83Debug.Assert(!buffer.IsSingleSegment);
CodeGenerator (6)
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
CodeStyleConfigFileGenerator (2)
Program.cs (2)
49Debug.Assert(language is "CSharp" or "VisualBasic"); 122Debug.Assert(sortedRulesById.Count > 0);
ConfigurationSchemaGenerator (29)
ConfigurationBindingGenerator.ForSchemaGeneration.cs (1)
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 (5)
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);
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);
csc (8)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
504Debug.Assert(reason is object);
src\Compilers\Shared\BuildClient.cs (3)
158Debug.Assert(serverResult.Value.RanOnServer); 239Debug.Assert(buildResponse != null); 274Debug.Assert(false);
src\Compilers\Shared\BuildServerConnection.cs (4)
68Debug.Assert(workingDirectory is object); 179Debug.Assert(pipeName is object); 703Debug.Assert(Stream is null); 741Debug.Assert(Stream is not null);
CSharpSyntaxGenerator (7)
SourceWriter.cs (1)
1534System.Diagnostics.Debug.Assert(!IsRequiredFactoryField(nd, field));
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)); 1174Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
dotnet-dev-certs (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
dotnet-svcutil-lib (1179)
CodeDomFixup\CodeDomVisitors\AttributeFixer.cs (1)
41System.Diagnostics.Debug.Assert(generator != null);
FrameworkFork\Microsoft.CodeDom\Microsoft\CSharpCodeProvider.cs (1)
3269Debug.Assert(names.Length > 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 (10)
143Debug.Assert(rguiData.Length == 4); 168Debug.Assert(rgulU.Length == s_cNumeMax); 338Debug.Assert(dwlAccum < s_ulInt32Base); 407Debug.Assert(dwlAccum < dwlDivisor); 409Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 433Debug.Assert(dwlAccum < s_ulInt32Base); 458Debug.Assert(uiDigit < 10); 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 (12)
388Debug.Assert(len >= 2 && (data[0] == 0xdf && data[1] == 0xff)); 925Debug.Assert(decl != null); 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); 2971Debug.Assert(_mark < 0); 3096Debug.Assert(_pos >= 3); 3101Debug.Assert(_pos >= 1); 3107Debug.Assert(_pos >= 2);
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\BufferBuilder.cs (3)
433Debug.Assert(_lastBuffer == null); 481Debug.Assert(_buffers != null); 532Debug.Assert(newLength <= _length);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentBuilder.cs (17)
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); 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); 622Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 652Debug.Assert(xptyp != XPathNodeType.Namespace); 723Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 739Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 889Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 890Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathDocumentNavigator.cs (8)
40Debug.Assert(pageCurrent != null && idxCurrent != 0); 41Debug.Assert((pageParent == null) == (idxParent == 0)); 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 (3)
363Debug.Assert(info != null && idxParent <= UInt16.MaxValue); 402Debug.Assert(NodeType == XPathNodeType.Element); 413Debug.Assert(NodeType == XPathNodeType.Element);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (9)
30Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 79Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 123Debug.Assert(idx != 0); 183Debug.Assert(idxNode <= UInt16.MaxValue); 184Debug.Assert(pageNode[0].PageInfo.PageNumber <= Int16.MaxValue); 203Debug.Assert(idx != 0); 315Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 335Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 371Debug.Assert(idxAnc != 0 && pageAnc != null);
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 (2)
128Debug.Assert(idxPage + 1 == _pages.Count); 286Debug.Assert(idxPage + 1 == _pages.Count);
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 (168)
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); 822Debug.Assert(xmlFragment != null); 848default: Debug.Assert(false); goto case XmlNodeType.None; 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); 2228Debug.Assert(_stringBuilder.Length == 0); 2269Debug.Assert(_outerReader is XmlTextReader); 2311Debug.Assert(_outerReader is XmlTextReader); 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); 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); 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); 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); 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); 5090Debug.Assert(_curNode.type == XmlNodeType.Element); 5227Debug.Assert(_stringBuilder.Length == 0); 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); 7169Debug.Assert(_ps.isEof); 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); 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); 8676Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8693Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8720Debug.Assert(_stringBuilder.Length == 0); 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); 9159Debug.Assert(_nameTableFromSettings == false); 9187Debug.Assert(_dtdInfo == null); 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 (17)
293Debug.Assert(internalDtd != null); 435Debug.Assert(type == XmlNodeType.Element); 448Debug.Assert(type == XmlNodeType.Attribute); 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); 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 (3)
973Debug.Assert(false); 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 (14)
254Debug.Assert(writer != null); 255Debug.Assert(settings != null); 256Debug.Assert(MaxNamespacesWalkCount <= 3); 484Debug.Assert(prefix.Length == 0); 1346Debug.Assert(i >= 0); 1357Debug.Assert(i >= 0); 1681Debug.Assert(_stateTable == s_stateTableAuto); 1725Debug.Assert(prefix == "xmlns"); 1913Debug.Assert(_useNsHashtable); 1914Debug.Assert(indexFrom <= indexTo); 1917Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 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 (3)
100Debug.Assert(kind == NamespaceKind.NeedToWrite); 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 (2)
330Debug.Assert(_cdataSections != null); 502Debug.Assert(Encoding.UTF8.WebName == "utf-8");
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 (30)
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); 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); 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 (8)
42Debug.Assert(doc != null); 115Debug.Assert(parentNode != null); 172Debug.Assert(parentNode != null); 777Debug.Assert(firstNode.NodeType == XmlNodeType.Text 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\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 (36)
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); 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 (6)
301Debug.Assert(compiledAttributes != null); //AttributeUses is never null 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);
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 (1)
159Debug.Assert(qname != null); //string representation is handled in a different overload
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchema.cs (2)
272Debug.Assert(_isPreprocessed); 702Debug.Assert(extList != null && schema != null);
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 (8)
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);
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 (27)
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); 2340Debug.Assert(datatype != null); 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 (1)
3678Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdBuilder.cs (5)
712Debug.Assert(_currentEntry.InitFunc != null); 715Debug.Assert(_xso != null); 1340Debug.Assert(false); 2381Debug.Assert(false); 2430Debug.Assert(false);
FrameworkFork\Microsoft.Xml\Xml\schema\XsdDuration.cs (1)
115Debug.Assert(durationType == DurationType.Duration || durationType == DurationType.DayTimeDuration);
FrameworkFork\Microsoft.Xml\Xml\schema\xsdvalidator.cs (1)
502Debug.Assert(attnDef.SchemaType != null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeExporter.cs (1)
176Debug.Assert(comments != null);
FrameworkFork\Microsoft.Xml\Xml\Serialization\CodeGenerator.cs (29)
47System.Diagnostics.Debug.Assert(typeBuilder != null); 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); 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 (3)
200Debug.Assert(invCharIndex < data.Length); 201Debug.Assert(invCharIndex < length); 202Debug.Assert(length <= data.Length);
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\CacheAxisQuery.cs (2)
43Debug.Assert(0 <= count && count <= outputBuffer.Count); 55Debug.Assert(0 <= count && count <= outputBuffer.Count);
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 (1)
123Debug.Assert(prefix != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\ForwardPositionQuery.cs (1)
16Debug.Assert(input != null);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\LogicalExpr.cs (3)
22Debug.Assert( 93Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 126Debug.Assert(
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\NamespaceQuery.cs (1)
62Debug.Assert(e.NodeType == XPathNodeType.Namespace);
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\Query.cs (1)
156Debug.Assert(0 <= l && l < r);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\SortQuery.cs (6)
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);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\StringFunctions.cs (1)
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 (1)
101Debug.Assert(firstNotEmpty <= item && item < arr.Length);
FrameworkFork\Microsoft.Xml\Xml\XPath\Internal\XPathParser.cs (4)
424Debug.Assert(nodeType != XPathNodeType.Root); 477Debug.Assert(IsPrimaryExpr(_scanner)); 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 (4)
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 (7)
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 (2)
520Debug.Assert(value == null); 646Debug.Assert(XPathNodeType.Namespace == _nav.NodeType);
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\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);
GetDocument.Insider (1)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
294Debug.Assert(_hostTcs.Task.IsCompleted);
http2cat (30)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.FunctionalTests (31)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
195Debug.Assert(expectedMessage.Length > 0);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.LongTests (30)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewHandler.FunctionalTests (30)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.NewShim.FunctionalTests (30)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IIS.ShadowCopy.Tests (7)
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
IISExpress.FunctionalTests (31)
src\Servers\IIS\IIS\test\Common.FunctionalTests\WebSocketTests.cs (1)
195Debug.Assert(expectedMessage.Length > 0);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
illink (196)
ILLink.RoslynAnalyzer (74)
DataFlow\ControlFlowGraphExtensions.cs (2)
18 Debug.Assert (firstBlock.Kind == BasicBlockKind.Entry); 25 Debug.Assert (lastBlock.Kind == BasicBlockKind.Exit);
DataFlow\ControlFlowGraphProxy.cs (2)
62 Debug.Assert (region != null); 163 Debug.Assert (enclosingRegion.Kind == ControlFlowRegionKind.TryAndCatch);
DataFlow\InterproceduralState.cs (1)
54 Debug.Assert (!Methods.IsUnknown ());
DataFlow\LocalDataFlowAnalysis.cs (2)
81 Debug.Assert (Context.OwningSymbol is not IMethodSymbol methodSymbol || 89 Debug.Assert (!oldInterproceduralState.Methods.IsUnknown ());
DataFlow\LocalDataFlowVisitor.cs (17)
176 Debug.Assert (assemblyType != null); 180 Debug.Assert (method != null); 343 Debug.Assert (operation.Target is not IFlowCaptureReferenceOperation); 397 Debug.Assert (IsLValueFlowCapture (flowCaptureReference.Id)); 398 Debug.Assert (flowCaptureReference.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Write)); 400 Debug.Assert (!capturedReferences.IsUnknown ()); 436 Debug.Assert (addMethod != null); 442 Debug.Assert (removeMethod != null); 509 Debug.Assert (operation.Value is not IFlowCaptureReferenceOperation); 529 Debug.Assert (!capturedReferences.IsUnknown ()); 574 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction); 624 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read)); 638 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Reference)); 672 Debug.Assert (operation.GetValueUsageInfo (OwningSymbol).HasFlag (ValueUsageInfo.Read)); 715 Debug.Assert (operation.Symbol.ContainingSymbol is IMethodSymbol or IFieldSymbol); 717 Debug.Assert (lambda.MethodKind == MethodKind.LambdaMethod); 824 Debug.Assert (localFunction.MethodKind == MethodKind.LocalFunction);
DataFlow\MethodBodyValue.cs (2)
23 Debug.Assert (owningSymbol is (IMethodSymbol or IFieldSymbol or IPropertySymbol)); 33 Debug.Assert (ControlFlowGraph == other.ControlFlowGraph);
DynamicallyAccessedMembersAnalyzer.cs (1)
72 Debug.Assert ((int) first < (int) last);
IOperationExtensions.cs (1)
116 Debug.Assert (parenthesizedOperation.Language == LanguageNames.VisualBasic);
src\tools\illink\src\ILLink.Shared\Annotations.cs (1)
54 Debug.Assert (memberTypes != DynamicallyAccessedMemberTypes.None);
src\tools\illink\src\ILLink.Shared\DataFlow\ForwardDataFlowAnalysis.cs (9)
70 Debug.Assert (entryOut != null); 194 Debug.Assert (successor.ConditionKind is ConditionKind.WhenTrue or ConditionKind.WhenFalse); 303 Debug.Assert (isPredecessorInFinally); 365 Debug.Assert (result); 376 Debug.Assert (exceptionState != null); 377 Debug.Assert (oldExceptionState != null); 383 Debug.Assert (enclosingTryOrCatch.Kind != RegionKind.Filter); 412 Debug.Assert (finallyExit != null); 415 Debug.Assert (finallyExit.Value.ConditionKind == ConditionKind.Unconditional);
src\tools\illink\src\ILLink.Shared\DataFlow\ValueSet.cs (4)
180 Debug.Assert (other._values == UnknownSentinel); 189 Debug.Assert (other._values == UnknownSentinel); 193 Debug.Assert (_values == UnknownSentinel); 223 Debug.Assert (_values == UnknownSentinel);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\HandleCallAction.cs (3)
86 Debug.Assert (requiresDataFlowAnalysis || annotatedMethodReturnValue.DynamicallyAccessedMemberTypes == DynamicallyAccessedMemberTypes.None); 90 Debug.Assert (instanceValue.IsEmpty ()); 91 Debug.Assert (argumentValues.Count == 1);
src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableSystemTypeValue.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\NullableValueWithDynamicallyAccessedMembers.cs (1)
23 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableSystemTypeValue.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
src\tools\illink\src\ILLink.Shared\TrimAnalysis\RuntimeTypeHandleForNullableValueWithDynamicallyAccessedMembers.cs (1)
21 Debug.Assert (nullableType.IsTypeOf (WellKnownType.System_Nullable_T));
TrimAnalysis\ArrayValue.cs (1)
77 System.Diagnostics.Debug.Assert (v is not ArrayValue);
TrimAnalysis\DiagnosticContext.cs (1)
48 Debug.Assert (Location != null);
TrimAnalysis\FlowAnnotations.cs (3)
153 Debug.Assert (parameterMethod != null); 163 Debug.Assert (property != null); 182 Debug.Assert (property != null);
TrimAnalysis\HandleCallAction.cs (1)
238 Debug.Assert (property != null);
TrimAnalysis\ReflectionAccessAnalyzer.cs (2)
110 Debug.Assert (member is IMethodSymbol or IFieldSymbol); 117 Debug.Assert (_typeHierarchyType is not null);
TrimAnalysis\TrimAnalysisAssignmentPattern.cs (2)
45 Debug.Assert (Operation == other.Operation); 46 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisFieldAccessPattern.cs (3)
36 Debug.Assert (SymbolEqualityComparer.Default.Equals (Field, other.Field)); 37 Debug.Assert (Operation == other.Operation); 38 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisGenericInstantiationPattern.cs (3)
35 Debug.Assert (Operation == other.Operation); 36 Debug.Assert (SymbolEqualityComparer.Default.Equals (GenericInstantiation, other.GenericInstantiation)); 37 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisMethodCallPattern.cs (4)
54 Debug.Assert (Operation == other.Operation); 55 Debug.Assert (SymbolEqualityComparer.Default.Equals (CalledMethod, other.CalledMethod)); 56 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol)); 57 Debug.Assert (Arguments.Length == other.Arguments.Length);
TrimAnalysis\TrimAnalysisReflectionAccessPattern.cs (3)
35 Debug.Assert (SymbolEqualityComparer.Default.Equals (ReferencedMethod, other.ReferencedMethod)); 36 Debug.Assert (Operation == other.Operation); 37 Debug.Assert (SymbolEqualityComparer.Default.Equals (OwningSymbol, other.OwningSymbol));
TrimAnalysis\TrimAnalysisVisitor.cs (2)
343 Debug.Assert (OwningSymbol is IMethodSymbol); 358 Debug.Assert (OwningSymbol is IMethodSymbol);
InMemory.FunctionalTests (10)
Http2\Http2TestBase.cs (2)
446Debug.Assert(index <= H2StaticTable.Count); 454Debug.Assert(index <= H2StaticTable.Count);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
299Debug.Assert(success);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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);
IntegrationTestsWebsite (1)
Infrastructure\DynamicServiceModelProvider.cs (1)
15Debug.Assert(CreateMethod != null);
InteractiveHost.UnitTests (1)
SynchronizedTextWriter.cs (1)
48Debug.Assert(!string.IsNullOrEmpty(mark));
IOperationGenerator (4)
IOperationClassWriter.cs (4)
333Debug.Assert(elementsToKindEnumerator.MoveNext()); 366Debug.Assert(elementsToKindEnumerator.MoveNext() || i == numKinds); 614Debug.Assert(baseProperties != null); 1100Debug.Assert(typeName.Length > 0);
KeyManagementSimulator (3)
Program.cs (3)
402Debug.Assert(now >= _now); 485Debug.Assert(pFail >= 0); 486Debug.Assert(pFail <= 1); // Allow 100% failure rate
Microsoft.Arcade.Test.Common (2)
DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.AspNetCore (3)
BootstrapHostBuilder.cs (1)
111Debug.Assert(descriptor.ImplementationType?.Name == "GenericWebHostService");
WebApplicationBuilder.cs (2)
391Debug.Assert(_builtApplication is not null); 495Debug.Assert(_builtApplication is not null);
Microsoft.AspNetCore.Analyzer.Testing (1)
DiagnosticVerifier.cs (1)
144Debug.Assert(sources.Length == documents.Length);
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 (14)
Internal\BinaryBlob.cs (2)
60Debug.Assert(_data.Length == other._data.Length); 73Debug.Assert(_data != null && _data.Length >= (32 / 8));
Internal\DefaultAntiforgery.cs (7)
54Debug.Assert(antiforgeryFeature.NewCookieTokenString != null); 184Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.CookieToken)); 185Debug.Assert(!string.IsNullOrEmpty(antiforgeryTokenSet.RequestToken)); 284Debug.Assert(antiforgeryFeature.HaveDeserializedCookieToken); 313Debug.Assert(_tokenGenerator.IsCookieTokenValid(newCookieToken)); 407Debug.Assert(antiforgeryFeature.HaveGeneratedNewCookieToken); 408Debug.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 (1)
26Debug.Assert(claimsPrincipal != null);
Microsoft.AspNetCore.App.Analyzers (63)
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 (5)
76Debug.Assert(expectedValueText == actualValueText); 132Debug.Assert(!token.ContainsDiagnostics); 136Debug.Assert(startDelimiter == ""); 137Debug.Assert(endDelimiter == ""); 218Debug.Assert(char.IsSurrogate(ch));
Infrastructure\VirtualChars\CSharpVirtualCharService.cs (9)
58Debug.Assert(!token.ContainsDiagnostics); 341Debug.Assert(char.IsSurrogate(ch)); 351Debug.Assert(tokenText[index] == '\\'); 364Debug.Assert(tokenText[index] == '\\'); 397Debug.Assert(tokenText[index] == '\\'); 416Debug.Assert(tokenText[index] == '\\'); 461Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 501Debug.Assert(character == 'x'); 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);
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
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.Authentication (1)
RemoteAuthenticationHandler.cs (1)
145Debug.Assert(ticket != null);
Microsoft.AspNetCore.Authentication.Cookies (1)
CookieAuthenticationHandler.cs (1)
212Debug.Assert(result.Ticket != null);
Microsoft.AspNetCore.Authentication.JwtBearer.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.AspNetCore.Authentication.Negotiate (3)
Internal\LdapAdapter.cs (1)
47Debug.Assert(settings.LdapConnection != null);
NegotiateHandler.cs (1)
140Debug.Assert(exception != null);
PostConfigureNegotiateOptions.cs (1)
49Debug.Assert(_serverAuth.AuthenticationScheme != null);
Microsoft.AspNetCore.Components (42)
Rendering\RenderTreeBuilder.cs (1)
790Debug.Assert(_hasSeenAddMultipleAttributes);
RenderTree\Renderer.cs (2)
287Debug.Assert(_pendingTasks == null); 344Debug.Assert(_pendingTasks is null || _pendingTasks.Count == 0);
Routing\SupplyParameterFromQueryValueProvider.cs (3)
54Debug.Assert(_subscribers is not null); 96Debug.Assert(url is not null); 126Debug.Assert(_subscribers is not null);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Http\Http.Abstractions\src\Routing\RouteValueDictionary.cs (1)
489Debug.Assert(_arrayStorage != null);
src\Http\Routing\src\Constraints\RegexRouteConstraint.cs (1)
68Debug.Assert(_regexFactory is not null);
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
161Debug.Assert(constructors.Count > 0);
src\Http\Routing\src\PathTokenizer.cs (3)
47Debug.Assert(_path[0] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
src\Http\Routing\src\Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
src\Http\Routing\src\Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
src\Http\Routing\src\Patterns\RoutePatternMatcher.cs (8)
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);
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\Http\Routing\src\Patterns\RoutePatternSeparatorPart.cs (1)
39Debug.Assert(!string.IsNullOrEmpty(content));
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\Http\Routing\src\Tree\TreeEnumerator.cs (1)
94Debug.Assert(next.Depth < _tokenizer.Count);
src\Http\Routing\src\Tree\UrlMatchingTree.cs (1)
98Debug.Assert(segment.Parts.Count == 1);
src\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
Microsoft.AspNetCore.Components.Endpoints (29)
Builder\RazorComponentEndpointDataSource.cs (4)
81Debug.Assert(_changeToken != null); 82Debug.Assert(_endpoints != null); 210Debug.Assert(_changeToken != null); 211Debug.Assert(_endpoints != null);
FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
FormMapping\HttpContextFormValueMapper.cs (1)
88Debug.Assert(deserializer != null);
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.Server (10)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.Assert(_rentedBuffer.Length - _index >= sizeHint);
src\SignalR\common\Protocols.MessagePack\src\Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Components.Web (10)
Forms\EditForm.cs (2)
133Debug.Assert(_editContext != null); 194Debug.Assert(_editContext != null);
Forms\InputDate.cs (1)
114Debug.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);
Routing\NavLink.cs (1)
132Debug.Assert(_hrefAbsolute != null);
Virtualization\Virtualize.cs (1)
189Debug.Assert(refreshTask.IsCompletedSuccessfully);
Microsoft.AspNetCore.Components.WebView (1)
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.AspNetCore.CookiePolicy (1)
ResponseCookiesWrapper.cs (1)
98Debug.Assert(key != null);
Microsoft.AspNetCore.Cryptography.Internal (4)
SafeHandles\BCryptAlgorithmHandle.cs (1)
45Debug.Assert(pbKey != null);
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 (39)
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 (2)
135Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor 172Debug.Assert(_descriptorException is null); // Mutually exclusive with _descriptor
KeyManagement\KeyRingBasedDataProtector.cs (4)
39Debug.Assert(keyRingProvider != null); 192Debug.Assert(protectedData != null); 334Debug.Assert(existingTemplate.Length >= sizeof(uint) /* MAGIC_HEADER */ + sizeof(Guid) /* keyId */); 410Debug.Assert(index == targetArr.Length);
KeyManagement\KeyRingProvider.cs (6)
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); 446Debug.Assert(task.IsCompleted);
KeyManagement\XmlKeyManager.cs (9)
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.
Repositories\DefaultKeyStorageDirectories.cs (1)
74Debug.Assert(retVal != null);
XmlEncryption\XmlEncryptionExtensions.cs (2)
62Debug.Assert(placeholderReplacements.Count > 0); 143Debug.Assert(placeholderReplacements.Count > 0);
Microsoft.AspNetCore.DataProtection.Abstractions (2)
DataProtectionCommonExtensions.cs (1)
53Debug.Assert(retVal is IDataProtector); // CreateProtector is supposed to return an instance of this interface
src\Shared\WebEncoders\WebEncoders.cs (1)
412Debug.Assert(output.Length >= GetArraySizeRequiredToEncode(input.Length));
Microsoft.AspNetCore.DeveloperCertificates.XPlat (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Microsoft.AspNetCore.Diagnostics (10)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (8)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
src\Shared\Diagnostics\BaseView.cs (3)
110Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 118Debug.Assert(AttributeValues != null); 119Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
Microsoft.AspNetCore.Grpc.JsonTranscoding (4)
Internal\JsonRequestHelpers.cs (1)
357Debug.Assert(read == data.Length);
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.Grpc.JsonTranscoding.Tests (3)
ConverterTests\JsonConverterReadTests.cs (1)
661Debug.Assert(objectOld != null);
UnaryServerCallHandlerTests.cs (2)
594Debug.Assert(requestMessage != null); 630Debug.Assert(requestMessage != null);
Microsoft.AspNetCore.Grpc.Swagger (3)
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 (11)
Http\DefaultHttpContextFactory.cs (2)
56Debug.Assert(featureCollection != null); 57Debug.Assert(httpContext != null);
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);
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
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\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\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
Microsoft.AspNetCore.Http.Abstractions (24)
PathString.cs (2)
158Debug.Assert(count > 0); 159Debug.Assert(buffer is not null);
Routing\RouteValueDictionary.cs (3)
489Debug.Assert(_arrayStorage != null); 772Debug.Assert(_propertyStorage != null); 885Debug.Assert(value != null);
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\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionContext.cs (1)
522Debug.Assert(Status == HttpConnectionStatus.Disposed);
Internal\HttpConnectionsMetrics.cs (1)
58Debug.Assert(transportType != HttpTransportType.None);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.Http.Connections.Client (9)
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);
Microsoft.AspNetCore.Http.Connections.Common (3)
NegotiateProtocol.cs (2)
64Debug.Assert(writer.CurrentDepth == 0); 133Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.Http.Extensions (21)
RequestDelegateFactory.cs (4)
244Debug.Assert(untargetableRequestDelegate is not null); 256Debug.Assert(targetableRequestDelegate is not null); 414Debug.Assert(factoryContext.EndpointBuilder.FilterFactories.Count > 0); 1982Debug.Assert(bindAsyncMethod.Expression is not null);
src\Components\Endpoints\src\FormMapping\Factories\NullableConverterFactory.cs (3)
26Debug.Assert(underlyingType != null); 29Debug.Assert(underlyingConverter != null); 32Debug.Assert(expectedConverterType != null);
src\Components\Endpoints\src\FormMapping\FormDataReader.cs (3)
202Debug.Assert(_currentDepth >= 0); 206Debug.Assert(_currentPrefixBuffer.Length >= keyLength); 235Debug.Assert(_prefixBuffer.Length >= (_currentPrefixBuffer.Length + separator.Length));
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\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.Http.RequestDelegateGenerator (2)
src\Shared\Diagnostics\AnalyzerDebug.cs (2)
12/// <inheritdoc cref="Debug.Assert(bool)"/> 14public static void Assert([DoesNotReturnIf(false)] bool b) => Debug.Assert(b);
Microsoft.AspNetCore.Http.Results (6)
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\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.HttpLogging (14)
BufferingStream.cs (1)
147Debug.Assert(_tail != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.Identity (1)
IdentityApiEndpointRouteBuilderExtensions.cs (1)
433Debug.Assert(!result.Succeeded);
Microsoft.AspNetCore.Identity.FunctionalTests (4)
src\Identity\Extensions.Core\src\Rfc6238AuthenticationService.cs (4)
40Debug.Assert(res); 53Debug.Assert(res); 54Debug.Assert(written == hash.Length); 61Debug.Assert(offset + 4 < hash.Length);
Microsoft.AspNetCore.Mvc.Abstractions (7)
ModelBinding\ModelMetadata.cs (4)
661Debug.Assert(_parameterMapping != null); 662Debug.Assert(_boundConstructorPropertyMapping != null); 749Debug.Assert(ModelType != null); 776Debug.Assert(ModelType != null);
ModelBinding\ModelStateDictionary.cs (2)
552Debug.Assert(key != null); 930Debug.Assert(ChildNodes != null);
src\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
Microsoft.AspNetCore.Mvc.Analyzers (3)
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.Api.Analyzers (3)
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.Core (231)
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)
205Debug.Assert(AuthorizeData != null);
Controllers\ControllerBinderDelegateProvider.cs (1)
60Debug.Assert(valueProvider is not null);
Formatters\AcceptHeaderParser.cs (2)
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 (15)
116Debug.Assert(state != null); 117Debug.Assert(_actionExecutingContext != null); 140Debug.Assert(state != null); 141Debug.Assert(_actionExecutingContext != null); 171Debug.Assert(state != null); 172Debug.Assert(_actionExecutingContext != null); 220Debug.Assert(state != null); 221Debug.Assert(_actionExecutingContext != null); 222Debug.Assert(_actionExecutedContext != null); 314Debug.Assert(_actionExecutedContext != null); 336Debug.Assert(invoker._actionExecutedContext != null); 342Debug.Assert(_actionExecutingContext != null); 355Debug.Assert(_actionExecutedContext != null); 362Debug.Assert(invoker._actionExecutedContext != null); 523Debug.Assert(_cacheEntry.ControllerBinderDelegate != null);
Infrastructure\DefaultActionDescriptorCollectionProvider.cs (4)
57Debug.Assert(_collection != null); 58Debug.Assert(_changeToken != null); 72Debug.Assert(_collection != null); 73Debug.Assert(_changeToken != null);
Infrastructure\ObjectResultExecutor.cs (1)
124Debug.Assert(result.ContentTypes != null);
Infrastructure\ResourceInvoker.cs (49)
335Debug.Assert(state != null); 336Debug.Assert(_authorizationContext != null); 359Debug.Assert(state != null); 360Debug.Assert(_authorizationContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_authorizationContext != null); 411Debug.Assert(state != null); 412Debug.Assert(_authorizationContext != null); 413Debug.Assert(_authorizationContext.Result != null); 471Debug.Assert(state != null); 472Debug.Assert(_resourceExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_resourceExecutingContext != null); 530Debug.Assert(state != null); 531Debug.Assert(_resourceExecutingContext != null); 573Debug.Assert(state != null); 574Debug.Assert(_resourceExecutingContext != null); 575Debug.Assert(_resourceExecutedContext != null); 599Debug.Assert(state != null); 600Debug.Assert(_resourceExecutingContext != null); 601Debug.Assert(_resourceExecutedContext != null); 647Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 666Debug.Assert(state != null); 696Debug.Assert(state != null); 697Debug.Assert(_exceptionContext != null); 733Debug.Assert(state != null); 782Debug.Assert(state != null); 783Debug.Assert(_exceptionContext != null); 856Debug.Assert(scope == Scope.Invoker || scope == Scope.Resource); 889Debug.Assert(scope == Scope.Invoker); 908Debug.Assert(_resourceExecutingContext != null); 922Debug.Assert(_resourceExecutedContext != null); 929Debug.Assert(invoker._resourceExecutedContext != null); 971Debug.Assert(_resourceExecutedContext != null); 993Debug.Assert(invoker._resourceExecutedContext != null); 1168Debug.Assert(state != null); 1169Debug.Assert(_resultExecutingContext != null); 1192Debug.Assert(state != null); 1193Debug.Assert(_resultExecutingContext != null); 1225Debug.Assert(state != null); 1226Debug.Assert(_resultExecutingContext != null); 1274Debug.Assert(state != null); 1275Debug.Assert(_resultExecutingContext != null); 1276Debug.Assert(_resultExecutedContext != null); 1373Debug.Assert(_resultExecutedContext != null); 1396Debug.Assert(invoker._resultExecutedContext != null); 1404Debug.Assert(_resultExecutingContext != null); 1418Debug.Assert(_resultExecutedContext != null); 1425Debug.Assert(invoker._resultExecutedContext != null);
ModelBinding\Binders\CollectionModelBinder.cs (1)
168Debug.Assert(model != null);
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 (1)
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\PrefixContainer.cs (2)
202Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase)); 259Debug.Assert(candidate.StartsWith(prefix, StringComparison.OrdinalIgnoreCase));
ModelBinding\SuppressChildValidationMetadataProvider.cs (1)
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); 427Debug.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)
308Debug.Assert(path.HasValue); 377Debug.Assert(pageName.Length > 0);
Routing\ViewEnginePath.cs (3)
18Debug.Assert(!string.IsNullOrEmpty(first)); 31Debug.Assert(index >= 0); 48Debug.Assert(!string.IsNullOrEmpty(path));
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\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
src\Shared\ResultsHelpers\SharedUrlHelper.cs (1)
26Debug.Assert(path.HasValue);
Microsoft.AspNetCore.Mvc.Core.Test (1)
ModelBinding\StubModelBinder.cs (1)
64Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Core.TestCommon (1)
ActivityReplacer.cs (1)
20Debug.Assert(Activity.Current == _activity);
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.IntegrationTests (6)
BinderTypeBasedModelBinderIntegrationTest.cs (5)
322Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 347Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 371Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 389Debug.Assert(bindingContext.Result == ModelBindingResult.Failed()); 401Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
GenericModelBinderIntegrationTest.cs (1)
170Debug.Assert(bindingContext.Result == ModelBindingResult.Failed());
Microsoft.AspNetCore.Mvc.Localization (1)
Properties\Resources.Designer.cs (1)
49System.Diagnostics.Debug.Assert(value != null);
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 (16)
CSharpCompiler.cs (3)
117Debug.Assert(_parseOptions is not null); 118Debug.Assert(_compilationOptions is not null); 119Debug.Assert(_emitOptions is not null);
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\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.Razor.RuntimeCompilation.Test (2)
TestInfrastructure\DirectoryNode.cs (2)
34Debug.Assert(directory != null); 113Debug.Assert(!string.IsNullOrEmpty(path));
Microsoft.AspNetCore.Mvc.RazorPages (78)
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 (28)
192Debug.Assert(_instance is not null); 213Debug.Assert(handlerBinder is not null); 214Debug.Assert(_arguments is not null); 253Debug.Assert(_instance is not null); 254Debug.Assert(_arguments is not null); 321Debug.Assert(_instance is not null); 357Debug.Assert(state != null); 358Debug.Assert(_handlerSelectedContext != null); 381Debug.Assert(state != null); 382Debug.Assert(_handlerSelectedContext != null); 397Debug.Assert(state != null); 398Debug.Assert(_handlerSelectedContext != null); 439Debug.Assert(_instance is not null); 440Debug.Assert(_arguments is not null); 471Debug.Assert(state != null); 472Debug.Assert(_handlerExecutingContext != null); 495Debug.Assert(state != null); 496Debug.Assert(_handlerExecutingContext != null); 498Debug.Assert(_instance is not null); 529Debug.Assert(state != null); 530Debug.Assert(_handlerExecutingContext != null); 531Debug.Assert(_instance is not null); 580Debug.Assert(state != null); 581Debug.Assert(_handlerExecutingContext != null); 582Debug.Assert(_handlerExecutedContext != null); 670Debug.Assert(_handlerExecutedContext != null); 675Debug.Assert(_handlerExecutingContext != null); 690Debug.Assert(_handlerExecutedContext != null);
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 (7)
CacheTagHelper.cs (1)
269Debug.Assert(length == 0);
CurrentValues.cs (1)
12Debug.Assert(values != null);
LinkTagHelper.cs (2)
325Debug.Assert(url != null); 451Debug.Assert(fallbackHrefs[i] != null);
ScriptTagHelper.cs (2)
338Debug.Assert(url != null); 366Debug.Assert(src != null);
TagHelperOutputExtensions.cs (1)
99Debug.Assert(found);
Microsoft.AspNetCore.Mvc.Testing (2)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
294Debug.Assert(_hostTcs.Task.IsCompleted);
Handlers\RedirectHandler.cs (1)
137Debug.Assert(response.RequestMessage is not null);
Microsoft.AspNetCore.Mvc.ViewFeatures (46)
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)
71Debug.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);
ModelExplorer.cs (2)
127Debug.Assert(Container != null); 202Debug.Assert(propertyHelper != null);
ModelExplorerExtensions.cs (1)
53Debug.Assert(enumGroupedDisplayNamesAndValues != null);
src\Shared\PooledArrayBufferWriter.cs (6)
80Debug.Assert(_rentedBuffer != null); 144Debug.Assert(_rentedBuffer != null); 165Debug.Assert(oldBuffer.Length >= _index); 166Debug.Assert(_rentedBuffer.Length >= _index); 174Debug.Assert(_rentedBuffer.Length - _index > 0); 175Debug.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 (5)
Schemas\OpenApiJsonSchema.Helpers.cs (1)
202Debug.Assert(type is not null);
src\Shared\ParameterBindingMethodCache.cs (1)
725Debug.Assert(obj is ParameterLookupKey);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
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 (5)
97Debug.Assert(keys != null); 115Debug.Assert(key != null); 136Debug.Assert(tags != null); 137Debug.Assert(tags.Length > 0); 138Debug.Assert(key is string);
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);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (6)
RedisOutputCacheStore.cs (6)
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);
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.Runtime.Test (1)
Runtime\TagHelpers\TagHelperRunnerTest.cs (1)
259Debug.Assert(ProcessOrderTracker != null);
Microsoft.AspNetCore.ResponseCaching (3)
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.ResponseCompression (4)
ResponseCompressionMiddleware.cs (1)
51Debug.Assert(originalBodyFeature != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Rewrite (6)
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);
Microsoft.AspNetCore.Routing (84)
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 (4)
43Debug.Assert(x != null); 44Debug.Assert(y != null); 79Debug.Assert(x != null); 80Debug.Assert(y != null);
Matching\ILEmitTrieFactory.cs (3)
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] == '/'); 97Debug.Assert(_path[_path.Length - 1] != '/'); 98Debug.Assert(currentSegmentIndex == index);
Patterns\RoutePattern.cs (5)
48Debug.Assert(defaults != null); 49Debug.Assert(parameterPolicies != null); 50Debug.Assert(parameters != null); 51Debug.Assert(requiredValues != null); 52Debug.Assert(pathSegments != null);
Patterns\RoutePatternLiteralPart.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(content));
Patterns\RoutePatternMatcher.cs (8)
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);
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 (1)
247Debug.Assert(factoryCreatedRequestDelegate is not null);
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 (1)
98Debug.Assert(segment.Parts.Count == 1);
UriBuildingContext.cs (1)
171Debug.Assert(result);
Microsoft.AspNetCore.Routing.Abstractions (19)
RouteData.cs (1)
146Debug.Assert(_routers != null);
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 (29)
AsyncAcceptContext.cs (2)
72Debug.Assert(_requestContext != null); 172Debug.Assert(_requestContext != null);
MessagePump.cs (3)
106Debug.Assert(application != null); 162Debug.Assert(RequestContextFactory != null); 270Debug.Assert(_messagePump.Stopping);
NativeInterop\RequestQueue.cs (2)
109Debug.Assert(Created); 125Debug.Assert(Created);
RequestProcessing\RequestContext.FeatureCollection.cs (1)
80Debug.Assert(_features != null);
RequestProcessing\Response.cs (2)
610Debug.Assert(HasTrailers); 656Debug.Assert(unknownHeadersOffset == trailerCount);
RequestProcessing\ResponseBody.cs (1)
223Debug.Assert(hasData);
RequestProcessing\ResponseStreamAsyncResult.cs (2)
94Debug.Assert(currentChunk == _dataChunks.Length); 135Debug.Assert(currentChunk == _dataChunks.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\PathNormalizer\PathNormalizer.cs (1)
98Debug.Assert(src[0] == '/');
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
UrlPrefixCollection.cs (2)
214Debug.Assert(_urlGroup != null); 224Debug.Assert(port >= 5000 || port < 8000);
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (24)
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
Microsoft.AspNetCore.Server.IIS (27)
Core\IISHttpContext.cs (2)
451Debug.Assert(_hasResponseStarted == false); 491Debug.Assert(!HasStartedConsumingRequestBody);
Core\IISHttpContext.FeatureCollection.cs (1)
365Debug.Assert(_readBodyTask == null || _readBodyTask.IsCompleted);
Core\IO\AsyncIOEngine.cs (1)
175Debug.Assert(_runningOperation != null);
Core\IO\WebSocketsAsyncIOEngine.cs (2)
37Debug.Assert(!read.InUse()); 53Debug.Assert(!write.InUse());
Core\OutputProducer.cs (1)
119Debug.Assert(false);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\PathNormalizer\PathNormalizer.cs (1)
98Debug.Assert(src[0] == '/');
src\Shared\RazorViews\BaseView.cs (3)
150Debug.Assert(string.IsNullOrEmpty(AttributeEnding)); 158Debug.Assert(AttributeValues != null); 159Debug.Assert(!string.IsNullOrEmpty(AttributeEnding));
src\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Core (267)
AnyIPListenOptions.cs (1)
20Debug.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\Http\Http1Connection.cs (2)
160Debug.Assert(MinRequestBodyDataRate != null); 293Debug.Assert(startLine.IndexOf((byte)0) == -1);
Internal\Http\Http1OutputProducer.cs (7)
175Debug.Assert(!producer._pipeWriterCompleted); 176Debug.Assert(producer._autoChunk && producer._advancedBytesForChunk > 0); 540Debug.Assert(_currentSegmentOwner == null); 541Debug.Assert(_completedSegments == null || _completedSegments.Count == 0); 647Debug.Assert(_advancedBytesForChunk <= _currentChunkMemory.Length); 648Debug.Assert(_advancedBytesForChunk > 0); 652Debug.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)
73Debug.Assert(foundDelimiter); 80Debug.Assert(readResult); 345Debug.Assert(result);
Internal\Http\HttpProtocol.cs (3)
725Debug.Assert(_bodyControl != null); 1017Debug.Assert(_requestRejectedException != null); 1620Debug.Assert(!HasResponseStarted);
Internal\Http\ReasonPhrases.cs (1)
84Debug.Assert(!string.IsNullOrEmpty(reasonPhrase));
Internal\Http2\Http2Connection.cs (9)
269Debug.Assert(Limits.MinRequestBodyDataRate != null); 425Debug.Assert(_currentHeadersStream != null); 1221Debug.Assert(_currentHeadersStream != null); 1248Debug.Assert(_currentHeadersStream != null); 1263Debug.Assert(_currentHeadersStream != null); 1530Debug.Assert(TimeoutControl.TimerReason == TimeoutReason.RequestHeaders || 1548Debug.Assert(index <= H2StaticTable.Count); 1556Debug.Assert(index <= H2StaticTable.Count); 1574Debug.Assert(_currentHeadersStream != null);
Internal\Http2\Http2FrameWriter.cs (5)
254Debug.Assert(actual <= int.MaxValue); 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); 316Debug.Assert(_unconsumedBytes > 0);
Internal\Http2\Http2Stream.cs (3)
164Debug.Assert(_decrementCalled); 446Debug.Assert(32 < ch && ch < 127); 513Debug.Assert(flushTask.IsCompletedSuccessfully);
Internal\Http3\Http3Connection.cs (7)
384Debug.Assert(streamDirectionFeature != null); 385Debug.Assert(streamIdFeature != null); 625Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 891Debug.Assert(!stream.IsReceivingHeader); 902Debug.Assert(Limits.MinRequestBodyDataRate != null); 918Debug.Assert(_context.ServiceContext.ServerOptions.EnableWebTransportAndH3Datagrams); 923Debug.Assert(!_webtransportSessions.ContainsKey(http3Stream.StreamId));
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 (3)
206Debug.Assert(index <= H3StaticTable.Count); 214Debug.Assert(index <= H3StaticTable.Count); 1167Debug.Assert(32 < ch && ch < 127);
Internal\Http3\QPackHeaderWriter.cs (1)
15Debug.Assert(hasValue == true);
Internal\Infrastructure\HttpUtilities.cs (4)
59Debug.Assert(operationStatus == OperationStatus.Done); 71Debug.Assert(operationStatus == OperationStatus.Done); 101Debug.Assert(written == destination.Length); 281Debug.Assert(WordListForPerfectHashOfMethods.Length == (MaxHashValue + 1) && methodsLookup.Length == (MaxHashValue + 1));
Internal\Infrastructure\KestrelMetrics.cs (2)
422Debug.Assert(reason != ConnectionEndReason.Unset); 435Debug.Assert(reason != ConnectionEndReason.Unset);
Internal\Infrastructure\PipeWriterHelpers\ConcurrentPipeWriter.cs (4)
163Debug.Assert(_currentFlushTcs != null); 249Debug.Assert(_tail != null); 305Debug.Assert(_currentFlushTcs != null); 338Debug.Assert(_tail != null);
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 (1)
116Debug.Assert(_minReadRate != null);
Internal\WebTransport\WebTransportSession.cs (1)
136Debug.Assert(success);
KestrelConfigurationLoader.cs (1)
318Debug.Assert(ReloadOnChange);
KestrelServerOptions.cs (1)
312Debug.Assert(DevelopmentCertificate is null);
Middleware\HttpsConnectionMiddleware.cs (1)
93Debug.Assert(_serverCertificate != null);
src\Shared\Buffers\BufferSegment.cs (4)
27Debug.Assert(value <= AvailableMemory.Length); 64Debug.Assert(_memoryOwner != null); 102Debug.Assert(segment != null); 103Debug.Assert(Next == null);
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
158Debug.Assert(removed != null);
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\PathNormalizer\PathNormalizer.cs (1)
98Debug.Assert(src[0] == '/');
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 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\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (11)
src\Servers\Kestrel\shared\KnownHeaders.cs (4)
773Debug.Assert(requestHeaders.Length <= 64); 774Debug.Assert(requestHeaders.Max(x => x.Index) <= 62); 778Debug.Assert(responseHeaders.Length <= 63); 779Debug.Assert(responseHeaders.Count(x => x.Index == 63) == 1);
src\Servers\Kestrel\shared\test\RevocationResponder.cs (1)
314System.Diagnostics.Debug.Assert(read == requestBytes.Length);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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\Shared\test\Shared.Tests\runtime\Http2\DynamicTableTest.cs (1)
157Debug.Assert(data.Length == 16);
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (10)
Http2\Http2ConnectionBenchmarkBase.cs (3)
106Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS); 108Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.WINDOW_UPDATE); 110Debug.Assert(_receiveHttpFrame.Type == Http2FrameType.SETTINGS);
src\Servers\Kestrel\shared\test\Http3\Http3InMemory.cs (1)
299Debug.Assert(success);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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.NamedPipes (6)
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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\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); 184Debug.Assert(_stream != null); 204Debug.Assert(_stream != null); 352Debug.Assert(_streamClosedTokenSource != null); 367Debug.Assert(_stream != null); 522Debug.Assert(_stream != null);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (12)
Internal\SocketConnection.cs (3)
44Debug.Assert(socket != null); 45Debug.Assert(memoryPool != null); 46Debug.Assert(logger != null);
Internal\SocketSender.cs (2)
78Debug.Assert(!buffer.IsEmpty); 79Debug.Assert(!buffer.IsSingleSegment);
SocketConnectionListener.cs (1)
51Debug.Assert(listenSocket.LocalEndPoint != null);
src\Servers\Kestrel\shared\TransportConnection.cs (1)
72Debug.Assert(Application != null);
src\Shared\Buffers.MemoryPool\DiagnosticPoolBlock.cs (1)
204Debug.Assert(_memoryHandle.HasValue);
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.Shared.Tests (89)
runtime\Http2\DynamicTableTest.cs (1)
157Debug.Assert(data.Length == 16);
src\Shared\Dictionary\AdaptiveCapacityDictionary.cs (8)
229Debug.Assert(_arrayStorage == null); 515Debug.Assert(_arrayStorage != null); 545Debug.Assert(_arrayStorage is not null); 546Debug.Assert(_count <= _arrayStorage.Length); 556Debug.Assert(_dictionaryStorage == null); 557Debug.Assert(_arrayStorage != null); 576Debug.Assert(_dictionaryStorage == null); 577Debug.Assert(_arrayStorage != null);
src\Shared\Hpack\DynamicHPackEncoder.cs (1)
158Debug.Assert(removed != null);
src\Shared\Hpack\EncoderHeaderEntry.cs (2)
32Debug.Assert(name != null); 33Debug.Assert(value != null);
src\Shared\HttpSys\RequestProcessing\NativeRequestContext.cs (2)
168Debug.Assert(_backingBuffer != null); 226Debug.Assert((int)HTTP_VERB.HttpVerbMaximum == HttpVerbs.Length);
src\Shared\PathNormalizer\PathNormalizer.cs (1)
98Debug.Assert(src[0] == '/');
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\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
src\Shared\runtime\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\Shared\runtime\Http2\Hpack\HPackEncoder.cs (17)
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);
src\Shared\runtime\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\Shared\runtime\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\Shared\runtime\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\Shared\runtime\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 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\Shared\runtime\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\Shared\ServerInfrastructure\BufferExtensions.cs (1)
235Debug.Assert(totalBytesUsed == encodedLength);
src\Shared\ServerInfrastructure\StringUtilities.cs (3)
34Debug.Assert(destination[0] == '\0' || written == destination.Length); 63Debug.Assert(written == destination.Length); 82Debug.Assert(IsValidHeaderString(previousValue));
src\Shared\StackTrace\StackFrame\StackTraceHelper.cs (2)
198Debug.Assert(method != null); 199Debug.Assert(method.DeclaringType != null);
src\Shared\TaskToApm.cs (3)
79Debug.Assert(task != null); 104Debug.Assert(!CompletedSynchronously); 105Debug.Assert(_callback != null);
Microsoft.AspNetCore.SignalR.Client.Core (7)
HubConnection.cs (3)
878Debug.Assert(genericTypes.Length == 1); 927Debug.Assert(methodInfo == _sendIAsyncStreamItemsMethod); 2299Debug.Assert(_messageBuffer is not null);
src\SignalR\common\Shared\MessageBuffer.cs (3)
326Debug.Assert(_currentIndex == -1); 332Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 374Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Client.Tests (3)
ServerSentEventsTransportTests.cs (1)
513Debug.Assert(buffer.Length > _contents[_index].Length);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Common (5)
Protocol\HandshakeProtocol.cs (2)
69Debug.Assert(writer.CurrentDepth == 0); 100Debug.Assert(writer.CurrentDepth == 0);
src\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Core (18)
HubConnectionContext.cs (1)
302Debug.Assert(_messageBuffer is not null);
Internal\ChannelBasedSemaphore.cs (1)
74Debug.Assert(false);
Internal\DefaultHubDispatcher.cs (2)
371Debug.Assert(hub.Clients is HubCallerClients); 683Debug.Assert(authorizePolicy != null);
Internal\HubMethodDescriptor.cs (1)
266Debug.Assert(adapterMethodInfo == MakeAsyncEnumeratorFromChannelMethod);
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\SignalR\common\Shared\MessageBuffer.cs (3)
326Debug.Assert(_currentIndex == -1); 332Debug.Assert(_startingSequenceId + _currentIndex + 1 == sequenceId); 374Debug.Assert(numElements > 0 && numElements < BufferLength + 1);
src\SignalR\common\Shared\ReflectionHelper.cs (1)
35Debug.Assert(nullableType.GetGenericArguments().Length == 1);
Microsoft.AspNetCore.SignalR.Protocols.Json (4)
Protocol\JsonHubProtocol.cs (3)
571Debug.Assert(writer.CurrentDepth == 0); 791Debug.Assert(arguments != null); 809Debug.Assert(arguments != null);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Protocol\MessagePackHubProtocolWorker.cs (1)
376Debug.Assert(written == prefixLength);
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\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
src\SignalR\common\Shared\Utf8BufferTextWriter.cs (1)
126Debug.Assert(charsUsed == 1);
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
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\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\SignalR\common\Shared\MemoryBufferWriter.cs (2)
249Debug.Assert(span.Length >= _bytesWritten); 273Debug.Assert(_bytesWritten == totalWritten + _position);
Microsoft.AspNetCore.SignalR.Tests (1)
TestFilters.cs (1)
48Debug.Assert(syncPoints.Length == 3);
Microsoft.AspNetCore.SpaServices.Extensions (1)
Npm\NodeScriptRunner.cs (1)
109Debug.Assert(chunk.Array != null);
Microsoft.AspNetCore.StaticAssets (5)
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);
Microsoft.AspNetCore.StaticFiles (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.StaticFiles.FunctionalTests (1)
src\Shared\RangeHelper\RangeHelper.cs (1)
67Debug.Assert(rangeHeader.Ranges.Count == 1);
Microsoft.AspNetCore.TestHost (3)
.packages\microsoft.extensions.hostfactoryresolver.sources\10.0.0-preview.2.25102.2\contentFiles\cs\netstandard2.0\HostFactoryResolver.cs (1)
294Debug.Assert(_hostTcs.Task.IsCompleted);
ResponseBodyReaderStream.cs (1)
116Debug.Assert(innerException != null);
WebSocketClient.cs (1)
104Debug.Assert(webSocketFeature != null);
Microsoft.AspNetCore.WebSockets (10)
HandshakeHelpers.cs (4)
175Debug.Assert(ret); 176Debug.Assert(written == len); 270Debug.Assert(ret); 271Debug.Assert(written == len);
src\Shared\ValueStringBuilder\ValueListBuilder.cs (1)
47Debug.Assert(_pos == _span.Length);
src\Shared\ValueStringBuilder\ValueStringBuilder.cs (5)
37Debug.Assert(value >= 0); 38Debug.Assert(value <= _chars.Length); 48Debug.Assert(capacity >= 0); 86Debug.Assert(index < _pos); 289Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.AspNetCore.WebUtilities (21)
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 298Debug.Assert(matchCount == length); 315Debug.Assert(read == length); // It should have all been buffered
src\Shared\QueryStringEnumerable.cs (1)
102Debug.Assert(success);
Microsoft.AspNetCore.WebUtilities.Microbenchmarks (2)
HttpRequestStreamReaderReadLineBenchmark.cs (2)
33Debug.Assert(result.Length == Length - 2); 42Debug.Assert(result.Length == Length - 2);
Microsoft.Build (56)
BackEnd\BuildManager\BuildManager.cs (20)
677Debug.Assert(Monitor.IsEntered(_syncLock)); 1354Debug.Assert(!Monitor.IsEntered(_syncLock)); 1368Debug.Assert(Monitor.IsEntered(_syncLock)); 1470Debug.Assert(Monitor.IsEntered(_syncLock)); 1661Debug.Assert(!Monitor.IsEntered(_syncLock)); 1682Debug.Assert(!Monitor.IsEntered(_syncLock)); 1763Debug.Assert(!Monitor.IsEntered(_syncLock)); 2217Debug.Assert(Monitor.IsEntered(_syncLock)); 2250Debug.Assert(Monitor.IsEntered(_syncLock)); 2258Debug.Assert(Monitor.IsEntered(_syncLock)); 2375Debug.Assert(Monitor.IsEntered(_syncLock)); 2401Debug.Assert(Monitor.IsEntered(_syncLock)); 2478Debug.Assert(Monitor.IsEntered(_syncLock)); 2570Debug.Assert(Monitor.IsEntered(_syncLock)); 2619Debug.Assert(Monitor.IsEntered(_syncLock)); 2745Debug.Assert(Monitor.IsEntered(_syncLock)); 2771Debug.Assert(Monitor.IsEntered(_syncLock)); 2915Debug.Assert(Monitor.IsEntered(_syncLock)); 3179Debug.Assert(Monitor.IsEntered(_syncLock)); 3260Debug.Assert(Monitor.IsEntered(_syncLock));
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
843Debug.Assert(coresAcquired >= 1);
BuildCheck\Infrastructure\EditorConfig\EditorConfigFile.cs (4)
99Debug.Assert(!string.IsNullOrEmpty(sectionName)); 112Debug.Assert(!string.IsNullOrEmpty(key)); 113Debug.Assert(key == key.Trim()); 114Debug.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\RetrievableEntryHashSet.cs (4)
238Debug.Assert(String.Equals(name, value.Key, StringComparison.Ordinal)); 287Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 401Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal)); 607Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
Definition\BuiltInMetadata.cs (1)
76Debug.Assert(FileUtilities.ItemSpecModifiers.IsItemSpecModifier(name));
Definition\ProjectCollection.cs (2)
1654Debug.Assert(_locker.IsWriteLockHeld); 1672Debug.Assert(_locker.IsWriteLockHeld);
Evaluation\Conditionals\Scanner.cs (1)
111Debug.Assert(-1 != _errorPosition); // We should have set it
Evaluation\LazyItemEvaluator.cs (1)
211Debug.Assert(_cache == null);
FileMatcher.cs (3)
1966Debug.Assert(projectDirectoryUnescaped != null); 1967Debug.Assert(filespecUnescaped != null); 1968Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
Graph\ProjectGraph.cs (1)
840Debug.Assert(_evaluationContext is not null);
Utilities\FileSpecMatchTester.cs (4)
23Debug.Assert(!string.IsNullOrEmpty(unescapedFileSpec)); 24Debug.Assert(currentDirectory != null); 58Debug.Assert(!string.IsNullOrEmpty(fileToMatch)); 78Debug.Assert(!string.IsNullOrEmpty(normalizedFileToMatch));
Utilities\SimpleVersion.cs (1)
183Debug.Assert(value >= 0);
WindowsFileSystem.cs (2)
132Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 194Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
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.Engine.OM.UnitTests (7)
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
132Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 194Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.Build.Framework (63)
ArraySortHelper.cs (49)
108Debug.Assert(i != j); 121Debug.Assert(i != j); 130Debug.Assert(comparer != null); 140Debug.Assert(keys.Length > 0); 141Debug.Assert(depthLimit >= 0); 142Debug.Assert(comparer != null); 185Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 186Debug.Assert(comparer != null); 230Debug.Assert(comparer != null); 231Debug.Assert(keys.Length > 0); 248Debug.Assert(comparer != null); 249Debug.Assert(lo >= 0); 250Debug.Assert(lo < keys.Length); 410Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 419Debug.Assert(keys.Length > 0); 420Debug.Assert(depthLimit >= 0); 466Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 529Debug.Assert(keys.Length > 0); 546Debug.Assert(lo >= 0); 547Debug.Assert(lo < keys.Length); 689Debug.Assert(comparer != null); 690Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 691Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 692Debug.Assert(i != j); 709Debug.Assert(i != j); 722Debug.Assert(comparer != null); 723Debug.Assert(keys.Length == values.Length); 733Debug.Assert(keys.Length > 0); 734Debug.Assert(values.Length == keys.Length); 735Debug.Assert(depthLimit >= 0); 736Debug.Assert(comparer != null); 779Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 780Debug.Assert(comparer != null); 824Debug.Assert(comparer != null); 825Debug.Assert(keys.Length > 0); 842Debug.Assert(comparer != null); 843Debug.Assert(lo >= 0); 844Debug.Assert(lo < keys.Length); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1096Debug.Assert(lo >= 0); 1097Debug.Assert(lo < keys.Length); 1237Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
BinaryTranslator.cs (1)
639Debug.Assert(count == 2);
HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
SegmentedArray.cs (5)
106Debug.Assert(length > 0); 107Debug.Assert(sourceIndex >= 0); 108Debug.Assert(destinationIndex >= 0); 109Debug.Assert((uint)(sourceIndex + length) <= array.Length); 110Debug.Assert((uint)(destinationIndex + length) <= array.Length);
SegmentedDictionary`2.cs (4)
195Debug.Assert(modified); 202Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 479Debug.Assert(_buckets.Length > 0); 651Debug.Assert(newSize >= _entries.Length);
Microsoft.Build.Tasks.CodeAnalysis (11)
CommandLineBuilderExtension.cs (1)
124Debug.Assert(!_isQuotingRequired);
MapSourceRoots.cs (1)
176Debug.Assert(mappedTopLevelPath.EndsWith("/", StringComparison.Ordinal));
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
504Debug.Assert(reason is object);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Compilers\Shared\BuildServerConnection.cs (4)
68Debug.Assert(workingDirectory is object); 179Debug.Assert(pipeName is object); 703Debug.Assert(Stream is null); 741Debug.Assert(Stream is not null);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (1)
TestUtilities\DotNetSdkTestBase.cs (1)
149Debug.Assert(s_dotnetInstallDir is object);
Microsoft.Build.Tasks.Core (18)
FileMatcher.cs (3)
1966Debug.Assert(projectDirectoryUnescaped != null); 1967Debug.Assert(filespecUnescaped != null); 1968Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
GenerateApplicationManifest.cs (2)
396Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 414Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateDeploymentManifest.cs (2)
138Debug.Assert(!String.IsNullOrEmpty(manifest.Product)); 150Debug.Assert(!String.IsNullOrEmpty(manifest.Publisher));
GenerateResource.cs (1)
3372Debug.Assert(_logger.HasLoggedErrors);
RedistList.cs (2)
895Debug.Assert(firstEntry != null && secondEntry != null); 1084Debug.Assert(name != null && frameworkDirectory != null);
ResolveManifestFiles.cs (1)
958Debug.Assert(!String.IsNullOrEmpty(targetPath));
WindowsFileSystem.cs (2)
132Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 194Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.Build.Utilities.Core (10)
FileMatcher.cs (3)
1966Debug.Assert(projectDirectoryUnescaped != null); 1967Debug.Assert(filespecUnescaped != null); 1968Debug.Assert(Path.IsPathRooted(projectDirectoryUnescaped));
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
132Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 194Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
Microsoft.CodeAnalysis (2224)
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 (15)
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); 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); 461Debug.Assert(toRemove == next || toRemove.TotalSize == 0); 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 (30)
90Debug.Assert(!_pendingBlockCreate || (_currentBlock == null)); 102Debug.Assert(_currentBlock == null); 121Debug.Assert(_lastCompleteBlock.NextBlock == null); 131Debug.Assert(_currentBlock == null); 134Debug.Assert(_currentBlock != null); 135Debug.Assert(!_pendingBlockCreate); 167Debug.Assert((startMarker < 0) || (startMarker == (_lastCompleteBlock.LastILMarker + 1))); 259Debug.Assert(AllBlocks(block => (block.Reachability == Reachability.NotReachable))); 432Debug.Assert(handlerBlock != null); 438Debug.Assert(handlerBlock.NextExceptionHandler == null); 460Debug.Assert(handlerBlock.Type == BlockType.Catch || handlerBlock.Type == BlockType.Fault || handlerBlock.Type == BlockType.Filter); 471Debug.Assert(block.EnclosingHandler.LastFilterConditionBlock.BranchCode == ILOpCode.Endfilter); 521Debug.Assert(!IsSpecialEndHandlerBlock(targetBlock)); 581Debug.Assert(!IsSpecialEndHandlerBlock(targetBlock)); 693Debug.Assert(AllBlocks(block => (block.Reachability == Reachability.Reachable) || (block.Reachability == Reachability.BlockedByFinally))); 737Debug.Assert(current.Reachability != Reachability.BlockedByFinally || 758Debug.Assert(AllBlocks(block => !IsSpecialEndHandlerBlock(block))); 773Debug.Assert(block.BranchBlock == block); 900Debug.Assert(blockLastMarker >= blockFirstMarker); 951Debug.Assert(btOffset == offset); 989Debug.Assert(lastOffset < offset); 992Debug.Assert((lastOffset >= 0) || (offset == 0)); 1030Debug.Assert(this.SeqPointsOpt.Count == 0); 1073Debug.Assert(_initialHiddenSequencePointMarker < 0); 1078Debug.Assert(_initialHiddenSequencePointMarker == 0); 1094Debug.Assert(_emitState.CurStack == 0); 1100Debug.Assert(_emitState.InstructionsEmitted >= _instructionCountAtLastLabel); 1130Debug.Assert(!_pendingBlockCreate); 1138Debug.Assert(!_pendingBlockCreate); 1241Debug.Assert(curBlock != null);
CodeGen\ILBuilderConversions.cs (2)
227Debug.Assert(fromPredefTypeKind.IsFloatingPoint()); 264Debug.Assert(fromPredefTypeKind.IsFloatingPoint());
CodeGen\ILBuilderEmit.cs (10)
177Debug.Assert(validOpCode); 178Debug.Assert(revOpCode == ILOpCode.Nop || revOpCode.IsBranch()); 179Debug.Assert(!code.HasVariableStackBehavior()); 199Debug.Assert((code != ILOpCode.Nop) || (block == _labelInfos[label].bb)); 237Debug.Assert(caseLabels.Length > 0); 266Debug.Assert(caseLabels.Length > 0); 267Debug.Assert(keyTypeCode != Cci.PrimitiveTypeCode.String); 309Debug.Assert(!this.InExceptionHandler); 752Debug.Assert(alignment is 1 or 2 or 4); 798Debug.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 (1)
248Debug.Assert(slot.Name == null);
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 (3)
77Debug.Assert(!locals.IsDefault); 78Debug.Assert(!exceptionHandlers.IsDefault); 79Debug.Assert(!localScopes.IsDefault);
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 (26)
202Debug.Assert(!IsFrozen); 206Debug.Assert(typeCode is 226Debug.Assert(!IsFrozen); 228Debug.Assert(typeCode is not Cci.PrimitiveTypeCode.Reference); 246Debug.Assert(!IsFrozen); 247Debug.Assert(alignment is 1 or 2 or 4 or 8); 248Debug.Assert(length != 1 || alignment == 1); 377Debug.Assert(method is not null); 396Debug.Assert(!IsFrozen); 400Debug.Assert(_mvidField.Type == mvidType); 408Debug.Assert(!IsFrozen); 412Debug.Assert(_moduleCancellationTokenField.Type == cancellationTokenType); 421Debug.Assert(!IsFrozen); 425Debug.Assert(payloadRootField.Type == payloadRootType); 432Debug.Assert(IsFrozen); 439Debug.Assert(!IsFrozen); 447Debug.Assert(IsFrozen); 453Debug.Assert(IsFrozen); 459Debug.Assert(IsFrozen); 487Debug.Assert(!IsFrozen); 488Debug.Assert(type.Name is { }); 500Debug.Assert(IsFrozen); 506Debug.Assert(IsFrozen); 539Debug.Assert(context.Module == ModuleBuilder); 555Debug.Assert(bytesWritten == hash.Length); 952Debug.Assert(!block.IsDefault);
CodeGen\SequencePointList.cs (1)
97Debug.Assert(ilOffset >= 0);
CodeGen\SwitchIntegralJumpTableEmitter.cs (13)
62Debug.Assert(caseLabels.Length > 0); 100Debug.Assert(!_sortedCaseLabels.IsEmpty); 145Debug.Assert(SwitchConstantValueHelper.IsValidSwitchCaseLabelConstant(firstConstant) 149Debug.Assert(SwitchConstantValueHelper.IsValidSwitchCaseLabelConstant(secondConstant) 180Debug.Assert(startLabelIndex >= 0 && startLabelIndex <= endLabelIndex); 181Debug.Assert(_sortedCaseLabels.Length > endLabelIndex); 220Debug.Assert(!switchBucketsStack.IsEmpty); 253Debug.Assert(startLabelIndex >= 0 && startLabelIndex <= endLabelIndex); 382Debug.Assert(i == bucketSize - 1); 390Debug.Assert(nextCaseLabelValue > startConstant.Int64Value); 396Debug.Assert(nextCaseLabelValue > startConstant.UInt64Value); 406Debug.Assert(nextCaseIndex >= switchBucket.LabelsCount); 416Debug.Assert(branchCode.IsBranch());
CodeGen\SwitchIntegralJumpTableEmitter.SwitchBucket.cs (9)
64Debug.Assert((uint)startIndex < (uint)endIndex); 74Debug.Assert((uint)startIndex <= (uint)endIndex); 75Debug.Assert((uint)startIndex != (uint)endIndex || isDegenerate); 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)
75Debug.Assert(caseLabels.Length > 0); 89Debug.Assert(_keyHash == null || ShouldGenerateHashTableSwitch(_caseLabels.Length)); 104Debug.Assert(_keyHash != null); 193Debug.Assert(stringConstant.IsNull || stringConstant.IsString); 204Debug.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\ImmutableArrayExtensions.cs (16)
86Debug.Assert(items != null); 487Debug.Assert(self.Length == other.Length); 518Debug.Assert(self.Length == other.Length); 550Debug.Assert(!array.IsDefault); 551Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 570Debug.Assert(i > 0); 586Debug.Assert(i > 0); 589Debug.Assert(builder == null); 602Debug.Assert(!all); 603Debug.Assert(!none); 612Debug.Assert(none); 816Debug.Assert(!array.IsDefault); 1189Debug.Assert(builder.Count > 1); 1233Debug.Assert(members.Length > 0); 1248Debug.Assert(count < members.Length); 1260Debug.Assert(builder.Count == count);
Collections\ImmutableMemoryStream.cs (1)
19Debug.Assert(!array.IsDefault);
Collections\OrderPreservingMultiDictionary.cs (11)
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); 309Debug.Assert(this.Count >= 1); 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\TemporaryArray`1.cs (2)
170Debug.Assert(_count == InlineCapacity); 333Debug.Assert(_builder is null);
Collections\TopologicalSort.cs (1)
75Debug.Assert(count != 0);
Collections\UnionCollection.cs (3)
32Debug.Assert(coll1.IsReadOnly && coll2.IsReadOnly); 50Debug.Assert(collections.All(c => selector(c).IsReadOnly)); 67Debug.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); 554Debug.Assert(_values is object); 563Debug.Assert(_values is object); 564Debug.Assert(_duplicates is object); 621Debug.Assert(originalEntry.globalLevel == globalLevel);
CommandLine\CommandLineArguments.cs (1)
428Debug.Assert((diagnosticsOpt == null) == (messageProviderOpt == null));
CommandLine\CommandLineParser.cs (7)
64Debug.Assert(PathUtilities.IsAbsolute(directory)); 101Debug.Assert(isAllAscii(optionName.AsSpan())); 457Debug.Assert(outputDirectory is object); 587Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 951Debug.Assert(i < arg.Length); 970Debug.Assert(slashCount >= 0); 1123Debug.Assert(IsScriptCommandLineParser || !arg.StartsWith('-') && !arg.StartsWith('@'));
CommandLine\CommandLineReference.cs (1)
22Debug.Assert(!string.IsNullOrEmpty(reference));
CommandLine\CommandLineSourceFile.cs (1)
21Debug.Assert(!string.IsNullOrEmpty(path));
CommandLine\CommonCompiler.CompilerEmitStreamProvider.cs (1)
51Debug.Assert(_streamToDispose == null);
CommandLine\CommonCompiler.cs (20)
129Debug.Assert(null == responseFile || PathUtilities.IsAbsolute(responseFile)); 317Debug.Assert(normalizedPath is object); 426Debug.Assert(compilation.Options.SourceReferenceResolver is object); 465Debug.Assert(text != null); 470Debug.Assert(text != null || diagnostics.HasAnyErrors()); 720Debug.Assert(Arguments.ErrorLogOptions?.Path != null); 732Debug.Assert(diagnostics.HasAnyErrors()); 822Debug.Assert(generatedFilesBaseDirectory is not null); 855Debug.Assert(!string.IsNullOrWhiteSpace(Arguments.OutputFileName)); 881Debug.Assert(!Arguments.IsScriptRunner); 926Debug.Assert(hadErrors); 1032Debug.Assert(existing.GetOptions(syntaxTree) == DictionaryAnalyzerConfigOptions.Empty); 1047Debug.Assert(existing.GetOptions(additionalFiles[i]) == DictionaryAnalyzerConfigOptions.Empty); 1066Debug.Assert(analyzerConfigSet is object); 1161Debug.Assert(!string.IsNullOrWhiteSpace(tree.FilePath)); 1177Debug.Assert(path.StartsWith(explicitGeneratedOutDir!)); 1186Debug.Assert(tree.Encoding is object); 1554Debug.Assert(touchedFilesLogger != null); 1589Debug.Assert(filePath != null); 1605Debug.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\ReportAnalyzerUtil.cs (1)
67Debug.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\CommonModuleCompilationState.cs (3)
19Debug.Assert(!_frozen); 44Debug.Assert(!Frozen); 59Debug.Assert(Frozen);
Compilation\Compilation.cs (18)
686Debug.Assert(reference is UnresolvedMetadataReference || reference is CompilationReference); 1079Debug.Assert(tree.Options.Kind != SourceCodeKind.Script); 1218Debug.Assert(result 1249Debug.Assert(result 2518Debug.Assert(!string.IsNullOrEmpty(text.FilePath)); 2636Debug.Assert(IsSubmission); 2667Debug.Assert(this.CommonAnonymousTypeManager.AreTemplatesSealed); 2949Debug.Assert(!embedPdb || pdbStream == null); 2950Debug.Assert(metadataPEStream == null || !options.IncludePrivateMembers); // you may not use a secondary stream and include private members together 3229Debug.Assert(moduleBeingBuilt.DebugInformationFormat != DebugInformationFormat.Embedded || pdbStreamProvider == null); 3263Debug.Assert(!deterministic || moduleBeingBuilt.PdbChecksumAlgorithm.Name != null); 3298Debug.Assert(nativePdbStream != null || metadataDiagnostics.HasAnyErrors()); 3356Debug.Assert(auxStream != null || metadataDiagnostics.HasAnyErrors()); 3398Debug.Assert(!metadataOnly); 3399Debug.Assert(!includePrivateMembers); 3606Debug.Assert(this.ContainsSyntaxTree(tree1)); 3607Debug.Assert(this.ContainsSyntaxTree(tree2)); 3842Debug.Assert(!found); // only one required language version in a given diagnostic
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)
258Debug.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)
209Debug.Assert(diagnostic.Severity != InternalDiagnosticSeverity.Unknown); //Info access should have forced resolution. 256Debug.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)
145Debug.Assert(expectedLength == actualLength); 146Debug.Assert(bits == BitVector.AllSet(actualLength)); 154Debug.Assert(!isWarningAsError || _defaultSeverity == DiagnosticSeverity.Warning); 169Debug.Assert(this.GetType() == result.GetType()); 170Debug.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)
96Debug.Assert(_analyzerExecutionTimeOpt != null); 256Debug.Assert(!analysisScope.FilterSpanOpt.HasValue); 411Debug.Assert(getLocalDiagnostics || getNonLocalDiagnostics); 487Debug.Assert(diagnostics != null);
DiagnosticAnalyzer\AnalysisScope.cs (5)
142Debug.Assert(!isSyntacticSingleFileAnalysis || filterFile.HasValue); 160Debug.Assert(!filterSpan.HasValue || filterFile.HasValue); 164Debug.Assert(filterFile.HasValue); 185Debug.Assert(_lazyAnalyzersSet.Value.Contains(analyzer)); 203Debug.Assert(compilationWithAnalyzers.Analyzers.Contains(analyzer));
DiagnosticAnalyzer\AnalysisValueProvider.cs (1)
55Debug.Assert(value is object);
DiagnosticAnalyzer\AnalyzerDriver.cs (58)
75Debug.Assert(_lazyAnalyzerExecutor != null); 85Debug.Assert(_lazyCurrentCompilationData != null); 103Debug.Assert(_lazyUnsuppressedAnalyzers != null); 120Debug.Assert(_lazyPerSymbolAnalyzerActionsCache != null); 139Debug.Assert(_lazyCompilationEndAnalyzers != null); 161Debug.Assert(_lazyAnalyzerGateMap != null); 175Debug.Assert(!_lazyGeneratedCodeAnalysisFlagsMap.IsDefault); 195Debug.Assert(_lazyNonConfigurableAndCustomConfigurableAnalyzers != null); 209Debug.Assert(_lazySymbolStartAnalyzers != null); 223Debug.Assert(_lazyTreatAllCodeAsNonGeneratedCode.HasValue); 242Debug.Assert(_lazyGeneratedCodeFilesMap != null); 256Debug.Assert(_lazyGeneratedCodeSymbolsForTreeMap != null); 270Debug.Assert(_lazySuppressedAnalyzersForTreeMap != null); 286Debug.Assert(_lazySuppressedDiagnosticIdsForUnsuppressedAnalyzers != null); 300Debug.Assert(_lazyIsGeneratedCodeSymbolMap != null); 345Debug.Assert(_lazyCompilationEventQueue != null); 359Debug.Assert(_lazyDiagnosticQueue != null); 373Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Suppress)); 374Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Default)); 401Debug.Assert(_lazyInitializeTask == null); 470Debug.Assert(_lazyInitializeTask == null); 471Debug.Assert(compilation.SemanticModelProvider != null); 696Debug.Assert(analysisScope != null); 718Debug.Assert(faultedTask.IsFaulted); 983Debug.Assert(severity != ReportDiagnostic.Default); 1007Debug.Assert(compilation.ContainsSyntaxTree(tree)); 1014Debug.Assert(!reportedDiagnostics.IsEmptyWithoutResolution); 1038Debug.Assert(HasDiagnosticSuppressors); 1039Debug.Assert(!reportedDiagnostics.IsEmpty); 1040Debug.Assert(_programmaticSuppressions != null); 1041Debug.Assert(_diagnosticsProcessedForProgrammaticSuppressions != null); 1071Debug.Assert(suppressableDiagnostics.Contains(diagnostic)); 1072Debug.Assert(!diagnostic.IsSuppressed); 1074Debug.Assert(suppressedDiagnostic.IsSuppressed); 1252Debug.Assert(location.SourceTree != null); 1272Debug.Assert(declaredSymbols != null); 1289Debug.Assert(GeneratedCodeSymbolsForTreeMap != null); 1290Debug.Assert(_lazyGeneratedCodeAttribute != null); 1312Debug.Assert(existingGeneratedCodeSymbols.SetEquals(generatedCodeSymbols)); 1433Debug.Assert(_lazyInitializeTask != null); 1445Debug.Assert(_lazyPrimaryTask != null); 1779Debug.Assert(!subsetProcessedAnalyzers.IsDefault); 1817Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0); 1868Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length); 1944Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent); 2144Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0); 2145Debug.Assert(SymbolStartAnalyzers.Contains(analyzer)); 2235Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)); 2260Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken)); 2325Debug.Assert(_lazyDoNotAnalyzeGeneratedCode.HasValue); 2580Debug.Assert(shouldExecuteSyntaxNodeActions || shouldExecuteOperationActions || shouldExecuteCodeBlockActions || shouldExecuteOperationBlockActions); 2581Debug.Assert(!isInGeneratedCode || !DoNotAnalyzeGeneratedCode); 2975Debug.Assert(!operationBlock.Parent.IsImplicit); 2982Debug.Assert(operationBlock.Kind is OperationKind.Invocation or OperationKind.Invalid); 2983Debug.Assert(operationBlock.Parent.IsImplicit); 2984Debug.Assert(operationBlock.Parent.Parent is IConstructorBodyOperation ctorBody && 2986Debug.Assert(!operationBlock.Parent.Parent.IsImplicit); 3004Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActions.cs (3)
47Debug.Assert(isEmpty || !GroupedActionsByAnalyzer.IsEmpty); 67Debug.Assert(!analyzers.IsDefaultOrEmpty); 84Debug.Assert(intersected.IsEmpty());
DiagnosticAnalyzer\AnalyzerDriver.GroupedAnalyzerActionsForAnalyzer.cs (2)
30Debug.Assert(!analyzerActions.IsEmpty); 45Debug.Assert(action.Analyzer == analyzer);
DiagnosticAnalyzer\AnalyzerExecutor.AnalyzerDiagnosticReporter.cs (3)
104Debug.Assert(_addNonCategorizedDiagnostic != null); 109Debug.Assert(_addNonCategorizedDiagnostic == null); 110Debug.Assert(_addCategorizedNonLocalDiagnostic != null);
DiagnosticAnalyzer\AnalyzerExecutor.cs (44)
119Debug.Assert((addNonCategorizedDiagnostic != null) ^ (addCategorizedLocalDiagnostic != null)); 120Debug.Assert((addCategorizedLocalDiagnostic != null) == (addCategorizedNonLocalDiagnostic != null)); 184Debug.Assert(_analyzerExecutionTimeMap != null); 268Debug.Assert(startAction.Analyzer == symbolScope.Analyzer); 287Debug.Assert(_addSuppression != null); 327Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent); 373Debug.Assert(getTopMostNodeForAnalysis != null); 374Debug.Assert(!filterSpan.HasValue || filterTree != null); 487Debug.Assert(getTopMostNodeForAnalysis != null); 488Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer)); 489Debug.Assert(!IsAnalyzerSuppressedForSymbol(analyzer, symbolDeclaredEvent.Symbol, cancellationToken)); 490Debug.Assert(!filterSpan.HasValue || filterTree != null); 586Debug.Assert(file.SourceTree != null); 637Debug.Assert(file.AdditionalFile != null); 679Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(syntaxNodeAction.Analyzer)); 680Debug.Assert(!IsAnalyzerSuppressedForTree(syntaxNodeAction.Analyzer, node.SyntaxTree, cancellationToken)); 705Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(operationAction.Analyzer)); 706Debug.Assert(!IsAnalyzerSuppressedForTree(operationAction.Analyzer, semanticModel.SyntaxTree, cancellationToken)); 800Debug.Assert(declaredNode != null); 801Debug.Assert(declaredSymbol != null); 802Debug.Assert(CanHaveExecutableCodeBlock(declaredSymbol)); 803Debug.Assert(startActions.Any() || endActions.Any() || actions.Any()); 804Debug.Assert(!executableBlocks.IsEmpty); 882Debug.Assert(getKind != null); 918Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer)); 919Debug.Assert(!IsAnalyzerSuppressedForTree(analyzer, declaredNode.SyntaxTree, cancellationToken)); 963Debug.Assert(nodeActions != null && nodeActions.Any()); 1025Debug.Assert(nodeActionsByKind.Any()); 1026Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer)); 1027Debug.Assert(!IsAnalyzerSuppressedForTree(analyzer, model.SyntaxTree, cancellationToken)); 1057Debug.Assert(operationActions.Any()); 1119Debug.Assert(operationActionsByKind != null); 1120Debug.Assert(operationActionsByKind.Any()); 1121Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer)); 1122Debug.Assert(!IsAnalyzerSuppressedForTree(analyzer, model.SyntaxTree, cancellationToken)); 1162Debug.Assert(((IFieldSymbol)symbol).AssociatedSymbol == null); 1221Debug.Assert(false); 1373Debug.Assert(IsAnalyzerExceptionDiagnostic(exceptionDiagnostic)); 1423Debug.Assert(addNonCategorizedDiagnostic != null); 1428Debug.Assert(addNonCategorizedDiagnostic == null); 1429Debug.Assert(addCategorizedNonLocalDiagnostic != null); 1462Debug.Assert(_addNonCategorizedDiagnostic != null); 1518Debug.Assert(_analyzerExecutionTimeMap != null); 1529Debug.Assert(operation.Parent == null);
DiagnosticAnalyzer\AnalyzerFileReference.cs (1)
607Debug.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 (5)
98Debug.Assert(_data.Count == 0); 102Debug.Assert(waiter.Task.CreationOptions.HasFlag(TaskCreationOptions.RunContinuationsAsynchronously)); 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)
709Debug.Assert(analysisScope != null); 732Debug.Assert(driver.IsInitialized); 733Debug.Assert(!driver.WhenInitializedTask.IsCanceled); 778Debug.Assert(!analysisScope.IsSyntacticSingleFileAnalysis); 779Debug.Assert(hasAnyActionsRequiringCompilationEvents); 782Debug.Assert(!symbolStartAnalyzers.IsEmpty); 836Debug.Assert(driver.IsInitialized); 958Debug.Assert(compilationEvents.Count(e => e is CompilationUnitCompletedEvent c && !c.FilterSpan.HasValue) == 1); 961Debug.Assert(!compilationEvents.HasDuplicates()); 994Debug.Assert(analysisScope.IsSingleFileAnalysis); 1045Debug.Assert(analysisScope.IsSingleFileAnalysis); 1046Debug.Assert(!analysisScope.IsSyntacticSingleFileAnalysis);
DiagnosticAnalyzer\DiagnosticAnalysisContext.cs (2)
831Debug.Assert(!filterSpan.HasValue || filterTree != null); 911Debug.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\Suppression.cs (1)
21Debug.Assert(suppressedDiagnostic.ProgrammaticSuppressionInfo == null);
DiagnosticAnalyzer\SuppressMessageAttributeState.cs (3)
75Debug.Assert(symbol != null); 171Debug.Assert(declaredSymbols != null); 313Debug.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)
657Debug.Assert(symbol.ContainingSymbol is null or INamedTypeSymbol or IMethodSymbol); 660Debug.Assert(!declarer.Failed); 976System.Diagnostics.Debug.Assert(PeekNextChar(id, index) == '`'); 1455System.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 (30)
58Debug.Assert(manifestResources != null); 59Debug.Assert(serializationProperties != null); 60Debug.Assert(compilation != null); 309Debug.Assert(ReferenceEquals(context.Module, this)); 331Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); 332Debug.Assert(methodSymbol.IsDefinition); 333Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. 348Debug.Assert(methodSymbol.ContainingModule == CommonSourceModule); 349Debug.Assert(methodSymbol.IsDefinition); 350Debug.Assert(((IMethodSymbol)methodSymbol.GetISymbol()).PartialDefinitionPart == null); // Must be definition. 351Debug.Assert(body == null || (object)methodSymbol == body.MethodDefinition.GetInternalSymbol()); 358Debug.Assert(method == null || IsSourceDefinition(method)); 359Debug.Assert(OutputKind.IsApplication()); 366Debug.Assert(method == null || IsSourceDefinition(method)); 543Debug.Assert(value != null); 550Debug.Assert(TestData == null); 614Debug.Assert(sourceModule != null); 615Debug.Assert(serializationProperties != null); 678Debug.Assert(names != null); 708Debug.Assert(_namesOfTopLevelTypes == null); 785Debug.Assert(((ISynthesizedGlobalMethodSymbol)cctor.GetInternalSymbol()).ContainingPrivateImplementationDetailsType == (object)details); 813Debug.Assert(NestedTypes is null || 905Debug.Assert(container.IsDefinition); 911Debug.Assert(method != null); 924Debug.Assert(property != null); 937Debug.Assert(field != null); 950Debug.Assert(nestedType != null); 958Debug.Assert(typeOrNamespace != null); 1125Debug.Assert(_lazyPrivateImplementationDetails?.IsFrozen != false); 1135Debug.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 (12)
54Debug.Assert(edits != null); 89Debug.Assert(edit.NewSymbol != null); 90Debug.Assert(edit.OldSymbol != null); 95Debug.Assert(oldMethod != null); 96Debug.Assert(newMethod != null); 181Debug.Assert(peMethod != null); 182Debug.Assert(peMethod.MetadataName == oldMethod.MetadataName); 590Debug.Assert(!containingDisplayClassId.HasValue); 604Debug.Assert(hasDebugIds); 614Debug.Assert(containingDisplayClassId.HasValue); 624Debug.Assert(hasDebugIds); 688Debug.Assert(peMethod != null);
Emit\EditAndContinue\DeletedPEMethodDefinition.cs (1)
23Debug.Assert(oldMethod.MetadataToken != 0);
Emit\EditAndContinue\DeltaMetadataWriter.cs (30)
90Debug.Assert(previousGeneration != null); 91Debug.Assert(encId != default(Guid)); 92Debug.Assert(encId != previousGeneration.EncId); 93Debug.Assert(context.Module.DebugInformationFormat != DebugInformationFormat.Embedded); 191Debug.Assert(module.EncSymbolChanges is not null); 731Debug.Assert(!methodDef.IsEncDeleted); 814Debug.Assert(def is INestedTypeDefinition or IPropertyDefinition or IEventDefinition); 977Debug.Assert(xOrdinal == int.MaxValue && yOrdinal == int.MaxValue); 990Debug.Assert(xOrdinal == int.MaxValue && yOrdinal == int.MaxValue); 1005Debug.Assert(_customAttributeRowIds.IsSorted()); 1017Debug.Assert(_customAttributeRowIds.IsSorted()); 1071Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0); 1072Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncMap] == 0); 1307Debug.Assert(tokens.IsSorted(HandleComparer.Default)); 1326Debug.Assert(debugTokens.Distinct().Count() == debugTokens.Count); 1384Debug.Assert(rowCounts[i] == 0); 1514Debug.Assert(prev < next); 1564Debug.Assert(!_map.TryGetValue(index, out var other) || ((object)other == (object)item) || other is DeletedSourceTypeDefinition || item is DeletedSourceTypeDefinition); 1579Debug.Assert(!this.IsFrozen); 1593Debug.Assert(!this.IsFrozen); 1645Debug.Assert(index > 0); 1738Debug.Assert(!this.IsFrozen); 1776Debug.Assert(!this.IsFrozen); 1812Debug.Assert(!this.IsFrozen); 1844Debug.Assert(this.ShouldVisit(eventDefinition)); 1850Debug.Assert(this.ShouldVisit(fieldDefinition)); 1864Debug.Assert(this.ShouldVisit(method)); 1883Debug.Assert(this.ShouldVisit(namespaceTypeDefinition)); 1889Debug.Assert(this.ShouldVisit(nestedTypeDefinition)); 1895Debug.Assert(this.ShouldVisit(propertyDefinition));
Emit\EditAndContinue\EmitBaseline.cs (29)
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); 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)
324Debug.Assert(symbol != null); 326Debug.Assert(result != null); 381Debug.Assert(edit.OldSymbol is IMethodSymbol or IPropertySymbol or IEventSymbol); 396Debug.Assert(!deletedMembersPerType.Contains(oldSymbol)); 422Debug.Assert(newMethod.PartialImplementationPart == null); 423Debug.Assert(edit.OldSymbol == null || ((IMethodSymbol)edit.OldSymbol).PartialImplementationPart == null); 445Debug.Assert(newProperty.PartialImplementationPart == null); 446Debug.Assert(edit.OldSymbol == null || ((IPropertySymbol)edit.OldSymbol).PartialImplementationPart == null);
Emit\EditAndContinue\SymbolMatcher.cs (3)
115Debug.Assert(type != null); 129Debug.Assert(delegateTypeDef != null); 214Debug.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)
224Debug.Assert(_lazyAssemblyRefIndex >= 0); 247Debug.Assert(TypeManager.IsFrozen); 276Debug.Assert(TypeManager.IsFrozen); 445Debug.Assert(TypeManager.IsFrozen); 495Debug.Assert(TypeManager.IsFrozen);
Emit\NoPia\EmbeddedTypesManager.cs (1)
115Debug.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 (1)
21Debug.Assert(value >= sbyte.MinValue && value <= sbyte.MaxValue);
FileKey.cs (2)
30Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 31Debug.Assert(timestamp.Kind == DateTimeKind.Utc);
FileSystem\FileUtilities.cs (15)
48Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 72Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 85Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 102Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 108Debug.Assert(PathUtilities.GetPathKind(path) == kind); 173Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 174Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 199Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 249Debug.Assert(PathUtilities.IsAbsolute(path)); 293Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 311Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 395Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 413Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 436Debug.Assert(PathUtilities.IsAbsolute(fullPath));
FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.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); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
InternalUtilities\EnumerableExtensions.cs (1)
737Debug.Assert(data.All(d => d.Count() == count));
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\OneOrMany.cs (1)
199Debug.Assert(HasOneItem == other.HasOneItem);
InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
InternalUtilities\StringExtensions.cs (1)
28Debug.Assert(number >= 0);
InternalUtilities\ThreeState.cs (1)
33Debug.Assert(value != ThreeState.Unknown);
InternalUtilities\WeakList.cs (5)
27Debug.Assert(_size == _items.Length); 28Debug.Assert(_items.Length == 0 || _items.Length >= MinimalNonEmptySize); 64Debug.Assert(_size == _items.Length); 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 (26)
133Debug.Assert(!isTypeArgumentWithAssemblyName || isTypeArgument); 157Debug.Assert(decodedString != null); 285Debug.Assert(topLevelType == null); 305Debug.Assert(i == _input.Length || s_typeNameDelimiters.Contains(_input[i])); 414Debug.Assert(Current == '['); 474Debug.Assert(arity > 0); 539Debug.Assert(intArity > 0); 566Debug.Assert(suffixStartsAt == -1); 570Debug.Assert(suffixStartsAt > 0 && suffixStartsAt < emittedTypeName.Length - 1); 576Debug.Assert(arity > 0); 581Debug.Assert(suffixStartsAt > 0 && suffixStartsAt < emittedTypeName.Length - 1); 603Debug.Assert(!nameMemory.Equals(default(ReadOnlyMemory<char>))); 668Debug.Assert(pstrName != null); 696Debug.Assert(angleBracketDepth == 0); 720Debug.Assert(name != null); 774Debug.Assert(typesByNS != null); 775Debug.Assert(namespaceNameLength >= 0); 776Debug.Assert(!isGlobalNamespace || namespaceNameLength == 0); 843Debug.Assert((object)lastChildNamespaceName != null); 850Debug.Assert(typesInLastChildNamespace.Count != 0); 858Debug.Assert((object)lastChildNamespaceName != null); 868Debug.Assert(typesInLastChildNamespace.Count != 0); 900Debug.Assert(keyIndex < i); 908Debug.Assert(removed > 0); 914Debug.Assert(types != null); 915Debug.Assert(namespaces != null);
MetadataReader\MetadataTypeName.cs (16)
94Debug.Assert(fullName != null); 95Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 124Debug.Assert(namespaceName != null); 125Debug.Assert(typeName != null); 126Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 127Debug.Assert(!typeName.Contains(MetadataHelpers.DotDelimiterString)); 153Debug.Assert(typeName != null); 154Debug.Assert(!typeName.Contains(MetadataHelpers.DotDelimiterString) || typeName.IndexOf(MetadataHelpers.MangledNameRegionStartChar) >= 0); 155Debug.Assert(forcedArity >= -1 && forcedArity < short.MaxValue); 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)
60Debug.Assert(!modules.IsDefault); 61Debug.Assert(modules.Length > 0);
MetadataReader\PEModule.cs (48)
149Debug.Assert((peReader == null) ^ (metadataOpt == IntPtr.Zero && metadataSizeOpt == 0)); 150Debug.Assert(metadataOpt == IntPtr.Zero || metadataSizeOpt > 0); 173Debug.Assert(peReader != null); 247Debug.Assert(_peReaderOpt != null); 344Debug.Assert(_hashesOpt != null); 530Debug.Assert(name.Length == 0 || MetadataHelpers.IsValidMetadataIdentifier(name)); // Obfuscated assemblies can have types with empty names. 724Debug.Assert(left.IsEmpty() && right.IsEmpty()); 729Debug.Assert(result != 0); 1098Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1118Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1150Debug.Assert(info.SignatureIndex == 0); 1166Debug.Assert(info.SignatureIndex == 0); 1181Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 1280Debug.Assert(attributeInfo.HasValue); 1452Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 1453Debug.Assert(targetAttribute.SignatureIndex is 0 or 1); 1463Debug.Assert(!paramNames.IsDefault); 1473Debug.Assert(description.Namespace == "System.Diagnostics.CodeAnalysis"); 1474Debug.Assert(description.Name == "MaybeNullWhenAttribute" || description.Name == "NotNullWhenAttribute" || description.Name == "DoesNotReturnIfAttribute"); 1514Debug.Assert(info.SignatureIndex == 0); 1622Debug.Assert(info.SignatureIndex == 0); 1755Debug.Assert(attributeInfo.HasValue); 1795Debug.Assert(!handle.IsNil); 1822Debug.Assert(attributeInfo.HasValue); 1841Debug.Assert(attributeInfo.HasValue); 1855Debug.Assert(attributeInfo.HasValue); 1906Debug.Assert(info.HasValue); 2002Debug.Assert(!handle.IsNil); 2485Debug.Assert(signatureIndex >= 0 && signatureIndex <= byte.MaxValue); 2606Debug.Assert(rid > 0); 2672Debug.Assert(rid > 0); 2753Debug.Assert(namespaceName != null); 2754Debug.Assert(typeName != null); 2788Debug.Assert(assemblyName != null); 2827Debug.Assert(!resolutionScope.IsNil); 2828Debug.Assert(namespaceName != null); 2829Debug.Assert(typeName != null); 2874Debug.Assert(MetadataHelpers.IsValidMetadataIdentifier(name)); 2933Debug.Assert(targetSignature.Length >= 3); 3086Debug.Assert(!ctorType.IsNil); 3172Debug.Assert(_lazyContainsNoPiaLocalTypes != ThreeState.True); 3210Debug.Assert(!info.HasValue || info.SignatureIndex == 0); 3224Debug.Assert(!info.HasValue || info.SignatureIndex == 0 || info.SignatureIndex == 1); 3245Debug.Assert(!info.HasValue || info.SignatureIndex == 0); 3378Debug.Assert(rva >= 0); 3582Debug.Assert(!param.IsNil); 3599Debug.Assert(!fieldDef.IsNil); 3966Debug.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)
449Debug.Assert(displayName.IndexOf('\0') == -1); 551Debug.Assert(i == displayName.Length || IsNameTokenTerminator(displayName[i])); 601Debug.Assert(str.Length > 0); 602Debug.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)
36Debug.Assert(!modules.IsDefaultOrEmpty && assembly != null); 93Debug.Assert(!modules.IsDefaultOrEmpty); 100Debug.Assert(manifestModule != null); 101Debug.Assert(moduleFactory != null); 325Debug.Assert(_initialModules.Length == 1); 393Debug.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);
NativePdbWriter\PdbWriter.cs (24)
68Debug.Assert(_metadataWriter != null); 94Debug.Assert(emitAllDebugInfo || !emitExternNamespaces); 175Debug.Assert(import.AliasOpt != null); 176Debug.Assert(import.TargetAssemblyOpt == null); 250Debug.Assert(import.TargetAssemblyOpt == null); 251Debug.Assert(declaredExternAliasesOpt == null); 255Debug.Assert(import.TargetNamespaceOpt == null); 256Debug.Assert(import.TargetAssemblyOpt == null); 290Debug.Assert(import.AliasOpt != null); 291Debug.Assert(import.TargetXmlNamespaceOpt != null); 296Debug.Assert(import.TargetXmlNamespaceOpt == null); 300Debug.Assert(import.TargetNamespaceOpt == null); 301Debug.Assert(import.TargetAssemblyOpt == null); 328Debug.Assert(import.AliasOpt != null); 329Debug.Assert(import.TargetAssemblyOpt == null); 367Debug.Assert(!(typeReference is IArrayTypeReference)); 368Debug.Assert(!(typeReference is IPointerTypeReference)); 369Debug.Assert(!typeReference.IsTypeSpecification()); 392Debug.Assert(namespaceType != null); 520Debug.Assert(scopeLocal.SlotIndex >= 0); 575Debug.Assert(age == Age); 672Debug.Assert(sequencePoint.Document != null); 709Debug.Assert(!handle.IsNil); 731Debug.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 (326)
65Debug.Assert(compilation != null); 77Debug.Assert(_currentRegion != null); 89Debug.Assert(body != null); 90Debug.Assert(((Operation)body).OwningSemanticModel != null); 95Debug.Assert(body.Parent == null); 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); 260Debug.Assert(outOfRangeBlocksToVisit != null); 305Debug.Assert(current.Region != null); 323Debug.Assert(branch.Destination == null); 328Debug.Assert(branch.Destination != null); 329Debug.Assert(current.Region != null); 349Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 350Debug.Assert(region.EnclosingRegion != null); 354Debug.Assert(enclosing.NestedRegions[0] == region); 355Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 372Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 413Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 414Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 423Debug.Assert(enclosing.NestedRegions[0] == fromRegion); 434Debug.Assert(enclosing!.Kind == ControlFlowRegionKind.FilterAndHandler); 435Debug.Assert(enclosing.EnclosingRegion != null); 437Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 461Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 462Debug.Assert(startAt > 0); 463Debug.Assert(startAt <= tryAndCatch.NestedRegions.Length); 477Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 478Debug.Assert(entryBlock.Ordinal == @catch.NestedRegions[0].FirstBlockOrdinal); 517Debug.Assert(!region.IsEmpty); 555Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 576Debug.Assert(subRegion.FirstBlock != null); 581Debug.Assert(!subRegion.HasCaptureIds); 584Debug.Assert(regionMap[block] == subRegion); 616Debug.Assert(subRegion.Kind != ControlFlowRegionKind.Root); 617Debug.Assert(subRegion.Enclosing != null); 626Debug.Assert(canHaveEmptyRegion); 627Debug.Assert(!subRegion.HasRegions); 640Debug.Assert(!r.IsEmpty); 643Debug.Assert(regionMap[blocks[i]] == subRegion); 659Debug.Assert(regionMap[blocks[i]] == subRegion); 704Debug.Assert(predecessor.BranchValue == null); 705Debug.Assert(predecessor.FallThrough.Kind == ControlFlowBranchSemantics.Regular); 718Debug.Assert((block.BranchValue != null && !block.HasCondition) == (next.Kind == ControlFlowBranchSemantics.Return || next.Kind == ControlFlowBranchSemantics.Throw)); 719Debug.Assert((next.Destination == null) == 730Debug.Assert(currentRegion.Kind == ControlFlowRegionKind.Filter || 732Debug.Assert(block == currentRegion.LastBlock); 748Debug.Assert(currentRegion.FirstBlock == block); 749Debug.Assert(!currentRegion.HasRegions); 757Debug.Assert(currentRegion.Enclosing != null); 759Debug.Assert(tryAndFinally.Kind == ControlFlowRegionKind.TryAndFinally); 760Debug.Assert(tryAndFinally.Regions!.Count == 2); 763Debug.Assert(@try.Kind == ControlFlowRegionKind.Try); 764Debug.Assert(tryAndFinally.Regions.Last() == currentRegion); 769Debug.Assert(@try.FirstBlock != null); 781Debug.Assert(tryAndFinally.Enclosing != null); 786Debug.Assert(regionMap[block] == tryAndFinallyEnclosing); 797Debug.Assert(block.HasCondition || block.BranchValue == null); 798Debug.Assert(next.Destination == null); 828Debug.Assert(next.Kind == ControlFlowBranchSemantics.Regular || 835Debug.Assert(!block.HasCondition); // This is ensured by an "if" above. 850Debug.Assert(implicitEntryRegion.LastBlock!.Ordinal >= next.Destination.Ordinal); 858Debug.Assert(next.Destination != null); 882Debug.Assert(predecessor.FallThrough.Destination == block); 921Debug.Assert(predecessor.BranchValue == null); 928Debug.Assert(value == null); 949Debug.Assert(next.Kind == ControlFlowBranchSemantics.Regular || 976Debug.Assert(predecessor != block); 977Debug.Assert(predecessor.BranchValue == null); 1040Debug.Assert(!region.IsEmpty); 1041Debug.Assert(region.FirstBlock.Ordinal >= 0); 1042Debug.Assert(region.FirstBlock.Ordinal <= region.LastBlock.Ordinal); 1043Debug.Assert(region.FirstBlock.Ordinal <= block.Ordinal); 1044Debug.Assert(block.Ordinal <= region.LastBlock.Ordinal); 1050Debug.Assert(region.Enclosing != null); 1055Debug.Assert(enclosing.Enclosing != null); 1063Debug.Assert(region.Enclosing != null); 1068Debug.Assert(enclosing.Enclosing != null); 1073Debug.Assert(region.FirstBlock.Ordinal <= region.LastBlock.Ordinal); 1076Debug.Assert(removed); 1077Debug.Assert(blocks[block.Ordinal] == block); 1097Debug.Assert(predecessorBranch.Kind == ControlFlowBranchSemantics.Regular); 1226Debug.Assert(branch.Kind == ControlFlowBranchSemantics.Regular); 1237Debug.Assert(stackDepth == 0 || _evalStack.Peek().frameOpt != null); 1251Debug.Assert(_evalStack.Count == stackDepth); 1252Debug.Assert(stackDepth == 0 || _evalStack.Peek().frameOpt != null); 1278Debug.Assert(spillingTheStack || _evalStack.All( 1297Debug.Assert(block != null); 1298Debug.Assert(_currentRegion != null); 1329Debug.Assert(_evalStack.Count == _startSpillingAt); 1342Debug.Assert(_currentRegion != null); 1354Debug.Assert((frameOpt == null) != (operationOpt == null)); 1358Debug.Assert(enclosed != frameOpt.RegionBuilderOpt); 1363Debug.Assert(enclosed.LastBlock != null); 1370Debug.Assert(prevBlock.HasCondition || prevBlock.BranchValue == null); 1371Debug.Assert(prevBlock.FallThrough.Destination == null); 1395Debug.Assert(_currentStatement == operation); 1396Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1404Debug.Assert(_currentStatement == originalOperation); 1405Debug.Assert(_evalStack.Count == 0 || _evalStack.Peek().frameOpt != null); 1500Debug.Assert(captureIdForResult is null); 1507Debug.Assert(_currentStatement == operation); 1568Debug.Assert(whenFalse is { }); 1607Debug.Assert(operation is { WhenTrue: not null, WhenFalse: not null }); 1622Debug.Assert(rewrittenThrow!.Kind == OperationKind.None); 1623Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 1640Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 1641Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 1686Debug.Assert(_startSpillingAt == _evalStack.Count); 1715Debug.Assert(_lazyRegionBuilder == null); 1716Debug.Assert(value != null); 1731Debug.Assert(frame != null); 1733Debug.Assert(_startSpillingAt <= stackDepth); 1741Debug.Assert(frame == frameOpt); 1742Debug.Assert(operationOpt == null); 1748Debug.Assert(_currentRegion != null); 1750Debug.Assert(toMerge.Enclosing != null); 1753Debug.Assert(toMerge.IsStackSpillRegion); 1754Debug.Assert(!toMerge.HasLocalFunctions); 1755Debug.Assert(toMerge.Locals.IsEmpty); 1783Debug.Assert(_currentRegion!.IsStackSpillRegion); 1807Debug.Assert(owner != null); 1815Debug.Assert(_startSpillingAt <= _evalStack.Count); 1827Debug.Assert(frameOpt.RegionBuilderOpt != null); 1835Debug.Assert((frameOpt == null) != (operationOpt == null)); 1840Debug.Assert(frameOpt.RegionBuilderOpt == null); 1846Debug.Assert(operationOpt != null); 1862Debug.Assert(currentFrame != null); 1864Debug.Assert(currentSpillRegion != null); 1895Debug.Assert(candidate.IsStackSpillRegion); 1902Debug.Assert(candidate.Enclosing != null); 1922Debug.Assert(CurrentRegionRequired.IsStackSpillRegion); 1939Debug.Assert(operationOpt == null); 1940Debug.Assert(frameOpt.RegionBuilderOpt != null); 1944Debug.Assert(operationOpt != null); 1952Debug.Assert(_evalStack.Count != 0); 1953Debug.Assert(_evalStack.First().frameOpt != null); 1954Debug.Assert(_evalStack.First().operationOpt == null); 1955Debug.Assert(_startSpillingAt <= _evalStack.Count); 1956Debug.Assert(operation != null); 1963Debug.Assert(_startSpillingAt <= stackDepth); 1971Debug.Assert(frameOpt == null); 1972Debug.Assert(operationOpt != null); 1979Debug.Assert(_startSpillingAt <= _evalStack.Count); 1982Debug.Assert(frameOpt == null); 1983Debug.Assert(operationOpt != null); 1990Debug.Assert(unwrapper != null || typeof(T) == typeof(IOperation)); 1999Debug.Assert(wrapper != null || typeof(T) == typeof(IOperation)); 2029Debug.Assert(stackSizeBefore == _evalStack.Count); 2062Debug.Assert(interpolatedStringBuilder != null); 2092Debug.Assert(index >= 0 && index < args.Length); 2451Debug.Assert(binOp.Type is not null); 2465Debug.Assert(binOp.Type is not null); 2490Debug.Assert(unaryOperatorMethod == null); 2564Debug.Assert(binOp.OperatorMethod is not null); 2593Debug.Assert(unaryOperatorMethod == null || !ITypeSymbolHelpers.IsNullableType(unaryOperatorMethod.Parameters[0].Type)); 2654Debug.Assert(IsBooleanConditionalOperator(condition)); 2704Debug.Assert(ITypeSymbolHelpers.IsBooleanType(condition.Type)); 2766Debug.Assert(current == _currentRegion); 2783Debug.Assert(_startSpillingAt == _evalStack.Count); 2870Debug.Assert(conditional.WhenFalse is not null); 2928Debug.Assert(rewrittenThrow != null); 2929Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 2930Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 2966Debug.Assert(previous.BranchValue == null); 2967Debug.Assert(!previous.HasCondition); 2968Debug.Assert(condition != null); 2969Debug.Assert(branch.Destination != null); 2983Debug.Assert(_evalStack.Last().frameOpt != null); 2984Debug.Assert(_startSpillingAt >= _evalStack.Count - 1); 3068Debug.Assert(conversion is not null); 3070Debug.Assert(rewrittenThrow != null); 3071Debug.Assert(rewrittenThrow.Kind == OperationKind.None); 3072Debug.Assert(rewrittenThrow.ChildOperations.IsEmpty()); 3103Debug.Assert(operation.Parent != null); 3105Debug.Assert(captureIdForResult == null || !isStatement); 3119Debug.Assert(valueFrame.RegionBuilderOpt != null); 3181Debug.Assert(intermediateFrame.RegionBuilderOpt != null); 3196Debug.Assert(intermediateFrame != null); 3217Debug.Assert(whenNullFrame.RegionBuilderOpt != null); 3314Debug.Assert(ITypeSymbolHelpers.IsBooleanType(booleanType)); 3325Debug.Assert(nullableMember == SpecialMember.System_Nullable_T_GetValueOrDefault || 3332Debug.Assert(ITypeSymbolHelpers.IsNullableType(valueType)); 3355Debug.Assert(ITypeSymbolHelpers.IsNullableType(value.Type)); 3408Debug.Assert(captureIdForResult == null); 3415Debug.Assert(_currentStatement is not null); 3427Debug.Assert(expressionFrame != null); 3454Debug.Assert(operation.Type is not null); 3470Debug.Assert(!_currentConditionalAccessTracker.IsDefault); 3471Debug.Assert(_currentConditionalAccessTracker.Operations.Count == 0); 3521Debug.Assert(!_currentConditionalAccessTracker.IsDefault && _currentConditionalAccessTracker.Operations.Count > 0); 3529Debug.Assert(!_currentConditionalAccessTracker.IsDefault); 3562Debug.Assert(operation.Operation.Kind == OperationKind.ConditionalAccess || operation.Operation.Kind == OperationKind.CoalesceAssignment); 3599Debug.Assert(operation.Condition is not null); 3639Debug.Assert(_currentRegion == locals); 3678Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3711Debug.Assert(!filterRegion.IsEmpty); 3712Debug.Assert(filterRegion.LastBlock.FallThrough.Destination == null); 3713Debug.Assert(!filterRegion.FirstBlock.HasPredecessors); 3732Debug.Assert(!handlerRegion.IsEmpty); 3735Debug.Assert(CurrentRegionRequired == filterAndHandlerRegion); 3738Debug.Assert(filterAndHandlerRegion.Regions![0].LastBlock!.FallThrough.Destination == null); 3743Debug.Assert(predecessors.All(p => filterAndHandlerRegion.Regions[0].FirstBlock!.Ordinal <= p.Ordinal && 3751Debug.Assert(!handlerRegion.FirstBlock.HasPredecessors); 3755Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndCatch); 3761Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3772Debug.Assert(_currentRegion == tryAndFinallyRegion); 3774Debug.Assert(!finallyRegion.IsEmpty); 3775Debug.Assert(finallyRegion.LastBlock.FallThrough.Destination == null); 3776Debug.Assert(!finallyRegion.FirstBlock.HasPredecessors); 3780Debug.Assert(tryAndFinallyRegion?.Regions![1].LastBlock!.FallThrough.Destination == null); 3842Debug.Assert(current.BranchValue == null); 3843Debug.Assert(!current.HasCondition); 3939Debug.Assert(current.BranchValue == null); 3940Debug.Assert(!current.HasCondition); 3941Debug.Assert(current.FallThrough.Destination == null); 3942Debug.Assert(current.FallThrough.Kind == ControlFlowBranchSemantics.None); 3967Debug.Assert(visitResource is null); 3985Debug.Assert(resources.Kind != OperationKind.VariableDeclaration); 3986Debug.Assert(resources.Kind != OperationKind.VariableDeclarator); 4005Debug.Assert(_currentRegion == usingRegion); 4092Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4099Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4104Debug.Assert(_currentRegion == resourceRegion); 4114Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4115Debug.Assert(resource.Type is not null); 4126Debug.Assert(!isNotNullableValueType(resource.Type)); 4131Debug.Assert(resource.Type is not null); 4162Debug.Assert(_currentRegion == finallyRegion); 4168Debug.Assert((disposeMethod is object && !disposeArguments.IsDefault) || 4212Debug.Assert(iDisposable.SpecialType == SpecialType.System_IDisposable || 4332Debug.Assert(lockStatement.LockTakenSymbol == null); 4366Debug.Assert(lockStatement.LockTakenSymbol is not null); 4367Debug.Assert(enterMethod is not null); 4394Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4408Debug.Assert(lockStatement.LockTakenSymbol is not null); 4442Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4493Debug.Assert(regionForCollection == _currentRegion); 4521Debug.Assert(localsRegion == _currentRegion); 4531Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.Try); 4548Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.TryAndFinally); 4554Debug.Assert(_currentRegion == enumeratorCaptureRegion); 4680Debug.Assert(info?.ElementConversion?.ToCommonConversion().IsIdentity != false); 4702Debug.Assert(method.IsStatic == (instanceOpt == null)); 4780Debug.Assert(isObjectLoop && loopObject is not null); 4801Debug.Assert(builder.All(o => o != null)); 4831Debug.Assert(builder.All(op => op is not null)); 4894Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 4895Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5038Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 5039Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5050Debug.Assert(positiveFlag is not null); 5089Debug.Assert(value.Discriminator != ConstantValueTypeDiscriminator.Bad); 5286Debug.Assert(_forToLoopBinaryOperatorLeftOperand == null); 5287Debug.Assert(_forToLoopBinaryOperatorRightOperand == null); 5355Debug.Assert(controlVariableReferenceForAssignment.Kind == OperationKind.FlowCaptureReference); 5380Debug.Assert(ITypeSymbolHelpers.IsNullableType(controlVariableReferenceForIncrement.Type)); 5404Debug.Assert(controlVariableReferenceForAssignment.Type != null); 5435Debug.Assert(!_forceImplicit); 5481Debug.Assert(_currentRegion == switchRegion); 5512Debug.Assert(section.Clauses.All(c => c.Label == null)); 5513Debug.Assert(_currentSwitchOperationExpression == null); 5568Debug.Assert(compareWith.Type != null); 5574Debug.Assert(operation.Value.Type != null); 5664Debug.Assert(ITypeSymbolHelpers.IsNullableType(type)); 5665Debug.Assert(ITypeSymbolHelpers.GetNullableUnderlyingType(type).Equals(operand.Type)); 5705Debug.Assert(current.BranchValue == null); 5706Debug.Assert(!current.HasCondition); 5707Debug.Assert(current.FallThrough.Destination == null); 5708Debug.Assert(current.FallThrough.Kind == ControlFlowBranchSemantics.None); 5869Debug.Assert(initializer != null && assignmentSyntax != null); 5872Debug.Assert((afterInitialization, localSymbol.IsStatic) is (null, false) or (not null, true)); 6066Debug.Assert(validKinds.Contains(innerInitializer.Kind)); 6220Debug.Assert(instance.Kind == OperationKind.Invalid || instance.Kind == OperationKind.None); 6307Debug.Assert(array.Initializer is not null); 6378Debug.Assert(operation.Type is not null); 6380Debug.Assert(_currentImplicitInstance.AnonymousTypePropertyValues is not null); 6392Debug.Assert(propertyReference != null); 6393Debug.Assert(propertyReference.Arguments.IsEmpty); 6394Debug.Assert(propertyReference.Instance != null); 6395Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 6396Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver); 6444Debug.Assert(owner.Enclosing != null); 6454Debug.Assert(_currentStatement == null); 6586Debug.Assert(operation.IsImplicit); 6725Debug.Assert(left != null); 6726Debug.Assert(right != null); 6759Debug.Assert(_currentStatement == operation); 6779Debug.Assert(_evalStack[maxStackDepth + 1].frameOpt != null); 6786Debug.Assert(_evalStack[i].frameOpt == null); 6787Debug.Assert(_evalStack[i].operationOpt != null); 6811Debug.Assert(operation.HandlerCreation is IObjectCreationOperation); 6825Debug.Assert(outParameterArgument is { Parameter: { RefKind: RefKind.Out, Type.SpecialType: SpecialType.System_Boolean } }); 6837Debug.Assert(resultBlock != null); 6838Debug.Assert(outParameterPlaceholder != null); 6839Debug.Assert(outParameterFlowCapture != -1); 6860Debug.Assert(resultBlock != null); 6975Debug.Assert(_currentInterpolatedStringHandlerArgumentContext != null); 6978Debug.Assert(receiverCapture is IFlowCaptureReferenceOperation); 6988Debug.Assert(_currentInterpolatedStringHandlerArgumentContext != null); 6991Debug.Assert(argumentCapture is IFlowCaptureReferenceOperation or IDiscardOperation); 7013Debug.Assert(_evalStack.Count > _currentInterpolatedStringHandlerCreationContext.MaximumStackDepth); 7056Debug.Assert(interpolation.FormatString is ILiteralOperation or IConversionOperation { Operand: ILiteralOperation }); 7069Debug.Assert(interpolatedStringText.Text is ILiteralOperation or IConversionOperation { Operand: ILiteralOperation }); 7098Debug.Assert(operation.GetConstantValue() != null); 7146Debug.Assert(_currentImplicitInstance.AnonymousTypePropertyValues is not null); 7312Debug.Assert(operation.EventReference != null); 7494Debug.Assert(_currentStatement == invalidOperation); 7857Debug.Assert(operation == null || ((Operation)operation).OwningSemanticModel!.Compilation == _compilation); 7865Debug.Assert(operation == null || ((Operation)operation).OwningSemanticModel!.Compilation == _compilation); 7867Debug.Assert((result == null) == (operation == null)); 7878Debug.Assert((result == null) == (operation == null)); 7944Debug.Assert(operation.Type!.IsAnonymousType); 7989Debug.Assert(simpleAssignment.Target is InvalidOperation); 7996Debug.Assert(propertyReference != null); 7997Debug.Assert(propertyReference.Arguments.IsEmpty); 7998Debug.Assert(propertyReference.Instance != null); 7999Debug.Assert(propertyReference.Instance.Kind == OperationKind.InstanceReference); 8000Debug.Assert(((IInstanceReferenceOperation)propertyReference.Instance).ReferenceKind == InstanceReferenceKind.ImplicitReceiver); 8030Debug.Assert(oldValueCaptureId >= 0); 8082Debug.Assert(simpleAssignment.Target is InvalidOperation); 8087Debug.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); 63Debug.Assert(_currentInterpolatedStringHandlerArgumentContext != null); 64Debug.Assert(_currentInterpolatedStringHandlerArgumentContext.ApplicableCreationOperations.Contains((IInterpolatedStringHandlerCreationOperation)operation));
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)
125Debug.Assert(_operation != null && _currentSlot >= 0 && _currentIndex >= 0);
Operations\IOperation.OperationList.Reversed.cs (2)
105Debug.Assert(_operation != null && _currentSlot is >= 0 and not int.MaxValue && _currentIndex is >= 0 and not int.MaxValue); 112Debug.Assert((_currentSlot == int.MaxValue) == (_currentIndex == int.MaxValue));
Operations\Loops\ForEachLoopOperationInfo.cs (1)
61Debug.Assert(!collectionIsInlineArrayValue || inlineArrayConversion is { });
Operations\Operation.cs (8)
32Debug.Assert(semanticModel.ContainingPublicModelOrSelf != null); 33Debug.Assert(semanticModel.ContainingPublicModelOrSelf != semanticModel); 34Debug.Assert(semanticModel.ContainingPublicModelOrSelf.ContainingPublicModelOrSelf == semanticModel.ContainingPublicModelOrSelf); 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)
334Debug.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 (49)
105Debug.Assert(metadata != debugMetadataOpt); 662Debug.Assert(namespaceTypeReference.AsGenericTypeInstanceReference == null); 669Debug.Assert(!_tableIndicesAreComplete); 678Debug.Assert(!_tableIndicesAreComplete); 847Debug.Assert(!_tableIndicesAreComplete); 1131Debug.Assert((methodReference.CallingConvention & CallingConvention.Generic) != 0 == (methodReference.GenericParameterCount > 0)); 1191Debug.Assert(!(signature is IMethodReference)); 1428Debug.Assert(str != null); // No need to handle in an internal utility. 1690Debug.Assert(nativePdbWriterOpt == null ^ portablePdbStreamOpt == null); 1708Debug.Assert(module.SerializationProperties.PersistentIdentifier != default(Guid)); 1719Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncLog] == 0); 1720Debug.Assert(typeSystemRowCounts[(int)TableIndex.EncMap] == 0); 1723Debug.Assert(mappedFieldDataBuilder == null); 1724Debug.Assert(managedResourceDataBuilder == null); 1725Debug.Assert(mvidFixup.IsDefault); 1726Debug.Assert(mvidStringFixup.IsDefault); 1979Debug.Assert(sourceAssembly != null); 2051Debug.Assert(this.IsFullMetadata); // parentToken is not relative 2089Debug.Assert(this.IsFullMetadata); 2254Debug.Assert(exportedType.ParentIndex != -1); 2419Debug.Assert(propDef.DefaultValue != null); 2547Debug.Assert(resourceDataWriter == null || (resourceDataWriter.Count % ManagedPEBuilder.ManagedResourcesDataAlignment) == 0); 2906Debug.Assert(MetadataOnly); 2935Debug.Assert(!MetadataOnly); 2961Debug.Assert(body != null); 3043Debug.Assert(!_tableIndicesAreComplete); 3223Debug.Assert(pseudoToken <= 0xffffff); 3264Debug.Assert(ReadByte(generatedIL, offset - 1) == (byte)ILOpCode.Ldtoken); 3272Debug.Assert(handle.Kind is HandleKind.MethodDefinition); 3280Debug.Assert(handle.Kind is HandleKind.FieldDefinition); 3319Debug.Assert(guidStringLength == default(Guid).ToString().Length); 3414Debug.Assert(parameterTypeInformation.RefCustomModifiers.Length == 0 || parameterTypeInformation.IsByReference); 3425Debug.Assert(fieldReference.RefCustomModifiers.Length == 0 || fieldReference.IsByReference); 3467Debug.Assert(parameters.Length == arguments.Length); 3523Debug.Assert(this.module.IsPlatformType(targetType, PlatformType.SystemObject)); 3583Debug.Assert(!module.IsPlatformType(c.Type, PlatformType.SystemType) || c.Value == null); 3599Debug.Assert(marshallingInformation.NumberOfElements >= 0); 3638Debug.Assert(marshallingInformation.ElementType >= 0); 3736Debug.Assert(identity.ContentType == AssemblyContentType.Default); 3783Debug.Assert(!signature.ReturnValueIsByRef); 3784Debug.Assert(signature.RefCustomModifiers.IsEmpty); 3791Debug.Assert(signature.RefCustomModifiers.IsEmpty || signature.ReturnValueIsByRef); 4015Debug.Assert(arrayTypeReference.IsSZArray); 4018Debug.Assert(!(elementType is IModifiedTypeReference)); 4049Debug.Assert(typeReference.IsEnum); 4228Debug.Assert(!_writer._tableIndicesAreComplete); 4231Debug.Assert(!this.TryGetValue(item, out i)); 4254Debug.Assert(index.Count == 0); 4281Debug.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)
22Debug.Assert(!customModifiers.IsDefault);
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)); 204Debug.Assert(!isDeterministic || context.Module.PdbChecksumAlgorithm.Name != null); 299Debug.Assert(strongNameProvider != null); 341Debug.Assert(writer.RemainingBytes == 0); 348Debug.Assert(writer.RemainingBytes == 0); 355Debug.Assert(writer.RemainingBytes == 0); 405Debug.Assert(resourceSection != null); 421Debug.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)
30Debug.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)
31Debug.Assert(identity != null); 32Debug.Assert(!referencedAssemblyData.IsDefault); 88Debug.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)
68Debug.Assert(index >= 0); 81Debug.Assert(!aliasesOpt.IsDefault || !recursiveAliasesOpt.IsDefault); 82Debug.Assert(!mergedReferences.IsDefault); 100Debug.Assert(!IsUninitialized); 114Debug.Assert(!IsUninitialized); 123Debug.Assert(!IsUninitialized); 143Debug.Assert(!IsSkipped); 155Debug.Assert(!IsSkipped); 322Debug.Assert(metadata != null || diagnostics.HasAnyErrors()); 335Debug.Assert(assembly is object); 530Debug.Assert(existing is Metadata || existing is Diagnostic); 548Debug.Assert(metadata != null || diagnostics.HasAnyErrors()); 685Debug.Assert(other.Identity is object); 715Debug.Assert(other.Identity is object); 730Debug.Assert(other.Identity is object); 749Debug.Assert(equivalent.Identity.IsStrongName); 770Debug.Assert(!equivalent.Identity.IsStrongName); 784Debug.Assert(equivalent.Reference != null); 803Debug.Assert(referenceDirective.Location is object); 812Debug.Assert(referenceDirective.File is object); 813Debug.Assert(referenceDirective.Location.SourceTree is object); 874Debug.Assert(compilation.Options.MetadataReferenceResolver != null); 962Debug.Assert(reference.Version > definition.Version); 1053Debug.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 (1)
83Debug.Assert(nodeList[0].Name == RuleSetNodeName);
SignatureComparer.cs (3)
35Debug.Assert(!result || position == signature.Length); 79Debug.Assert(position == signature.Length); 124Debug.Assert(position == signature.Length);
SourceGeneration\AdditionalSourcesCollection.cs (1)
31Debug.Assert(fileExtension.Length > 0 && fileExtension[0] == '.');
SourceGeneration\GeneratorAdaptor.cs (2)
38Debug.Assert(_sourceExtension != DummySourceExtension); 89Debug.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 343Debug.Assert(false); 356Debug.Assert(outputKind != IncrementalGeneratorOutputKind.None);
SourceGeneration\GeneratorDriverState.cs (2)
37Debug.Assert(Generators.Length == GeneratorStates.Length); 38Debug.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\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\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 (4)
60Debug.Assert(added); 78Debug.Assert(usedCache); 87Debug.Assert(modified); 93Debug.Assert(removed);
SourceGeneration\Nodes\NodeStateTable.cs (16)
69Debug.Assert(!hasTrackedSteps || steps.Length == states.Length); 171Debug.Assert(compacted.Count == nonRemovedCount); 179Debug.Assert((_states.Length == 1 || _states.Length == 2 && _states[0].IsRemovedDueToInputRemoval) && _states[^1].Count == 1); 188Debug.Assert(inputTable.HasTrackedSteps && inputTable.IsCached); 194Debug.Assert(usedCachedEntry); 304Debug.Assert(previousEntries.IsCached); 337Debug.Assert(previousEntry.Count == 1); 477Debug.Assert(stepInputs.IsDefault == !TrackIncrementalSteps); 481Debug.Assert(_steps.Count + 1 == _states.Count); 520Debug.Assert(!TrackIncrementalSteps || _states.Count == _steps.Count); 532Debug.Assert(_requestedTableCapacity == null || _states.Count <= _requestedTableCapacity); 597Debug.Assert(!states.IsDefault); 598Debug.Assert(states.Length == 1 || states.Distinct().Length > 1); 650Debug.Assert(itemBuilder.Count < this.Count); 764Debug.Assert(_items.Count == _requestedCapacity); 765Debug.Assert(_states == null || _states.Count == _requestedCapacity);
SourceGeneration\Nodes\PredicateSyntaxStrategy.cs (1)
80Debug.Assert(model is object);
SourceGeneration\Nodes\SourceOutputNode.cs (2)
33Debug.Assert(outputKind == IncrementalGeneratorOutputKind.Source || outputKind == IncrementalGeneratorOutputKind.Implementation); 101Debug.Assert(context.TableBuilder is not null);
SourceGeneration\Nodes\SyntaxReceiverStrategy.cs (1)
75Debug.Assert(model is not null);
SourceGeneration\Nodes\SyntaxValueProvider_ForAttributeWithMetadataName.cs (1)
97Debug.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 || (generatedSources.IsEmpty && diagnostics.Length == 1));
SourceGeneration\SyntaxStore.cs (2)
51Debug.Assert(_syntaxInputNodes.Contains(syntaxInputNode)); 130Debug.Assert(_tableBuilder.Contains(node));
SpecialTypeExtensions.cs (1)
375Debug.Assert(value.GetType().IsPrimitive);
SpecialTypes.cs (1)
95Debug.Assert(name.IndexOf('+') < 0); // Compilers aren't prepared to lookup for a nested special type.
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
60Debug.Assert(assemblyScopedNamespaceSymbol.ConstituentNamespaces.Length == 1);
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
17Debug.Assert(declaredNode != null); 18Debug.Assert(!executableCodeBlocks.IsDefault);
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (11)
25Debug.Assert(builder.Count == 0); 50Debug.Assert(_recordCount <= byte.MaxValue); 57Debug.Assert(typeName != null); 87Debug.Assert(groupSizes.Count <= ushort.MaxValue); 104Debug.Assert(usingCount <= ushort.MaxValue); 145Debug.Assert(dynamicLocals != null); 156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 157Debug.Assert(info.LocalName.Length <= IdentifierSize); 171Debug.Assert(tupleLocals != null); 178Debug.Assert(infos.Count > 0); 185Debug.Assert((info.SlotIndex == -1) ^ (info.ScopeStart == 0 && info.ScopeEnd == 0));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (7)
255Debug.Assert(flagsBuilder.Count == 0); 256Debug.Assert(nameBuilder.Length == 0); 396Debug.Assert(!allModuleInfoImportStrings.IsDefault); 420Debug.Assert(!importStrings.IsDefault); 450Debug.Assert(groupBuilder.Count == 0); 491Debug.Assert(!importStrings.IsDefault); 510Debug.Assert(!importStrings.IsDefault);
src\Dependencies\CodeAnalysis.Debugging\StateMachineHoistedLocalScope.cs (2)
26Debug.Assert(startOffset >= 0); 27Debug.Assert(endOffset > startOffset || startOffset == 0 && endOffset == 0);
src\Dependencies\CodeAnalysis.Debugging\TupleElementNamesInfo.cs (1)
22Debug.Assert(!elementNames.IsDefault);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
118Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (41)
110Debug.Assert(i != j); 123Debug.Assert(i != j); 132Debug.Assert(comparer != null); 145Debug.Assert(keys.Length > 0); 146Debug.Assert(depthLimit >= 0); 147Debug.Assert(comparer != null); 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 191Debug.Assert(comparer != null); 235Debug.Assert(comparer != null); 236Debug.Assert(keys.Length > 0); 253Debug.Assert(comparer != null); 413Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 425Debug.Assert(keys.Length > 0); 426Debug.Assert(depthLimit >= 0); 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 535Debug.Assert(keys.Length > 0); 691Debug.Assert(comparer != null); 692Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 693Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 694Debug.Assert(i != j); 711Debug.Assert(i != j); 724Debug.Assert(comparer != null); 725Debug.Assert(keys.Length == values.Length); 735Debug.Assert(keys.Length > 0); 736Debug.Assert(values.Length == keys.Length); 737Debug.Assert(depthLimit >= 0); 738Debug.Assert(comparer != null); 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 782Debug.Assert(comparer != null); 826Debug.Assert(comparer != null); 827Debug.Assert(keys.Length > 0); 844Debug.Assert(comparer != null); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1233Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
32Debug.Assert(bitPosition >= 0); 46Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\SegmentedArray.cs (5)
112Debug.Assert(length > 0); 113Debug.Assert(sourceIndex >= 0); 114Debug.Assert(destinationIndex >= 0); 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length);
src\Dependencies\Collections\SegmentedDictionary`2.cs (11)
166Debug.Assert(_entries.Length >= source.Count); 167Debug.Assert(_count == 0); 258Debug.Assert(modified); 265Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 445Debug.Assert(comparer is not null); 516Debug.Assert(_buckets.Length > 0); 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 572Debug.Assert(comparer is not null); 647Debug.Assert(newSize >= _entries.Length); 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
src\Dependencies\Collections\SegmentedHashSet`1.cs (6)
187Debug.Assert(Count == source.Count); 256Debug.Assert(comparer is not null); 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 900Debug.Assert(newSize >= _entries.Length); 1021Debug.Assert(_buckets.Length > 0); 1061Debug.Assert(comparer is not null);
src\Dependencies\Collections\SegmentedList`1.cs (2)
268Debug.Assert(_size == _items.Length); 518Debug.Assert(_items.Length < capacity);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.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.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\AbstractSymbolDisplayVisitor_Minimal.cs (1)
23Debug.Assert(IsMinimizing);
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); 203Debug.Assert(AttributeConstructor is object); 207Debug.Assert(parameters.Length == 5); 208Debug.Assert(parameters[0].Type.SpecialType == SpecialType.System_Byte); 209Debug.Assert(parameters[1].Type.SpecialType == SpecialType.System_Byte); 218Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_Int32); 219Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_Int32); 220Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_Int32); 228Debug.Assert(parameters[2].Type.SpecialType == SpecialType.System_UInt32); 229Debug.Assert(parameters[3].Type.SpecialType == SpecialType.System_UInt32); 230Debug.Assert(parameters[4].Type.SpecialType == SpecialType.System_UInt32); 275Debug.Assert(this.CommonConstructorArguments.Length == 1); 323Debug.Assert(args.Length <= 2); 328Debug.Assert(args[1].ValueInternal is object); 381Debug.Assert(args[1].ValueInternal is object); 395Debug.Assert(this.CommonConstructorArguments.Length == 0); 406Debug.Assert(arguments.AttributeSyntaxOpt is object); 412Debug.Assert(attribute.AttributeConstructor is object); 443Debug.Assert(attribute.AttributeClass is object); 467Debug.Assert(arguments.AttributeSyntaxOpt is object); 470Debug.Assert(attribute.AttributeClass is object); 578Debug.Assert(positionalArg.ValueInternal is object);
Symbols\Attributes\CommonAttributeDataComparer.cs (3)
27Debug.Assert(attr1 != null); 28Debug.Assert(attr2 != null); 40Debug.Assert(attr != null);
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)
215Debug.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)
102Debug.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)
139Debug.Assert(idx >= 0); 224Debug.Assert(node.FullSpan.Contains(targetPosition)); 230Debug.Assert(!green.IsList); 310Debug.Assert(idx >= 0); 408Debug.Assert(_node is object);
Syntax\ChildSyntaxList.Enumerator.cs (2)
50Debug.Assert(_node != null); 63Debug.Assert(_node is object);
Syntax\ChildSyntaxList.Reversed.cs (2)
29Debug.Assert(_node is object); 92Debug.Assert(_node is object);
Syntax\CommonSyntaxNodeRemover.cs (1)
36Debug.Assert(node is object);
Syntax\GreenNode.cs (7)
159Debug.Assert(value <= byte.MaxValue); 223Debug.Assert(0 <= offset && offset < FullWidth); 229Debug.Assert(i < SlotCount); 979Debug.Assert(this.IsCacheable); 997Debug.Assert(this.IsCacheable); 1007Debug.Assert(this.IsCacheable); 1018Debug.Assert(this.IsCacheable);
Syntax\GreenNode.NodeEnumerable.cs (1)
43Debug.Assert(_started);
Syntax\GreenNode.NodeFlagsAndSlotCount.cs (2)
44Debug.Assert(shifted <= SlotCountTooLarge); 67Debug.Assert((ushort)value <= NodeFlagsMask);
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); 145Debug.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 (1)
137Debug.Assert(node.GetCacheHash() == hash);
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 (3)
153Debug.Assert(green.IsToken); 442Debug.Assert(node is object); 455Debug.Assert(tr.UnderlyingNode is object);
Syntax\SeparatedSyntaxListBuilder.cs (1)
78Debug.Assert(separatorToken.Node is object);
Syntax\SyntaxDiffer.cs (13)
196System.Diagnostics.Debug.Assert(count >= 0); 444Debug.Assert(tr.UnderlyingNode is object); 450Debug.Assert(tr.UnderlyingNode is object); 456Debug.Assert(tr.UnderlyingNode is object); 465Debug.Assert(tr.UnderlyingNode is object); 476Debug.Assert(n1.UnderlyingNode is object); 487Debug.Assert(n2.UnderlyingNode is object); 587Debug.Assert(change.Range.Span.Start >= last.Range.Span.End); 610Debug.Assert(textChangeRange.Span.Start >= last.Range.Span.End); 643Debug.Assert(start >= 0); 644Debug.Assert(end >= 0); 668Debug.Assert(start >= 0); 669Debug.Assert(end >= 0);
Syntax\SyntaxList`1.cs (2)
150Debug.Assert(index == 0); 405Debug.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 (6)
107Debug.Assert(width >= 0); 213Debug.Assert(this.IsList); 233Debug.Assert(this.IsList); 1468Debug.Assert(Eof.EndPosition == position); 1485Debug.Assert(curNode.RawKind != 0); 1486Debug.Assert(curNode.FullSpan.Contains(position));
Syntax\SyntaxNode.Iterators.cs (19)
71Debug.Assert(_stack is object); 86Debug.Assert(_stack is object); 102Debug.Assert(_stack is object); 218Debug.Assert(_discriminatorStack is object); 229Debug.Assert(_discriminatorStack is object); 241Debug.Assert(_discriminatorStack is object); 250Debug.Assert(_discriminatorStack is object); 258Debug.Assert(_discriminatorStack is object); 265Debug.Assert(_discriminatorStack is object); 313Debug.Assert(_discriminatorStack is object); 324Debug.Assert(_discriminatorStack is object); 336Debug.Assert(_discriminatorStack is object); 343Debug.Assert(_discriminatorStack is object); 344Debug.Assert(_tokenStack is object); 353Debug.Assert(_discriminatorStack is object); 361Debug.Assert(_discriminatorStack is object); 368Debug.Assert(_discriminatorStack is object); 375Debug.Assert(_discriminatorStack is object); 376Debug.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 (2)
136Debug.Assert(UnderlyingNode is not null); 702Debug.Assert(
Syntax\SyntaxNodeOrTokenList.cs (1)
42Debug.Assert(node != null || index == 0);
Syntax\SyntaxToken.cs (1)
83Debug.Assert(Node is object);
Syntax\SyntaxTokenList.cs (7)
30Debug.Assert(tokenOrList != null || (position == 0 && index == 0 && parent == null)); 31Debug.Assert(position >= 0); 32Debug.Assert(tokenOrList == null || (tokenOrList.IsToken) || (tokenOrList.IsList)); 102Debug.Assert(token.Node is object); 257Debug.Assert(this.Count >= offset + count); 270Debug.Assert(Node is object); 279Debug.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)
110Debug.Assert(_singleNodeOrList is object); 112Debug.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\SyntaxTrivia.cs (2)
33Debug.Assert(this.RawKind != 0 || this.Equals(default(SyntaxTrivia))); 63Debug.Assert(node is object);
Syntax\SyntaxTriviaList.cs (2)
452Debug.Assert(Node is object); 458Debug.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)
107Debug.Assert(_singleNodeOrList is object); 111Debug.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) || 525Debug.Assert(lastSegment.Lines.Count >= 1); 533Debug.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 (7)
68Debug.Assert(embeddedTextBlob.IsDefault || !checksum.IsDefault); 488Debug.Assert(0 <= span.Start && span.Start <= span.End); 633Debug.Assert(charBuffer.Length == CharBufferSize); 1187Debug.Assert(buffer1.Length == buffer2.Length); 1188Debug.Assert(buffer1.Length == CharBufferSize); 1221Debug.Assert(length <= source.Length); 1291Debug.Assert(stream.CanSeek);
Text\SourceTextStream.cs (1)
33Debug.Assert(source.Encoding != null || useDefaultEncodingIfNull);
Text\SubText.cs (3)
123Debug.Assert(_subText.UnderlyingText[underlyingSpanStart - 1] == '\r' && _subText.UnderlyingText[underlyingSpanStart] == '\n'); 131Debug.Assert(_subText.UnderlyingText[underlyingSpanEnd - 1] == '\r' && _subText.UnderlyingText[underlyingSpanEnd] == '\n'); 192Debug.Assert(resultLine.ToString().All(static c => !TextUtilities.IsAnyLineBreakCharacter(c)));
Text\TextChange.cs (1)
90Debug.Assert(change.NewText is object);
Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
Text\TextLine.cs (2)
90Debug.Assert(span.Start == 0 || TextUtilities.IsAnyLineBreakCharacter(text[span.Start - 1])); 91Debug.Assert(span.End == text.Length || TextUtilities.IsAnyLineBreakCharacter(text[span.End - 1]));
VersionHelper.cs (2)
55Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 188Debug.Assert(revision < ushort.MaxValue);
WellKnownMembers.cs (1)
5833Debug.Assert(!descriptor.IsSpecialTypeMember); // Members of types from core library should be in the SpecialMember set instead.
WellKnownTypes.cs (5)
776Debug.Assert(typeId != WellKnownType.ExtSentinel); 782Debug.Assert(typeId != WellKnownType.ExtSentinel); 805Debug.Assert(WellKnownType.First != 0); 812Debug.Assert(invokeArgumentCount >= 0); 821Debug.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.CodeStyle (488)
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
76Debug.Assert(options.Count > 1); 88Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
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\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
71Debug.Assert(customTags.Length == tags.Length); 75Debug.Assert(customTags[i] == tags[i]); 81Debug.Assert(isConfigurable || enforceOnBuild == EnforceOnBuild.Never);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
338Debug.Assert(id.StartsWith("IDE", StringComparison.Ordinal));
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (4)
52Debug.Assert(perLanguageValuedOption.IsPerLanguage); 88Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions)); 89Debug.Assert(options.All(option => option.Definition.IsEditorConfigOption)); 101Debug.Assert(!s_diagnosticIdToFadingOptionMap.TryGetValue(diagnosticId, out var existingOption) || existingOption.Equals(fadingOption));
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (3)
109Debug.Assert(fieldStateMap.ContainsKey(field.OriginalDefinition)); 219Debug.Assert(IsCandidateField(field)); 278Debug.Assert(isInInstanceConstructor);
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
104Debug.Assert(preference.Value == ParenthesesPreference.NeverIfUnnecessary ||
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (4)
422Debug.Assert(!analyzer.IsCompilerAnalyzer()); 454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics); 554Debug.Assert(diagnostic.Location.IsInSource); 555Debug.Assert(diagnostic.Location.SourceTree == tree);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
399Debug.Assert(memberReference.Parent is ICompoundAssignmentOperation compoundAssignment && 539Debug.Assert(IsCandidateSymbol(member)); 540Debug.Assert(!member.IsImplicitlyDeclared);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
254Debug.Assert(unusedValueExpressionStatementSeverity.Severity != ReportDiagnostic.Suppress || 315Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _)); 321Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (3)
259Debug.Assert(operation.Kind is OperationKind.DelegateCreation or OperationKind.AnonymousFunction); 308Debug.Assert(operation.Kind is OperationKind.LocalReference or OperationKind.ParameterReference); 594Debug.Assert(symbol is not ILocalSymbol local || !local.IsRef);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
36Debug.Assert(binaryToAssignmentMap.Count == assignmentToTokenMap.Count); 37Debug.Assert(binaryToAssignmentMap.Values.All(assignmentToTokenMap.ContainsKey));
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
70Debug.Assert(elementCount >= 2 || statements.Length >= 2);
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
202Debug.Assert(syntaxFacts.IsArgument(argsArgument));
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\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (16)
86Debug.Assert(items != null); 487Debug.Assert(self.Length == other.Length); 518Debug.Assert(self.Length == other.Length); 550Debug.Assert(!array.IsDefault); 551Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 570Debug.Assert(i > 0); 586Debug.Assert(i > 0); 589Debug.Assert(builder == null); 602Debug.Assert(!all); 603Debug.Assert(!none); 612Debug.Assert(none); 816Debug.Assert(!array.IsDefault); 1189Debug.Assert(builder.Count > 1); 1233Debug.Assert(members.Length > 0); 1248Debug.Assert(count < members.Length); 1260Debug.Assert(builder.Count == count);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (11)
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); 309Debug.Assert(this.Count >= 1); 343Debug.Assert(_count >= 1);
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (2)
170Debug.Assert(_count == InlineCapacity); 333Debug.Assert(_builder is null);
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\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
48Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 72Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 85Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 102Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 108Debug.Assert(PathUtilities.GetPathKind(path) == kind); 173Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 174Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 199Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 249Debug.Assert(PathUtilities.IsAbsolute(path)); 293Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 311Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 395Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 413Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 436Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
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\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
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\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\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
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\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
737Debug.Assert(data.All(d => d.Count() == count)); 996Debug.Assert(local.Length == size);
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
199Debug.Assert(HasOneItem == other.HasOneItem);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
28Debug.Assert(number >= 0);
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
375Debug.Assert(value.GetType().IsPrimitive);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
118Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (41)
110Debug.Assert(i != j); 123Debug.Assert(i != j); 132Debug.Assert(comparer != null); 145Debug.Assert(keys.Length > 0); 146Debug.Assert(depthLimit >= 0); 147Debug.Assert(comparer != null); 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 191Debug.Assert(comparer != null); 235Debug.Assert(comparer != null); 236Debug.Assert(keys.Length > 0); 253Debug.Assert(comparer != null); 413Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 425Debug.Assert(keys.Length > 0); 426Debug.Assert(depthLimit >= 0); 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 535Debug.Assert(keys.Length > 0); 691Debug.Assert(comparer != null); 692Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 693Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 694Debug.Assert(i != j); 711Debug.Assert(i != j); 724Debug.Assert(comparer != null); 725Debug.Assert(keys.Length == values.Length); 735Debug.Assert(keys.Length > 0); 736Debug.Assert(values.Length == keys.Length); 737Debug.Assert(depthLimit >= 0); 738Debug.Assert(comparer != null); 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 782Debug.Assert(comparer != null); 826Debug.Assert(comparer != null); 827Debug.Assert(keys.Length > 0); 844Debug.Assert(comparer != null); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1233Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
32Debug.Assert(bitPosition >= 0); 46Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\SegmentedArray.cs (5)
112Debug.Assert(length > 0); 113Debug.Assert(sourceIndex >= 0); 114Debug.Assert(destinationIndex >= 0); 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length);
src\Dependencies\Collections\SegmentedDictionary`2.cs (11)
166Debug.Assert(_entries.Length >= source.Count); 167Debug.Assert(_count == 0); 258Debug.Assert(modified); 265Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 445Debug.Assert(comparer is not null); 516Debug.Assert(_buckets.Length > 0); 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 572Debug.Assert(comparer is not null); 647Debug.Assert(newSize >= _entries.Length); 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
src\Dependencies\Collections\SegmentedHashSet`1.cs (6)
187Debug.Assert(Count == source.Count); 256Debug.Assert(comparer is not null); 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 900Debug.Assert(newSize >= _entries.Length); 1021Debug.Assert(_buckets.Length > 0); 1061Debug.Assert(comparer is not null);
src\Dependencies\Collections\SegmentedList`1.cs (2)
268Debug.Assert(_size == _items.Length); 518Debug.Assert(_items.Length < capacity);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
184Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
192Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 214Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 222Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 260Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 268Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 312Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 321Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
101Debug.Assert(rightBalance == 1); 114Debug.Assert(leftBalance == -1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (4)
74Debug.Assert(!string.IsNullOrEmpty(sectionName)); 91Debug.Assert(!string.IsNullOrEmpty(key)); 92Debug.Assert(key == key.Trim()); 93Debug.Assert(value == value.Trim());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
313Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (5)
80Debug.Assert(expectedValueText == actualValueText); 136Debug.Assert(!token.ContainsDiagnostics); 140Debug.Assert(startDelimiter == ""); 141Debug.Assert(endDelimiter == ""); 220Debug.Assert(char.IsSurrogate(ch));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (1)
103Debug.Assert(index + 1 >= data.Length ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
196Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 197Debug.Assert(_span.End == virtualChars._span.Start); 208Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (1)
44Debug.Assert(type is null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
24Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 29Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (7)
90Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 176Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 214Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 251Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 376Debug.Assert(current.IsDefinition); 410Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 437Debug.Assert(current.IsDefinition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
537Debug.Assert(isTypeParameter2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
44Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
146Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
31Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
60Debug.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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 144Debug.Assert(cfg.Parent != null); 145Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 146Debug.Assert(parentAnalysisData != null); 303Debug.Assert(lambdaOrLocalFunctionCfg != null); 313Debug.Assert(anonymousFunctionCfg != null); 322Debug.Assert(localFunction.IsLocalFunction()); 330Debug.Assert(localFunctionCfg != null); 346Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 487Debug.Assert(localFunction.IsLocalFunction()); 488Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 578Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
54Debug.Assert(_currentContainingSymbol == null); 55Debug.Assert(_currentAnalysisData == null); 56Debug.Assert(_currentRootOperation == null); 57Debug.Assert(_pendingWritesMap == null); 110Debug.Assert(symbol != null); 162Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 198Debug.Assert(symbolOpt != null); 208Debug.Assert(symbolOpt == null); 211Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 347Debug.Assert(localFunction.IsLocalFunction()); 500Debug.Assert(operation.Type.IsDelegateType());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
57Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (2)
148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
65Debug.Assert(this.TokenCount > 0); 87Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 391Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 392Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 416Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 417Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 435Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 447Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 495Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 519Debug.Assert(token.FullSpan.IsEmpty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
751Debug.Assert(!_firstLineBlank); 857Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
85Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
160Debug.Assert(spanToCheck.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
23Debug.Assert(nameSpan.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
70Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 72Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 73Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
60Debug.Assert(IsSupportedOptionType(Type));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
23Debug.Assert(option.IsPerLanguage == language is not null); 31Debug.Assert(option.IsPerLanguage); 43Debug.Assert(!option.IsPerLanguage);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (3)
90Debug.Assert(BitConverter.IsLittleEndian); 468Debug.Assert(id >= 0); 540Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
44Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsAnonymousType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
196Debug.Assert(reader.Position == symbolKey.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
18Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 130Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 263Debug.Assert(method != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
37Debug.Assert(symbol.IsGlobalNamespace); 95Debug.Assert(metadataName == string.Empty); 99Debug.Assert(metadataName == string.Empty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
110Debug.Assert(_nestingCount == 0); 256Debug.Assert(location.Kind is LocationKind.None or 310Debug.Assert(!array.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22Debug.Assert(symbol.IsTupleType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (17)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 572Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 573Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 627Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 629Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1081Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1082Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1167Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
202Debug.Assert(!this.IsLocked); 211Debug.Assert(this.IsOwnedByMe);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (7)
114Debug.Assert(source != null); 115Debug.Assert(scheduler != null); 116Debug.Assert(body != null); 279Debug.Assert(source != null); 280Debug.Assert(scheduler != null); 281Debug.Assert(body != null); 543Debug.Assert(!Cancellation.IsCancellationRequested);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (3)
85Debug.Assert(current < length); 107Debug.Assert(current < length); 126Debug.Assert(char.IsUpper(identifier[current - 1]));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
164Debug.Assert(_assemblyComparer == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
77Debug.Assert(!x.IsDefault && !y.IsDefault); 113Debug.Assert(x.Kind == y.Kind && x.Kind == k); 331Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 617Debug.Assert( 621Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
261Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
134Debug.Assert(similarityWeight <= _threshold);
Microsoft.CodeAnalysis.CodeStyle.Fixes (18)
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
395Debug.Assert(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
87Debug.Assert(constructor.Parameters.Length == expressions.Length);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
45Debug.Assert(diagnostics.Select(diagnostic => diagnostic.Properties[MatchFolderAndNamespaceConstants.TargetNamespace]).Distinct().Count() == 1); 64Debug.Assert(newSolution != document.Project.Solution);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
62Debug.Assert(missingCases || missingDefaultCase);
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
99Debug.Assert(childDeclarators.All(c => !declarators.Contains(c)));
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
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); 726Debug.Assert(removeAssignments);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
341Debug.Assert(desiredGroupIndex >= 0); 342Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
47Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (2)
50Debug.Assert(diagnostic != null); 104Debug.Assert(analyzerConfigPath != null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel);
Microsoft.CodeAnalysis.CodeStyle.UnitTestUtilities (1)
src\Workspaces\CoreTestUtilities\OptionsCollection.cs (1)
40Debug.Assert(optionKey.Option is IOption2 { Definition.StorageMapping: null });
Microsoft.CodeAnalysis.Collections.Package (72)
ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
118Debug.Assert(other is not ValueBuilder);
Internal\ArraySortHelper.cs (41)
110Debug.Assert(i != j); 123Debug.Assert(i != j); 132Debug.Assert(comparer != null); 145Debug.Assert(keys.Length > 0); 146Debug.Assert(depthLimit >= 0); 147Debug.Assert(comparer != null); 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 191Debug.Assert(comparer != null); 235Debug.Assert(comparer != null); 236Debug.Assert(keys.Length > 0); 253Debug.Assert(comparer != null); 413Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 425Debug.Assert(keys.Length > 0); 426Debug.Assert(depthLimit >= 0); 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 535Debug.Assert(keys.Length > 0); 691Debug.Assert(comparer != null); 692Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 693Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 694Debug.Assert(i != j); 711Debug.Assert(i != j); 724Debug.Assert(comparer != null); 725Debug.Assert(keys.Length == values.Length); 735Debug.Assert(keys.Length > 0); 736Debug.Assert(values.Length == keys.Length); 737Debug.Assert(depthLimit >= 0); 738Debug.Assert(comparer != null); 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 782Debug.Assert(comparer != null); 826Debug.Assert(comparer != null); 827Debug.Assert(keys.Length > 0); 844Debug.Assert(comparer != null); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1233Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
Internal\BitHelper.cs (2)
32Debug.Assert(bitPosition >= 0); 46Debug.Assert(bitPosition >= 0);
Internal\HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
SegmentedArray.cs (5)
112Debug.Assert(length > 0); 113Debug.Assert(sourceIndex >= 0); 114Debug.Assert(destinationIndex >= 0); 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length);
SegmentedDictionary`2.cs (11)
166Debug.Assert(_entries.Length >= source.Count); 167Debug.Assert(_count == 0); 258Debug.Assert(modified); 265Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 445Debug.Assert(comparer is not null); 516Debug.Assert(_buckets.Length > 0); 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 572Debug.Assert(comparer is not null); 647Debug.Assert(newSize >= _entries.Length); 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
SegmentedHashSet`1.cs (6)
187Debug.Assert(Count == source.Count); 256Debug.Assert(comparer is not null); 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 900Debug.Assert(newSize >= _entries.Length); 1021Debug.Assert(_buckets.Length > 0); 1061Debug.Assert(comparer is not null);
SegmentedList`1.cs (2)
268Debug.Assert(_size == _items.Length); 518Debug.Assert(_items.Length < capacity);
Microsoft.CodeAnalysis.CSharp (6704)
Binder\Binder.CapturedParametersFinder.cs (2)
58Debug.Assert(syntaxNode is not null); 165Debug.Assert(lookupResult.SingleSymbolOrDefault == (object)parameter);
Binder\Binder.cs (2)
93Debug.Assert(Next is not null); 760Debug.Assert(syntax.GetLocation() != null);
Binder\Binder.IdentifierUsedAsValueFinder.cs (7)
123Debug.Assert(targetNode.Parent is not null); 196Debug.Assert(_lookupResult?.IsClear != false); 259Debug.Assert(!type.IsDynamic()); 260Debug.Assert(lookupResult.IsClear); 269Debug.Assert(lookupResult.Symbols.Any()); 277Debug.Assert(members.Count > 0); 290Debug.Assert(symbol.Kind != SymbolKind.Method);
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.QueryTranslationState.cs (2)
78Debug.Assert(identifier.Parent is { }); 126Debug.Assert(nextInvokedMethodName is null);
Binder\Binder.ValueChecks.cs (73)
116Debug.Assert(parameter.RefKind.IsWritableReference() && parameter.Type.IsRefLikeOrAllowsRefLikeType()); 117Debug.Assert(GetParameterValEscapeLevel(parameter).HasValue); 158Debug.Assert(!isArgList || parameter is null); 416Debug.Assert(parameters.Length == indexerAccess.Indexer.Parameters.Length); 496Debug.Assert(expr.Syntax.Kind() != SyntaxKind.Argument || valueKind == BindValueKind.RefOrOut); 501Debug.Assert(valueKind == BindValueKind.RefOrOut); 612Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable); 676Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 847Debug.Assert(!RequiresRefAssignableVariable(valueKind)); 1111Debug.Assert(!RequiresAssignableVariable(BindValueKind.AddressOf)); 1130Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind)); 1138Debug.Assert(backingField.RefKind == RefKind.None); 1139Debug.Assert(!RequiresRefAssignableVariable(valueKind)); 1143Debug.Assert(backingField.RefKind == RefKind.None); 1176Debug.Assert(valueKind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp 1280Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape.IsReturnOnly); 1362Debug.Assert(!fieldSymbol.IsStatic); 1363Debug.Assert(valueKind == BindValueKind.RefAssignable); 1504Debug.Assert(fieldAccess.ReceiverOpt is { }); 1560Debug.Assert(!RequiresVariableReceiver(receiver, eventSymbol)); 1607Debug.Assert(receiver != null); 1687Debug.Assert((object)propertySymbol != null); 1688Debug.Assert(propertySyntax != null); 1700Debug.Assert(propertySymbol.TypeWithAnnotations.HasType); 1902Debug.Assert(member.Kind != SymbolKind.Property); 1903Debug.Assert(member.Kind != SymbolKind.Event); 1970Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(argsOpt, parameters, argsToParamsOpt)); 2127Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(argsOpt, parameters, argsToParamsOpt)); 2291Debug.Assert(receiver.Type is { }); 2292Debug.Assert(receiverIsSubjectToCloning != ThreeState.Unknown); 2296Debug.Assert(receiver is not BoundValuePlaceholderBase && method is not null && receiver.Type?.IsReferenceType == false); 2320Debug.Assert(argIndex == argsOpt.Length - 1); 2396Debug.Assert(!getArgument.RefKind.IsWritableReference()); 2758Debug.Assert(symbol is null or SourceLocalSymbol or GlobalExpressionVariable); 2991Debug.Assert(underlyingParameter.IsThis); 2992Debug.Assert(underlyingParameter.RefKind != RefKind.Out); // Shouldn't get here for a constructor 2993Debug.Assert(underlyingParameter.ContainingSymbol is MethodSymbol); 3066Debug.Assert((object)local != null); 3067Debug.Assert(kind != BindValueKind.RValue); 3225Debug.Assert((object)field != null); 3226Debug.Assert(field.RefKind == RefKind.None ? RequiresAssignableVariable(kind) : RequiresRefAssignableVariable(kind)); 3227Debug.Assert(field.Type != (object)null); 3231Debug.Assert(kind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp 3261Debug.Assert((object)symbol != null); 3262Debug.Assert(RequiresAssignableVariable(kind)); 3298Debug.Assert(expr.Type is not null); 3380Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 3533Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 3541Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 3582Debug.Assert(expr is BoundConversion conversion && 3589Debug.Assert(expr is BoundUnaryOperator unaryOperator && 3596Debug.Assert(expr is BoundBinaryOperator binaryOperator && 3603Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && 3609Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && 3631Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 3706Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 3854Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None); 3862Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None); 3953Debug.Assert(!conversion.Conversion.IsUserDefined || 3959Debug.Assert(expr is BoundUnaryOperator unaryOperator && 3966Debug.Assert(expr is BoundBinaryOperator binaryOperator && 3973Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator && 3979Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator && 4050Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 4357Debug.Assert(operatorMethod is not null); 4529Debug.Assert(elementType.Type is { }); 4544Debug.Assert(constructMethod.ReturnType.Equals(expr.Type, TypeCompareKind.AllIgnoreOptions)); 4545Debug.Assert(parameter.Type.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 4628Debug.Assert(expr.AccessorKind != AccessorKind.Unknown); 4715Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter()); 4747Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything)); 5141Debug.Assert(operatorMethod is not null); 5503Debug.Assert(conversion.Conversion.IsInlineArray);
Binder\Binder.WithQueryLambdaParametersBinder.cs (3)
39Debug.Assert(!qv.IsTransparent); 56Debug.Assert(base.lambdaSymbol.Parameters[0].Name.StartsWith(transparentIdentifierPrefix, StringComparison.Ordinal)); 107Debug.Assert(result.IsClear);
Binder\Binder_Attributes.cs (31)
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()); 257Debug.Assert(boundConstructorArguments.All(a => !a.NeedsToBeConverted())); 265Debug.Assert(boundNamedArguments.All(arg => !arg.Right.NeedsToBeConverted())); 288Debug.Assert(boundAttribute.Syntax.Kind() == SyntaxKind.Attribute); 295Debug.Assert(hasErrors); 326Debug.Assert(rewrittenArguments.Length == attributeConstructor.ParameterCount); 352Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) == (boundAttribute.ConstructorExpanded ? 1 : 0)); 377Debug.Assert(argsToParamsOpt.IsDefault 384Debug.Assert(!arguments[argIndex].IsParamsArrayOrCollection || arguments[argIndex] is BoundArrayCreation); 401Debug.Assert(paramType.HasType); 420Debug.Assert((object)attributeType != null); 421Debug.Assert(!attributeType.IsErrorType()); 426Debug.Assert(conditionalSymbols != null); 516Debug.Assert(namedArgument.NameEquals is not null); 547Debug.Assert(resultKind == LookupResultKind.Viable || wasError); 705Debug.Assert(!constructorArgsArray.IsDefault); 706Debug.Assert(!hasErrors); 741Debug.Assert(hasErrors || reorderedArguments.All(arg => arg.Kind != TypedConstantKind.Error)); 917Debug.Assert(type.IsSZArray());
Binder\Binder_Await.cs (2)
262Debug.Assert(TypeSymbol.Equals(expression.Type, getAwaiterArgument.Type, TypeCompareKind.ConsiderEverything)); 424Debug.Assert(conversion.IsValid);
Binder\Binder_Constraints.cs (11)
32Debug.Assert(this.Flags.Includes(BinderFlags.GenericConstraintsClause)); 34Debug.Assert((containingSymbol.Kind == SymbolKind.NamedType) || (containingSymbol.Kind == SymbolKind.Method)); 35Debug.Assert(typeParameters.Length > 0); 36Debug.Assert(clauses.Count > 0); 65Debug.Assert(ordinal >= 0); 66Debug.Assert(ordinal < n); 124Debug.Assert(!InExecutableBinder); // Cannot eagerly report diagnostics handled by LazyMissingNonNullTypesContextDiagnosticInfo 344Debug.Assert(!isForOverride || 391Debug.Assert(typeParameters.Length > 0); 392Debug.Assert(typeParameters.Length == constraintClauses.Count); 468Debug.Assert(possibleFileType?.IsDefinition != false);
Binder\Binder_Conversions.cs (83)
67Debug.Assert(result is BoundConversion || (conversion.IsIdentity && ((object)result == source) || source.NeedsToBeConverted()) || hasErrors); 72Debug.Assert(filterConversion(conversion)); 73Debug.Assert(BoundNode.GetConversion(result, placeholder1) == conversion); 79Debug.Assert(BoundNode.GetConversion(result2, placeholder2) == conversion); 191Debug.Assert(destination.SpecialType != SpecialType.System_String); 214Debug.Assert(!conversion.Exists); 233Debug.Assert(conversion.IsCollectionExpression 255Debug.Assert(source.Type is null); 256Debug.Assert(!conversion.Exists); 303Debug.Assert(!conversion.IsMethodGroup); 318Debug.Assert(conversion.UnderlyingConversions.Length == 1); 378Debug.Assert(elementConversions.Length == sourceTypes.Length); 400Debug.Assert(conversion.UnderlyingConversions.IsDefault); 409Debug.Assert(syntax.SyntaxTree is object); 417Debug.Assert(conversion.ConstrainedToTypeOpt is TypeParameterSymbol); 446Debug.Assert(source.Type is { }); 449Debug.Assert(elementField is { }); 468Debug.Assert(destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions)); 485Debug.Assert(source.Type is not null); 486Debug.Assert(destination.IsSpan() || destination.IsReadOnlySpan()); 507Debug.Assert(destination.IsReadOnlySpan()); 519Debug.Assert(destination.IsReadOnlySpan()); 576Debug.Assert(type.IsSpan() || type.IsReadOnlySpan()); 577Debug.Assert(type.IsDefinition); 586Debug.Assert(spanType.IsSpan() && readonlySpanType.IsReadOnlySpan()); 587Debug.Assert(spanType.IsDefinition && readonlySpanType.IsDefinition); 609Debug.Assert(source.IsSpan() || source.IsReadOnlySpan()); 610Debug.Assert(destination.IsReadOnlySpan()); 611Debug.Assert(!source.IsDefinition && !destination.IsDefinition); 618Debug.Assert(!source.IsReadOnlySpan() || !sameElementTypes); 626Debug.Assert(source.IsReadOnlySpan() && destination.IsReadOnlySpan()); 627Debug.Assert(source.IsDefinition && destination.IsDefinition); 654Debug.Assert(readOnlySpanType.IsReadOnlySpan()); 655Debug.Assert(!readOnlySpanType.IsDefinition); 656Debug.Assert(((NamedTypeSymbol)readOnlySpanType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].SpecialType is SpecialType.System_Char); 709Debug.Assert(destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) || 749Debug.Assert(expr is BoundObjectCreationExpressionBase { WasTargetTyped: true } or 754Debug.Assert(expr is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node.Syntax, node)); 824Debug.Assert(conversion.Kind is ConversionKind.NoConversion); 853Debug.Assert(elementType is { }); 888Debug.Assert(inProgressConstructor is not null); 895Debug.Assert((collectionCreation is BoundNewT && !isExpanded && constructor is null) || 945Debug.Assert(elementType is { }); 946Debug.Assert(elements.Length == elementConversions.Length); 947Debug.Assert(elementConversions.All(c => c.Exists)); 989Debug.Assert(enumeratorInfo is { }); 990Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable. 1040Debug.Assert(result); 1044Debug.Assert(result); 1062Debug.Assert(parameterType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 1108Debug.Assert(!isParamsModifierValidation || syntax is ParameterSyntax); 1240Debug.Assert(!targetType.IsDynamic()); 1356Debug.Assert(methodGroup.ReceiverOpt is not null); 1357Debug.Assert(methodGroup.ReceiverOpt.Type is not null); 1451Debug.Assert(methodGroup.ReceiverOpt is not null); 1467Debug.Assert(receiverType is not null); 1528Debug.Assert(constructed is not null); 1561Debug.Assert(node != null); 1562Debug.Assert(methodGroup != null); 1563Debug.Assert(methodGroup.Error == null); 1564Debug.Assert(methodGroup.Methods.Count > 0); 1617Debug.Assert(!method.IsRuntimeFinalizer()); 1653Debug.Assert(call.Method.Name == "Add"); 1656Debug.Assert(false); // Add test if we hit this assert. 1684Debug.Assert(false); 1752Debug.Assert(elementTypeWithAnnotations.Type is null); // GetCollectionExpressionTypeKind() does not set elementType for these cases. 1764Debug.Assert(elementTypeWithAnnotations.HasType); 1774Debug.Assert(elementType is { }); 1821Debug.Assert(reportedErrors); 1931Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything)); 1970Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything)); 2003Debug.Assert(conversionGroup != null); 2052Debug.Assert(conversion.BestUserDefinedConversionAnalysis is object); // All valid user-defined conversions have this populated 2166Debug.Assert(conversion.Kind == ConversionKind.FunctionType); 2167Debug.Assert(source.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda); 2172Debug.Assert(delegateType is { }); 2312Debug.Assert(delegateType is not null); 2316Debug.Assert(lambdaSymbol.ParameterCount == delegateParameters.Length); 2429Debug.Assert(conversion.IsNullable == destination.IsNullableType()); 2668Debug.Assert(!invokedAsExtensionMethod); 2832Debug.Assert(methodParameters.Length > numParams + (isExtensionMethod ? 1 : 0)); 2998Debug.Assert(conversion.Method is object); 3200Debug.Assert(underlyingType.SpecialType != SpecialType.None);
Binder\Binder_Crefs.cs (18)
83Debug.Assert(Flags.Includes(BinderFlags.Cref)); 95Debug.Assert((object)namespaceOrTypeSymbol != null); 160Debug.Assert((object?)containerOpt == null); 206Debug.Assert(sortedSymbols.All(SymbolExtensions.IsIndexer)); 370Debug.Assert(memberName == memberNameText); 460Debug.Assert(builder != null); 485Debug.Assert(!symbols.IsEmpty); 671Debug.Assert(!symbols.IsEmpty); 690Debug.Assert(!best.IsNone); 691Debug.Assert(!secondBest.IsNone); 885Debug.Assert(typeArgumentListSyntax is object); 892Debug.Assert(unusedDiagnostics.DiagnosticBag is object); 921Debug.Assert(symbol is NamedTypeSymbol); 942Debug.Assert(parameterListSyntax.Parent is object); 960Debug.Assert(InCrefButNotParameterOrReturnType); 966Debug.Assert(!this.Compilation.ContainsSyntaxTree(typeSyntax.SyntaxTree) || 972Debug.Assert(localDiagnostics.DiagnosticBag is object); 980Debug.Assert(typeSyntax.Parent is object);
Binder\Binder_Deconstruct.cs (17)
96Debug.Assert(locals.NestedVariables is object); 120Debug.Assert(diagnostics.DiagnosticBag is object); 158Debug.Assert(hasErrors || lhsTuple.Type is object); 184Debug.Assert(parent.Kind() == SyntaxKind.SimpleAssignmentExpression); 210Debug.Assert(diagnostics.DiagnosticBag is object); 250Debug.Assert((object)type != null); 308Debug.Assert(nestedConversion.Kind == ConversionKind.Deconstruction); 320Debug.Assert(single is object); 321Debug.Assert(single.Type is not null); 379Debug.Assert((object?)pending.Type == null); 403Debug.Assert(variable.Single is object); 421Debug.Assert((object?)variables[i].Single!.Type != null); 461Debug.Assert(NestedVariables is object); 501Debug.Assert(variable.Single is object); 564Debug.Assert(variable.Single is object); 752Debug.Assert(isVar == !declType.HasType); 950Debug.Assert(TypeSymbol.Equals(declTypeWithAnnotations.Type, fieldType.Type, TypeCompareKind.ConsiderEverything2));
Binder\Binder_Expressions.cs (230)
196Debug.Assert(expr != null); 197Debug.Assert(resultKind != LookupResultKind.Viable); 310Debug.Assert(op.NoCommonTypeError != 0); 411Debug.Assert(expr.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup); 441Debug.Assert((object)this.ContainingMemberOrLambda == field); 449Debug.Assert(initializerBinder != null); 499Debug.Assert(this.InParameterDefaultValue); 500Debug.Assert(this.ContainingMemberOrLambda.Kind == SymbolKind.Method || this.ContainingMemberOrLambda.Kind == SymbolKind.Property); 504Debug.Assert(defaultValueBinder != null); 522Debug.Assert(initializerBinder != null); 590Debug.Assert(node != null); 1440Debug.Assert(ContainingType is { }); 1458Debug.Assert((this.Flags & BinderFlags.InContextualAttributeBinder) != 0); 1502Debug.Assert(symbol is null or LocalSymbol or LocalFunctionSymbol or RangeVariableSymbol or TypeParameterSymbol); 1580Debug.Assert(node != null); 1618Debug.Assert(node.Arity == typeArgumentList.Count); 1669Debug.Assert(isError); // Should have been reported by GetSymbolOrMethodOrPropertyGroup. 1743Debug.Assert(SyntaxFacts.IsInvoked(id) == invoked); 1806Debug.Assert(!isError); 1807Debug.Assert(!primaryConstructor.GetCapturedParameters().ContainsKey(shadowedParameter)); // How could we capture a shadowed parameter? 1834Debug.Assert((options & LookupOptions.NamespacesOrTypesOnly) == 0); 1863Debug.Assert(node.Identifier.IsUnderscoreToken()); 1971Debug.Assert(!symbol.ContainingSymbol.Equals(containingMethod)); 2120Debug.Assert(primaryCtor is null || 2139Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType()); 2162Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType()); 2485Debug.Assert(node != null); 2513Debug.Assert(location is not null); 2523Debug.Assert(this.ContainingMemberOrLambda is not null); 2587Debug.Assert(node.OperatorToken.IsKind(SyntaxKind.CaretToken)); 2786Debug.Assert(conversion.IsUserDefined); 2871Debug.Assert((object)operand.Type != null); 2912Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType()); 2913Debug.Assert((object)operand.Type != null && !operand.Type.IsNullableType()); 3162Debug.Assert(isVar != declType.HasType); 3178Debug.Assert(declarationExpression.IsOutVarDeclaration()); 3202Debug.Assert(localSymbol.DeclarationKind == LocalDeclarationKind.OutVariable); 3320Debug.Assert(argumentSyntax is ArgumentSyntax || argumentSyntax is AttributeArgumentSyntax); 3432Debug.Assert(result.ConversionForArg(arg).IsIdentity); 3433Debug.Assert(!argument.NeedsToBeConverted()); 3434Debug.Assert(!expanded || result.ParameterFromArgument(arg) != parameters.Length - 1); 3450Debug.Assert(!available); 3462Debug.Assert(argNumber > 0); 3475Debug.Assert(argNumber >= 0); // can be 0 for receiver of extension method 3484Debug.Assert(argNumber > 0); 3510Debug.Assert(paramsArgsBuilder is null); 3550Debug.Assert(argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 3571Debug.Assert(parameterTypeWithAnnotations.HasType); 3576Debug.Assert(kind.IsIdentity); 3604Debug.Assert(arguments[arg].Kind is not 3633Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType); 3634Debug.Assert(methodResult.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel); 3656Debug.Assert(collectionArgs.Length != 0); 3661Debug.Assert(firstParamsArgument != -1); 3675Debug.Assert(argsToParamsBuilder is not null || argsToParamsOpt.IsDefault); 3725Debug.Assert(unconvertedString is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 3727Debug.Assert(interpolatedStringConversion.IsInterpolatedStringHandler); 3728Debug.Assert(handlerType is NamedTypeSymbol { IsInterpolatedStringHandlerType: true }); 3735Debug.Assert(handlerParameterIndexes.IsEmpty); 3748Debug.Assert(arguments is not null); 3779Debug.Assert(handlerParameterIndexes.All((index, paramLength) => index >= BoundInterpolatedStringArgumentPlaceholder.InstanceParameter && index < paramLength, 3798Debug.Assert(handlerArgumentIndexesBuilder[handlerParameterIndex] is BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter); 3831Debug.Assert(argumentIndex != interpolatedStringArgNum); 3838Debug.Assert(receiver!.Type is not null); 3891Debug.Assert(receiver != null); 4178Debug.Assert(rank > 0); 4179Debug.Assert(dimension > 0 && dimension <= rank); 4180Debug.Assert(exprBuilder != null); 4251Debug.Assert(!boundInitExpr.IsDefault); 4261Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length); 4286Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length); 4289Debug.Assert(init.HasAnyErrors); 4290Debug.Assert(init.Type.IsErrorType()); 4399Debug.Assert(creationSyntax == null || 4402Debug.Assert(initSyntax != null); 4403Debug.Assert((object)type != null); 4404Debug.Assert(boundInitExprOpt.IsDefault || creationSyntax.Kind() == SyntaxKind.ImplicitArrayCreationExpression); 4556Debug.Assert(node is StackAllocArrayCreationExpressionSyntax || node is ImplicitStackAllocArrayCreationExpressionSyntax); 4607Debug.Assert(node != null); 4646Debug.Assert(node.IsKind(SyntaxKind.ImplicitStackAllocArrayCreationExpression) || node.IsKind(SyntaxKind.StackAllocArrayCreationExpression)); 4692Debug.Assert(expression != null); 4710Debug.Assert(expression != null); 4736Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64); 4771Debug.Assert(argumentListBinder.IsSemanticModelBinder); 4803Debug.Assert((object)constructor != null); 4804Debug.Assert(constructor.MethodKind == MethodKind.Constructor || 4806Debug.Assert(diagnostics != null); 4820Debug.Assert(constructorReturnType.IsVoidType()); //true of all constructors 4839Debug.Assert((object)initializerType != null || 4875Debug.Assert(initializerArgumentListOpt.Parent.Kind() == SyntaxKind.ThisConstructorInitializer); 4981Debug.Assert(initializerType.IsErrorType() || 5168Debug.Assert(result is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node, node)); 5275Debug.Assert(expression.Type is { }); 5282Debug.Assert(conversion.IsValid); 5291Debug.Assert(length > 0); 5377Debug.Assert(!type.IsGenericOrNonGenericExpressionType(out _)); 5464Debug.Assert(!conv.IsExtensionMethod); 5465Debug.Assert(conv.IsValid); // i.e. if it exists, then it is valid. 5532Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 5576Debug.Assert(typeSyntax is not null); 5595Debug.Assert(syntax != null); 5596Debug.Assert((object)type != null); 5627Debug.Assert(syntax != null); 5628Debug.Assert((object)type != null); 5634Debug.Assert(syntax.Parent.Parent.Kind() != SyntaxKind.WithInitializerExpression); 5635Debug.Assert(rhsValueKind == BindValueKind.RValue); 5655Debug.Assert(initializerSyntax.Kind() == SyntaxKind.ObjectInitializerExpression || 5657Debug.Assert((object)initializerType != null); 5713Debug.Assert(objectInitializerMemberBinder != null); 5719Debug.Assert((object)boundLeft.Type != null); 5747Debug.Assert(objectInitializerMemberBinder != null); 6051Debug.Assert(!boundMember.NeedsToBeConverted()); 6073Debug.Assert(boundMember.HasAnyErrors); 6087Debug.Assert(memberNameMap != null); 6097Debug.Assert(memberInitializerSyntax.Kind() == SyntaxKind.SimpleAssignmentExpression); 6231Debug.Assert(initializerSyntax.Kind() == SyntaxKind.CollectionInitializerExpression); 6232Debug.Assert(initializerSyntax.Expressions.Any()); 6233Debug.Assert((object)initializerType != null); 6386Debug.Assert(node.Kind() == SyntaxKind.ComplexElementInitializerExpression); 6417Debug.Assert(!boundElementInitializerExpressions.IsEmpty); 6450Debug.Assert(collectionInitializerAddMethodBinder != null); 6451Debug.Assert(collectionInitializerAddMethodBinder.Flags.Includes(BinderFlags.CollectionInitializerAddMethod)); 6452Debug.Assert(implicitReceiver != null); 6453Debug.Assert((object)implicitReceiver.Type != null); 6519Debug.Assert(addMethodInvocation.Kind == BoundKind.BadExpression); 6565Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable. 6612Debug.Assert((object)constructor != null); 6613Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor); 6640Debug.Assert((object)this.Compilation.Assembly != null); 6690Debug.Assert(finalApplicableCandidates[0].IsApplicable); 6911Debug.Assert((object)type != null); 6937Debug.Assert((object)interfaceType != null); 6938Debug.Assert(interfaceType.IsInterfaceType()); 6939Debug.Assert((object)coClassType != null); 6940Debug.Assert(TypeSymbol.Equals(interfaceType.ComImportCoClass, coClassType, TypeCompareKind.ConsiderEverything2)); 6941Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error); 7351Debug.Assert( 7372Debug.Assert(node.Kind() == SyntaxKind.Utf8StringLiteralExpression); 7373Debug.Assert(node.Token.Kind() is SyntaxKind.Utf8StringLiteralToken or SyntaxKind.Utf8SingleLineRawStringLiteralToken or SyntaxKind.Utf8MultiLineRawStringLiteralToken); 7403Debug.Assert(node != null); 7404Debug.Assert(invoked == SyntaxFacts.IsInvoked(node)); 7416Debug.Assert(node.Kind() == SyntaxKind.PointerMemberAccessExpression); 7465Debug.Assert((left.Parent is MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression } memberAccess && memberAccess.Expression == left) || 7502Debug.Assert((object)leftType != null); 7511Debug.Assert(!leftType.IsDynamic()); 7512Debug.Assert(IsPotentialColorColorReceiver(left, leftType)); 7523Debug.Assert(!IsPotentialColorColorReceiver(left, leftType)); 7640Debug.Assert(node != null); 7641Debug.Assert(boundLeft != null); 7675Debug.Assert((object)leftType == null); 7817Debug.Assert(sym.Kind == SymbolKind.NamedType); 7833Debug.Assert(symbols[0].Kind == SymbolKind.NamedType); 7843Debug.Assert(lookupResult.Error == null); 7868Debug.Assert((object)leftType != null); 7935Debug.Assert(!resolution.IsEmpty); 7966Debug.Assert(rightArity == (typeArgumentsWithAnnotations.IsDefault ? 0 : typeArgumentsWithAnnotations.Length)); 8225Debug.Assert(receiver != null); 8263Debug.Assert(node != null); 8264Debug.Assert(left != null); 8265Debug.Assert(lookupResult.IsMultiViable); 8266Debug.Assert(lookupResult.Symbols.Any()); 8301Debug.Assert(symbol.Kind != SymbolKind.Method); 8381Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 8484Debug.Assert((actualArguments == null) || !firstResult.IsEmpty); 8515Debug.Assert(lookupResult.Symbols.Any()); 8519Debug.Assert((object)symbol == null); 8680Debug.Assert((object)underlyingType != null); 8730Debug.Assert(symbol is not TypeSymbol); 8882Debug.Assert(!methodOrPropertyGroup.Any()); 8887Debug.Assert(result.Kind != LookupResultKind.Empty); 8888Debug.Assert(!result.Symbols.Any(s => s.IsIndexer())); 8934Debug.Assert(methodOrPropertyGroup.Any() || ((object)other != null)); 8969Debug.Assert(members.All(m => m.Kind == member.Kind)); 8977Debug.Assert(members.All(m => !m.IsIndexer())); 9015Debug.Assert(propertyGroup.ReceiverOpt is not null); 9065Debug.Assert(expr.Type.TryGetInlineArrayElementField() is not null); 9081Debug.Assert(tryInlineArrayAccess); 9082Debug.Assert(diagnosticsForBindElementAccessCore.DiagnosticBag is { }); 9309Debug.Assert(node != null); 9310Debug.Assert(expr != null); 9311Debug.Assert((object)expr.Type != null); 9312Debug.Assert(arguments != null); 9340Debug.Assert(node != null); 9341Debug.Assert(expr != null); 9342Debug.Assert(arguments != null); 9401Debug.Assert(convertedArguments.Length == 1); 9423Debug.Assert(index != null); 9528Debug.Assert(expr != null); 9529Debug.Assert((object)targetType != null); 9545Debug.Assert(result != null); // If this ever fails (it shouldn't), then put a null-check around the diagnostics update. 9552Debug.Assert(node != null); 9553Debug.Assert(expr != null); 9554Debug.Assert(analyzedArguments != null); 9568Debug.Assert(expr.Type.IsPointerType()); 9613Debug.Assert(node != null); 9614Debug.Assert(expr != null); 9615Debug.Assert((object)expr.Type != null); 9616Debug.Assert(analyzedArguments != null); 9648Debug.Assert(symbol.IsIndexer()); 9667Debug.Assert(property.ParameterCount > 0); 9685Debug.Assert(receiver is not null); 9713Debug.Assert(receiver is not null); 9775Debug.Assert(receiver is not null); 9797Debug.Assert(finalApplicableCandidates[0].IsApplicable); 9922Debug.Assert(receiver is not null); 9942Debug.Assert(receiver.Type is not null); 9956Debug.Assert(lengthOrCountAccess is BoundPropertyAccess); 9957Debug.Assert(indexerOrSliceAccess is BoundIndexerAccess or BoundCall); 9958Debug.Assert(indexerOrSliceAccess.Type is not null); 10041Debug.Assert(receiver.Type is not null); 10089Debug.Assert(!argIsIndex); 10101Debug.Assert(!argIsIndex); 10179Debug.Assert(receiverPlaceholder.Type is not null); 10203Debug.Assert(lookupResult.IsClear); 10278Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 10382Debug.Assert(!methodResolution.HasAnyApplicableMethod); 10383Debug.Assert(!extensionMethodResolution.HasAnyApplicableMethod); 10384Debug.Assert(!methodResolution.IsEmpty); 10385Debug.Assert(!extensionMethodResolution.IsEmpty); 10399Debug.Assert(!extensionMethodResolution.IsEmpty); 10417Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion | 10844Debug.Assert(ContainingMemberOrLambda is { }); 10845Debug.Assert(parameterRefKinds.IsDefault || parameterRefKinds.Length == parameterTypes.Length); 10847Debug.Assert(returnType.Type is { }); // Expecting System.Void rather than null return type. 10848Debug.Assert(!hasParams || parameterTypes.Length != 0); 10937Debug.Assert((location == null) ^ (node == null)); 10987Debug.Assert((object)receiverType != null); 11098Debug.Assert(node != null); 11099Debug.Assert(node.Expression != null); 11105Debug.Assert(receiver != 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); 116Debug.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 (18)
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); 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); 979Debug.Assert(call is BoundCall or BoundDynamicInvocation or { HasErrors: true });
Binder\Binder_Invocation.cs (29)
100Debug.Assert(receiver != null); 101Debug.Assert(names.IsDefault || names.Length == args.Length); 124Debug.Assert(allowFieldsAndProperties || boundExpression.Kind is (BoundKind.MethodGroup or BoundKind.BadExpression)); 129Debug.Assert(!args.Any(static e => e.Kind == BoundKind.OutVariablePendingInference || 225Debug.Assert(node.Expression.Kind() is SyntaxKind.SimpleMemberAccessExpression); 425Debug.Assert(ContainingType is not null); 556Debug.Assert(receiver.Type is not null); 608Debug.Assert((object?)arg.Type != null); 794Debug.Assert(finalApplicableCandidates[0].IsApplicable); 806Debug.Assert(finalApplicableCandidates.Length > 0); 817Debug.Assert(methodGroup.InstanceOpt != null && (object)methodGroup.InstanceOpt.Type != null); 978Debug.Assert(overloadResolutionResult.HasAnyApplicableMember); 1035Debug.Assert(diagnostics != null); 1117Debug.Assert(node != null); 1118Debug.Assert(methodGroup != null); 1119Debug.Assert(methodGroup.Error == null); 1127Debug.Assert(!invokedAsExtensionMethod || ((object)delegateTypeOpt == null)); 1221Debug.Assert(argsToParams.IsDefault || argsToParams[0] == 0); 1245Debug.Assert(analyzedArguments.RefKind(0) == RefKind.None); 1299Debug.Assert(args.IsDefaultOrEmpty || (object)receiver != (object)args[0]); 1366Debug.Assert(parameterType.IsDynamic() || parameterType.SpecialType == SpecialType.System_Object); 1447Debug.Assert(argumentOrdinal < argsToParamsOpt.Length); 1530Debug.Assert(InAttributeArgument || (attributedMember is null && containingMember is not null)); 1536Debug.Assert(!expanded || parameters[^1].IsParams); 1545Debug.Assert(parameter.IsOptional); 1620Debug.Assert((object?)defaultConstantValue != ConstantValue.Unset); 1749Debug.Assert(false); // Add test if this code path is reachable 1755Debug.Assert(conversion.IsCollectionExpression); 1771Debug.Assert(collection.IsParamsArrayOrCollection);
Binder\Binder_Lambda.cs (6)
42Debug.Assert(syntax != null); 43Debug.Assert(syntax.IsAnonymousFunction()); 296Debug.Assert(syntax is not ScopedTypeSyntax); 361Debug.Assert(syntax != null); 362Debug.Assert(syntax.IsAnonymousFunction()); 430Debug.Assert(s_lambdaBindings is null);
Binder\Binder_Lookup.cs (33)
63Debug.Assert(options.AreValid()); 67Debug.Assert((binder != null) || result.IsClear); 74Debug.Assert(binder == otherBinder); 77Debug.Assert(result.IsMultiViable || result.IsClear || result.Error != null); 84Debug.Assert(result.IsClear); 85Debug.Assert(options.AreValid()); 150Debug.Assert(options.AreValid()); 161Debug.Assert(result.IsMultiViable || result.IsClear || result.Error != null); 166Debug.Assert(options.AreValid()); 168Debug.Assert(arity >= 0); 358Debug.Assert(result.Symbols.All(IsMethodOrIndexer)); 497Debug.Assert(result.IsClear); 498Debug.Assert(options.AreValid()); 499Debug.Assert(options.IsAttributeTypeLookup()); 551Debug.Assert(resultWithSuffix != null); 627Debug.Assert(!best.IsNone); 628Debug.Assert(!secondBest.IsNone); 686Debug.Assert((object)symbol != null); 696Debug.Assert((object)symbol != null); 712Debug.Assert(!diagnose || useSiteInfo.AccumulatesDiagnostics); 805Debug.Assert((object)type != null); 806Debug.Assert(!type.IsInterfaceType() && type.TypeKind != TypeKind.TypeParameter); 1024Debug.Assert((object)type != null); 1025Debug.Assert(type.IsInterface); 1152Debug.Assert((object)type != null); 1153Debug.Assert(type.IsInterface); 1170Debug.Assert((object)typeParameter != null); 1189Debug.Assert(!TypeSymbol.Equals(baseType, derivedType, TypeCompareKind.ConsiderEverything2)); 1387Debug.Assert((options & LookupOptions.MustBeAbstractOrVirtual) == 0 || (options & LookupOptions.MustNotBeInstance) != 0); 1542Debug.Assert(symbol.MustCallMethodsDirectly()); 1582Debug.Assert(aliasSymbol == null || aliasSymbol.GetAliasTarget(basesBeingResolved: null) == symbol); 1583Debug.Assert(options.AreValid()); 1774Debug.Assert(object.ReferenceEquals(namedType.ConstructedFrom, namedType));
Binder\Binder_Operators.cs (65)
212Debug.Assert(finalConversion.HasErrors || (object)finalConversion == finalPlaceholder); 241Debug.Assert(left.Kind != BoundKind.EventAccess || hasError); 260Debug.Assert(opKind == BinaryOperatorKind.Addition || opKind == BinaryOperatorKind.Subtraction); 345Debug.Assert(operand != null); 375Debug.Assert((object)left.Type != null && left.Type.IsDynamic() || (object)right.Type != null && right.Type.IsDynamic()); 405Debug.Assert(left.Type is not TypeParameterSymbol); 457Debug.Assert(IsSimpleBinaryOperator(node.Kind())); 557Debug.Assert(right.Type.SpecialType == SpecialType.System_String); 637Debug.Assert((object)signature.LeftType != null); 638Debug.Assert((object)signature.RightType != null); 651Debug.Assert(conversionDiagnostics != diagnostics); 655Debug.Assert(sourceBag is not null); 770Debug.Assert(current.IsUnconvertedInterpolatedStringAddition); 789Debug.Assert(left != null); 821Debug.Assert(!conversion.IsImplicit); 845Debug.Assert(!right.Type.IsReferenceType); 849Debug.Assert(!left.Type.IsReferenceType); 891Debug.Assert(node.Kind() == SyntaxKind.LogicalOrExpression || node.Kind() == SyntaxKind.LogicalAndExpression); 930Debug.Assert(kind == BinaryOperatorKind.LogicalAnd || kind == BinaryOperatorKind.LogicalOr); 1008Debug.Assert(trueOperator != null && falseOperator != null); 1029Debug.Assert(bothBool); 1030Debug.Assert(!(signature.Method?.ContainingType?.IsInterface ?? false)); 1079Debug.Assert(left.IsLiteralNull()); 1106Debug.Assert(signature.Kind.OperandTypes() == BinaryOperatorKind.UserDefined); 1494Debug.Assert(valueLeft != null); 1495Debug.Assert(valueRight != null); 1525Debug.Assert(valueLeft != null); 1526Debug.Assert(valueRight != null); 1568Debug.Assert(valueLeft != null); 1569Debug.Assert(valueRight != null); 1624Debug.Assert(valueLeft != null); 1625Debug.Assert(valueRight != null); 1720Debug.Assert(left != null); 1721Debug.Assert(right != null); 1722Debug.Assert(kind.IsEnum()); 1723Debug.Assert(!kind.IsLifted()); 1766Debug.Assert(resultTypeSymbol.SpecialType == SpecialType.System_Boolean); 1795Debug.Assert(left != null); 1796Debug.Assert(right != null); 1979Debug.Assert(valueLeft != null); 1980Debug.Assert(valueRight != null); 2211Debug.Assert(valueLeft != null); 2212Debug.Assert(valueRight != null); 2293Debug.Assert((object)operandType != null); 2348Debug.Assert(hasErrors || (object)resultConversion == resultPlaceholder); 2425Debug.Assert((methodOpt.Name == WellKnownMemberNames.UnsignedRightShiftOperatorName) == isUnsignedRightShift); 2458Debug.Assert(node.Operand.SkipParens().GetLastToken().Kind() == SyntaxKind.ExclamationToken); 2528Debug.Assert(hasErrors); 2854Debug.Assert(operand != null); 3132Debug.Assert(valueRight != null); 3326Debug.Assert((object)operandType != null); 3375Debug.Assert(constantValue == ConstantValue.True || constantValue == ConstantValue.False); 3397Debug.Assert((object)targetType != null); 3438Debug.Assert((object)operandType != null); 3538Debug.Assert(operandType is TypeParameterSymbol { AllowsRefLikeType: false }); 3546Debug.Assert(targetType is TypeParameterSymbol { AllowsRefLikeType: false }); 3615Debug.Assert(operandType.IsNullableType()); 3672Debug.Assert(targetType.IsNullableType()); 3787Debug.Assert(operand.Type is null); 3803Debug.Assert((object)operandType != null); 3934Debug.Assert(constantValue.IsNull); 4191Debug.Assert((object)leftType != null); 4367Debug.Assert(type is { }); 4368Debug.Assert(Conversions.HasIdentityConversion(trueType, type)); 4369Debug.Assert(Conversions.HasIdentityConversion(falseType, type));
Binder\Binder_Patterns.cs (20)
37Debug.Assert(expression.Type is { }); 65Debug.Assert(expression.Type is object); 82Debug.Assert(expression.Type is object); 240Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 248Debug.Assert(indexerAccess.Type is not null); 322Debug.Assert(indexerAccess!.Type is not null); 357Debug.Assert(!inputType.IsDynamic()); 389Debug.Assert(indexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 515Debug.Assert(expression is { Kind: BoundKind.TypeExpression, Type: { } }); 580Debug.Assert(hasErrors); 831Debug.Assert(!conversion.IsUserDefined || result == ConstantValue.False || result == ConstantValue.Bad); 859Debug.Assert(declType.HasType); 906Debug.Assert(designation.SyntaxTree.Options.Kind != SourceCodeKind.Regular); 1243Debug.Assert(!declType.IsTupleType); 1244Debug.Assert(!IsZeroElementTupleType(declType)); 1364Debug.Assert(node.Parent is { }); 1589Debug.Assert(boundMember.HasAnyErrors); 1634Debug.Assert(type is { }); 1786Debug.Assert(!permitDesignations); 1820Debug.Assert(spoiler.Equals(bestSoFar, TypeCompareKind.ConsiderEverything));
Binder\Binder_Query.cs (9)
300Debug.Assert(state.fromExpression.Type is { }); 689Debug.Assert(LambdaUtilities.IsQueryPairLambda(node)); 741Debug.Assert(yExpression.Type is { }); 836Debug.Assert(lambdaSymbol != null); 867Debug.Assert(node is ExpressionSyntax || LambdaUtilities.IsQueryPairLambda(node)); 920Debug.Assert(expectedMethodName is null || expectedMethodName == methodName); 928Debug.Assert(receiver.Type is object || ultimateReceiver.Type is null); 969Debug.Assert(!resolution.IsEmpty); 1035Debug.Assert(receiver == originalUltimateReceiver);
Binder\Binder_QueryErrors.cs (1)
215Debug.Assert(methodName == "SelectMany");
Binder\Binder_Statements.cs (83)
59Debug.Assert(node != null); 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); 758Debug.Assert(expr is object); 759Debug.Assert(expr.Type is object); 760Debug.Assert(expr.Type.IsRefLikeType || hasAwait); // pattern dispose lookup is only valid on ref structs or asynchronous usings 788Debug.Assert( 798Debug.Assert(typeSyntax is not ScopedTypeSyntax); 800Debug.Assert(declType.HasType || isVar); 960Debug.Assert(declarator != null); 986Debug.Assert(declarator != null); 987Debug.Assert(declTypeOpt.HasType || isVar); 988Debug.Assert(typeSyntax != null); 1071Debug.Assert(declTypeOpt.HasType); 1224Debug.Assert(!ReferenceEquals(declType, null)); 1225Debug.Assert(declType.IsPointerType()); 1361Debug.Assert(initializer != null); 1404Debug.Assert(node != null); 1405Debug.Assert(node.Left != null); 1406Debug.Assert(node.Right != null); 1480Debug.Assert(op1 != null); 1481Debug.Assert(op2 != null); 1487Debug.Assert(!op1.NeedsToBeConverted() 1549Debug.Assert(op1 != null); 1550Debug.Assert(op2 != null); 1554Debug.Assert(op1.Type is { }); 1587Debug.Assert(leftEscape.Equals(rightEscape) || op1.Type.IsRefLikeOrAllowsRefLikeType()); 1595Debug.Assert(op1.Kind != BoundKind.Parameter); // If the assert fails, add a corresponding test. 1629Debug.Assert(false); 1830Debug.Assert((object)receiver.Type != null); 1841Debug.Assert(node != null); 1886Debug.Assert(binder != null); 1937Debug.Assert((object)targetType != null); 1938Debug.Assert(expression != null); 2017Debug.Assert((object)targetType != null); 2018Debug.Assert(anonymousFunction != null); 2074Debug.Assert(targetType.IsExpressionTree()); 2081Debug.Assert(targetType.IsGenericOrNonGenericExpressionType(out _)); 2119Debug.Assert(delegateType is not null); 2177Debug.Assert(diagnostics.DiagnosticBag?.Count is not 0); 2200Debug.Assert(anonymousFunction.HasExplicitlyTypedParameterList); 2204Debug.Assert(anonymousFunction.ParameterCount == delegateParameters.Length); 2210Debug.Assert(!lambdaParameterType.IsErrorType()); 2232Debug.Assert(ErrorFacts.PreventsSuccessfulDelegateConversion(bindingResult.Diagnostics.Diagnostics)); 2250Debug.Assert(!conversion.IsImplicit || !conversion.IsValid); 2284Debug.Assert(conversion.IsUserDefined); 2322Debug.Assert(operand != null); 2323Debug.Assert((object)targetType != null); 2414Debug.Assert(reportedError); 2434Debug.Assert(reportedError); 2574Debug.Assert(b != null); 2756Debug.Assert(node != null); 2773Debug.Assert(node != null); 2776Debug.Assert(loopBinder != null); 2788Debug.Assert(loopBinder != null); 2801Debug.Assert(loopBinder != null); 2819Debug.Assert(typeSyntax is not ScopedTypeSyntax || localKind is LocalDeclarationKind.RegularVariable or LocalDeclarationKind.UsingVariable); 2839Debug.Assert(declType.HasType || isVar); 2843Debug.Assert(count > 0); 3156Debug.Assert(returnRefKind == RefKind.None); 3218Debug.Assert(node != null); 3266Debug.Assert((object)type != null); 3302Debug.Assert(((object)type == null) || !type.IsErrorType()); 3344Debug.Assert(binder != null); 3352Debug.Assert(local.Type.IsErrorType() || (TypeSymbol.Equals(local.Type, type, TypeCompareKind.ConsiderEverything2))); 3494Debug.Assert(expressionSyntax != null || !IsValidExpressionBody(expressionSyntax, expression)); 3584Debug.Assert(bodyBinder != null); 3605Debug.Assert(bodyBinder != null); 3617Debug.Assert(bodyBinder != null); 3619Debug.Assert(body.Kind() != SyntaxKind.RefExpression); 3697Debug.Assert(typeDecl.ParameterList is object); 3698Debug.Assert(typeDecl.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.StructDeclaration); 3705Debug.Assert(initializerBinder != null); 3739Debug.Assert(bodyBinder != null); 3792Debug.Assert(!this.ContainingMember().IsImplicitlyDeclared); 3835Debug.Assert(sourceConstructor?.SyntaxNode is TypeDeclarationSyntax
Binder\Binder_Symbols.cs (34)
40Debug.Assert(isVar == symbol.IsDefault); 60Debug.Assert((keyword != ConstraintContextualKeyword.None) == symbol.IsDefault); 81Debug.Assert(isVar == symbol.IsDefault); 274Debug.Assert(UnwrapAliasNoDiagnostics(symbol) is NamespaceSymbol); 322Debug.Assert(diagnostics != null); 388Debug.Assert(!result.IsDefault); 1124Debug.Assert(syntax != null); 1125Debug.Assert(diagnostics != null); 1306Debug.Assert(lookupResult.Error != null); 1339Debug.Assert(typeArguments.Count > 0); 1439Debug.Assert(colorColorValueReceiver is null || (methodGroupFlags & BoundMethodGroupFlags.SearchExtensionMethods) != 0); 1474Debug.Assert(haveStaticCandidates); 1529Debug.Assert(lookupResult?.IsClear != false); 1532Debug.Assert(haveStaticCandidates || haveInstanceCandidates); 1576Debug.Assert(!typeArguments.IsEmpty); 1730Debug.Assert(symbol.IsDefinition); 1822Debug.Assert((syntax != null) ^ (location != null)); 1942Debug.Assert(where != null); 1943Debug.Assert(diagnostics != null); 1965Debug.Assert(!best.IsNone); 1966Debug.Assert(!secondBest.IsNone); 1981Debug.Assert(best.IsFromAddedModule); 2076Debug.Assert(!best.IsFromCorLibrary); 2088Debug.Assert(best.IsFromCompilation); 2124Debug.Assert(secondBest.IsFromAddedModule); 2135Debug.Assert(best.IsFromAddedModule); 2159Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly); 2439Debug.Assert(location != BestSymbolLocation.None); 2466Debug.Assert(secondLocation != 0); 2513Debug.Assert(!first.IsNone); 2514Debug.Assert(!second.IsNone); 2576Debug.Assert(qualifierOpt.IsNamespace); 2582Debug.Assert(aliasOpt == null || aliasOpt == SyntaxFacts.GetText(SyntaxKind.GlobalKeyword)); 2679Debug.Assert(false);
Binder\Binder_TupleOperators.cs (7)
56Debug.Assert(length == multiple.Operators.Length); 183Debug.Assert((object)left.Type != null && left.Type.IsDynamic() || (object)right.Type != null && right.Type.IsDynamic()); 217Debug.Assert((object)left.Type != null || left.Kind == BoundKind.TupleLiteral); 218Debug.Assert((object)right.Type != null || right.Kind == BoundKind.TupleLiteral); 234Debug.Assert(length == rightParts.Length); 284Debug.Assert(leftNoNames || rightNoNames || leftNames.Length == rightNames.Length); 332Debug.Assert(targetType.StrippedType().IsTupleType);
Binder\Binder_XmlNameAttribute.cs (2)
41Debug.Assert(lookupResult.IsMultiViable); 45Debug.Assert(lookupSymbols[0].Kind == SymbolKind.TypeParameter || lookupSymbols[0].Kind == SymbolKind.Parameter);
Binder\BinderFactory.BinderFactoryVisitor.cs (20)
29Debug.Assert((memberDeclarationOpt == null) == (memberOpt == null)); 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); 642Debug.Assert(syntaxTree != null); 651Debug.Assert(syntaxTree != null); 901Debug.Assert(name is not QualifiedNameSyntax); 912Debug.Assert(outer is SimpleProgramUnitBinder); 925Debug.Assert(!inUsing); 958Debug.Assert((object)compilation.ScriptClass != null); 1036Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 1073Debug.Assert(token == this.syntaxTree.GetRoot().GetLastToken()); 1276Debug.Assert(property.SetMethod.ParameterCount > 0); 1289Debug.Assert((object)delegateType != null); 1291Debug.Assert((object)invokeMethod != null); 1373Debug.Assert(crefSyntax != null); 1374Debug.Assert(memberSyntax != null); 1416Debug.Assert(xmlSyntax is XmlAttributeSyntax || xmlSyntax.Kind() == SyntaxKind.XmlEmptyElement || xmlSyntax.Kind() == SyntaxKind.XmlElementStartTag); 1451Debug.Assert(curr != null);
Binder\BinderFactory.cs (2)
126Debug.Assert(node != null); 158Debug.Assert(typeDecl.ParameterList is not null);
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.cs (39)
287Debug.Assert(pattern.HasErrors || pattern.InputType.Equals(input.Type, TypeCompareKind.AllIgnoreOptions) || pattern.InputType.IsErrorType()); 384Debug.Assert(input.Index == 0); 407Debug.Assert(variableAccess.Type!.Equals(input.Type, TypeCompareKind.AllIgnoreOptions) || variableAccess.Type.IsErrorType()); 461Debug.Assert(!conversion.IsUserDefined); 500Debug.Assert(constant.Value.Type is not null || constant.HasErrors); 505Debug.Assert(input.Source is BoundDagPropertyEvaluation { IsLengthOrCount: true }); 587Debug.Assert(recursive.HasAnyErrors); 697Debug.Assert(bin.HasErrors || output.Type.Equals(bin.NarrowedType, TypeCompareKind.AllIgnoreOptions)); 709Debug.Assert(type is { }); 761Debug.Assert(kvp.Key == kvp.Value); 907Debug.Assert(!first.IsImpossible); 931Debug.Assert(e.Input.IsEquivalentTo(e.Target)); 976Debug.Assert(_defaultLabel != null); 977Debug.Assert(defaultDecision != null); 1177Debug.Assert(e.IsLengthOrCount); 1183Debug.Assert(input.Index == 0); 1198Debug.Assert(input.Index == 0); 1470Debug.Assert(s1LengthTemp.Syntax is ListPatternSyntax); 1471Debug.Assert(s2LengthTemp.Syntax is ListPatternSyntax); 1477Debug.Assert(s1LengthTemp.IsEquivalentTo(s2LengthTemp)); 1485Debug.Assert(state.RemainingValues.ContainsKey(s1LengthTemp)); 1489Debug.Assert(!lengthValues.IsEmpty); 1783Debug.Assert(arrayBuilder != null); 1890Debug.Assert(dagState.RemainingValues is null); 1891Debug.Assert(dagState.SelectedTest is null); 1892Debug.Assert(dagState.TrueBranch is null); 1893Debug.Assert(dagState.FalseBranch is null); 1894Debug.Assert(dagState.Dag is null); 2171Debug.Assert(relationEffect is True or One(BoundDagAssignmentEvaluation)); 2224Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 2225Debug.Assert(t.Relation == BinaryOperatorKind.GreaterThanOrEqual); 2226Debug.Assert(t.Value.Int32Value >= 0); 2239Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 2243Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32); 2267Debug.Assert(value >= 0); // Tests with negative values should never be created. 2268Debug.Assert(offset >= 0); // The number of elements in a list is always non-negative. 2326Debug.Assert(remainingTests.Length > 1); 2391Debug.Assert(t2 is not (True or False)); 2471Debug.Assert(t2 is not (True or False));
Binder\DecisionDagBuilder_ListPatterns.cs (10)
15Debug.Assert(input.Type.IsErrorType() || list.HasErrors || list.InputType.IsErrorType() || 38Debug.Assert(list.LengthAccess is not null); 40Debug.Assert(lengthProperty is not null); 58Debug.Assert(slice.IndexerAccess is not null); 59Debug.Assert(index <= 0); 60Debug.Assert(slice.ReceiverPlaceholder is not null); 61Debug.Assert(slice.ArgumentPlaceholder is not null); 74Debug.Assert(list.IndexerAccess is not null); 75Debug.Assert(list.ReceiverPlaceholder is not null); 76Debug.Assert(list.ArgumentPlaceholder is not null);
Binder\EarlyWellKnownAttributeBinder.cs (1)
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 (7)
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);
Binder\FixedStatementBinder.cs (1)
25Debug.Assert(syntax != null);
Binder\ForEachEnumeratorInfo.cs (6)
72Debug.Assert(patternDisposeInfo == null || needsDisposal); 73Debug.Assert(inlineArraySpanType is WellKnownType.Unknown or WellKnownType.System_Span_T or WellKnownType.System_ReadOnlySpan_T); 74Debug.Assert(inlineArraySpanType == WellKnownType.Unknown || 76Debug.Assert(!inlineArrayUsedAsValue || inlineArraySpanType != WellKnownType.Unknown); 122Debug.Assert(MoveNextInfo != null); 123Debug.Assert(CurrentPropertyGetter != null);
Binder\ForEachLoopBinder.cs (39)
43Debug.Assert(syntax != null); 307Debug.Assert(declType.HasType); 543Debug.Assert(collectionConversionClassification.IsValid); 544Debug.Assert(currentConversionClassification.IsValid || 567Debug.Assert( 630Debug.Assert(!collectionConversionClassification.IsUserDefined); 643Debug.Assert(collectionConversionClassification.IsIdentity); 644Debug.Assert(convertedCollectionExpression == (object)collectionExpr); 645Debug.Assert(collectionType.Equals(collectionExpr.Type, TypeCompareKind.AllIgnoreOptions)); // Should not create an Identity conversion that changes type. 671Debug.Assert(!isAsync || !isSpread); 766Debug.Assert(!isAsync || !isSpread); 863Debug.Assert(span == originalSpan); 864Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod); 871Debug.Assert(builder.CollectionType == (object)spanType); 909Debug.Assert(collectionExpr == originalCollectionExpr || 911Debug.Assert(!builder.ViaExtensionMethod || builder.GetEnumeratorInfo.Method.IsExtensionMethod); 939Debug.Assert(collectionExpr.HasAnyErrors); // should already have been reported 1020Debug.Assert((object)builder.GetEnumeratorInfo != null); 1022Debug.Assert(!(viaExtensionMethod && builder.GetEnumeratorInfo.Method.Parameters.IsDefaultOrEmpty)); 1067Debug.Assert((object)builder.CollectionType != null); 1084Debug.Assert(IsIAsyncEnumerable(collectionType.OriginalDefinition)); 1090Debug.Assert(getEnumeratorMethod is null or { ParameterCount: 1 }); 1101Debug.Assert(collectionType.OriginalDefinition.SpecialType == SpecialType.System_Collections_Generic_IEnumerable_T); 1122Debug.Assert(enumeratorType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_IAsyncEnumerator_T))); 1160Debug.Assert(collectionType.SpecialType == SpecialType.System_Collections_IEnumerable); 1167Debug.Assert((object)builder.GetEnumeratorInfo == null || 1203Debug.Assert(!patternDisposeMethod.IsExtensionMethod); 1204Debug.Assert(patternDisposeMethod.ParameterRefKinds.IsDefaultOrEmpty || 1224Debug.Assert(argsToParams.IsDefault); 1245Debug.Assert(!enumeratorType.IsRefLikeType); // Ref like types are supposed to be structs, therefore, sealed. 1306Debug.Assert((object)builder.GetEnumeratorInfo == null || 1356Debug.Assert(lookupResult.IsClear); 1479Debug.Assert(argsToParams.IsDefault); 1535Debug.Assert(!collectionConversion.IsUserDefined); 1596Debug.Assert((object)builder.GetEnumeratorInfo.Method != null); 1649Debug.Assert((object)lookupSymbol != null); 1901Debug.Assert(resolvedMember is null or { ParameterCount: 0 }); 1910Debug.Assert((extensionReceiverOpt != null) == method.IsExtensionMethod); 1937Debug.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 (10)
41Debug.Assert(usingAliases != null); 42Debug.Assert(!usings.IsDefault); 43Debug.Assert(!externs.IsDefault); 67Debug.Assert(previousSubmissionImports != null); 68Debug.Assert(newSubmission.IsSubmission); 93Debug.Assert(newSubmission.IsSubmission); 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); 106Debug.Assert(result.IsClear);
Binder\InMethodBinder.cs (4)
43Debug.Assert(!enclosing.Flags.Includes(BinderFlags.InCatchFilter)); 44Debug.Assert((object)owner != null); 196Debug.Assert(result.IsClear); 246Debug.Assert(!locations.IsEmpty || parameter.IsImplicitlyDeclared);
Binder\InSubmissionClassBinder.cs (2)
29Debug.Assert(submissionClass.IsSubmissionClass); 50Debug.Assert(result.IsClear);
Binder\LocalBinderFactory.cs (25)
137Debug.Assert((object)containingMemberOrLambda != null); 138Debug.Assert(containingMemberOrLambda.Kind != SymbolKind.Local && containingMemberOrLambda.Kind != SymbolKind.RangeVariable && containingMemberOrLambda.Kind != SymbolKind.Parameter); 176Debug.Assert(node.ParameterList is object); 177Debug.Assert(node.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration); 289Debug.Assert((current.Flags & BinderFlags.InContextualAttributeBinder) != 0); 292Debug.Assert(contextualAttributeBinder is not null); 334Debug.Assert(false); 348Debug.Assert(false); 355Debug.Assert(delegateType.IsDelegateType()); 361Debug.Assert(false); 368Debug.Assert(parameters[^1] is SynthesizedAccessorValueParameterSymbol); 536Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 549Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 577Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 587Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 597Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 643Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 696Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 732Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 880Debug.Assert((object)_containingMemberOrLambda == _enclosing.ContainingMemberOrLambda); 920Debug.Assert(_map.TryGetValue(node.Block, out finallyBinder) && finallyBinder.Flags.Includes(BinderFlags.InFinallyBlock)); 1013Debug.Assert(node.CanHaveAssociatedLocalBinder() || 1025Debug.Assert(!_map.TryGetValue(node, out existing) || existing == binder || existing == binder.Next || existing == binder.Next?.Next); 1053Debug.Assert((object)_containingMemberOrLambda == enclosing.ContainingMemberOrLambda); 1058Debug.Assert((object)_containingMemberOrLambda == enclosing.ContainingMemberOrLambda);
Binder\LocalInProgressBinder.cs (1)
35Debug.Assert(_localSymbol is not null);
Binder\LocalScopeBinder.cs (5)
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());
Binder\LockBinder.cs (1)
70Debug.Assert(this.Locals.IsDefaultOrEmpty);
Binder\LockOrUsingBinder.cs (3)
44Debug.Assert(targetExpressionSyntax.Parent.Kind() == SyntaxKind.LockStatement || 73Debug.Assert(_lazyLockedOrDisposedVariables != null); 95Debug.Assert(_lazyExpressionAndDiagnostics != null);
Binder\MethodArgumentInfo.cs (1)
36Debug.Assert(method.ParameterCount == 0);
Binder\MethodGroupResolution.cs (4)
45Debug.Assert((methodGroup == null) || (methodGroup.Methods.Count > 0)); 46Debug.Assert((methodGroup == null) || ((object)otherSymbol == null)); 48Debug.Assert(((object)otherSymbol == null) || (otherSymbol.Kind != SymbolKind.Method)); 49Debug.Assert(resultKind != LookupResultKind.Ambiguous); // HasAnyApplicableMethod is expecting Viable methods.
Binder\ParamsCollectionTypeInProgressBinder.cs (1)
22Debug.Assert(inProgress is not null);
Binder\PatternExplainer.cs (7)
47Debug.Assert(!nodes.Contains(x)); 84Debug.Assert(next != null); 85Debug.Assert(distance(next) == (d - 1)); 328Debug.Assert(sense); // we have dropped failing type tests 441Debug.Assert(e == slice); 586Debug.Assert(typeName != null || deconstruction != null || propertyString != null); 673Debug.Assert(underlyingType.IsNativeIntegerType);
Binder\RefSafetyAnalysis.cs (20)
178Debug.Assert(_localEscapeScopes?.ContainsKey(local) == true || _symbol != local.ContainingSymbol); 187Debug.Assert(_localEscapeScopes?.ContainsKey(local) == true); 194Debug.Assert(_placeholderScopes?.ContainsKey(placeholder) != true); 206Debug.Assert(_placeholderScopes?.ContainsKey(placeholder) == true); 216Debug.Assert(_placeholderScopes?.ContainsKey(placeholder) == true); 279Debug.Assert(ContainsPlaceholderScope(placeholder)); 295Debug.Assert(ContainsPlaceholderScope(placeholder)); 429Debug.Assert(_localEscapeScopes?.ContainsKey(node.LocalSymbol) == true || 457Debug.Assert(_localEscapeScopes?.ContainsKey(local) != true); 471Debug.Assert(_localEscapeScopes is { }); 492Debug.Assert(localSymbol.RefKind == RefKind.None || 678Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 705Debug.Assert(interpolationData.ReceiverPlaceholder is not null); 715Debug.Assert(receiver != null); 726Debug.Assert(placeholder.Type.SpecialType == SpecialType.System_Boolean); 854Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 860Debug.Assert(node.InitialBindingReceiverIsSubjectToCloning != ThreeState.Unknown); 927Debug.Assert(node.ArgumentPlaceholders.All(p => p is BoundImplicitIndexerValuePlaceholder { Type.SpecialType: SpecialType.System_Int32 })); 948Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 976Debug.Assert(parameters.Length - offset == n);
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); 463Debug.Assert(current.IsDefinition); 496Debug.Assert(within is NamedTypeSymbol || within is AssemblySymbol); 517Debug.Assert((object)withinType != null); 518Debug.Assert((object)originalContainingType != null); 519Debug.Assert(originalContainingType.IsDefinition); 526Debug.Assert(current.IsDefinition); 550Debug.Assert(type.IsDefinition); 551Debug.Assert(baseType.IsDefinition); 569Debug.Assert(current.IsDefinition); 601Debug.Assert(!result); 612Debug.Assert(currentBase.IsDefinition);
Binder\Semantics\BestTypeInferrer.cs (3)
72Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr)); 137Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr1)); 152Debug.Assert(!NullableWalker.IsTargetTypedExpression(expr2));
Binder\Semantics\Conversions\Conversion.cs (11)
98Debug.Assert(!deconstructConversionInfo.IsDefaultOrEmpty); 115Debug.Assert(collectionExpressionTypeKind != CollectionExpressionTypeKind.None); 116Debug.Assert(elementType is { }); 182Debug.Assert(kind == ConversionKind.Deconstruction); 195Debug.Assert(_kind is ConversionKind.MethodGroup or ConversionKind.IntPtr or ConversionKind.ImplicitUserDefined or ConversionKind.ExplicitUserDefined); 202Debug.Assert(_kind.IsDynamic()); 203Debug.Assert(_uncommonData == null); 350Debug.Assert(kind == ConversionKind.ImplicitNullable || kind == ConversionKind.ExplicitNullable); 412Debug.Assert((_uncommonData as NestedUncommonData)?._nestedConversionsChecked ?? true); 583Debug.Assert(!this.IsUserDefined); 1256Debug.Assert(invocation is not BoundCall { Expanded: true });
Binder\Semantics\Conversions\Conversions.cs (9)
40Debug.Assert(IncludeNullability != includeNullability); 58Debug.Assert(methodSymbol == ((NamedTypeSymbol)destination).DelegateInvokeMethod); 150Debug.Assert(source is BoundUnconvertedInterpolatedString); 183Debug.Assert(elementType is { }); 325Debug.Assert((object)method != null); 328Debug.Assert(method.IsExtensionMethod); 479Debug.Assert(method.ParameterCount == parameterCount + (methodGroup.IsExtensionMethodGroup ? 1 : 0)); 488Debug.Assert((object)sourceExpression.Type == null); 489Debug.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); 795Debug.Assert((object)source != null); 796Debug.Assert((object)destination != null); 805Debug.Assert(!HasExplicitNumericConversion(source, destination)); 952Debug.Assert((object)baseType != null); 953Debug.Assert((object)derivedType != null); 987Debug.Assert((object)derivedType != null); 988Debug.Assert((object)baseType != null); 1031Debug.Assert(sourceExpression is null || Compilation is not null); 1032Debug.Assert(sourceExpression != null || (object)source != null); 1033Debug.Assert(sourceExpression == null || (object)sourceExpression.Type == (object)source); 1034Debug.Assert((object)destination != null); 1186Debug.Assert(Compilation is not null); 1215Debug.Assert(Compilation is not null); 1233Debug.Assert((object)source != null); 1234Debug.Assert((object)destination != null); 1295Debug.Assert(Compilation is not null); 1321Debug.Assert(Compilation is not null); 1403Debug.Assert(sourceExpression != null); 1404Debug.Assert(Compilation != null); 1405Debug.Assert((object)destination != null); 1443Debug.Assert((object)source != null); 1444Debug.Assert((object)destination != null); 1469Debug.Assert((object)anonymousFunction != null); 1470Debug.Assert((object)type != null); 1588Debug.Assert((object)anonymousFunction != null); 1589Debug.Assert((object)type != null); 1590Debug.Assert(type.IsExpressionTree()); 1626Debug.Assert((object)anonymousFunction != null); 1627Debug.Assert((object)type != null); 1643Debug.Assert(source != null); 1644Debug.Assert((object)destination != null); 1656Debug.Assert(compilation is { }); 1731Debug.Assert((object)sourceType != null); 1732Debug.Assert(!sourceType.IsValidV6SwitchGoverningType()); 1741Debug.Assert(switchGoverningType.IsValidV6SwitchGoverningType(isTargetTypeOfUserDefinedOp: true)); 1804Debug.Assert((object)type1 != null); 1805Debug.Assert((object)type2 != null); 1891Debug.Assert(IncludeNullability); 1912Debug.Assert((object)thisType != null); 1922Debug.Assert(sourceExpressionOpt is null || Compilation is not null); 1923Debug.Assert(sourceExpressionOpt == null || (object)sourceExpressionOpt.Type == sourceType); 1924Debug.Assert((object)destination != null); 1953Debug.Assert(!IncludeNullability); 2025Debug.Assert(conversion.Kind == ConversionKind.NoConversion); 2034Debug.Assert((object)source != null); 2035Debug.Assert((object)destination != null); 2050Debug.Assert(conversionKind is ConversionKind.ImplicitNumeric or ConversionKind.ExplicitNumeric); 2123Debug.Assert((object)source != null); 2124Debug.Assert((object)target != null); 2209Debug.Assert((object)source != null); 2210Debug.Assert((object)destination != null); 2238Debug.Assert((object)source != null); 2239Debug.Assert((object)destination != null); 2284Debug.Assert(Compilation is not null); 2288Debug.Assert(!IncludeNullability); 2302Debug.Assert(Compilation is not null); 2306Debug.Assert(!IncludeNullability); 2327Debug.Assert(Compilation is not null); 2338Debug.Assert(arguments.Length == targetElementTypes.Length); 2433Debug.Assert((object)source != null); 2434Debug.Assert((object)destination != null); 2488Debug.Assert((object)source != null); 2489Debug.Assert((object)destination != null); 2510Debug.Assert((object)source != null); 2511Debug.Assert((object)destination != null); 2526Debug.Assert((object)destination != null); 2535Debug.Assert((object)source != null); 2536Debug.Assert((object)destination != null); 2542Debug.Assert((object)source != null); 2543Debug.Assert((object)destination != null); 2623Debug.Assert((object)source != null); 2624Debug.Assert((object)destination != null); 2873Debug.Assert((object)source != null); 2874Debug.Assert((object)destination != null); 2970Debug.Assert((object)derivedType != null); 2971Debug.Assert((object)baseType != null); 3001Debug.Assert(targetInterfaceType.IsErrorType() || targetInterfaceType.IsInterface); 3035Debug.Assert(targetInterfaceType.IsErrorType() || targetInterfaceType.IsInterface); 3069Debug.Assert((object)source != null); 3070Debug.Assert((object)destination != null); 3088Debug.Assert((object)source != null); 3089Debug.Assert((object)destination != null); 3138Debug.Assert((object)source != null); 3139Debug.Assert((object)destination != null); 3157Debug.Assert((object)source != null); 3158Debug.Assert((object)destination != null); 3170Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, destination.OriginalDefinition, TypeCompareKind.AllIgnoreOptions)); 3171Debug.Assert(typeParameters.Count == sourceTypeArguments.Count); 3172Debug.Assert(typeParameters.Count == destinationTypeArguments.Count); 3250Debug.Assert((object)source != null); 3251Debug.Assert((object)destination != null); 3304Debug.Assert((object)source != null); 3305Debug.Assert((object)destination != null); 3365Debug.Assert((object)source != null); 3366Debug.Assert((object)destination != null); 3433Debug.Assert((object)source != null); 3434Debug.Assert((object)destination != null); 3456Debug.Assert((object)source != null); 3457Debug.Assert((object)destination != null); 3530Debug.Assert((object)source != null); 3531Debug.Assert((object)destination != null); 3582Debug.Assert((object)source != null); 3583Debug.Assert((object)destination != null); 3633Debug.Assert((object)source != null); 3634Debug.Assert((object)destination != null); 3722Debug.Assert((object)source != null); 3723Debug.Assert((object)destination != null); 3814Debug.Assert((object)source != null); 3815Debug.Assert((object)destination != null); 3882Debug.Assert((object)source != null); 3883Debug.Assert((object)destination != null); 3890Debug.Assert((object)source != null); 3891Debug.Assert((object)destination != null); 3908Debug.Assert((object)source != null); 3909Debug.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 (17)
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); 906Debug.Assert((object)source != null); 907Debug.Assert(!source.IsValidV6SwitchGoverningType());
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 (25)
34Debug.Assert(left != null); 35Debug.Assert(right != null); 56Debug.Assert(left != null); 57Debug.Assert(right != null); 120Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 193Debug.Assert((result.Results.Count == 0) != hadApplicableCandidates); 234Debug.Assert(hadUserDefinedCandidateFromInterfaces == candidates.Any(r => r.IsValid)); 286Debug.Assert(hadUserDefinedCandidate == results.Any(r => r.IsValid)); 326Debug.Assert(left != null); 327Debug.Assert(right != null); 466Debug.Assert((object)enumType != null); 475Debug.Assert((object)underlying != null); 476Debug.Assert(underlying.SpecialType != SpecialType.None); 545Debug.Assert((object)pointerType != null); 590Debug.Assert(left != null); 591Debug.Assert(right != null); 679Debug.Assert(left != null); 680Debug.Assert(right != null); 725Debug.Assert(op.LeftType.IsObjectType()); 726Debug.Assert(op.RightType.IsObjectType()); 731Debug.Assert(convLeft.IsImplicit); 732Debug.Assert(convRight.IsImplicit); 827Debug.Assert(op.Signature.Kind.Operator() == existingSignature.Kind.Operator()); 912Debug.Assert(hadApplicableCandidates == results.Any(r => r.IsValid)); 1187Debug.Assert(op1.Priority.HasValue == op2.Priority.HasValue);
Binder\Semantics\Operators\BinaryOperatorSignature.cs (4)
98Debug.Assert(Method.ParameterCount == 2); 102Debug.Assert(Method.ParameterRefKinds.Length == 2); 118Debug.Assert(Method.ParameterCount == 2); 122Debug.Assert(Method.ParameterRefKinds.Length == 2);
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 (6)
25Debug.Assert(operand != null); 26Debug.Assert(result.Results.Count == 0); 294Debug.Assert(operand != null); 325Debug.Assert(operand != null); 349Debug.Assert(operand != null); 479Debug.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)
29Debug.Assert(!_argumentsCoerced); 51Debug.Assert(!_argumentsCoerced); 65Debug.Assert(!_argumentsCoerced); 79Debug.Assert(!_argumentsCoerced); 128Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || definitionParamsElementTypeOpt.HasType); 129Debug.Assert(kind != MemberResolutionKind.ApplicableInExpandedForm || paramsElementTypeOpt.HasType); 164Debug.Assert(arg >= 0); 169Debug.Assert(arg < ArgsToParamsOpt.Length); 323Debug.Assert(conversions.Length != 0); 324Debug.Assert(badArguments.TrueBits().Any());
Binder\Semantics\OverloadResolution\MethodGroup.cs (6)
124Debug.Assert(this.Receiver == null); 125Debug.Assert(this.Methods.Count == 0); 126Debug.Assert(this.TypeArguments.Count == 0); 127Debug.Assert(!this.IsExtensionMethodGroup); 128Debug.Assert(this.Error == null); 129Debug.Assert(this.ResultKind == LookupResultKind.Empty);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (123)
277Debug.Assert(!methodTypeParameters.IsDefault); 278Debug.Assert(methodTypeParameters.Length > 0); 279Debug.Assert(!formalParameterTypes.IsDefault); 280Debug.Assert(formalParameterRefKinds.IsDefault || formalParameterRefKinds.Length == formalParameterTypes.Length); 281Debug.Assert(!arguments.IsDefault); 337Debug.Assert(_nullableAnnotationLowerBounds.All(annotation => annotation.IsNotAnnotated())); 425Debug.Assert(0 <= index && index < _formalParameterTypes.Length); 480Debug.Assert(ValidIndex(methodTypeParameterIndex)); 486Debug.Assert(type.HasType); 511Debug.Assert(IsUnfixedTypeParameter(methodTypeParameterWithAnnotations)); 526Debug.Assert(ValidIndex(methodTypeParameterIndex)); 534Debug.Assert((object)delegateOrFunctionPointerType != null); 535Debug.Assert(delegateOrFunctionPointerType.IsDelegateType() || delegateOrFunctionPointerType is FunctionPointerTypeSymbol); 575Debug.Assert(!_formalParameterTypes.IsDefault); 576Debug.Assert(!_arguments.IsDefault); 643Debug.Assert(targetType is { }); 677Debug.Assert(target.Type is { }); 716Debug.Assert(sourceArguments.Length == destTypes.Length); 774Debug.Assert(res != InferenceResult.NoProgress); 913Debug.Assert(sourceArguments.Length == destTypes.Length); 1100Debug.Assert(ValidIndex(iParam)); 1101Debug.Assert(ValidIndex(jParam)); 1113Debug.Assert(IsUnfixed(iParam)); 1114Debug.Assert(IsUnfixed(jParam)); 1166Debug.Assert(_dependencies == null); 1170Debug.Assert(0 == (int)Dependency.Unknown); 1187Debug.Assert(_dependencies != null); 1193Debug.Assert(0 <= iParam && iParam < _methodTypeParameters.Length); 1194Debug.Assert(0 <= jParam && jParam < _methodTypeParameters.Length); 1206Debug.Assert(_dependencies != null); 1207Debug.Assert(ValidIndex(iParam)); 1208Debug.Assert(ValidIndex(jParam)); 1242Debug.Assert(_dependencies != null); 1263Debug.Assert(_dependencies != null); 1278Debug.Assert(_dependencies != null); 1296Debug.Assert(ValidIndex(iParam)); 1311Debug.Assert(ValidIndex(iParam)); 1324Debug.Assert(ValidIndex(iParam)); 1343Debug.Assert(expression != null); 1344Debug.Assert(target.HasType); 1376Debug.Assert(source != null); 1377Debug.Assert(target.HasType); 1404Debug.Assert(inferredReturnType.Type is not FunctionTypeSymbol); 1412Debug.Assert(source != null); 1413Debug.Assert((object)target != null); 1519Debug.Assert(source != null); 1520Debug.Assert(target.HasType); 1574Debug.Assert(source != null); 1575Debug.Assert(target.HasType); 1610Debug.Assert(source.HasType); 1611Debug.Assert(target.HasType); 1664Debug.Assert(source.HasType); 1665Debug.Assert(target.HasType); 1679Debug.Assert(source.HasType); 1680Debug.Assert(target.HasType); 1711Debug.Assert(source is not null); 1712Debug.Assert(target is not null); 1738Debug.Assert(type.IsSpan() || type.IsReadOnlySpan()); 1774Debug.Assert(source.HasType); 1775Debug.Assert(target.HasType); 1803Debug.Assert(source.HasType); 1804Debug.Assert(target.HasType); 1830Debug.Assert(source.HasType); 1831Debug.Assert(target.HasType); 1914Debug.Assert((object)source != null); 1915Debug.Assert((object)target != null); 1916Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 1941Debug.Assert(source.HasType); 1942Debug.Assert(target.HasType); 2035Debug.Assert(source.HasType); 2036Debug.Assert(target.HasType); 2050Debug.Assert((object)source != null); 2051Debug.Assert((object)target != null); 2085Debug.Assert((object)source != null); 2086Debug.Assert((object)target != null); 2123Debug.Assert(source is not null); 2124Debug.Assert(target is not null); 2166Debug.Assert((object)source != null); 2167Debug.Assert((object)target != null); 2230Debug.Assert((object)source != null); 2231Debug.Assert((object)target != null); 2275Debug.Assert((object)source != null); 2276Debug.Assert((object)target != null); 2356Debug.Assert((object)source != null); 2357Debug.Assert((object)target != null); 2358Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 2450Debug.Assert(source.HasType); 2451Debug.Assert(target.HasType); 2484Debug.Assert(source.Type.IsReferenceType || source.Type.IsFunctionPointer()); 2511Debug.Assert(source.HasType); 2512Debug.Assert(target.HasType); 2525Debug.Assert(source.HasType); 2526Debug.Assert(target.HasType); 2567Debug.Assert(sourceWithAnnotations.HasType); 2568Debug.Assert(targetWithAnnotations.HasType); 2627Debug.Assert((object)source != null); 2628Debug.Assert((object)target != null); 2656Debug.Assert((object)source != null); 2657Debug.Assert((object)target != null); 2706Debug.Assert((object)source != null); 2707Debug.Assert((object)target != null); 2708Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 2799Debug.Assert(IsUnfixed(iParam)); 2821Debug.Assert(best.Type.Type.Equals(withoutNullability.Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 2853Debug.Assert(!containsFunctionTypes(exact)); 2854Debug.Assert(!containsFunctionTypes(upper)); 2944Debug.Assert(!best.Equals(candidate, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 3035Debug.Assert((object)target != null); 3036Debug.Assert(target.IsDelegateType()); 3039Debug.Assert(!target.DelegateInvokeMethod.ReturnsVoid); 3043Debug.Assert(!HasUnfixedParamInInputType(source, target)); 3129Debug.Assert(target.IsInterface); 3196Debug.Assert((object)method != null); 3197Debug.Assert(method.Arity > 0); 3198Debug.Assert(!arguments.IsDefault); 3207Debug.Assert(!method.GetParameterType(0).IsDynamic()); 3233Debug.Assert(!_formalParameterTypes.IsDefault); 3234Debug.Assert(_formalParameterTypes.Length >= 1); 3235Debug.Assert(!_arguments.IsDefault); 3236Debug.Assert(_arguments.Length >= 1); 3255Debug.Assert(IsUnfixed(iParam)); 3325Debug.Assert(conversions.IncludeNullability || 3356Debug.Assert(variance == VarianceKind.In || variance == VarianceKind.Out);
Binder\Semantics\OverloadResolution\OverloadResolution.cs (78)
103Debug.Assert(!dynamicResolution || arguments.HasDynamicArgument); 148Debug.Assert((options & Options.DynamicResolution) == 0 || arguments.HasDynamicArgument); 149Debug.Assert((options & Options.InferWithDynamic) == 0 || (options & Options.DynamicResolution) == 0); 150Debug.Assert((options & Options.IsFunctionPointerResolution) == 0 || (options & Options.DynamicResolution) == 0); 151Debug.Assert((options & Options.IsMethodGroupConversion) == 0 || (options & Options.DynamicResolution) == 0); 152Debug.Assert((options & Options.InferWithDynamic) == 0 || (options & Options.IsMethodGroupConversion) != 0); 172Debug.Assert(!dynamicResolution || arguments.HasDynamicArgument); 514Debug.Assert(hidden == hidden.ConstructedFrom()); 562Debug.Assert(funcPtrBuilder[0].Arity == 0); 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))); 847Debug.Assert(typeof(TMember) == typeof(MethodSymbol)); 925Debug.Assert(!MemberAnalysisResult.UnsupportedMetadata().HasUseSiteDiagnosticToReportFor(constructor)); 1025Debug.Assert(!constructor.IsVararg); 1041Debug.Assert(!result.IsValid || result.Kind == MemberResolutionKind.ApplicableInExpandedForm); 1058Debug.Assert(checkOverriddenOrHidden || containingTypeMapOpt is null); 1059Debug.Assert((options & Options.IgnoreNormalFormIfHasValidParamsParameter) == 0 || (options & Options.IsMethodGroupConversion) == 0); 1144Debug.Assert(!MemberAnalysisResult.UnsupportedMetadata().HasUseSiteDiagnosticToReportFor(member)); 1226Debug.Assert(!normalResult.IsValid); 1357Debug.Assert(elementType.Type is { }); 1867Debug.Assert(result.MemberWithPriority is not null); 1895Debug.Assert(previousResults.All(r => r.MemberWithPriority.GetOverloadResolutionPriority() == previousPriority)); 2039Debug.Assert(worse[i] != notBetterThanEverything || i == notBestIdx); 2043Debug.Assert(worse[notBestIdx] == notBetterThanEverything); 2048Debug.Assert(countOfNotBestCandidates > 1); 2085Debug.Assert(m1.Result.IsValid); 2086Debug.Assert(m2.Result.IsValid); 2087Debug.Assert(arguments != null); 2125Debug.Assert(m1.Result.IsValid); 2126Debug.Assert(m2.Result.IsValid); 2127Debug.Assert(arguments != null); 2162Debug.Assert(i == arguments.Count - 1); 2163Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2263Debug.Assert(result == r); 2264Debug.Assert(result == BetterResult.Left || result == BetterResult.Right); 2304Debug.Assert(i == arguments.Count - 1); 2305Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2357Debug.Assert(m1.Result.Kind != MemberResolutionKind.ApplicableInExpandedForm); 2464Debug.Assert(i == arguments.Count - 1); 2465Debug.Assert(m1.Member.GetIsVararg() && m2.Member.GetIsVararg()); 2567Debug.Assert(paramsElementTypeOpt.HasType); 2568Debug.Assert(paramsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel); 2585Debug.Assert(m.Result.IsValid); 2626Debug.Assert(!isInterpolatedStringHandlerConversion || arguments[i] is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 2764Debug.Assert(arr1.HasSameShapeAs(arr2)); 2780Debug.Assert(t1.IsDynamic() && t2.IsDynamic() || 2795Debug.Assert(((object)n1 == null) == ((object)n2 == null)); 2864Debug.Assert(refKind1 == RefKind.None || refKind1 == RefKind.Ref); 2865Debug.Assert(refKind2 == RefKind.None || refKind2 == RefKind.Ref); 3076Debug.Assert(underlyingElementConversions1.Length == underlyingElementConversions2.Length && underlyingElementConversions1.Length == collectionExpressionElements.Length); 3142Debug.Assert(!Conversions.HasIdentityConversion(t1, t2)); 3160Debug.Assert(kind1 is not (CollectionExpressionTypeKind.ReadOnlySpan or CollectionExpressionTypeKind.Span)); 3347Debug.Assert(sourceArguments.Length == destTypes.Length); 3667Debug.Assert((r1.IsVoidType()) == (r2.IsVoidType())); 3671Debug.Assert(!r1.IsVoidType()); 3672Debug.Assert(!r2.IsVoidType()); 3673Debug.Assert(!Conversions.HasIdentityConversion(r1, r2)); 3684Debug.Assert(currentResult == BetterResult.Right); 3689Debug.Assert(currentResult == BetterResult.Left); 3711Debug.Assert( 3829Debug.Assert(firstParamsElementIndex == -1 || (firstParamsElementIndex >= 0 && firstParamsElementIndex < types.Length)); 3846Debug.Assert(argumentRefKinds != null); 3954Debug.Assert(compilation is not null); 3998Debug.Assert(argumentRefKinds != null); 4021Debug.Assert(paramsIterationType.HasType); 4097Debug.Assert(!hasAnyRefOmittedArgument || (options & Options.AllowRefOmittedArguments) != 0); 4166Debug.Assert(!hasAnyRefOmittedArgument || (options & Options.AllowRefOmittedArguments) != 0); 4183Debug.Assert(!result.Result.IsValid || result.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm); 4205Debug.Assert(GetConstructedFrom(leastOverriddenMember) == (object)leastOverriddenMember); 4474Debug.Assert(argumentRefKind == RefKind.None); 4512Debug.Assert( 4525Debug.Assert(badArguments.IsNull); 4526Debug.Assert(conversions == null); 4569Debug.Assert(paramsElementTypeOpt.HasType); 4624Debug.Assert(argRefKind != RefKind.None);
Binder\Semantics\OverloadResolution\OverloadResolution_ArgsToParameters.cs (9)
34Debug.Assert(parameters == null || parameters.Length == length); 47Debug.Assert(0 <= argument && argument < _length); 64Debug.Assert((object)symbol != null); 65Debug.Assert(arguments != null); 279Debug.Assert(expanded); 346Debug.Assert(!parameters.IsDefault); 347Debug.Assert(arguments != null); 348Debug.Assert(arguments.Names.Count == 0); 438Debug.Assert(!(expanded && isMethodGroupConversion));
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (24)
68Debug.Assert(_bestResultState == ThreeState.True && _bestResult.Result.IsValid); 93Debug.Assert(_bestResultState == ThreeState.True); 209Debug.Assert(arguments.Arguments.All(a => a.Display != null)); 414Debug.Assert(!supportedRequiredParameterMissingConflicts); 512Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor }); 521Debug.Assert(firstSupported.Member is MethodSymbol { Name: "Add" }); 583Debug.Assert(diagInfo != null); 584Debug.Assert(diagInfo.Severity == DiagnosticSeverity.Error); 597Debug.Assert(firstSupported.Result.Kind == MemberResolutionKind.WrongCallingConvention); 800Debug.Assert(badName != null); 820Debug.Assert(badName != null); 831Debug.Assert(result.Result.BadArgumentsOpt.TrueBits().Count() == 1); 834Debug.Assert(name != null); 860Debug.Assert(badName != null); 903Debug.Assert(badMember.Kind == SymbolKind.Method); 904Debug.Assert(((MethodSymbol)(object)badMember).IsVararg); 1194Debug.Assert(refArg == RefKind.None); 1299Debug.Assert(argument.Kind != BoundKind.OutDeconstructVarPendingInference); 1300Debug.Assert(argument.Kind != BoundKind.OutVariablePendingInference); 1301Debug.Assert(argument.Kind != BoundKind.DiscardExpression || argument.HasExpressionType()); 1302Debug.Assert(argument.Display != null); 1306Debug.Assert((arg == 0) && (parm == arg)); 1307Debug.Assert(!badArg.Result.ConversionForArg(parm).IsImplicit); 1382Debug.Assert(badArg.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
Binder\SwitchBinder.cs (16)
43Debug.Assert(_switchGoverningExpression != null); 95Debug.Assert(labels.Length > 0); 211Debug.Assert(caseLabel.Value != null); 279Debug.Assert((object)constantValue != null); 312Debug.Assert(key != null); 320Debug.Assert((object)label != null); 374Debug.Assert(ScopeDesignator == SwitchSyntax); 377Debug.Assert(binder != null); 417Debug.Assert(conversion.Kind == ConversionKind.ImplicitUserDefined); 418Debug.Assert(conversion.Method.IsUserDefinedConversion()); 419Debug.Assert(conversion.UserDefinedToConversion.IsIdentity); 420Debug.Assert(resultantGoverningType.IsValidV6SwitchGoverningType(isTargetTypeOfUserDefinedOp: true)); 442Debug.Assert((object)switchGoverningExpression.Type == null || switchGoverningExpression.Type.IsVoidType()); 474Debug.Assert(node.Kind() == SyntaxKind.GotoCaseStatement || node.Kind() == SyntaxKind.GotoDefaultStatement); 494Debug.Assert(node.Kind() == SyntaxKind.GotoCaseStatement); 519Debug.Assert(node.Kind() == SyntaxKind.GotoDefaultStatement);
Binder\SwitchBinder_Patterns.cs (3)
31Debug.Assert(SwitchSyntax.Equals(node)); 143Debug.Assert(this.SwitchSyntax == node.Parent.Parent); 189Debug.Assert(sectionBinder != null);
Binder\SwitchExpressionArmBinder.cs (2)
31Debug.Assert(node == _arm); 38Debug.Assert(node == _arm);
Binder\SwitchExpressionBinder.cs (4)
28Debug.Assert(node == SwitchExpressionSyntax); 90Debug.Assert(wasAcyclic); 182Debug.Assert(inputExpression.Type is not null); 193Debug.Assert(inputExpression.Type is not null);
Binder\UsingStatementBinder.cs (9)
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); 224Debug.Assert(argsToParams.IsDefault); 239Debug.Assert((object)disposableInterface != null); 278Debug.Assert(expressionOpt is { }); 283Debug.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\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 (1)
89Debug.Assert(result.IsClear);
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)
41Debug.Assert(result.IsClear);
Binder\WithUsingNamespacesAndTypesBinder.cs (5)
135Debug.Assert(result.IsClear); 246Debug.Assert(_lazyImportChain != null || !_withImportChainEntry); 278Debug.Assert(declarationSyntax.Kind() is SyntaxKind.CompilationUnit or SyntaxKind.NamespaceDeclaration or SyntaxKind.FileScopedNamespaceDeclaration); 308Debug.Assert(declarationSyntax.IsKind(SyntaxKind.CompilationUnit) || declarationSyntax.IsKind(SyntaxKind.NamespaceDeclaration)); 343Debug.Assert(!namespacesOrTypes.IsDefault);
BoundTree\BoundBinaryOperator.UncommonData.cs (1)
56Debug.Assert(interpolatedStringHandlerData is null || !isUnconvertedInterpolatedStringAddition);
BoundTree\BoundBinaryPattern.cs (4)
13Debug.Assert(Left.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 17Debug.Assert(Right.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 23Debug.Assert(Right.InputType.Equals(Left.NarrowedType, TypeCompareKind.AllIgnoreOptions)); 24Debug.Assert(NarrowedType.Equals(Right.NarrowedType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundConstantPattern.cs (1)
13Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
BoundTree\BoundDagEvaluation.cs (3)
48Debug.Assert(result is not null || this is BoundDagAssignmentEvaluation); 131Debug.Assert(IndexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess); 147Debug.Assert(IndexerAccess is BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess);
BoundTree\BoundDecisionDag.cs (2)
81Debug.Assert(wasAcyclic); 108Debug.Assert(!replacement.ContainsKey(node));
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 (2)
42Debug.Assert(suppress || !this.IsSuppressed); 226Debug.Assert(false); // 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); 27Debug.Assert(!decisionDag.ContainsAnySynthesizedNodes());
BoundTree\BoundITuplePattern.cs (1)
14Debug.Assert(NarrowedType.IsCompilerServicesTopLevelType() && NarrowedType.Name == "ITuple");
BoundTree\BoundListPattern.cs (4)
14Debug.Assert(LengthAccess is null or BoundPropertyAccess or BoundBadExpression); 15Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 16Debug.Assert(Binder.GetIndexerOrImplicitIndexerSymbol(IndexerAccess) is var _); 17Debug.Assert(NarrowedType.Equals(InputType.StrippedType(), TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundNegatedPattern.cs (2)
13Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions)); 14Debug.Assert(Negated.InputType.Equals(InputType, TypeCompareKind.AllIgnoreOptions));
BoundTree\BoundNode.cs (7)
75Debug.Assert( 157Debug.Assert(original is BoundExpression || !original.IsSuppressed); 360Debug.Assert(value || !IsParamsArrayOrCollection); 361Debug.Assert(!value || 366Debug.Assert(!value || 562Debug.Assert(added); 579Debug.Assert(removed);
BoundTree\BoundNodeExtensions.cs (6)
41Debug.Assert(statement != null); 59Debug.Assert(call != null); 156Debug.Assert(typeof(TInterpolatedStringType) == typeof(BoundInterpolatedString) || binary.IsUnconvertedInterpolatedStringAddition); 209Debug.Assert(currentBinary.Left is TInterpolatedStringType || result != null); 231Debug.Assert(result != null); 242Debug.Assert(typeof(TInterpolatedStringType) == typeof(BoundInterpolatedString) || binary.IsUnconvertedInterpolatedStringAddition);
BoundTree\BoundRelationalPattern.cs (1)
13Debug.Assert(NarrowedType.Equals(InputType, TypeCompareKind.AllIgnoreOptions) ||
BoundTree\BoundSlicePattern.cs (3)
13Debug.Assert(IndexerAccess is null or BoundIndexerAccess or BoundImplicitIndexerAccess or BoundArrayAccess or BoundBadExpression or BoundDynamicIndexerAccess); 14Debug.Assert(Binder.GetIndexerOrImplicitIndexerSymbol(IndexerAccess) is var _); 15Debug.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\BoundSwitchExpression.cs (1)
29Debug.Assert(!decisionDag.ContainsAnySynthesizedNodes());
BoundTree\BoundSwitchStatement.cs (1)
25Debug.Assert(!decisionDag.ContainsAnySynthesizedNodes());
BoundTree\BoundTreeRewriter.cs (8)
37System.Diagnostics.Debug.Assert(item != null); 137Debug.Assert(left is { }); 143Debug.Assert(right is { }); 149Debug.Assert((object)binary == node); 192Debug.Assert((object)ifStatement == node); 226Debug.Assert(left is { }); 232Debug.Assert(right is { }); 237Debug.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\BoundTypePattern.cs (1)
13Debug.Assert(NarrowedType.Equals(DeclaredType.Type, TypeCompareKind.AllIgnoreOptions));
BoundTree\Constructors.cs (4)
137Debug.Assert(arguments.IsDefaultOrEmpty || (object)receiverOpt != (object)arguments[0]); 206Debug.Assert(method is ErrorMethodSymbol || arguments[i].Kind == BoundKind.ArgListOperator); 513Debug.Assert(operatorKind.IsUserDefined() && operatorKind.IsLogical()); 602Debug.Assert((object)type != null);
BoundTree\InterpolatedStringHandlerData.cs (3)
37Debug.Assert(construction is BoundObjectCreationExpression or BoundDynamicObjectCreationExpression or BoundBadExpression); 38Debug.Assert(!placeholders.IsDefault); 41Debug.Assert(!positionInfo.IsDefault);
BoundTree\LengthBasedStringSwitchData.cs (11)
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)); 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 (7)
39Debug.Assert(rewrittenConsequence is { }); 87Debug.Assert(stack.Count > 0); 121Debug.Assert(currentBinary != null); 166Debug.Assert(updatedContaining is object); 171Debug.Assert(updatedDelegateType is object); 177Debug.Assert(lambda.ParameterCount == updatedLambda.ParameterCount); 243Debug.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 (28)
87Debug.Assert( 137Debug.Assert(!UnboundLambda.HasExplicitReturnType(out _, out _)); 138Debug.Assert(conversions != null); 188Debug.Assert(!node.UnboundLambda.HasExplicitReturnType(out _, out _)); 195Debug.Assert(!node.HasExplicitReturnType(out _, out _)); 228Debug.Assert(bestType.Type is not FunctionTypeSymbol); 407Debug.Assert(binder != null); 408Debug.Assert(syntax.IsAnonymousFunction()); 537Debug.Assert(binder != null); 538Debug.Assert(binder.ContainingMemberOrLambda != null); 551Debug.Assert(unbound != null); 552Debug.Assert(_unboundLambda == null || (object)_unboundLambda == unbound); 566Debug.Assert((state._bindingCache == null) != includeCache); 720Debug.Assert(Binder.ContainingMemberOrLambda is { }); 769Debug.Assert(getEffectiveScopeFromSymbol); 774Debug.Assert(lambdaSymbol.Parameters[i].EffectiveScope == parameterScopesBuilder[i]); 797Debug.Assert(Binder.ContainingMemberOrLambda is { }); 1054Debug.Assert(parameterTypes.Length == parameterRefKinds.Length); 1055Debug.Assert(taskLikeReturnTypeOpt is null || ((object)taskLikeReturnTypeOpt == taskLikeReturnTypeOpt.ConstructedFrom && taskLikeReturnTypeOpt.IsCustomTaskType(out var builderArgument))); 1227Debug.Assert(!inferredReturnType.IsExplicitType); 1522Debug.Assert(HasSignature && 0 <= index && index < ParameterCount); 1545Debug.Assert(!_parameterNames.IsDefault && 0 <= index && index < _parameterNames.Length); 1551Debug.Assert(0 <= index && index < this.ParameterCount); 1557Debug.Assert(0 <= index && index < this.ParameterCount); 1563Debug.Assert(0 <= index && index < this.ParameterCount); 1569Debug.Assert(0 <= index && index < this.ParameterCount); 1575Debug.Assert(this.HasExplicitlyTypedParameterList); 1576Debug.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.cs (18)
92Debug.Assert((object)method != null); 93Debug.Assert(boundBody != null); 94Debug.Assert(builder != null); 95Debug.Assert(moduleBuilder != null); 96Debug.Assert(diagnostics != null); 97Debug.Assert(diagnostics.DiagnosticBag != null); 212Debug.Assert(_asyncCatchHandlerOffset < 0); 213Debug.Assert(_asyncYieldPoints == null); 214Debug.Assert(_asyncResumePoints == null); 225Debug.Assert(_asyncCatchHandlerOffset >= 0); 232Debug.Assert((yieldPoints == null) == (resumePoints == null)); 248Debug.Assert(resumeOffset >= 0); // resume marker should always be reachable from dispatch 311Debug.Assert(_method.ReturnsVoid == (_returnTemp == null)); 443Debug.Assert(node.Syntax is { }); 487Debug.Assert(_emitPdbSequencePoints); 498Debug.Assert(syntaxTree != null); 499Debug.Assert(_emitPdbSequencePoints); 520Debug.Assert(!exprTemps.Contains(temp));
CodeGen\CodeGenerator_HasHome.cs (6)
49Debug.Assert(containingSymbol is object); 125Debug.Assert(HasHome( 131Debug.Assert(HasHome( 178Debug.Assert(containingSymbol is object); 216Debug.Assert(field.RefKind == RefKind.None); 226Debug.Assert(!IsAnyReadOnly(addressKind));
CodeGen\EmitAddress.cs (9)
41Debug.Assert(!expression.Type.IsReferenceType); 42Debug.Assert(!expression.Type.IsValueType || expression.Type.IsNullableType()); 102Debug.Assert(operand.Type.IsPointerType()); 170Debug.Assert(!HasHome(expression, addressKind)); 236Debug.Assert(!expression.Type.IsReferenceType); 237Debug.Assert(!expression.Type.IsValueType); 249Debug.Assert(receiverTemp == null); 530Debug.Assert(receiverType.TypeKind == TypeKind.TypeParameter || receiverType.IsValueType); 536Debug.Assert(!receiverType.IsVerifierReference());
CodeGen\EmitArrayInitializer.cs (15)
150Debug.Assert(!indices.Any()); 469Debug.Assert(!rosPointerCtor.HasUnsupportedMetadata); 513Debug.Assert(arrayType is not null); 514Debug.Assert(elementType is not null); 527Debug.Assert(length is not null); 571Debug.Assert(used); 614Debug.Assert(!createSpan.HasUnsupportedMetadata); 692Debug.Assert(initializer != null); 695Debug.Assert(initializers.All(static init => init.ConstantValueOpt != null)); 696Debug.Assert(!elementType.IsEnumType()); 741Debug.Assert(used); 772Debug.Assert(used); 786Debug.Assert(!rosArrayCtor.HasUnsupportedMetadata); 815Debug.Assert(initializers.Length > 0); 816Debug.Assert(initializers.All(static init => init.ConstantValueOpt != null));
CodeGen\EmitConversion.cs (8)
152Debug.Assert(IsNumeric(toType)); 155Debug.Assert(IsNumeric(fromType)); 156Debug.Assert( 216Debug.Assert(IsNumeric(fromType)); 220Debug.Assert(IsNumeric(toType)); 288Debug.Assert(!conversion.Type.IsNullableType()); 297Debug.Assert(IsNumeric(fromType)); 306Debug.Assert(IsNumeric(toType));
CodeGen\EmitExpression.cs (87)
79Debug.Assert(_recursionDepth == 1); 84Debug.Assert(_recursionDepth == 1); 236Debug.Assert(used); 241Debug.Assert(used); 246Debug.Assert(!used); 251Debug.Assert(used); 256Debug.Assert(used); 261Debug.Assert(used); 266Debug.Assert(used); 271Debug.Assert(used); 276Debug.Assert(used); 281Debug.Assert(used); 316Debug.Assert(used); 362Debug.Assert(expression.Kind != BoundKind.BadExpression); 379Debug.Assert(!expression.Type.IsReferenceType); 380Debug.Assert(!expression.Type.IsValueType); 418Debug.Assert(receiverType.IsVerifierReference()); 522Debug.Assert(receiver.Type.IsNullableType()); 575Debug.Assert(receiverTemp == null); 578Debug.Assert(receiverTemp == null || receiver.IsDefaultValue()); 616Debug.Assert(walker._result.HasValue); 634Debug.Assert(!_result.HasValue); 643Debug.Assert(!_result.HasValue); 654Debug.Assert(!expression.Type.IsValueType); 694Debug.Assert((object)getTypeMethod != null); 729Debug.Assert(refKind is RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn); 802Debug.Assert((object)meth != null); 809Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter); 859Debug.Assert(sequence.Value.Kind != BoundKind.TypeExpression || !used); 1002Debug.Assert(arguments[i].Kind == BoundKind.ArgListOperator); 1644Debug.Assert(method.IsImplicitlyDeclared); 1645Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2)); 1646Debug.Assert(receiver.Kind == BoundKind.ThisReference); 1661Debug.Assert(method.IsStatic); 1722Debug.Assert(!box); 1730Debug.Assert(addressKind.GetValueOrDefault() != AddressKind.Constrained); 1731Debug.Assert(!parentCallReceiverType.IsVerifierValue()); 1732Debug.Assert(parentCallKind != CallKind.ConstrainedCallVirt); 1736Debug.Assert(!box); 1737Debug.Assert(!parentCallReceiverType.IsVerifierReference()); 1767Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1777Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1782Debug.Assert(!parentCallReceiverType.IsVerifierReference()); 1786Debug.Assert(receiverUseKind == UseKind.UsedAsValue); 1787Debug.Assert(!HasHome(nested, addressKind.GetValueOrDefault())); 1827Debug.Assert(!method.IsStatic && !method.IsDefaultValueTypeConstructor() && method.RequiresInstanceReceiver); 1867Debug.Assert(TypeSymbol.Equals(receiverType, methodContainingType, TypeCompareKind.ObliviousNullableModifierMatchesAny)); 1908Debug.Assert((callKind != CallKind.ConstrainedCallVirt) || (addressKind.GetValueOrDefault() == AddressKind.Constrained) || receiverType.IsVerifierValue()); 1931Debug.Assert(!box); 1932Debug.Assert(!receiverType.IsVerifierReference()); 1977Debug.Assert(receiver.Type.IsVerifierReference()); 1988Debug.Assert(receiver.Type.IsVerifierReference()); 2154Debug.Assert(!b.OperatorKind.IsUserDefined()); 2167Debug.Assert(!conv.ConversionKind.IsUserDefinedConversion()); 2347Debug.Assert(expression.Type.SpecialType == SpecialType.System_Int32 || 2895Debug.Assert(left.IsRef); 2931Debug.Assert(left.Method.RefKind != RefKind.None); 2942Debug.Assert(left.FunctionPointer.Signature.RefKind != RefKind.None); 3004Debug.Assert(lhs.Kind != BoundKind.Parameter || exprTempsAfter <= exprTempsBefore); 3110Debug.Assert(((BoundDup)expression).RefKind != RefKind.None); 3115Debug.Assert(((BoundConditionalOperator)expression).IsRef); 3133Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None); 3138Debug.Assert(((BoundFunctionPointerInvocation)expression).FunctionPointer.Signature.RefKind != RefKind.None); 3189Debug.Assert(thisRef.Type.IsValueType); 3385Debug.Assert((object)operand.Type != null); 3404Debug.Assert(asOp.OperandPlaceholder is null); 3405Debug.Assert(asOp.OperandConversion is null); 3414Debug.Assert((object)targetType != null); 3534Debug.Assert((object)getTypeMethod != null); // Should have been checked during binding 3555Debug.Assert(node.Method.IsDefinition); 3556Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3573Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3587Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3601Debug.Assert(field.IsDefinition); 3610Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3648Debug.Assert(throwMethod != null); 3693Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32); 3704Debug.Assert((object)getMethod != null); 3712Debug.Assert(getMethod.ParameterCount == 2); 3731Debug.Assert((object)getField != null); 3739Debug.Assert(getField.ParameterCount == 2); 3867Debug.Assert(expr.Type.IsReferenceType); 3947Debug.Assert(conversionKind != ConversionKind.NullLiteral && conversionKind != ConversionKind.DefaultLiteral); 4014Debug.Assert(to.IsVerifierReference()); 4034Debug.Assert(!type.IsRefLikeType); 4120Debug.Assert(method.RefKind != RefKind.None); 4126Debug.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 (3)
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));
CodeGen\EmitStatement.cs (49)
145Debug.Assert((_asyncYieldPoints == null) == (_asyncResumePoints == null)); 156Debug.Assert(_asyncYieldPoints != null); 157Debug.Assert(_asyncYieldPoints != null); 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); 794Debug.Assert(!block.Locals.IsEmpty); 800Debug.Assert(local.Name != null); 801Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.UserDefined && 924Debug.Assert(!statement.CatchBlocks.IsDefault); 1129Debug.Assert(exceptionSourceOpt.Type.IsTypeParameter()); // only expecting type parameters 1138Debug.Assert(seq.Locals.IsDefaultOrEmpty); 1147Debug.Assert(exceptionSourceLocal.LocalSymbol.RefKind == RefKind.None); 1158Debug.Assert(!left.ReceiverOpt.Type.IsTypeParameter()); 1159Debug.Assert(left.FieldSymbol.RefKind == RefKind.None); 1173Debug.Assert(receiverTemp == null); 1192Debug.Assert(_builder.IsStackEmpty); 1224Debug.Assert(_asyncCatchHandlerOffset < 0); // only one expected 1232Debug.Assert((object)dispatch.Expression.Type != null); 1233Debug.Assert(dispatch.Expression.Type.IsValidV6SwitchGoverningType() || dispatch.Expression.Type.IsSpanOrReadOnlySpanChar()); 1236Debug.Assert(!dispatch.Expression.Type.IsNullableType()); 1239Debug.Assert(dispatch.Cases.Any()); 1255Debug.Assert((object)expression.Type != null && 1257Debug.Assert(switchCaseLabels.Length > 0); 1259Debug.Assert(switchCaseLabels != null || lengthBasedSwitchStringJumpTableOpt != null); 1307Debug.Assert(lengthBasedSwitchStringJumpTableOpt is null || 1373Debug.Assert(indexerRef is not null); 1374Debug.Assert(lengthMethodRef is not null); 1473Debug.Assert(diag.IsEmptyWithoutResolution); 1538Debug.Assert(sequenceEqualsTMethod != null && !sequenceEqualsTMethod.HasUseSiteError); 1543Debug.Assert(asSpanMethod != null && !asSpanMethod.HasUseSiteError); 1549Debug.Assert(stringEqualityMethod != null && !stringEqualityMethod.HasUseSiteError); 1560Debug.Assert(!isSpanOrReadOnlySpan); 1590Debug.Assert(diag.IsEmptyWithoutResolution); 1632Debug.Assert(spanTLengthMethod != null && !spanTLengthMethod.HasUseSiteError); 1690Debug.Assert(stringEqualityMethodRef != null); 1694Debug.Assert(stringEqualityMethodRef == _module.Translate((MethodSymbol)_module.Compilation.GetSpecialTypeMember(SpecialMember.System_String__op_Equality), (CSharpSyntaxNode)syntaxNode, assertDiagnostics)); 1728Debug.Assert(sequenceEqualsRef != null); 1729Debug.Assert(asSpanRef != null); 1767Debug.Assert(local.HasConstantValue); 1789Debug.Assert(local.RefKind == RefKind.None); 1790Debug.Assert(local.TypeWithAnnotations.Type.IsPointerType()); 1855Debug.Assert((local.Name == null) == (localKind != SynthesizedLocalKind.UserDefined)); 1872Debug.Assert(ordinal == 0 || localKind != SynthesizedLocalKind.UserDefined);
CodeGen\Optimizer.cs (23)
299Debug.Assert(instance._localDefs == null); 451Debug.Assert(expr.Kind != BoundKind.Label); 521Debug.Assert(_recursionDepth == 1); 526Debug.Assert(_recursionDepth == 1); 542Debug.Assert(result != null || context == ExprContext.None); 568Debug.Assert(node == null || EvalStackIsEmpty()); 869Debug.Assert(_assignmentLocal == null); 1168Debug.Assert(method.IsStatic); 1257Debug.Assert(!arguments.IsDefault); 1258Debug.Assert(!parameters.IsDefault); 1260Debug.Assert(arguments.Length == parameters.Length || arguments.Length == parameters.Length + 1); 1320Debug.Assert(node.InitializerExpressionOpt == null); 1420Debug.Assert(EvalStackIsEmpty()); 1540Debug.Assert((object)binary == node); 1569Debug.Assert(node.LeftPlaceholder is null); 1570Debug.Assert(node.LeftConversion is null); 1921Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth()); 1942Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.OptimizerTemp); 1947Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth()); 1955Debug.Assert(local.SynthesizedKind != SynthesizedLocalKind.OptimizerTemp); 2112Debug.Assert((object)binary == node); 2144Debug.Assert(node.InitializerExpressionOpt == null); 2184Debug.Assert(locInfo.LocalDefs.Any((d) => _nodeCounter == d.Start && _nodeCounter <= d.End));
CommandLine\CSharpCommandLineParser.cs (8)
52Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 166Debug.Assert(optionsEnded || !arg.StartsWith("@", StringComparison.Ordinal)); 425Debug.Assert(loweredValue == nameof(NullableContextOptions.Disable).ToLower()); 429Debug.Assert(loweredValue == nameof(NullableContextOptions.Enable).ToLower()); 433Debug.Assert(loweredValue == nameof(NullableContextOptions.Warnings).ToLower()); 437Debug.Assert(loweredValue == nameof(NullableContextOptions.Annotations).ToLower()); 1699Debug.Assert(!IsScriptCommandLineParser); 1741Debug.Assert(IsScriptCommandLineParser);
CommandLine\CSharpCompiler.cs (5)
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);
Compilation\AttributeSemanticModel.cs (1)
31Debug.Assert(syntax != null);
Compilation\BuiltInOperators.cs (5)
692Debug.Assert(_compilation.IsReadOnlySpanType(readonlySpanOfByte)); 693Debug.Assert(((NamedTypeSymbol)readonlySpanOfByte).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.Single().Type.SpecialType is SpecialType.System_Byte); 835Debug.Assert(kind.IsLifted()); 886Debug.Assert((object)leftType != null); 897Debug.Assert((object)rightType != null);
Compilation\CSharpCompilation.cs (54)
410Debug.Assert(!isSubmission || options.ReferencesSupersedeLowerVersions); 447Debug.Assert(compilation._lazyAssemblySymbol is null); 490Debug.Assert(previousSubmission == null || previousSubmission.HostObjectType == hostObjectType); 495Debug.Assert(previousSubmission == null && submissionReturnType == null && hostObjectType == null); 518Debug.Assert(_lazyAssemblySymbol is null); 524Debug.Assert(debugEntryPoint != null); 771Debug.Assert(IsSubmission); 1038Debug.Assert(this.ContainsSyntaxTree(tree)); 1083Debug.Assert(contentHash.Length == InterceptableLocation1.ContentHashLength); 1147Debug.Assert(_lazyAssemblySymbol is object); 1201Debug.Assert(reference.Properties.Kind == MetadataImageKind.Module); 1525Debug.Assert(foundNamespace == !(@namespace is MissingNamespaceSymbol)); 1559Debug.Assert(tree != null); 1560Debug.Assert(!this.IsSubmission || _syntaxAndDeclarations.ExternalSyntaxTrees.Length <= 1); 1617Debug.Assert(this.IsSubmission); 1618Debug.Assert(_syntaxAndDeclarations.ExternalSyntaxTrees.Length <= 1); 1638Debug.Assert(this.IsSubmission); 1679Debug.Assert(result.ExtendedSpecialType == specialType); 1825Debug.Assert(result?.IsErrorType() != true); 1892Debug.Assert(!this.Options.Errors.IsDefaultOrEmpty); 2121Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.Uninitialized)); 2122Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound)); 2424Debug.Assert(!_declarationDiagnosticsFrozen); 2454Debug.Assert(!_declarationDiagnosticsFrozen); 2455Debug.Assert(!InterceptorsDiscoveryComplete); 2530Debug.Assert(model != null); 2563Debug.Assert(System.Runtime.CompilerServices.Unsafe.AreSame(ref cachedBinderFactories, ref ignoreAccessibility ? ref _ignoreAccessibilityBinderFactories : ref _binderFactories)); 2594Debug.Assert(slot is object); 2636Debug.Assert(diagnostics is { }); 2638Debug.Assert(bag.DiagnosticBag is { }); 2838Debug.Assert(!_declarationDiagnosticsFrozen || true); 2929Debug.Assert(builder.DiagnosticBag is { }); 3030Debug.Assert(!loadDirectives.IsEmpty); 3090Debug.Assert(bindingDiagnostics.DiagnosticBag is { }); 3116Debug.Assert(reportUnusedUsings); 3135Debug.Assert(reportUnusedUsings); 3138Debug.Assert(discarded.DiagnosticBag is object); 3286Debug.Assert(!_lazyClsComplianceDependencies.IsDefault); 3287Debug.Assert(!_lazyClsComplianceDiagnostics.IsDefault); 3407Debug.Assert(!IsSubmission || HasCodeToEmit() || 3520Debug.Assert(methodBodyDiagnosticBag.DiagnosticBag is { }); 3521Debug.Assert(moduleBeingBuilt is object); 3609Debug.Assert(symbol.ContainingSymbol.Kind == SymbolKind.Namespace); // avoid unnecessary traversal of nested types 3659Debug.Assert(_declarationDiagnosticsFrozen); 3714Debug.Assert(xmlDiagnostics.DiagnosticBag is { }); 4235Debug.Assert(csharpReturnType is not null); 4236Debug.Assert(csharpLeftType is not null); 4237Debug.Assert(csharpRightType is not null); 4459Debug.Assert(csharpReturnType is not null); 4460Debug.Assert(csharpOperandType is not null); 4543Debug.Assert(loc1.IsInSource); 4544Debug.Assert(loc2.IsInSource); 4711Debug.Assert(symbol.IsDefinition); 4768Debug.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 (63)
61Debug.Assert(node != null); 204Debug.Assert(expression != null); 253Debug.Assert(binder != null); 254Debug.Assert(binder.IsSemanticModelBinder); 255Debug.Assert(expression != null); 256Debug.Assert(bindingOption != SpeculativeBindingOption.BindAsTypeOrNamespace || expression is TypeSyntax); 265Debug.Assert(bindingOption == SpeculativeBindingOption.BindAsExpression); 723Debug.Assert(boundNode == null || crefSymbols.IsDefault); 749Debug.Assert(CanGetSemanticInfo(attribute, isSpeculative: true)); 777Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true)); 849Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true)); 910Debug.Assert(CanGetSemanticInfo(cref, isSpeculative: true)); 1053Debug.Assert(boundNode == null || crefSymbols.IsDefault); 1200Debug.Assert(boundNode == null || crefSymbols.IsDefault); 1220Debug.Assert(result == null || result.IsSemanticModelBinder); 1312Debug.Assert(IsInTree(node)); 1330Debug.Assert(position == fullSpan.Start); 1338Debug.Assert(node.Width == 0); 1570Debug.Assert(!options.IsAttributeTypeLookup()); // Not exposed publicly. 1590Debug.Assert((object)container == null); 1728Debug.Assert(results != null); 1731Debug.Assert((options & LookupOptions.AllMethodsOnArityZero) == 0); 2312Debug.Assert((object)symbol != null); 2350Debug.Assert((object)symbol != null); 3303Debug.Assert(catchClause.Kind() == SyntaxKind.CatchClause); 3482Debug.Assert((object)indexerAccess.Indexer != null); 3531Debug.Assert((object)symbol != null); 3575Debug.Assert(conditional.ExpressionSymbol is null); 3581Debug.Assert(boundNodeForSyntacticParent == null); 3593Debug.Assert(resultKind != LookupResultKind.Viable); 3627Debug.Assert(dynamicInvocation.ExpressionSymbol is null); 3635Debug.Assert(collectionInit.ExpressionSymbol is null); 3643Debug.Assert(dynamicIndexer.ExpressionSymbol is null); 3650Debug.Assert((object)boundNode.ExpressionSymbol == null); 3666Debug.Assert(boundObjectCreation.ConstructorsGroup.Contains(boundObjectCreation.Constructor)); 3807Debug.Assert((object)unaryOperator.MethodOpt == null && unaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3830Debug.Assert((object)increment.MethodOpt == null && increment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3855Debug.Assert((object)binaryOperator.Method == null && binaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3894Debug.Assert(returnType.IsDynamic()); 3898Debug.Assert(rightType.IsDynamic()); 3903Debug.Assert(leftType.IsDynamic()); 3928Debug.Assert((object)compoundAssignment.Operator.Method == null && compoundAssignment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty); 3987Debug.Assert(resultKind != LookupResultKind.Viable || 4022Debug.Assert(lowestBoundNode != null); 4023Debug.Assert(binderOpt != null || IsInTree(lowestBoundNode.Syntax)); 4027Debug.Assert(lowestBoundNode.Syntax != null); 4048Debug.Assert(resultKind != LookupResultKind.Viable); 4059Debug.Assert(candidateConstructors.Contains(constructorOpt)); 4065Debug.Assert(resultKind != LookupResultKind.Viable); 4083Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4240Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4392Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax)); 4475Debug.Assert(SyntaxFacts.IsNamedArgumentName(identifierNameSyntax)); 4575Debug.Assert(nonHiddenMethods.Any()); // Something must be hiding, so can't all be hidden. 4611Debug.Assert(receiver != null); 4674Debug.Assert((object)constructedMethod != null); 4715Debug.Assert(singleResult.Symbol.Kind == SymbolKind.Method); 4739Debug.Assert((methods.Count == 0) == (resultKind == LookupResultKind.Empty)); 4751Debug.Assert(!methods.IsDefault); 4766Debug.Assert((object)extensionThisType != null); 4787Debug.Assert((object)method != null); 4791Debug.Assert(call.Arguments.Length > 0); 4804Debug.Assert((object)method != null);
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 (52)
52Debug.Assert(root != null); 53Debug.Assert((object)memberSymbol != null); 54Debug.Assert(containingPublicSemanticModel.IsSpeculativeSemanticModel == (containingPublicSemanticModel is SpeculativeSemanticModelWithMemberModel)); 148Debug.Assert(false); 158Debug.Assert(_lazySnapshotManager is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled()); 165Debug.Assert(_lazyRemappedSymbols is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled()); 227Debug.Assert(root.Contains(node)); 236Debug.Assert(current != null); // Why were we asked for an enclosing binder for a node outside our root? 253Debug.Assert(ownerOfTypeParametersInScope == null); 281Debug.Assert(binder != null); 356Debug.Assert(!current.CanHaveAssociatedLocalBinder()); 366Debug.Assert(binder != null); 394Debug.Assert(binder != null); 404Debug.Assert(binder != null); 410Debug.Assert(binder != null); 421Debug.Assert(binder != null); 529Debug.Assert(node == GetBindableSyntaxNode(node)); 551Debug.Assert(node == GetBindableSyntaxNode(node)); 832Debug.Assert(parameter != null); 867Debug.Assert(parameter != null); 868Debug.Assert(lambda != null && lambda.IsAnonymousFunction()); 952Debug.Assert(enumeratorInfoOpt != null || boundForEach.HasAnyErrors); 1006Debug.Assert(boundConversion != null); 1024Debug.Assert(boundDeconstruction != null || boundForEach.HasAnyErrors); 1094Debug.Assert(index >= 0); 1095Debug.Assert(index < anonymousObjectCreation.Initializers.Count); 1188Debug.Assert(highestBoundNode != null); 1200Debug.Assert(highestBoundNode.Kind != BoundKind.UnboundLambda); 1370Debug.Assert(node != null); 1434Debug.Assert(_nodeMapLock.IsWriteLockHeld || _nodeMapLock.IsReadLockHeld); 1452Debug.Assert(_nodeMapLock.IsWriteLockHeld); 1466Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax)); 1483Debug.Assert(_nodeMapLock.IsWriteLockHeld); 1502Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax)); 1510Debug.Assert((manager is null && (!IsNullableAnalysisEnabled() || syntax != Root || syntax is TypeSyntax || 1528Debug.Assert(node != null); 1663Debug.Assert(bindingRoot.Contains(enclosingLambdaOrQuery)); 1705Debug.Assert(lambdaOrQuery != nodeToBind); 1740Debug.Assert(boundInnerLambdaOrQuery != null); 1758Debug.Assert(result != null); 1899Debug.Assert(containingLambda.IsAnonymousFunction()); 1900Debug.Assert(LookupPosition.IsInAnonymousFunctionOrQuery(position, containingLambda)); 1951Debug.Assert(!isNullableAnalysisEnabled || 1997Debug.Assert(Compilation.IsNullableAnalysisEnabledAlways); 2025Debug.Assert(binder is SimpleProgramBinder); 2075Debug.Assert(node == GetBindableSyntaxNode(node)); 2236Debug.Assert(parent.Kind() == SyntaxKind.VariableDeclaration); 2314Debug.Assert(bindableParent != null); 2342Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod }); 2411Debug.Assert(!(binder is IncrementalBinder)); 2468Debug.Assert(!block.WasCompilerGenerated); 2532Debug.Assert(alternative is BoundIfStatement);
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\SyntaxAndDeclarationManager.cs (12)
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);
Compilation\SyntaxAndDeclarationManager.LazyState.cs (1)
55Debug.Assert(syntaxTrees.All(tree => syntaxTrees[syntaxTreeOrdinalMap[tree]] == tree));
Compilation\SyntaxTreeSemanticModel.cs (31)
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); 1387Debug.Assert(declarationSyntax != null); 1395Debug.Assert(declarationSyntax != null); 1398Debug.Assert((object)container != null); 1588Debug.Assert((object)container != null); 1589Debug.Assert(declarationSyntax.Keyword.Kind() != SyntaxKind.IdentifierToken); 1609Debug.Assert((object)container != null); 1731Debug.Assert((object)left != null); 1841Debug.Assert((object)container != null); 1844Debug.Assert((object)result != null); 2010Debug.Assert(parameter != null); 2047Debug.Assert(parameter != null); 2074Debug.Assert(parameter != null); 2326Debug.Assert((object)container != null); 2386Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod }); 2413Debug.Assert(((INamespaceSymbol)declaredSymbol).IsGlobalNamespace); 2418Debug.Assert((object)declaredSymbol.GetSymbol() == (object)entryPoint); 2423Debug.Assert((object)declaredSymbol.GetSymbol() == (object)entryPoint.ContainingSymbol); 2438Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor); 2459Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor.ContainingSymbol); 2474Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor); 2487Debug.Assert((object)declaredSymbol.GetSymbol() == (object)ctor.ContainingSymbol); 2508Debug.Assert(declaredSymbol.GetSymbol() is SynthesizedRecordPropertySymbol);
Compiler\AnonymousTypeMethodBodySynthesizer.cs (2)
38Debug.Assert(ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 50Debug.Assert(anonymousType.Properties.Length == paramCount);
Compiler\ClsComplianceChecker.cs (27)
44Debug.Assert(diagnostics.DependenciesBag is null || diagnostics.DependenciesBag is ConcurrentSet<AssemblySymbol>); 93System.Diagnostics.Debug.Assert(symbol is SourceAssemblySymbol); 243Debug.Assert(!symbol.IsImplicitClass); 424System.Diagnostics.Debug.Assert( 430System.Diagnostics.Debug.Assert(!symbol.IsAccessor()); 546System.Diagnostics.Debug.Assert((object)containingType == null || !containingType.IsImplicitClass); 665System.Diagnostics.Debug.Assert(syntaxRef.SyntaxTree.HasCompilationUnitRoot); 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))); 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'); 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); 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 (27)
106Debug.Assert(compiler._indentDepth == 0); 141Debug.Assert( 149Debug.Assert(compilation != null); 165Debug.Assert(compiler._indentDepth == 0); 180Debug.Assert(_assemblyName != null); 199Debug.Assert(!_isForSingleSymbol); 386Debug.Assert(location.SourceTree!.ReportDocumentationCommentDiagnostics()); //Should be the same tree as for the symbol. 401Debug.Assert(location.SourceTree!.ReportDocumentationCommentDiagnostics()); //Should be the same tree as for the symbol. 501Debug.Assert(!docCommentNodes.IsDefaultOrEmpty); 658Debug.Assert((object)symbol != null); 776Debug.Assert(numLines > 0); 781Debug.Assert(numLines > 0); 815Debug.Assert(start >= 0); 816Debug.Assert(start <= str.Length); 817Debug.Assert(end >= 0); 818Debug.Assert(end <= str.Length); 819Debug.Assert(end >= start); 942Debug.Assert(numLines > 0); 962Debug.Assert(pattern.StartsWith(currentLinePattern, StringComparison.Ordinal)); 1084Debug.Assert((object)symbol != null); 1095Debug.Assert(!ns.IsGlobalNamespace); 1190Debug.Assert(referencedSymbol.Kind == SymbolKind.Parameter); 1191Debug.Assert(documentedParameters != null); 1204Debug.Assert(referencedSymbol.Kind == SymbolKind.TypeParameter); 1205Debug.Assert(documentedTypeParameters != null); 1254Debug.Assert(_indentDepth >= 0); 1312Debug.Assert(depth >= 0);
Compiler\DocumentationCommentCompiler.IncludeElementExpander.cs (14)
135Debug.Assert(expander._nextSourceIncludeElementIndex == expander._sourceIncludeElementNodes.Length); 149Debug.Assert(nodes != null); 165Debug.Assert(builder == null || builder.All(node => node.Parent == null)); 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); 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 (12)
37Debug.Assert((object)constructor.ContainingType.BaseTypeNoUseSiteDiagnostics == null || constructor.ContainingType.BaseTypeNoUseSiteDiagnostics.SpecialType == SpecialType.System_Object); 90Debug.Assert(submissionConstructor.ParameterCount == 1); 99Debug.Assert(slotIndex >= 0); 144Debug.Assert(targetSubmissionIndex >= 0); 176Debug.Assert(accessor.MethodKind == MethodKind.PropertyGet || accessor.MethodKind == MethodKind.PropertySet); 197Debug.Assert(accessor.MethodKind == MethodKind.PropertySet); 217Debug.Assert(eventSymbol.HasAssociatedField); 237Debug.Assert((object)accessor != null); 240Debug.Assert((object)field != null); 243Debug.Assert(fieldType.Name == "EventRegistrationTokenTable"); 532Debug.Assert(method.MethodKind == MethodKind.Destructor); 533Debug.Assert(syntax.Kind() == SyntaxKind.Block || syntax.Kind() == SyntaxKind.ArrowExpressionClause);
Compiler\MethodBodySynthesizer.Lowered.cs (2)
328Debug.Assert(this.Arity == methodBeingWrapped.Arity); 361Debug.Assert(system_Int32.SpecialType == SpecialType.System_Int32);
Compiler\MethodCompiler.cs (60)
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); 223Debug.Assert(diagnostics.DiagnosticBag != null); 288Debug.Assert(lazyVariableSlotAllocator is null); 289Debug.Assert(stateMachineTypeOpt is null); 290Debug.Assert(codeCoverageSpans.IsEmpty); 291Debug.Assert(lambdaDebugInfoBuilder.IsEmpty); 292Debug.Assert(lambdaRuntimeRudeEditsBuilder.IsEmpty); 293Debug.Assert(closureDebugInfoBuilder.IsEmpty); 294Debug.Assert(stateMachineStateDebugInfoBuilder.IsEmpty); 356Debug.Assert(_moduleBeingBuiltOpt != null); 469Debug.Assert((object)scriptCtor != null); 470Debug.Assert((object)scriptInitializer != null); 515Debug.Assert(scriptCtorOrdinal == -1); 516Debug.Assert((object)scriptCtor == method); 578Debug.Assert(containingType.IsScriptClass == (scriptCtorOrdinal >= 0)); 597Debug.Assert(processedStaticInitializers.BoundInitializers.All((init) => 637Debug.Assert(scriptCtorOrdinal >= 0); 667Debug.Assert(_moduleBeingBuiltOpt != null); 676Debug.Assert(method.SynthesizesLoweredBoundBody); 687Debug.Assert(diagnostics.DiagnosticBag != null); 708Debug.Assert(_moduleBeingBuiltOpt != null); 709Debug.Assert(compilationState.ModuleBuilderOpt == _moduleBeingBuiltOpt); 755Debug.Assert((object)iteratorStateMachine == null || (object)asyncStateMachine == null); 802Debug.Assert(emittedBody is null); 831Debug.Assert(synthesizedExplicitImpl.SynthesizesLoweredBoundBody); 857Debug.Assert(synthesizedAccessor.SynthesizesLoweredBoundBody); 963Debug.Assert(methodSymbol.IsImplicitlyDeclared); 968Debug.Assert(methodSymbol.IsImplicitlyDeclared); 1023Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || originalBodyNested); 1024Debug.Assert(!prependedDefaultValueTypeConstructorInitializer || methodSymbol.ContainingType.IsStructType()); 1082Debug.Assert(importChain == null); 1086Debug.Assert(processedInitializers.BoundInitializers.IsDefaultOrEmpty || processedInitializers.FirstImportChain != null); 1135Debug.Assert(rootSyntax == forSemanticModel.Syntax); 1196Debug.Assert(loweredBodyOpt != null); 1210Debug.Assert(!(methodSymbol.IsImplicitInstanceConstructor && methodSymbol.ParameterCount == 0) || 1253Debug.Assert(!instrumentation.Kinds.Contains(InstrumentationKind.TestCoverage)); 1272Debug.Assert(initializerCodeCoverageSpans.IsEmpty); 1277Debug.Assert(initializerStateMachineTypeOpt is null); 1278Debug.Assert(!hasErrors); 1382Debug.Assert(compilationState.ModuleBuilderOpt != null); 1472Debug.Assert((object)iteratorStateMachine == null || (object)asyncStateMachine == null); 1535Debug.Assert(kickoffMethod != null); 1610Debug.Assert(method.IsAsync || method.IsIterator); 1675Debug.Assert(index >= 0); 1773Debug.Assert(!sourceMethod.IsDefaultValueTypeConstructor()); 1809Debug.Assert(diagnostics.DiagnosticBag != null); 1845Debug.Assert(IsEmptyRewritePossible(methodBody)); 1846Debug.Assert(WasPropertyBackingFieldAccessChecked.FindUncheckedAccess(methodBody) is null); 1876Debug.Assert(constructor.Initializer is null); 1877Debug.Assert(constructor.Locals.IsEmpty); 1878Debug.Assert(BindImplicitConstructorInitializerIfAny(method, compilationState, BindingDiagnosticBag.Discarded) is null); 1886Debug.Assert(body != null); 2169Debug.Assert(false); 2338Debug.Assert(!method.ContainingType.IsDelegateType());
Compiler\SynthesizedMetadataCompiler.cs (2)
31Debug.Assert(moduleBeingBuilt != null); 46Debug.Assert(moduleBeingBuilt != null);
Compiler\TypeCompilationState.cs (1)
98Debug.Assert(_typeOpt is { });
Declarations\DeclarationTable.cs (1)
105Debug.Assert(compilation.Declarations == this);
Declarations\DeclarationTreeBuilder.cs (6)
128Debug.Assert( 241Debug.Assert(nameLocation.SourceTree is not null); 266Debug.Assert(_syntaxTree.Options.Kind != SourceCodeKind.Regular); 326Debug.Assert(parent.Kind() == SyntaxKind.CompilationUnit && _syntaxTree.Options.Kind != SourceCodeKind.Regular); 558Debug.Assert(node.Parent is CompilationUnitSyntax); 568Debug.Assert(node is NamespaceDeclarationSyntax);
Declarations\RootSingleNamespaceDeclaration.cs (1)
43Debug.Assert(!referenceDirectives.IsDefault);
Declarations\SingleTypeDeclaration.cs (1)
86Debug.Assert(kind != DeclarationKind.Namespace);
DocumentationComments\DocumentationCommentIDVisitor.PartVisitor.cs (2)
160Debug.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 (46)
61Debug.Assert(definition is PrivateImplementationDetails or Cci.IEmbeddedDefinition); 140Debug.Assert((object)symbol.ContainingAssembly != (object)_otherAssembly); 175Debug.Assert(symbol.IsDefinition); 260Debug.Assert(@namespace.IsGlobalNamespace); 318Debug.Assert(sourceType.IsDefinition); 333Debug.Assert((object)otherContainer == (object)_otherAssembly.GlobalNamespace); 339Debug.Assert((object)otherContainer == (object)_otherAssembly.GlobalNamespace); 468Debug.Assert((object)delegateSymbol.ContainingSymbol == (object)_sourceAssembly.GlobalNamespace); 476Debug.Assert((object)template.ContainingSymbol == (object)_sourceAssembly.GlobalNamespace); 484Debug.Assert(delegateTemplate.DelegateInvokeMethod != null); 494Debug.Assert(otherDelegateType is not null); 509Debug.Assert(type.Arity == otherType.Arity); 549Debug.Assert(!string.IsNullOrEmpty(sourceMember.MetadataName)); 569Debug.Assert(type.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 570Debug.Assert(other.ElementTypeWithAnnotations.CustomModifiers.IsEmpty); 578Debug.Assert(StringOrdinalComparer.Equals(@event.Name, other.Name)); 587Debug.Assert(StringOrdinalComparer.Equals(field.Name, other.Name)); 593Debug.Assert(StringOrdinalComparer.Equals(method.Name, other.Name)); 595Debug.Assert(method.IsDefinition); 596Debug.Assert(other.IsDefinition); 609Debug.Assert(method.IsDefinition); 623Debug.Assert(StringOrdinalComparer.Equals(type.MetadataName, other.MetadataName)); 626Debug.Assert(type.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 627Debug.Assert(other.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics.All(t => t.CustomModifiers.IsEmpty)); 634Debug.Assert(type.IsDefinition); 648Debug.Assert(StringOrdinalComparer.Equals(@namespace.MetadataName, other.MetadataName)); 654Debug.Assert(parameter.Ordinal == other.Ordinal); 664Debug.Assert(type.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 665Debug.Assert(other.PointedAtTypeWithAnnotations.CustomModifiers.IsEmpty); 696Debug.Assert(type.CustomModifiers.IsEmpty); 697Debug.Assert(verifyRefModifiers(refCustomModifiers, refKind, allowOut)); 701Debug.Assert(RefKind.RefReadOnly == RefKind.In); 715Debug.Assert(StringOrdinalComparer.Equals(property.MetadataName, other.MetadataName)); 726Debug.Assert(type.Ordinal == other.Ordinal); 727Debug.Assert(StringOrdinalComparer.Equals(type.Name, other.Name)); 731Debug.Assert(type.HasConstructorConstraint == other.HasConstructorConstraint); 732Debug.Assert(type.HasValueTypeConstraint == other.HasValueTypeConstraint); 733Debug.Assert(type.AllowsRefLikeType == other.AllowsRefLikeType); 734Debug.Assert(type.HasUnmanagedTypeConstraint == other.HasUnmanagedTypeConstraint); 735Debug.Assert(type.HasReferenceTypeConstraint == other.HasReferenceTypeConstraint); 736Debug.Assert(type.ConstraintTypesNoUseSiteDiagnostics.Length == other.ConstraintTypesNoUseSiteDiagnostics.Length); 742Debug.Assert(type.CustomModifiers.IsDefaultOrEmpty); 743Debug.Assert(other.CustomModifiers.IsDefaultOrEmpty); 817Debug.Assert(matcher != null); 892Debug.Assert(type.IsDefinition); 951Debug.Assert((object)translatedType != null);
Emitter\EditAndContinue\EmitHelpers.cs (1)
80Debug.Assert(baseline.PEModuleBuilder != null);
Emitter\EditAndContinue\PEDeltaAssemblyBuilder.cs (3)
83Debug.Assert(visited is not null); 252Debug.Assert(EmitOptions.InstrumentationKinds.IsEmpty); 275Debug.Assert(Compilation == template.DeclaringCompilation);
Emitter\Model\AssemblyReference.cs (1)
24Debug.Assert((object)assemblySymbol != null);
Emitter\Model\AttributeDataAdapter.cs (3)
30Debug.Assert(argument.Kind != TypedConstantKind.Error); 121Debug.Assert(!argument.Values.IsDefault); 145Debug.Assert(argument.ValueInternal != null);
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()); 95Debug.Assert(this.IsDefinitionOrDistinct()); 101Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 106Debug.Assert(((Cci.IMethodReference)this).AsSpecializedMethodReference != null); 115Debug.Assert(((Cci.IMethodReference)this).GetResolvedMethod(visitor.Context) != null); 161Debug.Assert(this.IsDefinitionOrDistinct()); 167Debug.Assert((object)AdaptedMethodSymbol.PartialDefinitionPart == null); // must be definition 192Debug.Assert(this.IsDefinitionOrDistinct()); 207Debug.Assert(AdaptedMethodSymbol.Parameters.All(p => p.IsDefinition)); 251Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 255Debug.Assert(arg.CustomModifiers.IsEmpty); 264Debug.Assert(((Cci.IMethodReference)this).AsGenericMethodInstanceReference != null); 287Debug.Assert(((Cci.IMethodReference)this).AsSpecializedMethodReference != null); 339Debug.Assert(@param.IsDefinition); 359Debug.Assert(AdaptedMethodSymbol.HasDeclarativeSecurity); 647Debug.Assert(this.MethodKind != MethodKind.Destructor);
Emitter\Model\ModuleReference.cs (2)
24Debug.Assert(moduleBeingBuilt != null); 25Debug.Assert((object)underlyingModule != null);
Emitter\Model\NamedTypeReference.cs (1)
22Debug.Assert((object)underlyingNamedType != null);
Emitter\Model\NamedTypeSymbolAdapter.cs (33)
63Debug.Assert(this.IsDefinitionOrDistinct()); 97Debug.Assert(this.IsDefinitionOrDistinct()); 118Debug.Assert(this.IsDefinitionOrDistinct()); 134Debug.Assert(this.IsDefinitionOrDistinct()); 168Debug.Assert(this.IsDefinitionOrDistinct()); 184Debug.Assert(this.IsDefinitionOrDistinct()); 189Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null && 207Debug.Assert(this.IsDefinitionOrDistinct()); 287Debug.Assert(((Cci.ITypeReference)this).AsTypeDefinition(context) != null); 293Debug.Assert((object)baseType == null); 328Debug.Assert((object)method.PartialDefinitionPart == null); // must be definition 389Debug.Assert(body.ContainingType == (object)container); 409Debug.Assert((object)method.PartialDefinitionPart == null); // must be definition 416Debug.Assert(!method.RequiresExplicitOverride(out _)); 431Debug.Assert((object)(f.TupleUnderlyingField ?? f) == f); 432Debug.Assert(!(f is TupleErrorFieldSymbol)); 483Debug.Assert(((Cci.ITypeReference)this).AsTypeDefinition(context) != null); 629Debug.Assert((object)method != null); 677Debug.Assert((object)property != null); 803Debug.Assert(((Cci.ITypeReference)this).AsNamespaceTypeReference != null); 813Debug.Assert(((Cci.ITypeReference)this).AsNamespaceTypeReference != null); 823Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType == null && AdaptedNamedTypeSymbol.ContainingModule is SourceModuleSymbol); 833Debug.Assert(((Cci.ITypeReference)this).AsNestedTypeReference != null); 835Debug.Assert(this.IsDefinitionOrDistinct()); 847Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null); 858Debug.Assert((object)AdaptedNamedTypeSymbol.ContainingType != null); 869Debug.Assert(((Cci.ITypeReference)this).AsGenericTypeInstanceReference != null); 890Debug.Assert(((Cci.ITypeReference)this).AsGenericTypeInstanceReference != null); 903Debug.Assert(((Cci.ITypeReference)this).AsSpecializedNestedTypeReference != null); 906Debug.Assert(result != null); 920Debug.Assert(this is not SynthesizedPrivateImplementationDetailsType); 960Debug.Assert(this.IsDefinition); 961Debug.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 (5)
77Debug.Assert(sourceAssembly is object); 562Debug.Assert(!allowUserDefinedAttribute || typeof(T) == typeof(NamedTypeSymbol)); 583Debug.Assert(symbol.Constructors.Length == description.Signatures.Length); 597Debug.Assert(userDefinedAttribute is null || (object)userDefinedAttribute.ContainingModule == _sourceAssembly.SourceModule); 598Debug.Assert(userDefinedAttribute?.IsErrorType() != true);
Emitter\Model\PEModuleBuilder.cs (50)
73Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 253Debug.Assert(methodDocumentList.Count == 0); 530Debug.Assert(Compilation == template.DeclaringCompilation); 538Debug.Assert(Compilation == template.DeclaringCompilation); 591Debug.Assert(symbol.IsDefinition); 645Debug.Assert(OutputKind.IsNetModule() == sourceAssembly.DeclaringCompilation.Options.OutputKind.IsNetModule()); 678Debug.Assert(type.IsDefinition); 713Debug.Assert(contender.ContainingAssembly == sourceAssembly); 816Debug.Assert(diagnostics != null); 961Debug.Assert(namedTypeSymbol.IsDefinitionOrDistinct()); 962Debug.Assert(diagnostics != null); 967Debug.Assert(!needDeclaration); 1000Debug.Assert(!needDeclaration); 1048Debug.Assert((object)container != null); 1067Debug.Assert(namedTypeSymbol.IsDefinition); 1140Debug.Assert(diagnostics != null); 1173Debug.Assert(fieldSymbol.IsDefinitionOrDistinct()); 1180Debug.Assert(!needDeclaration); 1215Debug.Assert(!methodSymbol.IsDefaultValueTypeConstructor()); 1216Debug.Assert(optArgList == null || (methodSymbol.IsVararg && !needDeclaration)); 1255Debug.Assert(!needDeclaration); 1259Debug.Assert(methodSymbol.IsDefinitionOrDistinct()); 1263Debug.Assert(!needDeclaration); 1264Debug.Assert(!(methodSymbol.OriginalDefinition is NativeIntegerMethodSymbol)); 1265Debug.Assert(!(methodSymbol.ConstructedFrom is NativeIntegerMethodSymbol)); 1295Debug.Assert(typeIsGeneric); 1349Debug.Assert(methodSymbol.IsDefinition); 1366Debug.Assert(@params.All(p => p.IsDefinitionOrDistinct())); 1570Debug.Assert(flagsBuilder.All(f => f <= 2)); 1639Debug.Assert((object)type != null); 1640Debug.Assert(type.ContainsNativeIntegerWrapperType()); 1652Debug.Assert(builder.Any()); 1653Debug.Assert(builder.Contains(true)); 1663Debug.Assert((object)booleanType != null); 1685Debug.Assert(scope != ScopedKind.None); 1686Debug.Assert(!ParameterHelpers.IsRefScopedByDefault(symbol) || scope == ScopedKind.ScopedValue); 1687Debug.Assert(!symbol.IsThis); 1760Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 1839Debug.Assert(methodAdapter.Name == methodName); 1844Debug.Assert(methodSymbol.Name == methodName); 1906Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 1924Debug.Assert(arrayLength > 0); 1933Debug.Assert(attributeConstructor is { }); 1940Debug.Assert(typeAdapter.Name == typeName); 1946Debug.Assert(syntaxNode is { }); 1947Debug.Assert(diagnostics is { }); 1961Debug.Assert(typeAdapter.Name == typeName); 1975Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 1992Debug.Assert(intType.SpecialType == SpecialType.System_Int32); 2008Debug.Assert(intType.SpecialType == SpecialType.System_Int32);
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 (4)
64Debug.Assert(this.IsDefinition); 67Debug.Assert(this.ContainingModule is SourceModuleSymbol || 88Debug.Assert(this.Kind != SymbolKind.Assembly); 95Debug.Assert(this.Kind != SymbolKind.Assembly);
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\EmbeddedParameter.cs (1)
28Debug.Assert(underlyingParameter.AdaptedParameterSymbol.IsDefinition);
Emitter\NoPia\EmbeddedType.cs (5)
33Debug.Assert(underlyingNamedType.AdaptedNamedTypeSymbol.IsDefinition); 34Debug.Assert(underlyingNamedType.AdaptedNamedTypeSymbol.IsTopLevelType()); 35Debug.Assert(!underlyingNamedType.AdaptedNamedTypeSymbol.IsGenericType); 40Debug.Assert(UnderlyingNamedType.AdaptedNamedTypeSymbol.IsInterfaceType()); 126Debug.Assert((object)TypeManager.ModuleBeingBuilt == context.Module);
Emitter\NoPia\EmbeddedTypeParameter.cs (1)
24Debug.Assert(underlyingTypeParameter.AdaptedTypeParameterSymbol.IsDefinition);
Emitter\NoPia\EmbeddedTypesManager.cs (11)
183Debug.Assert(guidString == null); 354Debug.Assert(namedType.IsDefinition); 371Debug.Assert(namedType.IsDefinition); 401Debug.Assert(namedType.TypeKind == TypeKind.Struct || namedType.TypeKind == TypeKind.Enum || namedType.TypeKind == TypeKind.Delegate); 437Debug.Assert(field.AdaptedSymbol.IsDefinition); 473Debug.Assert(method.AdaptedSymbol.IsDefinition); 474Debug.Assert(!method.AdaptedMethodSymbol.IsDefaultValueTypeConstructor()); 534Debug.Assert(property.AdaptedPropertySymbol.IsDefinition); 569Debug.Assert(@event.AdaptedSymbol.IsDefinition); 606Debug.Assert(member.AdaptedSymbol.IsDefinition); 637Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Errors\CSDiagnosticInfo.cs (1)
41Debug.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)
470Debug.Assert(RequiredFeature(feature) == null);
Errors\SyntaxDiagnosticInfo.cs (1)
19Debug.Assert(width >= 0);
FlowAnalysis\AbstractFlowPass.cs (39)
141Debug.Assert(newState != null); 191Debug.Assert(node != null); 200Debug.Assert(firstInRegion != null); 201Debug.Assert(lastInRegion != null); 273Debug.Assert(this.regionPlace == RegionPlace.Before); 290Debug.Assert(IsInside); 300Debug.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); 1518Debug.Assert(method?.OriginalDefinition.MethodKind != MethodKind.LocalFunction); 2197Debug.Assert(node.HasAnyErrors || (object)readMethod != (object)GetWriteMethod(property)); 2388Debug.Assert(!node.OperatorKind.IsUserDefined()); 2430Debug.Assert(!binOp.OperatorKind.IsUserDefined()); 2477Debug.Assert(isAnd || op == BinaryOperatorKind.Or); 2493Debug.Assert((object)binary == node); 2686Debug.Assert(node.InterpolatedStringHandlerData.HasValue); 2725Debug.Assert(shortCircuitState != null || (!usesBoolReturns && !firstPartIsConditional)); 2749Debug.Assert(shortCircuitState != null); 2813Debug.Assert(node.HasAnyErrors || (object)readMethod != (object)writeMethod); 2909Debug.Assert(!IsConditionalState); 2945Debug.Assert(!IsConditionalState); 2990Debug.Assert(!IsConditionalState); 3016Debug.Assert(method is object); 3017Debug.Assert(method.ParameterCount is 1); 3089Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion)); 3100Debug.Assert(expr is BoundExpression); 3224Debug.Assert(!this.IsConditionalState); 3232Debug.Assert(!this.IsConditionalState); 3335Debug.Assert(!this.IsConditionalState); 3432Debug.Assert(!this.IsConditionalState); 3547Debug.Assert(this.IsConditionalState);
FlowAnalysis\AlwaysAssignedWalker.cs (1)
51Debug.Assert(!IsInside);
FlowAnalysis\ControlFlowPass.cs (3)
84Debug.Assert(!self.Alive || !self.Reported); 93Debug.Assert(!self.Alive || !self.Reported); 167Debug.Assert(!badRegion);
FlowAnalysis\DefiniteAssignment.cs (27)
244Debug.Assert(member is TypeSymbol type && 248Debug.Assert((object)member.ContainingAssembly == compilation?.SourceAssembly); 457Debug.Assert(node != null || location != null); 471Debug.Assert(thisSlot > 0); 532Debug.Assert(!parameter.IsThis); 549Debug.Assert(diagnostics != null); 563Debug.Assert(unused.IsDefault); 642Debug.Assert(walker.TrackImplicitlyInitializedFields); 652Debug.Assert(!badRegion); 663Debug.Assert(strictAnalysis || implicitlyInitializedFieldsOpt.IsDefault); 692Debug.Assert(captured.Kind == SymbolKind.Parameter || captured.Kind == SymbolKind.Local || captured.Kind == SymbolKind.RangeVariable); 785Debug.Assert(fieldOrEventAccess.Kind == BoundKind.FieldAccess || fieldOrEventAccess.Kind == BoundKind.EventAccess); 1153Debug.Assert(!IsConditionalState); 1258Debug.Assert(CurrentSymbol is MethodSymbol { MethodKind: MethodKind.Constructor, ContainingType.TypeKind: TypeKind.Struct }); 1290Debug.Assert(foundUnassignedField); 1472Debug.Assert(unassignedSlot > 0); 1535Debug.Assert(!IsConditionalState); 1560Debug.Assert(local.InitializerOpt == value || value == null); 1689Debug.Assert(containingSlot != -1); 1690Debug.Assert(!state.IsAssigned(containingSlot)); 1729Debug.Assert(!_emptyStructTypeCache.IsEmptyStructType(type)); 1765Debug.Assert(!_emptyStructTypeCache.IsEmptyStructType(type)); 1934Debug.Assert(!this.IsConditionalState); 2265Debug.Assert(_usedVariables.Contains(local)); 2767Debug.Assert((object)iterationVariable != null); 2897Debug.Assert(!other.Reachable); 2916Debug.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)
54Debug.Assert(compilation != null || !dev12CompilerCompatibility); 104Debug.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)))); 112Debug.Assert(!implicitlyInitializedFields.IsEmpty); 113Debug.Assert(method.MethodKind == MethodKind.Constructor); 115Debug.Assert(containingType.IsStructType()); 125Debug.Assert(elementField == implicitlyInitializedFields.Single()); 189Debug.Assert(body != null); 190Debug.Assert(method != null); 194Debug.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.cs (287)
63Debug.Assert(variables.Id == variableNullableStates.Id); 130Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything)); 147Debug.Assert(!StateForLambda.HasValue); 344Debug.Assert(TypeAllowsConditionalState(visitResult.RValueType.Type) 442Debug.Assert(_targetTypedAnalysisCompletionOpt is null or { Count: 0 }); 465Debug.Assert(!TrackingRegions); 466Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethodOpt is object); 467Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor }); 539Debug.Assert(AreCloseEnough(placeholder.Type, result.RValueType.Type)); 540Debug.Assert(expression != null || placeholder.Kind == BoundKind.InterpolatedStringArgumentPlaceholder); 549Debug.Assert(_resultForPlaceholdersOpt is { }); 551Debug.Assert(removed); 557Debug.Assert(placeholder is { }); 635Debug.Assert(_useConstructorExitWarnings); 640Debug.Assert(thisParameter is object); 980Debug.Assert(requiredMember.IsRequired()); 1439Debug.Assert(node.SyntaxTree is object); 1484Debug.Assert(method.IsConstructor()); 1798Debug.Assert(diagnostics != null); 1820Debug.Assert(!walker.IsConditionalState); 1838Debug.Assert(snapshotBuilderOpt is null || symbol is object); 1845Debug.Assert(walker._variables.Id == initialState.Value.Id); 1851Debug.Assert(!badRegion); 1872Debug.Assert(result.RequiredAnalysis == requiredAnalysis); 1888Debug.Assert(!IsConditionalState); 1911Debug.Assert(node is object); 1961Debug.Assert(slot > 0); 2050Debug.Assert(member?.RequiresInstanceReceiver() ?? true); 2069Debug.Assert(node.HasErrors || 2189Debug.Assert(containingSlot == 0); 2586Debug.Assert(!IsConditionalState); 2640Debug.Assert(ErrorFacts.NullableWarnings.Contains(MessageProvider.Instance.GetIdForErrorCode((int)errorCode))); 2649Debug.Assert(targetSlot > 0); 2650Debug.Assert(EmptyStructTypeCache.IsTrackableStructType(targetType)); 2684Debug.Assert(targetContainerSlot > 0); 2685Debug.Assert(skipSlot > 0); 2750Debug.Assert(slot > 0); 2771Debug.Assert(targetSlot > 0); 2775Debug.Assert(actualType is { }); 2783Debug.Assert(conversion.Kind is ConversionKind.Identity or ConversionKind.ImplicitReference); 2804Debug.Assert(targetSlot > 0); 2805Debug.Assert(valueSlot > 0); 2887Debug.Assert(!IsConditionalState); 2941Debug.Assert(!IsConditionalState); 3046Debug.Assert((object)returnType != LambdaSymbol.ReturnTypeIsBeingInferred); 3096Debug.Assert(node.Type.IsErrorType() || type.Type.IsErrorType()); 3128Debug.Assert(!TrackingRegions); 3195Debug.Assert(newBodiesVisited); 3285Debug.Assert((object?)variables.Container == container); 3297Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethod is object); 3298Debug.Assert(!useDelegateInvokeReturnType || delegateInvokeMethod is object); 3420Debug.Assert(!IsConditionalState); 3446Debug.Assert(!IsConditionalState); 3535Debug.Assert(!IsConditionalState); 3570Debug.Assert(type.Type.IsErrorType()); 3589Debug.Assert(node is BoundExpression or BoundPattern); 3590Debug.Assert(!IsConditionalState); 3607Debug.Assert((object?)resultType.Type != _invalidType.Type); 3608Debug.Assert(AreCloseEnough(resultType.Type, node.Type)); 3706Debug.Assert(!_completingTargetTypedExpression); 3766Debug.Assert(node.Placeholder is { }); 3781Debug.Assert(completion is not null); 3797Debug.Assert(completion is not null); 3830Debug.Assert(TypeSymbol.Equals(strippedTargetCollectionType, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 3892Debug.Assert(node.ExpressionPlaceholder is { }); 3893Debug.Assert(node.EnumeratorInfoOpt is { }); 3906Debug.Assert(node.HasErrors); 3907Debug.Assert(node.Conversion is null); 3908Debug.Assert(node.EnumeratorInfoOpt is null); 3916Debug.Assert(!IsConditionalState); 3926Debug.Assert(isTargetTyped == argumentsCompletion is not null); 3957Debug.Assert(argumentsCompletion is not null); 3958Debug.Assert(initialStateInferenceCompletion is not null); 3963Debug.Assert(argumentsCompletion is null); 3964Debug.Assert(initialStateInferenceCompletion is null); 3965Debug.Assert(initializerCompletion is null); 3981Debug.Assert(resultState == NullableFlowState.NotNull); 3986Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4024Debug.Assert(node.Kind is BoundKind.ObjectCreationExpression or BoundKind.DynamicObjectCreationExpression or BoundKind.NewT or BoundKind.NoPiaObjectCreationExpression); 4093Debug.Assert(completion is null); 4094Debug.Assert(resultState == NullableFlowState.NotNull); 4106Debug.Assert(!delayCompletionForType || containingSlot == -1); 4156Debug.Assert(!delayCompletionForType || containingSlot == -1); 4224Debug.Assert(argumentsCompletion is null); 4225Debug.Assert(initializationCompletion is null); 4244Debug.Assert(initializationCompletion is null || symbol is not null); 4250Debug.Assert(result is null); 4260Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, symbol.GetTypeOrReturnType().Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4275Debug.Assert(!delayCompletionForType || slot == -1); 4291Debug.Assert(nestedCompletion is null); 4316Debug.Assert(!delayCompletionForType || conversionCompletion is null); 4323Debug.Assert(symbol.GetTypeOrReturnType().HasType); 4335Debug.Assert(conversionCompletion is not null); 4339Debug.Assert(conversionCompletion is null); 4352Debug.Assert(result is null); 4391Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4392Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4408Debug.Assert(visitArgumentsCompletion is not null); 4412Debug.Assert(visitArgumentsCompletion is null); 4413Debug.Assert(reinferredMethod is object); 4416Debug.Assert(node.ImplicitReceiverOpt.Kind == BoundKind.ObjectOrCollectionValuePlaceholder); 4449Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4450Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 4526Debug.Assert(node.Type is object); 4544Debug.Assert((object)placeholder != null); 4550Debug.Assert(!IsConditionalState); 4551Debug.Assert(node.Type.IsAnonymousType); 4728Debug.Assert(namedType.Name == "Span"); 4729Debug.Assert(namedType.OriginalDefinition.Arity == 1); 4735Debug.Assert(namedType.Name == "Span"); 4736Debug.Assert(namedType.OriginalDefinition.Arity == 1); 4844Debug.Assert(!IsConditionalState); 4848Debug.Assert(!IsConditionalState); 4849Debug.Assert(!node.Expression.Type!.IsValueType); 4878Debug.Assert(!IsConditionalState); 4882Debug.Assert(!IsConditionalState); 4883Debug.Assert(expressionType is not null); 4884Debug.Assert(expressionType.IsValueType); 4958Debug.Assert(!IsConditionalState); 5116Debug.Assert(binary.Type.SpecialType == SpecialType.System_Boolean); 5149Debug.Assert(!IsConditionalState); 5220Debug.Assert(operand == expr); 5238Debug.Assert(!IsConditionalState); 5242Debug.Assert(binary.Type!.SpecialType == SpecialType.System_Boolean); 5275Debug.Assert(!IsConditionalState); 5376Debug.Assert(operand != null); 5624Debug.Assert(targetType.Type.ContainsErrorType() || 5636Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions)); 5647Debug.Assert(!IsConditionalState); 5698Debug.Assert(rightType is object); 5705Debug.Assert(!conversion.IsUserDefined); 5710Debug.Assert(!conversion.IsUserDefined); 5733Debug.Assert(conversionResult.Type is not null); 5762Debug.Assert(targetType.HasType); 5774Debug.Assert(!IsConditionalState); 5812Debug.Assert(!IsConditionalState); 5857Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion)); 5869Debug.Assert(expr is BoundExpression); 5879Debug.Assert(expr is BoundExpression); 6040Debug.Assert(!wasTargetTyped); 6047Debug.Assert(node is BoundUnconvertedConditionalOperator); 6048Debug.Assert(_returnTypesOpt is not null || _disableDiagnostics); 6140Debug.Assert(!isRef); 6152Debug.Assert(isRef); 6283Debug.Assert(node.InvokedAsExtensionMethod); 6317Debug.Assert(node.ReceiverOpt is null); 6391Debug.Assert(arguments.Length == 2); 6402Debug.Assert(arguments.Length == 1); 6491Debug.Assert(baseType is object); 6563Debug.Assert(!compareExchangeInfo.IsDefault); 6585Debug.Assert(argsToParamsOpt is { IsDefault: true } or { Length: 3 }); 6819Debug.Assert(result.completion is null); 6840Debug.Assert(!arguments.IsDefault); 6841Debug.Assert(!expanded || !parametersOpt.IsDefault); 6842Debug.Assert(refKindsOpt.IsDefaultOrEmpty || refKindsOpt.Length == arguments.Length); 6843Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Length); 6851Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection)); 6934Debug.Assert(method is ErrorMethodSymbol); 7053Debug.Assert(result.completion is null); 7065Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) <= 1); 7072Debug.Assert(parametersOpt.IsDefault || arguments.Length == parametersOpt.Length); 7100Debug.Assert(defaultArguments.IsNull || elements.Length == 1); 7101Debug.Assert(elements.Length == 1 || a == arguments.Length - 1); 7204Debug.Assert(receiverSlot >= 0); 7287Debug.Assert(!IsConditionalState); 7351Debug.Assert(!IsConditionalState); 7399Debug.Assert(!IsConditionalState); 7418Debug.Assert(!this.IsConditionalState); 7435Debug.Assert(argumentResultType is not null); 7491Debug.Assert(!this.IsConditionalState); 7676Debug.Assert(!IsConditionalState); 7681Debug.Assert(!IsConditionalState); 7841Debug.Assert(variables.Id == localState.Id); 7860Debug.Assert(!expanded); 7870Debug.Assert(paramsIterationType.HasType); 7886Debug.Assert(method.IsGenericMethod); 7972Debug.Assert(false); // unexpected value 8011Debug.Assert(lambdaState.HasValue); 8024Debug.Assert(collectionExpressionVisitResults is not null); 8025Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length); 8121Debug.Assert(group != null || !conversion.ExplicitCastInCode); // Explicit conversions should include a group. 8234Debug.Assert((object)symbol != null); 8268Debug.Assert(symbol.ContainingType.IsDefinition); 8304Debug.Assert(false); // If this assert fails, add an appropriate test. 8334Debug.Assert(targetType.HasType); 8379Debug.Assert(completion is null); 8410Debug.Assert(targetTypeOpt.HasType); 8439Debug.Assert(result.completion is null); 8469Debug.Assert(!IsConditionalState); 8505Debug.Assert(diagnostics.DiagnosticBag is { }); 8531Debug.Assert(tupleType.IsTupleType); 8532Debug.Assert(values.Length == types.Length); 8533Debug.Assert(values.Length == (useRestField ? Math.Min(tupleType.TupleElements.Length, NamedTypeSymbol.ValueTupleRestPosition) : tupleType.TupleElements.Length)); 8566Debug.Assert(index != -1); 8573Debug.Assert(containingType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T); 8574Debug.Assert(containingSlot > 0); 8575Debug.Assert(valueSlot > 0); 8596Debug.Assert(conversion.Kind == ConversionKind.ImplicitTuple || conversion.Kind == ConversionKind.ExplicitTuple); 8597Debug.Assert(slot > 0); 8598Debug.Assert(valueSlot > 0); 8700Debug.Assert(diagnostics.DiagnosticBag is { }); 8756Debug.Assert(diagnostics.DiagnosticBag is { }); 8811Debug.Assert(conversionOpt is null 8858Debug.Assert(!trackMembers || !IsConditionalState); 8859Debug.Assert(conversionOperand != null); 8885Debug.Assert(conversionOpt is null); 9053Debug.Assert(conversionOperand != null); 9061Debug.Assert(containingSlot > 0); 9100Debug.Assert(conversionOperand != null); 9156Debug.Assert(targetType.IsValueType || targetType.IsErrorType()); 9259Debug.Assert(dependsOn); // If this case fails, add a corresponding test. 9332Debug.Assert(handlerData.ArgumentPlaceholders.IsEmpty 9405Debug.Assert(conversionOperand != null); 9406Debug.Assert(targetTypeWithNullability.HasType); 9407Debug.Assert(diagnosticLocation != null); 9408Debug.Assert(conversion.Kind == ConversionKind.ExplicitUserDefined || conversion.Kind == ConversionKind.ImplicitUserDefined); 9440Debug.Assert(method is object); 9441Debug.Assert(method.ParameterCount == 1); 9442Debug.Assert(operandType.Type is object); 9549Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup); 9561Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup); 9622Debug.Assert(operandType.Type is object); 9623Debug.Assert(diagnosticLocation != null); 9656Debug.Assert(node.Type.IsDelegateType()); 9703Debug.Assert(analysisCompletion is null); 9715Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 9792Debug.Assert(arg.Type is not null); 9811Debug.Assert(arg.Type is not null); 9832Debug.Assert(!IsConditionalState); 9894Debug.Assert(_binder is object); 9929Debug.Assert(delegateTypeOpt?.IsDelegateType() != false); 9997Debug.Assert(!IsConditionalState); 10088Debug.Assert(expr is not BoundObjectInitializerMember); 10197Debug.Assert(conversion.Kind == ConversionKind.Deconstruction); 10225Debug.Assert(invocation is object); 10226Debug.Assert(rightResult.Type is object); 10262Debug.Assert(parameters.Length - offset == n); 10311Debug.Assert(rightParts.Length == n); 10478Debug.Assert(!IsConditionalState); 10632Debug.Assert(MakeSlot(node) == -1); 10821Debug.Assert(!IsConditionalState); 10852Debug.Assert(!IsConditionalState); 10889Debug.Assert(containingType.IsNullableType()); 10890Debug.Assert(TypeSymbol.Equals(NominalSlotType(containingSlot), containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 10902Debug.Assert(node.HasErrors); 10954Debug.Assert(resultType is object); 11001Debug.Assert(!foundMultiple); 11002Debug.Assert(targetTypeWithAnnotations.HasType); 11063Debug.Assert(wellKnownSpan is WellKnownType.System_Span_T or WellKnownType.System_ReadOnlySpan_T); 11109Debug.Assert(disposalPlaceholder is not null); 11287Debug.Assert(!IsConditionalState); 11418Debug.Assert(!IsConditionalState); 11428Debug.Assert(!((BoundBinaryOperator)node).OperatorKind.IsUserDefined()); 11448Debug.Assert(trueFalseOperator is null || logicalOperator is object); 11449Debug.Assert(logicalOperator is null || left is object); 11490Debug.Assert(placeholder is object); 11547Debug.Assert(!this.IsConditionalState); 11567Debug.Assert(!this.IsConditionalState); 11586Debug.Assert(node.Type.SpecialType == SpecialType.System_Boolean); 11638Debug.Assert(node.Type.SpecialType == SpecialType.System_RuntimeArgumentHandle); 11646Debug.Assert(node.Type is null); 11653Debug.Assert(!IsConditionalState); 11661Debug.Assert(!IsConditionalState); 11670Debug.Assert(node.WasCompilerGenerated); 11678Debug.Assert(node.WasCompilerGenerated); 11717Debug.Assert(node.Type.IsDynamic()); 11736Debug.Assert(node.Type.IsDynamic()); 11737Debug.Assert(node.Type.IsReferenceType); 11747Debug.Assert(!IsConditionalState); 11843Debug.Assert(node.Type.IsDynamic()); 11856Debug.Assert(!this.IsConditionalState); 11866Debug.Assert(receiverOpt.Type is null || AreCloseEnough(receiverOpt.Type, resultTypeSymbol)); 11987Debug.Assert(node.Type is null || node.Type.IsErrorType() || node.Type.IsRefLikeType); 12007Debug.Assert(node.Type is not null); 12166Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull }); 12237Debug.Assert(!otherIsConditional); 12374Debug.Assert(Id == variables.Container!.Id); 12433Debug.Assert(state.Id > id); 12447Debug.Assert(Id < variables.Id); 12493Debug.Assert(Id > id); 12506Debug.Assert(index < Capacity); 12508Debug.Assert((_state[index], _state[index + 1]) != (false, false)); 12525Debug.Assert(Id > id); 12580Debug.Assert(Id == other.Id); 12587Debug.Assert(_state.Capacity == other._state.Capacity); 12609Debug.Assert(Id == other.Id); 12616Debug.Assert(_state.Capacity == other._state.Capacity);
FlowAnalysis\NullableWalker.PlaceholderLocal.cs (2)
30Debug.Assert(identifier != null); 31Debug.Assert(containingSymbol is null || containingSymbol.DeclaringCompilation is not null);
FlowAnalysis\NullableWalker.SnapshotManager.cs (4)
42Debug.Assert(!incrementalSnapshots.IsDefaultOrEmpty); 47Debug.Assert(currentPosition > previousPosition); 173Debug.Assert(_symbolToSlot.Count > 0); 223Debug.Assert(AreCloseEnough(originalSymbol, updatedSymbol));
FlowAnalysis\NullableWalker.Variables.cs (15)
164Debug.Assert(_variableSlot.Count == 0); 165Debug.Assert(_variableTypes.Count == 0); 185Debug.Assert(id >= 0); 186Debug.Assert(id <= IdMask); 187Debug.Assert(container is null || container.Id < id); 216Debug.Assert(GetVariablesForMethodScope(method) is null); 217Debug.Assert(!(method.ContainingSymbol is MethodSymbol containingMethod) || 262Debug.Assert(slot <= 0 || 290Debug.Assert(id == Id); 306Debug.Assert((object)variables == this); 416Debug.Assert(id >= 0); 417Debug.Assert(id <= IdMask); 418Debug.Assert(index >= 0); 419Debug.Assert(index <= IndexMask); 426Debug.Assert(slot > -1);
FlowAnalysis\NullableWalker_Patterns.cs (32)
36Debug.Assert(!IsConditionalState); 129Debug.Assert(current.Left is not BoundBinaryPattern); 396Debug.Assert(originalInputSlot > 0); 410Debug.Assert(isDerivedType(NominalSlotType(originalInputSlot), expressionTypeWithState.Type)); 421Debug.Assert(found); // the topologically sorted nodes should contain only reachable nodes 438Debug.Assert(inputSlot > 0); 454Debug.Assert(outputSlot > 0); 479Debug.Assert(!IsConditionalState); 487Debug.Assert(inputSlot > 0); 518Debug.Assert(originalInputMap[outputSlot] == ((BoundTupleExpression)expression).Arguments[originalTupleElement.TupleElementIndex]); 527Debug.Assert(outputSlot > 0); 533Debug.Assert(inputSlot > 0); 542Debug.Assert(outputSlot > 0); 559Debug.Assert(inputSlot > 0); 563Debug.Assert(outputSlot > 0); 571Debug.Assert(inputSlot > 0); 575Debug.Assert(outputSlot > 0); 592Debug.Assert(foundTemp); 631Debug.Assert(t.Value != ConstantValue.Null); 708Debug.Assert(this.IsConditionalState); 714Debug.Assert(w.WhenFalse is null); 743Debug.Assert(slot > 0); 747Debug.Assert(outputSlotAndType.slot == slot); 748Debug.Assert(isDerivedType(outputSlotAndType.type, type)); 752Debug.Assert(NominalSlotType(slot) is var slotType && (slotType.IsErrorType() || isDerivedType(slotType, type))); 779Debug.Assert(false); 784Debug.Assert(false); 789Debug.Assert(false); 813Debug.Assert(false); 842Debug.Assert(outputSlot > 0); 966Debug.Assert((node is BoundUnconvertedSwitchExpression && (_returnTypesOpt is not null || _disableDiagnostics)) 1055Debug.Assert(!IsConditionalState);
FlowAnalysis\ReadWriteWalker.cs (1)
90Debug.Assert(!ignoreThisParameter || m is SynthesizedPrimaryConstructor);
FlowAnalysis\UnassignedAddressTakenVariablesWalker.cs (1)
30Debug.Assert(!badRegion);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (16)
40Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 116Debug.Assert(containingSymbol != null); 117Debug.Assert((object)containingType != null); 118Debug.Assert(statement != null); 119Debug.Assert(compilationState != null); 120Debug.Assert(diagnostics != null); 140Debug.Assert(SyntaxBindingUtilities.BindsToTryStatement(tryStatementSyntax)); 170Debug.Assert(asTry.FinallyBlockOpt == null); 543Debug.Assert(!_inCatchWithoutAwaits); 548Debug.Assert(node.Syntax.IsKind(SyntaxKind.CatchClause)); 578Debug.Assert(filterPrologueOpt is null); 939Debug.Assert(parent != null); 940Debug.Assert(syntax != null); 942Debug.Assert(SyntaxBindingUtilities.BindsToTryStatement(syntax)); 1007Debug.Assert(_syntaxOpt != null); 1067Debug.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 (5)
288Debug.Assert(!CurrentMethod.IsIterator); // an override handles async-iterators 371Debug.Assert(node.Syntax.IsKind(SyntaxKind.AwaitExpression) || node.WasCompilerGenerated); 423Debug.Assert(receiver != null); 431Debug.Assert(methodName != null); 660Debug.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); 384Debug.Assert(!_asyncMethodBuilderMemberCollection.CheckGenericMethodConstraints);
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
51Debug.Assert(compilationState.ModuleBuilderOpt != null);
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (6)
83Debug.Assert(scopeTree != null); 180Debug.Assert(!oldEnv.IsStruct); 181Debug.Assert(oldEnv.Parent == null || oldEnv.Parent == env); 342Debug.Assert(scope.DeclaredEnvironment is null); 383Debug.Assert(environmentsToScopes.ContainsKey(env)); 529Debug.Assert(syntax != null);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (17)
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); 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 (39)
202Debug.Assert(localOrParameter is LocalSymbol || localOrParameter is ParameterSymbol || 241Debug.Assert(thisType is not null); 242Debug.Assert(thisParameter is null || TypeSymbol.Equals(thisParameter.Type, thisType, TypeCompareKind.ConsiderEverything2)); 243Debug.Assert(compilationState.ModuleBuilderOpt != null); 244Debug.Assert(diagnostics.DiagnosticBag != null); 307Debug.Assert(_addedStatements == null); 344Debug.Assert(!_frames.ContainsKey(scope.BoundNode)); 368Debug.Assert(syntax != null); 390Debug.Assert(!proxies.ContainsKey(captured)); 457Debug.Assert((object)translatedLambdaContainer != _topLevelMethod.ContainingType || 580Debug.Assert(TypeSymbol.Equals(result.Type, frameType, TypeCompareKind.ConsiderEverything2)); 594Debug.Assert(frameClass.IsDefinition); 665Debug.Assert(frame.ScopeSyntaxOpt != null); 677Debug.Assert(TypeSymbol.Equals(frameType, constructor.ContainingType, TypeCompareKind.ConsiderEverything2)); 700Debug.Assert(capturedFrame.Type.IsReferenceType); // Make sure we're not accidentally capturing a struct by value 804Debug.Assert(_thisProxyInitDeferred == null); 809Debug.Assert(_currentMethod is not SynthesizedPrimaryConstructor primaryConstructor || 876Debug.Assert(localFunc.MethodKind == MethodKind.LocalFunction); 886Debug.Assert(!arguments.IsDefault); 899Debug.Assert(frameType is SynthesizedClosureEnvironment); 904Debug.Assert(typeParameters.Length == frameType.Arity); 962Debug.Assert(!typeArguments.IsDefault); 998Debug.Assert((object)oldTypeArg.Type == newTypeArg.Type); 1002Debug.Assert(oldTypeArg.NullableAnnotation == newTypeArg.NullableAnnotation); 1023Debug.Assert((typeArgumentsOpt.IsDefault && !originalMethod.IsGenericMethod) || (typeArgumentsOpt.Length == originalMethod.Arity)); 1049Debug.Assert(realTypeArguments.Length == 0); 1200Debug.Assert(!node.Locals.IsEmpty); 1256Debug.Assert(rewrittenFilter != null); 1366Debug.Assert(node.TargetMethod is { RequiresInstanceReceiver: false, IsStatic: true }); 1378Debug.Assert(arguments.IsDefault && 1392Debug.Assert(_inExpressionLambda || conversion.Conversion.MethodSymbol is null); 1394Debug.Assert(conversion.ConversionKind != ConversionKind.MethodGroup); 1441Debug.Assert(syntax != null); 1442Debug.Assert(CompilationState.ModuleBuilderOpt != null); 1443Debug.Assert(closureOrdinal >= LambdaDebugInfo.MinClosureOrdinal); 1472Debug.Assert(closureKind == ClosureKind.Singleton); 1481Debug.Assert(!isLambdaBody || LambdaUtilities.IsLambdaBody(lambdaOrLambdaBodySyntax)); 1522Debug.Assert(synthesizedMethod != null); 1541Debug.Assert(tmpScope != null);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (8)
133Debug.Assert(block.Locals.IsEmpty); 273Debug.Assert(saveRecursionDepth == _recursionDepth); 370Debug.Assert(node.OperandPlaceholder is null); 371Debug.Assert(node.OperandConversion is null); 879Debug.Assert(node.LeftPlaceholder is not null); 954Debug.Assert((object)sym != null); 999Debug.Assert(ci.Initializers.Length != 0); 1187Debug.Assert((object)node.MethodOpt == null);
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); 181Debug.Assert(parameter is { IsThis: false });
Lowering\ClosureConversion\SynthesizedClosureEnvironment.cs (1)
86Debug.Assert(methodId.Ordinal >= 0);
Lowering\ClosureConversion\SynthesizedClosureMethod.cs (2)
45Debug.Assert(containingType.DeclaringCompilation is not null); 110Debug.Assert(!(originalMethod is LocalFunctionSymbol) || !originalMethod.IsStatic || IsStatic);
Lowering\DiagnosticsPass_ExpressionTrees.cs (8)
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); 313Debug.Assert((object)method != null); 314Debug.Assert(((object)propertyAccess == null) || 876Debug.Assert(!(!parentIsConversion && _inExpressionLambda));
Lowering\DiagnosticsPass_Warnings.cs (12)
25Debug.Assert(arguments.Length == argumentRefKindsOpt.Length); 228Debug.Assert(TypeSymbol.Equals(expr1.Type, expr2.Type, TypeCompareKind.ConsiderEverything2)); 306Debug.Assert(node != null); 383Debug.Assert(node != null); 384Debug.Assert(node.OperatorKind.IsComparison()); 394Debug.Assert(tree != null); 395Debug.Assert(constantValue != null); 396Debug.Assert(operand != null); 720Debug.Assert(node != null); 735Debug.Assert(node != null); 782Debug.Assert(node != null); 912Debug.Assert(length == rightTuple.Arguments.Length);
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.cs (7)
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 }); 481Debug.Assert(filterClause is not null);
Lowering\Instrumentation\DebugInfoInjector_SequencePoints.cs (8)
30Debug.Assert(declarationSyntax.Initializer != null); 55Debug.Assert(startFallbackOpt != default || endOpt != default); 89Debug.Assert(declaratorSyntax.Parent != null); 91Debug.Assert(declarationSyntax.Parent != null); 109Debug.Assert(!modifiers.Any(SyntaxKind.ConstKeyword)); // const locals don't have a sequence point 144Debug.Assert(declaratorSyntax.Parent != null); 148Debug.Assert(declarationSyntax.Parent != null); 173Debug.Assert(condition.Type 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 (12)
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); 358Debug.Assert(original.Left is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.UserDefined } or BoundParameter); 421Debug.Assert(!parameterSymbol.IsDiscard); 448Debug.Assert(parameter.RefKind == RefKind.None); 453Debug.Assert(!parameter.Type.IsManagedTypeNoUseSiteDiagnostics); 475Debug.Assert(targetType.IsStructType()); 554Debug.Assert(refKinds.IsDefault || arguments.Length == refKinds.Length); 555Debug.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 (2)
391Debug.Assert(!frame.IsRoot()); 409Debug.Assert(frame.parent.finalizeState == _currentFinallyFrame.finalizeState);
Lowering\IteratorRewriter\IteratorRewriter.cs (2)
175Debug.Assert(F.ModuleBuilderOpt is not null); 277Debug.Assert(stateMachineType.Constructor is IteratorConstructor);
Lowering\LocalRewriter\DelegateCacheContainer.cs (6)
24Debug.Assert(containingType.IsDefinition); 33Debug.Assert(ownerMethod.IsDefinition); 34Debug.Assert(ownerMethod.Arity > 0); 59Debug.Assert(delegateType.IsDelegateType()); 60Debug.Assert(targetMethod is { }); 77Debug.Assert(_constructedContainer is { });
Lowering\LocalRewriter\DelegateCacheRewriter.cs (7)
29Debug.Assert(factory.TopLevelMethod is { }); 39Debug.Assert(targetMethod is { }); 46Debug.Assert(boundDelegateCreation.MethodOpt is { }); 64Debug.Assert(_factory.ModuleBuilderOpt is { }); 65Debug.Assert(_factory.CurrentFunction is { }); 127Debug.Assert(targetMethod is { }); 161Debug.Assert(targetMethod.MethodKind == MethodKind.Ordinary);
Lowering\LocalRewriter\DynamicSiteContainer.cs (1)
20Debug.Assert(topLevelMethod != null);
Lowering\LocalRewriter\LocalRewriter.cs (32)
66Debug.Assert(factory.InstrumentationState != null); 72Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2)); 101Debug.Assert(statement != null); 102Debug.Assert(compilationState != null); 147Debug.Assert(loweredStatement is { }); 248Debug.Assert(!nameofOperator.WasCompilerGenerated); 280Debug.Assert(visited == null || visited.HasErrors || ReferenceEquals(visited.Type, node.Type) || 317Debug.Assert(CanBePassedByReference(node)); 319Debug.Assert(CanBePassedByReference(result)); 328Debug.Assert(_factory.ModuleBuilderOpt is { }); 503Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { }); 512Debug.Assert(value.Type is { } && (value.Type.Equals(placeholder.Type, TypeCompareKind.AllIgnoreOptions) || value.HasErrors)); 521Debug.Assert(_placeholderReplacementMapDoNotUseDirectly.Count == 0); 549Debug.Assert(placeholder is { }); 550Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { }); 553Debug.Assert(removed); 577Debug.Assert(node.Type is { }); 598Debug.Assert((syntax != null) ^ (location != null)); 648Debug.Assert(node.Type.ExtendedSpecialType == InternalSpecialType.System_Type || 650Debug.Assert(node.GetTypeFromHandle is null); 653Debug.Assert(sourceType is { }); 674Debug.Assert(getTypeFromHandle is not null); 675Debug.Assert(TypeSymbol.Equals(type, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions)); 681Debug.Assert(node.GetTypeFromHandle is null); 714Debug.Assert(statement is { }); 843Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array }); 873Debug.Assert(parent.Parent is { }); 922Debug.Assert(assignment.Left.Kind == BoundKind.FieldAccess); 1059Debug.Assert(eventAccess.ReceiverOpt is { }); 1060Debug.Assert(eventAccess.ReceiverOpt.Type is { }); 1070Debug.Assert(fieldAccess.ReceiverOpt is { }); 1071Debug.Assert(fieldAccess.ReceiverOpt.Type is { });
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (21)
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); 1068Debug.Assert(found); 1089Debug.Assert(whenNodes.All(n => n.Syntax == whenClauseSyntax)); 1090Debug.Assert(whenNodes.All(n => n.WhenExpression == whenExpression)); 1091Debug.Assert(whenNodes.All(n => n.Bindings == whenNodes[0].Bindings)); 1092Debug.Assert(whenNodes.All(n => GetDagNodeLabel(n.WhenTrue) == whenTrueLabel)); 1103Debug.Assert(whenNode.WhenFalse != null); 1112Debug.Assert(_whenNodeIdentifierLocal is not null); 1166Debug.Assert(whenFalse != null); 1172Debug.Assert(whenFalse == null); 1184Debug.Assert(left.Kind == BoundKind.Local && left == binding.VariableAccess); 1206Debug.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 (25)
170Debug.Assert(method.Name == WellKnownMemberNames.DeconstructMethodName); 174Debug.Assert(method.IsExtensionMethod); 188Debug.Assert(parameter.RefKind == RefKind.Out); 199Debug.Assert(inputType is { }); 213Debug.Assert(!conversion.IsUserDefined); 242Debug.Assert(e.Property.GetMethod.ParameterCount == 1); 243Debug.Assert(e.Property.GetMethod.Parameters[0].Type.SpecialType == SpecialType.System_Int32); 340Debug.Assert(input.Type is { }); 354Debug.Assert(!input.Type.IsNullableType()); 358Debug.Assert(!input.Type.IsNullableType()); 359Debug.Assert(input.Type.IsValueType); 369Debug.Assert(!rewrittenExpr.Type.IsSpanOrReadOnlySpanChar()); 396Debug.Assert(operatorType != BinaryOperatorKind.Error); 406Debug.Assert(operatorKind.Operator() == BinaryOperatorKind.Equal); 415Debug.Assert(comparisonType.SpecialType switch 442Debug.Assert(sequenceEqual != null && asSpan != null); 475Debug.Assert(output.Type is { }); 511Debug.Assert(loweredInput.Type is { }); 531Debug.Assert(tempAssigned); 545Debug.Assert(l.LocalSymbol.DeclarationKind == LocalDeclarationKind.PatternVariable); 575Debug.Assert(savedInputExpression != null); 624Debug.Assert(field != null); 642Debug.Assert(!IsCapturedPrimaryConstructorParameter(expr)); 673Debug.Assert(!evalNode.Evaluation.Input.IsOriginalInput); 677Debug.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\LocalRewriter_AsOperator.cs (7)
28Debug.Assert(result is { }); 42Debug.Assert(rewrittenTargetType.Type.Equals(rewrittenType)); 45Debug.Assert(!rewrittenType.IsValueType || rewrittenType.IsNullableType()); 60Debug.Assert(constantValue.IsNull); 83Debug.Assert(operandPlaceholder is not null); 84Debug.Assert(operandConversion is not null); 88Debug.Assert(result.Type!.Equals(rewrittenType, TypeCompareKind.ConsiderEverything));
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (12)
48Debug.Assert(!node.IsRef); 118Debug.Assert(eventAccess.IsUsableAsField); 181Debug.Assert(!isRef); 185Debug.Assert(!property.IsIndexer); 200Debug.Assert(!isRef); 205Debug.Assert(indexer.IsIndexer || indexer.IsIndexedProperty); 222Debug.Assert(!isRef || rewrittenLeft.GetRefKind() != RefKind.None); 258Debug.Assert(!isRef); 286Debug.Assert(_factory.CurrentFunction.IsConstructor()); 287Debug.Assert(property.Equals(autoProp, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 323Debug.Assert(exprType is object); 377Debug.Assert(newElement is { });
Lowering\LocalRewriter\LocalRewriter_BasePatternSwitchLocalRewriter.cs (1)
31Debug.Assert(sectionSyntax is { });
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (68)
124Debug.Assert(applyParentUnaryOperator is null); 140Debug.Assert(stack.Count >= 1); 162Debug.Assert(node.OperatorKind == BinaryOperatorKind.StringConcatenation); 163Debug.Assert(node.InterpolatedStringHandlerData is not null); 202Debug.Assert(oldNode == null || (oldNode.Syntax == syntax)); 227Debug.Assert(!isPointerElementAccess); 235Debug.Assert(method is null); 333Debug.Assert(loweredLeft.Type is { }); 334Debug.Assert(loweredRight.Type is { }); 347Debug.Assert(loweredLeft.Type is { }); 348Debug.Assert(loweredRight.Type is { }); 361Debug.Assert(loweredLeft.Type is { }); 362Debug.Assert(loweredRight.Type is { }); 569Debug.Assert(loweredLeft.Type is { }); 606Debug.Assert(operatorKind.Operator() == BinaryOperatorKind.And || operatorKind.Operator() == BinaryOperatorKind.Or); 623Debug.Assert(applyParentUnaryOperator == null || applyParentUnaryOperator.OperatorKind == testOperator); 629Debug.Assert(leftTruthOperator == null); 704Debug.Assert(temp is { }); 729Debug.Assert(leftTruthOperator == null); 742Debug.Assert(leftTruthOperator == null); 758Debug.Assert(leftTruthOperator != null); 776Debug.Assert(!operatorKind.IsLogical()); 784Debug.Assert(method is { }); 785Debug.Assert(TypeSymbol.Equals(method.ReturnType, type, TypeCompareKind.ConsiderEverything2)); 803Debug.Assert(left != null); 804Debug.Assert(right != null); 846Debug.Assert(nonNull is { }); 890Debug.Assert(expression.Type is { }); 913Debug.Assert(expression.Type is { }); 927Debug.Assert(expression.Type is { }); 1305Debug.Assert(left != null); 1306Debug.Assert(right != null); 1373Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case. 1614Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 1615Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 1616Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 1666Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case. 1689Debug.Assert(alwaysNull.Type is { }); 1731Debug.Assert(conditionalExpression.Type is { }); 1765Debug.Assert(leftNonNull == null || rightNonNull == null); // We've already optimized the case where they are both non-null. 1766Debug.Assert(!NullableNeverHasValue(left) && !NullableNeverHasValue(right)); // We've already optimized the case where one is null. 1907Debug.Assert(nullableType2 is { }); 1939Debug.Assert(loweredLeft != null); 1940Debug.Assert(loweredRight != null); 1941Debug.Assert((object)returnType != null); 1942Debug.Assert(returnType.SpecialType == SpecialType.System_Boolean); 1943Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull()); 2003Debug.Assert((object)method != null); 2028Debug.Assert((object)method != null); 2040Debug.Assert(loweredLeft.Type is { SpecialType: SpecialType.System_Decimal }); 2041Debug.Assert(loweredRight.Type is { SpecialType: SpecialType.System_Decimal }); 2064Debug.Assert((object)method != null); 2071Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) || 2077Debug.Assert( 2137Debug.Assert(loweredRight.Type is { }); 2139Debug.Assert(rightType.SpecialType == SpecialType.System_Int32); 2204Debug.Assert(loweredLeft.Type is { }); 2206Debug.Assert(leftType.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr); 2209Debug.Assert(loweredRight.Type is { }); 2211Debug.Assert(rightType.SpecialType == SpecialType.System_Int32); 2260Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2265Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2271Debug.Assert(kind.Operator() == BinaryOperatorKind.Addition); 2305Debug.Assert(sizeOfExpression.Type is { SpecialType: SpecialType.System_Int32 }); 2315Debug.Assert(numericOperand.Type is { }); 2452Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer }); 2453Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer }); 2454Debug.Assert(returnType.SpecialType == SpecialType.System_Int64);
Lowering\LocalRewriter\LocalRewriter_Call.cs (68)
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 { }); 85Debug.Assert(loweredReceiver != null); 150Debug.Assert(nameSyntax != null); 151Debug.Assert(interceptor.IsDefinition); 152Debug.Assert(!interceptor.ContainingType.IsGenericType); 188Debug.Assert(containingMethod is not null); 201Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic); 273Debug.Assert(methodThisParameter is not null); 274Debug.Assert(receiverOpt?.Type is not null); 280Debug.Assert(receiverOpt.Type.Equals(interceptor.Parameters[0].Type, TypeCompareKind.AllIgnoreOptions) 322Debug.Assert(node != null); 372Debug.Assert(node.ReceiverOpt is null); 393Debug.Assert(invokedAsExtensionMethod && !arguments.IsEmpty); 454Debug.Assert(rewrittenArguments.Length == 2); 507Debug.Assert(rewrittenBoundCall.Type is not null); 555Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 664Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length == arguments.Length); 666Debug.Assert(!requiresInstanceReceiver || rewrittenReceiver != null || _inExpressionLambda); 667Debug.Assert(captureReceiverMode == ReceiverCaptureMode.Default || (requiresInstanceReceiver && rewrittenReceiver != null && storesOpt is object)); 675Debug.Assert(!_inExpressionLambda); 676Debug.Assert(rewrittenReceiver is object); 677Debug.Assert(rewrittenReceiver.Type is { }); 773Debug.Assert(saveTempsOpt is object || tempsOpt?.Count is null or > 0); 780Debug.Assert(assignmentToTemp is object); 781Debug.Assert(tempsOpt is object); 838Debug.Assert(!_inExpressionLambda); 843Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 849Debug.Assert(!argumentsAssignedToTemp.IsNull); 855Debug.Assert(argIndex < argumentIndex); 861Debug.Assert(usesReceiver(argument)); 862Debug.Assert(requiresInstanceReceiver); 863Debug.Assert(receiverTemp is object); 877Debug.Assert(visitedArgumentsBuilder[argIndex] != null); 914Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode); 932Debug.Assert(assignmentToTemp.IsRef); 935Debug.Assert(receiverType is object); 971Debug.Assert(SpillSequenceSpiller.IsComplexConditionalInitializationOfReceiverRef(assignmentToTemp, out _, out _, out _, out _)); 988Debug.Assert(CodeGenerator.ReceiverIsKnownToReferToTempIfReferenceType(receiverTemp)); 1019Debug.Assert(expanded ? rewrittenArguments.Length == parameters.Length : rewrittenArguments.Length >= parameters.Length); 1020Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); 1126Debug.Assert(actualArguments.All(static arg => arg is not null)); 1173Debug.Assert(parameters[i].Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true, IsValueType: true }); 1187Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length >= parameters.Length); 1196Debug.Assert(!argumentRefKindsOpt.IsEmpty); 1225Debug.Assert(rewrittenArguments.Length == methodOrIndexer.GetParameterCount() + 1); 1226Debug.Assert(argsToParamsOpt.IsDefault); 1258Debug.Assert(paramsArray.IsParamsArrayOrCollection); 1314Debug.Assert(rewrittenArguments.Length == parameters.Length); 1315Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0)); 1324Debug.Assert(arguments[p] == null); 1328Debug.Assert(expanded); 1329Debug.Assert(p == parameters.Length - 1); 1330Debug.Assert(argRefKind == RefKind.None); 1349Debug.Assert(arguments[p].IsParamsArrayOrCollection); 1365Debug.Assert(argRefKind is RefKind.None or RefKind.In or RefKind.Ref); 1457Debug.Assert(arguments != null); 1458Debug.Assert(storesToTemps != null); 1459Debug.Assert(temporariesBuilder != null); 1486Debug.Assert(arguments != null); 1487Debug.Assert(tempStores != null); 1553Debug.Assert(value.Type is { }); 1605Debug.Assert(actualArguments != null); 1606Debug.Assert(actualArguments.Length == parameters.Length); 1608Debug.Assert(argsRefKindsBuilder != null); 1635Debug.Assert(localRefKind == RefKind.None); 1662Debug.Assert(node.TypeArgumentsOpt.IsDefault);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (72)
33Debug.Assert(conversion.Kind == ConversionKind.CollectionExpression); 34Debug.Assert(!_inExpressionLambda); 35Debug.Assert(_additionalLocals is { }); 36Debug.Assert(node.Type is { }); 62Debug.Assert(elementType is { }); 119Debug.Assert(spreadElement.IteratorBody is { }); 137Debug.Assert(spreadElement.IteratorBody is { }); 139Debug.Assert(iteratorBody is { }); 152Debug.Assert(result is { }); 176Debug.Assert(singleSpread.Expression.Type is not null); 193Debug.Assert(targetEnumerableType.OriginalDefinition == (object)_compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T)); 248Debug.Assert(!_inExpressionLambda); 249Debug.Assert(_additionalLocals is { }); 250Debug.Assert(node.CollectionCreation is null); // shouldn't have generated a constructor call 251Debug.Assert(node.Placeholder is null); 263Debug.Assert(collectionTypeKind is CollectionExpressionTypeKind.Span or CollectionExpressionTypeKind.ReadOnlySpan); 264Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType( 266Debug.Assert(elementType.Equals(spanType.TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0], TypeCompareKind.AllIgnoreOptions)); 278Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, collectionTypeKind, elementType.Type, _compilation)); 287Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, collectionTypeKind, elementType.Type, _compilation)); 295Debug.Assert(IsAllocatingRefStructCollectionExpression(node, collectionTypeKind, elementType.Type, _compilation)); 316Debug.Assert(list.Type is { }); 317Debug.Assert(list.Type.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T), TypeCompareKind.AllIgnoreOptions)); 328Debug.Assert(TypeSymbol.Equals(array.Type, spanConstructor.Parameters[0].Type, TypeCompareKind.AllIgnoreOptions)); 334Debug.Assert(!_inExpressionLambda); 339Debug.Assert(rewrittenReceiver is { }); 348Debug.Assert(placeholder is { }); 396Debug.Assert(!_inExpressionLambda); 397Debug.Assert(_factory.ModuleBuilderOpt is { }); 398Debug.Assert(_diagnostics.DiagnosticBag is { }); 399Debug.Assert(node.Type is NamedTypeSymbol); 400Debug.Assert(node.CollectionCreation is null); 401Debug.Assert(node.Placeholder is null); 419Debug.Assert(numberIncludingLastSpread == 0); 470Debug.Assert(!_inExpressionLambda); 471Debug.Assert(node.Type is { }); 472Debug.Assert(node.CollectionCreation is null); 473Debug.Assert(node.Placeholder is null); 474Debug.Assert(node.CollectionBuilderMethod is { }); 475Debug.Assert(node.CollectionBuilderInvocationPlaceholder is { }); 476Debug.Assert(node.CollectionBuilderInvocationConversion is { }); 481Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions)); 546Debug.Assert(elements.Length > 0); 547Debug.Assert(elements.All(e => e is BoundExpression)); 548Debug.Assert(_factory.ModuleBuilderOpt is { }); 549Debug.Assert(_diagnostics.DiagnosticBag is { }); 550Debug.Assert(_compilation.Assembly.RuntimeSupportsInlineArrayTypes); 551Debug.Assert(_additionalLocals is { }); 572Debug.Assert(inlineArrayType.HasInlineArrayAttribute(out int inlineArrayLength) && inlineArrayLength == arrayLength); 613Debug.Assert(span.Type is { }); 732Debug.Assert(TryOptimizeSingleSpreadToArray(node, arrayType) is null); 789Debug.Assert(arrayTemp.Type is ArrayTypeSymbol); 790Debug.Assert(indexTemp.Type is { SpecialType: SpecialType.System_Int32 }); 904Debug.Assert(type is not null); 1000Debug.Assert((object)spreadOperandAsSpan != rewrittenSpreadOperand || spreadOperandAsSpan is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.LoweringTemp }); 1023Debug.Assert(!_inExpressionLambda); 1094Debug.Assert(useKnownLength); 1095Debug.Assert(setCount is { }); 1096Debug.Assert(asSpan is { }); 1097Debug.Assert(knownLengthTemp is { }); 1125Debug.Assert(spanTemp.Type is NamedTypeSymbol); 1126Debug.Assert(indexTemp.Type is { SpecialType: SpecialType.System_Int32 }); 1178Debug.Assert(rewrittenSpreadOperand.Type is not null); 1259Debug.Assert(statements.Length > 0); 1287Debug.Assert(collectionPlaceholder is { }); 1292Debug.Assert(lengthAccess is { }); 1311Debug.Assert(sum is { }); 1333Debug.Assert(enumeratorInfo is { }); 1334Debug.Assert(convertedExpression is { }); 1335Debug.Assert(expressionPlaceholder is { }); 1336Debug.Assert(elementPlaceholder is { }); 1337Debug.Assert(iteratorBody is { });
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (32)
24Debug.Assert(TypeSymbol.Equals(node.Right.Type, node.Operator.RightType, TypeCompareKind.ConsiderEverything2)); 92Debug.Assert(rewrittenAssignment.Type is { }); 104Debug.Assert(rewrittenAssignment.Type is { }); 135Debug.Assert(node.LeftPlaceholder is not null); 144Debug.Assert(node.Left.Type is { }); 149Debug.Assert(node.FinalPlaceholder is not null); 156Debug.Assert(TypeSymbol.Equals(transformedLHS.Type, node.Left.Type, TypeCompareKind.AllIgnoreOptions)); 163Debug.Assert(propertyOrEvent.Kind == SymbolKind.Property || propertyOrEvent.Kind == SymbolKind.Event); 189Debug.Assert(receiverOpt.Kind != BoundKind.TypeExpression); 202Debug.Assert(rewrittenReceiver.Type is { }); 247Debug.Assert(receiverOpt != null); 310Debug.Assert(temps is object); 349Debug.Assert(array is BoundArrayCreation); 366Debug.Assert(accessor is not null); 376Debug.Assert(actualArguments.All(static arg => arg is not null)); 425Debug.Assert(implicitIndexerAccess.IndexerOrSliceAccess.GetRefKind() == RefKind.None); 461Debug.Assert(fieldOrEvent.Kind == SymbolKind.Field || fieldOrEvent.Kind == SymbolKind.Event); 469Debug.Assert(receiver is { Type: { } }); 479Debug.Assert(receiver.Type.IsReferenceType); 480Debug.Assert(receiver.Kind != BoundKind.TypeExpression); 483Debug.Assert(rewrittenReceiver.Type is { }); 622Debug.Assert(implicitIndexerAccess.Argument.Type!.Equals(_compilation.GetWellKnownType(WellKnownType.System_Index)) 678Debug.Assert(originalLHS.GetRefKind() == RefKind.Ref); 694Debug.Assert((object)result == originalLHS || IsCapturedPrimaryConstructorParameter(originalLHS)); // If this fails, we might need to add tests for new scenarios and relax the assert. 699Debug.Assert(((BoundCall)originalLHS).Method.RefKind != RefKind.None); 703Debug.Assert(((BoundFunctionPointerInvocation)originalLHS).FunctionPointer.Signature.RefKind != RefKind.None); 707Debug.Assert(((BoundConditionalOperator)originalLHS).IsRef); 711Debug.Assert(((BoundAssignmentOperator)originalLHS).IsRef); 722Debug.Assert(eventAccess.IsUsableAsField); 885Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 905Debug.Assert(expression.Type is { }); 925Debug.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_Conversion.cs (89)
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)); 305Debug.Assert(oldNodeOpt == null || oldNodeOpt.Syntax == syntax); 306Debug.Assert(rewrittenType is { }); 307Debug.Assert(_factory.ModuleBuilderOpt is { }); 308Debug.Assert(_diagnostics.DiagnosticBag is { }); 318Debug.Assert(rewrittenOperand.Type is { }); 426Debug.Assert(rewrittenOperand.Type is { }); 441Debug.Assert(rewrittenOperand.Type is { }); 444Debug.Assert(rewrittenOperand.Type.Equals(rewrittenType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 487Debug.Assert(rewrittenOperand.Type is { }); 497Debug.Assert(rewrittenOperand.Type.IsEnumType()); 508Debug.Assert(rewrittenType.IsEnumType()); 533Debug.Assert(conversion.Method is null); 534Debug.Assert(!conversion.IsExtensionMethod); 552Debug.Assert(symbolOpt is { }); 562Debug.Assert(oldNodeOpt is { }); 565Debug.Assert(method is { }); 569Debug.Assert(receiver is { }); 576Debug.Assert(_factory.TopLevelMethod is { }); 594Debug.Assert(rewrittenOperand.Type is not null); 605Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions)); 621Debug.Assert(sourceType is not null); 646Debug.Assert(destinationType.IsReadOnlySpan()); 647Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 678Debug.Assert(destinationType.IsReadOnlySpan()); 679Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 697Debug.Assert(destinationType.IsReadOnlySpan()); 698Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan); 740Debug.Assert(_factory.ModuleBuilderOpt is { }); 753Debug.Assert((object)target != null); 811Debug.Assert(rewrittenOperand.Type is { }); 843Debug.Assert(conversion.IsValid); 868Debug.Assert(conversion.Method is { }); 869Debug.Assert(conversion.BestUserDefinedConversionAnalysis is { }); 895Debug.Assert(rewrittenOperand.Type is { }); 952Debug.Assert(rewrittenOperand.Type is { }); 993Debug.Assert(expression.Type is { }); 1039Debug.Assert((object)rewrittenType != null); 1047Debug.Assert(rewrittenOperandType is { }); 1048Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType()); 1095Debug.Assert((object)rewrittenType != null); 1096Debug.Assert(rewrittenOperand.Type is { }); 1098Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType()); 1220Debug.Assert(conversion.Method is { }); 1240Debug.Assert(operand != null); 1241Debug.Assert((object)type != null); 1309Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 1310Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 1311Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 1342Debug.Assert(conversion.Method is { } && !conversion.Method.ReturnsVoid && conversion.Method.ParameterCount == 1); 1343Debug.Assert(rewrittenOperand.Type is { }); 1373Debug.Assert(TypeSymbol.Equals(result.Type, rewrittenType, TypeCompareKind.ConsiderEverything2)); 1381Debug.Assert(resultType.IsNullableType() && TypeSymbol.Equals(resultType.GetNullableUnderlyingType(), call.Method.ReturnType, TypeCompareKind.ConsiderEverything2)); 1396Debug.Assert(rewrittenOperand.Type is { }); 1410Debug.Assert((object)rewrittenType != null); 1411Debug.Assert(rewrittenOperand.Type.IsNullableType()); 1442Debug.Assert(conversion.Method is { }); 1486Debug.Assert(rewrittenOperand != null); 1487Debug.Assert((object)rewrittenType != null); 1488Debug.Assert(rewrittenOperand.Type is { }); 1489Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr); 1502Debug.Assert(!method.ReturnsVoid); 1503Debug.Assert(method.ParameterCount == 1); 1509Debug.Assert(target.IsNullableType()); 1535Debug.Assert((object)source != null); 1536Debug.Assert((object)target != null); 1695Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal); 1714Debug.Assert(operand.Type is { }); 1742Debug.Assert(TypeSymbol.Equals(method.ReturnType, toType, TypeCompareKind.ConsiderEverything2)); 1759Debug.Assert(meth is { }); 1788Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr); 1819Debug.Assert(underlying is { }); 1832Debug.Assert(underlying is { }); 1864Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (18)
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); 231Debug.Assert(placeholder is not null); 232Debug.Assert(nestedConversion is not null); 247Debug.Assert(leftTarget is { Type: { } }); 258Debug.Assert(builder is null || resultPart is { }); 285Debug.Assert(!IsTupleExpression(right.Kind)); 318Debug.Assert(right.Type is { }); 337Debug.Assert(expression.Type is { }); 338Debug.Assert(expression.Type.IsTupleType); 462Debug.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 (10)
57Debug.Assert(method is { }); 58Debug.Assert(method.ReturnType.Equals(node.Type, TypeCompareKind.AllIgnoreOptions)); 91Debug.Assert(eventSymbol.IsStatic || rewrittenReceiverOpt is { }); 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");
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (20)
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); 268Debug.Assert(pinnedTemp.IsPinned); 269Debug.Assert(!localSymbol.IsPinned); 308Debug.Assert(initializerExpr.Type is { }); 313Debug.Assert(getPinnableMethod is { }); 387Debug.Assert(nullableBoundTemp is not null); 388Debug.Assert(nullableTempAssignment is not null); 444Debug.Assert(initializerType is { }); 457Debug.Assert(pinnedTemp.IsPinned); 458Debug.Assert(!localSymbol.IsPinned); 513Debug.Assert(initializerType is { }); 520Debug.Assert(pinnedTemp.IsPinned); 521Debug.Assert(!localSymbol.IsPinned);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (34)
43Debug.Assert(nodeExpressionType is { }); 116Debug.Assert(enumeratorInfo != null); 119Debug.Assert(rewrittenBody is { }); 227Debug.Assert(awaitableInfo is { GetResult: { } }); 337Debug.Assert(_factory.CurrentFunction is { }); 362Debug.Assert(idisposableTypeSymbol is { }); 393Debug.Assert(enumeratorType.OriginalDefinition.SpecialType != SpecialType.System_Nullable_T); 418Debug.Assert(!enumeratorType.IsSealed); 419Debug.Assert(!enumeratorInfo.IsAsync); 420Debug.Assert(idisposableTypeSymbol is { }); 421Debug.Assert(disposeMethod is { }); 497Debug.Assert(receiver.Type is { }); 500Debug.Assert(receiverConversion.IsImplicit && !receiverConversion.IsUserDefined); 525Debug.Assert(!receiverConversion.IsNumeric); 547Debug.Assert(methodArgumentInfo.Arguments.IsEmpty); 573Debug.Assert(rewrittenBody is { }); 575Debug.Assert(node.EnumeratorInfoOpt is not null); 610Debug.Assert(collectionType is { }); 748Debug.Assert(rewrittenExpression.Type is not null); 770Debug.Assert(rewriter._factory.ModuleBuilderOpt is { }); 771Debug.Assert(rewriter._diagnostics.DiagnosticBag is { }); 780Debug.Assert(enumeratorInfo.InlineArraySpanType == WellKnownType.System_ReadOnlySpan_T); 796Debug.Assert(length > 0); 820Debug.Assert(iterationVariables.Length == 1); 877Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 880Debug.Assert(rewrittenBody is { }); 905Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 911Debug.Assert(arrayType is { IsSZArray: true }); 1026Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1029Debug.Assert(rewrittenBody is { }); 1054Debug.Assert(collectionExpression.Type is { TypeKind: TypeKind.Array }); 1061Debug.Assert(!arrayType.IsSZArray); 1207Debug.Assert(forLoop != null); 1247Debug.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 (61)
69Debug.Assert(node.AccessorKind != AccessorKind.Unknown); 70Debug.Assert(node.Indexer.IsIndexer || node.Indexer.IsIndexedProperty); 71Debug.Assert((object?)node.Indexer.GetOwnOrInheritedGetMethod() != null); 79Debug.Assert(indexer.IsIndexer || indexer.IsIndexedProperty); 80Debug.Assert(node.AccessorKind != AccessorKind.Unknown); 81Debug.Assert(isLeftOfAssignment || (node.AccessorKind != AccessorKind.Set)); 85Debug.Assert(rewrittenReceiver is { }); 114Debug.Assert(oldNode is BoundIndexerAccess or BoundObjectInitializerMember); 119Debug.Assert(oldNode.Type is not null); 120Debug.Assert(oldNode.Type.Equals(type, TypeCompareKind.ConsiderEverything)); 157Debug.Assert(getMethod is not null); 180Debug.Assert(call.Type is not null); 201Debug.Assert(_factory.ModuleBuilderOpt is { }); 202Debug.Assert(_diagnostics.DiagnosticBag is { }); 203Debug.Assert(node.Expression.Type is object); 204Debug.Assert(node.Argument.Type is object); 216Debug.Assert(getItemOrSliceHelper is object); 227Debug.Assert(length > 0); 240Debug.Assert(receiverStore is null); 241Debug.Assert(TypeSymbol.Equals(node.Argument.Type, _compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.AllIgnoreOptions)); 265Debug.Assert(rewrittenRangeArg is not null); 323Debug.Assert(node.Expression.Type is object); 340Debug.Assert(node.Expression.Type is object); 341Debug.Assert(index.Type?.SpecialType == SpecialType.System_Int32); 358Debug.Assert(node.GetItemOrSliceHelper is WellKnownMember.System_ReadOnlySpan_T__get_Item); 377Debug.Assert(node.GetItemOrSliceHelper is WellKnownMember.System_ReadOnlySpan_T__get_Item); 387Debug.Assert(index.ConstantValueOpt is null); // Binder should have reported an error due to index out of bounds, or should have handled by code above. 444Debug.Assert(TypeSymbol.Equals( 448Debug.Assert(!isLeftOfAssignment || node.IndexerOrSliceAccess.GetRefKind() == RefKind.Ref); 479Debug.Assert(node.ArgumentPlaceholders.Length == 1); 480Debug.Assert(node.IndexerOrSliceAccess is BoundIndexerAccess or BoundArrayAccess); 482Debug.Assert(TypeSymbol.Equals( 499Debug.Assert(receiver.Type is { }); 561Debug.Assert(node.ArgumentPlaceholders.Length == 1); 563Debug.Assert(integerArgument.Type!.SpecialType == SpecialType.System_Int32); 569Debug.Assert(indexerAccess.Arguments.Length == 1); 586Debug.Assert(locals is not null); 653Debug.Assert(lengthAccess is not null); 657Debug.Assert(loweredExpr is not null); 658Debug.Assert(lengthAccess is not null); 659Debug.Assert(loweredExpr.Type!.SpecialType == SpecialType.System_Int32); 669Debug.Assert(loweredExpr is not null); 670Debug.Assert(loweredExpr.Type!.SpecialType == SpecialType.System_Int32); 674Debug.Assert(loweredExpr is not null); 675Debug.Assert(lengthAccess is not null); 676Debug.Assert(TypeSymbol.Equals( 709Debug.Assert(TypeSymbol.Equals( 718Debug.Assert(hatExpression.Operand is { Type: { SpecialType: SpecialType.System_Int32 } }); 771Debug.Assert(node.ArgumentPlaceholders.Length == 2); 772Debug.Assert(node.IndexerOrSliceAccess is BoundCall); 774Debug.Assert(TypeSymbol.Equals( 801Debug.Assert(receiver.Type is { }); 915Debug.Assert(startStrategy != PatternIndexOffsetLoweringStrategy.Zero || (rewriteFlags & captureStartOffset) == 0); 916Debug.Assert((rewriteFlags & captureEndOffset) == 0 || (rewriteFlags & captureStartOffset) != 0 || startStrategy == PatternIndexOffsetLoweringStrategy.Zero); 917Debug.Assert((rewriteFlags & captureStartOffset) == 0 || (rewriteFlags & captureEndOffset) != 0 || endStrategy == PatternIndexOffsetLoweringStrategy.Length); 918Debug.Assert(endStrategy != PatternIndexOffsetLoweringStrategy.Length || (rewriteFlags & captureEndOffset) == 0); 919Debug.Assert((rewriteFlags & captureLength) == 0 || (rewriteFlags & useLength) != 0); 923Debug.Assert(startMakeOffsetInput is not null); 934Debug.Assert(endMakeOffsetInput is not null); 978Debug.Assert(rewrittenRangeArg is not null); 982Debug.Assert(node.ArgumentPlaceholders.Length == 2);
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (3)
52Debug.Assert(targetType is { }); 86Debug.Assert(constantValue == ConstantValue.True || constantValue == ConstantValue.False); 87Debug.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 (3)
28Debug.Assert(rewrittenBody is { }); 35Debug.Assert(rewrittenArgument.ConstantValueOpt == ConstantValue.Null); 201Debug.Assert(enterMethod.ParameterCount == 1);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (9)
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)); 47Debug.Assert(conditionalExpression.Type is { }); 63Debug.Assert(node.LeftOperand.Type.IsNullableType()); 90Debug.Assert(!_inExpressionLambda && lhsRead.Kind != BoundKind.PropertyAccess); 112Debug.Assert(transformedLHS.Type.GetNullableUnderlyingType().Equals(tmp.Type.StrippedType(), TypeCompareKind.AllIgnoreOptions)); 115Debug.Assert(TypeSymbol.Equals(transformedLHS.Type, node.LeftOperand.Type, TypeCompareKind.AllIgnoreOptions));
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (16)
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); 90Debug.Assert(rewrittenLeft.Type is { }); 167Debug.Assert(convertedLeft.HasErrors || convertedLeft.Type!.Equals(rewrittenResultType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 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 (13)
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); 209Debug.Assert(left.MemberSymbol is not null); 218Debug.Assert(property.MemberIndexOpt!.Value >= 0 && property.MemberIndexOpt.Value < anonymousType.Properties.Length); 261Debug.Assert(!_inExpressionLambda); 262Debug.Assert(initializerExpression != null && !initializerExpression.HasErrors); 340Debug.Assert((object)method != null); 384Debug.Assert(node.GuidString is { });
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (34)
38Debug.Assert(!_inExpressionLambda); 39Debug.Assert(rewrittenReceiver != null); 68Debug.Assert(_inExpressionLambda); 90Debug.Assert(rewrittenReceiver is { } || _inExpressionLambda); 104Debug.Assert(!_inExpressionLambda); 105Debug.Assert(initializer.Kind == BoundKind.DynamicCollectionElementInitializer); 144Debug.Assert(addMethod.Name == "Add"); 145Debug.Assert(addMethod.Parameters 148Debug.Assert(initializer.Arguments.Any()); 149Debug.Assert(rewrittenReceiver != null || _inExpressionLambda); 191Debug.Assert(addMethod.IsStatic); 192Debug.Assert(addMethod.IsExtensionMethod); 256Debug.Assert(!_inExpressionLambda); 276Debug.Assert(rewrittenReceiver != null); 277Debug.Assert(!_inExpressionLambda); 299Debug.Assert(memberInit is { }); 303Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsArrayOrCollection) <= (memberInit.Expanded ? 1 : 0)); 327Debug.Assert(!memberInit.Expanded); 344Debug.Assert(setMember.SiteInitialization is { }); 356Debug.Assert(getMember.SiteInitialization is { }); 367Debug.Assert(assignment.Type.IsDynamic() || TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 378Debug.Assert(initializerMember is { }); 388Debug.Assert(setMember.SiteInitialization is { }); 395Debug.Assert(getMember.SiteInitialization is { }); 404Debug.Assert(rewrittenArrayAccess is { }); 408Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection)); 419Debug.Assert(getSubArrayCall.Arguments.Length == 2); 421Debug.Assert(TypeSymbol.Equals(rangeArgument.Type, _compilation.GetWellKnownType(WellKnownType.System_Range), TypeCompareKind.ConsiderEverything)); 439Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 472Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 506Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions)); 545Debug.Assert(initializers is not null); 663Debug.Assert(memberSymbol is object); 667Debug.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 (30)
39Debug.Assert( 53Debug.Assert(loweredLeft.Type is { } && (loweredLeft.Type.IsStringType() || loweredLeft.Type.IsErrorType()) || loweredLeft.ConstantValueOpt?.IsNull == true); 54Debug.Assert(loweredRight.Type is { } && (loweredRight.Type.IsStringType() || loweredRight.Type.IsErrorType()) || loweredRight.ConstantValueOpt?.IsNull == true); 200Debug.Assert(boundCoalesce.LeftPlaceholder is null); 201Debug.Assert(boundCoalesce.LeftConversion is null); 338Debug.Assert(leftVal is { } && rightVal is { }); 371Debug.Assert(loweredLeft.HasAnyErrors || loweredLeft.Type is { } && loweredLeft.Type.IsStringType()); 372Debug.Assert(loweredRight.HasAnyErrors || loweredRight.Type is { } && loweredRight.Type.IsStringType()); 375Debug.Assert((object)method != null); 382Debug.Assert(loweredFirst.HasAnyErrors || loweredFirst.Type is { } && loweredFirst.Type.IsStringType()); 383Debug.Assert(loweredSecond.HasAnyErrors || loweredSecond.Type is { } && loweredSecond.Type.IsStringType()); 384Debug.Assert(loweredThird.HasAnyErrors || loweredThird.Type is { } && loweredThird.Type.IsStringType()); 387Debug.Assert((object)method != null); 394Debug.Assert(loweredFirst.HasAnyErrors || loweredFirst.Type is { } && loweredFirst.Type.IsStringType()); 395Debug.Assert(loweredSecond.HasAnyErrors || loweredSecond.Type is { } && loweredSecond.Type.IsStringType()); 396Debug.Assert(loweredThird.HasAnyErrors || loweredThird.Type is { } && loweredThird.Type.IsStringType()); 397Debug.Assert(loweredFourth.HasAnyErrors || loweredFourth.Type is { } && loweredFourth.Type.IsStringType()); 400Debug.Assert((object)method != null); 407Debug.Assert(loweredArgs.Length > 4); 408Debug.Assert(loweredArgs.All(a => a.HasErrors || a.Type is { } && a.Type.IsStringType())); 411Debug.Assert((object)method != null); 421Debug.Assert(args.Count is >= 2 and <= 4); 466Debug.Assert(charType is not null); 537Debug.Assert(arg.Type is not null); 544Debug.Assert(readOnlySpanCtorRefParamChar.Parameters[0].RefKind != RefKind.Out); 568Debug.Assert(arg.HasAnyErrors || arg.Type.SpecialType == SpecialType.System_String); 569Debug.Assert(stringImplicitConversionToReadOnlySpan is not null); 600Debug.Assert((object)method != null); 648Debug.Assert(expr.Type is not null); 755Debug.Assert(!IsCapturedPrimaryConstructorParameter(expr));
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (20)
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); 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 (7)
57Debug.Assert(savedInputExpression != null); 158Debug.Assert(factory.ModuleBuilderOpt is not null); 162Debug.Assert(diagnostics is not null); 173Debug.Assert(factory.ModuleBuilderOpt is not null); 177Debug.Assert(diagnostics is not null); 187Debug.Assert(factory.ModuleBuilderOpt is not null); 191Debug.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)); 107Debug.Assert(expr.Type is { }); 110Debug.Assert(boundConversion.Operand.Type is { }); 368Debug.Assert(expr.Type is { }); 398Debug.Assert(expr.Type is { }); 440Debug.Assert(expr.Type is { }); 443Debug.Assert(operand.Type is { }); 448Debug.Assert(underlyingConversions.Length == tupleCardinality); 507Debug.Assert(currentResult is { }); 524Debug.Assert(tuple.Type is { IsTupleType: true }); 583Debug.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 (33)
37Debug.Assert(false); // these should have been represented as a BoundIncrementOperator 84Debug.Assert((kind == UnaryOperatorKind.DynamicTrue || kind == UnaryOperatorKind.DynamicFalse) && type.SpecialType == SpecialType.System_Boolean 86Debug.Assert(method is null); 112Debug.Assert(method is { }); 113Debug.Assert(TypeSymbol.Equals(type, method.ReturnType, TypeCompareKind.ConsiderEverything2)); 133Debug.Assert(underlyingType is { }); 276Debug.Assert(result.Type is { }); 327Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2)); 328Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2)); 329Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2)); 440Debug.Assert(operandType is { }); 441Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.ConsiderEverything2)); 492Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression)); 512Debug.Assert(boundTemp.Type is not null); 540Debug.Assert(boundTemp.Type is not null); 543Debug.Assert(tempValue.Type is { }); 599Debug.Assert(placeholder is not null); 632Debug.Assert(node.MethodOpt is { }); 633Debug.Assert(node.MethodOpt.ParameterCount == 1); 644Debug.Assert(TypeSymbol.Equals(node.MethodOpt.GetParameterType(0), node.MethodOpt.ReturnType, TypeCompareKind.ConsiderEverything2)); 741Debug.Assert(constantOne != null); 742Debug.Assert(constantOne.SpecialType != SpecialType.None); 743Debug.Assert(binaryOperandType.SpecialType != SpecialType.None); 744Debug.Assert(binaryOperatorKind.OperandTypes() != 0); 771Debug.Assert(binaryOperatorKind.OperandTypes() == BinaryOperatorKind.PointerAndInt); 772Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer }); 773Debug.Assert(boundOne.Type is { SpecialType: SpecialType.System_Int32 }); 819Debug.Assert((object)method != null); // Should have been checked during Warnings pass 826Debug.Assert(operand.Type is { SpecialType: SpecialType.System_Decimal }); 833Debug.Assert(operand.Type is { } && operand.Type.IsNullableType() && operand.Type.GetNullableUnderlyingType().SpecialType == SpecialType.System_Decimal); 1019Debug.Assert(underlyingType is { }); 1024Debug.Assert(underlyingType.IsEnumType()); 1026Debug.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\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 (17)
24Debug.Assert(factory != null); 82Debug.Assert(!isExplicit || !isArrayIndex); 119Debug.Assert(operatorKind.IsDynamic()); 157Debug.Assert(operatorKind.IsDynamic()); 204Debug.Assert(_factory.TopLevelMethod is { }); 544Debug.Assert(loweredReceiver.Type is { }); 569Debug.Assert(argumentNames.IsDefaultOrEmpty || loweredArguments.Length == argumentNames.Length); 570Debug.Assert(refKinds.IsDefault || loweredArguments.Length == refKinds.Length); 571Debug.Assert(!receiverIsStaticType || receiverRefKind == RefKind.None); 607Debug.Assert(!loweredArguments.IsDefault); 686Debug.Assert(factory.CompilationState.ModuleBuilderOpt is { }); 687Debug.Assert(factory.TopLevelMethod is { }); 688Debug.Assert(factory.CurrentFunction is { }); 714Debug.Assert(_currentDynamicCallSiteContainer is { }); 726Debug.Assert(refKinds.IsDefaultOrEmpty || refKinds.Length == loweredArguments.Length); 785Debug.Assert(_factory.CompilationState.ModuleBuilderOpt is { }); 793Debug.Assert(refKind != RefKind.RefReadOnlyParameter);
Lowering\MethodToClassRewriter.cs (18)
58Debug.Assert(compilationState != null); 59Debug.Assert(diagnostics != null); 60Debug.Assert(diagnostics.DiagnosticBag != null); 238Debug.Assert(rewrittenMethodSymbol.IsMetadataVirtual(MethodSymbol.IsMetadataVirtualOption.ForceCompleteIfNeeded) 268Debug.Assert(node.InterpolatedStringHandlerData is null); 332Debug.Assert(methodBeingCalled.IsGenericMethod); 334Debug.Assert(typeArgs.Length == newMethod.Arity); 367Debug.Assert(wrapper.SynthesizesLoweredBoundBody); 412Debug.Assert(!NeedsProxy(node.LocalSymbol)); 497Debug.Assert(!proxies.ContainsKey(leftLocal.LocalSymbol)); 498Debug.Assert(originalRight.Kind != BoundKind.ConvertedStackAllocExpression); 505Debug.Assert(leftLocal.LocalSymbol.DeclarationKind == LocalDeclarationKind.None); 531Debug.Assert(!node.IsRef); 564Debug.Assert(rewritten != null); 702Debug.Assert(member is not null); 741Debug.Assert(containingType.ContainingModule is SourceModuleSymbol); 742Debug.Assert(ReferenceEquals(methodBeingWrapped, methodBeingWrapped.ConstructedFrom)); 743Debug.Assert(!methodBeingWrapped.IsStatic);
Lowering\SpillSequenceSpiller.cs (37)
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); 590Debug.Assert(!sideEffectsOnly || refKinds.IsDefault); 591Debug.Assert(refKinds.IsDefault || refKinds.Length == args.Length); 599Debug.Assert(newList.Length == args.Length); 637Debug.Assert(sideEffectsOnly || replacement != null); 681Debug.Assert(expr != null); 682Debug.Assert(builder == null || builder.Value == null); 713Debug.Assert(exceptionFilterPrologueOpt is null); // it is introduced by this pass 718Debug.Assert(builder.Value is null); 731Debug.Assert(!(node is BoundStatement)); 852Debug.Assert(node.OperandPlaceholder is null); 853Debug.Assert(node.OperandConversion is null); 922Debug.Assert(field.ReceiverOpt is object); 1034Debug.Assert(refKind == RefKind.None || !receiver.Type.IsReferenceType); 1044Debug.Assert(!receiverType.IsReferenceType); 1147Debug.Assert(condition.Type.SpecialType == SpecialType.System_Boolean); 1235Debug.Assert(node.LeftPlaceholder is null); 1236Debug.Assert(node.LeftConversion is null); 1303Debug.Assert(node.HasValueMethodOpt == null); 1328Debug.Assert(whenNullOpt == null || !LocalRewriter.ReadIsSideeffecting(whenNullOpt)); 1414Debug.Assert(node.InitializerExpressionOpt == null);
Lowering\StateMachineRewriter\IteratorAndAsyncCaptureWalker.cs (5)
62Debug.Assert(!badRegion); 91Debug.Assert(local.RefKind != RefKind.None); 100Debug.Assert(parameter.TypeWithAnnotations.IsRestrictedType()); 111Debug.Assert(!allVariables.Any((s, method) => s.Symbol is ParameterSymbol { ContainingSymbol: var container } && container != method && container is not SynthesizedPrimaryConstructor, method)); 251Debug.Assert(parameter.IsThis || parameter.RefKind == RefKind.None);
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (30)
115Debug.Assert(F != null); 116Debug.Assert(originalMethod != null); 117Debug.Assert(state != null); 118Debug.Assert(nonReusableLocalProxies != null); 119Debug.Assert(!nonReusableFieldsForCleanup.IsDefault); 120Debug.Assert(diagnostics != null); 121Debug.Assert(hoistedVariables != null); 122Debug.Assert(nextFreeHoistedLocalSlot >= 0); 150Debug.Assert(thisProxyReplacement.Type is not null); 177Debug.Assert(localOrParameter.Kind == SymbolKind.Local || localOrParameter.Kind == SymbolKind.Parameter); 209Debug.Assert(TypeSymbol.Equals(frameClass, result.Type, TypeCompareKind.ConsiderEverything2)); 284Debug.Assert(!NeedsProxy(local) || proxies.ContainsKey(local)); 315Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.Spill || 510Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.Spill || 512Debug.Assert(local.SyntaxOpt != null); 514Debug.Assert(local.SynthesizedKind switch 534Debug.Assert(local.SynthesizedKind switch 559Debug.Assert(TypeSymbol.Equals(type, replacement.Type, TypeCompareKind.ConsiderEverything2)); 641Debug.Assert(refKind is RefKindExtensions.StrictIn or RefKind.Ref or RefKind.Out); 642Debug.Assert(call.Method.RefKind != RefKind.None); 659Debug.Assert(refKind is RefKindExtensions.StrictIn or RefKind.Ref or RefKind.In); 660Debug.Assert(conditional.IsRef); 684Debug.Assert(awaitSyntaxOpt != null); 749Debug.Assert(!node.Locals.IsEmpty); 756Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.UserDefined && 842Debug.Assert(!node.IsRef); 853Debug.Assert(leftLocal.SynthesizedKind == SynthesizedLocalKind.Spill || 855Debug.Assert(node.IsRef); 982Debug.Assert(proxy != null); 998Debug.Assert(proxy != null);
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (2)
52Debug.Assert(SyntaxBindingUtilities.BindsToResumableStateMachineState(awaitOrYieldReturnSyntax)); 82Debug.Assert(f.ModuleBuilderOpt != null);
Lowering\StateMachineRewriter\StateMachineFieldSymbol.cs (3)
51Debug.Assert((object)type != null); 52Debug.Assert(slotDebugInfo.SynthesizedKind.IsLongLived() == (slotIndex >= 0)); 96Debug.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); 153Debug.Assert(variable.Kind == SymbolKind.Local || variable.Kind == SymbolKind.Parameter); 174Debug.Assert(synthesizedKind == SynthesizedLocalKind.Spill || 179Debug.Assert(local.RefKind == RefKind.None); 313Debug.Assert((object)method.ThisParameter != null); 381Debug.Assert(CanGetThreadId()); 521Debug.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)
53Debug.Assert((object)containingType != null); 54Debug.Assert((object)baseMethod != null); 62Debug.Assert(typeMap != null); 63Debug.Assert(this.TypeMap == null); 64Debug.Assert(!typeParameters.IsDefault); 65Debug.Assert(_typeParameters.IsDefault); 167Debug.Assert(base.GetAttributes().IsEmpty); 175Debug.Assert(base.GetReturnTypeAttributes().IsEmpty);
Lowering\SynthesizedSubmissionFields.cs (2)
33Debug.Assert(compilation != null); 34Debug.Assert(submissionClass.IsSubmissionClass);
Lowering\SyntheticBoundNodeFactory.cs (76)
116Debug.Assert(node != null); 117Debug.Assert(compilationState != null); 118Debug.Assert(diagnostics != null); 134Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2)); 140Debug.Assert(CurrentFunction is null || 150Debug.Assert(ModuleBuilderOpt is { }); 172Debug.Assert(CurrentType is { }); 180Debug.Assert(CurrentType is { }); 188Debug.Assert(CurrentType is { }); 196Debug.Assert(CurrentType is { }); 204Debug.Assert(CurrentType is { }); 213Debug.Assert(ModuleBuilderOpt is { }); 224Debug.Assert(CurrentFunction is { IsStatic: false }); 235Debug.Assert(CurrentFunction is { IsStatic: false }); 267Debug.Assert(receiverOpt is null || receiverOpt.Type is { } && 275Debug.Assert((receiverOpt is null) == property.IsStatic); 284Debug.Assert(accessor is not null); 290Debug.Assert((receiverOpt is null) == property.IsStatic); 292Debug.Assert(accessor is not null); 361Debug.Assert(result is not null); 402Debug.Assert(result is not null); 439Debug.Assert(left.Type is { } && right.Type is { } && 553Debug.Assert(CurrentFunction is { }); 566Debug.Assert(conversion.Kind != ConversionKind.NoConversion); 569Debug.Assert(CurrentFunction.RefKind == RefKind.None); 579Debug.Assert(CurrentFunction is { }); 658Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 659Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 665Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 666Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 810Debug.Assert(methodSymbol.IsStatic); 818Debug.Assert(methodSymbol.IsStatic); 819Debug.Assert(methodSymbol.IsGenericMethod); 820Debug.Assert(methodSymbol.Arity == typeArgs.Length); 828Debug.Assert(methodSymbol.IsStatic); 857Debug.Assert(method.ParameterCount == args.Length); 894Debug.Assert(method.ParameterCount == args.Length); 909Debug.Assert(valueTypeReceiver.Type is { }); 910Debug.Assert(TypeSymbol.Equals(valueTypeReceiver.Type, referenceTypeReceiver.Type, TypeCompareKind.ConsiderEverything2)); 916Debug.Assert(left.Type!.Equals(right.Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes) || left.Type.IsErrorType()); 917Debug.Assert(left.Type.IsReferenceType); 945Debug.Assert(thenClause != null); 1027Debug.Assert(result.Type is { }); 1034Debug.Assert(result.Type is { }); 1043Debug.Assert(result.Type is { }); 1073Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 }); 1100Debug.Assert(statements[0] is null); 1117Debug.Assert(!labels.Contains(v2)); 1146Debug.Assert(stringConst.IsString || stringConst.IsNull); 1168Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1174Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1187Debug.Assert(array.Type is { TypeKind: TypeKind.Array }); 1194Debug.Assert(CurrentFunction is { }); 1239Debug.Assert(type.CanBeAssignedNull()); 1258Debug.Assert(systemType.ExtendedSpecialType == InternalSpecialType.System_Type || 1272Debug.Assert(TypeSymbol.Equals(systemType, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions)); 1294Debug.Assert(this.CompilationState is { DynamicOperationContextType: { } }); 1316Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); 1423Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo)); 1440Debug.Assert(systemReflectionMethodOrConstructorInfo.ExtendedSpecialType == InternalSpecialType.System_Reflection_MethodInfo || 1472Debug.Assert(!allowBoxingByRefLikeTypeParametersToObject || type.IsObjectType()); 1493Debug.Assert(c.Exists); 1514Debug.Assert(arg.Type is { }); 1630Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } }); 1651Debug.Assert(argument.Type is { }); 1653Debug.Assert(containingMethod is { }); 1654Debug.Assert(kind != SynthesizedLocalKind.UserDefined); 1671Debug.Assert(argument.GetRefKind() != RefKind.In); 1728Debug.Assert(node.Type is { }); 1751Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) || 1757Debug.Assert( 1827Debug.Assert(loweredLeft != null); 1828Debug.Assert(loweredRight != null); 1829Debug.Assert((object)returnType != null); 1830Debug.Assert(returnType.SpecialType == CodeAnalysis.SpecialType.System_Boolean); 1831Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull());
Lowering\UnmatchedGotoFinder.cs (1)
30Debug.Assert(unmatchedLabelsCache != null);
Operations\CSharpOperationFactory.cs (44)
513Debug.Assert(initializer.Initializers.All(i => i is ISimpleAssignmentOperation)); 527Debug.Assert(declaredTypeOpt != null); 538Debug.Assert(declaredTypeOpt != null); 695Debug.Assert(type is not null); 709Debug.Assert(constructor is not null); 719Debug.Assert(isImplicit); 720Debug.Assert(type is not null); 811Debug.Assert(!boundObjectInitializerMember.Expanded); 858Debug.Assert(boundObjectInitializerMember.Type.IsDynamic()); 1017Debug.Assert(!forceOperandImplicitLiteral || boundConversion.Operand is BoundLiteral); 1023Debug.Assert(!forceOperandImplicitLiteral); 1024Debug.Assert(!boundOperand.GetInterpolatedStringHandlerData().IsDefault); 1032Debug.Assert(!forceOperandImplicitLiteral); 1036Debug.Assert(boundConversion.SymbolOpt is object); 1050Debug.Assert(isImplicit || target.Syntax != syntax || target.IsImplicit || boundConversion.ConversionGroupOpt != null); 1070Debug.Assert(boundOperand.Kind == BoundKind.BadExpression || 1073Debug.Assert(!forceOperandImplicitLiteral); 1086Debug.Assert(!forceOperandImplicitLiteral); 1175Debug.Assert(typeOperand is not null); 1186Debug.Assert(typeOperand is not null); 1197Debug.Assert(typeOperand is not null); 1332Debug.Assert(!IsMemberInitializer(boundAssignmentOperator)); 1346Debug.Assert(IsMemberInitializer(boundAssignmentOperator)); 1538Debug.Assert(boundBinaryOperator.InterpolatedStringHandlerData is not null); 1651Debug.Assert(lengthSymbol is not null); 1652Debug.Assert(indexerSymbol is not null); 1965Debug.Assert(boundForEachStatement.IterationVariables.Length == 1); 2009Debug.Assert(boundCatchBlock.ExceptionFilterPrologueOpt is null); 2031Debug.Assert((boundUsingStatement.DeclarationsOpt == null) != (boundUsingStatement.ExpressionOpt == null)); 2032Debug.Assert(boundUsingStatement.ExpressionOpt is object || boundUsingStatement.Locals.Length > 0); 2124Debug.Assert(node.Parent != null); 2219Debug.Assert(boundExpressionStatement.Syntax == sequence.Value.Syntax); 2256Debug.Assert(positionInfo == null || boundInterpolatedString.InterpolationData is null or { BuilderType: null }); 2299Debug.Assert(parts.Length == positionInfo.Length); 2322Debug.Assert(bad.ChildBoundNodes.Length == 2350Debug.Assert(alignment is null); 2351Debug.Assert(format is null); 2359Debug.Assert(valueOperation.IsImplicit); 2369Debug.Assert(valueOperation.Syntax != part.Syntax); 2419Debug.Assert(conversion.Conversion.IsInterpolatedStringHandler); 2712Debug.Assert(boundSwitchExpression.DefaultLabel is GeneratedLabelSymbol); 2753Debug.Assert(boundSwitchLabel.Pattern.Kind == BoundKind.DiscardPattern); 2894Debug.Assert(nameSyntax is not null); 2943Debug.Assert(!patternDisposeInfo.Method.IsStatic);
Operations\CSharpOperationFactory_Methods.cs (6)
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); 415Debug.Assert(arguments.Length >= declarations.Length); 471Debug.Assert(currentDeclarationIndex == declarations.Length);
Parser\Blender.cs (4)
37Debug.Assert(lexer != null); 93Debug.Assert(lexer != null); 94Debug.Assert(changes != null); 95Debug.Assert(newPosition >= 0);
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 (2)
403Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 680Debug.Assert(isActive);
Parser\DocumentationCommentParser.cs (5)
971Debug.Assert(CurrentToken.Kind == SyntaxKind.ThisKeyword); 983Debug.Assert(CurrentToken.Kind == SyntaxKind.OperatorKeyword); 1103Debug.Assert(SyntaxFacts.IsAnyOverloadableOperator(operatorToken.Kind)); 1141Debug.Assert(CurrentToken.Kind == SyntaxKind.ExplicitKeyword || 1204Debug.Assert(CurrentToken.Kind != SyntaxKind.CommaToken);
Parser\LanguageParser.cs (117)
211Debug.Assert(_recursionDepth == 0); 251Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NamespaceKeyword); 282Debug.Assert(semicolon != null || openBrace != null); 289Debug.Assert(semicolon != null); 570Debug.Assert(!IsInAsync); 932Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ExternKeyword); 943Debug.Assert(this.IsNamedAssignment()); 960Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UsingKeyword); 1352Debug.Assert(!(forAccessors && forTopLevelStatements)); 1360Debug.Assert(newMod != DeclarationModifiers.Scoped); 1469Debug.Assert(modTok.Kind is not (SyntaxKind.OutKeyword or SyntaxKind.InKeyword)); 1495Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken && GetModifierExcludingScoped(this.CurrentToken) != DeclarationModifiers.None); 1613Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1654Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.PartialKeyword); 1688Debug.Assert(!IsInAsync); 1710Debug.Assert(CurrentToken.ContextualKind == SyntaxKind.RecordKeyword); 1720Debug.Assert(this.CurrentToken.Kind is SyntaxKind.ClassKeyword or SyntaxKind.StructKeyword or SyntaxKind.InterfaceKeyword || 1724Debug.Assert(!IsInAsync); 2057Debug.Assert((_termState & TerminatorState.IsEndOfRecordOrClassOrStructOrInterfaceSignature) != 0); 2477Debug.Assert(!IsInAsync); 2478Debug.Assert(parentKind == SyntaxKind.CompilationUnit); 2770Debug.Assert(identifierOrThisOpt != null); 3047Debug.Assert(!IsInAsync); 3048Debug.Assert(parentKind != SyntaxKind.CompilationUnit); 3174Debug.Assert(identifierOrThisOpt != null); 3359Debug.Assert(this.CurrentToken.Kind == SyntaxKind.TildeToken); 3504Debug.Assert(!IsInAsync); 3846Debug.Assert(type != null); // How could it be? The only caller got it from ParseReturnType. 3967Debug.Assert(thisKeyword.Kind == SyntaxKind.ThisKeyword); 4041Debug.Assert(IsStartOfPropertyBody(this.CurrentToken.Kind)); 4668Debug.Assert(parent.Kind() == SyntaxKind.ParameterList); 4788Debug.Assert(this.CurrentToken.Kind == SyntaxKind.FixedKeyword); 4806Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EventKeyword); 4857Debug.Assert(identifierOrThisOpt.Kind == SyntaxKind.ThisKeyword); 4865Debug.Assert(identifier != null); 4866Debug.Assert(identifier.Kind == SyntaxKind.IdentifierToken); 5007Debug.Assert(localFunction == null); 5086Debug.Assert(localFunction is null); 5440Debug.Assert(this.CurrentToken.Kind is SyntaxKind.OpenParenToken or SyntaxKind.LessThanToken); 5497Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DelegateKeyword); 5530Debug.Assert(this.CurrentToken.Kind == SyntaxKind.EnumKeyword); 5879Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 5952Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 6036Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6049Debug.Assert(start.Kind == SyntaxKind.LessThanToken); 6050Debug.Assert(greaterThanToken.Kind == SyntaxKind.GreaterThanToken); 6222Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6428Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LessThanToken); 6552Debug.Assert(beforeIdentifierPointSet); 6735Debug.Assert(separator.Kind is SyntaxKind.DotToken or SyntaxKind.ColonColonToken); 6876Debug.Assert(mode != ParseTypeMode.NewExpression); 6908Debug.Assert(this.CurrentToken.Kind is SyntaxKind.IdentifierToken); 6919Debug.Assert(result is ScanTypeFlags.GenericTypeOrExpression or ScanTypeFlags.GenericTypeOrMethod or ScanTypeFlags.NonGenericTypeOrExpression); 6940Debug.Assert(result is ScanTypeFlags.GenericTypeOrExpression or ScanTypeFlags.GenericTypeOrMethod or ScanTypeFlags.NonGenericTypeOrExpression); 7094Debug.Assert(IsFunctionPointerStart()); 7135Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7291Debug.Assert(type != null); 7358Debug.Assert(type != null); 7365Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 7690Debug.Assert(IsFunctionPointerStart()); 7739Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 7819Debug.Assert(CurrentToken.Kind == SyntaxKind.CommaToken); 8192Debug.Assert(PeekToken(1).Kind != SyntaxKind.OpenParenToken); 8198Debug.Assert(PeekToken(2).Kind != SyntaxKind.OpenParenToken); 8533Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 8938Debug.Assert(this.CurrentToken.Kind is SyntaxKind.TryKeyword or SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 8951Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CatchKeyword or SyntaxKind.FinallyKeyword); 9014Debug.Assert(this.CurrentToken.Kind == SyntaxKind.CatchKeyword); 9097Debug.Assert(this.CurrentToken.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 9114Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DoKeyword); 9155Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9176Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9320Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ForEachKeyword || this.CurrentToken.Kind == SyntaxKind.ForKeyword); 9422Debug.Assert(mode is ParseTypeMode.Normal or ParseTypeMode.FirstElementOfPossibleTupleLiteral or ParseTypeMode.AfterTupleComma); 9537Debug.Assert(this.CurrentToken.Kind == SyntaxKind.GotoKeyword); 9570Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IfKeyword); 9635Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ElseKeyword); 9658Debug.Assert(this.CurrentToken.Kind == SyntaxKind.LockKeyword); 9670Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ReturnKeyword); 9680Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.YieldKeyword); 9717Debug.Assert(this.CurrentToken.Kind is SyntaxKind.SwitchKeyword or SyntaxKind.CaseKeyword); 9763Debug.Assert(parenExpression.GetDiagnostics().Length == 0); 9793Debug.Assert(this.IsPossibleSwitchSection()); 9843Debug.Assert(this.CurrentToken.Kind == SyntaxKind.DefaultKeyword); 9865Debug.Assert(this.CurrentToken.Kind == SyntaxKind.ThrowKeyword); 9875Debug.Assert(this.CurrentToken.Kind == SyntaxKind.UnsafeKeyword); 10000Debug.Assert(st != ScanTypeFlags.NullableType); 10011Debug.Assert(this.CurrentToken.Kind == SyntaxKind.WhileKeyword); 10025Debug.Assert(this.IsTrueIdentifier() && this.PeekToken(1).Kind == SyntaxKind.ColonToken); 10291Debug.Assert(localFunction == null); 10395Debug.Assert(this.CurrentToken.Kind == SyntaxKind.IdentifierToken); 11417Debug.Assert(IsAtDotDotToken()); 11651Debug.Assert(expr != null); 11743Debug.Assert(this.CurrentToken.Kind == SyntaxKind.BaseKeyword); 11823Debug.Assert(this.CurrentToken.Kind == SyntaxKind.QuestionToken); 11858Debug.Assert(this.CurrentToken.Kind is SyntaxKind.DotToken or SyntaxKind.OpenBracketToken); 11956Debug.Assert(openKind is SyntaxKind.OpenParenToken or SyntaxKind.OpenBracketToken); 11957Debug.Assert(closeKind is SyntaxKind.CloseParenToken or SyntaxKind.CloseBracketToken); 11958Debug.Assert((openKind == SyntaxKind.OpenParenToken) == (closeKind == SyntaxKind.CloseParenToken)); 12154Debug.Assert(checkedOrUnchecked.Kind is SyntaxKind.CheckedKeyword or SyntaxKind.UncheckedKeyword); 12188Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12219Debug.Assert(CurrentToken.Kind == SyntaxKind.OpenParenToken); 12295Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenParenToken); 12695Debug.Assert(this.CurrentToken.Kind == SyntaxKind.NewKeyword); 12714Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBracketToken); 12760Debug.Assert(IsAnonymousType()); 12763Debug.Assert(this.CurrentToken.Kind == SyntaxKind.OpenBraceToken); 13043Debug.Assert(this.CurrentToken.Kind is SyntaxKind.NewKeyword or SyntaxKind.StackAllocKeyword); 13252Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.AsyncKeyword); 13652Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.FromKeyword); 13685Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.JoinKeyword); 13705Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.LetKeyword); 13715Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.WhereKeyword); 13723Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.OrderByKeyword); 13786Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.SelectKeyword); 13794Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.GroupKeyword); 13804Debug.Assert(this.CurrentToken.ContextualKind == SyntaxKind.IntoKeyword);
Parser\LanguageParser_InterpolatedString.cs (9)
40Debug.Assert(this.CurrentToken.Kind == SyntaxKind.InterpolatedStringToken); 45Debug.Assert(originalText[0] == '$' || originalText[0] == '@'); 68Debug.Assert(originalToken.ToFullString() == result.ToFullString()); // yield from text equals yield from node 147Debug.Assert(closeQuoteText[afterWhitespace] == '"'); 387Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 402Debug.Assert(text[interpolation.OpenBraceRange.Start..interpolation.CloseBraceRange.End] == result.ToFullString()); // yield from text equals yield from node 459Debug.Assert(kind is Lexer.InterpolatedStringKind.Normal or Lexer.InterpolatedStringKind.Verbatim); 468Debug.Assert(token.Kind == SyntaxKind.StringLiteralToken); 478Debug.Assert(infos.Length > 0);
Parser\LanguageParser_Patterns.cs (1)
209Debug.Assert(precedence < Precedence.Shift);
Parser\Lexer.cs (42)
120Debug.Assert(options != null); 344Debug.Assert(info.Kind != SyntaxKind.IdentifierToken || info.StringValue != null); 426Debug.Assert(SyntaxFacts.IsPunctuationOrKeyword(info.Kind)); 634Debug.Assert(TextWindow.PeekChar() == '@'); 758Debug.Assert(TextWindow.PeekChar() == '@'); 784Debug.Assert(TextWindow.PeekChar() == '$'); 1057Debug.Assert(info.Text != null); 1155Debug.Assert(hasUSuffix && hasLSuffix); 1624Debug.Assert(string.Equals(info.Text.Substring(0, objectAddressOffset + 1), "@0x", StringComparison.OrdinalIgnoreCase)); 1660Debug.Assert(InXmlCrefOrNameAttributeValue); 2094Debug.Assert(firstCh is '<' or '|' or '=' or '>'); 2234Debug.Assert(delimiter is '/' or '@'); 2235Debug.Assert(TextWindow.PeekChar() == delimiter && TextWindow.PeekChar(1) == '*'); 2717Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 2812Debug.Assert(this.LocationIs(XmlDocCommentLocation.End) || TextWindow.PeekChar() == SlidingTextWindow.InvalidCharacter); 2848Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 2849Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 2893Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 2907Debug.Assert(TextWindow.PeekChar() == '<'); 2956Debug.Assert(TextWindow.PeekChar() == '&'); 3215Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3216Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3311Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 3388Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3389Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3455Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 3546Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3547Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3606Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 3607Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 3891Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null); 4012Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4013Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4134Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4135Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4265Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start)); 4266Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior)); 4477Debug.Assert(this.StyleIs(XmlDocCommentStyle.Delimited)); 4642Debug.Assert(character == '\\'); 4692Debug.Assert(character == 'u' || character == 'x'); 4746Debug.Assert(TextWindow.PeekChar() == '&'); 4860Debug.Assert(codepoint > 0x0000FFFF && codepoint <= 0x0010FFFF);
Parser\Lexer_RawStringLiteral.cs (6)
63Debug.Assert(startingQuoteCount >= 3); 101Debug.Assert(info.StringValue != null); 104Debug.Assert(info.Kind is (SyntaxKind.SingleLineRawStringLiteralToken or SyntaxKind.MultiLineRawStringLiteralToken)); 197Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar())); 224Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar())); 317Debug.Assert(SyntaxFacts.IsNewLine(TextWindow.PeekChar()));
Parser\Lexer_StringLiteral.cs (24)
17Debug.Assert(quoteCharacter is '\'' or '"'); 63Debug.Assert(TextWindow.Width > 0); 134Debug.Assert(ch == '\\'); 194Debug.Assert(TextWindow.PeekChar() == '@'); 208Debug.Assert(TextWindow.PeekChar() == '"'); 383Debug.Assert(_lexer.TextWindow.Position != start); 448Debug.Assert(startingDollarSignCount > 0); 458Debug.Assert(totalAtCount + startingDollarSignCount + startingQuoteCount >= 2); 518Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 529Debug.Assert(kind is InterpolatedStringKind.Normal or InterpolatedStringKind.Verbatim); 535Debug.Assert(IsAtEnd(kind)); 550Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 558Debug.Assert(IsAtEnd(kind)); 574Debug.Assert(closeQuoteCount >= startingQuoteCount); 604Debug.Assert(closeQuoteCount >= startingQuoteCount); 621Debug.Assert(closeQuoteCount >= startingQuoteCount); 769Debug.Assert(kind == InterpolatedStringKind.Verbatim); 781Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 818Debug.Assert(kind is InterpolatedStringKind.MultiLineRaw or InterpolatedStringKind.SingleLineRaw); 850Debug.Assert(kind is InterpolatedStringKind.Normal or InterpolatedStringKind.Verbatim); 879Debug.Assert(kind is InterpolatedStringKind.SingleLineRaw or InterpolatedStringKind.MultiLineRaw); 953Debug.Assert(_lexer.TextWindow.PeekChar() == ':'); 1039Debug.Assert(colonRange.Equals(default(Range))); 1139Debug.Assert(start == _lexer.TextWindow.PeekChar());
Parser\QuickScanner.cs (1)
261Debug.Assert(quickWidth == token.FullWidth);
Parser\SlidingTextWindow.cs (3)
303Debug.Assert(SyntaxFacts.IsNewLine(this.PeekChar())); 309Debug.Assert(SyntaxFacts.IsNewLine(currentChar)); 478Debug.Assert(codepoint > 0x0000FFFF && codepoint <= 0x0010FFFF);
Parser\SyntaxParser.cs (19)
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)); 583Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 597Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 611Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 630Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 644Debug.Assert(SyntaxFacts.IsAnyToken(kind)); 1179Debug.Assert(!assertIfFalse);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
SymbolDisplay\SymbolDisplay.cs (2)
268Debug.Assert(semanticModelOpt == null); 269Debug.Assert(positionOpt < 0);
SymbolDisplay\SymbolDisplayVisitor.cs (2)
90Debug.Assert(visitor != this); 371Debug.Assert((object)containingType != null || (symbol.ContainingSymbol is ITypeSymbol));
SymbolDisplay\SymbolDisplayVisitor.Members.cs (7)
395Debug.Assert(containingType != null); 614Debug.Assert(!conventionTypes.IsDefaultOrEmpty); 625Debug.Assert(conventionType.Name.StartsWith("CallConv")); 689Debug.Assert(operatorKind != SyntaxKind.None); 735Debug.Assert(conversionKind != SyntaxKind.None); 926Debug.Assert(containingType != null || (symbol.ContainingSymbol is ITypeSymbol)); 1051Debug.Assert(implementedMember.ContainingType != null);
SymbolDisplay\SymbolDisplayVisitor.Types.cs (7)
247Debug.Assert(symbol.DelegateInvokeMethod is not null); 312Debug.Assert(symbol.IsTupleType); 390Debug.Assert(symbol.Arity > 0); 450Debug.Assert(symbol.DelegateInvokeMethod is not null); 500Debug.Assert(tupleSymbol.IsTupleType); 539Debug.Assert(symbol.IsTupleType); 705Debug.Assert(!symbol.IsRefLikeType);
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 (2)
63Debug.Assert(symbol.ContainingNamespace != null || symbol.IsGlobalNamespace); 94Debug.Assert(Format.GlobalNamespaceStyle == SymbolDisplayGlobalNamespaceStyle.Included ||
Symbols\AbstractTypeMap.cs (4)
27Debug.Assert((object)previous.ConstructedFrom == (object)previous); 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 (3)
57Debug.Assert(locations.Length == 1 || (locations.IsEmpty && aliasName == "global")); // It looks like equality implementation depends on this condition. 58Debug.Assert(containingSymbol is not null); 288Debug.Assert(syntax.Alias is object);
Symbols\AnonymousTypes\AnonymousTypeDescriptor.cs (3)
53Debug.Assert(!this.Fields.IsDefault); 103Debug.Assert(!newFieldTypes.IsDefault); 104Debug.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); 46Debug.Assert((object)type != null); 47Debug.Assert(type.IsAnonymousType); 58Debug.Assert(type.IsAnonymousType); 70Debug.Assert(!newFieldTypes.IsDefault); 71Debug.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)
104Debug.Assert(_sourceLocationsSeen.ContainsKey(location)); 163Debug.Assert(refKinds.IsNull || parameterCount == refKinds.Capacity - (returnsVoid ? 0 : 1)); 188Debug.Assert(typeDescr.Location.IsInSource); // AnonymousDelegateTemplateSymbol requires a location in source for ordering. 198Debug.Assert(fields.All(f => hasDefaultScope(useUpdatedEscapeRules, f))); 208Debug.Assert(needsIndexedName); 209Debug.Assert(i == fields.Length - 2); 210Debug.Assert(field.Type.IsSZArray()); 224Debug.Assert(nTypeArguments != 0); 232Debug.Assert(lastParam.Type.IsSZArray()); 270Debug.Assert(typeArguments.Length == template.TypeParameters.Length); 293Debug.Assert(typeParameters.Length == template.TypeParameters.Length); 345Debug.Assert(changed); 400Debug.Assert(isContainedIn(yOwner, xOwner)); 428Debug.Assert(ReferenceEquals(this, anonymous.Manager)); 490Debug.Assert(!key.IsDelegate); 607Debug.Assert(!builder.Any()); 625Debug.Assert(!builder.Any()); 647Debug.Assert(!builder.Any()); 758Debug.Assert((object)type != null); 767Debug.Assert((object)type != null); 768Debug.Assert(type.IsAnonymousType); 779Debug.Assert((object)method != null);
Symbols\AnonymousTypes\PublicSymbols\AnonymousType.TypePublicSymbol.cs (1)
55Debug.Assert(membersCount == _members.Length);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.DelegateTemplateSymbol.cs (7)
40Debug.Assert(refKinds.IsNull || parameterCount == refKinds.Capacity - (voidReturnTypeOpt is { } ? 0 : 1)); 102Debug.Assert(SmallestLocation != null); 103Debug.Assert(SmallestLocation != Location.None); 135Debug.Assert(field.Type.IsSZArray()); 136Debug.Assert(i == parameterCount - 1); 162Debug.Assert(SmallestLocation != null); 163Debug.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)
67Debug.Assert(_smallestLocation != null); 80Debug.Assert(value != null); 82Debug.Assert(oldValue == null || 93Debug.Assert(location.IsInSource);
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.TypeParameterSymbol.cs (2)
27Debug.Assert((object)container != null); 28Debug.Assert(!string.IsNullOrEmpty(name));
Symbols\ArrayTypeSymbol.cs (7)
29Debug.Assert(elementTypeWithAnnotations.HasType); 413Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 479Debug.Assert(nullableAnnotation != DefaultNullableAnnotation); 517Debug.Assert(constructedInterfaces.Length <= 2); 575Debug.Assert(rank >= 1); 638Debug.Assert(!sizes.IsDefaultOrEmpty || !lowerBounds.IsDefault); 639Debug.Assert(lowerBounds.IsDefaultOrEmpty || (!lowerBounds.IsEmpty && (lowerBounds.Length != rank || !lowerBounds.All(b => b == 0))));
Symbols\AssemblySymbol.cs (24)
64Debug.Assert((object)_corLibrary == null); 500Debug.Assert(SpecialMembers.GetDescriptor(feature).DeclaringSpecialType == SpecialType.System_Runtime_CompilerServices_RuntimeFeature); 653Debug.Assert(result?.IsErrorType() != true); 698Debug.Assert(parts.Length > 0); 708Debug.Assert(!type.IsErrorType()); 720Debug.Assert(!type.IsErrorType()); 735Debug.Assert(type?.IsErrorType() != true); 752Debug.Assert(!typeInfo.IsByRef); 755Debug.Assert(!typeInfo.ContainsGenericParameters); 781Debug.Assert(!typeInfo.IsArray); 791Debug.Assert(currentTypeInfo.IsGenericTypeDefinition || !currentTypeInfo.IsGenericType); 815Debug.Assert(symbol?.IsErrorType() != true); 830Debug.Assert(typeArgumentIndex == genericArguments.Length); 849Debug.Assert(!symbol.IsErrorType()); 854Debug.Assert(typeArgumentIndex == genericArguments.Length); 864Debug.Assert(remainingTypeArguments >= symbol.Arity); 902Debug.Assert(warnings is null || isWellKnownType); 909Debug.Assert(result?.IsErrorType() != true); 931Debug.Assert(corLibCandidate?.IsErrorType() != true); 966Debug.Assert(candidate?.IsErrorType() != true); 973Debug.Assert(!TypeSymbol.Equals(candidate, result, TypeCompareKind.ConsiderEverything)); 1011Debug.Assert(result?.IsErrorType() != true); 1048Debug.Assert(result?.IsErrorType() != true); 1049Debug.Assert(result is null || ReferenceEquals(result.ContainingAssembly, assembly));
Symbols\Attributes\AttributeData.cs (20)
90Debug.Assert(!attributeType.IsErrorType()); 218Debug.Assert(!this.HasErrors); 219Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 247Debug.Assert(arguments.AttributeSyntaxOpt is object); 298Debug.Assert(arguments.AttributeSyntaxOpt is object); 341Debug.Assert((object)targetSymbol != null); 342Debug.Assert(targetSymbol.Kind == SymbolKind.Assembly || targetSymbol.Kind == SymbolKind.NamedType || targetSymbol.Kind == SymbolKind.Method); 343Debug.Assert(this.IsSecurityAttribute(compilation)); 384Debug.Assert((object)targetSymbol != null); 385Debug.Assert(targetSymbol.Kind == SymbolKind.Assembly || targetSymbol.Kind == SymbolKind.NamedType || targetSymbol.Kind == SymbolKind.Method); 386Debug.Assert(typedValue.ValueInternal is object); 510Debug.Assert(!this.HasErrors); 518Debug.Assert(AttributeClass is object); 574Debug.Assert(!this.HasErrors); 577Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 599Debug.Assert(!this.HasErrors); 602Debug.Assert(ctorArgument.Kind == TypedConstantKind.Enum || ctorArgument.Kind == TypedConstantKind.Primitive); 625Debug.Assert(!this.HasErrors); 674Debug.Assert(target is SourceAssemblySymbol || target.ContainingAssembly is SourceAssemblySymbol); 807Debug.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 (8)
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);
Symbols\Compilation_UsedAssemblies.cs (3)
175Debug.Assert(!dependency.IsLinked); 193Debug.Assert(retargetingAssembly.Modules[0].ReferencedAssemblySymbols.Contains(underlyingDependency)); 254Debug.Assert(!added || !wasFrozen);
Symbols\Compilation_WellKnownMembers.cs (23)
54Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 66Debug.Assert(!_needsGeneratedAttributes_IsFrozen); 79Debug.Assert(member >= 0 && member < WellKnownMember.Count); 123Debug.Assert(type.IsValid()); 151Debug.Assert(result?.IsErrorType() != true); 162Debug.Assert(conflicts.Item2 is null); 180Debug.Assert( 218Debug.Assert(wellKnownType == WellKnownType.System_Attribute || 264Debug.Assert(!isStatic); 399Debug.Assert(isOptionalUse || WellKnownMembers.IsSynthesizedAttributeOptional(constructor)); 422Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(constructor)); 445Debug.Assert(isOptionalUse); 514Debug.Assert(!modifyCompilation || !_needsGeneratedAttributes_IsFrozen); 565Debug.Assert(ShouldEmitNativeIntegerAttributes()); 624Debug.Assert(ShouldEmitNativeIntegerAttributes()); 676Debug.Assert(errorReported); 778Debug.Assert(type.ContainsDynamic()); 798Debug.Assert(type.ContainsTuple()); 893Debug.Assert(flagsBuilder.Any()); 894Debug.Assert(flagsBuilder.Contains(true)); 917Debug.Assert(!transformFlagsBuilder.Any()); 965Debug.Assert(!isNestedNamedType); 1043Debug.Assert(type.ContainingAssembly?.RuntimeSupportsNumericIntPtr != true);
Symbols\ConstantValueUtils.cs (1)
50Debug.Assert(value != null);
Symbols\ConstraintsHelper.cs (32)
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); 605Debug.Assert(tuple.IsTupleType); 676Debug.Assert(typeArgumentsSyntax.Count == 0 /*omitted*/ || typeArgumentsSyntax.Count == type.Arity); 713Debug.Assert(args.CurrentCompilation is object); 900Debug.Assert(typeParameters.Length == typeArguments.Length); 901Debug.Assert(typeParameters.Length > 0); 902Debug.Assert(!args.Conversions.IncludeNullability || (nullabilityDiagnosticsBuilderOpt != null)); 1039Debug.Assert(substitution != null); 1042Debug.Assert(ReferenceEquals(typeParameter.ContainingSymbol, containingSymbol.OriginalDefinition)); 1383Debug.Assert(iface.IsInterfaceType()); 1488Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct); 1525Debug.Assert(IsValidEncompassedByArgument(a)); 1526Debug.Assert(IsValidEncompassedByArgument(b)); 1529Debug.Assert(!conversions.IncludeNullability); 1567Debug.Assert(!type.ConstructedFrom.Equals(type, TypeCompareKind.ConsiderEverything)); 1589Debug.Assert(method.ConstructedFrom != method); 1596Debug.Assert((object)deducedBase != null); 1597Debug.Assert((object)effectiveBase != null); 1599Debug.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)
15Debug.Assert(typeWithAnnotations.Type is object);
Symbols\DynamicTypeEraser.cs (1)
20Debug.Assert((object)objectType != null);
Symbols\DynamicTypeSymbol.cs (2)
233Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 244Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\ErrorMethodSymbol.cs (1)
283Debug.Assert(MethodKind == MethodKind.Constructor);
Symbols\ErrorTypeSymbol.cs (3)
475Debug.Assert(this.IsDefinition); 476Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol?.OriginalDefinition)); 556Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\EventSymbol.cs (4)
262Debug.Assert(this.IsDefinition); 263Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 264Debug.Assert(newOwner.IsDefinition || newOwner is SubstitutedNamedTypeSymbol); 284Debug.Assert(this.IsDefinition);
Symbols\ExtendedErrorTypeSymbol.cs (1)
35Debug.Assert(((object?)containingSymbol == 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 (15)
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); 545Debug.Assert(retAndParamTypes.Length > 0); 554Debug.Assert(RefKind != RefKind.Out);
Symbols\FunctionPointers\FunctionPointerParameterSymbol.cs (1)
18Debug.Assert(typeWithAnnotations.HasType);
Symbols\FunctionPointers\FunctionPointerTypeSymbol.cs (3)
126Debug.Assert(nullableAnnotation != DefaultNullableAnnotation); 162Debug.Assert(this.Equals(other, TypeCompareKind.AllIgnoreOptions)); 208Debug.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 (4)
503Debug.Assert(sawInterfaceInName2); 628Debug.Assert(member1.GetMemberArity() == member2.GetMemberArity()); 643Debug.Assert(typeParameters1.Length == typeParameters2.Length); 768Debug.Assert(params1.Length == params2.Length);
Symbols\MemberSymbolExtensions.cs (4)
129Debug.Assert(symbol.ContainingType.IsInterface); 550Debug.Assert(member.IsDefinition); 559Debug.Assert(member.IsDefinition); 568Debug.Assert(member.IsDefinition);
Symbols\MergedNamespaceSymbol.cs (2)
83Debug.Assert(namespacesToMerge.Length != 0); 103Debug.Assert(ns.ConstituentNamespaces.Length == 1);
Symbols\Metadata\PE\DynamicTypeDecoder.cs (15)
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); 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)
62Debug.Assert(!handle.IsNil); 160Debug.Assert(candidateAssociatedField.DeclaredAccessibility == Accessibility.Private);
Symbols\Metadata\PE\PEFieldSymbol.cs (9)
55Debug.Assert((value & ~(FlowAnalysisAnnotations.DisallowNull | FlowAnalysisAnnotations.AllowNull | FlowAnalysisAnnotations.MaybeNull | FlowAnalysisAnnotations.NotNull)) == 0); 76Debug.Assert(value == 0 || result); 83Debug.Assert(IsVolatile == isVolatile); 92Debug.Assert(RefKind == refKind); 139Debug.Assert((object)moduleSymbol != null); 140Debug.Assert((object)containingType != null); 141Debug.Assert(!fieldDef.IsNil); 291Debug.Assert((object)eventSymbol != null); 292Debug.Assert(TypeSymbol.Equals(eventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2));
Symbols\Metadata\PE\PEGlobalNamespaceSymbol.cs (1)
31Debug.Assert((object)moduleSymbol != null);
Symbols\Metadata\PE\PEMethodSymbol.cs (30)
123Debug.Assert((int)value == ((int)value & MethodKindMask)); 170Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 177Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 183Debug.Assert((int)methodKind == ((int)methodKind & MethodKindMask)); 185Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 195Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 250Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet)); 406Debug.Assert((object)moduleSymbol != null); 407Debug.Assert((object)containingType != null); 408Debug.Assert(!methodDef.IsNil); 420Debug.Assert((uint)implFlags <= ushort.MaxValue); 433Debug.Assert((uint)localflags <= ushort.MaxValue); 455Debug.Assert(flag != 0 && ((ushort)flag & ((ushort)flag - 1)) == 0); 611Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated); 624Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated); 711Debug.Assert(!memberNotNull.IsDefault); 719Debug.Assert(!memberNotNullWhenTrue.IsDefault); 725Debug.Assert(!memberNotNullWhenFalse.IsDefault); 786Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet)); 796Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove)); 804Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2)); 812Debug.Assert( 1052Debug.Assert(!attributeData.IsDefault); 1445Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.Uninitialized)); 1446Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound)); 1528Debug.Assert(!result.IsDefault); 1556Debug.Assert(MethodKind == MethodKind.Constructor); 1612Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyData, UnmanagedCallersOnlyAttributeData.Uninitialized) 1636Debug.Assert(result != null); 1718Debug.Assert(_uncommonFields is null or { _lazyOverloadResolutionPriority: 0 });
Symbols\Metadata\PE\PEModuleSymbol.cs (16)
128Debug.Assert(ordinal >= 0); 134Debug.Assert(ordinal > 0); 140Debug.Assert(ordinal > 0); 145Debug.Assert((object)assemblySymbol != null); 146Debug.Assert(module != null); 491Debug.Assert(added); 563Debug.Assert((object)_lazyEventRegistrationTokenSymbol != null); 580Debug.Assert((object)_lazyEventRegistrationTokenTableSymbol != null); 595Debug.Assert((object)_lazySystemTypeSymbol != null); 606Debug.Assert(currentModuleResult?.IsErrorType() != true); 610Debug.Assert(isAcceptableSystemTypeSymbol(currentModuleResult)); 645Debug.Assert(isAcceptableSystemTypeSymbol(referencedAssemblyResult)); 714Debug.Assert(result?.IsErrorType() != true); 793Debug.Assert(symbol is object); 794Debug.Assert(symbol.IsDefinition); 795Debug.Assert((object)symbol.ContainingModule == this);
Symbols\Metadata\PE\PENamedTypeSymbol.cs (21)
284Debug.Assert(!handle.IsNil); 285Debug.Assert((object)container != null); 286Debug.Assert(arity == 0 || this is PENamedTypeSymbolGeneric); 322Debug.Assert(ReferenceEquals(_name, metadataName) == (_name == metadataName)); 753Debug.Assert(uncommon.lazyHasRequiredMembers.Value() != requiredHandle.IsNil); 1000Debug.Assert(instanceIndex == uncommon.lazyInstanceEnumFields.Length); 1001Debug.Assert(staticIndex == staticFields.Length || staticFields[staticIndex].Kind != SymbolKind.Field); 1023Debug.Assert((object)associatedField.AssociatedSymbol != null); 1024Debug.Assert(!nonEventFields.Contains(associatedField)); 1300Debug.Assert(SymbolKind.Field.ToSortOrder() < SymbolKind.Method.ToSortOrder()); 1301Debug.Assert(SymbolKind.Method.ToSortOrder() < SymbolKind.Property.ToSortOrder()); 1302Debug.Assert(SymbolKind.Property.ToSortOrder() < SymbolKind.Event.ToSortOrder()); 1303Debug.Assert(SymbolKind.Event.ToSortOrder() < SymbolKind.NamedType.ToSortOrder()); 1399Debug.Assert(field.AssociatedSymbol.Kind == SymbolKind.Event); 1434Debug.Assert(previous.Kind.ToSortOrder() <= current.Kind.ToSortOrder()); 1447Debug.Assert(members is object); 2186Debug.Assert(DeriveCompilerFeatureRequiredDiagnostic() is null); 2402Debug.Assert(!conditionalSymbols.IsDefault); 2606Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr); 2650Debug.Assert(genericParameterHandles.Count > 0); 2715Debug.Assert(_arity > 0);
Symbols\Metadata\PE\PENamespaceSymbol.cs (3)
209Debug.Assert(typesByNS != null); 340Debug.Assert(isNoPiaLocalType); 341Debug.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 (23)
147Debug.Assert(value == 0 || result); 246Debug.Assert((object)moduleSymbol != null); 247Debug.Assert((object)containingSymbol != null); 248Debug.Assert(ordinal >= 0); 249Debug.Assert(typeWithAnnotations.HasType); 333Debug.Assert(refKind != RefKind.None); 362Debug.Assert(refKind == this.RefKind); 363Debug.Assert(hasNameInMetadata == this.HasNameInMetadata); 364Debug.Assert(_name is not null); 401Debug.Assert(parameter.RefKind != RefKind.RefReadOnlyParameter); 439Debug.Assert(_refCustomModifiers.IsEmpty || isByRef); 534Debug.Assert(!_handle.IsNil); 574Debug.Assert(!_handle.IsNil); 831Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 842Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 853Debug.Assert(indexes != s_defaultStringHandlerAttributeIndexes); 855Debug.Assert(initialized == s_defaultStringHandlerAttributeIndexes || indexes == initialized || indexes.SequenceEqual(initialized)); 973Debug.Assert(!_handle.IsNil); 987Debug.Assert(!_handle.IsNil); 1059Debug.Assert(!_handle.IsNil); 1133Debug.Assert(filterOutParamArrayAttribute); 1134Debug.Assert(filterOutParamCollectionAttribute); 1156Debug.Assert(!_lazyHiddenAttributes.IsDefault);
Symbols\Metadata\PE\PEPropertySymbol.cs (8)
193Debug.Assert((object)moduleSymbol != null); 194Debug.Assert((object)containingType != null); 195Debug.Assert(!handle.IsNil); 201Debug.Assert(propertyParams.Length > 0); 837Debug.Assert((getMethodParams == null) == ((object)getMethod == null)); 838Debug.Assert((setMethodParams == null) == ((object)setMethod == null)); 1048Debug.Assert(IsIndexer || IsIndexedProperty); 1060Debug.Assert(_uncommonFields is null or { _lazyOverloadResolutionPriority: 0 });
Symbols\Metadata\PE\PETypeParameterSymbol.cs (18)
71Debug.Assert((object)moduleSymbol != null); 72Debug.Assert((object)definingSymbol != null); 73Debug.Assert(ordinal >= 0); 74Debug.Assert(!handle.IsNil); 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); 661Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 666Debug.Assert(!constraintTypes.IsDefault); 697Debug.Assert(_lazyCachedConstraintsUseSiteInfo.IsInitialized); 704Debug.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 (12)
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); 252Debug.Assert(result != IVTConclusion.NoRelationshipClaimed);
Symbols\MethodSymbol.cs (8)
229Debug.Assert(this.RefKind != RefKind.Out); 391Debug.Assert(!(this is IAttributeTargetSymbol)); //such types must override 529Debug.Assert(conditionalSymbols != null); 889Debug.Assert(this.IsDefinition); 890Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 953Debug.Assert(this.IsDefinition); 1012Debug.Assert(callConvTypedConstant.Kind == TypedConstantKind.Type); 1038Debug.Assert((node == null) == (diagnostics == null));
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)
33Debug.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)
32Debug.Assert((object)assembly != null); 33Debug.Assert(ordinal >= -1); 214Debug.Assert(name != null);
Symbols\MissingNamespaceSymbol.cs (3)
25Debug.Assert((object)containingModule != null); 33Debug.Assert((object)containingNamespace != null); 34Debug.Assert(name != null);
Symbols\NamedTypeSymbol.cs (21)
259Debug.Assert(includeInstance || includeStatic); 278Debug.Assert(method.MethodKind == MethodKind.Constructor); 286Debug.Assert(method.MethodKind == MethodKind.StaticConstructor); 317Debug.Assert(((PropertySymbol)candidate).IsIndexer); 365Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 438Debug.Assert(IsScriptClass); 444Debug.Assert(IsScriptClass); 450Debug.Assert(IsScriptClass); 483Debug.Assert(!(fileIdentifier != null && !MangleName && Arity > 0)); 533Debug.Assert(!_lazyRequiredMembers.IsDefault); 558Debug.Assert(!_lazyRequiredMembers.IsDefault); 877Debug.Assert(count == otherTypeArguments.Length); 990Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 1031Debug.Assert(typeA.IsGenericType); 1032Debug.Assert(typeA.Equals(typeB, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 1211Debug.Assert(!unbound || typeArguments.All(TypeWithAnnotationsIsErrorType)); 1351Debug.Assert(this.IsDefinition); 1352Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 1445Debug.Assert(owner.ContainingModule.HasUnifiedReferences); 1665Debug.Assert(tupleCardinality < ValueTupleRestPosition); 1698Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\NamespaceOrTypeSymbol.cs (8)
223Debug.Assert(memberT.MergedDeclaration.Declarations.SelectAsArray(decl => decl.NameLocation).SequenceEqual(memberT.Locations)); 256Debug.Assert(!emittedTypeName.IsNull); 259Debug.Assert(scope is not MergedNamespaceSymbol); 260Debug.Assert(scope is NamespaceSymbol or NamedTypeSymbol); 272Debug.Assert(!isTopLevel || scope.ToDisplayString(SymbolDisplayFormat.QualifiedNameOnlyFormat) == emittedTypeName.NamespaceName); 276Debug.Assert(!emittedTypeName.UnmangledTypeName.Equals(emittedTypeName.TypeName) && emittedTypeName.InferredArity > 0); 302Debug.Assert(ReferenceEquals(emittedTypeName.UnmangledTypeName, emittedTypeName.TypeName) && emittedTypeName.InferredArity == 0); 325Debug.Assert(forcedArity == emittedTypeName.InferredArity);
Symbols\NamespaceSymbol.cs (2)
234Debug.Assert(types.Length == 1); 339Debug.Assert((object)assembly != null);
Symbols\NativeIntegerTypeSymbol.cs (15)
31Debug.Assert(underlyingType.TupleData is null); 32Debug.Assert(!underlyingType.IsNativeIntegerType); 33Debug.Assert(underlyingType.SpecialType == SpecialType.System_IntPtr || underlyingType.SpecialType == SpecialType.System_UIntPtr); 34Debug.Assert(!underlyingType.ContainingAssembly.RuntimeSupportsNumericIntPtr); 82Debug.Assert(_underlyingType.Equals(underlyingMember.ContainingSymbol)); 167Debug.Assert(useSiteInfo.DiagnosticInfo is null); // If assert fails, add unit test for use site diagnostic. 269Debug.Assert(!symbolA.Equals(symbolB, TypeCompareKind.ConsiderEverything)); 270Debug.Assert(!symbolB.Equals(symbolA, TypeCompareKind.ConsiderEverything)); 271Debug.Assert(symbolA.Equals(symbolB, TypeCompareKind.IgnoreNativeIntegers)); 272Debug.Assert(symbolB.Equals(symbolA, TypeCompareKind.IgnoreNativeIntegers)); 273Debug.Assert(symbolA.GetHashCode() == symbolB.GetHashCode()); 310Debug.Assert(_specialType == SpecialType.System_IntPtr || _specialType == SpecialType.System_UIntPtr); 338Debug.Assert(!underlyingMethod.IsGenericMethod); 412Debug.Assert(container != null); 463Debug.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 (4)
47Debug.Assert(obsoleteAttributeData == null || !obsoleteAttributeData.IsUninitialized); 155Debug.Assert(result?.IsObsoleteDiagnostic() != false); 180Debug.Assert(data.Message == null); 206Debug.Assert(!isColInit || symbol.Name == WellKnownMemberNames.CollectionInitializerAddMethodName);
Symbols\OverriddenOrHiddenMembersHelpers.cs (22)
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()); 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)
28Debug.Assert(pointedAtType.HasType); 275Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 306Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\PropertySymbol.cs (3)
381Debug.Assert(this.IsDefinition); 382Debug.Assert(ReferenceEquals(newOwner.OriginalDefinition, this.ContainingSymbol.OriginalDefinition)); 400Debug.Assert(this.IsDefinition);
Symbols\PublicModel\ArrayTypeSymbol.cs (2)
26Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); 27Debug.Assert(nullableAnnotation != this.NullableAnnotation);
Symbols\PublicModel\AssemblySymbol.cs (1)
87Debug.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)
26Debug.Assert(underlying is object);
Symbols\PublicModel\ModuleSymbol.cs (1)
18Debug.Assert(underlying is object);
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)
39Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 40Debug.Assert(method.ParameterCount > 0); 41Debug.Assert((object)receiverType != null); 74Debug.Assert(method.IsExtensionMethod && method.MethodKind != MethodKind.ReducedExtension); 87Debug.Assert(!method.TypeArgumentsWithAnnotations.IsEmpty); 93Debug.Assert((object)reducedFrom != null); 94Debug.Assert(reducedFrom.IsExtensionMethod); 95Debug.Assert((object)reducedFrom.ReducedFrom == null); 96Debug.Assert(reducedFrom.ConstructedFrom == reducedFrom); 97Debug.Assert(reducedFrom.ParameterCount > 0); 115Debug.Assert(method.IsExtensionMethod); 116Debug.Assert(method.MethodKind != MethodKind.ReducedExtension); 117Debug.Assert(method.ParameterCount > 0); 118Debug.Assert((object)thisType != null); 281Debug.Assert(_reducedFrom.ConstructedFrom == _reducedFrom); 563Debug.Assert(count == 1); 623Debug.Assert(containingMethod != null); 624Debug.Assert(underlyingParameter.Ordinal > 0);
Symbols\ReferenceManager.cs (28)
94Debug.Assert(csReference.Compilation._lazyAssemblySymbol is object); 121Debug.Assert(AssemblyIdentityComparer.SimpleNameComparer.Equals(identity1.Name, identity2.Name)); 207Debug.Assert(successful); 213Debug.Assert(compilation._lazyAssemblySymbol is object); 261Debug.Assert(assembly is object); 317Debug.Assert(ReferenceEquals(compilation._referenceManager, this)); 334Debug.Assert(assemblyModules.Length == referencedModulesReferences.Length + 1); 399Debug.Assert(bindingResult.Length == allAssemblyData.Length); 434Debug.Assert(allAssemblyData[i].IsLinked == bound.AssemblySymbol.IsLinked); 544Debug.Assert(newSymbols.Count > 0); 572Debug.Assert(currentBindingResult.AssemblySymbol is object); 573Debug.Assert(currentBindingResult.ReferenceBinding is object); 594Debug.Assert(linkedAssemblySymbol is object); 625Debug.Assert(current.AssemblySymbol is object); 646Debug.Assert(currentBindingResult.AssemblySymbol is object); 647Debug.Assert(currentBindingResult.ReferenceBinding is object); 687Debug.Assert(newIndex == filteredReferencedAssemblies.Length); 723Debug.Assert(currentBindingResult.AssemblySymbol is object); 724Debug.Assert(currentBindingResult.ReferenceBinding is object); 769Debug.Assert(moduleSymbols.Length == 1 + modules.Length); 785Debug.Assert(bindingResult[0].ReferenceBinding is object); 787Debug.Assert(boundReference.ReferenceIdentity is object); 825Debug.Assert(referenceBinding.ReferenceIdentity is object); 827Debug.Assert(assembly is object); 876Debug.Assert(!referencedAssemblies.IsDefault); 1103Debug.Assert(sourceReferencedAssemblies.Length == sourceReferencedAssemblySymbols.Length); 1129Debug.Assert(result.Count == builderSize); 1163Debug.Assert(!(asm is RetargetingAssemblySymbol));
Symbols\RefKindExtensions.cs (1)
16Debug.Assert(refKind <= RefKind.RefReadOnly);
Symbols\Retargeting\RetargetingAssemblySymbol.cs (1)
104Debug.Assert((object)underlyingAssembly != null);
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 (5)
44Debug.Assert((object)retargetingModule != null); 45Debug.Assert(!(underlyingType is RetargetingNamedTypeSymbol)); 149Debug.Assert((object)method != null); 259Debug.Assert(!underlyingResult.IsErrorType()); 260Debug.Assert((object)_underlyingType == underlyingResult.ContainingSymbol);
Symbols\Retargeting\RetargetingNamespaceSymbol.cs (6)
41Debug.Assert((object)retargetingModule != null); 42Debug.Assert((object)underlyingNamespace != null); 43Debug.Assert(!(underlyingNamespace is RetargetingNamespaceSymbol)); 128Debug.Assert(t.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive); 220Debug.Assert((object)underlying.ContainingModule == (object)_retargetingModule.UnderlyingModule); 221Debug.Assert(!underlying.IsErrorType());
Symbols\Retargeting\RetargetingParameterSymbol.cs (3)
32Debug.Assert(!(underlyingParameter is RetargetingParameterSymbol)); 158Debug.Assert((object)retargetingMethod != null); 198Debug.Assert((object)retargetingProperty != null);
Symbols\Retargeting\RetargetingPropertySymbol.cs (3)
41Debug.Assert((object)retargetingModule != null); 42Debug.Assert(!(underlyingProperty is RetargetingPropertySymbol)); 172Debug.Assert(!impls.IsDefault);
Symbols\Retargeting\RetargetingSymbolTranslator.cs (37)
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()); 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)
41Debug.Assert((object)retargetingModule != null); 42Debug.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)
117Debug.Assert(result == AttributeLocation.None ^ SyntaxFacts.IsAttributeTargetSpecifier(kind));
Symbols\Source\ConstantEvaluationHelpers.cs (11)
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)
108Debug.Assert(idx < fullName.Length); 127Debug.Assert((object)unsubstitutedInterfaceType != null); 129Debug.Assert((object)explicitInterfaceType != null);
Symbols\Source\FieldSymbolWithAttributesAndModifiers.cs (11)
92Debug.Assert(completed); 95Debug.Assert(_lazyCustomAttributesBag.IsSealed); 164Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 169Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 314Debug.Assert(!boundAttributes.IsDefault); 315Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 316Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 317Debug.Assert(_lazyCustomAttributesBag != null); 318Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 319Debug.Assert(symbolPart == AttributeLocation.None); 328Debug.Assert(boundAttributes.Any());
Symbols\Source\GlobalExpressionVariable.cs (7)
37Debug.Assert(DeclaredAccessibility == Accessibility.Private); 51Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax); 72Debug.Assert(fieldsBeingBound != null); 101Debug.Assert(type.HasType || isVar); 106Debug.Assert(_lazyType != null); 134Debug.Assert((object)originalType == null || 178Debug.Assert(nodeToBind.Kind() == SyntaxKind.VariableDeclarator || nodeToBind is ExpressionSyntax);
Symbols\Source\ImplicitNamedTypeSymbol.cs (1)
24Debug.Assert(declaration.Kind == DeclarationKind.ImplicitClass ||
Symbols\Source\LambdaSymbol.cs (7)
52Debug.Assert(syntaxReferenceOpt is not null); 53Debug.Assert(containingSymbol.DeclaringCompilation == compilation); 161Debug.Assert(inferredReturnType.HasType); 162Debug.Assert(_returnType.Type.IsErrorType()); 291Debug.Assert(diagnostics.DiagnosticBag is { }); 292Debug.Assert(diagnostics.DependenciesBag is { }); 327Debug.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 (11)
44Debug.Assert(containingSymbol.DeclaringCompilation == binder.Compilation); 55Debug.Assert(diagnostics.DiagnosticBag is { }); 56Debug.Assert(diagnostics.DependenciesBag is { }); 192Debug.Assert(diagnostics.DiagnosticBag is { }); 193Debug.Assert(diagnostics.DependenciesBag is { }); 253Debug.Assert(diagnostics.DiagnosticBag is { }); 254Debug.Assert(diagnostics.DependenciesBag is { }); 257Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 453Debug.Assert(tpEnclosing.ContainingSymbol.Kind == SymbolKind.NamedType); 482Debug.Assert(diagnostics.DiagnosticBag is { }); 483Debug.Assert(diagnostics.DependenciesBag is { });
Symbols\Source\ModifierUtils.cs (7)
48Debug.Assert(!isForTypeDeclaration || !isForInterfaceMember); 55Debug.Assert((allowedModifiers & (DeclarationModifiers.Override | DeclarationModifiers.Virtual)) == 0); 77Debug.Assert(oneError != DeclarationModifiers.None); 120Debug.Assert(modifier.Kind() == SyntaxKind.ScopedKeyword); 202Debug.Assert(oneError != DeclarationModifiers.None); 215Debug.Assert(location.SourceTree is not null); 241Debug.Assert(!isExplicitInterfaceImplementation);
Symbols\Source\ParameterHelpers.cs (16)
130Debug.Assert(!parsingFunctionPointer || owner is FunctionPointerMethodSymbol); 180Debug.Assert(parameterSyntax.Type != null); 185Debug.Assert(refnessKeyword.Kind() != SyntaxKind.None); 193Debug.Assert(parameter is SourceComplexParameterSymbolBase || !parameter.IsParams); // Only SourceComplexParameterSymbolBase validates 'params' type. 194Debug.Assert(parameter is SourceComplexParameterSymbolBase || parameter is not SourceParameterSymbol s || s.DeclaredScope == ScopedKind.None); // Only SourceComplexParameterSymbolBase validates 'scope'. 211Debug.Assert(methodOwner?.MethodKind != MethodKind.LambdaMethod); 278Debug.Assert(moduleBuilder.Compilation.ShouldEmitNativeIntegerAttributes()); 301Debug.Assert(compilation.ShouldEmitNativeIntegerAttributes()); 320Debug.Assert(!parameter.IsThis); 426Debug.Assert(!parsingLambdaParams || !parsingAnonymousMethodParams); 599Debug.Assert(!seenIn); 600Debug.Assert(!seenOut); 601Debug.Assert(!seenRef); 602Debug.Assert(!seenScoped); 685Debug.Assert(containingSymbol is null || (containingSymbol is FunctionPointerMethodSymbol or { ContainingType: not null })); 970Debug.Assert(refKind == RefKind.None);
Symbols\Source\QuickAttributeChecker.cs (4)
76Debug.Assert(!_sealed); 125Debug.Assert(_sealed); 163Debug.Assert(QuickAttributes.Last == QuickAttributes.AssemblySignatureKey); 191Debug.Assert(attributeDescription.Name.EndsWith(nameof(System.Attribute)));
Symbols\Source\SourceAssemblySymbol.cs (38)
121Debug.Assert(compilation != null); 122Debug.Assert(assemblySimpleName != null); 123Debug.Assert(!String.IsNullOrWhiteSpace(moduleName)); 124Debug.Assert(!netModules.IsDefault); 496Debug.Assert(!DeclaringCompilation.Options.Errors.IsEmpty); 924Debug.Assert(thisThreadCompleted); 948Debug.Assert(thisThreadCompleted); 1070Debug.Assert(moduleNs.Extent.Kind == NamespaceKind.Module); 1211Debug.Assert(!attribute.HasErrors); 1223Debug.Assert(!attribute.HasErrors); 1240Debug.Assert(success); 1317Debug.Assert(attributesFromNetModules.Any()); 1318Debug.Assert(netModuleNames.Any()); 1319Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length); 1454Debug.Assert(lazyNetModuleAttributesBag.IsSealed); 1460Debug.Assert(attributeMatches is QuickAttributes.AssemblyKeyFile 1486Debug.Assert(attributesFromNetModules.Any()); 1487Debug.Assert(netModuleNames.Any()); 1488Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length); 1546Debug.Assert(attributesBag.IsSealed); 1599Debug.Assert(!attributes.IsDefault); 1600Debug.Assert(!netmoduleAttributes.IsDefault); 1614Debug.Assert(!attributes.IsDefault); 1627Debug.Assert(_lazyOmittedAttributeIndices == null || !_lazyOmittedAttributeIndices.Any(i => i < 0 || i >= this.GetAttributes().Length)); 1628Debug.Assert(_lazySourceAttributesBag.IsSealed); 1629Debug.Assert(_lazyNetModuleAttributesBag.IsSealed); 1630Debug.Assert(index >= 0); 1631Debug.Assert(index < this.GetAttributes().Length); 1750Debug.Assert(added); 1756Debug.Assert(removed); 1781Debug.Assert(attributesBag.IsSealed); 2107Debug.Assert(conclusion != IVTConclusion.NoRelationshipClaimed); 2223Debug.Assert(forwardedType.TypeKind != TypeKind.Error); 2275Debug.Assert(!attrData.HasErrors); 2366Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 2595Debug.Assert(!attribute.HasErrors); 2776Debug.Assert(!_unusedFieldWarnings.IsDefault); 2822Debug.Assert(forcedArity == emittedName.InferredArity);
Symbols\Source\SourceClonedParameterSymbol.cs (1)
28Debug.Assert((object)originalParam != null);
Symbols\Source\SourceComplexParameterSymbol.cs (46)
53Debug.Assert((syntaxRef == null) || (syntaxRef.GetSyntax().IsKind(SyntaxKind.Parameter))); 249Debug.Assert(diagnostics.DiagnosticBag != null); 254Debug.Assert(previousValue == ConstantValue.Unset); 257Debug.Assert(completedOnThisThread); 286Debug.Assert(completedOnThisThread); 307Debug.Assert(binder.GetBinder(syntax) == null); 352Debug.Assert(diagnostics.DiagnosticBag != null); 381Debug.Assert(binder.InParameterDefaultValue); 382Debug.Assert(binder.ContainingMemberOrLambda == ContainingSymbol); 486Debug.Assert(!this.ContainingSymbol.IsPartialImplementation()); 507Debug.Assert(!this.ContainingSymbol.IsPartialDefinition()); 528Debug.Assert(PartialImplementationPart is null); 590Debug.Assert(!ReferenceEquals(copyFrom, this)); 624Debug.Assert(!attributeType.IsErrorType()); 687Debug.Assert(constructorArguments.Length == 1); 711Debug.Assert(description.Equals(AttributeDescription.DefaultParameterValueAttribute) || 740Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 744Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 745Debug.Assert(AttributeDescription.InterpolatedStringHandlerArgumentAttribute.Signatures.Length == 2); 765Debug.Assert(_lazyHasOptionalAttribute == ThreeState.True); 904Debug.Assert(syntax != null); 905Debug.Assert(diagnostics != null); 942Debug.Assert(!attribute.HasErrors); 954Debug.Assert(description.Equals(AttributeDescription.DateTimeConstantAttribute)); 961Debug.Assert(!diagnose || diagnosticsOpt != null); 981Debug.Assert(attribute.CommonConstructorArguments.Length == 1); 1053Debug.Assert(this.GetAttributeDeclarations().Any(attrLists => attrLists.Any(attrList => attrList.Contains(node)))); 1249Debug.Assert(attributeIndex is 0 or 1); 1251Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1332Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1347Debug.Assert(name != null); 1396Debug.Assert(!boundAttributes.IsDefault); 1397Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1398Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1399Debug.Assert(_lazyCustomAttributesBag != null); 1400Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1401Debug.Assert(symbolPart == AttributeLocation.None); 1465Debug.Assert(!ReferenceEquals(copyFrom, this)); 1525Debug.Assert(filter == null); 1547Debug.Assert(ParameterSyntax is not null); 1555Debug.Assert(completedOnThisThread); 1599Debug.Assert(!addMethods.IsDefaultOrEmpty); 1603Debug.Assert(addMethods[0].IsExtensionMethod); 1657Debug.Assert(elementType is { }); 1738Debug.Assert(!refCustomModifiers.IsEmpty); 1743Debug.Assert(refKind != RefKind.None || _refCustomModifiers.IsEmpty);
Symbols\Source\SourceConstructorSymbol.cs (1)
103Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceConstructorSymbolBase.cs (2)
30Debug.Assert(syntax.Kind() is SyntaxKind.ConstructorDeclaration or SyntaxKind.RecordDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.StructDeclaration); 170Debug.Assert(position >= 0 && tree != null);
Symbols\Source\SourceCustomEventAccessorSymbol.cs (3)
37Debug.Assert(syntax != null); 38Debug.Assert(syntax.Kind() == SyntaxKind.AddAccessorDeclaration || syntax.Kind() == SyntaxKind.RemoveAccessorDeclaration); 63Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceCustomEventSymbol.cs (1)
149Debug.Assert(containingType.IsInterface);
Symbols\Source\SourceDelegateMethodSymbol.cs (3)
41Debug.Assert(_parameters.IsDefault); 53Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 315Debug.Assert(location != null);
Symbols\Source\SourceDestructorSymbol.cs (2)
49Debug.Assert(syntax.ParameterList.Parameters.Count == 0); 90Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceEnumConstantSymbol.cs (7)
39Debug.Assert(otherConstantOffset == 0); 44Debug.Assert(otherConstantOffset > 0); 122Debug.Assert(!this.IsFixedSizeBuffer); 169Debug.Assert(syntax.EqualsValue != null); 175Debug.Assert(syntax.EqualsValue != null); 194Debug.Assert((object)otherConstant != null); 195Debug.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); 201Debug.Assert(this.Locations.Length == 1);
Symbols\Source\SourceEventSymbol.cs (8)
150Debug.Assert(syntax.Parent!.Parent is object); 198Debug.Assert(wasCompletedThisThread); 300Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 483Debug.Assert(explicitInterfaceImplementation); 526Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 527Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 672Debug.Assert(explicitInterfaceImplementations.Length == 1); 674Debug.Assert((object?)this.OverriddenEvent == null);
Symbols\Source\SourceFieldLikeEventSymbol.cs (2)
32Debug.Assert(declaratorSyntax.Parent is object); 181Debug.Assert(field.Name == _name);
Symbols\Source\SourceFieldSymbol.cs (9)
24Debug.Assert((object)containingType != null); 116Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 117Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 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 (3)
37Debug.Assert(this.IsFixedSizeBuffer); 99Debug.Assert(sizeConstant != null); 136Debug.Assert(_fixedSize != FixedSizeNotInitialized);
Symbols\Source\SourceLabelSymbol.cs (1)
31Debug.Assert(identifierNodeOrToken.IsToken || identifierNodeOrToken.IsNode);
Symbols\Source\SourceLocalSymbol.cs (28)
50Debug.Assert(identifierToken.Kind() != SyntaxKind.None); 51Debug.Assert(declarationKind != LocalDeclarationKind.None); 52Debug.Assert(scopeBinder != null); 53Debug.Assert(containingSymbol.DeclaringCompilation == scopeBinder.Compilation); 144Debug.Assert(closestTypeSyntax != null); 145Debug.Assert(nodeBinder != null); 165Debug.Assert( 177Debug.Assert(!(nodeToBind.Kind() == SyntaxKind.SwitchExpressionArm) || nodeBinder is SwitchExpressionArmBinder); 211Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 299Debug.Assert(concurrentTypeResolutions < 50); 375Debug.Assert(declType.HasType); 390Debug.Assert(newType.Type is object); 396Debug.Assert((object)originalType?.DefaultType == null || 433Debug.Assert(node is VariableDeclaratorSyntax); 439Debug.Assert(node is VariableDeclaratorSyntax); 443Debug.Assert(node is ForEachStatementSyntax || node is SingleVariableDesignationSyntax); 447Debug.Assert(node is CatchDeclarationSyntax); 454Debug.Assert(node is SingleVariableDesignationSyntax); 535Debug.Assert(declarationKind != LocalDeclarationKind.ForEachIterationVariable); 536Debug.Assert(initializer != null); 581Debug.Assert(inProgress != this); 611Debug.Assert(boundInitValue != null); 634Debug.Assert(declarationKind == LocalDeclarationKind.ForEachIterationVariable); 686Debug.Assert(assignment.IsDeconstruction()); 693Debug.Assert(this.ScopeBinder.GetBinder((ForEachVariableStatementSyntax)_deconstruction) == _nodeBinder); 740Debug.Assert( 750Debug.Assert(!(nodeToBind.Kind() == SyntaxKind.SwitchExpressionArm) || nodeBinder is SwitchExpressionArmBinder); 812Debug.Assert(this.DeclarationKind == LocalDeclarationKind.DeclarationExpressionVariable);
Symbols\Source\SourceMemberContainerSymbol.cs (79)
147Debug.Assert(BitsAreUnsetOrSame(_flags, bitsToSet)); 231Debug.Assert(containingSymbol is NamespaceSymbol { IsGlobalNamespace: true } || !declaration.Declarations.Any(static d => d.IsSimpleProgram)); 260Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor); 624Debug.Assert(thisThreadCompleted); 674Debug.Assert(thisThreadCompleted); 685Debug.Assert((incompletePart & CompletionPart.NamedTypeSymbolAll) == 0); 825Debug.Assert(!useSiteDiagnostics.IsDefault); 834Debug.Assert(!useSiteDependencies.IsDefault); 1064Debug.Assert(!nonTypeMembers.IsDefault); 1065Debug.Assert(!staticInitializers.IsDefault); 1066Debug.Assert(staticInitializers.All(g => !g.IsDefault)); 1067Debug.Assert(!instanceInitializers.IsDefault); 1068Debug.Assert(instanceInitializers.All(g => !g.IsDefault)); 1070Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol)); 1071Debug.Assert(haveIndexers == nonTypeMembers.Any(static s => s.IsIndexer())); 1138Debug.Assert(ctorInitializerLength >= 0); 1161Debug.Assert(distanceFromCtorBody > 0); 1366Debug.Assert(s_emptyTypeMembers.Count == 0); 1423Debug.Assert(symbol is not null); 1428Debug.Assert(attr is SourceAttributeData); 1885Debug.Assert(IsFileLocal); 1893Debug.Assert(fileIdentifier.FilePathChecksumOpt.IsDefault); 2161Debug.Assert(method1.ParameterCount == method2.ParameterCount); 2269Debug.Assert(!membersByName[indexerName.AsMemory()].Any(SymbolExtensions.IsIndexer)); 2371Debug.Assert(value == _lazyKnownCircularStruct); 2382Debug.Assert(TypeKind == TypeKind.Struct); 2676Debug.Assert(IsSubmissionClass || IsScriptClass); 2702Debug.Assert(ReferenceEquals(this, this.OriginalDefinition)); 2988Debug.Assert(!nonTypeMembersWithPartialImplementations.IsDefault); 2992Debug.Assert(!nonTypeMembersWithPartialImplementations.Any(static s => s is TypeSymbol)); 2993Debug.Assert(declarationWithParameters is object == primaryConstructor is object); 3008Debug.Assert(!initializers.IsDefault); 3016Debug.Assert(!group.IsDefaultOrEmpty); 3023Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3028Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0); 3033Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0); 3058Debug.Assert(declaredMembersAndInitializers != DeclaredMembersAndInitializers.UninitializedSentinel); 3084Debug.Assert(declaredMembers.PrimaryConstructor is object); 3085Debug.Assert(declaredMembers.DeclarationWithParameters is object); 3086Debug.Assert(declaredMembers.DeclarationWithParameters.SyntaxTree == InstanceInitializersForPositionalMembers[0].Syntax.SyntaxTree); 3087Debug.Assert(declaredMembers.DeclarationWithParameters.Span.Contains(InstanceInitializersForPositionalMembers[0].Syntax.Span.Start)); 3120Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.SyntaxTree == declaredInitializers[0].Syntax.SyntaxTree); 3121Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.Span.Start < declaredInitializers[0].Syntax.Span.Start); 3134Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree && 3365Debug.Assert(!_lazySimpleProgramEntryPoints.IsDefault); 3424Debug.Assert(result is object); 3447Debug.Assert(primaryConstructor is not null); 3448Debug.Assert(!this.IsDelegateType()); 3482Debug.Assert(declared.PrimaryConstructor is not null); 3488Debug.Assert(membersAndInituializers.PrimaryConstructor is not null); 3517Debug.Assert(primaryConstructor is not null); 3686Debug.Assert(symbol.IsPartialMember()); 3710Debug.Assert(symbol is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol); 3711Debug.Assert(prev is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol); 3719Debug.Assert(symbol.IsPartialMember()); 3775Debug.Assert(symbol.IsPartialMember()); 3926Debug.Assert(!propertySymbol.IsExplicitInterfaceImplementation); // checked by caller 3974Debug.Assert(!eventSymbol.IsExplicitInterfaceImplementation); // checked by caller 4109Debug.Assert(node.SyntaxTree == initializers.Last().Syntax.SyntaxTree); 4110Debug.Assert(node.SpanStart > initializers.Last().Syntax.Span.Start); 4213Debug.Assert(TypeKind == TypeKind.Struct); 4217Debug.Assert(builder.DeclarationWithParameters is TypeDeclarationSyntax { ParameterList: not null } type 4262Debug.Assert(ctor is object); 4272Debug.Assert(declaredMembersAndInitializers.PrimaryConstructor?.GetBackingFields().Any() != true); 4308Debug.Assert(declaredMembersAndInitializers.DeclarationWithParameters is object); 4312Debug.Assert(ctor is object); 4360Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false })); 4371Debug.Assert(positionalMembers.All(p => p is PropertySymbol or FieldSymbol)); 4419Debug.Assert(isRecordClass); 4463Debug.Assert(isRecordClass); 4670Debug.Assert(property.GetMethod is object); 4671Debug.Assert(property.SetMethod is object); 4675Debug.Assert(backingField is object); 4737Debug.Assert(isRecordClass); 4859Debug.Assert(isRecordClass); 5198Debug.Assert((object)@event.AddMethod != null); 5199Debug.Assert((object)@event.RemoveMethod != null); 5223Debug.Assert(@event.AssociatedField is null); 5331Debug.Assert(
Symbols\Source\SourceMemberContainerSymbol_ImplementationChecks.cs (26)
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); 657Debug.Assert((object)sourceField == null || (object)sourceField.AssociatedSymbol == null || 671Debug.Assert(symbol.Kind == SymbolKind.Field || symbol.Kind == SymbolKind.NamedType); 746Debug.Assert((object)overridingMember != null); 747Debug.Assert(overriddenOrHiddenMembers != null); 755Debug.Assert(overridingMemberIsMethod ^ overridingMemberIsProperty ^ overridingMemberIsEvent); 760Debug.Assert(!overriddenMembers.IsDefault); 765Debug.Assert(!hiddenMembers.IsDefault); 879Debug.Assert(AccessCheck.IsSymbolAccessible(overriddenMember, overridingType, ref discardedUseSiteInfo)); 883Debug.Assert(overriddenMember.Kind == overridingMember.Kind); 929Debug.Assert(overridingMember.ObsoleteState != ThreeState.Unknown); 930Debug.Assert(leastOverriddenMember.ObsoleteState != ThreeState.Unknown); 976Debug.Assert(overridingMemberIsMethod); 1077Debug.Assert(diagnosticInfo is { }); 1261Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1365Debug.Assert(conversions.IncludeNullability); 1453Debug.Assert(reportMismatchInParameterType is { }); 1464Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1505Debug.Assert(reportMismatchInParameterType is { }); 1515Debug.Assert(baseMethod.ParameterCount == overrideMethod.ParameterCount - overrideParameterOffset); 1572Debug.Assert(overriddenOrHiddenMembers != null); 1573Debug.Assert(!overriddenOrHiddenMembers.OverriddenMembers.Any()); //since hidingMethod.IsOverride is false 1576Debug.Assert(!hiddenMembers.IsDefault);
Symbols\Source\SourceMemberFieldSymbol.cs (6)
86Debug.Assert(constToken.Kind() == SyntaxKind.ConstKeyword); 219Debug.Assert((result & ~(DeclarationModifiers.AccessibilityMask | DeclarationModifiers.Fixed | DeclarationModifiers.Unsafe | DeclarationModifiers.New)) == 0); 448Debug.Assert(fieldsBeingBound != null); 499Debug.Assert(refKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly); 518Debug.Assert(refKindToAssert == RefKind.None); // Otherwise we might need to report an error 519Debug.Assert(type.HasType || isVar);
Symbols\Source\SourceMemberMethodSymbol.cs (16)
108Debug.Assert((bits & ReturnsVoidIsSetBit) != 0); 116Debug.Assert((bits & ReturnsVoidIsSetBit) == 0); 117Debug.Assert(value || (bits & ReturnsVoidBit) == 0); 193Debug.Assert(!returnsVoid || returnsVoidIsSet); 272Debug.Assert(!IsMetadataVirtualLocked); 328Debug.Assert(containingType is not null); 329Debug.Assert(location is not null); 330Debug.Assert(containingType.DeclaringCompilation is not null); 442Debug.Assert(lockObject != null); 575Debug.Assert(!this.IsStatic); 722Debug.Assert(arrowExpression.Parent.Kind() == SyntaxKind.PropertyDeclaration || 728Debug.Assert(this is SynthesizedClosureMethod); 759Debug.Assert(current is InMethodBinder); 1004Debug.Assert(!this.IsConstructor()); // Constructors should use IsNullableEnabledForConstructorsAndInitializers() instead. 1132Debug.Assert(this.SyntaxNode.SyntaxTree == localTree); 1149Debug.Assert(bodySyntax != null);
Symbols\Source\SourceMethodSymbolWithAttributes.cs (30)
54Debug.Assert(arrowExpression.Parent!.Kind() == SyntaxKind.PropertyDeclaration || 62Debug.Assert(recordDecl.IsKind(SyntaxKind.RecordDeclaration)); 280Debug.Assert(!ReferenceEquals(copyFrom, this)); 334Debug.Assert(arguments.SymbolPart == AttributeLocation.None || arguments.SymbolPart == AttributeLocation.Return); 464Debug.Assert(!forceComplete); 480Debug.Assert(!forceComplete); 493Debug.Assert(earlyData is { UnmanagedCallersOnlyAttributePresent: true }); 497Debug.Assert(lateData is null or { UnmanagedCallersOnlyAttributeData: null }); 513Debug.Assert(arguments.SymbolPart == AttributeLocation.None || arguments.SymbolPart == AttributeLocation.Return); 527Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 716Debug.Assert(this.IsConditional); 780Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 944Debug.Assert(arguments.AttributeSyntaxOpt is object); 953Debug.Assert(ContainingType is object); 1004Debug.Assert(arguments.Attribute.AttributeConstructor.Parameters is [{ Type.SpecialType: SpecialType.System_Int32 }, { Type.SpecialType: SpecialType.System_String }]); 1012Debug.Assert(arguments.AttributeSyntaxOpt is not null); 1051Debug.Assert(_lazyCustomAttributesBag.IsEarlyDecodedWellKnownAttributeDataComputed); 1127Debug.Assert(namespaceSegments.Length > 0); 1171Debug.Assert(attributeSyntax is object); 1209Debug.Assert(_lazyCustomAttributesBag.IsEarlyDecodedWellKnownAttributeDataComputed); 1341Debug.Assert(namespaceSegments.Length > 0); 1379Debug.Assert(arguments.AttributeSyntaxOpt != null); 1395Debug.Assert(reportedError); 1435Debug.Assert(attribute.AttributeClass is not null); 1465Debug.Assert(!boundAttributes.IsDefault); 1466Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1467Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1468Debug.Assert(symbolPart == AttributeLocation.None || symbolPart == AttributeLocation.Return); 1472Debug.Assert(_lazyCustomAttributesBag != null); 1473Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed);
Symbols\Source\SourceModuleSymbol.cs (7)
57Debug.Assert((object)assemblySymbol != null); 147Debug.Assert(!_lazyAssembliesToEmbedTypesFrom.IsDefault); 160Debug.Assert(_lazyContainsExplicitDefinitionOfNoPiaLocalTypes != ThreeState.Unknown); 267Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingReferencedAssemblies)); 514Debug.Assert(completed); 553Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 557Debug.Assert(arguments.SymbolPart == AttributeLocation.None);
Symbols\Source\SourceNamedTypeSymbol.cs (37)
288Debug.Assert(!_typeParameterInfo.LazyTypeParameterConstraintTypes.IsDefault); 310Debug.Assert(!_typeParameterInfo.LazyTypeParameterConstraintKinds.IsDefault); 351Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 357Debug.Assert(constraints.Length == arity); 432Debug.Assert(!binder.Flags.Includes(BinderFlags.GenericConstraintsClause)); 439Debug.Assert(constraints.Length == arity); 502Debug.Assert(constraintClauses.Length == arity); 536Debug.Assert(originalConstraintTypes[j].Equals(mergedConstraintTypes[j], TypeCompareKind.ObliviousNullableModifierMatchesAny)); 655Debug.Assert(constraintClauses.Length == arity); 671Debug.Assert((constraint.Constraints & (TypeParameterConstraintKind.AllNonNullableKinds | TypeParameterConstraintKind.NotNull)) == 673Debug.Assert((mergedKind & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0 || 675Debug.Assert((constraint.Constraints & TypeParameterConstraintKind.AllReferenceTypeKinds) == (mergedKind & TypeParameterConstraintKind.AllReferenceTypeKinds) || 847Debug.Assert(completed); 850Debug.Assert(_lazyCustomAttributesBag.IsSealed); 1031Debug.Assert(attributeData.CommonConstructorArguments[0].Kind == TypedConstantKind.Type); 1052Debug.Assert(this.SpecialType == SpecialType.System_Object || this.DeclaringCompilation.IsAttributeType(this)); 1093Debug.Assert(arguments.AttributeSyntaxOpt is { }); 1098Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 1255Debug.Assert(_lazyIsExplicitDefinitionOfNoPiaLocalType != ThreeState.Unknown); 1298Debug.Assert(diagnose == (diagnosticsOpt != null)); 1299Debug.Assert(!attribute.HasErrors); 1301Debug.Assert(!this.IsErrorType()); 1341Debug.Assert(argument.Kind == TypedConstantKind.Type); 1388Debug.Assert(this.IsConditional); 1389Debug.Assert(!attribute.HasErrors); 1581Debug.Assert(!boundAttributes.IsDefault); 1582Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1583Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1584Debug.Assert(_lazyCustomAttributesBag != null); 1585Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1586Debug.Assert(symbolPart == AttributeLocation.None); 1592Debug.Assert(boundAttributes.Any()); 1642Debug.Assert(boundAttributes.Any()); 1652Debug.Assert(boundAttributes.Any()); 1788Debug.Assert(this.SpecialType == SpecialType.System_IntPtr || this.SpecialType == SpecialType.System_UIntPtr); 1827Debug.Assert(ObsoleteKind != ObsoleteAttributeKind.Uninitialized); 1828Debug.Assert(GetMembers().All(m => m.ObsoleteKind != ObsoleteAttributeKind.Uninitialized));
Symbols\Source\SourceNamedTypeSymbol_Bases.cs (5)
103Debug.Assert(!this.IsClassType() || localBase.IsObjectType() || baseLocation != null); 186Debug.Assert(!other.Equals(@interface, TypeCompareKind.ConsiderEverything)); 187Debug.Assert(other.Equals(@interface, TypeCompareKind.CLRSignatureCompareOptions)); 382Debug.Assert(baseTypeLocation != null); 527Debug.Assert((object)localBase != null);
Symbols\Source\SourceNamedTypeSymbol_Enum.cs (1)
96Debug.Assert((object)this.EnumUnderlyingType != null);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (28)
33Debug.Assert((object)result == calculated); 37Debug.Assert(result.ExternAliases.SequenceEqual(calculated.ExternAliases)); 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); 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); 598Debug.Assert(calculated.UsingAliases.SequenceEqual(result.UsingAliases)); 600Debug.Assert(calculated.UsingNamespacesOrTypes.SequenceEqual(result.UsingNamespacesOrTypes)); 762Debug.Assert(directiveDiagnostics.DiagnosticBag is object); 763Debug.Assert(directiveDiagnostics.DependenciesBag is object); 945Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports)); 969Debug.Assert(diagnostics.DiagnosticBag is object); 970Debug.Assert(diagnostics.DependenciesBag is object); 980Debug.Assert(declaringSymbol.IsGlobalNamespace); 1006Debug.Assert(declaringSymbol.IsGlobalNamespace); 1037Debug.Assert(target.IsGlobalNamespace); 1176Debug.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); 345Debug.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 (25)
62Debug.Assert(diagnostics.DiagnosticBag is object); 78Debug.Assert(syntax.ReturnType is not ScopedTypeSyntax); 133Debug.Assert(returnTypeSyntax is not ScopedTypeSyntax); 172Debug.Assert(declaredConstraints.All(clause => clause.ConstraintTypes.IsEmpty)); 214Debug.Assert(parameterSyntax.Type != null); 270Debug.Assert(syntaxReferenceOpt != null); 291Debug.Assert(definition.IsPartialDefinition); 292Debug.Assert(implementation.IsPartialImplementation); 398Debug.Assert(PartialDefinitionPart is null); 448Debug.Assert(this.DeclaringSyntaxReferences.Length == 1); 476Debug.Assert(!ReferenceEquals(definition, implementation)); 587Debug.Assert(!ReferenceEquals(definition, implementation)); 588Debug.Assert(definition.Arity == implementation.Arity); 727Debug.Assert(isExplicitInterfaceImplementation); 797Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 798Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 1000Debug.Assert(definition.IsPartialDefinition); 1001Debug.Assert(implementation.IsPartialImplementation); 1003Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || alreadySetImplPart == implementation); 1004Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || alreadySetDefPart == definition); 1009Debug.Assert(definition._otherPartOfPartial == implementation); 1010Debug.Assert(implementation._otherPartOfPartial == definition); 1023Debug.Assert(!_typeParameterInfo.LazyTypeParameters.IsDefault); 1086Debug.Assert(syntax.ExplicitInterfaceSpecifier != null); 1098Debug.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)); 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 (6)
36Debug.Assert(syntax.Kind() == SyntaxKind.GetAccessorDeclaration || 270Debug.Assert(explicitInterfaceImplementations.Length == 1); 310Debug.Assert(propertyAccessibility != Accessibility.NotApplicable); 589Debug.Assert(syntaxReferenceOpt != null); 646Debug.Assert(MethodKind == MethodKind.PropertySet); 849Debug.Assert(IsPartialDefinition);
Symbols\Source\SourcePropertySymbol.cs (18)
51Debug.Assert(!(getterUsesFieldKeyword || setterUsesFieldKeyword) || 143Debug.Assert(syntax.Type is not ScopedTypeSyntax); 195Debug.Assert(PartialDefinitionPart is null 286Debug.Assert(hasGetAccessorImplementation); // it's not clear how this even parsed as a property if it has no accessor list and no arrow expression. 413Debug.Assert(isExplicitInterfaceImplementation); 450Debug.Assert(location.SourceTree is not null); 510Debug.Assert(!(syntax.AccessorList is null && GetArrowExpression(syntax) != null)); 564Debug.Assert(typeSyntax is not ScopedTypeSyntax); 684Debug.Assert(this.IsPartialDefinition); 685Debug.Assert((object)this != implementation); 686Debug.Assert((object?)this.OtherPartOfPartial == implementation); 754Debug.Assert(this.ParameterCount == implementation.ParameterCount); 797Debug.Assert(definition.IsPartialDefinition); 798Debug.Assert(implementation.IsPartialImplementation); 800Debug.Assert(definition._otherPartOfPartial is not { } alreadySetImplPart || alreadySetImplPart == implementation); 801Debug.Assert(implementation._otherPartOfPartial is not { } alreadySetDefPart || alreadySetDefPart == definition); 806Debug.Assert(definition._otherPartOfPartial == implementation); 807Debug.Assert(implementation._otherPartOfPartial == definition);
Symbols\Source\SourcePropertySymbolBase.cs (37)
103Debug.Assert(!isExpressionBodied || !(hasAutoPropertyGet || hasAutoPropertySet)); 104Debug.Assert(!isExpressionBodied || !hasInitializer); 105Debug.Assert(!isExpressionBodied || accessorsHaveImplementation); 106Debug.Assert((modifiers & DeclarationModifiers.Required) == 0 || this is SourcePropertySymbol); 172Debug.Assert(memberName == DefaultIndexerName); 184Debug.Assert(!IsIndexer); 199Debug.Assert(_lazyDeclaredBackingField is null); 276Debug.Assert(isExplicitInterfaceImplementation || _lazyExplicitInterfaceImplementations.IsEmpty); 319Debug.Assert(property.PartialImplementationPart is null); 458Debug.Assert(IsIndexer); 462Debug.Assert(!IsExplicitInterfaceImplementation); 667Debug.Assert(_lazyExplicitInterfaceImplementations.IsEmpty); 761Debug.Assert(!IsPartial); 784Debug.Assert((object?)_lazyMergedBackingField.Value == backingField); 916Debug.Assert(_getMethod is object); 917Debug.Assert(_setMethod is object); 999Debug.Assert(location != null); 1051Debug.Assert(!IsStatic || !IsOverride); // Otherwise should have been reported and cleared earlier. 1052Debug.Assert(!IsStatic || ContainingType.IsInterface || (!IsAbstract && !IsVirtual)); // Otherwise should have been reported and cleared earlier. 1174Debug.Assert(thisAccessor.MethodKind == MethodKind.PropertySet); 1222Debug.Assert(this.IsSealed && (GetMethod is null || SetMethod is null)); 1283Debug.Assert(!ReferenceEquals(copyFrom, this)); 1302Debug.Assert(completed); 1305Debug.Assert(_lazyCustomAttributesBag.IsSealed); 1493Debug.Assert(arguments.AttributeSyntaxOpt != null); 1496Debug.Assert(diagnostics.DiagnosticBag is object); 1500Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 1676Debug.Assert(!boundAttributes.IsDefault); 1677Debug.Assert(!allAttributeSyntaxNodes.IsDefault); 1678Debug.Assert(boundAttributes.Length == allAttributeSyntaxNodes.Length); 1679Debug.Assert(_lazyCustomAttributesBag != null); 1680Debug.Assert(_lazyCustomAttributesBag.IsDecodedWellKnownAttributeDataComputed); 1681Debug.Assert(symbolPart == AttributeLocation.None); 1704Debug.Assert(this.IsIndexer); 1745Debug.Assert(_state.HasComplete(CompletionPart.FinishPropertyEnsureSignature)); 1780Debug.Assert(completedOnThisThread); 1803Debug.Assert(completedOnThisThread);
Symbols\Source\SourceSimpleParameterSymbol.cs (1)
29Debug.Assert(locations.Length <= 1);
Symbols\Source\SourceTypeParameterSymbol.cs (16)
36Debug.Assert(!syntaxRefs.IsEmpty); 224Debug.Assert(!inProgress.Any() || ReferenceEquals(inProgress.Head.ContainingSymbol, this.ContainingSymbol)); 351Debug.Assert(filter == null); 368Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.EffectiveBaseClassNoUseSiteDiagnostics)); 369Debug.Assert(this.ContainingSymbol.IsContainingSymbolOfAllTypeParameters(this.DeducedBaseTypeNoUseSiteDiagnostics)); 428Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 429Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 433Debug.Assert(arguments.SymbolPart == AttributeLocation.None); 520Debug.Assert(!HasValueTypeConstraint); 701Debug.Assert(!HasValueTypeConstraint); 828Debug.Assert(overriddenTypeParameters.Length == overridingTypeParameters.Length); 859Debug.Assert(overridingMethod.IsOverride); 865Debug.Assert(method.IsOverride); 880Debug.Assert(implementationMethod.IsExplicitInterfaceImplementation); 886Debug.Assert(explicitImplementations.Length <= 1); 1011Debug.Assert(map != null);
Symbols\Source\SourceUserDefinedConversionSymbol.cs (1)
95Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceUserDefinedOperatorSymbol.cs (1)
95Debug.Assert(syntaxReferenceOpt != null);
Symbols\Source\SourceUserDefinedOperatorSymbolBase.cs (6)
102Debug.Assert(!(IsAbstract && IsExtern)); 150Debug.Assert(isExplicitInterfaceImplementation); 570Debug.Assert(!different.IsTypeParameter()); 703Debug.Assert(containingType.IsDefinition); 797Debug.Assert(operatorDeclaration.ExplicitInterfaceSpecifier != null); 802Debug.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\ThisParameterSymbol.cs (1)
135Debug.Assert(containingType is not null);
Symbols\Source\TypeParameterBuilder.cs (1)
29Debug.Assert(syntaxRef.GetSyntax().IsKind(SyntaxKind.TypeParameter));
Symbols\Source\TypeParameterConstraintClause.cs (4)
86Debug.Assert(!constraintTypes.IsDefault); 119Debug.Assert((constraints & TypeParameterConstraintKind.ObliviousNullabilityIfReferenceType) == 0 || 136Debug.Assert(constraintClauses.Length == typeParameters.Length); 201Debug.Assert(constraintClauses.Length == typeParameters.Length);
Symbols\SpecializedSymbolCollections.cs (2)
16Debug.Assert(instance.Count == 0); 28Debug.Assert(instance.Count == 0);
Symbols\SubstitutedEventSymbol.cs (1)
20Debug.Assert(originalDefinition.IsDefinition);
Symbols\SubstitutedMethodSymbol.cs (8)
43Debug.Assert(containingSymbol is SubstitutedNamedTypeSymbol || containingSymbol is SubstitutedErrorTypeSymbol); 44Debug.Assert(TypeSymbol.Equals(originalDefinition.ContainingType, containingSymbol.OriginalDefinition, TypeCompareKind.ConsiderEverything2)); 49Debug.Assert((object)originalDefinition != null); 50Debug.Assert(originalDefinition.IsDefinition); 57Debug.Assert(ReferenceEquals(constructedFrom.ConstructedFrom, constructedFrom)); 109Debug.Assert(ReferenceEquals(_constructedFrom, this)); 123Debug.Assert(_lazyTypeParameters != null); 178Debug.Assert((object)notUsed == null && (object)OriginalDefinition.ReducedFrom != null);
Symbols\SubstitutedNamedTypeSymbol.cs (6)
56Debug.Assert(originalDefinition.IsDefinition); 57Debug.Assert(!originalDefinition.IsErrorType()); 66Debug.Assert(ReferenceEquals(constructedFrom.ConstructedFrom, constructedFrom)); 119Debug.Assert(_lazyTypeParameters != null); 170Debug.Assert(!ReferenceEquals(_lazyBaseType, ErrorTypeSymbol.UnknownResultType)); 282Debug.Assert(builder is object);
Symbols\SubstitutedParameterSymbol.cs (1)
30Debug.Assert(originalParameter.IsDefinition);
Symbols\SubstitutedTypeParameterSymbol.cs (1)
121Debug.Assert(!HasNotNullConstraint && !HasValueTypeConstraint);
Symbols\Symbol.cs (9)
55Debug.Assert(!this.RequiresCompletion); 62Debug.Assert(!this.RequiresCompletion); 291Debug.Assert(ContainingType.TypeKind != TypeKind.Submission); 408Debug.Assert(declaringCompilation != null); // require that it is a source symbol 902Debug.Assert(this.Kind == SymbolKind.NamedType || this.Kind == SymbolKind.Method); 908Debug.Assert(compilation != null); 1031Debug.Assert(compilation != null); 1160Debug.Assert(!retVal); 1529Debug.Assert(attribute is SourceAttributeData);
Symbols\Symbol_Attributes.cs (32)
30Debug.Assert(!(this is IAttributeTargetSymbol)); //such types must override 218Debug.Assert(arguments.Diagnostics.DiagnosticBag is not null); 219Debug.Assert(arguments.AttributeSyntaxOpt is not null); 316Debug.Assert(!attributesToBind.IsDefault); 323Debug.Assert(!binders.IsDefault); 324Debug.Assert(binders.Length == attributesToBind.Length); 360Debug.Assert(!attributeDataArray.Contains((attr) => attr != null && attr.HasErrors)); 377Debug.Assert(!boundAttributes.Any(static (attr) => attr == null)); 400Debug.Assert(!earlyDecodingOnly); 411Debug.Assert(diagnostics.DiagnosticBag is not null); 417Debug.Assert(boundAttributeArray is not null); 421Debug.Assert(boundAttribute is not null); 444Debug.Assert(diagnostics.DiagnosticBag is not null); 469Debug.Assert(totalAttributesCount == boundAttributes.Length); 569Debug.Assert(compilation != null); 639Debug.Assert(bindersBuilder != null); 773Debug.Assert(boundAttributeTypes.Any()); 774Debug.Assert(attributesToBind.Any()); 775Debug.Assert(binders.Any()); 776Debug.Assert(attributeDataArray != null); 777Debug.Assert(!attributeDataArray.Contains((attr) => attr != null)); 799Debug.Assert(earlyAttributeDataOpt == null || !earlyAttributeDataOpt.HasErrors); 800Debug.Assert(boundAttributeOpt is null == earlyAttributeDataOpt is null); 816Debug.Assert(attributeSyntaxList.Any()); 817Debug.Assert(attributeTypes.Any()); 844Debug.Assert(binders.Any()); 845Debug.Assert(attributeSyntaxList.Any()); 846Debug.Assert(boundAttributes.Any()); 847Debug.Assert(binders.Length == boundAttributes.Length); 848Debug.Assert(attributeSyntaxList.Length == boundAttributes.Length); 894Debug.Assert(!attribute.HasErrors); 911Debug.Assert(this.Kind == SymbolKind.Method);
Symbols\SymbolCompletionState.cs (1)
50Debug.Assert(symbol.RequiresCompletion);
Symbols\SymbolDistinguisher.cs (3)
35Debug.Assert(symbol0 != symbol1); 163Debug.Assert((object)unwrappedSymbol == UnwrapSymbol(unwrappedSymbol)); 196Debug.Assert(unwrappedSymbol.Kind == SymbolKind.DynamicType || unwrappedSymbol.Kind == SymbolKind.ErrorType || unwrappedSymbol.Kind == SymbolKind.FunctionPointerType);
Symbols\SymbolExtensions.cs (4)
35Debug.Assert(type.TypeParameters.IsEmpty == (typeArguments.Length == 0)); 106Debug.Assert(!useSiteInfo.AccumulatesDependencies); 281Debug.Assert(!(symbol is TypeSymbol)); 832Debug.Assert(symbol is MethodSymbol or PropertySymbol);
Symbols\Synthesized\GeneratedNameParser.cs (2)
179Debug.Assert((char)GeneratedNameKind.PrimaryConstructorParameter == 'P'); 200Debug.Assert(s_regexPatternString[0] == FileTypeNameStartChar);
Symbols\Synthesized\GeneratedNames.cs (47)
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); 80Debug.Assert(generation >= 0); 81Debug.Assert(methodOrdinal >= -1); 88Debug.Assert((char)GeneratedNameKind.BaseMethodWrapper == 'n'); 94Debug.Assert(methodOrdinal >= -1); 95Debug.Assert(methodGeneration >= 0); 96Debug.Assert(lambdaOrdinal >= 0); 97Debug.Assert(lambdaGeneration >= 0); 106Debug.Assert(methodOrdinal >= -1); 107Debug.Assert(lambdaOrdinal >= 0); 114Debug.Assert(methodOrdinal >= -1); 115Debug.Assert(methodGeneration >= 0); 116Debug.Assert(lambdaOrdinal >= 0); 117Debug.Assert(lambdaGeneration >= 0); 132Debug.Assert(methodOrdinal >= -1); 133Debug.Assert(methodGeneration >= 0 || methodGeneration == -1 && methodOrdinal == -1); 134Debug.Assert(entityOrdinal >= -1); 135Debug.Assert(entityGeneration >= 0 || entityGeneration == -1 && entityOrdinal == -1); 136Debug.Assert(entityGeneration == -1 || entityGeneration >= methodGeneration); 137Debug.Assert(suffixTerminator != GeneratedNameConstants.IdSeparator); 205Debug.Assert((localName != null) == (kind == SynthesizedLocalKind.UserDefined)); 206Debug.Assert(slotIndex >= 0); 221Debug.Assert(localName.IndexOf('.') == -1); 248Debug.Assert((char)GeneratedNameKind.AwaiterField == 'u'); 254Debug.Assert((char)GeneratedNameKind.LambdaCacheField == '9'); 278Debug.Assert((char)GeneratedNameKind.DisplayClassLocalOrField == '8'); 285Debug.Assert((char)GeneratedNameKind.FixedBufferField == 'e'); 292Debug.Assert((char)GeneratedNameKind.StateMachineStateField == '1'); 298Debug.Assert((char)GeneratedNameKind.AsyncIteratorPromiseOfValueOrEndBackingField == 'v'); 304Debug.Assert((char)GeneratedNameKind.CombinedTokensField == 'x'); 310Debug.Assert((char)GeneratedNameKind.IteratorCurrentBackingField == '2'); 316Debug.Assert((char)GeneratedNameKind.DisposeModeField == 'w'); 322Debug.Assert((char)GeneratedNameKind.IteratorCurrentThreadIdField == 'l'); 328Debug.Assert((char)GeneratedNameKind.StateMachineStateIdField == 'I'); 334Debug.Assert((char)GeneratedNameKind.ThisProxyField == '4'); 345Debug.Assert((char)GeneratedNameKind.StateMachineParameterProxyField == '3'); 358Debug.Assert((char)GeneratedNameKind.DynamicCallSiteField == 'p'); 455Debug.Assert(name == MakeSynthesizedDelegateName(byRefs, returnsVoid, generation)); 461Debug.Assert((char)GeneratedNameKind.InlineArrayType == 'y'); 470Debug.Assert((char)GeneratedNameKind.ReadOnlyListType == 'z'); 486Debug.Assert((char)GeneratedNameKind.AsyncBuilderField == 't'); 526Debug.Assert((char)GeneratedNameKind.ReusableHoistedLocalField == '7');
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorTypeSymbol.cs (1)
114Debug.Assert(property is { GetMethod: not null, SetMethod: null });
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListProperty.cs (1)
21Debug.Assert(setAccessorBody is null == interfaceProperty.SetMethod is null);
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeParameterSymbol.cs (1)
17Debug.Assert(containingType.IsClassType());
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListTypeSymbol.cs (6)
251Debug.Assert(diagnosticInfo is { }); 479Debug.Assert(enumeratorType is not null); 739Debug.Assert(fieldType.IsTypeParameter()); 740Debug.Assert(parameterReference.Type.Equals(fieldType) || 772Debug.Assert(symbol is { }); 773Debug.Assert(_field.Type.OriginalDefinition.Equals(symbol.ContainingType, TypeCompareKind.AllIgnoreOptions));
Symbols\Synthesized\Records\SynthesizedPrimaryConstructor.cs (14)
25Debug.Assert(syntax.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.StructDeclaration); 26Debug.Assert(containingType.HasPrimaryConstructor); 27Debug.Assert(containingType is SourceNamedTypeSymbol); 28Debug.Assert(containingType is IAttributeTargetSymbol); 38Debug.Assert(syntax.ParameterList != null); 59Debug.Assert(syntaxReferenceOpt != null); 106Debug.Assert(typeDecl.ParameterList is not null); 142Debug.Assert(arguments.SymbolPart == AttributeLocation.Method); 151Debug.Assert(arguments.SymbolPart == AttributeLocation.Method); 159Debug.Assert(symbolPart is AttributeLocation.Method or AttributeLocation.Return); 165Debug.Assert(attributeDeclarationSyntax.Target is object); 215Debug.Assert(count == value.Count); 224Debug.Assert(oldSet.Contains(p)); 228Debug.Assert(count == 0);
Symbols\Synthesized\Records\SynthesizedRecordBaseEquals.cs (1)
22Debug.Assert(!containingType.IsRecordStruct);
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 (3)
47Debug.Assert(!containingType.IsRecordStruct); 98Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor)); 164Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperatorBase.cs (3)
42Debug.Assert(name == WellKnownMemberNames.EqualityOperatorName || name == WellKnownMemberNames.InequalityOperatorName); 84Debug.Assert(IsImplicitlyDeclared); 87Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (3)
27Debug.Assert(equalityContract is null == containingType.IsRecordStruct); 69Debug.Assert(_equalityContract is not null); 93Debug.Assert(!other.Type.IsStructType());
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (2)
23Debug.Assert(containingType.IsRecordStruct == equalityContract is null); 56Debug.Assert(_equalityContract is not null);
Symbols\Synthesized\Records\SynthesizedRecordOrdinaryMethod.cs (3)
36Debug.Assert(Arity == 0); 78Debug.Assert(IsImplicitlyDeclared); 81Debug.Assert(WellKnownMembers.IsSynthesizedAttributeOptional(WellKnownMember.System_Runtime_CompilerServices_CompilerGeneratedAttribute__ctor));
Symbols\Synthesized\Records\SynthesizedRecordPrintMembers.cs (3)
51Debug.Assert(modifiersAreValid(result)); 180Debug.Assert(!printableMembers.IsEmpty); 208Debug.Assert(value.Type is not null);
Symbols\Synthesized\Records\SynthesizedRecordPropertySymbol.cs (2)
60Debug.Assert(isAutoPropertyAccessor); 66Debug.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)
30Debug.Assert(accessor.Locations.Length <= 1); 104Debug.Assert(accessor.Locations.Length <= 1); 117Debug.Assert(accessor.Locations.Length <= 1);
Symbols\Synthesized\SynthesizedBackingFieldSymbol.cs (6)
31Debug.Assert(!string.IsNullOrEmpty(name)); 91Debug.Assert(!string.IsNullOrEmpty(name)); 92Debug.Assert(property.RefKind is RefKind.None or RefKind.Ref or RefKind.RefReadOnly); 130Debug.Assert((object)arguments.AttributeSyntaxOpt != null); 131Debug.Assert(arguments.Diagnostics is BindingDiagnosticBag); 135Debug.Assert(arguments.SymbolPart == AttributeLocation.None);
Symbols\Synthesized\SynthesizedContainer.cs (2)
28Debug.Assert(name != null); 43Debug.Assert(name != null);
Symbols\Synthesized\SynthesizedEmbeddedAttributeSymbol.cs (4)
41Debug.Assert(name is object); 42Debug.Assert(containingNamespace is object); 43Debug.Assert(containingModule is object); 44Debug.Assert(baseType is object);
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 (13)
50Debug.Assert((object)containingType != null); 346Debug.Assert(userMain.ParameterCount == 0 || userMain.ParameterCount == 1); 376Debug.Assert( 449Debug.Assert(containingType.IsScriptClass); 450Debug.Assert(returnType.IsVoidType()); 477Debug.Assert(ctor.ParameterCount == 0); 480Debug.Assert(initializer.ParameterCount == 0); 489Debug.Assert(!initializer.ReturnType.IsDynamic()); 538Debug.Assert(containingType.IsSubmissionClass); 539Debug.Assert(!returnType.IsVoidType()); 568Debug.Assert(ctor.ParameterCount == 1); 571Debug.Assert(initializer.ParameterCount == 0); 610Debug.Assert(TypeSymbol.Equals(initializeResult.Type, _returnType.Type, TypeCompareKind.ConsiderEverything2));
Symbols\Synthesized\SynthesizedEventAccessorSymbol.cs (2)
31Debug.Assert(IsAbstract || IsExtern || IsFieldLikeEventAccessor()); 112Debug.Assert(TryGetBodyBinder() is null);
Symbols\Synthesized\SynthesizedFieldSymbol.cs (1)
32Debug.Assert((object)type != null);
Symbols\Synthesized\SynthesizedFieldSymbolBase.cs (2)
31Debug.Assert((object)containingType != null); 32Debug.Assert(!string.IsNullOrEmpty(name));
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\SynthesizedInlineArrayTypeSymbol.cs (2)
32Debug.Assert(arrayLength > 0); 195Debug.Assert(compilation is { });
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (2)
22Debug.Assert((object)containingType != null); 84Debug.Assert(_containingType.TypeKind == TypeKind.Class);
Symbols\Synthesized\SynthesizedInstanceMethodSymbol.cs (1)
47Debug.Assert(!IsStatic);
Symbols\Synthesized\SynthesizedInteractiveInitializerMethod.cs (3)
28Debug.Assert(containingType.IsScriptClass); 172Debug.Assert(!this.IsStatic); 173Debug.Assert(!this.IsGenericMethod);
Symbols\Synthesized\SynthesizedIntrinsicOperatorSymbol.cs (3)
34Debug.Assert(leftType.Equals(returnType, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 41Debug.Assert((leftType.IsDynamic() || rightType.IsDynamic()) == returnType.IsDynamic()); 42Debug.Assert(_containingType.IsDynamic() == returnType.IsDynamic());
Symbols\Synthesized\SynthesizedLambdaCacheFieldSymbol.cs (2)
22Debug.Assert((object)type != null); 23Debug.Assert((object)topLevelMethod != null);
Symbols\Synthesized\SynthesizedLocal.cs (5)
49Debug.Assert(!type.IsVoidType()); 51Debug.Assert(refKind != RefKind.Out); 52Debug.Assert(containingMethodOpt is null || containingMethodOpt.DeclaringCompilation is not null); 155Debug.Assert(_syntaxOpt != null); 179Debug.Assert(!_isKnownToReferToTempIfReferenceType);
Symbols\Synthesized\SynthesizedParameterSymbol.cs (9)
33Debug.Assert(type.HasType); 34Debug.Assert(name != null); 35Debug.Assert(ordinal >= 0); 307Debug.Assert(!(oldParam is SynthesizedComplexParameterSymbol)); 358Debug.Assert(!refCustomModifiers.IsDefault); 359Debug.Assert(isParams || !refCustomModifiers.IsEmpty || baseParameterForAttributes is object || defaultValue is not null || hasUnscopedRefAttribute); 360Debug.Assert(baseParameterForAttributes is null || baseParameterForAttributes.ExplicitDefaultConstantValue == defaultValue); 418Debug.Assert(_baseParameterForAttributes is null); 427Debug.Assert(_baseParameterForAttributes is null);
Symbols\Synthesized\SynthesizedPrivateImplementationDetailsType.cs (2)
26Debug.Assert(globalNamespace.IsGlobalNamespace); 27Debug.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 (1)
32Debug.Assert(declaration.SyntaxReference.GetSyntax() is CompilationUnitSyntax);
Symbols\Synthesized\SynthesizedStaticConstructor.cs (1)
402Debug.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\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); 195Debug.Assert(newOwner.IsTupleType && newOwner.TupleElementTypesWithAnnotations.Length > TupleElementIndex);
Symbols\Tuples\TupleFieldSymbol.cs (13)
46Debug.Assert(tupleElementIndex >= 0); 49Debug.Assert(!(underlyingField is TupleElementFieldSymbol)); 52Debug.Assert(!container.IsDefinition); 54Debug.Assert(container.IsTupleType); 57Debug.Assert(!locations.IsDefault); 211Debug.Assert(newOwner.IsTupleType); 267Debug.Assert(container.IsTupleType); 268Debug.Assert(underlyingField.ContainingType.IsTupleType); 269Debug.Assert(name != null); 272Debug.Assert((correspondingDefaultFieldOpt is null) == (NamedTypeSymbol.TupleMemberName(tupleElementIndex + 1) == name)); 273Debug.Assert(!(correspondingDefaultFieldOpt is TupleErrorFieldSymbol)); 332Debug.Assert(newOwner.IsTupleType); 333Debug.Assert(newOwner.TupleElements.Length == this._containingTuple.TupleElements.Length);
Symbols\Tuples\TupleTypeSymbol.cs (28)
42Debug.Assert(!shouldCheckConstraints || syntax is object); 43Debug.Assert(elementNames.IsDefault || elementTypesWithAnnotations.Length == elementNames.Length); 44Debug.Assert(!includeNullability || shouldCheckConstraints); 65Debug.Assert(syntax is object); 107Debug.Assert(tupleCompatibleType.IsTupleType); 129Debug.Assert(TupleElementTypesWithAnnotations.Length == newElementTypes.Length); 130Debug.Assert(newElementTypes.All(t => t.HasType)); 166Debug.Assert(IsTupleType); 167Debug.Assert(newElementNames.IsDefault || this.TupleElementTypesWithAnnotations.Length == newElementNames.Length); 173Debug.Assert(IsTupleType); 234Debug.Assert(chainedTupleTypeOpt is null == elementTypes.Length < ValueTupleRestPosition); 291Debug.Assert(allMissing || destinationNames.Length == sourceLength); 518Debug.Assert(relativeMember >= WellKnownMember.System_ValueTuple_T1__Item1 && relativeMember <= WellKnownMember.System_ValueTuple_TRest__ctor); 519Debug.Assert(type.IsDefinition); 572Debug.Assert(IsTupleType); 573Debug.Assert(currentMembers.All(m => !(m is TupleVirtualElementFieldSymbol))); 724Debug.Assert((object)oldUnderlying.OriginalDefinition == currentValueTuple.OriginalDefinition); 812Debug.Assert(relativeMember >= WellKnownMember.System_ValueTuple_T1__Item1 && relativeMember <= WellKnownMember.System_ValueTuple_TRest__ctor); 838Debug.Assert(fields.All(f => f is object)); 866Debug.Assert(names1.Length == names2.Length); 923Debug.Assert(underlyingType.IsTupleType); 924Debug.Assert(underlyingType.TupleElementNames.IsDefault); 970Debug.Assert(tuple.Equals(TupleUnderlyingType, TypeCompareKind.IgnoreTupleNames)); 1002Debug.Assert(tuple.Equals(TupleUnderlyingType, TypeCompareKind.IgnoreTupleNames)); 1034Debug.Assert(candidate.IsDefaultTupleElement); 1039Debug.Assert(builder.All(f => f is object)); 1083Debug.Assert((object)underlyingAssociatedField.ContainingSymbol == TupleUnderlyingType); 1084Debug.Assert(TupleUnderlyingType.GetMembers(underlyingAssociatedField.Name).IndexOf(underlyingAssociatedField) < 0);
Symbols\TypedConstantExtensions.cs (10)
32Debug.Assert(constant.Value is object); 42Debug.Assert(constant.ValueInternal is object); 49Debug.Assert(constant.Kind == TypedConstantKind.Enum); 53Debug.Assert(constant.ValueInternal is object); 69Debug.Assert(constant.Kind == TypedConstantKind.Enum); 140Debug.Assert(constant.ValueInternal is object); 142Debug.Assert(result is object); 148Debug.Assert(constant.Kind == TypedConstantKind.Enum); 218Debug.Assert(constant.ValueInternal is object); 220Debug.Assert(result is object);
Symbols\TypeMap.cs (7)
46Debug.Assert(allowAlpha || !from.Any(static tp => tp is SubstitutedTypeParameterSymbol)); 141Debug.Assert(TypeSymbol.Equals(oldOwner.ConstructedFrom, oldOwner, TypeCompareKind.ConsiderEverything2)); 147Debug.Assert(oldOwner.ConstructedFrom == oldOwner); 158Debug.Assert(oldOwner.ConstructedFrom == oldOwner); 159Debug.Assert(stopAt == null || stopAt.ConstructedFrom == stopAt); 191Debug.Assert( 204Debug.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)
403Debug.Assert(constraint.TypeKind != TypeKind.TypeParameter); 450Debug.Assert(!constraintTypes.IsDefaultOrEmpty); 569Debug.Assert(fromNonTypeConstraints == null); 570Debug.Assert(fromTypes != true); 698Debug.Assert(this.Equals(other, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes)); 709Debug.Assert(nullableAnnotation != DefaultNullableAnnotation);
Symbols\TypeParameterSymbolExtensions.cs (2)
13Debug.Assert((object)typeParameter1 != null); 14Debug.Assert((object)typeParameter2 != null);
Symbols\TypeSymbol.cs (24)
253Debug.Assert((object)type != null); 254Debug.Assert(!type.IsTypeParameter()); 387Debug.Assert(InterfaceInfo.EmptyInterfacesAndTheirBaseInterfaces.IsEmpty); 722Debug.Assert((object)interfaceMember != null); 723Debug.Assert(!this.IsInterfaceType()); 758Debug.Assert(ignoreImplementationInInterfacesIfResultIsNotReady || !implementationInInterfacesMightChangeResult); 759Debug.Assert(!implementationInInterfacesMightChangeResult || result.Symbol is null); 805Debug.Assert(!implementingType.IsInterfaceType()); 806Debug.Assert(interfaceMember.Kind == SymbolKind.Method || interfaceMember.Kind == SymbolKind.Property || interfaceMember.Kind == SymbolKind.Event); 807Debug.Assert(interfaceMember.IsImplementableInterfaceMember()); 810Debug.Assert((object)interfaceType != null && interfaceType.IsInterface); 939Debug.Assert(!canBeImplementedImplicitlyInCSharp9 || (object)implementingBaseOpt == null); 1052Debug.Assert(!implementingType.IsInterfaceType()); 1069Debug.Assert((object)defaultImpl == null); 1070Debug.Assert((object)conflict2 != null); 1076Debug.Assert(((object)conflict2 == null)); 1375Debug.Assert(interfaceType.IsInterface); 1541Debug.Assert(!implementingType.IsInterfaceType()); 1542Debug.Assert(interfaceMethod.IsAccessor()); 1974Debug.Assert(false); 2073Debug.Assert((object)implementingType != null); 2087Debug.Assert(interfaceMethod.Arity == implicitImpl.Arity); 2285Debug.Assert(interfaceMember.Kind != SymbolKind.Method || (object)interfaceMember == ((MethodSymbol)interfaceMember).ConstructedFrom); 2517Debug.Assert(HasInlineArrayAttribute(out var length) && length > 0);
Symbols\TypeSymbolExtensions.cs (1)
585Debug.Assert(type is FunctionPointerTypeSymbol || type.IsDelegateType());
Symbols\TypeUnification.cs (4)
33Debug.Assert(substituted1.Type.Equals(substituted2.Type, TypeCompareKind.CLRSignatureCompareOptions)); 34Debug.Assert(substituted1.CustomModifiers.SequenceEqual(substituted2.CustomModifiers)); 107Debug.Assert(t1.Type.IsTypeParameter() || !t2.Type.IsTypeParameter()); 154Debug.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); 90Debug.Assert(container.IsInterfaceType()); 91Debug.Assert(container.TypeParameters.Any(static tp => tp.Variance != VarianceKind.None)); 102Debug.Assert(!container.IsDelegateType()); 298Debug.Assert(requireOutputSafety || requireInputSafety); 366Debug.Assert(requireOutputSafety || requireInputSafety);
Symbols\Wrapped\WrappedFieldSymbol.cs (1)
30Debug.Assert((object)underlyingField != null);
Symbols\Wrapped\WrappedNamedTypeSymbol.cs (1)
33Debug.Assert((object)underlyingType != null);
Symbols\Wrapped\WrappedParameterSymbol.cs (1)
28Debug.Assert((object)underlyingParameter != null);
Symbols\Wrapped\WrappedPropertySymbol.cs (1)
30Debug.Assert((object)underlyingProperty != null);
Symbols\Wrapped\WrappedTypeParameterSymbol.cs (1)
31Debug.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 (3)
53Debug.Assert(result != null); 97Debug.Assert(tree != null); 390Debug.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 (7)
135Debug.Assert(HasCompilationUnitRoot); 145Debug.Assert(HasCompilationUnitRoot); 166Debug.Assert(!_lazyDirectives.IsNull); 294Debug.Assert(currentPos < pos); 382Debug.Assert(root != null); 397Debug.Assert(root != null); 676Debug.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)
83System.Diagnostics.Debug.Assert(index < 11); // Max. slots 11 (TypeDeclarationSyntax)
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)
53Debug.Assert(lambdaBody.Parent is object); 61Debug.Assert(lambda.IsKind(SyntaxKind.LocalFunctionStatement)); 64Debug.Assert(IsLambda(lambda)); 73Debug.Assert(oldBody.Parent is object); 105Debug.Assert(oldJoin.LeftExpression == oldBody || oldJoin.RightExpression == oldBody); 111Debug.Assert(oldGroup.GroupExpression == oldBody || oldGroup.ByExpression == oldBody); 228Debug.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 (2)
36Debug.Assert(!topLevel || ignoreChildNode == null); 69Debug.Assert(before.RawKind == after.RawKind);
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 (4)
1623Debug.Assert(leadingTrivia.Count == 1); 1626Debug.Assert(structure.Content.Count == 2); 1628Debug.Assert(elementSyntax.Attributes.Count == 1); 2247Debug.Assert(currentNode.Kind() == SyntaxKind.MemberBindingExpression ||
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)); 1174Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
Syntax\SyntaxNodeExtensions.cs (5)
20Debug.Assert(syntax != null); 34Debug.Assert(syntax != null); 148Debug.Assert(node != null); 265Debug.Assert( 370Debug.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)
318Debug.Assert(openBraceToken.IsKind(SyntaxKind.OpenBraceToken)); 335Debug.Assert(closeBraceToken.IsKind(SyntaxKind.CloseBraceToken)); 448Debug.Assert(((PropertyDeclarationSyntax)currentToken.Parent).SemicolonToken == currentToken);
Syntax\SyntaxTreeDiagnosticEnumerator.cs (9)
61Debug.Assert(_syntaxTree is object); 111get { Debug.Assert(_current is object); return _current; } 135Debug.Assert(capacity > 0); 204Debug.Assert(_stack != null); 205Debug.Assert(index >= 0 && index < _count); 212Debug.Assert(_stack != null); 213Debug.Assert(_count > 0); 219Debug.Assert(_stack != null); 220Debug.Assert(_count > 0);
Utilities\FirstAmongEqualsSet.cs (1)
76Debug.Assert(_hashSet.Count == 0);
Utilities\InterceptableLocation.cs (5)
64Debug.Assert(checksum.Length == ContentHashLength); 65Debug.Assert(path is not null); 66Debug.Assert(position >= 0); 67Debug.Assert(lineNumberOneIndexed > 0); 68Debug.Assert(characterNumberOneIndexed > 0);
Utilities\TypeSymbolExtensions.cs (1)
212Debug.Assert(visited == null || !visited.Contains(type.OriginalDefinition));
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 (2)
45Debug.Assert(value != char.MaxValue); 58Debug.Assert(value != char.MinValue);
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 (9)
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)); 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.UShortTC.cs (2)
45Debug.Assert(value != ushort.MaxValue); 57Debug.Assert(value != ushort.MinValue);
Microsoft.CodeAnalysis.CSharp.CodeStyle (54)
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
274Debug.Assert(ifStatementOrElseClause.IsKind(SyntaxKind.IfStatement));
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
64Debug.Assert(IsBinaryLike(binaryLike));
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
38Debug.Assert(IsBinaryLike(binaryPattern));
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
135Debug.Assert(labels.Count >= 1);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
189Debug.Assert(initializer.Parent is EqualsValueClauseSyntax);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
70Debug.Assert(IsIntIndexingMethod(method)); 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
132Debug.Assert(IsTwoArgumentSliceLikeMethod(sliceLikeMethod) || IsOneArgumentSliceLikeMethod(sliceLikeMethod));
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\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
377Debug.Assert(constructorDeclaration.Initializer.Kind() == SyntaxKind.ThisConstructorInitializer);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (9)
60Debug.Assert(!token.ContainsDiagnostics); 333Debug.Assert(char.IsSurrogate(ch)); 343Debug.Assert(tokenText[index] == '\\'); 356Debug.Assert(tokenText[index] == '\\'); 390Debug.Assert(tokenText[index] == '\\'); 409Debug.Assert(tokenText[index] == '\\'); 454Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 494Debug.Assert(character == 'x'); 526Debug.Assert(IsHexDigit(c));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
50Debug.Assert(trivia.ToString() == trivia.ToFullString()); 140Debug.Assert(trivia.ToString() == trivia.ToFullString()); 325Debug.Assert(trivia.HasStructure);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (6)
74Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 82Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 140Debug.Assert(result.Tab >= 0); 141Debug.Assert(result.LineBreaks >= 0); 178Debug.Assert((indentation / Options.TabSize) == result.Tab); 179Debug.Assert((indentation % Options.TabSize) == result.Space);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
98Debug.Assert(_options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents) != _options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
334Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
116Debug.Assert(oldNode.Kind() == newNode.Kind());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
855Debug.Assert(memberDeclaration.Kind() == SyntaxKind.IncompleteMember); 917Debug.Assert(topLevel || methodLevel);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
792Debug.Assert(rewrittenBitwiseNotExpression.Kind() == SyntaxKind.BitwiseNotExpression); 1174Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1230Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1260Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1440Debug.Assert(!rewrittenType.IsReferenceType && !IsIntrinsicOrEnum(rewrittenType));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (11)
73Debug.Assert(expression != 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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
84Debug.Assert(node.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (19)
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
110Debug.Assert(nextStatement.Kind() is SyntaxKind.ThrowStatement or SyntaxKind.ReturnStatement);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (4)
85Debug.Assert(SyntaxFacts.IsAssignmentExpression(nodeToGenerate)); 86Debug.Assert(_assignmentTarget != null); 207Debug.Assert(statements.Count is 1 or 2); 208Debug.Assert(!statements[0].IsKind(SyntaxKind.BreakStatement));
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
82Debug.Assert(leftSymbol.Equals(rightSymbol));
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
64Debug.Assert(diagnostics.Length == 1);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
66Debug.Assert(diagnostic.Properties[Constants.Kind] == Constants.SingleIfStatementForm);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
70Debug.Assert(node.Kind() is SyntaxKind.IsExpression or SyntaxKind.IsPatternExpression);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
176Debug.Assert(typeSymbol.IsTupleType); 178Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
245Debug.Assert(method.ExplicitInterfaceImplementations.Any() || method.IsOverride);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
130Debug.Assert(!endOfLine.IsKind(SyntaxKind.None));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
133Debug.Assert(oldUsings.Count == newUsings.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
244Debug.Assert(IsDiscardDeclaration(variable));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
77Debug.Assert(_seenContextNode);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1704Debug.Assert(expressionOpt != null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
206Debug.Assert(block.Statements.Count == 0); 241Debug.Assert(IsExpressionBody(body));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ResultProvider (17)
src\Compilers\CSharp\Portable\Parser\CharacterInfo.cs (3)
55Debug.Assert(IsHexDigit(c)); 65Debug.Assert(IsBinaryDigit(c)); 75Debug.Assert(IsDecDigit(c));
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (2)
179Debug.Assert((char)GeneratedNameKind.PrimaryConstructorParameter == 'P'); 200Debug.Assert(s_regexPatternString[0] == FileTypeNameStartChar);
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)); 1174Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.TypeNames.cs (2)
91Debug.Assert(!sawSingleInvalidIdentifier); 102Debug.Assert(rank > 0);
src\ExpressionEvaluator\CSharp\Source\ResultProvider\CSharpFormatter.Values.cs (4)
49Debug.Assert(lmrType.IsArray); 112Debug.Assert(!string.IsNullOrEmpty(argument)); 113Debug.Assert(!string.IsNullOrEmpty(type)); 201Debug.Assert(!string.IsNullOrEmpty(type));
Microsoft.CodeAnalysis.CSharp.Features (122)
BraceCompletion\CurlyBraceCompletionService.cs (1)
109Debug.Assert(s_instances[(int)indentStyle]._indentStyle == indentStyle);
ChangeSignature\UnifiedArgumentSyntax.cs (2)
19Debug.Assert(argument.Kind() is SyntaxKind.Argument or SyntaxKind.AttributeArgument); 41Debug.Assert(nameColonSyntax is NameColonSyntax);
CodeRefactorings\EnableNullable\EnableNullableCodeRefactoringProvider.FixAllProvider.cs (1)
36Debug.Assert(fixAllContext.Scope == FixAllScope.Solution);
CodeRefactorings\InlineTemporary\InlineTemporaryCodeRefactoringProvider.cs (2)
363Debug.Assert(variableDeclaration.Variables.Count > 1); 364Debug.Assert(variableDeclaration.Variables.Contains(variableDeclarator));
CodeRefactorings\SyncNamespace\CSharpChangeNamespaceService.cs (4)
237Debug.Assert(!declaredNamespaceParts.IsDefault && !targetNamespaceParts.IsDefault); 314Debug.Assert(!compilationUnit.Members.Any(m => m is BaseNamespaceDeclarationSyntax)); 417Debug.Assert(part.Length > 0); 430Debug.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);
ConvertBetweenRegularAndVerbatimString\AbstractConvertBetweenRegularAndVerbatimStringCodeRefactoringProvider.cs (1)
164Debug.Assert(!chars.IsDefault);
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
111Debug.Assert(operation.SemanticModel is not null);
ConvertToRawString\ConvertStringToRawStringCodeRefactoringProvider.cs (1)
146Debug.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)
123Debug.Assert(startFallbackOpt != default || endOpt != default); 485Debug.Assert(typeDeclaration.ParameterList != null); 491Debug.Assert(typeDeclaration.ParameterList != null); 950Debug.Assert(((ArrowExpressionClauseSyntax)parent).Expression == expression); 954Debug.Assert(((SwitchExpressionArmSyntax)parent).Expression == expression);
EditAndContinue\CSharpEditAndContinueAnalyzer.cs (36)
113Debug.Assert(((PropertyDeclarationSyntax)current).Initializer != null); 136Debug.Assert(current.Parent.IsKind(SyntaxKind.VariableDeclaration)); 160Debug.Assert(current.Parent.IsKind(SyntaxKind.CompilationUnit)); 183Debug.Assert(localOrParameter is IParameterSymbol or ILocalSymbol or IRangeVariableSymbol); 237Debug.Assert(!isBody); 245Debug.Assert(position == ((DoStatementSyntax)node).WhileKeyword.SpanStart); 246Debug.Assert(!isBody); 253Debug.Assert(position == ((PropertyDeclarationSyntax)node).Initializer!.SpanStart); 261Debug.Assert(!isBody); 281Debug.Assert(span.End == switchExpression.CloseBraceToken.Span.End); 289Debug.Assert(position == switchExpression.Span.Start); 304Debug.Assert(position == ((SwitchExpressionArmSyntax)node).Expression.SpanStart); 305Debug.Assert(!isBody); 438Debug.Assert(oldBody is ExpressionSyntax or BlockSyntax); 439Debug.Assert(newBody is ExpressionSyntax or BlockSyntax); 601Debug.Assert(statementPart is DefaultStatementPart or (int)BlockPart.OpenBrace or (int)BlockPart.CloseBrace); 621Debug.Assert(statementPart == DefaultStatementPart); 630Debug.Assert(statementPart == DefaultStatementPart); 653Debug.Assert(statementPart == DefaultStatementPart); 673Debug.Assert(statementPart == DefaultStatementPart); 1049Debug.Assert(oldModel != null); 1119Debug.Assert(matchingNewContainingMemberOrType == null); 1295Debug.Assert(oldCopyConstructor != null || newCopyConstructor != null); 1313Debug.Assert(node.Parent.IsKind(SyntaxKind.AccessorList)); 1363Debug.Assert(oldNode.RawKind == newNode.RawKind); 1423Debug.Assert(node is null or ParameterSyntax or TypeParameterSyntax or TypeParameterConstraintClauseSyntax); 1430Debug.Assert(otherNode != null); 1571Debug.Assert(oldParameters.Length is 1 or 2); 1572Debug.Assert(newParameters.Length is 1 or 2); 1939Debug.Assert(ordinal >= 0); 1947Debug.Assert(ordinal == 0); 2262Debug.Assert(((CommonForEachStatementSyntax)node).AwaitKeyword.IsKind(SyntaxKind.AwaitKeyword)); 2614Debug.Assert(current.Parent != null); 2630Debug.Assert(edit.Kind != EditKind.Update || edit.OldNode.RawKind == edit.NewNode.RawKind); 2766Debug.Assert(awaitExpression.IsKind(SyntaxKind.AwaitExpression)); 2876Debug.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)
83Debug.Assert(partnerDeclarationBody is null or PropertyOrIndexerAccessorDeclarationBody { HeaderActiveStatement: not null }); 90Debug.Assert(ExplicitBody != null); 91Debug.Assert(partnerDeclarationBody is null or PropertyOrIndexerAccessorDeclarationBody { ExplicitBody: not null });
EditAndContinue\SyntaxComparer.cs (4)
1508Debug.Assert(GetLabel(oldNode) == GetLabel(newNode) && GetLabel(oldNode) != IgnoredNode); 1544Debug.Assert(newNodeOrToken.IsToken == oldNodeOrToken.IsToken); 1553Debug.Assert(!SyntaxFactory.AreEquivalent(leftToken, rightToken) || distance == ExactMatchDist); 1561Debug.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 (1)
629Debug.Assert(name is SimpleNameSyntax);
GoToDefinition\CSharpGoToDefinitionSymbolService.cs (1)
82Debug.Assert(gotoOperation is { BranchKind: BranchKind.GoTo });
Highlighting\KeywordHighlighters\LoopHighlighter.cs (1)
81Debug.Assert(highlightBreaks || highlightContinues);
Highlighting\KeywordHighlighters\SwitchStatementHighlighter.cs (1)
59Debug.Assert(highlightBreaks || highlightGotos);
InitializeParameter\CSharpInitializeMemberFromPrimaryConstructorParameterCodeRefactoringProvider_Update.cs (3)
31Debug.Assert(parameters.Length >= 1); 32Debug.Assert(fieldsOrProperties.Length >= 1); 33Debug.Assert(parameters.Length == fieldsOrProperties.Length);
IntroduceVariable\CSharpIntroduceVariableService_IntroduceLocal.cs (2)
308Debug.Assert(matches.Contains(expression)); 372Debug.Assert(matches.Contains(expression));
Organizing\Organizers\MemberDeclarationsOrganizer.cs (1)
44Debug.Assert(originalList.Count == finalList.Count);
SignatureHelp\LightweightOverloadResolution.cs (3)
102Debug.Assert(foundParameterIndex < parameters.Length); 223Debug.Assert(parameterIndex >= 0); 224Debug.Assert(parameterIndex < method.Parameters.Length);
SignatureHelp\ObjectCreationExpressionSignatureHelpProvider.cs (2)
115Debug.Assert(type.TypeKind == TypeKind.Delegate); 116Debug.Assert(objectCreationExpression.ArgumentList is not null);
Snippets\AbstractCSharpForLoopSnippetProvider.cs (1)
77Debug.Assert(inlineExpressionType is not null);
src\Analyzers\CSharp\Analyzers\AddBraces\CSharpAddBracesDiagnosticAnalyzer.cs (1)
274Debug.Assert(ifStatementOrElseClause.IsKind(SyntaxKind.IfStatement));
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs (1)
64Debug.Assert(IsBinaryLike(binaryLike));
src\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs (1)
38Debug.Assert(IsBinaryLike(binaryPattern));
src\Analyzers\CSharp\Analyzers\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionDiagnosticAnalyzer.Analyzer.cs (1)
135Debug.Assert(labels.Count >= 1);
src\Analyzers\CSharp\Analyzers\UseCollectionExpression\CSharpUseCollectionExpressionForArrayDiagnosticAnalyzer.cs (1)
189Debug.Assert(initializer.Parent is EqualsValueClauseSyntax);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseIndexOperatorDiagnosticAnalyzer.InfoCache.cs (2)
70Debug.Assert(IsIntIndexingMethod(method)); 93Debug.Assert(method.MethodKind == MethodKind.Ordinary);
src\Analyzers\CSharp\Analyzers\UseIndexOrRangeOperator\CSharpUseRangeOperatorDiagnosticAnalyzer.InfoCache.cs (1)
132Debug.Assert(IsTwoArgumentSliceLikeMethod(sliceLikeMethod) || IsOneArgumentSliceLikeMethod(sliceLikeMethod));
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\Analyzers\CSharp\Analyzers\UsePrimaryConstructor\CSharpUsePrimaryConstructorDiagnosticAnalyzer.cs (1)
377Debug.Assert(constructorDeclaration.Initializer.Kind() == SyntaxKind.ThisConstructorInitializer);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.cs (1)
110Debug.Assert(nextStatement.Kind() is SyntaxKind.ThrowStatement or SyntaxKind.ReturnStatement);
src\Analyzers\CSharp\CodeFixes\ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionCodeFixProvider.Rewriter.cs (4)
85Debug.Assert(SyntaxFacts.IsAssignmentExpression(nodeToGenerate)); 86Debug.Assert(_assignmentTarget != null); 207Debug.Assert(statements.Count is 1 or 2); 208Debug.Assert(!statements[0].IsKind(SyntaxKind.BreakStatement));
src\Analyzers\CSharp\CodeFixes\DisambiguateSameVariable\CSharpDisambiguateSameVariableCodeFixProvider.cs (1)
82Debug.Assert(leftSymbol.Equals(rightSymbol));
src\Analyzers\CSharp\CodeFixes\FixReturnType\CSharpFixReturnTypeCodeFixProvider.cs (1)
64Debug.Assert(diagnostics.Length == 1);
src\Analyzers\CSharp\CodeFixes\InvokeDelegateWithConditionalAccess\InvokeDelegateWithConditionalAccessCodeFixProvider.cs (1)
66Debug.Assert(diagnostic.Properties[Constants.Kind] == Constants.SingleIfStatementForm);
src\Analyzers\CSharp\CodeFixes\RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs (1)
70Debug.Assert(node.Kind() is SyntaxKind.IsExpression or SyntaxKind.IsPatternExpression);
src\Analyzers\CSharp\CodeFixes\UseImplicitOrExplicitType\UseExplicitTypeCodeFixProvider.cs (2)
176Debug.Assert(typeSymbol.IsTupleType); 178Debug.Assert(elements.Length == parensDesignation.Variables.Count);
src\Compilers\CSharp\CSharpAnalyzerDriver\CSharpDeclarationComputer.cs (1)
109Debug.Assert(ctor.MethodKind == MethodKind.Constructor && typeDeclaration.ParameterList is object);
src\Compilers\CSharp\Portable\Syntax\LambdaUtilities.cs (7)
53Debug.Assert(lambdaBody.Parent is object); 61Debug.Assert(lambda.IsKind(SyntaxKind.LocalFunctionStatement)); 64Debug.Assert(IsLambda(lambda)); 73Debug.Assert(oldBody.Parent is object); 105Debug.Assert(oldJoin.LeftExpression == oldBody || oldJoin.RightExpression == oldBody); 111Debug.Assert(oldGroup.GroupExpression == oldBody || oldGroup.ByExpression == oldBody); 228Debug.Assert(selectOrGroupClause.Parent!.Parent is object);
UseExpressionBody\UseExpressionBodyCodeRefactoringProvider.cs (1)
194Debug.Assert(equivalenceKey != null);
UsePatternMatching\CSharpIsAndCastCheckWithoutNameCodeFixProvider.cs (1)
46Debug.Assert(diagnostics.Length == 1);
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\BetterCandidates.cs (1)
32Debug.Assert(TestOptions.Regular.LanguageVersion >= MessageID.IDS_FeatureImprovedOverloadCandidates.RequiredVersion());
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (3)
Compilation\ReferenceManagerTests.cs (1)
840Debug.Assert(parts.Length >= 3);
DeclarationTests.cs (2)
938Debug.Assert(underlying != null); 939Debug.Assert(underlying.HasCompilationUnitRoot);
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (1)
Parsing\ParsingTests.cs (1)
109Debug.Assert(node is object);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (8)
CSharpTestBase.cs (1)
2410Debug.Assert(returnExpression == null || useBoolReturns);
CSharpTestSource.cs (7)
53Debug.Assert(string.IsNullOrEmpty(sourceFileName)); 56Debug.Assert(string.IsNullOrEmpty(sourceFileName)); 59Debug.Assert(string.IsNullOrEmpty(sourceFileName)); 62Debug.Assert(parseOptions == null); 63Debug.Assert(string.IsNullOrEmpty(sourceFileName)); 66Debug.Assert(parseOptions == null); 67Debug.Assert(string.IsNullOrEmpty(sourceFileName));
Microsoft.CodeAnalysis.CSharp.Workspaces (58)
Classification\Worker.cs (1)
71Debug.Assert(nodeOrToken.IsNode || nodeOrToken.IsToken);
FindSymbols\CSharpDeclaredSymbolInfoFactoryService.cs (1)
688Debug.Assert(IsExtensionMethod(methodDeclaration));
Recommendations\CSharpRecommendationServiceRunner.cs (1)
835Debug.Assert(!excludeInstance || !excludeStatic);
Simplification\CSharpSimplificationService.cs (1)
206Debug.Assert(tuple.IsKind(SyntaxKind.TupleExpression));
Simplification\CSharpSimplificationService.Expander.cs (3)
591Debug.Assert(name.StartsWith(originalSimpleName.Identifier.ValueText, StringComparison.Ordinal)); 894Debug.Assert(!replaceNode || rewrittenNode.Kind() == SyntaxKind.IdentifierName); 966Debug.Assert(rewrittenNode is SimpleNameSyntax);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\EmbeddedLanguages\VirtualChars\CSharpVirtualCharService.cs (9)
60Debug.Assert(!token.ContainsDiagnostics); 333Debug.Assert(char.IsSurrogate(ch)); 343Debug.Assert(tokenText[index] == '\\'); 356Debug.Assert(tokenText[index] == '\\'); 390Debug.Assert(tokenText[index] == '\\'); 409Debug.Assert(tokenText[index] == '\\'); 454Debug.Assert(uintChar is > 0x0000FFFF and <= 0x0010FFFF); 494Debug.Assert(character == 'x'); 526Debug.Assert(IsHexDigit(c));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Extensions\SimpleNameSyntaxExtensions.cs (1)
16Debug.Assert(name.IsSimpleMemberAccessExpressionName() || name.IsMemberBindingExpressionName() || name.IsRightSideOfQualifiedName() || name.IsParentKind(SyntaxKind.NameMemberCref));
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.CodeShapeAnalyzer.cs (3)
50Debug.Assert(trivia.ToString() == trivia.ToFullString()); 140Debug.Assert(trivia.ToString() == trivia.ToFullString()); 325Debug.Assert(trivia.HasStructure);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Engine\Trivia\TriviaDataFactory.cs (6)
74Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 82Debug.Assert(string.IsNullOrWhiteSpace(this.TreeInfo.GetTextBetween(token1, token2))); 140Debug.Assert(result.Tab >= 0); 141Debug.Assert(result.LineBreaks >= 0); 178Debug.Assert((indentation / Options.TabSize) == result.Tab); 179Debug.Assert((indentation % Options.TabSize) == result.Space);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\IndentBlockFormattingRule.cs (1)
98Debug.Assert(_options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContents) != _options.Indentation.HasFlag(IndentationPlacement.SwitchCaseContentsWhenBlock));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Formatting\Rules\SuppressFormattingRule.cs (1)
334Debug.Assert(!startToken.IsKind(SyntaxKind.None) && !endToken.IsKind(SyntaxKind.None));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SemanticFacts\CSharpSemanticFacts.cs (1)
116Debug.Assert(oldNode.Kind() == newNode.Kind());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Services\SyntaxFacts\CSharpSyntaxFacts.cs (2)
855Debug.Assert(memberDeclaration.Kind() == SyntaxKind.IncompleteMember); 917Debug.Assert(topLevel || methodLevel);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Simplification\Simplifiers\CastSimplifier.cs (5)
792Debug.Assert(rewrittenBitwiseNotExpression.Kind() == SyntaxKind.BitwiseNotExpression); 1174Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1230Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1260Debug.Assert(currentOld.Kind() == currentNew.Kind()); 1440Debug.Assert(!rewrittenType.IsReferenceType && !IsIntrinsicOrEnum(rewrittenType));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\SpeculationAnalyzer.cs (11)
73Debug.Assert(expression != 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\Workspaces\SharedUtilitiesAndExtensions\Compiler\CSharp\Utilities\TypeStyle\CSharpTypeStyleHelper.cs (1)
84Debug.Assert(node.Kind() is SyntaxKind.VariableDeclaration or SyntaxKind.ForEachStatement or SyntaxKind.DeclarationExpression);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\CodeGeneration\MethodGenerator.cs (1)
245Debug.Assert(method.ExplicitInterfaceImplementations.Any() || method.IsOverride);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\Extensions\CompilationUnitSyntaxExtensions.cs (1)
130Debug.Assert(!endOfLine.IsKind(SyntaxKind.None));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpRemoveUnnecessaryImportsService.Rewriter.cs (1)
133Debug.Assert(oldUsings.Count == newUsings.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpReplaceDiscardDeclarationsWithAssignmentsService.cs (1)
244Debug.Assert(IsDiscardDeclaration(variable));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpSyntaxFactsService.cs (1)
77Debug.Assert(_seenContextNode);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\CSharpTypeInferenceService.TypeInferrer.cs (1)
1704Debug.Assert(expressionOpt != null);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\CSharp\LanguageServices\InitializeParameter\InitializeParameterHelpers.cs (2)
206Debug.Assert(block.Statements.Count == 0); 241Debug.Assert(IsExpressionBody(body));
Microsoft.CodeAnalysis.Debugging.Package (21)
CustomDebugInfoEncoder.cs (11)
25Debug.Assert(builder.Count == 0); 50Debug.Assert(_recordCount <= byte.MaxValue); 57Debug.Assert(typeName != null); 87Debug.Assert(groupSizes.Count <= ushort.MaxValue); 104Debug.Assert(usingCount <= ushort.MaxValue); 145Debug.Assert(dynamicLocals != null); 156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 157Debug.Assert(info.LocalName.Length <= IdentifierSize); 171Debug.Assert(tupleLocals != null); 178Debug.Assert(infos.Count > 0); 185Debug.Assert((info.SlotIndex == -1) ^ (info.ScopeStart == 0 && info.ScopeEnd == 0));
CustomDebugInfoReader.cs (7)
255Debug.Assert(flagsBuilder.Count == 0); 256Debug.Assert(nameBuilder.Length == 0); 396Debug.Assert(!allModuleInfoImportStrings.IsDefault); 420Debug.Assert(!importStrings.IsDefault); 450Debug.Assert(groupBuilder.Count == 0); 491Debug.Assert(!importStrings.IsDefault); 510Debug.Assert(!importStrings.IsDefault);
StateMachineHoistedLocalScope.cs (2)
26Debug.Assert(startOffset >= 0); 27Debug.Assert(endOffset > startOffset || startOffset == 0 && endOffset == 0);
TupleElementNamesInfo.cs (1)
22Debug.Assert(!elementNames.IsDefault);
Microsoft.CodeAnalysis.EditorFeatures (21)
AutomaticCompletion\BraceCompletionSessionProvider.BraceCompletionSession.cs (1)
231Debug.Assert(caretPos.HasValue && caretPos.Value.Position < closingSnapshotPoint.Position);
Classification\Syntactic\SyntacticClassificationTaggerProvider.ClassifiedLineCache.cs (1)
180Debug.Assert(_spanToLruNode[firstNode.Value.Span] == firstNode);
CodeActions\CodeActionEditHandlerService.cs (1)
189Debug.Assert(operationsList.Length > 0);
EditAndContinue\ActiveStatementTrackingService.cs (3)
212Debug.Assert(openDocumentIds.Length == baseActiveStatementSpans.Length); 265Debug.Assert(oldSpans.Length == newSpans.Length); 352Debug.Assert(TryGetSnapshot(document, out var s) && s == snapshot);
EditAndContinue\EditAndContinueLanguageService.cs (1)
177Debug.Assert(solution != null);
Editor\EditorLayerExtensionManager.cs (1)
50Debug.Assert(exception is not OperationCanceledException);
InlineRename\InlineRenameSession.cs (2)
268Debug.Assert(buffer.GetRelatedDocuments().Count() == 1); 269Debug.Assert(buffer.IsReadOnly(0) == buffer.IsReadOnly(VisualStudio.Text.Span.FromBounds(0, buffer.CurrentSnapshot.Length))); // All or nothing.
InlineRename\InlineRenameSession.OpenTextBufferManager.cs (1)
248Debug.Assert(trackingSpansTouched.Count() == 1);
IntelliSense\AsyncCompletion\Helpers.cs (1)
37Debug.Assert(item.DisplayText.StartsWith(Completion.Utilities.UnicodeStarAndSpace));
IntelliSense\AsyncCompletion\ItemManager.CompletionListUpdater.cs (4)
343Debug.Assert(matchResults.Count > 0); 401Debug.Assert(selectedItemIndex < matchResults.Count); 682Debug.Assert(filteredMatchResults.Count > 0); 806Debug.Assert(_filterText.Length > 0 || item.Rules.MatchPriority != MatchPriority.Default);
Interactive\InteractiveSession.cs (1)
187Debug.Assert(_lastSuccessfulSubmissionProjectId == null);
Preview\AbstractPreviewFactoryService.cs (1)
516Debug.Assert(oldDocument.Kind is TextDocumentKind.AdditionalDocument or TextDocumentKind.AnalyzerConfigDocument);
RenameTracking\RenameTrackingTaggerProvider.RenameTrackingCommitter.cs (1)
194Debug.Assert(newFullText.ToString() == documentWithOriginalName.GetTextSynchronously(cancellationToken).ToString());
Shared\Tagging\EventSources\TaggerEventSources.ViewSpanChangedEventSource.cs (1)
24Debug.Assert(textView != null);
Tagging\AbstractAsynchronousTaggerProvider.TagSource_ProduceTags.cs (1)
38Debug.Assert(_dataSource.CaretChangeBehavior.HasFlag(TaggerCaretChangeBehavior.RemoveAllTagsOnCaretMoveOutsideOfTag));
Microsoft.CodeAnalysis.EditorFeatures.Test.Utilities (8)
BraceHighlighting\MultiCharacterBraceHighlightingTests.cs (5)
38Debug.Assert(text.Substring(braces.Value.LeftSpan.Start, braces.Value.LeftSpan.Length) == "<@"); 39Debug.Assert(text.Substring(braces.Value.RightSpan.Start, braces.Value.RightSpan.Length) == "@>"); 57Debug.Assert(text[position + 1] == '@'); 72Debug.Assert(text[position + 1] == '>'); 81Debug.Assert(text[position - 1] == '@');
StubVsServiceExporter`2.cs (1)
61Debug.Assert(task.IsCompleted);
Threading\WpfTestRunner.cs (2)
59Debug.Assert(sta.StaThread == Thread.CurrentThread); 65Debug.Assert(SynchronizationContext.Current is DispatcherSynchronizationContext);
Microsoft.CodeAnalysis.EditorFeatures.Text (1)
Shared\Extensions\TextSpanExtensions.cs (1)
29Debug.Assert(snapshot != null);
Microsoft.CodeAnalysis.EditorFeatures.Wpf (13)
InlineDiagnostics\InlineDiagnosticsTaggerProvider.cs (1)
55Debug.Assert(!string.IsNullOrWhiteSpace(diagnostic.Message));
InlineRename\UI\Adornment\RenameFlyoutViewModel.cs (1)
263Debug.Assert(_oleComponent is null);
Interactive\InteractiveCommandHandler.cs (1)
101Debug.Assert(buffer != null);
Interactive\InteractiveEvaluator.cs (1)
212Debug.Assert(GetInteractiveCommands().CommandPrefix == CommandPrefix);
Interactive\InteractivePasteCommandHandler.cs (2)
94Debug.Assert(data != null); 98Debug.Assert(!(dataHasLineCutCopyTag && dataHasBoxCutCopyTag));
QuickInfo\LazyToolTip.cs (4)
62Debug.Assert(_element.ToolTip == this); 63Debug.Assert(_disposableToolTip == null); 80Debug.Assert(_disposableToolTip != null); 81Debug.Assert(_element.ToolTip == _disposableToolTip.ToolTip);
SignatureHelp\Presentation\SignatureHelpPresenter.SignatureHelpPresenterSession.cs (1)
96Debug.Assert(_signatureMap.ContainsKey(selectedItem));
StringIndentation\StringIndentationAdornmentManager.VisibleBlock.cs (1)
38Debug.Assert(span.Snapshot == view.TextSnapshot);
Suggestions\SuggestedActionWithNestedActions.cs (1)
38Debug.Assert(!nestedActionSets.IsDefaultOrEmpty);
Microsoft.CodeAnalysis.ExpressionEvaluator.ExpressionCompiler (38)
CustomTypeInfo.cs (2)
178Debug.Assert(str.Length > 0); 179Debug.Assert(str[0] == NameSeparator);
DkmUtilities.cs (5)
71Debug.Assert(size > 0); 89Debug.Assert(block.ModuleId.Id == module.Mvid); 115Debug.Assert(size > 0); 151Debug.Assert(size > 0); 227Debug.Assert(compResult.Assembly != null);
DynamicFlagsCustomTypeInfo.cs (3)
17Debug.Assert(startIndex >= 0); 35Debug.Assert(f == numFlags); 54Debug.Assert(index >= 0);
ExpressionCompiler.cs (3)
72Debug.Assert((builder.Count == 0) == (assembly.Count == 0)); 192Debug.Assert( 462Debug.Assert(missingAssemblyIdentities.IsEmpty);
FrameDecoder.cs (1)
191Debug.Assert((formattedArgument == null) || (formattedArgument.Flags & DkmEvaluationResultFlags.Expandable) == 0);
ILSpan.cs (1)
21Debug.Assert(start <= end);
MetadataUtilities.cs (4)
219Debug.Assert(corLibrary != null); 271Debug.Assert(modules.Count == identities.Count); 310Debug.Assert(referencedIndices.Count <= modules.Count); 311Debug.Assert(referencedIndices.Count <= referencedModules.Count);
MethodContextReuseConstraints.cs (8)
22Debug.Assert(moduleId.Id != Guid.Empty); 23Debug.Assert(MetadataTokens.Handle(methodToken).Kind == HandleKind.MethodDefinition); 24Debug.Assert(methodVersion >= 1); 34Debug.Assert(moduleId.Id != Guid.Empty); 35Debug.Assert(MetadataTokens.Handle(methodToken).Kind == HandleKind.MethodDefinition); 36Debug.Assert(methodVersion >= 1); 37Debug.Assert(ilOffset >= 0); 64Debug.Assert(ilOffset >= 0);
PDB\MethodDebugInfo.Native.cs (8)
298Debug.Assert(importStringGroups.IsDefault == externAliasStrings.IsDefault); 452Debug.Assert(localNames.Count == 0); 559Debug.Assert(alias == null); // The default namespace is never aliased. 560Debug.Assert(target != null); 561Debug.Assert(kind == ImportTargetKind.DefaultNamespace); 565Debug.Assert(lazyDefaultNamespaceName == null); 582Debug.Assert(scope == VBImportScopeKind.File || scope == VBImportScopeKind.Unspecified); 710Debug.Assert(localInfo.Length >= names.Length);
PDB\MethodDebugInfo.Portable.cs (1)
300Debug.Assert(importGroupBuilder.Count == 0);
PseudoVariableUtilities.cs (2)
44Debug.Assert(name.StartsWith("$ReturnValue", StringComparison.OrdinalIgnoreCase)); 66Debug.Assert(alias.Kind != DkmClrAliasKind.ReturnValue ||
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver (32)
CSharp\MemberSignatureParser.cs (5)
52Debug.Assert(token.Kind != TokenKind.End); 98Debug.Assert(CurrentToken.Kind == TokenKind.LessThan); 147Debug.Assert(signature != null); 173Debug.Assert(CurrentToken.Kind == TokenKind.LessThan); 256Debug.Assert(CurrentToken.Kind == TokenKind.OpenParen);
CSharp\Scanner.cs (3)
116Debug.Assert(_offset > 0); 117Debug.Assert(UnicodeCharacterUtilities.IsIdentifierStartCharacter(_text[_offset - 1])); 118Debug.Assert(_offset == 1 || !UnicodeCharacterUtilities.IsIdentifierPartCharacter(_text[_offset - 2]));
FunctionResolver.cs (2)
73Debug.Assert(module != null); // <Filter><RuntimeId RequiredValue="DkmRuntimeId.Clr"/></Filter> should ensure this. 189Debug.Assert(result == 0 || result == 1);
MetadataResolver.cs (1)
351Debug.Assert(!handle.IsNil);
Name.cs (3)
31Debug.Assert(qualifiedName != null); 32Debug.Assert(!typeParameters.IsDefault); 65Debug.Assert(!string.IsNullOrEmpty(name));
src\Compilers\CSharp\Portable\Symbols\Synthesized\GeneratedNameParser.cs (2)
179Debug.Assert((char)GeneratedNameKind.PrimaryConstructorParameter == 'P'); 200Debug.Assert(s_regexPatternString[0] == FileTypeNameStartChar);
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)); 1174Debug.Assert(Enum.IsDefined(typeof(SyntaxKind), (SyntaxKind)i));
TypeSignature.cs (5)
33Debug.Assert(qualifiedName != null); 34Debug.Assert(!typeArguments.IsDefault); 67Debug.Assert(!string.IsNullOrEmpty(name)); 86Debug.Assert(elementType != null); 110Debug.Assert(pointedAtType != null);
VisualBasic\MemberSignatureParser.cs (5)
61Debug.Assert(token.Kind != TokenKind.End); 116Debug.Assert(IsStartOfTypeArguments()); 166Debug.Assert(signature != null); 198Debug.Assert(IsStartOfTypeArguments()); 296Debug.Assert(CurrentToken.Kind == TokenKind.OpenParen);
Microsoft.CodeAnalysis.ExpressionEvaluator.FunctionResolver.UnitTests (1)
FunctionResolverTestBase.cs (1)
197Debug.Assert(arity >= 0);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider (129)
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Compilers\Core\Portable\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);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (2)
178Debug.Assert(str.Length > 0); 179Debug.Assert(str[0] == NameSeparator);
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\DynamicFlagsCustomTypeInfo.cs (3)
17Debug.Assert(startIndex >= 0); 35Debug.Assert(f == numFlags); 54Debug.Assert(index >= 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (7)
26Debug.Assert(elementTypeAndInfo.Type != null); 27Debug.Assert(sizes != null); 28Debug.Assert(lowerBounds != null); 29Debug.Assert(sizes.Count > 0); 30Debug.Assert(sizes.Count == lowerBounds.Count); 42Debug.Assert(count > 0); 110Debug.Assert(_lowerBounds == null || _lowerBounds.Count == 1);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\DebuggerTypeProxyExpansion.cs (3)
38Debug.Assert((inspectionContext.EvaluationFlags & DkmEvaluationFlags.NoExpansion) == 0); 51Debug.Assert(rawView != null); 115Debug.Assert(proxyValue != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\DynamicViewExpansion.cs (3)
33Debug.Assert((proxyValue == null) || (!proxyValue.IsNull && !proxyValue.IsError() && !proxyValue.HasExceptionThrown())); 65Debug.Assert(proxyValue != null); 66Debug.Assert(proxyMembers != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (6)
46Debug.Assert(!value.IsNull); 51Debug.Assert(!runtimeType.IsInterface || value.IsNull); 175Debug.Assert(staticExpansions.Count > 0); 280Debug.Assert(members != null); 281Debug.Assert(members.Length > 0); 282Debug.Assert(customTypeInfoMap != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\PointerDereferenceExpansion.cs (1)
20Debug.Assert(elementTypeAndInfo.Type != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ResultsViewExpansion.cs (5)
76Debug.Assert(errorMessage != null); 130Debug.Assert(!value.IsError()); 198Debug.Assert(proxyValue != null); 199Debug.Assert(proxyMembers != null); 229Debug.Assert(parent != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TupleExpansion.cs (8)
232Debug.Assert(declaringTypeAndInfo.ClrType != null); 233Debug.Assert(fieldTypeAndInfo.ClrType != null); 234Debug.Assert(fieldInfo != null); 235Debug.Assert(name != null); 236Debug.Assert(declaringTypeAndInfo.Type.Equals(fieldInfo.DeclaringType)); 237Debug.Assert(fieldTypeAndInfo.Type.Equals(fieldInfo.FieldType)); 238Debug.Assert(parent == null || parent.FieldInfo.FieldType.Equals(fieldInfo.DeclaringType)); 269Debug.Assert(declaringTypeAndInfo.Type.GetTupleCardinalityIfAny() == cardinality);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (5)
25Debug.Assert(declaredType.IsGenericType); 26Debug.Assert(!declaredType.IsGenericTypeDefinition); 34Debug.Assert(_typeParameters.Length == _typeArguments.Length); 35Debug.Assert(Array.TrueForAll(_typeParameters, t => t.IsGenericParameter)); 36Debug.Assert(Array.TrueForAll(_typeArguments, t => !t.IsGenericParameter));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (2)
78Debug.Assert(inspectionContext != null); 345Debug.Assert((formatSpecifiers.Count == 0) == (newLength == oldLength));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (6)
160Debug.Assert(!IsPredefinedType(type)); 197Debug.Assert(hasTypeArguments == (typeArguments != null)); 403Debug.Assert(nTypeArgs > 0); 404Debug.Assert(nTypeArgs <= TypeHelpers.TupleFieldRestPosition); 432Debug.Assert(!DynamicFlagsCustomTypeInfo.GetFlag(dynamicFlags, dynamicFlagIndex)); 438Debug.Assert(nameIndex == lastNameIndex);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.Values.cs (11)
102Debug.Assert(tmp != null); 181Debug.Assert(value.Type.GetLmrType().IsCharacter()); 193Debug.Assert(charTemp != null); 218Debug.Assert(!value.IsError()); 274Debug.Assert(lmrType.IsEnum); 275Debug.Assert(value != null); 350Debug.Assert(lmrType.IsEnum); 367Debug.Assert(inspectionContext != null); 377Debug.Assert(value != null); 447Debug.Assert(value != null); 471Debug.Assert(valueStr != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ArrayBuilder.cs (1)
27Debug.Assert(builder.Count == 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\CustomTypeInfoTypeArgumentMap.cs (10)
35Debug.Assert(typeDefinition != null); 36Debug.Assert((dynamicFlags != null) == (dynamicFlagStartIndices != null)); 37Debug.Assert((tupleElementNames != null) == (tupleElementNameStartIndices != null)); 40Debug.Assert(typeDefinition.IsGenericTypeDefinition); 42Debug.Assert(dynamicFlagStartIndices == null || dynamicFlagStartIndices.Length == n + 1); 43Debug.Assert(tupleElementNameStartIndices == null || tupleElementNameStartIndices.Length == n + 1); 62Debug.Assert(type != null); 77Debug.Assert(typeDefinition != null); 178Debug.Assert(typeArgs.Length > 0); 205Debug.Assert(type.IsGenericParameter);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\EvalResultDataItem.cs (3)
170Debug.Assert(name != null); 171Debug.Assert(formatSpecifiers != null); 172Debug.Assert((flags & DkmEvaluationResultFlags.Expandable) == 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\MemberAndDeclarationInfo.cs (2)
79Debug.Assert(member != null); 236Debug.Assert(accessors.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeAndCustomInfo.cs (1)
21Debug.Assert(type != null); // Can only be null in the default instance.
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (17)
44Debug.Assert(!type.IsInterface); 54Debug.Assert(memberLocation == DeclarationInfo.FromSubTypeOfDeclaredType); 152Debug.Assert(memberNameAlreadySeen != (previousDeclaration == DeclarationInfo.None)); 305Debug.Assert(result == type.IsMscorlibType("System", "Object")); 416Debug.Assert(value.Type.GetLmrType().IsNullable()); 484Debug.Assert(index >= 0); 701Debug.Assert(typeDef.IsGenericTypeDefinition); 702Debug.Assert(typeDef.GetGenericArguments().Length == typeArgs.Length); 779Debug.Assert(type != null); 780Debug.Assert(baseType != null); 781Debug.Assert(!baseType.IsInterface); 825Debug.Assert((@namespace == null) || (@namespace.Length > 0)); // Type.Namespace is null not empty. 826Debug.Assert(!string.IsNullOrEmpty(name)); 861Debug.Assert(((PropertyInfo)member).GetIndexParameters().Length == 0); 877Debug.Assert(interfaceType.IsInterface); 885Debug.Assert(index >= 0); 888Debug.Assert(interfaceType.GetGenericTypeDefinition().Equals(result.GetGenericTypeDefinition()));
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeWalker.cs (1)
80Debug.Assert(_stack != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ValueHelpers.cs (2)
19Debug.Assert(valueStr != null); 55Debug.Assert(values != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.cs (14)
143Debug.Assert(index >= numRows); 144Debug.Assert(initialRequestSize >= numRows); 186Debug.Assert(count >= numRows); 567Debug.Assert(value.Type.GetProxyType() == null); 576Debug.Assert(declaredType.Equals(value.Type.GetLmrType())); 593Debug.Assert(lmrNullableTypeArg.Equals(value.Type.GetLmrType())); // If this is not the case, add a test for includeRuntimeTypeIfNecessary. 654Debug.Assert(formatSpecifiers != null); 659Debug.Assert(type.Equals(declaredType.GetLmrType())); 680Debug.Assert(dataItem.Flags == (DkmEvaluationResultFlags.ReadOnly | DkmEvaluationResultFlags.Expandable)); 861Debug.Assert(name != null); 944Debug.Assert(!declaredType.IsTypeVariables()); 994Debug.Assert(declaredTypeAndInfo.Info?.PayloadTypeId != CustomTypeInfo.PayloadTypeId); 1072Debug.Assert(_completionRoutine == null); 1082Debug.Assert(_state != State.Executing);
Microsoft.CodeAnalysis.ExpressionEvaluator.ResultProvider.Utilities (139)
Debugger\Engine\DkmClrModuleInstance.cs (1)
55Debug.Assert(typeArguments.Count == type.GetGenericArguments().Length);
Debugger\Engine\DkmClrRuntimeInstance.cs (1)
106Debug.Assert(mscorlib == null);
Debugger\Engine\DkmClrValue.cs (6)
44Debug.Assert((type == null) || !type.GetLmrType().IsTypeVariables() || (valueFlags == DkmClrValueFlags.Synthetic)); 45Debug.Assert((alias == null) || evalFlags.Includes(DkmEvaluationResultFlags.HasObjectId)); 47Debug.Assert((type == null) || !type.GetLmrType().IsPointer || (value != null)); 409Debug.Assert(declaringType != null); 630Debug.Assert(!lmrType.IsGenericTypeDefinition); 685Debug.Assert(typeArgs.Count <= 1);
Debugger\MemberInfo\AssemblyImpl.cs (1)
21Debug.Assert(assembly != null);
Debugger\MemberInfo\ConstructorInfoImpl.cs (1)
22Debug.Assert(constructor != null);
Debugger\MemberInfo\CustomAttributeDataImpl.cs (1)
21Debug.Assert(customAttributeData != null);
Debugger\MemberInfo\EventInfoImpl.cs (1)
21Debug.Assert(@event != null);
Debugger\MemberInfo\FieldInfoImpl.cs (1)
23Debug.Assert(field != null);
Debugger\MemberInfo\MethodInfoImpl.cs (1)
22Debug.Assert(method != null);
Debugger\MemberInfo\ModuleImpl.cs (1)
21Debug.Assert(module != null);
Debugger\MemberInfo\ParameterInfoImpl.cs (1)
21Debug.Assert(parameter != null);
Debugger\MemberInfo\PropertyInfoImpl.cs (1)
23Debug.Assert(property != null);
Debugger\MemberInfo\TypeImpl.cs (1)
24Debug.Assert(type != null);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\CustomTypeInfo.cs (2)
178Debug.Assert(str.Length > 0); 179Debug.Assert(str[0] == NameSeparator);
src\ExpressionEvaluator\Core\Source\ExpressionCompiler\DynamicFlagsCustomTypeInfo.cs (3)
17Debug.Assert(startIndex >= 0); 35Debug.Assert(f == numFlags); 54Debug.Assert(index >= 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ArrayExpansion.cs (7)
26Debug.Assert(elementTypeAndInfo.Type != null); 27Debug.Assert(sizes != null); 28Debug.Assert(lowerBounds != null); 29Debug.Assert(sizes.Count > 0); 30Debug.Assert(sizes.Count == lowerBounds.Count); 42Debug.Assert(count > 0); 110Debug.Assert(_lowerBounds == null || _lowerBounds.Count == 1);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\DebuggerTypeProxyExpansion.cs (3)
38Debug.Assert((inspectionContext.EvaluationFlags & DkmEvaluationFlags.NoExpansion) == 0); 51Debug.Assert(rawView != null); 115Debug.Assert(proxyValue != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\DynamicViewExpansion.cs (3)
33Debug.Assert((proxyValue == null) || (!proxyValue.IsNull && !proxyValue.IsError() && !proxyValue.HasExceptionThrown())); 65Debug.Assert(proxyValue != null); 66Debug.Assert(proxyMembers != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\MemberExpansion.cs (6)
46Debug.Assert(!value.IsNull); 51Debug.Assert(!runtimeType.IsInterface || value.IsNull); 175Debug.Assert(staticExpansions.Count > 0); 280Debug.Assert(members != null); 281Debug.Assert(members.Length > 0); 282Debug.Assert(customTypeInfoMap != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\PointerDereferenceExpansion.cs (1)
20Debug.Assert(elementTypeAndInfo.Type != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\ResultsViewExpansion.cs (5)
76Debug.Assert(errorMessage != null); 130Debug.Assert(!value.IsError()); 198Debug.Assert(proxyValue != null); 199Debug.Assert(proxyMembers != null); 229Debug.Assert(parent != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TupleExpansion.cs (8)
232Debug.Assert(declaringTypeAndInfo.ClrType != null); 233Debug.Assert(fieldTypeAndInfo.ClrType != null); 234Debug.Assert(fieldInfo != null); 235Debug.Assert(name != null); 236Debug.Assert(declaringTypeAndInfo.Type.Equals(fieldInfo.DeclaringType)); 237Debug.Assert(fieldTypeAndInfo.Type.Equals(fieldInfo.FieldType)); 238Debug.Assert(parent == null || parent.FieldInfo.FieldType.Equals(fieldInfo.DeclaringType)); 269Debug.Assert(declaringTypeAndInfo.Type.GetTupleCardinalityIfAny() == cardinality);
src\ExpressionEvaluator\Core\Source\ResultProvider\Expansion\TypeVariablesExpansion.cs (5)
25Debug.Assert(declaredType.IsGenericType); 26Debug.Assert(!declaredType.IsGenericTypeDefinition); 34Debug.Assert(_typeParameters.Length == _typeArguments.Length); 35Debug.Assert(Array.TrueForAll(_typeParameters, t => t.IsGenericParameter)); 36Debug.Assert(Array.TrueForAll(_typeArguments, t => !t.IsGenericParameter));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.cs (2)
78Debug.Assert(inspectionContext != null); 345Debug.Assert((formatSpecifiers.Count == 0) == (newLength == oldLength));
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.TypeNames.cs (6)
160Debug.Assert(!IsPredefinedType(type)); 197Debug.Assert(hasTypeArguments == (typeArguments != null)); 403Debug.Assert(nTypeArgs > 0); 404Debug.Assert(nTypeArgs <= TypeHelpers.TupleFieldRestPosition); 432Debug.Assert(!DynamicFlagsCustomTypeInfo.GetFlag(dynamicFlags, dynamicFlagIndex)); 438Debug.Assert(nameIndex == lastNameIndex);
src\ExpressionEvaluator\Core\Source\ResultProvider\Formatter.Values.cs (11)
102Debug.Assert(tmp != null); 181Debug.Assert(value.Type.GetLmrType().IsCharacter()); 193Debug.Assert(charTemp != null); 218Debug.Assert(!value.IsError()); 274Debug.Assert(lmrType.IsEnum); 275Debug.Assert(value != null); 350Debug.Assert(lmrType.IsEnum); 367Debug.Assert(inspectionContext != null); 377Debug.Assert(value != null); 447Debug.Assert(value != null); 471Debug.Assert(valueStr != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ArrayBuilder.cs (1)
27Debug.Assert(builder.Count == 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\CustomTypeInfoTypeArgumentMap.cs (10)
35Debug.Assert(typeDefinition != null); 36Debug.Assert((dynamicFlags != null) == (dynamicFlagStartIndices != null)); 37Debug.Assert((tupleElementNames != null) == (tupleElementNameStartIndices != null)); 40Debug.Assert(typeDefinition.IsGenericTypeDefinition); 42Debug.Assert(dynamicFlagStartIndices == null || dynamicFlagStartIndices.Length == n + 1); 43Debug.Assert(tupleElementNameStartIndices == null || tupleElementNameStartIndices.Length == n + 1); 62Debug.Assert(type != null); 77Debug.Assert(typeDefinition != null); 178Debug.Assert(typeArgs.Length > 0); 205Debug.Assert(type.IsGenericParameter);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\EvalResultDataItem.cs (3)
170Debug.Assert(name != null); 171Debug.Assert(formatSpecifiers != null); 172Debug.Assert((flags & DkmEvaluationResultFlags.Expandable) == 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\MemberAndDeclarationInfo.cs (2)
79Debug.Assert(member != null); 236Debug.Assert(accessors.Length > 0);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeAndCustomInfo.cs (1)
21Debug.Assert(type != null); // Can only be null in the default instance.
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeHelpers.cs (17)
44Debug.Assert(!type.IsInterface); 54Debug.Assert(memberLocation == DeclarationInfo.FromSubTypeOfDeclaredType); 152Debug.Assert(memberNameAlreadySeen != (previousDeclaration == DeclarationInfo.None)); 305Debug.Assert(result == type.IsMscorlibType("System", "Object")); 416Debug.Assert(value.Type.GetLmrType().IsNullable()); 484Debug.Assert(index >= 0); 701Debug.Assert(typeDef.IsGenericTypeDefinition); 702Debug.Assert(typeDef.GetGenericArguments().Length == typeArgs.Length); 779Debug.Assert(type != null); 780Debug.Assert(baseType != null); 781Debug.Assert(!baseType.IsInterface); 825Debug.Assert((@namespace == null) || (@namespace.Length > 0)); // Type.Namespace is null not empty. 826Debug.Assert(!string.IsNullOrEmpty(name)); 861Debug.Assert(((PropertyInfo)member).GetIndexParameters().Length == 0); 877Debug.Assert(interfaceType.IsInterface); 885Debug.Assert(index >= 0); 888Debug.Assert(interfaceType.GetGenericTypeDefinition().Equals(result.GetGenericTypeDefinition()));
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\TypeWalker.cs (1)
80Debug.Assert(_stack != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\Helpers\ValueHelpers.cs (2)
19Debug.Assert(valueStr != null); 55Debug.Assert(values != null);
src\ExpressionEvaluator\Core\Source\ResultProvider\ResultProvider.cs (14)
143Debug.Assert(index >= numRows); 144Debug.Assert(initialRequestSize >= numRows); 186Debug.Assert(count >= numRows); 567Debug.Assert(value.Type.GetProxyType() == null); 576Debug.Assert(declaredType.Equals(value.Type.GetLmrType())); 593Debug.Assert(lmrNullableTypeArg.Equals(value.Type.GetLmrType())); // If this is not the case, add a test for includeRuntimeTypeIfNecessary. 654Debug.Assert(formatSpecifiers != null); 659Debug.Assert(type.Equals(declaredType.GetLmrType())); 680Debug.Assert(dataItem.Flags == (DkmEvaluationResultFlags.ReadOnly | DkmEvaluationResultFlags.Expandable)); 861Debug.Assert(name != null); 944Debug.Assert(!declaredType.IsTypeVariables()); 994Debug.Assert(declaredTypeAndInfo.Info?.PayloadTypeId != CustomTypeInfo.PayloadTypeId); 1072Debug.Assert(_completionRoutine == null); 1082Debug.Assert(_state != State.Executing);
Microsoft.CodeAnalysis.ExternalAccess.Razor (1)
RazorMappingServiceWrapper.cs (1)
47Debug.Assert(i == changesCount);
Microsoft.CodeAnalysis.Features (440)
AddFileBanner\AbstractAddFileBannerCodeRefactoringProvider.cs (2)
155Debug.Assert(equivalenceKey != null); 164Debug.Assert(banner.Length > 0);
AddImport\SearchScopes\SearchScope.cs (1)
69Debug.Assert(areSimilar);
AddImport\SymbolResult.cs (1)
43Debug.Assert(DesiredNameDiffersFromSourceName());
CodeFixes\Configuration\ConfigurationUpdater.cs (6)
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)); 236Debug.Assert(!string.IsNullOrEmpty(optionName)); 237Debug.Assert(optionValue != null);
CodeFixes\Suppression\AbstractSuppressionBatchFixAllProvider.cs (3)
116Debug.Assert(!diagnostics.IsDefault); 319Debug.Assert(orderedDocuments.Length > 1); 330Debug.Assert(currentDocument.Id == oldDocument.Id);
CodeRefactorings\AddMissingImports\AbstractAddMissingImportsFeatureService.cs (1)
187Debug.Assert(textChanges.Last().Span.IntersectsWith(insertSpan.End));
CodeRefactorings\MoveType\AbstractMoveTypeService.MoveTypeEditor.cs (1)
281Debug.Assert(!removableCandidates.Contains(ancestor));
CodeRefactorings\SyncNamespace\AbstractChangeNamespaceService.cs (4)
155Debug.Assert(namespaces.Length == originalNamespaceDeclarations.Length); 565Debug.Assert(newNamespace != null); 603Debug.Assert(containersToAddImports.Length > 0); 705Debug.Assert(document.Id == refLoc.Document.Id);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.MoveFileCodeAction.cs (1)
53Debug.Assert(state.RelativeDeclaredNamespace != null);
CodeRefactorings\SyncNamespace\AbstractSyncNamespaceCodeRefactoringProvider.State.cs (1)
202Debug.Assert(relativeTo != null && @namespace != null);
Completion\CompletionContext.cs (1)
98Debug.Assert(!Provider.IsExpandItemProvider);
Completion\CompletionHelper.cs (1)
273Debug.Assert(isItem1Expanded && match1.Kind == PatternMatchKind.Exact && !isItem2Expanded && match2.Kind > PatternMatchKind.Prefix ||
Completion\CompletionService.cs (1)
262Debug.Assert(item.Span == change.TextChange.Span || item.IsComplexTextEdit);
Completion\CompletionService_GetCompletions.cs (3)
141Debug.Assert(ValidatePossibleTriggerCharacterSet(trigger.Kind, triggeredProviders, document, text, caretPosition, options)); 257Debug.Assert(!completionContexts.IsDefaultOrEmpty); 266Debug.Assert(item != null);
Completion\FileSystemCompletionHelper.cs (1)
43Debug.Assert(searchPaths.All(PathUtilities.IsAbsolute));
Completion\Providers\ImportCompletionProvider\ImportCompletionItem.cs (1)
96Debug.Assert(!attributeItem.TryGetProperty(AttributeFullName, out var _));
Completion\Providers\Scripting\GlobalAssemblyCacheCompletionHelper.cs (1)
28Debug.Assert(itemRules != null);
ConvertAnonymousType\AbstractConvertAnonymousTypeToClassCodeRefactoringProvider.cs (2)
83Debug.Assert(anonymousObject != null); 84Debug.Assert(anonymousType != null);
ConvertIfToSwitch\AbstractConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (1)
55Debug.Assert(root is object); // we didn't remove the root
ConvertToInterpolatedString\AbstractConvertPlaceholderToInterpolatedStringRefactoringProvider.cs (1)
160Debug.Assert(remainingArgCount > 0);
ConvertTupleToStruct\AbstractConvertTupleToStructCodeRefactoringProvider.cs (2)
268Debug.Assert(tupleExprOrTypeNode != null); 269Debug.Assert(tupleType != null);
Debugging\AbstractBreakpointResolver.cs (2)
174Debug.Assert(type != null); 175Debug.Assert(names.Length >= 2);
Diagnostics\DiagnosticArguments.cs (3)
90Debug.Assert(documentId != null || documentSpan == null); 92Debug.Assert(documentAnalysisKind is null or 94Debug.Assert(projectAnalyzerIds.Length > 0 || hostAnalyzerIds.Length > 0);
Diagnostics\DiagnosticsUpdatedArgs.cs (2)
34Debug.Assert(diagnostics.All(d => d.ProjectId == projectId && d.DocumentId == documentId)); 35Debug.Assert(kind != DiagnosticsUpdatedKind.DiagnosticsRemoved || diagnostics.IsEmpty);
DocumentationComments\AbstractDocumentationCommentSnippetService.cs (3)
183Debug.Assert(lines.Count > 2); 341Debug.Assert(lines.Count > 2); 348Debug.Assert(line.Start + lineOffset == startPosition);
DocumentHighlighting\AbstractDocumentHighlightsService.cs (1)
243Debug.Assert(solution.WorkspaceKind is WorkspaceKind.Interactive or WorkspaceKind.MiscellaneousFiles);
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (52)
223Debug.Assert(oldSymbol != null || newSymbol != null); 516Debug.Assert(newDocument.State.SupportsEditAndContinue()); 517Debug.Assert(!newActiveStatementSpans.IsDefault); 518Debug.Assert(newDocument.SupportsSyntaxTree); 519Debug.Assert(newDocument.SupportsSemanticModel); 520Debug.Assert(filePath != null); 553Debug.Assert(oldTree == null || oldTree.Options.Equals(newTree.Options)); 663Debug.Assert(newActiveStatements.All(a => a != null)); 784Debug.Assert(!newActiveStatementSpans.IsDefault); 785Debug.Assert(oldActiveStatements.Length == newActiveStatements.Count); 786Debug.Assert(oldActiveStatements.Length == newExceptionRegions.Count); 943Debug.Assert(!newActiveStatementSpans.IsDefault); 944Debug.Assert(newActiveStatementSpans.IsEmpty || oldActiveStatements.Length == newActiveStatementSpans.Length); 945Debug.Assert(oldActiveStatements.IsEmpty || oldActiveStatements.Length == newActiveStatements.Count); 946Debug.Assert(newActiveStatements.Count == newExceptionRegions.Count); 947Debug.Assert(oldMemberBody != null || newMemberBody != null); 986Debug.Assert(oldDeclaration != null); 1005Debug.Assert(oldMemberBody != null); 1129Debug.Assert(oldMemberBody != null); 1130Debug.Assert(oldDeclaration != null); 1152Debug.Assert(lazyActiveOrMatchedLambdas != null); 1213Debug.Assert(oldEnclosingLambdaBody != null); 1214Debug.Assert(lazyActiveOrMatchedLambdas != null); 1259Debug.Assert(newSpan != default); 1571Debug.Assert(node != null); 2058Debug.Assert(editMap[newNode] is EditKind.Update or EditKind.Insert); 2120Debug.Assert(currentSegment.path != null); 2121Debug.Assert(lastOldStartLine >= 0); 2298Debug.Assert(previousOldEndLine >= 0); 2506Debug.Assert(inBreakState || newActiveStatementSpans.IsEmpty); 2536Debug.Assert(edit.OldNode is null || edit.NewNode is null || IsNamespaceDeclaration(edit.OldNode) == IsNamespaceDeclaration(edit.NewNode)); 2550Debug.Assert(oldSymbol is INamedTypeSymbol); 2551Debug.Assert(newSymbol is INamedTypeSymbol); 2568Debug.Assert(newTypeDeclaration != null); 2746Debug.Assert(oldSymbol is INamedTypeSymbol); 3036Debug.Assert(synthesizedProperty.SetMethod != null); 3106Debug.Assert(newSymbol != null); 3329Debug.Assert(IsConstructorWithMemberInitializers(oldSymbol, cancellationToken) == IsConstructorWithMemberInitializers(newSymbol, cancellationToken)); 3330Debug.Assert(IsDeclarationWithInitializer(oldDeclaration) == IsDeclarationWithInitializer(newDeclaration)); 3526Debug.Assert(member is IPropertySymbol or IMethodSymbol); 4154Debug.Assert(oldImportData.BestFitMapping == newImportData.BestFitMapping || 5174Debug.Assert(oldBody != null); 5175Debug.Assert(newBody != null); 5517Debug.Assert(IsNestedFunction(newLambda) == IsNestedFunction(oldLambda)); 6101Debug.Assert(parameterKey.Syntax != null); 6222Debug.Assert(oldCapture.Kind == newCapture.Kind); 6353Debug.Assert(local.Kind is not SymbolKind.RangeVariable); 6365Debug.Assert(node != null); 6443Debug.Assert(otherNode.SyntaxTree == otherRoot.SyntaxTree); 6444Debug.Assert(otherRoot.FullSpan.Contains(otherNode.SpanStart)); 6447Debug.Assert(otherNode.FullSpan.Length > 0); 6456Debug.Assert(otherNode.RawKind == rightNode.RawKind);
EditAndContinue\ActiveStatement.cs (1)
48Debug.Assert(!IsStale || !IsMethodUpToDate);
EditAndContinue\ActiveStatementsMap.cs (2)
51Debug.Assert(documentPathMap.All(entry => entry.Value.IsSorted(Comparer))); 182Debug.Assert(oldRoot.SyntaxTree == oldSyntaxTree);
EditAndContinue\CommittedSolution.cs (1)
267Debug.Assert(_solution.ContainsProject(documentId.ProjectId));
EditAndContinue\DebuggingSession.cs (4)
147Debug.Assert(!_isDisposed); 260Debug.Assert(project.SupportsEditAndContinue()); 704Debug.Assert(oldProject.SupportsEditAndContinue()); 705Debug.Assert(newProject.SupportsEditAndContinue());
EditAndContinue\DocumentActiveStatementChanges.cs (1)
29Debug.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\EditAndContinueDocumentAnalysesCache.cs (1)
152Debug.Assert(newMappedDocumentActiveSpan.UnmappedDocumentId == null || newMappedDocumentActiveSpan.UnmappedDocumentId == newDocument.Id);
EditAndContinue\EditAndContinueMethodDebugInfoReader.cs (2)
48Debug.Assert(symReader != null); 49Debug.Assert(version >= 1);
EditAndContinue\EditSession.cs (10)
124Debug.Assert(emitResult.Success); 125Debug.Assert(emitResult.Baseline is not null); 495Debug.Assert(oldProject.Id == newProject.Id); 1208Debug.Assert(oldActiveStatements.Length == newExceptionRegions.Length); 1209Debug.Assert(newActiveStatements.Length == newExceptionRegions.Length); 1232Debug.Assert(string.Equals(oldSpan.Path, newSpan.Path, 1236Debug.Assert(oldActiveStatement.IsMethodUpToDate == newActiveStatement.IsMethodUpToDate); 1318Debug.Assert(newSpan.Span.End.Line - newSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line); 1319Debug.Assert(region.OldSpan.Span.End.Line - region.OldSpan.Span.Start.Line == baseSpan.Span.End.Line - baseSpan.Span.Start.Line); 1320Debug.Assert(newSpan.Path == region.OldSpan.Path);
EditAndContinue\EditSessionTelemetry.cs (1)
144Debug.Assert(_capabilities == EditAndContinueCapabilities.None || _capabilities == capabilities);
EditAndContinue\EmitSolutionUpdateResults.cs (4)
56Debug.Assert(SyntaxError.DataLocation != null); 57Debug.Assert(SyntaxError.Message != null); 136Debug.Assert(Solution != null); 137Debug.Assert(SyntaxError.Location.SourceTree != null);
EditAndContinue\ProjectChanges.cs (4)
46Debug.Assert(!semanticEdits.IsDefault); 47Debug.Assert(!lineChanges.IsDefault); 48Debug.Assert(!activeStatementChanges.IsDefault); 49Debug.Assert(requiredCapabilities != EditAndContinueCapabilities.None);
EditAndContinue\SemanticEditInfo.cs (4)
29Debug.Assert(runtimeRudeEdits == null || matchingNodes != 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)
168Debug.Assert(argName != null || argIndex != null);
EmbeddedLanguages\Json\JsonLexer.cs (5)
51Debug.Assert(chars.Length > 0); 63Debug.Assert(Position < Text.Length); 278Debug.Assert(IsAt("//")); 299Debug.Assert(IsAt("/*")); 312Debug.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)
124Debug.Assert(_lexer.Position == _lexer.Text.Length); 125Debug.Assert(_currentToken.Kind == JsonKind.EndOfFile); 410Debug.Assert(_currentToken.Kind == JsonKind.ColonToken); 472Debug.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)
49Debug.Assert(_info.IsAnyStringLiteral(stringLiteral.RawKind));
EmbeddedLanguages\RegularExpressions\RegexLexer.cs (6)
376Debug.Assert(Text[beforeSlash] == '\\'); 377Debug.Assert(Text[beforeSlash + 1].Value is 'x' or 'u'); 419Debug.Assert(Text[beforeSlash] == '\\'); 420Debug.Assert(IsOctalDigit(Text[start])); 430Debug.Assert(octalVal is >= 0 and <= 7); 446Debug.Assert(Position - start > 0);
EmbeddedLanguages\RegularExpressions\RegexNodes.cs (62)
23Debug.Assert(expression != null); 24Debug.Assert(endOfFileToken.Kind == RegexKind.EndOfFile); 78Debug.Assert(textToken.Kind == RegexKind.TextToken); 106Debug.Assert(openBracketToken.Kind == RegexKind.OpenBracketToken); 107Debug.Assert(components != null); 108Debug.Assert(closeBracketToken.Kind == RegexKind.CloseBracketToken); 149Debug.Assert(caretToken.Kind == RegexKind.CaretToken); 180Debug.Assert(left != null); 181Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 182Debug.Assert(right != null); 218Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 219Debug.Assert(characterClass != null); 271Debug.Assert(dotToken.Kind == RegexKind.DotToken); 310Debug.Assert(expression != null); 311Debug.Assert(asteriskToken.Kind == RegexKind.AsteriskToken); 342Debug.Assert(expression != null); 343Debug.Assert(plusToken.Kind == RegexKind.PlusToken); 374Debug.Assert(expression != null); 375Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 408Debug.Assert(quantifier != null); 409Debug.Assert(quantifier.Kind != RegexKind.LazyQuantifier); 410Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 442Debug.Assert(expression != null); 443Debug.Assert(openBraceToken.Kind == RegexKind.OpenBraceToken); 444Debug.Assert(firstNumberToken.Kind == RegexKind.NumberToken); 445Debug.Assert(closeBraceToken.Kind == RegexKind.CloseBraceToken); 491Debug.Assert(commaToken.Kind == RegexKind.CommaToken); 525Debug.Assert(commaToken.Kind == RegexKind.CommaToken); 526Debug.Assert(secondNumberToken.Kind == RegexKind.NumberToken); 560Debug.Assert(anchorToken.Kind is RegexKind.DollarToken or RegexKind.CaretToken); 587Debug.Assert(sequenceList.NodesAndTokens.Length > 0); 589Debug.Assert(sequenceList.NodesAndTokens[i].Kind == RegexKind.BarToken); 613Debug.Assert(openParenToken.Kind == RegexKind.OpenParenToken); 614Debug.Assert(closeParenToken.Kind == RegexKind.CloseParenToken); 631Debug.Assert(expression != null); 660Debug.Assert(questionToken.Kind == RegexKind.QuestionToken); 713Debug.Assert(colonToken.Kind == RegexKind.ColonToken); 714Debug.Assert(expression != null); 750Debug.Assert(colonToken.Kind == RegexKind.ColonToken); 751Debug.Assert(expression != null); 786Debug.Assert(equalsToken.Kind == RegexKind.EqualsToken); 787Debug.Assert(expression != null); 822Debug.Assert(exclamationToken.Kind == RegexKind.ExclamationToken); 823Debug.Assert(expression != null); 855Debug.Assert(lessThanToken.Kind == RegexKind.LessThanToken); 872Debug.Assert(equalsToken.Kind == RegexKind.EqualsToken); 873Debug.Assert(expression != null); 909Debug.Assert(exclamationToken.Kind == RegexKind.ExclamationToken); 910Debug.Assert(expression != null); 946Debug.Assert(greaterThanToken.Kind == RegexKind.GreaterThanToken); 947Debug.Assert(expression != null); 983Debug.Assert(expression != null); 1025Debug.Assert(minusToken.Kind == RegexKind.MinusToken); 1026Debug.Assert(expression != null); 1070Debug.Assert(result != null); 1088Debug.Assert(innerOpenParenToken.Kind == RegexKind.OpenParenToken); 1089Debug.Assert(innerCloseParenToken.Kind == RegexKind.CloseParenToken); 1131Debug.Assert(grouping != null); 1161Debug.Assert(backslashToken.Kind == RegexKind.BackslashToken); 1190Debug.Assert(typeToken.Kind == RegexKind.TextToken); 1419Debug.Assert(openBraceToken.Kind == RegexKind.OpenBraceToken); 1420Debug.Assert(closeBraceToken.Kind == RegexKind.CloseBraceToken);
EmbeddedLanguages\RegularExpressions\RegexParser.cs (24)
169Debug.Assert(_lexer.Position == _lexer.Text.Length); 170Debug.Assert(_currentToken.Kind == RegexKind.EndOfFile); 624Debug.Assert(token.Value == null); 918Debug.Assert(_currentToken.Kind == RegexKind.OpenParenToken); 1224Debug.Assert(openBracketToken.Kind == RegexKind.OpenBracketToken); 1245Debug.Assert(_currentToken.VirtualChars.Length == 1); 1383Debug.Assert(sequence.ChildCount > 0); 1385Debug.Assert(IsEscapedMinus(sequence.ChildAt(i).Node)); 1417Debug.Assert(RegexLexer.IsHexChar(ch)); 1478Debug.Assert(_currentToken.VirtualChars.Length == 1); 1564Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1577Debug.Assert(_currentToken.VirtualChars.Length == 1); 1610Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1623Debug.Assert(_currentToken.VirtualChars.Length == 1); 1648Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1663Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1702Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1724Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1725Debug.Assert(_lexer.Text[_lexer.Position].Value is '<' or '\''); 1807Debug.Assert(_lexer.Text[_lexer.Position - 1] == '\\'); 1811Debug.Assert(_currentToken.VirtualChars.Length == 1); 1818Debug.Assert(octalDigits.VirtualChars.Length > 0); 1885Debug.Assert(_currentToken.VirtualChars.Length == 1); 1931Debug.Assert(_lexer.Text[_lexer.Position - 1] is var ch && (ch == 'P' || ch == 'p'));
EmbeddedLanguages\StackFrame\StackFrameLexer.cs (1)
419Debug.Assert(virtualChars.Length > 0);
EmbeddedLanguages\StackFrame\StackFrameNodeDefinitions.cs (25)
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); 222Debug.Assert(lessThanToken.Kind == StackFrameKind.LessThanToken); 223Debug.Assert(greaterThanToken.Kind == StackFrameKind.GreaterThanToken); 224Debug.Assert(!dollarToken.HasValue || dollarToken.Value.Kind == StackFrameKind.DollarToken); 273Debug.Assert(generatedNameSeparator.Kind == StackFrameKind.GeneratedNameSeparatorToken); 274Debug.Assert(identifier.Kind == StackFrameKind.IdentifierToken); 275Debug.Assert(pipeToken.Kind == StackFrameKind.PipeToken); 276Debug.Assert(suffix.Kind == StackFrameKind.GeneratedNameSuffixToken); 325Debug.Assert(!arrayRankSpecifiers.IsDefaultOrEmpty); 352Debug.Assert(!commaTokens.IsDefault); 353Debug.Assert(openBracket.Kind == StackFrameKind.OpenBracketToken); 354Debug.Assert(closeBracket.Kind == StackFrameKind.CloseBracketToken); 355Debug.Assert(commaTokens.All(static t => t.Kind == StackFrameKind.CommaToken)); 406Debug.Assert(openToken.Kind is StackFrameKind.OpenBracketToken or StackFrameKind.LessThanToken); 407Debug.Assert(typeArguments.Length > 0); 452Debug.Assert(identifier.Kind == StackFrameKind.IdentifierToken); 481Debug.Assert(openToken.Kind == StackFrameKind.OpenParenToken); 482Debug.Assert(closeToken.Kind == StackFrameKind.CloseParenToken); 521Debug.Assert(path.Kind == StackFrameKind.PathToken); 522Debug.Assert(colon.HasValue == line.HasValue); 523Debug.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);
ExtractMethod\AbstractSyntaxTriviaService.cs (1)
31Debug.Assert(Enum.GetNames(typeof(TriviaLocation)).Length == TriviaLocationsCount);
FindUsages\DefinitionItemFactory.cs (2)
211Debug.Assert(originatingProjectId == null || originatingProjectId == info.ProjectId); 292Debug.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)
328Debug.Assert(memberSymbol.TypeKind is TypeKind.Class or TypeKind.Struct);
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)
500Debug.Assert(parameterSymbol is not null);
InvertIf\AbstractInvertIfCodeRefactoringProvider.cs (2)
380Debug.Assert(statementRange.FirstStatement == statementRange.LastStatement); 539Debug.Assert(subsequentSingleExitPoint is TStatementSyntax);
InvertIf\AbstractInvertIfCodeRefactoringProvider.StatementRange.cs (5)
20Debug.Assert(firstStatement != null); 21Debug.Assert(lastStatement != null); 22Debug.Assert(firstStatement.Parent != null); 23Debug.Assert(firstStatement.Parent == lastStatement.Parent); 24Debug.Assert(firstStatement.SpanStart <= lastStatement.SpanStart);
MoveToNamespace\AbstractMoveToNamespaceService.cs (1)
274Debug.Assert(symbol != null && !string.IsNullOrEmpty(targetNamespace));
MoveToNamespace\MoveToNamespaceCodeAction.cs (1)
62Debug.Assert(moveToNamespaceResult.Succeeded);
NavigateTo\AbstractNavigateToSearchService.CachedDocumentSearch.cs (1)
74Debug.Assert(priorityDocuments.All(d => projects.Contains(d.Project)));
NavigateTo\AbstractNavigateToSearchService.InProcess.cs (1)
250Debug.Assert(Enum.GetUnderlyingType(typeof(DeclaredSymbolInfoKind)) == typeof(byte));
NavigateTo\AbstractNavigateToSearchService.NormalSearch.cs (1)
82Debug.Assert(priorityDocuments.All(d => projects.Contains(d.Project)));
NavigateTo\NavigateToSearcher.cs (5)
117Debug.Assert(count >= 0); 118Debug.Assert(_remainingProgressItems >= 0); 127Debug.Assert(newValue >= 0); 176Debug.Assert(_remainingProgressItems == 0); 238Debug.Assert(searchRegularDocuments || searchGeneratedDocuments);
PdbSourceDocument\ImplementationAssemblyLookupService.cs (1)
210Debug.Assert(assemblyName is not null);
PdbSourceDocument\SourceLinkMap.cs (1)
201Debug.Assert(mappedUri.Suffix.Length == 0);
ReplaceDocCommentTextWithTag\AbstractReplaceDocCommentTextWithTagCodeRefactoringProvider.cs (1)
214Debug.Assert(startInclusive > 0);
ReplaceMethodWithProperty\ReplaceMethodWithPropertyCodeRefactoringProvider.cs (1)
440Debug.Assert(method.DeclaringSyntaxReferences.Length == 1);
ReplacePropertyWithMethods\ReplacePropertyWithMethodsCodeRefactoringProvider.cs (1)
417Debug.Assert(property.DeclaringSyntaxReferences.Length == 1);
Shared\Extensions\DocumentExtensions.cs (1)
39Debug.Assert(document.GetRequiredSyntaxRootSynchronously(CancellationToken.None) == root);
SplitOrMergeIfStatements\Consecutive\AbstractMergeConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
124Debug.Assert(ifGenerator.GetElseIfAndElseClauses(firstIfOrElseIf).Length == 0);
SplitOrMergeIfStatements\Consecutive\AbstractSplitIntoConsecutiveIfStatementsCodeRefactoringProvider.cs (1)
84Debug.Assert(ifGenerator.GetElseIfAndElseClauses(ifOrElseIf).Length == 0);
SplitOrMergeIfStatements\Nested\AbstractMergeNestedIfStatementsCodeRefactoringProvider.cs (2)
127Debug.Assert(blockFacts.IsStatementContainer(ifOrElseIf)); 204Debug.Assert(blockFacts.GetStatementContainer(outerIfStatement) is object);
src\Analyzers\Core\Analyzers\AbstractBuiltInCodeStyleDiagnosticAnalyzer.cs (2)
76Debug.Assert(options.Count > 1); 88Debug.Assert(option is { Definition.DefaultValue: ICodeStyleOption2 } == descriptor.CustomTags.Contains(WellKnownDiagnosticTags.CustomSeverityConfigurable));
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\Analyzers\Core\Analyzers\DiagnosticCustomTags.cs (3)
71Debug.Assert(customTags.Length == tags.Length); 75Debug.Assert(customTags[i] == tags[i]); 81Debug.Assert(isConfigurable || enforceOnBuild == EnforceOnBuild.Never);
src\Analyzers\Core\Analyzers\Helpers\DiagnosticHelper.cs (1)
338Debug.Assert(id.StartsWith("IDE", StringComparison.Ordinal));
src\Analyzers\Core\Analyzers\IDEDiagnosticIdToOptionMappingHelper.cs (4)
52Debug.Assert(perLanguageValuedOption.IsPerLanguage); 88Debug.Assert(!map.TryGetValue(diagnosticId, out var existingOptions) || options.SetEquals(existingOptions)); 89Debug.Assert(options.All(option => option.Definition.IsEditorConfigOption)); 101Debug.Assert(!s_diagnosticIdToFadingOptionMap.TryGetValue(diagnosticId, out var existingOption) || existingOption.Equals(fadingOption));
src\Analyzers\Core\Analyzers\MakeFieldReadonly\AbstractMakeFieldReadonlyDiagnosticAnalyzer.cs (2)
109Debug.Assert(fieldStateMap.ContainsKey(field.OriginalDefinition)); 219Debug.Assert(IsCandidateField(field));
src\Analyzers\Core\Analyzers\RemoveUnnecessaryParentheses\AbstractRemoveUnnecessaryParenthesesDiagnosticAnalyzer.cs (1)
104Debug.Assert(preference.Value == ParenthesesPreference.NeverIfUnnecessary ||
src\Analyzers\Core\Analyzers\RemoveUnnecessarySuppressions\AbstractRemoveUnnecessaryPragmaSuppressionsDiagnosticAnalyzer.cs (3)
454Debug.Assert(semanticModel.Compilation.Options.ReportSuppressedDiagnostics); 554Debug.Assert(diagnostic.Location.IsInSource); 555Debug.Assert(diagnostic.Location.SourceTree == tree);
src\Analyzers\Core\Analyzers\RemoveUnusedMembers\AbstractRemoveUnusedMembersDiagnosticAnalyzer.cs (3)
399Debug.Assert(memberReference.Parent is ICompoundAssignmentOperation compoundAssignment && 539Debug.Assert(IsCandidateSymbol(member)); 540Debug.Assert(!member.IsImplicitlyDeclared);
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.cs (3)
254Debug.Assert(unusedValueExpressionStatementSeverity.Severity != ReportDiagnostic.Suppress || 315Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _)); 321Debug.Assert(TryGetUnusedValuePreference(diagnostic, out _));
src\Analyzers\Core\Analyzers\RemoveUnusedParametersAndValues\AbstractRemoveUnusedParametersAndValuesDiagnosticAnalyzer.SymbolStartAnalyzer.BlockAnalyzer.cs (4)
259Debug.Assert(operation.Kind is OperationKind.DelegateCreation or OperationKind.AnonymousFunction); 308Debug.Assert(operation.Kind is OperationKind.LocalReference or OperationKind.ParameterReference); 509Debug.Assert(!SymbolUsageAnalysis.Run(context.GetControlFlowGraph(operationBlock), context.OwningSymbol, context.CancellationToken) 594Debug.Assert(symbol is not ILocalSymbol local || !local.IsRef);
src\Analyzers\Core\Analyzers\UseCompoundAssignment\UseCompoundAssignmentUtilities.cs (2)
36Debug.Assert(binaryToAssignmentMap.Count == assignmentToTokenMap.Count); 37Debug.Assert(binaryToAssignmentMap.Values.All(assignmentToTokenMap.ContainsKey));
src\Analyzers\Core\Analyzers\UseSystemHashCode\UseSystemHashCodeDiagnosticAnalyzer.cs (1)
70Debug.Assert(elementCount >= 2 || statements.Length >= 2);
src\Analyzers\Core\Analyzers\ValidateFormatString\AbstractValidateFormatStringDiagnosticAnalyzer.cs (1)
202Debug.Assert(syntaxFacts.IsArgument(argsArgument));
src\Analyzers\Core\CodeFixes\ConflictMarkerResolution\AbstractConflictMarkerCodeFixProvider.cs (1)
395Debug.Assert(
src\Analyzers\Core\CodeFixes\GenerateConstructor\GenerateConstructorHelpers.cs (1)
87Debug.Assert(constructor.Parameters.Length == expressions.Length);
src\Analyzers\Core\CodeFixes\MatchFolderAndNamespace\AbstractChangeNamespaceToMatchFolderCodeFixProvider.cs (2)
45Debug.Assert(diagnostics.Select(diagnostic => diagnostic.Properties[MatchFolderAndNamespaceConstants.TargetNamespace]).Distinct().Count() == 1); 64Debug.Assert(newSolution != document.Project.Solution);
src\Analyzers\Core\CodeFixes\PopulateSwitch\AbstractPopulateSwitchCodeFixProvider.cs (1)
62Debug.Assert(missingCases || missingDefaultCase);
src\Analyzers\Core\CodeFixes\RemoveUnusedMembers\AbstractRemoveUnusedMembersCodeFixProvider.cs (1)
99Debug.Assert(childDeclarators.All(c => !declarators.Contains(c)));
src\Analyzers\Core\CodeFixes\RemoveUnusedParametersAndValues\AbstractRemoveUnusedValuesCodeFixProvider.cs (6)
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); 726Debug.Assert(removeAssignments);
src\Analyzers\Core\CodeFixes\UseNullPropagation\AbstractUseNullPropagationCodeFixProvider.cs (1)
279Debug.Assert(syntaxFacts.IsElementAccessExpression(elementAccess));
src\Compilers\Core\AnalyzerDriver\DeclarationComputer.cs (1)
60Debug.Assert(assemblyScopedNamespaceSymbol.ConstituentNamespaces.Length == 1);
src\Compilers\Core\AnalyzerDriver\DeclarationInfo.cs (2)
17Debug.Assert(declaredNode != null); 18Debug.Assert(!executableCodeBlocks.IsDefault);
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\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoEncoder.cs (11)
25Debug.Assert(builder.Count == 0); 50Debug.Assert(_recordCount <= byte.MaxValue); 57Debug.Assert(typeName != null); 87Debug.Assert(groupSizes.Count <= ushort.MaxValue); 104Debug.Assert(usingCount <= ushort.MaxValue); 145Debug.Assert(dynamicLocals != null); 156Debug.Assert(info.Flags.Length <= DynamicAttributeSize); 157Debug.Assert(info.LocalName.Length <= IdentifierSize); 171Debug.Assert(tupleLocals != null); 178Debug.Assert(infos.Count > 0); 185Debug.Assert((info.SlotIndex == -1) ^ (info.ScopeStart == 0 && info.ScopeEnd == 0));
src\Dependencies\CodeAnalysis.Debugging\CustomDebugInfoReader.cs (7)
255Debug.Assert(flagsBuilder.Count == 0); 256Debug.Assert(nameBuilder.Length == 0); 396Debug.Assert(!allModuleInfoImportStrings.IsDefault); 420Debug.Assert(!importStrings.IsDefault); 450Debug.Assert(groupBuilder.Count == 0); 491Debug.Assert(!importStrings.IsDefault); 510Debug.Assert(!importStrings.IsDefault);
src\Dependencies\CodeAnalysis.Debugging\StateMachineHoistedLocalScope.cs (2)
26Debug.Assert(startOffset >= 0); 27Debug.Assert(endOffset > startOffset || startOffset == 0 && endOffset == 0);
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));
UseAutoProperty\AbstractUseAutoPropertyCodeFixProvider.cs (2)
118Debug.Assert(fieldDocument.Project == propertyDocument.Project); 199Debug.Assert(fieldDocument.Project == propertyDocument.Project);
ValueTracking\ValueTracker.OperationCollector.cs (1)
112Debug.Assert(operation is
Wrapping\BinaryExpression\AbstractBinaryExpressionWrapper.cs (2)
74Debug.Assert(exprsAndOperators.Length >= 3); 79Debug.Assert(((i % 2) == 0 && item.IsNode) ||
Microsoft.CodeAnalysis.Features.Test.Utilities (4)
EditAndContinue\EditAndContinueTestVerifier.cs (1)
141Debug.Assert(oldDocuments.Length == newDocuments.Length);
EditAndContinue\EditAndContinueWorkspaceTestBase.cs (1)
143Debug.Assert(document != null);
EditAndContinue\SourceMarkers.cs (1)
163Debug.Assert(minor == -1);
EditAndContinue\SyntaxMapDescription.cs (1)
64Debug.Assert(OldNodeSpans.Length == 1);
Microsoft.CodeAnalysis.InteractiveHost (40)
Interactive\Core\InteractiveHost.RemoteService.cs (1)
110Debug.Assert(ascii.Length % 2 == 0);
Interactive\Core\InteractiveHost.Service.cs (4)
78Debug.Assert(!sourceSearchPaths.IsDefault); 79Debug.Assert(scriptOptions.MetadataResolver is ScriptMetadataResolver); 554Debug.Assert(cmdLineReference.Properties.Kind == MetadataImageKind.Assembly && !cmdLineReference.Properties.EmbedInteropTypes); 706Debug.Assert(PathUtilities.IsAbsolute(fullPath));
Interactive\Core\InteractiveHostPlatformInfo.cs (1)
36Debug.Assert(!platformAssemblyPaths.IsDefault);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
48Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 72Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 85Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 102Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 108Debug.Assert(PathUtilities.GetPathKind(path) == kind); 173Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 174Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 199Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 249Debug.Assert(PathUtilities.IsAbsolute(path)); 293Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 311Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 395Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 413Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 436Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
202Debug.Assert(!this.IsLocked); 211Debug.Assert(this.IsOwnedByMe);
Microsoft.CodeAnalysis.LanguageServer (1)
WindowsErrorReporting.cs (1)
23Debug.Assert(GetErrorMode() == (oldErrorMode & ErrorModes.SEM_NOALIGNMENTFAULTEXCEPT));
Microsoft.CodeAnalysis.LanguageServer.Protocol (31)
Extensions\ProtocolConversions.cs (2)
225Debug.Assert(!path.Split(System.IO.Path.DirectorySeparatorChar).Any(p => p == "." || p == "..")); 457Debug.Assert(document.FilePath != null);
Features\CodeFixes\CodeFixService.cs (1)
481Debug.Assert(!isInteractive);
Features\Diagnostics\DocumentAnalysisExecutor.cs (3)
175Debug.Assert(diags.Length == CompilationWithAnalyzers.GetEffectiveDiagnostics(diags, compilation).Count()); 176Debug.Assert(diagnostics.Length == ConvertToLocalDiagnostics(diags, textDocument, span).Count()); 306Debug.Assert(isCompilerAnalyzer);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.AnalysisData.cs (2)
46Debug.Assert(!items.IsDefault); 57Debug.Assert(!oldItems.IsDefault);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.Executor.cs (1)
113Debug.Assert(ideAnalyzers.All(a => a is ProjectDiagnosticAnalyzer or DocumentDiagnosticAnalyzer));
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.IncrementalMemberEditAnalyzer.cs (6)
60Debug.Assert(analyzersWithState.All(stateSet => stateSet.Analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis())); 176Debug.Assert(changedMember != null); 177Debug.Assert(analysisScope.Kind == AnalysisKind.Semantic); 188Debug.Assert(analysisScope.Span.Value == changedMember.FullSpan); 251Debug.Assert(executor.AnalysisScope.Span.Value == changedMember.FullSpan); 379Debug.Assert(diagnostic.DataLocation != null);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.ProjectState.cs (2)
98Debug.Assert(lastResult.Version == VersionStamp.Default); 147Debug.Assert(lastResult.Version == VersionStamp.Default);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.cs (2)
151Debug.Assert(analyzer != FileContentLoadAnalyzer.Instance && analyzer != GeneratorDiagnosticsPlaceholderAnalyzer.Instance); 170Debug.Assert(analyzer != FileContentLoadAnalyzer.Instance && analyzer != GeneratorDiagnosticsPlaceholderAnalyzer.Instance);
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer.StateManager.ProjectStates.cs (1)
142Debug.Assert(!entry.AnalyzerReferences.Equals(project.AnalyzerReferences));
Features\Diagnostics\EngineV2\DiagnosticIncrementalAnalyzer_GetDiagnosticsForSpan.cs (3)
349Debug.Assert(!incrementalAnalysis || kind == AnalysisKind.Semantic); 350Debug.Assert(!incrementalAnalysis || analyzersWithState.All(analyzerWithState => analyzerWithState.Analyzer.SupportsSpanBasedSemanticDiagnosticAnalysis())); 427Debug.Assert(span.Value.Length < _text.Length);
Features\EditAndContinue\EditAndContinueDiagnosticSource_OpenDocument.cs (2)
69Debug.Assert(data.DataLocation != null); 70Debug.Assert(designTimeDocument.FilePath != null);
Features\Options\SolutionAnalyzerConfigOptionsUpdater.cs (1)
40Debug.Assert(target is Workspace);
Features\UnifiedSuggestions\UnifiedSuggestedActionsSource.cs (1)
371Debug.Assert(set.CategoryName is UnifiedPredefinedSuggestedActionCategoryNames.CodeFix or
Handler\Completion\CompletionResultFactory.cs (2)
516Debug.Assert(change.Span == defaultSpan); 673Debug.Assert(selectedItem.IsComplexTextEdit);
Handler\OnAutoInsert\OnAutoInsertHandler.cs (1)
234Debug.Assert(desiredCaretLocation >= textChange.Span.Start);
Protocol\Converters\FormattingOptionsConverter.cs (1)
23Debug.Assert(reader.TokenType == JsonTokenType.StartObject);
Microsoft.CodeAnalysis.PooledObjects.Package (14)
ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
Microsoft.CodeAnalysis.Rebuild (3)
CSharpCompilationFactory.cs (2)
32Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.CSharp); 39Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.CSharp);
VisualBasicCompilationFactory.cs (1)
39Debug.Assert(optionsReader.GetLanguageName() == LanguageNames.VisualBasic);
Microsoft.CodeAnalysis.Remote.ServiceHub (9)
Host\RemoteWorkspace.SolutionCreator.cs (4)
125Debug.Assert(projectCone.ProjectIds.Count == newVersions.Map.Count); 126Debug.Assert(projectCone.ProjectIds.All(id => newVersions.Map.ContainsKey(id))); 130Debug.Assert(solution.ProjectIds.Count == newVersions.Map.Count); 131Debug.Assert(solution.ProjectIds.All(id => newVersions.Map.ContainsKey(id)));
Services\BrokeredServiceBase.FactoryBase.cs (2)
37Debug.Assert(typeof(TService).IsInterface); 119Debug.Assert(typeof(TCallback).IsInterface);
Services\DiagnosticAnalyzer\DiagnosticComputer.cs (3)
175Debug.Assert(!s_highPriorityComputeTasks.Contains(computeTask)); 197Debug.Assert(s_highPriorityComputeTasks.Contains(computeTask)); 274Debug.Assert(s_normalPriorityCancellationTokenSources.Contains(cancellationTokenSource));
Microsoft.CodeAnalysis.Remote.Workspaces (3)
BrokeredServiceConnection.cs (1)
333Debug.Assert(cancellationToken.IsCancellationRequested);
EditAndContinue\ManagedHotReloadLanguageServiceDescriptor.cs (1)
20=> Debug.Assert(Descriptor.Moniker.Name == MonikerName);
Serialization\MessagePackFormatters.cs (1)
190Debug.Assert(kind != TextEncodingKind.None);
Microsoft.CodeAnalysis.Scripting (63)
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 (6)
36Debug.Assert(console != null); 37Debug.Assert(compiler != null); 38Debug.Assert(scriptCompiler != null); 39Debug.Assert(objectFormatter != null); 140Debug.Assert(scriptOptions is not null); 368Debug.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)
329Debug.Assert(obj != null); 646Debug.Assert(array.Rank > 1);
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.FormattedMember.cs (1)
28Debug.Assert((name != null) || (index >= 0));
Hosting\ObjectFormatter\ObjectFormatterHelpers.cs (2)
278Debug.Assert(type != null); 411Debug.Assert(str != null && start >= 0 && end >= start);
Hosting\Resolvers\NuGetPackageResolver.cs (1)
25Debug.Assert(parts.Length > 0);
Hosting\Resolvers\RuntimeMetadataReferenceResolver.cs (1)
150Debug.Assert(!paths.IsDefault);
Script.cs (5)
42Debug.Assert(sourceText != null); 43Debug.Assert(options != null); 44Debug.Assert(compiler != null); 45Debug.Assert(builder != null); 404Debug.Assert(!preceding.IsDefault);
ScriptBuilder.cs (1)
62Debug.Assert(assemblyLoader != null);
ScriptExecutionState.cs (3)
64Debug.Assert(index >= 0 && index < SubmissionStateCount); 75Debug.Assert(_frozen == 0); 76Debug.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\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\Compilers\Shared\GlobalAssemblyCacheHelpers\ClrGlobalAssemblyCache.cs (3)
248Debug.Assert(info.pszCurrentAssemblyPathBuf != null); 249Debug.Assert(info.pszCurrentAssemblyPathBuf[info.cchBuf - 1] == '\0'); 252Debug.Assert(result.IndexOf('\0') == -1);
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.Test.Utilities (54)
Assert\AssertEx.cs (1)
1013Debug.Assert(value is object);
Assert\AssertXml.cs (1)
161Debug.Assert(shallowComparer.Equals(pair.Item1, pair.Item2)); // Shouldn't have been pushed otherwise.
Assert\DiffUtil.cs (2)
201Debug.Assert(lengthA >= 0 && lengthB >= 0); 215Debug.Assert(lcsLength <= max);
CommonTestBase.cs (2)
355Debug.Assert(assemblyName == null || assemblyIdentity == null || assemblyIdentity.Name == assemblyName); 441Debug.Assert(sourceFileNames == null || sourceFileNames.Length == files.Length);
Compilation\ControlFlowGraphVerifier.cs (3)
738Debug.Assert(region.EnclosingRegion.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 1305Debug.Assert(lastBlockOrdinal <= region.LastBlockOrdinal); 1320Debug.Assert(firstBlockOrdinal >= region.FirstBlockOrdinal);
Compilation\FlowAnalysis\BasicBlockReachabilityDataFlowAnalyzer.cs (2)
41Debug.Assert(currentIsReachable); 56Debug.Assert(currentIsReachable);
Compilation\OperationTreeVerifier.cs (3)
339Debug.Assert(!string.IsNullOrEmpty(header)); 350Debug.Assert(!string.IsNullOrEmpty(header)); 397Debug.Assert(operation.ChildOperations.All(o => o != null));
Diagnostics\DiagnosticExtensions.cs (1)
316Debug.Assert(newCompilation.SemanticModelProvider != null);
Diagnostics\OptionsDiagnosticAnalyzer.cs (1)
24Debug.Assert(expectedOptions.AnalyzerConfigOptionsProvider.GetType() == typeof(CompilerAnalyzerConfigOptionsProvider));
FX\EnsureEnglishUICulture.cs (1)
49Debug.Assert(_threadId == Environment.CurrentManagedThreadId);
FX\EnsureInvariantCulture.cs (1)
28Debug.Assert(_threadId == Environment.CurrentManagedThreadId);
FX\ProcessUtilities.cs (1)
87Debug.Assert(process.HasExited);
Metadata\DynamicAnalysisDataReader.cs (1)
231Debug.Assert(previousStartColumn == 0);
Mocks\Silverlight.cs (1)
79Debug.Assert("7C-EC-85-D7-BE-A7-79-8E" == BitConverter.ToString(publicKeyToken.ToArray()));
Mocks\StdOle.cs (1)
66Debug.Assert("B0-3F-5F-7F-11-D5-0A-3A" == BitConverter.ToString(publicKeyToken.ToArray()));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
60Debug.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);
TargetFrameworkUtil.cs (2)
292Debug.Assert(GetReferences(TargetFramework.NetCoreApp).SequenceEqual(NetCoreApp.References)); 293Debug.Assert(GetReferences(TargetFramework.NetFramework).SequenceEqual(NetFramework.References));
TempFiles\TempDirectory.cs (2)
25Debug.Assert(path != null); 26Debug.Assert(root != null);
TempFiles\TempFile.cs (1)
25Debug.Assert(PathUtilities.IsAbsolute(path));
TestableCompiler.cs (1)
214Debug.Assert(fileSystem.UsingMap);
TestableFile.cs (2)
31Debug.Assert(!memoryFile.Exists); 40Debug.Assert(memoryFile.Exists);
TestHelpers.cs (2)
92Debug.Assert(!result.Contains("--")); 105Debug.Assert(code is Microsoft.CodeAnalysis.CSharp.ErrorCode ||
Win32Res.cs (4)
242System.Diagnostics.Debug.Assert((reader.BaseStream.Position & 3) == 0); 250System.Diagnostics.Debug.Assert(length > valueLength); 254System.Diagnostics.Debug.Assert(type == 1); //string 268System.Diagnostics.Debug.Assert(length == (reader.BaseStream.Position - startPos));
Microsoft.CodeAnalysis.UnitTests (20)
Collections\HashSet\ISet_Generic_Tests`1.cs (1)
650Debug.Assert(enumerable != null);
Collections\ImmutablesTestBase.cs (1)
205Debug.Assert(generator != null);
Collections\List\TestBase.Generic.cs (5)
105Debug.Assert(count >= numberOfMatchingElements); 106Debug.Assert(count >= numberOfDuplicateElements); 165Debug.Assert(queue.Count == count); 214Debug.Assert(list.Count == count); 298Debug.Assert(set.Count == count);
CryptoBlobParserTests.cs (1)
31Debug.Assert(privateKeyOpt.HasValue);
MetadataReferences\FusionAssemblyIdentityComparer.cs (1)
65Debug.Assert(ignoreVersion);
MetadataReferences\FusionAssemblyPortabilityPolicy.cs (1)
46Debug.Assert(PathUtilities.IsAbsolute(appConfigPath));
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 (462)
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.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 (9)
151Debug.Assert(node.IsSupportingAssignment()) 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)
BoundTree\BoundLateInvocation.vb (3)
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)
BoundTree\BoundSequence.vb (2)
27Debug.Assert(Me.ValueOpt IsNot Nothing) 47Debug.Assert(val.IsValue AndAlso Not val.IsLValue AndAlso val.Type IsNot Nothing)
CodeGen\ResumableStateMachineStateAllocator.vb (1)
77Debug.Assert(f.CompilationState IsNot Nothing)
Compilation\DocumentationComments\DocumentationCommentCompiler.Namespace.vb (1)
30Debug.Assert(Me._assemblyName IsNot Nothing)
Compilation\DocumentationComments\DocumentationCommentWalker.vb (5)
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)
Compilation\DocumentationComments\DocWriter.vb (2)
55Debug.Assert(Me._indentDepth >= 0) 118Debug.Assert(depth >= 0)
Compilation\DocumentationComments\UnprocessedDocumentationCommentFinder.vb (2)
35Debug.Assert(diagnostics IsNot Nothing) 142Debug.Assert(parent IsNot Nothing)
Declarations\SingleNamespaceDeclaration.vb (1)
84Debug.Assert(Not singleDeclarations.IsEmpty)
Lowering\Diagnostics\DiagnosticsPass.vb (4)
32Debug.Assert(node IsNot Nothing) 33Debug.Assert(containingSymbol IsNot Nothing) 174Debug.Assert(info.ExpressionPlaceholder IsNot Nothing) 211Debug.Assert(_expressionsBeingVisited.Peek Is node)
Lowering\Diagnostics\DiagnosticsPass_ExpressionLambdas.vb (5)
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\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (22)
137Debug.Assert(block.Statements(0).Kind <> BoundKind.SequencePoint) 138Debug.Assert(block.Statements.Length = 1 OrElse 176Debug.Assert(False) 308Debug.Assert(saveRecursionDepth = _recursionDepth) 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) 532Debug.Assert(arg.Type Is Me.Int32Type) 543Debug.Assert(expressions(i).Type Is Me.Int32Type) 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) 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)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_ConditionalExpresion.vb (2)
185Debug.Assert((conversion.ConversionKind And ConversionKind.UserDefined) <> 0) 208Debug.Assert((innerConversion And ConversionKind.NarrowingNullable) = ConversionKind.NarrowingNullable)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_Conversion.vb (9)
25Debug.Assert(node.ExtendedInfoOpt Is Nothing) 34Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 43Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 96Debug.Assert(semantics = ConversionSemantics.Default) 149Debug.Assert(semantics <> ConversionSemantics.TryCast) 159Debug.Assert(semantics <> ConversionSemantics.TryCast) 177Debug.Assert(semantics <> ConversionSemantics.TryCast) 187Debug.Assert(semantics <> ConversionSemantics.TryCast) 295Debug.Assert(semantics <> ConversionSemantics.TryCast)
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter_UnaryOperator.vb (1)
34Debug.Assert((node.OperatorKind And UnaryOperatorKind.UserDefined) = 0)
Lowering\LambdaRewriter\LambdaRewriter.Analysis.vb (6)
139Debug.Assert(Not node.HasErrors) 302Debug.Assert(node.LambdaSymbol IsNot Nothing) 339Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 350Debug.Assert(node.RelaxationLambdaOpt Is Nothing) 361Debug.Assert(conversion.ExtendedInfoOpt Is Nothing) 418Debug.Assert(container IsNot Nothing)
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 (13)
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)) 78Debug.Assert(assignmentTarget.IsLValue) 91Debug.Assert(assignmentTarget Is setNode) 140Debug.Assert(node.LeftOnTheRightOpt Is Nothing) 207Debug.Assert(setNode.AccessKind = PropertyAccessKind.Set) 253Debug.Assert((accessKind And LateBoundAccessKind.Set) <> 0) 254Debug.Assert(((accessKind And LateBoundAccessKind.Get) = 0) = (node.LeftOnTheRightOpt Is Nothing)) 427Debug.Assert((conversionKind And ConversionKind.UserDefined) = 0) 462Debug.Assert(node.Left.IsLValue AndAlso node.LeftOnTheRightOpt IsNot Nothing AndAlso 499Debug.Assert(temporaries.IsDefault) 500Debug.Assert(copyBack.IsDefault)
Lowering\LocalRewriter\LocalRewriter_Call.vb (6)
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 (8)
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)
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 (2)
117Debug.Assert(node.MemberAccessExpressionOpt IsNot Nothing) 126Debug.Assert(objectInitializer.PlaceholderOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_ForEach.vb (3)
586Debug.Assert(enumeratorInfo.EnumeratorPlaceholder IsNot Nothing) 670Debug.Assert(Not needTryFinally) 757Debug.Assert(rewrittenDisposeConversion IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_ForTo.vb (5)
37Debug.Assert(node.OperatorsOpt Is Nothing) 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 (1)
14Debug.Assert(_previousSubmissionFields IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_LateInvocation.vb (2)
50Debug.Assert(invocation.AccessKind = LateBoundAccessKind.Get) 51Debug.Assert(receiverExpression.Kind <> BoundKind.LateMemberAccess)
Lowering\LocalRewriter\LocalRewriter_ObjectCreation.vb (10)
44Debug.Assert(Conversions.ConversionExists(conv)) 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_PreviousSubmissionReference.vb (1)
17Debug.Assert(_previousSubmissionFields IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_Query.vb (2)
121Debug.Assert(firstUnmappedRangeVariable = nodeRangeVariables.Length) 235Debug.Assert(node.GroupPlaceholderOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_RaiseEvent.vb (2)
30Debug.Assert(receiver.Kind = BoundKind.FieldAccess) 36Debug.Assert(fieldAccessReceiver Is Nothing OrElse
Lowering\LocalRewriter\LocalRewriter_RedimClause.vb (1)
18Debug.Assert(node.ArrayTypeOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_Return.vb (4)
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 (19)
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) 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) 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_Try.vb (2)
16Debug.Assert(_unstructuredExceptionHandling.Context Is Nothing) 168Debug.Assert((Me._flags And RewritingFlags.AllowCatchWithErrorLineNumberReference) <> 0)
Lowering\LocalRewriter\LocalRewriter_UnaryOperators.vb (4)
49Debug.Assert((binary.OperatorKind And BinaryOperatorKind.Lifted) <> 0) 123Debug.Assert(opKind = UnaryOperatorKind.Not) 147Debug.Assert(opKind = UnaryOperatorKind.Minus) 288Debug.Assert(temps Is Nothing AndAlso inits Is Nothing)
Lowering\LocalRewriter\LocalRewriter_UnstructuredExceptionHandling.vb (13)
65Debug.Assert(node.ContainsOnError OrElse node.ContainsResume) 67Debug.Assert(_unstructuredExceptionHandling.Context Is Nothing) 70Debug.Assert(_unstructuredExceptionHandling.OnErrorResumeNextCount = 0) 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) 536Debug.Assert(statement.Syntax.Kind = SyntaxKind.ModifiedIdentifier AndAlso 543Debug.Assert((statement.Syntax.Kind = SyntaxKind.RedimClause AndAlso 549Debug.Assert(TypeOf statement.Syntax Is ExecutableStatementSyntax)
Lowering\LocalRewriter\LocalRewriter_Using.vb (1)
124Debug.Assert(node.ResourceExpressionOpt IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_With.vb (6)
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) 177Debug.Assert(fieldType IsNot Nothing)
Lowering\LocalRewriter\LocalRewriter_XmlLiteralFixupData.vb (1)
45Debug.Assert(Not Me.IsEmpty)
Lowering\MethodToClassRewriter\MethodToClassRewriter.MyBaseMyClassWrapper.vb (4)
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)
Lowering\SynthesizedSubmissionFields.vb (1)
30Debug.Assert(compilation IsNot Nothing)
Lowering\SyntheticBoundNodeFactory.vb (11)
72Debug.Assert(compilationState IsNot Nothing) 358Debug.Assert(Conversions.IsWideningConversion(conversion)) 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 635Debug.Assert(expression IsNot Nothing) 666Debug.Assert(parts IsNot Nothing AndAlso parts.Length > 0) 1025Debug.Assert((convKind And ConversionKind.UserDefined) = 0) 1126Debug.Assert(Me.CurrentMethod IsNot Nothing)
Semantics\Operators.vb (48)
307Debug.Assert(opInfo.ParamCount <> 0) 308Debug.Assert(diagnosticsOpt Is Nothing OrElse assemblyBeingBuiltOpt IsNot Nothing) 354Debug.Assert(opInfo.IsBinary) 505Debug.Assert((opCode And UnaryOperatorKind.IntrinsicOpMask) = opCode AndAlso opCode <> UnaryOperatorKind.Error) 709Debug.Assert(operand IsNot Nothing) 710Debug.Assert(resultType IsNot Nothing) 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) 1096Debug.Assert((operatorKind And BinaryOperatorKind.CompareText) = 0) 1113Debug.Assert(result IsNot Nothing) 1129Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 1130Debug.Assert(Not integerOverflow) 1131Debug.Assert(Not divideByZero) 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) 1581Debug.Assert((op And BinaryOperatorKind.OpMask) = op) 2042Debug.Assert(bestMatch Is Nothing) 2105Debug.Assert(Not suppressViabilityChecks) 2108Debug.Assert(currentIndex = i) 2122Debug.Assert(Not suppressViabilityChecks) 2148Debug.Assert(bestMatch Is Nothing) 2184Debug.Assert(bestMatch Is Nothing) 2185Debug.Assert(Not bestMatchIsAmbiguous) 2246Debug.Assert(bestMatch IsNot Nothing) 2252Debug.Assert(bestMatch Is Nothing) 2379Debug.Assert(bestMatch Is Nothing) 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)) 2577Debug.Assert(bestMatch Is Nothing) 2578Debug.Assert(Not bestMatchIsAmbiguous) 2664Debug.Assert(bestMatch IsNot Nothing) 2806Debug.Assert(result > 0) 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)
Semantics\OverloadResolution.vb (97)
156Debug.Assert(method IsNot Nothing) 396Debug.Assert([property] IsNot Nothing) 596Debug.Assert((value And SmallFieldMask.InferenceLevelMask) = value) 638Debug.Assert(RequiresNarrowingConversion) 657Debug.Assert(relaxationLevel <= ConversionKind.DelegateRelaxationLevelNarrowing) 699Debug.Assert((value And SmallFieldMask.InferenceErrorReasonsMask) = value) 715Debug.Assert((value And (Not SmallFieldMask.State)) = 0) 930Debug.Assert(methodGroup.ResultKind = LookupResultKind.Good OrElse methodGroup.ResultKind = LookupResultKind.Inaccessible) 1058Debug.Assert(applicableNarrowingCandidateCount = 0) 1087Debug.Assert(propertyGroup.ResultKind = LookupResultKind.Good OrElse propertyGroup.ResultKind = LookupResultKind.Inaccessible) 1117Debug.Assert(asyncLambdaSubToFunctionMismatch Is Nothing) 1167Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length = arguments.Length) 1259Debug.Assert(applicableNarrowingCandidates < applicableCandidates) 1262Debug.Assert(applicableCandidates > 0) 1404Debug.Assert(existingWins Xor newWins) ' Both cannot win! 1434Debug.Assert(newCandidate.State = CandidateAnalysisResultState.Applicable) 1438Debug.Assert(newCandidate.Candidate.ParameterCount >= argumentCount OrElse newCandidate.IsExpandedParamArrayForm) 1439Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0) 1440Debug.Assert(Not operatorResolution OrElse argumentNames.IsDefault) 1457Debug.Assert(existingCandidate.Candidate.ParameterCount >= argumentCount OrElse existingCandidate.IsExpandedParamArrayForm) 1472Debug.Assert(Not operatorResolution) 1479Debug.Assert(Not operatorResolution) 1482Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 1483Debug.Assert(argumentCount = existingCandidate.Candidate.ParameterCount) 1500Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 1520Debug.Assert(argumentNames.IsDefault OrElse signatureMatch) 1757Debug.Assert(cmp = ApplicabilityComparisonResult.LeftIsMoreApplicable) 1779Debug.Assert(cmp = ApplicabilityComparisonResult.LeftIsMoreApplicable) 1817Debug.Assert(Not (leftWins AndAlso rightWins)) 1824Debug.Assert(rightWins) 1834Debug.Assert(applicableCandidates >= 0) 2121Debug.Assert(indexesOfApplicableCandidates.Count = applicableCandidates) 2194Debug.Assert(leftWins Xor rightWins) 2298Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 2345Debug.Assert(cmp = ApplicabilityComparisonResult.EquallyApplicable) 2349Debug.Assert(Not (leftHasMoreApplicableParameterType AndAlso rightHasMoreApplicableParameterType)) 2379Debug.Assert(argument Is Nothing OrElse argument.Kind <> BoundKind.OmittedArgument) 2601Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 2636Debug.Assert(argument Is Nothing OrElse argument.Kind <> BoundKind.OmittedArgument) 2713Debug.Assert(current.Candidate.IsOperator) 2720Debug.Assert(contender.Candidate.IsOperator) 2737Debug.Assert(applicableCandidates > 1) ' source and lifted operators are not equally applicable. 2744Debug.Assert(current.Candidate.IsOperator) 2751Debug.Assert(contender.Candidate.IsOperator) 2836Debug.Assert(applicableCandidates > 0) 2877Debug.Assert(applicableCandidates = 1) 2899Debug.Assert((conv And ConversionKind.UserDefined) = 0) 3007Debug.Assert(applicableCandidates > 0) 3038Debug.Assert(Not arguments.IsDefault) 3039Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3040Debug.Assert(Not candidate.ArgumentMatchingDone) 3041Debug.Assert(candidate.State = CandidateAnalysisResultState.Applicable) 3130Debug.Assert(argumentNames(i) Is Nothing OrElse argumentNames(i).Length > 0) 3223Debug.Assert(Not arguments.IsDefault) 3224Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3225Debug.Assert(Not candidate.ArgumentMatchingDone) 3226Debug.Assert(candidate.State = CandidateAnalysisResultState.Applicable) 3239Debug.Assert(Not candidate.IgnoreExtensionMethods) 3307Debug.Assert(paramArrayArgument Is Nothing OrElse paramArrayArgument.Kind <> BoundKind.OmittedArgument) 3328Debug.Assert(paramArrayArgument.IsNothingLiteral()) 3353Debug.Assert(candidate.IsExpandedParamArrayForm) 3518Debug.Assert(defaultArgument Is Nothing) 3682Debug.Assert(delegateInvoke IsNot Nothing) 3686Debug.Assert(bound IsNot Nothing) 3758Debug.Assert(Not argument.HasErrors) 3862Debug.Assert(results IsNot Nothing) 3863Debug.Assert(argumentNames.IsDefault OrElse (argumentNames.Length > 0 AndAlso argumentNames.Length = arguments.Length)) 3957Debug.Assert(isExtensionMethod = info2.Candidate.IsExtensionMethod) 3990Debug.Assert(accessibilityCmp = 0) 4046Debug.Assert(candidate IsNot Nothing) 4047Debug.Assert(appliesToNormalForm OrElse appliesToParamArrayForm) 4173Debug.Assert(candidate.AppliesToNormalForm <> candidate.AppliesToParamArrayForm) 4227Debug.Assert(triedToAddSomething) 4264Debug.Assert(newCandidate.State <> CandidateAnalysisResultState.Applicable) 4286Debug.Assert(newCandidate.State = CandidateAnalysisResultState.Applicable) 4290Debug.Assert(newCandidate.Candidate.ParameterCount >= argumentCount OrElse newCandidate.IsExpandedParamArrayForm) 4291Debug.Assert(argumentNames.IsDefault OrElse argumentNames.Length > 0) 4292Debug.Assert(Not operatorResolution OrElse argumentNames.IsDefault) 4308Debug.Assert(Not operatorResolution) 4349Debug.Assert(existingCandidate.Candidate.ParameterCount >= argumentCount OrElse existingCandidate.IsExpandedParamArrayForm) 4357Debug.Assert(Not operatorResolution) 4364Debug.Assert(Not operatorResolution) 4367Debug.Assert(argumentCount = existingCandidate.Candidate.ParameterCount) 4368Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 4389Debug.Assert(argumentNames.IsDefault) ' We matched the virtual signature above 4409Debug.Assert(argumentNames.IsDefault OrElse signatureMatch) 4438Debug.Assert(Not existingWins OrElse Not newWins) ' Both cannot win! 4513Debug.Assert(Not existingCandidate.Candidate.IsLifted) 4658Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 4726Debug.Assert((saveTrack And TypeParameterKind.Method) = 0 OrElse (leftHasLeastGenericParameterAgainstMethod AndAlso rightHasLeastGenericParameterAgainstMethod)) 4727Debug.Assert((saveTrack And TypeParameterKind.Type) = 0 OrElse (leftHasLeastGenericParameterAgainstType AndAlso rightHasLeastGenericParameterAgainstType)) 4762Debug.Assert(argument.Kind <> BoundKind.OmittedArgument) 4838Debug.Assert(left.ArgsToParamsOpt.IsDefault = right.ArgsToParamsOpt.IsDefault) 4870Debug.Assert(leftParamWins <> rightParamWins) 4891Debug.Assert(Not leftWins OrElse Not rightWins) 4959Debug.Assert(leftArgWins <> rightArgWins) 4981Debug.Assert(Not leftWins OrElse Not rightWins)
Semantics\TypeInference\Graph.vb (4)
84Debug.Assert(node.Graph Is Me) 96Debug.Assert(Contains(source)) 97Debug.Assert(Contains(target)) 182Debug.Assert(node.AlgorithmData.StronglyConnectedComponent Is Nothing)
Semantics\TypeInference\TypeInferenceCollection.vb (4)
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. 492Debug.Assert(Conversions.IsWideningConversion(inConversion) AndAlso Conversions.IsWideningConversion(outConversion) AndAlso 563Debug.Assert(type IsNot Nothing) 629Debug.Assert(names1.Length = names2.Length)
Symbols\AnonymousTypes\AnonymousTypeManager_Templates.vb (4)
37Debug.Assert(Me._sourceLocationsSeen.ContainsKey(location)) 267Debug.Assert(type IsNot Nothing) 268Debug.Assert(type.IsAnonymousType) 330Debug.Assert(result <> 0)
Symbols\ConstraintsHelper.vb (16)
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) 1166Debug.Assert(type.TypeKind = TypeKind.Class OrElse type.TypeKind = TypeKind.Structure) 1208Debug.Assert(constraintType IsNot Nothing) 1250Debug.Assert(method.ConstructedFrom <> method)
Symbols\EventSymbol.vb (1)
195Debug.Assert(Me.IsDefinition)
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 (7)
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)
29Debug.Assert(declaration.Kind = DeclarationKind.ImplicitClass OrElse declaration.Kind = DeclarationKind.Submission OrElse declaration.Kind = DeclarationKind.Script) 190Debug.Assert(Me.IsScriptClass OrElse Me.IsImplicitClass)
Symbols\Source\OverloadingHelper.vb (1)
29Debug.Assert(kind = SymbolKind.Method OrElse kind = SymbolKind.Property)
Symbols\Source\OverrideHidingHelper.vb (11)
24Debug.Assert(container.IsDefinition) ' Don't do this on constructed types 121Debug.Assert(Not exactMatch OrElse exactMatchIgnoringCustomModifiers) 350Debug.Assert(container.IsDefinition) 387Debug.Assert(Not (hidingMember.IsAccessor() AndAlso hiddenMember.IsAccessor)) 450Debug.Assert(hidingMember.Locations(0).IsInSource) 469Debug.Assert(hidingMember.Locations(0).IsInSource) 621Debug.Assert(Not (TypeOf overridingSym Is MethodSymbol AndAlso DirectCast(DirectCast(overridingSym, Symbol), MethodSymbol).ConstructedFrom <> overridingSym)) 625Debug.Assert(Not (TypeOf overridingSym Is MethodSymbol AndAlso 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 (14)
69Debug.Assert(container IsNot Nothing) 70Debug.Assert(syntaxRef IsNot Nothing) 71Debug.Assert(location IsNot Nothing) 314Debug.Assert(syntax.Kind = SyntaxKind.ModifiedIdentifier) 375Debug.Assert(type IsNot Nothing) 416Debug.Assert(_lazyMetadataName IsNot Nothing) 425Debug.Assert(old Is Nothing OrElse old = metadataName) 821Debug.Assert(IsDefinition) 940Debug.Assert(Not implementedProperties.IsDefault) 1049Debug.Assert(ExplicitInterfaceImplementations.Contains(implementedProperty)) 1078Debug.Assert(accessor IsNot Nothing) 1181Debug.Assert(syntaxTree IsNot Nothing) 1182Debug.Assert(block IsNot Nothing) 1231Debug.Assert(attributeData IsNot 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 (1)
29Debug.Assert(createOrDisposeMethod IsNot Nothing AndAlso createOrDisposeMethod.Length > 0)
Symbols\Source\SynthesizedStaticLocalBackingField.vb (1)
40Debug.Assert(implicitlyDefinedBy.IsStatic)
Symbols\SynthesizedSymbols\SynthesizedClonedTypeParameterSymbol.vb (2)
41Debug.Assert(correspondingMethodTypeParameter.IsDefinition) 42Debug.Assert(correspondingMethodTypeParameter.ContainingSymbol <> container)
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)
Microsoft.CodeAnalysis.Workspaces (632)
Classification\ClassifierHelper.cs (4)
289Debug.Assert(firstSemanticPartSpan.OverlapsWith(syntacticPartSpan)); 290Debug.Assert(lastSemanticPartSpan.OverlapsWith(syntacticPartSpan)); 307Debug.Assert(semanticPart1Span.OverlapsWith(syntacticPartSpan)); 308Debug.Assert(semanticPart1Span.OverlapsWith(syntacticPartSpan));
CodeActions\CodeAction.cs (1)
614Debug.Assert(nestedActions.Length > 0);
CodeFixes\CodeFix.cs (1)
52Debug.Assert(!diagnostics.IsDefaultOrEmpty);
CodeFixes\FixAllOccurrences\FixAllState.cs (1)
40Debug.Assert(diagnosticSpan.HasValue || scope is not FixAllScope.ContainingMember or FixAllScope.ContainingType);
CodeFixes\FixAllOccurrences\TextChangeMerger.cs (6)
45Debug.Assert(newDocument.Id == _oldDocument.Id); 157Debug.Assert(IsPureInsertion(change)); 158Debug.Assert(overlappingSpans.Count == 0); 202Debug.Assert(!IsPureInsertion(change)); 212Debug.Assert(!IsPureInsertion(change)); 232Debug.Assert(!IsPureInsertion(change));
CodeFixesAndRefactorings\CommonFixAllState.cs (1)
34Debug.Assert(document == null || document.Project == project);
Diagnostics\CompilationWithAnalyzersPair.cs (1)
63Debug.Assert(HostAnalyzers.Contains(analyzer));
Diagnostics\DiagnosticAnalysisResult.cs (6)
77Debug.Assert(!others.IsDefault); 78Debug.Assert(!syntaxLocals.Values.Any(item => item.IsDefault)); 79Debug.Assert(!semanticLocals.Values.Any(item => item.IsDefault)); 80Debug.Assert(!nonLocals.Values.Any(item => item.IsDefault)); 253Debug.Assert(DocumentIds != null && DocumentIds.Contains(documentId)); 332Debug.Assert(textDocument?.SupportsDiagnostics() == true);
Diagnostics\DiagnosticAnalysisResultBuilder.cs (1)
132Debug.Assert(dummy == null);
Diagnostics\DiagnosticAnalysisResultMap.cs (1)
39Debug.Assert(telemetryInfo.IsEmpty || telemetryInfo.Count == analysisResult.Count);
Diagnostics\DocumentAnalysisScope.cs (4)
28Debug.Assert(kind is AnalysisKind.Syntax or AnalysisKind.Semantic); 29Debug.Assert(!projectAnalyzers.IsDefault); 30Debug.Assert(!hostAnalyzers.IsDefault); 31Debug.Assert(!projectAnalyzers.IsEmpty || !hostAnalyzers.IsEmpty);
Diagnostics\Extensions.cs (4)
274Debug.Assert(diagnostics.All(d => d.Location.SourceTree == tree)); 286Debug.Assert(diagnostics.All(d => d.Location.SourceTree == tree)); 339Debug.Assert(documentAnalysisScope.ProjectAnalyzers.ToSet().IsSubsetOf(compilationWithAnalyzers.ProjectAnalyzers)); 340Debug.Assert(documentAnalysisScope.HostAnalyzers.ToSet().IsSubsetOf(compilationWithAnalyzers.HostAnalyzers));
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 (10)
92Debug.Assert(previous != null); 97Debug.Assert(minDepth > 0); 98Debug.Assert(minDepth <= maxDepth); 113Debug.Assert(start >= 0); 114Debug.Assert(start + length <= _array.Length); 285Debug.Assert(yEnd > yMid); 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)
1901Debug.Assert(!parts.IsEmpty());
ExtensionManager\ServicesLayerExtensionManager.cs (1)
19Debug.Assert(exception is not OperationCanceledException);
FindSymbols\FindReferences\DependentTypeFinder.cs (4)
145Debug.Assert(project.SupportsCompilation); 259Debug.Assert(infos.Count > 0); 293Debug.Assert(project.SupportsCompilation); 563Debug.Assert(pooledInstance.Count == 0);
FindSymbols\FindReferences\Finders\PropertySymbolReferenceFinder.cs (1)
255Debug.Assert(syntaxFacts.IsIndexerMemberCref(node));
FindSymbols\IStreamingFindReferencesProgress.cs (1)
39Debug.Assert(symbols.All(s => s.Kind == symbols[0].Kind));
FindSymbols\SymbolFinder.cs (1)
202Debug.Assert(solution.WorkspaceKind is WorkspaceKind.Interactive or WorkspaceKind.MiscellaneousFiles);
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)
57Debug.Assert(node.Name == this.Name); 58Debug.Assert(node.ParentIndex == this.ParentIndex);
FindSymbols\SymbolTree\SymbolTreeInfo_Metadata.cs (3)
516Debug.Assert(typeDefinition.Kind == MetadataDefinitionKind.Type); 801Debug.Assert(node.Name == null); 808Debug.Assert(node.Name != null);
FindSymbols\SymbolTree\SymbolTreeInfo_Serialization.cs (1)
46Debug.Assert(read.Checksum == checksum);
FindSymbols\SyntaxTree\SyntaxTreeIndex_Create.cs (8)
345Debug.Assert(identifiers.Comparer == StringComparer.OrdinalIgnoreCase); 346Debug.Assert(escapedIdentifiers.Comparer == StringComparer.OrdinalIgnoreCase); 353Debug.Assert(identifiers.Comparer == StringComparer.Ordinal); 354Debug.Assert(escapedIdentifiers.Comparer == StringComparer.Ordinal); 361Debug.Assert(identifiers.Comparer == StringComparer.OrdinalIgnoreCase); 362Debug.Assert(escapedIdentifiers.Comparer == StringComparer.OrdinalIgnoreCase); 369Debug.Assert(identifiers.Comparer == StringComparer.Ordinal); 370Debug.Assert(escapedIdentifiers.Comparer == StringComparer.Ordinal);
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)
131Debug.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 (3)
46Debug.Assert(!Monitor.IsEntered(_gate)); 163Debug.Assert(optionKey.Option is IOption2 { Definition.StorageMapping: null }); 269Debug.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)
32Debug.Assert(IsPublicOptionValue(result));
Options\PerLanguageOption.cs (1)
51Debug.Assert(storageLocations.All(l => l is not IEditorConfigValueSerializer));
PatternMatching\CamelCaseResult.cs (1)
30Debug.Assert(matchedSpansInReverse == null || matchedSpansInReverse.Count == matchCount);
PatternMatching\PatternMatcher.cs (2)
541Debug.Assert(firstMatch.HasValue); 542Debug.Assert(contiguous.HasValue);
Rename\ConflictEngine\ConflictResolver.Session.cs (1)
85Debug.Assert(location.ComplexifiedTargetSpan.Contains(location.ConflictCheckSpan) || location.Type == RelatedLocationType.UnresolvableConflict);
Rename\RenameUtilities.cs (2)
264Debug.Assert(subSpan.Start <= replaceInsideString.Length); 265Debug.Assert(subSpan.End <= replaceInsideString.Length);
Rename\SymbolicRenameLocations.ReferenceProcessing.cs (1)
421Debug.Assert(renameText.Length == match.Length);
Serialization\SerializableSourceText.cs (2)
76Debug.Assert(storageHandle is null != text is null); 84Debug.Assert(contentChecksum == Checksum.Create(computedContentHash));
Shared\Extensions\ISymbolExtensions.cs (3)
581Debug.Assert(copy != node); 582Debug.Assert(copy.Parent == null); // Otherwise, when we give it one, it will be copied. 599Debug.Assert(sourceAttributes.Current.Name == targetAttributes.Current.Name);
Shared\Extensions\ProjectExtensions.cs (1)
24Debug.Assert(location.Kind == LocationKind.ExternalFile);
Shared\Extensions\SemanticModelExtensions.cs (1)
110Debug.Assert(tokenParent is not null);
Shared\Utilities\AsyncBatchingWorkQueue`2.cs (1)
236Debug.Assert(_entireQueueCancellationToken.IsCancellationRequested);
Shared\Utilities\BloomFilter.cs (2)
182Debug.Assert(numberOfCharsLeft == 0); 237Debug.Assert(index <= 3);
Shared\Utilities\XmlFragmentParser.cs (2)
200Debug.Assert(charCount > 0); 205Debug.Assert(destCount >= 0);
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\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (16)
86Debug.Assert(items != null); 487Debug.Assert(self.Length == other.Length); 518Debug.Assert(self.Length == other.Length); 550Debug.Assert(!array.IsDefault); 551Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 570Debug.Assert(i > 0); 586Debug.Assert(i > 0); 589Debug.Assert(builder == null); 602Debug.Assert(!all); 603Debug.Assert(!none); 612Debug.Assert(none); 816Debug.Assert(!array.IsDefault); 1189Debug.Assert(builder.Count > 1); 1233Debug.Assert(members.Length > 0); 1248Debug.Assert(count < members.Length); 1260Debug.Assert(builder.Count == count);
src\Compilers\Core\Portable\Collections\OrderPreservingMultiDictionary.cs (11)
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); 309Debug.Assert(this.Count >= 1); 343Debug.Assert(_count >= 1);
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (2)
170Debug.Assert(_count == InlineCapacity); 333Debug.Assert(_builder is null);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
48Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 72Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 85Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 102Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 108Debug.Assert(PathUtilities.GetPathKind(path) == kind); 173Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 174Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 199Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 249Debug.Assert(PathUtilities.IsAbsolute(path)); 293Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 311Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 395Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 413Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 436Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
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\Compilers\Core\Portable\Hashing\NonCryptographicHashAlgorithm.cs (1)
329Debug.Assert(destination.Length == HashLengthInBytes);
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\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\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
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\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (2)
737Debug.Assert(data.All(d => d.Count() == count)); 996Debug.Assert(local.Length == size);
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
199Debug.Assert(HasOneItem == other.HasOneItem);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
28Debug.Assert(number >= 0);
src\Compilers\Core\Portable\SpecialTypeExtensions.cs (1)
375Debug.Assert(value.GetType().IsPrimitive);
src\Compilers\Core\Portable\Text\TextChangeRangeExtensions.cs (1)
232Debug.Assert(newChange.SpanStart == oldChange.Span.Start + oldDelta);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
118Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (41)
110Debug.Assert(i != j); 123Debug.Assert(i != j); 132Debug.Assert(comparer != null); 145Debug.Assert(keys.Length > 0); 146Debug.Assert(depthLimit >= 0); 147Debug.Assert(comparer != null); 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 191Debug.Assert(comparer != null); 235Debug.Assert(comparer != null); 236Debug.Assert(keys.Length > 0); 253Debug.Assert(comparer != null); 413Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 425Debug.Assert(keys.Length > 0); 426Debug.Assert(depthLimit >= 0); 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 535Debug.Assert(keys.Length > 0); 691Debug.Assert(comparer != null); 692Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 693Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 694Debug.Assert(i != j); 711Debug.Assert(i != j); 724Debug.Assert(comparer != null); 725Debug.Assert(keys.Length == values.Length); 735Debug.Assert(keys.Length > 0); 736Debug.Assert(values.Length == keys.Length); 737Debug.Assert(depthLimit >= 0); 738Debug.Assert(comparer != null); 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 782Debug.Assert(comparer != null); 826Debug.Assert(comparer != null); 827Debug.Assert(keys.Length > 0); 844Debug.Assert(comparer != null); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1233Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
32Debug.Assert(bitPosition >= 0); 46Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\SegmentedArray.cs (5)
112Debug.Assert(length > 0); 113Debug.Assert(sourceIndex >= 0); 114Debug.Assert(destinationIndex >= 0); 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length);
src\Dependencies\Collections\SegmentedDictionary`2.cs (11)
166Debug.Assert(_entries.Length >= source.Count); 167Debug.Assert(_count == 0); 258Debug.Assert(modified); 265Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 445Debug.Assert(comparer is not null); 516Debug.Assert(_buckets.Length > 0); 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 572Debug.Assert(comparer is not null); 647Debug.Assert(newSize >= _entries.Length); 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
src\Dependencies\Collections\SegmentedHashSet`1.cs (6)
187Debug.Assert(Count == source.Count); 256Debug.Assert(comparer is not null); 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 900Debug.Assert(newSize >= _entries.Length); 1021Debug.Assert(_buckets.Length > 0); 1061Debug.Assert(comparer is not null);
src\Dependencies\Collections\SegmentedList`1.cs (2)
268Debug.Assert(_size == _items.Length); 518Debug.Assert(_items.Length < capacity);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleHelpers.cs (1)
184Debug.Assert(s_unusedExpressionAssignmentPreferenceMap.ContainsValue(option.Value));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\CodeStyle\CodeStyleOptions2.cs (7)
192Debug.Assert(s_unusedParametersPreferenceMap.ContainsValue(option.Value)); 214Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsKey(value)); 222Debug.Assert(s_accessibilityModifiersRequiredMap.ContainsValue(option.Value)); 260Debug.Assert(s_parenthesesPreferenceMap.ContainsKey(value)); 268Debug.Assert(s_parenthesesPreferenceMap.ContainsValue(option.Value)); 312Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsKey(value)); 321Debug.Assert(s_forEachExplicitCastInSourcePreferencePreferenceMap.ContainsValue(option.Value));
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\MutableIntervalTree`1.cs (2)
101Debug.Assert(rightBalance == 1); 114Debug.Assert(leftBalance == -1);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Collections\NormalizedTextSpanCollection.cs (2)
295Debug.Assert(lastEnd < span1.End); 306Debug.Assert(lastEnd < span2.Start);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\EditorConfigParser.cs (4)
74Debug.Assert(!string.IsNullOrEmpty(sectionName)); 91Debug.Assert(!string.IsNullOrEmpty(key)); 92Debug.Assert(key == key.Trim()); 93Debug.Assert(value == value.Trim());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EditorConfig\Parsing\Sections\SectionMatcher.cs (1)
313Debug.Assert(match.Groups.Count - 1 == _numberRangePairs.Length);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNode.cs (1)
46Debug.Assert((int)(object)kind != 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxNodeOrToken.cs (2)
26Debug.Assert((int)(object)token.Kind != 0); 34Debug.Assert(Node == null);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\Common\EmbeddedSyntaxTrivia.cs (1)
28Debug.Assert(virtualChars.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\AbstractVirtualCharService.cs (5)
80Debug.Assert(expectedValueText == actualValueText); 136Debug.Assert(!token.ContainsDiagnostics); 140Debug.Assert(startDelimiter == ""); 141Debug.Assert(endDelimiter == ""); 220Debug.Assert(char.IsSurrogate(ch));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.Chunks.cs (1)
103Debug.Assert(index + 1 >= data.Length ||
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\EmbeddedLanguages\VirtualChars\VirtualCharSequence.cs (3)
196Debug.Assert(_leafCharacters == virtualChars._leafCharacters); 197Debug.Assert(_span.End == virtualChars._span.Start); 208Debug.Assert(chars1._leafCharacters == chars2._leafCharacters);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\CompilationExtensions.cs (1)
44Debug.Assert(type is null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (2)
16Debug.Assert(firstBlock.Kind == BasicBlockKind.Entry); 23Debug.Assert(lastBlock.Kind == BasicBlockKind.Exit);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\DiagnosticDescriptorExtensions.cs (2)
25Debug.Assert(descriptor.CustomTags is ImmutableArray<string>); 51Debug.Assert(reportDiagnostic != ReportDiagnostic.Default);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\IMethodSymbolExtensions.cs (2)
24Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); 29Debug.Assert(!Equals(method.PartialImplementationPart, method));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ISymbolExtensions_Accessibility.cs (7)
90Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 176Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 214Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 251Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 376Debug.Assert(current.IsDefinition); 410Debug.Assert(within is INamedTypeSymbol or IAssemblySymbol); 437Debug.Assert(current.IsDefinition);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ITypeSymbolExtensions.cs (1)
537Debug.Assert(isTypeParameter2);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\LocationExtensions.cs (1)
44Debug.Assert(loc1.IsInSource && loc2.IsInSource);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
146Debug.Assert(parenthesizedOperation.Language == LanguageNames.VisualBasic);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\SymbolUsageInfo.cs (1)
31Debug.Assert(valueUsageInfoOpt.HasValue ^ typeOrNamespaceUsageInfoOpt.HasValue);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
60Debug.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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.AnalysisData.cs (2)
93Debug.Assert(localFunction.IsLocalFunction()); 245Debug.Assert(newBlockAnalysisData != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
57Debug.Assert(localFunctionOrLambda.IsLocalFunction() || localFunctionOrLambda.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (13)
101Debug.Assert(LValueFlowCapturesInGraph.Values.All(kind => kind is FlowCaptureKind.LValueCapture or FlowCaptureKind.LValueAndRValueCapture)); 121Debug.Assert(cfg.Parent == null); 144Debug.Assert(cfg.Parent != null); 145Debug.Assert(lambdaOrLocalFunction.IsAnonymousFunction() || lambdaOrLocalFunction.IsLocalFunction()); 146Debug.Assert(parentAnalysisData != null); 303Debug.Assert(lambdaOrLocalFunctionCfg != null); 313Debug.Assert(anonymousFunctionCfg != null); 322Debug.Assert(localFunction.IsLocalFunction()); 330Debug.Assert(localFunctionCfg != null); 346Debug.Assert(_analysisDataByBasicBlockMap[basicBlock] != null); 487Debug.Assert(localFunction.IsLocalFunction()); 488Debug.Assert(localFunction.Equals(localFunction.OriginalDefinition)); 578Debug.Assert(localFunctionTarget.Method.IsLocalFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.Walker.cs (11)
54Debug.Assert(_currentContainingSymbol == null); 55Debug.Assert(_currentAnalysisData == null); 56Debug.Assert(_currentRootOperation == null); 57Debug.Assert(_pendingWritesMap == null); 110Debug.Assert(symbol != null); 162Debug.Assert(symbolOpt != null || operation.Kind == OperationKind.FlowCaptureReference); 198Debug.Assert(symbolOpt != null); 208Debug.Assert(symbolOpt == null); 211Debug.Assert(_currentAnalysisData.IsLValueFlowCapture(captureReference.Id)); 347Debug.Assert(localFunction.IsLocalFunction()); 500Debug.Assert(operation.Type.IsDelegateType());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
57Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.cs (2)
191Debug.Assert(scratch.Count == 0); 205Debug.Assert(scratch.Count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\AbstractFormatEngine.OperationApplier.cs (2)
148Debug.Assert(operation.Option == AdjustNewLinesOption.ForceLinesIfOnSingleLine); 464Debug.Assert(!previousChangesMap.ContainsKey(currentToken));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Engine\TokenStream.cs (12)
65Debug.Assert(this.TokenCount > 0); 87Debug.Assert(previousToken.FullSpan.End <= currentToken.FullSpan.Start); 390Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 391Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 392Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 415Debug.Assert(token1.Token.Span.End <= token2.Token.SpanStart); 416Debug.Assert(token1.IndexInStream < 0 || token2.IndexInStream < 0 || (token1.IndexInStream + 1 == token2.IndexInStream)); 417Debug.Assert((token1.IndexInStream >= 0 && token2.IndexInStream >= 0) || token1.Token.Equals(token2.Token.GetPreviousToken(includeZeroWidth: true)) || token2.Token.LeadingTrivia.Span.Contains(token1.Token.Span)); 435Debug.Assert(_treeData.IsFirstToken(this.FirstTokenInStream.Token)); 447Debug.Assert(_treeData.IsLastToken(this.LastTokenInStream.Token)); 495Debug.Assert(tokenData2 == tokenData1.GetNextTokenData()); 519Debug.Assert(token.FullSpan.IsEmpty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Rules\Operations\AlignTokensOperation.cs (1)
19Debug.Assert(!tokens.IsEmpty());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\TriviaEngine\AbstractTriviaFormatter.cs (2)
751Debug.Assert(!_firstLineBlank); 857Debug.Assert(IsWhitespaceOrEndOfLine(trivia2));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Indentation\AbstractIndentation.Indenter.cs (1)
85Debug.Assert(indentStyle == FormattingOptions2.IndentStyle.Smart);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.cs (1)
160Debug.Assert(spanToCheck.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\NamingStyles\NamingStyle.WordSpanEnumerator.cs (1)
23Debug.Assert(nameSpan.Length > 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\Option2.cs (3)
70Debug.Assert(LanguageName is null == (Definition.ConfigName.StartsWith(OptionDefinition.LanguageAgnosticConfigNamePrefix, StringComparison.Ordinal) || 72Debug.Assert(LanguageName is LanguageNames.CSharp == Definition.ConfigName.StartsWith(OptionDefinition.CSharpConfigNamePrefix, StringComparison.Ordinal)); 73Debug.Assert(LanguageName is LanguageNames.VisualBasic == Definition.ConfigName.StartsWith(OptionDefinition.VisualBasicConfigNamePrefix, StringComparison.Ordinal));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionDefinition.cs (1)
60Debug.Assert(IsSupportedOptionType(Type));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Options\OptionKey2.cs (3)
23Debug.Assert(option.IsPerLanguage == language is not null); 31Debug.Assert(option.IsPerLanguage); 43Debug.Assert(!option.IsPerLanguage);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectReader.cs (2)
45Debug.Assert(BitConverter.IsLittleEndian); 242Debug.Assert(code is >= TypeCode.FirstWellKnownTextEncoding and <= TypeCode.LastWellKnownTextEncoding);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Serialization\ObjectWriter.cs (3)
90Debug.Assert(BitConverter.IsLittleEndian); 468Debug.Assert(id >= 0); 540Debug.Assert(kind is >= EncodingExtensions.FirstTextEncodingKind and <= EncodingExtensions.LastTextEncodingKind);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\FileBannerFacts\AbstractFileBannerFacts.cs (2)
168Debug.Assert(root.FullSpan.Start == 0); 174Debug.Assert(firstToken.FullSpan.Start == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Services\HeaderFacts\AbstractHeaderFacts.cs (1)
44Debug.Assert(ownerOfHeader.FullSpan.Contains(lastTokenOrNodeOfHeader.Span));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousFunctionOrDelegateSymbolKey.cs (1)
23Debug.Assert(symbol.IsAnonymousDelegateType() || symbol.IsAnonymousFunction());
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.AnonymousTypeSymbolKey.cs (1)
20Debug.Assert(symbol.IsAnonymousType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.cs (1)
196Debug.Assert(reader.Position == symbolKey.Length);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.MethodSymbolKey.cs (3)
18Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 130Debug.Assert(symbol.Equals(symbol.ConstructedFrom)); 263Debug.Assert(method != null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.NamespaceSymbolKey.cs (3)
37Debug.Assert(symbol.IsGlobalNamespace); 95Debug.Assert(metadataName == string.Empty); 99Debug.Assert(metadataName == string.Empty);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.PropertySymbolKey.cs (1)
104Debug.Assert(property != null);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.SymbolKeyWriter.cs (3)
110Debug.Assert(_nestingCount == 0); 256Debug.Assert(location.Kind is LocationKind.None or 310Debug.Assert(!array.IsDefault);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\SymbolKey\SymbolKey.TupleTypeSymbolKey.cs (1)
22Debug.Assert(symbol.IsTupleType);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\AbstractSpeculationAnalyzer.cs (17)
261Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 263Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 285Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 287Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 297Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 299Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 307Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 309Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 319Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalNode)); 321Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newNode)); 572Debug.Assert(previousOriginalNode == null || previousOriginalNode.Parent == currentOriginalNode); 573Debug.Assert(previousReplacedNode == null || previousReplacedNode.Parent == currentReplacedNode); 627Debug.Assert(this.SemanticRootOfOriginalExpression.DescendantNodesAndSelf().Contains(originalExpression)); 629Debug.Assert(this.SemanticRootOfReplacedExpression.DescendantNodesAndSelf().Contains(newExpression)); 1081Debug.Assert(signature1Parameters.Length == signature2Parameters.Length); 1082Debug.Assert(specifiedArguments.Length <= signature1Parameters.Length || 1167Debug.Assert(parameter1.HasExplicitDefaultValue == parameter2.HasExplicitDefaultValue);
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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\BidirectionalMap.cs (1)
100Debug.Assert(_forwardMap.Count == _backwardMap.Count);
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\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\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\NonReentrantLock.cs (2)
202Debug.Assert(!this.IsLocked); 211Debug.Assert(this.IsOwnedByMe);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\RoslynParallel.NetFramework.cs (7)
114Debug.Assert(source != null); 115Debug.Assert(scheduler != null); 116Debug.Assert(body != null); 279Debug.Assert(source != null); 280Debug.Assert(scheduler != null); 281Debug.Assert(body != null); 543Debug.Assert(!Cancellation.IsCancellationRequested);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\StringBreaker.cs (3)
85Debug.Assert(current < length); 107Debug.Assert(current < length); 126Debug.Assert(char.IsUpper(identifier[current - 1]));
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.cs (1)
164Debug.Assert(_assemblyComparer == null);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.EquivalenceVisitor.cs (7)
77Debug.Assert(!x.IsDefault && !y.IsDefault); 113Debug.Assert(x.Kind == y.Kind && x.Kind == k); 331Debug.Assert(GetTypeKind(x) == GetTypeKind(y)); 371Debug.Assert(y.Kind == SymbolKind.ErrorType); 420Debug.Assert(y.IsTupleType); 617Debug.Assert( 621Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
261Debug.Assert(
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\WordSimilarityChecker.cs (1)
134Debug.Assert(similarityWeight <= _threshold);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\CodeGenerationHelpers.cs (2)
341Debug.Assert(desiredGroupIndex >= 0); 342Debug.Assert(desiredGroupIndex <= declarationList.Count);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\CodeGeneration\Symbols\CodeGenerationMethodSymbol.cs (1)
47Debug.Assert(!isInitOnly || methodKind == MethodKind.PropertySet);
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Extensions\ProjectExtensions.cs (3)
50Debug.Assert(diagnostic != null); 104Debug.Assert(analyzerConfigPath != null); 105Debug.Assert(PathUtilities.IsAbsolute(analyzerConfigPath));
src\Workspaces\SharedUtilitiesAndExtensions\Workspace\Core\Simplification\AbstractSimplificationService.cs (1)
74Debug.Assert(!semanticModel.IsSpeculativeSemanticModel);
TemporaryStorage\TemporaryStorageService.cs (1)
297Debug.Assert(*src == 0xFEFF);
TemporaryStorage\TemporaryStorageService.MemoryMappedInfo.cs (1)
88Debug.Assert(streamAccessor.Target.CanRead);
Utilities\Documentation\XmlDocumentationProvider.cs (1)
155Debug.Assert(PathUtilities.IsAbsolute(filePath));
Workspace\Host\Metadata\WorkspaceMetadataFileReferenceResolver.cs (2)
21Debug.Assert(metadataService != null); 22Debug.Assert(pathResolver != null);
Workspace\ProjectSystem\ProjectSystemProject.BatchingDocumentCollection.cs (2)
195Debug.Assert(_project._gate.CurrentCount == 0); 235Debug.Assert(_project._gate.CurrentCount == 0);
Workspace\ProjectSystem\ProjectSystemProject.cs (2)
1225Debug.Assert(_gate.CurrentCount == 0); 1295Debug.Assert(_gate.CurrentCount == 0);
Workspace\Solution\ProjectDependencyGraph.cs (8)
494Debug.Assert(projectIds.Count >= referencesMap.Count); 495Debug.Assert(referencesMap.Keys.All(projectIds.Contains)); 516Debug.Assert(projectIds.Count >= reverseReferencesMap.Count); 517Debug.Assert(reverseReferencesMap.Keys.All(projectIds.Contains)); 523Debug.Assert(reverseReferencesMap.ContainsKey(referencedProject)); 524Debug.Assert(reverseReferencesMap[referencedProject].Contains(project)); 533Debug.Assert(forwardReferencesMap.ContainsKey(referencingProject)); 534Debug.Assert(forwardReferencesMap[referencingProject].Contains(project));
Workspace\Solution\ProjectDependencyGraph_RemoveAllProjectReferences.cs (1)
93Debug.Assert(references.IsSupersetOf(referencedProjectIds));
Workspace\Solution\ProjectDependencyGraph_RemoveProjectReference.cs (2)
84Debug.Assert(references.Contains(referencedProjectId)); 138Debug.Assert(references.Contains(projectId));
Workspace\Solution\ProjectState.cs (7)
735Debug.Assert(attributes.Version != Attributes.Version); 889Debug.Assert(!documents.Any(d => DocumentStates.Contains(d.Id))); 901Debug.Assert(!documents.Any(d => AdditionalDocumentStates.Contains(d.Id))); 913Debug.Assert(!documents.Any(d => AnalyzerConfigDocumentStates.Contains(d.Id))); 992Debug.Assert(!oldDocuments.SequenceEqual(newDocuments)); 1018Debug.Assert(!oldDocuments.SequenceEqual(newDocuments)); 1041Debug.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)
616Debug.Assert(addedDocumentInfos.IsEmpty); 617Debug.Assert(removedDocumentInfos.IsEmpty); 989Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1004Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1019Debug.Assert(stateChange.NewSolutionState != this.SolutionState); 1033Debug.Assert(stateChange.OldProjectState != stateChange.NewProjectState); 1052Debug.Assert(stateChange.OldProjectState != stateChange.NewProjectState);
Workspace\Solution\SolutionCompilationState.RegularCompilationTracker.cs (1)
107Debug.Assert(symbol.Kind is SymbolKind.Assembly or SymbolKind.NetModule or SymbolKind.DynamicType);
Workspace\Solution\SolutionCompilationState.SkeletonReferenceCache.cs (2)
149Debug.Assert(version != VersionStamp.Default); 164Debug.Assert(version != VersionStamp.Default);
Workspace\Solution\SolutionState.cs (5)
160Debug.Assert(ProjectStates.Keys.SetEquals(ProjectIds)); 161Debug.Assert(ProjectStates.Keys.SetEquals(_dependencyGraph.ProjectIds)); 1112Debug.Assert(oldProject != newProject); 1125Debug.Assert(oldProject != newProject); 1136Debug.Assert(oldProject != newProject);
Workspace\Solution\TextDocumentStates.cs (1)
60Debug.Assert(map.KeyComparer == DocumentIdComparer.Instance);
Workspace\Solution\VersionStamp.cs (1)
125Debug.Assert(_globalIncrement != GlobalVersionMarker);
Workspace\Workspace_Editor.cs (2)
576Debug.Assert(oldDocument.Kind is TextDocumentKind.AdditionalDocument or TextDocumentKind.AnalyzerConfigDocument); 777Debug.Assert(oldDocument.Kind is TextDocumentKind.AdditionalDocument or TextDocumentKind.AnalyzerConfigDocument);
Microsoft.CodeAnalysis.Workspaces.MSBuild (11)
MSBuild\MSBuildWorkspace.cs (10)
315Debug.Assert(_applyChangesBuildHostProcessManager == null); 330Debug.Assert(_applyChangesBuildHostProcessManager != null); 331Debug.Assert(_applyChangesProjectFile == null); 451Debug.Assert(_applyChangesProjectFile != null); 499Debug.Assert(encoding != null); 511Debug.Assert(_applyChangesProjectFile != null); 650Debug.Assert(_applyChangesProjectFile != null); 665Debug.Assert(_applyChangesProjectFile != null); 678Debug.Assert(_applyChangesProjectFile != null); 690Debug.Assert(_applyChangesProjectFile != null);
src\Workspaces\MSBuild\BuildHost\Rpc\Contracts\ProjectFileReference.cs (1)
38Debug.Assert(!aliases.IsDefault);
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (165)
Build\ProjectBuildManager.cs (3)
91Debug.Assert(loadedProjects.Count == 1); 157Debug.Assert(BatchBuildStarted); 226Debug.Assert(BatchBuildStarted);
MSBuild\Logging\MSBuildDiagnosticLogger.cs (3)
27Debug.Assert(_projectFilePath != null); 33Debug.Assert(_projectFilePath != null); 39Debug.Assert(_eventSource == null);
Rpc\Contracts\ProjectFileReference.cs (1)
38Debug.Assert(!aliases.IsDefault);
src\Compilers\Core\Portable\Collections\ImmutableArrayExtensions.cs (16)
86Debug.Assert(items != null); 487Debug.Assert(self.Length == other.Length); 518Debug.Assert(self.Length == other.Length); 550Debug.Assert(!array.IsDefault); 551Debug.Assert(predicateWithArg != null ^ predicateWithoutArg != null); 570Debug.Assert(i > 0); 586Debug.Assert(i > 0); 589Debug.Assert(builder == null); 602Debug.Assert(!all); 603Debug.Assert(!none); 612Debug.Assert(none); 816Debug.Assert(!array.IsDefault); 1189Debug.Assert(builder.Count > 1); 1233Debug.Assert(members.Length > 0); 1248Debug.Assert(count < members.Length); 1260Debug.Assert(builder.Count == count);
src\Compilers\Core\Portable\Collections\TemporaryArray`1.cs (2)
170Debug.Assert(_count == InlineCapacity); 333Debug.Assert(_builder is null);
src\Compilers\Core\Portable\FileSystem\FileUtilities.cs (15)
48Debug.Assert(baseDirectory == null || searchPaths != null || PathUtilities.IsAbsolute(baseDirectory)); 61Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 72Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 85Debug.Assert(PathUtilities.IsAbsolute(combinedPath)); 102Debug.Assert(baseDirectory == null || PathUtilities.IsAbsolute(baseDirectory)); 108Debug.Assert(PathUtilities.GetPathKind(path) == kind); 173Debug.Assert(PathUtilities.IsDirectorySeparator(path![0])); 174Debug.Assert(path.Length == 1 || !PathUtilities.IsDirectorySeparator(path[1])); 199Debug.Assert(PathUtilities.IsAbsolute(resolvedBasePath)); 249Debug.Assert(PathUtilities.IsAbsolute(path)); 293Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 311Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 395Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 413Debug.Assert(PathUtilities.IsAbsolute(fullPath)); 436Debug.Assert(PathUtilities.IsAbsolute(fullPath));
src\Compilers\Core\Portable\FileSystem\PathUtilities.cs (3)
385Debug.Assert(!IsUnixLikePlatform); 403Debug.Assert(IsAbsolute(root)); 855Debug.Assert(parts[toSkip - 1] == string.Empty);
src\Compilers\Core\Portable\InternalUtilities\ArrayExtensions.cs (2)
16Debug.Assert(start >= 0); 17Debug.Assert(start <= array.Length);
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\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
102Debug.Assert(_capacity > 0);
src\Compilers\Core\Portable\InternalUtilities\ConsList`1.cs (4)
38Debug.Assert(_tail != null); 89Debug.Assert(tail != null); 100Debug.Assert(this != Empty); 110Debug.Assert(this != Empty);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Core\Portable\InternalUtilities\EnumerableExtensions.cs (1)
737Debug.Assert(data.All(d => d.Count() == count));
src\Compilers\Core\Portable\InternalUtilities\FileLockCheck.cs (1)
199Debug.Assert(rgAffectedApps != null);
src\Compilers\Core\Portable\InternalUtilities\InterlockedOperations.cs (2)
140Debug.Assert((object?)initializedValue != uninitializedValue); 156Debug.Assert(!initializedValue.IsDefault);
src\Compilers\Core\Portable\InternalUtilities\JsonWriter.cs (2)
219Debug.Assert(_pending == Pending.NewLineAndIndent || _pending == Pending.CommaNewLineAndIndent); 302Debug.Assert(ShouldAppendAsUnicode(c));
src\Compilers\Core\Portable\InternalUtilities\MultiDictionary.cs (3)
49Debug.Assert(_count > 1); 52Debug.Assert(_count == v.Count); 154Debug.Assert(_value != null);
src\Compilers\Core\Portable\InternalUtilities\OneOrMany.cs (1)
199Debug.Assert(HasOneItem == other.HasOneItem);
src\Compilers\Core\Portable\InternalUtilities\ReflectionUtilities.cs (1)
131Debug.Assert(e.InnerException is object);
src\Compilers\Core\Portable\InternalUtilities\StreamExtensions.cs (1)
35Debug.Assert(count > 0);
src\Compilers\Core\Portable\InternalUtilities\StringExtensions.cs (1)
28Debug.Assert(number >= 0);
src\Compilers\Core\Portable\InternalUtilities\ThreeState.cs (1)
33Debug.Assert(value != ThreeState.Unknown);
src\Compilers\Core\Portable\InternalUtilities\WeakList.cs (5)
27Debug.Assert(_size == _items.Length); 28Debug.Assert(_items.Length == 0 || _items.Length >= MinimalNonEmptySize); 64Debug.Assert(_size == _items.Length); 100Debug.Assert(_items[firstDead].IsNull()); 157Debug.Assert(_size < _items.Length);
src\Compilers\Core\Portable\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);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+KeyCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedDictionary`2+Builder+ValueCollection.cs (1)
22Debug.Assert(dictionary is not null);
src\Dependencies\Collections\ImmutableSegmentedHashSet`1+ValueBuilder.cs (1)
118Debug.Assert(other is not ValueBuilder);
src\Dependencies\Collections\Internal\ArraySortHelper.cs (41)
110Debug.Assert(i != j); 123Debug.Assert(i != j); 132Debug.Assert(comparer != null); 145Debug.Assert(keys.Length > 0); 146Debug.Assert(depthLimit >= 0); 147Debug.Assert(comparer != null); 190Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 191Debug.Assert(comparer != null); 235Debug.Assert(comparer != null); 236Debug.Assert(keys.Length > 0); 253Debug.Assert(comparer != null); 413Debug.Assert(!Unsafe.AreSame(ref i, ref j)); 425Debug.Assert(keys.Length > 0); 426Debug.Assert(depthLimit >= 0); 472Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 535Debug.Assert(keys.Length > 0); 691Debug.Assert(comparer != null); 692Debug.Assert(0 <= i && i < keys.Length && i < values.Length); 693Debug.Assert(0 <= j && j < keys.Length && j < values.Length); 694Debug.Assert(i != j); 711Debug.Assert(i != j); 724Debug.Assert(comparer != null); 725Debug.Assert(keys.Length == values.Length); 735Debug.Assert(keys.Length > 0); 736Debug.Assert(values.Length == keys.Length); 737Debug.Assert(depthLimit >= 0); 738Debug.Assert(comparer != null); 781Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 782Debug.Assert(comparer != null); 826Debug.Assert(comparer != null); 827Debug.Assert(keys.Length > 0); 844Debug.Assert(comparer != null); 871Debug.Assert(comparer != null); 944Debug.Assert(i != j); 962Debug.Assert(i != j); 975Debug.Assert(keys.Length > 0); 976Debug.Assert(values.Length == keys.Length); 977Debug.Assert(depthLimit >= 0); 1020Debug.Assert(keys.Length >= SegmentedArrayHelper.IntrosortSizeThreshold); 1079Debug.Assert(keys.Length > 0); 1233Debug.Assert(typeof(TKey) == typeof(double) || typeof(TKey) == typeof(float));
src\Dependencies\Collections\Internal\BitHelper.cs (2)
32Debug.Assert(bitPosition >= 0); 46Debug.Assert(bitPosition >= 0);
src\Dependencies\Collections\Internal\HashHelpers.cs (2)
111Debug.Assert(divisor <= int.MaxValue); 117Debug.Assert(highbits == value % divisor);
src\Dependencies\Collections\SegmentedArray.cs (5)
112Debug.Assert(length > 0); 113Debug.Assert(sourceIndex >= 0); 114Debug.Assert(destinationIndex >= 0); 115Debug.Assert((uint)(sourceIndex + length) <= array.Length); 116Debug.Assert((uint)(destinationIndex + length) <= array.Length);
src\Dependencies\Collections\SegmentedDictionary`2.cs (11)
166Debug.Assert(_entries.Length >= source.Count); 167Debug.Assert(_count == 0); 258Debug.Assert(modified); 265Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 445Debug.Assert(comparer is not null); 516Debug.Assert(_buckets.Length > 0); 522Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType)); 572Debug.Assert(comparer is not null); 647Debug.Assert(newSize >= _entries.Length); 709Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null); 786Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
src\Dependencies\Collections\SegmentedHashSet`1.cs (6)
187Debug.Assert(Count == source.Count); 256Debug.Assert(comparer is not null); 300Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null); 900Debug.Assert(newSize >= _entries.Length); 1021Debug.Assert(_buckets.Length > 0); 1061Debug.Assert(comparer is not null);
src\Dependencies\Collections\SegmentedList`1.cs (2)
268Debug.Assert(_size == _items.Length); 518Debug.Assert(_items.Length < capacity);
src\Dependencies\PooledObjects\ArrayBuilder.cs (8)
463Debug.Assert(builder.Count == 0); 579Debug.Assert(start >= 0 && length >= 0); 580Debug.Assert(start + length <= items.Count); 599Debug.Assert(start >= 0 && length >= 0); 600Debug.Assert(start + length <= items.Length); 614Debug.Assert(start >= 0 && length >= 0); 615Debug.Assert(start + length <= items.Length); 646Debug.Assert(limit <= Count);
src\Dependencies\PooledObjects\ObjectPool`1.cs (2)
116Debug.Assert(size >= 1); 124Debug.Assert(size >= 1);
src\Dependencies\PooledObjects\PooledDictionary.cs (1)
53Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledHashSet.cs (1)
42Debug.Assert(instance.Count == 0);
src\Dependencies\PooledObjects\PooledStringBuilder.cs (2)
25Debug.Assert(pool != null); 90Debug.Assert(builder.Builder.Length == 0);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Utilities\SerializableBytes.cs (1)
239Debug.Assert(count == 0);
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
WorkspaceTestBase.cs (1)
42Debug.Assert(fileContent is string or byte[]);
Microsoft.CodeAnalysis.Workspaces.Test.Utilities (3)
Fakes\TestOptionSet.cs (2)
20Debug.Assert(values.Values.All(IsInternalOptionValue)); 29Debug.Assert(IsInternalOptionValue(internalValue));
OptionsCollection.cs (1)
40Debug.Assert(optionKey.Option is IOption2 { Definition.StorageMapping: null });
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
Differencing\TestNode.cs (2)
25Debug.Assert(value is >= 0 and <= MaxValue); 26Debug.Assert(label is >= 0 and <= MaxLabel);
Microsoft.CSharp (800)
Microsoft\CSharp\RuntimeBinder\ArgumentObject.cs (1)
22Debug.Assert(type != null);
Microsoft\CSharp\RuntimeBinder\BinderHelper.cs (8)
43Debug.Assert(o.HasValue); 264Debug.Assert(action.ReturnType == typeof(object)); 273Debug.Assert(action.ReturnType == typeof(object)); 288Debug.Assert(args != null); 289Debug.Assert(args.Length != 0); 290Debug.Assert(args[0].Value is Type); 367Debug.Assert(discard <= argCount); 368Debug.Assert(argNames.Count <= argCount - discard);
Microsoft\CSharp\RuntimeBinder\CSharpBinaryOperationBinder.cs (2)
40Debug.Assert(name != null); 82Debug.Assert(_argumentInfo.Length == 2);
Microsoft\CSharp\RuntimeBinder\CSharpConvertBinder.cs (1)
35Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpGetMemberBinder.cs (1)
26Debug.Assert(arguments.Length == 1);
Microsoft\CSharp\RuntimeBinder\CSharpUnaryOperationBinder.cs (1)
68Debug.Assert(_argumentInfo.Length == 1);
Microsoft\CSharp\RuntimeBinder\Errors\ErrorHandling.cs (3)
71Debug.Assert(0 != (arg.eaf & ErrArgFlags.Unique) && 0 == (arg.eaf & ErrArgFlags.NoStr)); 101Debug.Assert(0 != (args[prgiarg[j]].eaf & ErrArgFlags.Unique)); 115Debug.Assert(0 != (arg2.eaf & ErrArgFlags.Unique) && 0 == (arg2.eaf & ErrArgFlags.NoStr));
Microsoft\CSharp\RuntimeBinder\Errors\UserStringBuilder.cs (4)
18Debug.Assert(_strBuilder == null || _strBuilder.Length == 0); 24Debug.Assert(_strBuilder != null); 189Debug.Assert(meth == prop.SetterMethod); 209Debug.Assert(meth == @event.methRemove);
Microsoft\CSharp\RuntimeBinder\ExpressionTreeCallRewriter.cs (18)
55Debug.Assert(binOp != null); 56Debug.Assert(binOp.Kind == ExpressionKind.Sequence); 57Debug.Assert(binOp.OptionalRightChild is ExprCall); 58Debug.Assert(((ExprCall)binOp.OptionalRightChild).PredefinedMethod == PREDEFMETH.PM_EXPRESSION_LAMBDA); 59Debug.Assert(binOp.OptionalLeftChild != null); 77Debug.Assert(call?.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_PARAMETER); 78Debug.Assert(pExpr.OptionalRightChild is ExprWrap); 296Debug.Assert(list != null); 306Debug.Assert(pExpr.PredefinedMethod == PREDEFMETH.PM_EXPRESSION_ARRAYINDEX2); 339Debug.Assert((pExpr.Flags & EXPRFLAG.EXF_UNBOXRUNTIME) == 0); 351Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 427Debug.Assert(fieldInfo != null); 501Debug.Assert(list != null); 573Debug.Assert(isLifted != null); 703Debug.Assert(pExpr.Type is NullType); 710Debug.Assert(call != null); 712Debug.Assert(pm == PREDEFMETH.PM_EXPRESSION_CONVERT || 912Debug.Assert(expressions.Count == arrinit.DimensionSizes[0]);
Microsoft\CSharp\RuntimeBinder\RuntimeBinder.cs (18)
76Debug.Assert(args.Length >= 1); 118Debug.Assert(pResult != null); 129Debug.Assert(System.Threading.Monitor.IsEntered(s_bindLock)); 206Debug.Assert(t != null); 257Debug.Assert(array[i].Type != null); 393Debug.Assert(type.IsByRef); 484Debug.Assert(argument.Info.Name != null); 693Debug.Assert(t != null); // Would have thrown in PopulateSymbolTableWithPayloadInformation already 821Debug.Assert(result != null); 857Debug.Assert(prop != null); 945Debug.Assert(arguments.Length == 1); 985Debug.Assert(arguments.Length == 2); 1137Debug.Assert(type != typeof(string)); 1145Debug.Assert(callingObject.Type is ArrayType); 1193Debug.Assert(arguments.Length == 1); 1228Debug.Assert(arguments.Length == 1); 1251Debug.Assert(arguments.Length >= 2); 1252Debug.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 (9)
185Debug.Assert(index != -1); 208Debug.Assert(!(args.prgexpr[i] is ExprNamedArgumentSpecification)); 352Debug.Assert(betterMethod == BetterType.Neither); 400Debug.Assert(argType != null); 401Debug.Assert(p1 != null); 402Debug.Assert(p2 != null); 489Debug.Assert(list.Count != 0); 490Debug.Assert(list[0].mpwi != null); 515Debug.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)
107Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0)); 108Debug.Assert(((_grflt & LiftFlags.Lift2) == 0) || ((_grflt & LiftFlags.Convert2) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\Conversion.cs (39)
222Debug.Assert(s_simpleTypeBetter[i][i] == same); 225Debug.Assert(s_simpleTypeBetter[i][j] != same && s_simpleTypeBetter[j][i] != same); 226Debug.Assert( 230Debug.Assert( 248Debug.Assert((int)pt1 < NUM_EXT_TYPES); 249Debug.Assert((int)pt2 < NUM_EXT_TYPES); 298Debug.Assert(type1 != null && type2 != null); 360Debug.Assert(!(expr is ExprMemberGroup)); 441Debug.Assert(!(expr is ExprMemberGroup)); 442Debug.Assert(dest != null); 517Debug.Assert(expr.Type != null); 629Debug.Assert(exprSrc == null || exprSrc.Type == typeSrc); 721Debug.Assert(convCur.getClass() == aggCur); 809Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); // If typeBestSrc is null then typeBestDst should be null. 810Debug.Assert(fFromImplicit); 817Debug.Assert(iuciBestSrc == -1); 823Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count - 1); 837Debug.Assert(fToImplicit); 844Debug.Assert(iuciBestDst == -1); 850Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count - 1); 863Debug.Assert((typeBestSrc == null) == (typeBestDst == null)); 866Debug.Assert(iuciBestSrc == -1 && iuciBestDst == -1); 870Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 871Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 933Debug.Assert(typeFrom != typeBestSrc || typeTo != typeBestDst); 941Debug.Assert(n <= 0); 955Debug.Assert(n <= 0); 982Debug.Assert(ctypeLiftBest <= 2); 996Debug.Assert(fLiftSrc || fLiftDst); 1034Debug.Assert(pConversionArgument != null); 1057Debug.Assert(0 <= iuciBestSrc && iuciBestSrc < prguci.Count); 1058Debug.Assert(0 <= iuciBestDst && iuciBestDst < prguci.Count); 1066Debug.Assert(pExpr != null); 1102Debug.Assert(pTransformedArgument != null); 1106Debug.Assert(pCast != null); 1126Debug.Assert(constSrc != null); 1327Debug.Assert(type1 != type2); 1361Debug.Assert(type1 != type2); 1487Debug.Assert(typeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Conversions.cs (5)
78Debug.Assert(typeSrc != null); 79Debug.Assert(typeDst != null); 186Debug.Assert(!(typeArr is MethodGroupType)); 241Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 242Debug.Assert(pTypeParams.Count == pTargetArgs.Count);
Microsoft\CSharp\RuntimeBinder\Semantics\ExplicitConversion.cs (31)
74Debug.Assert((_flags & CONVERTTYPE.STANDARD) == 0); 189Debug.Assert(_typeSrc != null); 190Debug.Assert(_typeDest != null); 204Debug.Assert(valueSrc.Type == _typeSrc.StripNubs()); 235Debug.Assert(_typeSrc != null); 236Debug.Assert(_typeDest != null); 299Debug.Assert(!(typeArr is MethodGroupType)); 345Debug.Assert(_typeSrc != null); 346Debug.Assert(arrayDest != null); 412Debug.Assert(_typeSrc != null); 413Debug.Assert(aggTypeDest != null); 455Debug.Assert(_typeSrc != null); 456Debug.Assert(_typeSrc.IsPredefType(PredefinedType.PT_DECIMAL)); 457Debug.Assert(aggTypeDest.IsEnumType); 497Debug.Assert(_typeSrc != null); 498Debug.Assert(aggTypeDest != null); 499Debug.Assert(aggTypeDest.IsPredefType(PredefinedType.PT_DECIMAL)); 500Debug.Assert(_typeSrc.IsEnumType); 542Debug.Assert(ok); 551Debug.Assert(_typeSrc != null); 552Debug.Assert(aggTypeDest != null); 603Debug.Assert(_typeSrc != null); 604Debug.Assert(aggTypeDest != null); 613Debug.Assert(_typeSrc.IsPredefined && aggDest.IsPredefined()); 618Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 622Debug.Assert(convertKind != ConvKind.Implicit); 623Debug.Assert(convertKind != ConvKind.Identity); 678Debug.Assert(_typeSrc != null); 679Debug.Assert(aggTypeDest != null); 736Debug.Assert(_typeSrc != null); 737Debug.Assert(aggTypeDest != null);
Microsoft\CSharp\RuntimeBinder\Semantics\ExpressionBinder.cs (45)
275Debug.Assert(pt != PredefinedType.PT_VOID); // use getVoidType() 290Debug.Assert(op1 is ExprCast 308Debug.Assert(pArrayType != null); 349Debug.Assert(typeDest != null); 377Debug.Assert(exprCast.Argument != null); 392Debug.Assert(mwi.Sym is MethodSymbol && (!mwi.Meth().isOverride || mwi.Meth().isHideByName)); 393Debug.Assert(pMemGroup != null); 422Debug.Assert(pResult.Type == VoidType.Instance); 437Debug.Assert(fwt.GetType() != null && fwt.Field().getClass() == fwt.GetType().OwningAggregate); 452Debug.Assert(BindingFlag.BIND_MEMBERSET == (BindingFlag)EXPRFLAG.EXF_MEMBERSET); 463Debug.Assert(pwt.Sym is PropertySymbol && 466Debug.Assert(pwt.Prop().Params.Count == 0 || pwt.Prop() is IndexerSymbol); 540Debug.Assert(pName != null); 598Debug.Assert(methCur.typeVars.Count == 0); 660Debug.Assert(arg.Type is NullableType); 716Debug.Assert(grp.SymKind == SYMKIND.SK_MethodSymbol || grp.SymKind == SYMKIND.SK_PropertySymbol && ((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0)); 721Debug.Assert(grp.Name != null); 730Debug.Assert((grp.Flags & EXPRFLAG.EXF_INDEXER) != 0); 763Debug.Assert(arg != null); 796Debug.Assert(pOperand1 != null); 797Debug.Assert(pOperand1.Type != null); 805Debug.Assert(pOperand2.Type != null); 814Debug.Assert(kind >= CheckLvalueKind.Assignment && kind <= CheckLvalueKind.Increment); 823Debug.Assert(prop != null); 824Debug.Assert(prop.isLvalue()); 865Debug.Assert(!(expr is ExprLocal)); 866Debug.Assert(!(expr is ExprMemberGroup)); 872Debug.Assert(!prop.MethWithTypeSet || ExprProperty.HasIsExternalInitModifier(prop.MethWithTypeSet)); 900Debug.Assert(field.FieldWithType.Field().isReadOnly); 929Debug.Assert(prop != null); 948Debug.Assert(swt.GetType() != null && swt.GetType().OwningAggregate == swt.Sym.parent as AggregateSymbol); 1000Debug.Assert(swt.GetType().OwningAggregate == aggCalled); 1003Debug.Assert(pObject != null); 1050Debug.Assert( 1064Debug.Assert(call != null); 1077Debug.Assert(mp != null); 1078Debug.Assert(mp.Params != null); 1089Debug.Assert(!Array.Exists(@params.Items, p => p is ArgumentListType)); // We should never have picked a varargs method to bind to. 1136Debug.Assert(index != mp.Params.Count); 1190Debug.Assert(rval != null); 1331Debug.Assert(arg != null); 1332Debug.Assert(arg.Type != null); 1338Debug.Assert(iarg <= argInfo.carg); 1607Debug.Assert(ek >= ExpressionKind.FirstOp && (ek - ExpressionKind.FirstOp) < (int)EK2NAME.Length); 1645Debug.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)
104Debug.Assert(type != null); 113Debug.Assert(type.FundamentalType > FUNDTYPE.FT_NONE); 114Debug.Assert(type.FundamentalType < FUNDTYPE.FT_COUNT); 160Debug.Assert(arg1 != null); 161Debug.Assert(exprKind.IsUnaryOperator() == (arg2 == null)); 176Debug.Assert(operand != null); 202Debug.Assert(wrap != null); 219Debug.Assert(last == first); 226Debug.Assert(last == first); 231Debug.Assert((last as ExprList)?.OptionalNextListNode != null); 232Debug.Assert((last as ExprList).OptionalNextListNode.Kind != ExpressionKind.List);
Microsoft\CSharp\RuntimeBinder\Semantics\GroupToArgsBinder.cs (26)
61Debug.Assert(grp != null); 62Debug.Assert(args != null); 93Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 106Debug.Assert(pGroup != null); 242Debug.Assert(!_results.InaccessibleResult); 247Debug.Assert(!_misnamed); 254Debug.Assert(!_mpwiBogus); 274Debug.Assert(type.IsInterfaceType); 345Debug.Assert(pmethBest != null); 572Debug.Assert(optionalArgument != null); 631Debug.Assert(meth is MethodSymbol); 647Debug.Assert(method.parent is AggregateSymbol); 852Debug.Assert(_methList.IsEmpty() || _methList.Head().mpwi.MethProp() != _pCurrentSym); 874Debug.Assert(methSym.typeVars.Count > 0); 1034Debug.Assert(pMethod != null); 1036Debug.Assert(pMethod.IsParameterOptional(iParam)); 1076Debug.Assert(_pGroup.SymKind == SYMKIND.SK_MethodSymbol || _pGroup.SymKind == SYMKIND.SK_PropertySymbol && 0 != (_pGroup.Flags & EXPRFLAG.EXF_INDEXER)); 1077Debug.Assert(_pGroup.TypeArgs.Count == 0 || _pGroup.SymKind == SYMKIND.SK_MethodSymbol); 1078Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_USERCALLABLE) || _results.BestResult.MethProp().isUserCallable()); 1082Debug.Assert(_results.BestResult.MethProp() is MethodSymbol); 1101Debug.Assert(_methList.IsEmpty()); 1155Debug.Assert(!_results.BestResult || _results.BestResult.MethProp().getClass().IsDelegate()); 1156Debug.Assert(!_results.BestResult || _results.BestResult.GetType().OwningAggregate.IsDelegate()); 1174Debug.Assert(_results.UninferableResult.Sym is MethodSymbol); 1218Debug.Assert(0 == (_pGroup.Flags & EXPRFLAG.EXF_CTOR)); 1224Debug.Assert(!(_pGroup.ParentType is TypeParameterType));
Microsoft\CSharp\RuntimeBinder\Semantics\ImplicitConversion.cs (18)
87Debug.Assert(_typeSrc != null && _typeDest != null); // types must be supplied. 88Debug.Assert(_exprSrc == null || _typeSrc == _exprSrc.Type); // type of source should be correct if source supplied 89Debug.Assert(!_needsExprDest || _exprSrc != null); // need source expr to create dest expr 144Debug.Assert(ftDest != FUNDTYPE.FT_NONE || _typeDest is ParameterModifierType); 268Debug.Assert(0 != (~_flags & (CONVERTTYPE.STANDARD | CONVERTTYPE.ISEXPLICIT))); 269Debug.Assert(_exprSrc == null || _exprSrc.Type == _typeSrc); 270Debug.Assert(!_needsExprDest || _exprSrc != null); 271Debug.Assert(_typeSrc != nubDst); // BindImplicitConversion should have taken care of this already. 278Debug.Assert(atsDst != _typeSrc); 304Debug.Assert(_typeSrc == typeSrcBase); 347Debug.Assert(exprTmp.Type == nubDst); 671Debug.Assert(aggSrc.getThisType().IsSimpleType); 672Debug.Assert(_typeDest.IsSimpleType); 674Debug.Assert(aggSrc.IsPredefined() && _typeDest.IsPredefined); 679Debug.Assert((int)ptSrc < NUM_SIMPLE_TYPES && (int)ptDest < NUM_SIMPLE_TYPES); 701Debug.Assert(ptSrc == PredefinedType.PT_FLOAT || ptSrc == PredefinedType.PT_DOUBLE); 702Debug.Assert(0 != (_flags & CONVERTTYPE.ISEXPLICIT)); 708Debug.Assert(convertKind != ConvKind.Identity);
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookup.cs (30)
70Debug.Assert(type != null && sym != null); 85Debug.Assert(_csym == 1); 86Debug.Assert(_prgtype[0] == type); 117Debug.Assert(!(symCur is AggregateSymbol)); 228Debug.Assert(_fMulti || typeCur == _prgtype[0]); 299Debug.Assert(!fInaccess || !fFoundSome); 328Debug.Assert(sym is PropertySymbol); 360Debug.Assert(!_swtFirst || _fMulti); 361Debug.Assert(typeStart != null && !typeStart.IsInterfaceType && (ptypeEnd == null || typeStart != ptypeEnd)); 369Debug.Assert(!typeCur.IsInterfaceType); 395Debug.Assert(typeCur == typeEnd); 405Debug.Assert(!_swtFirst || _fMulti); 406Debug.Assert(typeStart == null || typeStart.IsInterfaceType); 407Debug.Assert(typeStart != null || types.Count != 0); 420Debug.Assert(type.IsInterfaceType); 430Debug.Assert(typeCur != null); 435Debug.Assert(typeCur != null && typeCur.IsInterfaceType); 444Debug.Assert(type.IsInterfaceType); 472Debug.Assert(CSemanticChecker.CheckBogus(swt.Sym)); 475Debug.Assert((meth1 ?? meth2) != null); 523Debug.Assert((flags & ~MemLookFlags.All) == 0); 524Debug.Assert(obj == null || obj.Type != null); 525Debug.Assert(typeSrc is AggregateType); 545Debug.Assert((_flags & (MemLookFlags.Ctor | MemLookFlags.NewObj | MemLookFlags.Operator | MemLookFlags.BaseCall)) == 0); 568Debug.Assert(typeCls2 != null && typeCls2.IsPredefType(PredefinedType.PT_OBJECT)); 596Debug.Assert(FError()); 600Debug.Assert(!_swtFirst || _swtAmbig); 617Debug.Assert(_typeSrc is AggregateType); 645Debug.Assert(_arity != 0); 646Debug.Assert(!(_swtBadArity.Sym is AggregateSymbol));
Microsoft\CSharp\RuntimeBinder\Semantics\MemberLookupResults.cs (2)
24Debug.Assert(containingTypes != null); 25Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodIterator.cs (3)
29Debug.Assert(name != null); 30Debug.Assert(containingTypes != null); 31Debug.Assert(containingTypes.Count != 0);
Microsoft\CSharp\RuntimeBinder\Semantics\MethodTypeInferrer.cs (55)
90Debug.Assert(pMethod != null); 91Debug.Assert(pMethod.typeVars.Count > 0); 92Debug.Assert(pMethod.isParamArray || pMethod.Params == pMethodFormalParameterTypes); 98Debug.Assert(pMethodArguments != null); 99Debug.Assert(pMethodFormalParameterTypes != null); 100Debug.Assert(pMethodArguments.carg <= pMethodFormalParameterTypes.Count); 147Debug.Assert(0 <= iParam); 148Debug.Assert(iParam < _pMethodTypeParameters.Count); 156Debug.Assert(pParam != null); 157Debug.Assert(pParam.IsMethodTypeParameter); 159Debug.Assert(_pMethodTypeParameters[iParam] == pParam); 181Debug.Assert(IsUnfixed(pParam)); 193Debug.Assert(IsUnfixed(pParam)); 205Debug.Assert(IsUnfixed(pParam)); 217Debug.Assert(0 <= iParam); 218Debug.Assert(iParam < _pMethodTypeParameters.Count); 254Debug.Assert(_pMethodFormalParameterTypes != null); 255Debug.Assert(_pMethodArguments != null); 256Debug.Assert(_pMethodArguments.carg <= _pMethodFormalParameterTypes.Count); 399Debug.Assert(res != NewInferenceResult.NoProgress); 579Debug.Assert(_ppDependencies == null); 593Debug.Assert(_ppDependencies != null); 599Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 600Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 614Debug.Assert(_ppDependencies != null); 615Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 616Debug.Assert(0 <= jParam && jParam < _pMethodTypeParameters.Count); 654Debug.Assert(_ppDependencies != null); 677Debug.Assert(_ppDependencies != null); 694Debug.Assert(_ppDependencies != null); 728Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 743Debug.Assert(0 <= iParam && iParam < _pMethodTypeParameters.Count); 871Debug.Assert(pSource != null); 872Debug.Assert(pDest != null); 873Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 878Debug.Assert(pSourceArgs != null); 879Debug.Assert(pDestArgs != null); 880Debug.Assert(pSourceArgs.Count == pDestArgs.Count); 1233Debug.Assert(pSource != null); 1234Debug.Assert(pDest != null); 1235Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1241Debug.Assert(pTypeParams != null); 1242Debug.Assert(pSourceArgs != null); 1243Debug.Assert(pDestArgs != null); 1245Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1246Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1540Debug.Assert(pSource != null); 1541Debug.Assert(pDest != null); 1542Debug.Assert(pSource.OwningAggregate == pDest.OwningAggregate); 1548Debug.Assert(pTypeParams != null); 1549Debug.Assert(pSourceArgs != null); 1550Debug.Assert(pDestArgs != null); 1552Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 1553Debug.Assert(pTypeParams.Count == pDestArgs.Count); 1588Debug.Assert(IsUnfixed(iParam));
Microsoft\CSharp\RuntimeBinder\Semantics\Nullable.cs (5)
13Debug.Assert(expr != null); 31Debug.Assert(pExpr != null && !(pExpr is ExprList)); 41Debug.Assert(exprSrc != null && exprSrc.Type is NullableType); 47Debug.Assert(args != null && !(args is ExprList)); 65Debug.Assert(exprSrc != null);
Microsoft\CSharp\RuntimeBinder\Semantics\Operators.cs (128)
177Debug.Assert(prgbofs != null); 193Debug.Assert(rgbofs != null); 238Debug.Assert(typeSig1.IsValueType); 265Debug.Assert(typeSig1.IsValueType); 322Debug.Assert(typeSig2.IsValueType); 350Debug.Assert(typeSig2.IsValueType); 399Debug.Assert(binopSignatures != null); 488Debug.Assert(arg1 != null); 489Debug.Assert(arg2 != null); 527Debug.Assert(binopSignatures.Count > 0); 553Debug.Assert(bestBinopSignature < binopSignatures.Count); 585Debug.Assert(bofs.fnkind != BinOpFuncKind.BoolBitwiseOp); 605Debug.Assert(bofs.Type1() is NullableType || bofs.Type2() is NullableType); 649Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 737Debug.Assert(!(typeDst is NullableType)); 770Debug.Assert(!(typeDst is NullableType)); 811Debug.Assert(info.type1 is NullableType); 822Debug.Assert(info.type2 is NullableType); 948Debug.Assert(type1.FundamentalType != FUNDTYPE.FT_VAR); 964Debug.Assert(type2.FundamentalType != FUNDTYPE.FT_VAR); 999Debug.Assert( 1002Debug.Assert( 1049Debug.Assert(Enum.IsDefined(bt1)); 1050Debug.Assert(Enum.IsDefined(bt2)); 1156Debug.Assert(pArgument != null); 1159Debug.Assert(type != null); 1192Debug.Assert(pResult != null); 1259Debug.Assert(nBestSignature < pSignatures.Count); 1299Debug.Assert(pArgument != null); 1300Debug.Assert(pArgument.Type != null); 1316Debug.Assert(pRawType == pArgumentType); 1317Debug.Assert(pArgumentType is AggregateType); 1345Debug.Assert(!(pArgumentType is PointerType)); 1358Debug.Assert(pArgument != null); 1393Debug.Assert(pArgument != null); 1394Debug.Assert(pArgument.Type != null); 1516Debug.Assert(arg?.Type != null); 1530Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1553Debug.Assert(Enum.IsDefined(bt)); 1567Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1577Debug.Assert(arg.Type.IsPredefined); 1587Debug.Assert(arg1.Type.IsPredefined && arg2.Type.IsPredefined && arg1.Type.PredefinedType == arg2.Type.PredefinedType); 1597Debug.Assert(arg.Type.IsPredefined); 1608Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1632Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1641Debug.Assert(type.FundamentalType != FUNDTYPE.FT_PTR); // Can't have a pointer. 1645Debug.Assert(type.IsPredefType(PredefinedType.PT_DECIMAL)); 1704Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1705Debug.Assert(!uofs.isLifted()); 1707Debug.Assert(arg != null); 1711Debug.Assert(!(type is NullableType)); 1731Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 1732Debug.Assert(uofs.isLifted()); 1735Debug.Assert(arg != null); 1765Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_DECIMAL) && arg2.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1768Debug.Assert(typeDec != null); 1807Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_DECIMAL)); 1808Debug.Assert(ek == ExpressionKind.Negate || ek == ExpressionKind.UnaryPlus); 1811Debug.Assert(typeDec != null); 1827Debug.Assert(ek == ExpressionKind.Add); 1828Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) || arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1839Debug.Assert(ek == ExpressionKind.LeftShirt || ek == ExpressionKind.RightShift); 1840Debug.Assert(arg1.Type.IsPredefined); 1841Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_INT)); 1844Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 1857Debug.Assert(arg1 != null); 1858Debug.Assert(arg2 != null); 1859Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_BOOL) || arg1.Type is NullableType argNubType1 && argNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1860Debug.Assert(arg2.Type.IsPredefType(PredefinedType.PT_BOOL) || arg2.Type is NullableType argNubType2 && argNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1868Debug.Assert(ek == ExpressionKind.BitwiseAnd || ek == ExpressionKind.BitwiseOr); 1869Debug.Assert(expr1.Type.IsPredefType(PredefinedType.PT_BOOL) || expr1.Type is NullableType expNubType1 && expNubType1.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1870Debug.Assert(expr2.Type.IsPredefType(PredefinedType.PT_BOOL) || expr2.Type is NullableType expNubType2 && expNubType2.UnderlyingType.IsPredefType(PredefinedType.PT_BOOL)); 1896Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 1912Debug.Assert(arg.Type.IsPredefType(PredefinedType.PT_BOOL)); 1913Debug.Assert(ek == ExpressionKind.LogicalNot); 1937Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1938Debug.Assert(arg1.Type.IsPredefType(PredefinedType.PT_STRING) && arg2.Type.IsPredefType(PredefinedType.PT_STRING)); 1955Debug.Assert(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1971Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract || ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq); 1972Debug.Assert(arg1.Type == arg2.Type && (arg1.Type.IsDelegateType || arg1.Type.IsPredefType(PredefinedType.PT_DELEGATE))); 2014Debug.Assert(typeEnum != null); 2031Debug.Assert(!typeDst.IsPredefType(PredefinedType.PT_BOOL)); 2041Debug.Assert(ek == ExpressionKind.Add || ek == ExpressionKind.Subtract); 2055Debug.Assert(typeEnum != null); 2071Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2088Debug.Assert(ek == ExpressionKind.BitwiseNot); 2089Debug.Assert((ExprCast)arg != null); 2090Debug.Assert(((ExprCast)arg).Argument.Type.IsEnumType); 2190Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2192Debug.Assert(typeOp != null); 2193Debug.Assert(op1 != null && op1.Type == typeOp); 2194Debug.Assert(op2 == null || op2.Type == typeOp); 2195Debug.Assert((op2 == null) == (kind == ExpressionKind.Negate || kind == ExpressionKind.UnaryPlus || kind == ExpressionKind.BitwiseNot)); 2206Debug.Assert((exprRes.Flags & EXPRFLAG.EXF_LVALUE) == 0); 2244Debug.Assert(ptOp == PredefinedType.PT_INT || ptOp == PredefinedType.PT_UINT || ptOp == PredefinedType.PT_LONG || ptOp == PredefinedType.PT_ULONG); 2246Debug.Assert(typeOp != null); 2247Debug.Assert(op != null && op.Type == typeOp); 2260Debug.Assert(0 == (exprRes.Flags & EXPRFLAG.EXF_LVALUE)); 2275Debug.Assert(op2 == null || op1.Type == op2.Type); 2276Debug.Assert(op1.Type.IsPredefType(PredefinedType.PT_FLOAT) || op1.Type.IsPredefType(PredefinedType.PT_DOUBLE)); 2307Debug.Assert(op1 != null); 2308Debug.Assert(op2 != null); 2317Debug.Assert(op1 != null); 2332Debug.Assert(pCall != null); 2333Debug.Assert(pCall.MethWithInst.Meth() != null); 2334Debug.Assert(pCall.OptionalArguments != null); 2335Debug.Assert(kind == ExpressionKind.LogicalAnd || kind == ExpressionKind.LogicalOr); 2339Debug.Assert(pCall.MethWithInst.Meth().Params.Count == 2); 2347Debug.Assert(list != null); 2457Debug.Assert(method.typeVars.Count == 0); 2493Debug.Assert(name != null); 2543Debug.Assert(cats == 2); 2572Debug.Assert(pmethBest.ctypeLift == 2); 2620Debug.Assert(Params != paramsRaw); 2621Debug.Assert(paramsRaw[0] == Params[0].BaseOrParameterOrElementType); 2622Debug.Assert(paramsRaw[1] == Params[1].BaseOrParameterOrElementType); 2641Debug.Assert(paramsRaw[0] == paramsRaw[1]); 2642Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2650Debug.Assert(typeRetRaw.IsPredefType(PredefinedType.PT_BOOL)); 2658Debug.Assert(!(ek == ExpressionKind.Eq || ek == ExpressionKind.NotEq) || nonLiftedArg1.Type == nonLiftedArg2.Type); 2682Debug.Assert(argType1.IsEnumType || argType2.IsEnumType); 2689Debug.Assert(type1 == typeEnum || type1 == typeEnum.UnderlyingEnumType); 2690Debug.Assert(type2 == typeEnum || type2 == typeEnum.UnderlyingEnumType); 2699Debug.Assert(type1 == type2); 2703Debug.Assert(type1 != type2); 2712Debug.Assert(ek.IsRelational()); 2725Debug.Assert(methSym != null); 2740Debug.Assert(methSym != null);
Microsoft\CSharp\RuntimeBinder\Semantics\PredefinedMembers.cs (22)
214Debug.Assert(propertyName != null); 215Debug.Assert(propertyGetter >= 0 && propertyGetter < PREDEFMETH.PM_COUNT); 223Debug.Assert(property != null); 233Debug.Assert(signature != null); 253Debug.Assert(current >= 0 && (int)current < (int)PredefinedType.PT_COUNT); 274Debug.Assert(signature != null); 279Debug.Assert(count >= 0); 296Debug.Assert((int)GetMethInfo((PREDEFMETH)i).method == i); 300Debug.Assert((int)GetPropInfo((PREDEFPROP)i).property == i); 308Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 315Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 330Debug.Assert(signature != null); 331Debug.Assert(cMethodTyVars >= 0); 332Debug.Assert(methodName != null); 333Debug.Assert(type != null); 338Debug.Assert(returnType != null); 341Debug.Assert(argumentTypes != null); 394Debug.Assert(result >= 0 && result < PREDEFMETH.PM_COUNT); 412Debug.Assert(property >= 0 && property < PREDEFPROP.PP_COUNT); 413Debug.Assert(s_predefinedProperties[(int)property].property == property); 420Debug.Assert(method >= 0 && method < PREDEFMETH.PM_COUNT); 421Debug.Assert(s_predefinedMethods[(int)method].method == method);
Microsoft\CSharp\RuntimeBinder\Semantics\SemanticChecker.cs (13)
35Debug.Assert(symCheck != null); 36Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 37Debug.Assert(typeThru == null || 51Debug.Assert(atsCheck != null); 71Debug.Assert(atsCheck != null); 85Debug.Assert(type != null); 92Debug.Assert(type is VoidType || type is TypeParameterType); 119Debug.Assert(symCheck != null); 120Debug.Assert(atsCheck == null || symCheck.parent == atsCheck.OwningAggregate); 121Debug.Assert(typeThru == null || 210Debug.Assert(symCheck.GetAccess() == ACCESS.ACC_PROTECTED 228Debug.Assert(agg != aggCheck); // We checked for this above. 256Debug.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 (9)
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 (6)
40Debug.Assert(!_inferenceMustFail); 114Debug.Assert(isPropertyAccessor()); 120Debug.Assert(isPropertyAccessor()); 126Debug.Assert(isEventAccessor()); 132Debug.Assert(isEventAccessor()); 139Debug.Assert(MethKind == MethodKindEnum.ExplicitConv || MethKind == MethodKindEnum.ImplicitConv);
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 (1)
86Debug.Assert(_access != ACCESS.ACC_UNKNOWN);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolLoader.cs (28)
23Debug.Assert(atsDer != null); 24Debug.Assert(pBase != null); 47Debug.Assert(pDerived != null); 48Debug.Assert(pBase != null); 58Debug.Assert(pDerived != null); 59Debug.Assert(pBase != null); 96Debug.Assert(pSource != null); 97Debug.Assert(pDest != null); 108Debug.Assert(pSource != null); 109Debug.Assert(pDest != null); 123Debug.Assert(pSource != null); 124Debug.Assert(pDest != null); 157Debug.Assert(atsDest.TypeArgsAll.Count == 1); 165Debug.Assert(pSource != null); 166Debug.Assert(pDest != null); 167Debug.Assert(!(pSource is TypeParameterType)); 330Debug.Assert(pSource != null && pSource.IsInterfaceType); 331Debug.Assert(pDest != null && pDest.IsInterfaceType); 340Debug.Assert(pSource != null && pSource.IsDelegateType); 341Debug.Assert(pDest != null && pDest.IsDelegateType); 350Debug.Assert(pSource != null); 351Debug.Assert(pDest != null); 367Debug.Assert(pTypeParams.Count == pSourceArgs.Count); 368Debug.Assert(pTypeParams.Count == pDestArgs.Count); 405Debug.Assert(pSource != null); 406Debug.Assert(pDest != null); 407Debug.Assert(!(pSource is TypeParameterType)); 486Debug.Assert(!derived.IsEnum() && !@base.IsEnum());
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymbolStore.cs (3)
28Debug.Assert(child.nextSameName == null); 29Debug.Assert(child.parent == null || child.parent == parent); 54Debug.Assert(sym != null && sym.nextSameName == null);
Microsoft\CSharp\RuntimeBinder\Semantics\Symbols\SymFactory.cs (7)
87Debug.Assert(name != null); 88Debug.Assert(parent != null); 104Debug.Assert(name != null); 108Debug.Assert(sym != null); 128Debug.Assert(sym != null); 136Debug.Assert(sym != null); 172Debug.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\EXPR.cs (2)
34Debug.Assert(!(this is ExprList)); 35Debug.Assert(_type != null);
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)
16Debug.Assert(method != null); 17Debug.Assert(methodType != null); 56Debug.Assert(m.Name == methodInfo.Name && 125Debug.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); 52Debug.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)
18Debug.Assert(expr != null); 33Debug.Assert(assignment != null); 89Debug.Assert(anonmeth != null); 97Debug.Assert(createParameters != null); 98Debug.Assert(anonmeth.Expression != null); 100Debug.Assert(anonmeth.ArgumentScope.nextChild == null); 113Debug.Assert(expr != null); 120Debug.Assert(local != null); 121Debug.Assert(local.Local.wrap != null); 128Debug.Assert(expr != null); 145Debug.Assert(expr != null); 152Debug.Assert(pExpr != null); 186Debug.Assert(expr != null); 206Debug.Assert(expr != null); 220Debug.Assert(pExpr != null); 234Debug.Assert(pExpr != null); 248Debug.Assert(expr != null); 305Debug.Assert(!expr.MethWithInst.Meth().isVirtual || expr.MemberGroup.OptionalObject != null); 313Debug.Assert(expr != null); 337Debug.Assert(expr != null); 348Debug.Assert(expr != null); 355Debug.Assert(expr != null); 362Debug.Assert(expr != null); 364Debug.Assert(memberGroup.IsDelegate); 366Debug.Assert(oldObject != null); 376Debug.Assert(expr != null); 405Debug.Assert(origL != null); 406Debug.Assert(origR != null); 420Debug.Assert(expr.IsLifted); 427Debug.Assert(expr.IsLifted); 434Debug.Assert(expr.IsLifted); 441Debug.Assert(expr.IsLifted); 477Debug.Assert(expr != null); 494Debug.Assert(!(origOp.Type is NullableType nub) || !nub.UnderlyingType.IsEnumType); 501Debug.Assert(expr != null); 545Debug.Assert(udcall.Kind == ExpressionKind.Call || udcall.Kind == ExpressionKind.UserLogicalOp); 549Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 556Debug.Assert(userLogOp != null); 558Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 581Debug.Assert(expr != null); 592Debug.Assert(arg != null && arg.Kind != ExpressionKind.List); 632Debug.Assert(expr != null); 654Debug.Assert(args.OptionalNextListNode.Kind != ExpressionKind.List); 682Debug.Assert(pArgument != null); 775Debug.Assert(pUDConversion is ExprUserDefinedConversion); 813Debug.Assert(anonmeth.Expression != null); 833Debug.Assert(expr != null); 834Debug.Assert(expr.MethWithInst.Meth().IsConstructor()); 976Debug.Assert(expr != null); 977Debug.Assert(pp1 != null); 978Debug.Assert(pp1 != null); 979Debug.Assert(pp2 != null); 980Debug.Assert(pp2 != null); 984Debug.Assert(orig1 != null && orig2 != null); 1022Debug.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 (11)
79Debug.Assert(typeVars.Count == typeArgsThis.Count); 125Debug.Assert(mwi.Meth() != null && mwi.GetType() != null && mwi.TypeArgs != null); 126Debug.Assert(mwi.Meth().typeVars.Count == mwi.TypeArgs.Count); 127Debug.Assert(mwi.GetType().OwningAggregate == mwi.Meth().getClass()); 142Debug.Assert(typeVars.Count == typeArgs.Count); 143Debug.Assert(typeVars.Count > 0); 144Debug.Assert(flags == CheckConstraintsFlags.None || flags == CheckConstraintsFlags.NoErrors); 164Debug.Assert(!(arg is PointerType)); 165Debug.Assert(!arg.IsStaticClass); 253Debug.Assert(typeBnd.IsInterfaceType); 334Debug.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\PredefinedTypes.cs (1)
187Debug.Assert(s_types[i].Type == (PredefinedType)i);
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeArray.cs (3)
88Debug.Assert(types != null); 101Debug.Assert(Count >= 0); 102Debug.Assert(Array.TrueForAll(Items, item => item != null));
Microsoft\CSharp\RuntimeBinder\Semantics\Types\TypeManager.cs (40)
45Debug.Assert(iv >= 0); 62Debug.Assert(tpt != null); 69Debug.Assert(args > 0 && args < 32767); 70Debug.Assert(args == 1 || !isSZArray); 83Debug.Assert(pArray.Rank == args); 84Debug.Assert(pArray.ElementType == elementType); 95Debug.Assert(agg.GetTypeVars().Count == typeArgs.Count); 101Debug.Assert(!pAggregate.ConstraintError.HasValue); 106Debug.Assert(pAggregate.OwningAggregate == agg); 107Debug.Assert(pAggregate.TypeArgsThis != null && pAggregate.TypeArgsAll != null); 108Debug.Assert(pAggregate.TypeArgsThis == typeArgs); 115Debug.Assert(typeArgsAll != null && typeArgsAll.Count == agg.GetTypeVarsAll().Count); 126Debug.Assert(cvarOuter <= typeArgsAll.Count); 145Debug.Assert(pPointer.ReferentType == baseType); 174Debug.Assert(pParamModifier.ParameterType == paramType); 184Debug.Assert(typeSrc != null); 191Debug.Assert(typeSrc != null); 298Debug.Assert(tvs.GetIndexInOwnParameters() == tvs.GetIndexInTotalParameters()); 301Debug.Assert(pctx.MethodTypes != null); 317Debug.Assert(typeDst.Equals(SubstType(typeSrc, typeArgsCls, typeArgsMeth, denormMeth))); 378Debug.Assert(typeDst.TypeKind != typeSrc.TypeKind); 413Debug.Assert(atsSrc.TypeArgsAll.Count == atsDst.TypeArgsAll.Count); 434Debug.Assert(typeDst != typeSrc); 438Debug.Assert(tvs.GetIndexInOwnParameters() == index); 439Debug.Assert(tvs.GetIndexInTotalParameters() < pctx.MethodTypes.Length); 447Debug.Assert(index < pctx.ClassTypes.Length); 474Debug.Assert(typeFind.TypeKind != type.TypeKind); 578Debug.Assert(pSymbol.GetTypeParameterType() == null); // Should have been checked first before creating 595Debug.Assert(typeSrc != null); 596Debug.Assert(!(typeSrc is ParameterModifierType)); 597Debug.Assert(!(typeSrc is PointerType)); 606Debug.Assert(!(typeSrc is VoidType) && !(typeSrc is TypeParameterType)); 617Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 648Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 657Debug.Assert(typeSrc is NullableType); 666Debug.Assert(typeSrc != null); 667Debug.Assert(typeSrc.IsInterfaceType || typeSrc.IsDelegateType); 720Debug.Assert(CSemanticChecker.CheckTypeAccess(typeDst, context)); 727Debug.Assert(typeSrc != null); 740Debug.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 (5)
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); 61Debug.Assert(pt != PredefinedType.PT_UNDEFINEDINDEX); 72Debug.Assert((_grflt & LiftFlags.Lift2) == 0); 73Debug.Assert((_grflt & LiftFlags.Convert2) == 0); 79Debug.Assert(((_grflt & LiftFlags.Lift1) == 0) || ((_grflt & LiftFlags.Convert1) == 0));
Microsoft\CSharp\RuntimeBinder\Semantics\WithType.cs (2)
131Debug.Assert(ats == null || sym.parent == ats.OwningAggregate); 225Debug.Assert(ats == null || mps != null && mps.getClass() == ats.OwningAggregate);
Microsoft\CSharp\RuntimeBinder\SymbolTable.cs (25)
140Debug.Assert(!s_namesLoadedForEachType.Contains(key)); 210Debug.Assert(addedField == null); 407Debug.Assert(t1.IsGenericParameter && t2.IsGenericParameter); 457Debug.Assert(t.IsGenericParameter); 524Debug.Assert((agg != null && bIsAggregate) || (meth != null && !bIsAggregate)); 611Debug.Assert(!(ctype is AggregateType)); 629Debug.Assert(i + 1 < declarationChain.Count); 634Debug.Assert(o is string); 657Debug.Assert(meth != null); 694Debug.Assert(agg != null); 755Debug.Assert(!bAdded); 759Debug.Assert(bAdded); 811Debug.Assert(types != null); 823Debug.Assert(t != null); 916Debug.Assert(type.IsPublic || type.IsNestedPublic); 1058Debug.Assert(fieldInfo.IsFamilyAndAssembly); 1083Debug.Assert(ev.AssociatedEventInfo == eventInfo); 1108Debug.Assert(ev.methAdd != null || ev.methRemove != null); 1339Debug.Assert(method != null || member is ConstructorInfo); 1397Debug.Assert(member.IsFamilyAndAssembly); 1511Debug.Assert(Type.GetTypeCode(defValue.GetType()) != TypeCode.Decimal); // Handled above 1697Debug.Assert(baseMethod != null); 1710Debug.Assert(t is AggregateType); 1712Debug.Assert(aggregate != null); 1787Debug.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);
Microsoft.Data.Analysis (31)
DataFrame.cs (1)
688Debug.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);
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 (1)
306Debug.Assert(_columnContainer.NullCount >= 0);
Utils\BitUtility.cs (1)
151Debug.Assert(span.Length >= endByteIndex);
Microsoft.DotNet.ArcadeLogging (4)
MessageBuilder.cs (4)
27Debug.Assert(_state == State.NotStarted || _state == State.Finished); 35Debug.Assert(_state == State.Properties); 46Debug.Assert(_state == State.Properties); 58Debug.Assert(_state == State.Finished);
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Vsix\GetPkgDefAssemblyDependencyGuid.cs (1)
63Debug.Assert(reducedHash.Length == targetBlockSize);
Microsoft.DotNet.Internal.SymbolHelper (4)
SymbolUploadHelper.cs (4)
63Debug.Assert(logger is not null); 64Debug.Assert(options is not null); 65Debug.Assert(!string.IsNullOrEmpty(symbolToolPath) && (File.Exists(symbolToolPath) || options.IsDryRun)); 281Debug.Assert(entry.Length == 0);
Microsoft.DotNet.NuGetRepack.Tests (2)
TestHelpers\DiffUtil.cs (2)
198Debug.Assert(lengthA >= 0 && lengthB >= 0); 212Debug.Assert(lcsLength <= max);
Microsoft.DotNet.Open.Api.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.DotNet.SignTool (22)
src\BatchSignInput.cs (3)
35Debug.Assert(!filesToSign.IsDefault); 36Debug.Assert(zipDataMap != null); 37Debug.Assert(!filesToCopy.IsDefault);
src\ByteSequenceComparer.cs (2)
68Debug.Assert(x != null); 74Debug.Assert(!x.IsDefault);
src\Configuration.cs (8)
119Debug.Assert(tempDir != null); 120Debug.Assert(itemsToSign != null && !itemsToSign.Any(i => i == null)); 121Debug.Assert(strongNameInfo != null); 122Debug.Assert(fileSignInfo != null); 216Debug.Assert(!isNested); 323Debug.Assert(parentContainer.FullPath != file.FullPath); 731Debug.Assert(Path.GetExtension(archivePath) == ".zip"); 735Debug.Assert(zipFileSignInfo.IsUnpackableContainer());
src\ExplicitCertificateKey.cs (1)
18Debug.Assert(fileName != null);
src\FileSignInfo.cs (3)
133Debug.Assert(pathWithHash.FullPath != null); 134Debug.Assert(!pathWithHash.ContentHash.IsDefault && pathWithHash.ContentHash.Length == 256 / 8); 135Debug.Assert(targetFramework != "");
src\PathWithHash.cs (2)
33Debug.Assert(!contentHash.IsDefault); 34Debug.Assert(fullPath != null);
src\SignedFileContentKey.cs (2)
34Debug.Assert(!contentHash.IsDefault); 35Debug.Assert(fileName != null);
src\StrongName.cs (1)
422Debug.Assert(segment.Count > 0);
Microsoft.DotNet.SignTool.Tests (1)
StreamUtilities.cs (1)
29Debug.Assert(count > 0);
Microsoft.DotNet.XliffTasks (1)
Release.cs (1)
13Debug.Assert(condition);
Microsoft.DotNet.XUnitExtensions (2)
DiscovererHelpers.cs (1)
67Debug.Assert(ctorArgs.Count() >= 2);
Discoverers\ConditionalClassDiscoverer.cs (1)
39Debug.Assert(conditionArguments.Count() == 2);
Microsoft.Extensions.AI.OpenAI (15)
src\Shared\ServerSentEvents\ArrayBuffer.cs (9)
41Debug.Assert(initialSize > 0 || usePool); 53Debug.Assert(buffer.Length > 0); 78Debug.Assert(_usePool); 79Debug.Assert(_bytes is not null); 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 (2)
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);
Microsoft.Extensions.ApiDescription.Client.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.ApiDescription.Tool.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.Caching.Memory (2)
CacheEntry.CacheEntryTokens.cs (1)
116Debug.Assert(entry._tokens != null);
MemoryCache.cs (1)
452Debug.Assert(entry.Key == priorEntry.Key);
Microsoft.Extensions.Caching.StackExchangeRedis (8)
RedisCache.cs (8)
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); 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)
443Debug.Assert(bindingPoint.Value is not null); 478Debug.Assert(section is not null); 677Debug.Assert(source is not null); 678Debug.Assert(addMethod is not null); 699Debug.Assert(dictionaryType.IsGenericType && 895Debug.Assert(source is not null); 896Debug.Assert(addMethod is not null);
Microsoft.Extensions.Configuration.Json (1)
JsonConfigurationFileParser.cs (1)
83Debug.Assert(_paths.Count > 0);
Microsoft.Extensions.DependencyInjection (8)
ServiceLookup\CallSiteFactory.cs (7)
72Debug.Assert(implementationType != null); 105Debug.Assert(serviceTypeGenericArguments.Length == implementationTypeGenericArguments.Length); 301Debug.Assert(callSite != null); 554Debug.Assert(parameterCallSites != null); 731Debug.Assert(_item != null); 742Debug.Assert(_items == null); 792Debug.Assert(_items == null);
ServiceProvider.cs (1)
182System.Diagnostics.Debug.Assert(result is null || CallSiteFactory.IsService(serviceIdentifier));
Microsoft.Extensions.DependencyInjection.Abstractions (10)
ActivatorUtilities.cs (8)
133Debug.Assert(!constructor.IsPreferred); 596Debug.Assert(false); 626Debug.Assert(parameterMap != null); 679Debug.Assert(parameterMap != null); 932Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 933Debug.Assert(FixedArgumentThreshold == 4); 991Debug.Assert(parameters.Length >= 1 && parameters.Length <= FixedArgumentThreshold); 992Debug.Assert(FixedArgumentThreshold == 4);
ServiceDescriptor.cs (2)
302Debug.Assert(typeArguments.Length == 2); 321Debug.Assert(typeArguments.Length == 3);
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 (7)
Metrics\DebugConsoleMetricListener.cs (2)
44Debug.Assert(userState == this); 63Debug.Assert(state == this);
Metrics\DefaultMeterFactory.cs (1)
31Debug.Assert(options.Name is not null);
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);
Microsoft.Extensions.FileProviders.Embedded (1)
Manifest\EmbeddedFilesManifest.cs (1)
65Debug.Assert(path.Length > 0);
Microsoft.Extensions.FileProviders.Physical (5)
Internal\FileSystemInfoHelper.cs (1)
51Debug.Assert(fileInfo.Exists);
PhysicalFileProvider.cs (1)
153Debug.Assert(!_fileWatcherInitialized);
PhysicalFilesWatcher.cs (1)
470Debug.Assert(state != null);
PollingWildCardChangeToken.cs (2)
165Debug.Assert(previousHash.Length == currentHash.Length); 181Debug.Assert(_byteBuffer.Length > sizeof(long));
Microsoft.Extensions.Hosting (2)
Internal\ConsoleLifetime.netcoreapp.cs (1)
29Debug.Assert(context.Signal == PosixSignal.SIGINT || context.Signal == PosixSignal.SIGQUIT || context.Signal == PosixSignal.SIGTERM);
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 (5)
ActiveHandlerTrackingEntry.cs (3)
61Debug.Assert(Lifetime != Timeout.InfiniteTimeSpan); 78Debug.Assert(_callback != null); 79Debug.Assert(_timer != null);
DependencyInjection\DefaultHttpClientBuilder.cs (1)
15Debug.Assert(tracker != null);
DependencyInjection\HttpClientBuilderExtensions.cs (1)
789Debug.Assert(registry != null);
Microsoft.Extensions.Identity.Core (2)
DefaultPersonalDataProtector.cs (1)
36Debug.Assert(data != null);
Rfc6238AuthenticationService.cs (1)
61Debug.Assert(offset + 4 < hash.Length);
Microsoft.Extensions.Logging (4)
LoggerFactoryScopeProvider.cs (2)
139Debug.Assert(activity != null); 140Debug.Assert(activityTrackingOption != ActivityTrackingOptions.None);
LoggerInformation.cs (1)
67Debug.Assert(Logger != null);
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Abstractions (5)
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
Microsoft.Extensions.Logging.AzureAppServices (1)
BlobLoggerProvider.cs (1)
81System.Diagnostics.Debug.Assert(tryGetBuffer);
Microsoft.Extensions.Logging.Configuration (1)
src\libraries\Common\src\Extensions\ProviderAliasUtilities\ProviderAliasUtilities.cs (1)
27Debug.Assert(arg.ArgumentType == typeof(string));
Microsoft.Extensions.Logging.Console (16)
ConsoleLoggerProcessor.cs (2)
122Debug.Assert(FullMode == ConsoleLoggerQueueFullMode.Wait); 128Debug.Assert(_messageQueue.Count < MaxQueueLength);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
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);
Microsoft.Extensions.Logging.EventSource (17)
LoggingEventSource.cs (17)
146Debug.Assert(LoggerName != null); 147Debug.Assert(ActivityTraceId != null); 148Debug.Assert(ActivitySpanId != null); 149Debug.Assert(ActivityTraceFlags != null); 198Debug.Assert(LoggerName != null); 199Debug.Assert(Exception != null); 200Debug.Assert(ActivityTraceId != null); 201Debug.Assert(ActivitySpanId != null); 202Debug.Assert(ActivityTraceFlags != null); 263Debug.Assert(LoggerName != null); 264Debug.Assert(ExceptionJson != null); 265Debug.Assert(ArgumentsJson != null); 266Debug.Assert(ActivityTraceId != null); 267Debug.Assert(ActivitySpanId != null); 268Debug.Assert(ActivityTraceFlags != null); 558Debug.Assert(str != null); 562Debug.Assert(pinnedString == rePinnedString);
Microsoft.Extensions.Logging.Generators (1)
LoggerMessageGenerator.Parser.cs (1)
798Debug.Assert(searchedBrace is '{' or '}');
Microsoft.Extensions.Options.DataAnnotations (2)
DataAnnotationValidateOptions.cs (2)
67Debug.Assert(errors is not null && errors.Count > 0); 76Debug.Assert(options is not null);
Microsoft.Extensions.Primitives (4)
CompositeChangeToken.cs (2)
124Debug.Assert(state != null); 149Debug.Assert(disposables != null);
StringSegment.cs (1)
108Debug.Assert(Buffer is not null);
StringValues.cs (1)
192Debug.Assert(value is string[]);
Microsoft.Extensions.SecretManager.Tools.Tests (1)
src\Tools\Shared\TestHelpers\TemporaryCSharpProject.cs (1)
47Debug.Assert(tfms.Length > 0);
Microsoft.Extensions.ServiceDiscovery (4)
Http\HttpServiceEndpointResolver.cs (1)
258Debug.Assert(_onDisposed is not null);
ServiceEndpointResolver.cs (1)
250Debug.Assert(_onDisposed is not null);
ServiceEndpointWatcher.cs (2)
186Debug.Assert(error is null || newCacheState is CacheStatus.Invalid); 213Debug.Assert(newEndpoints is not null);
Microsoft.Interop.ComInterfaceGenerator (10)
ComInterfaceContext.cs (1)
78Debug.Assert(baseContext.HasValue);
ComMethodInfo.cs (1)
89Debug.Assert(method is { IsStatic: false, MethodKind: MethodKind.Ordinary });
GeneratedComInterfaceAttributeData.cs (2)
56Debug.Assert(found); 62Debug.Assert(attr.AttributeClass.ToDisplayString() == TypeNames.GeneratedComInterfaceAttribute);
Marshallers\ManagedHResultExceptionGeneratorResolver.cs (2)
40Debug.Assert(info.MarshallingAttributeInfo is ManagedHResultExceptionMarshallingInfo); 68Debug.Assert(info.MarshallingAttributeInfo is ManagedHResultExceptionMarshallingInfo);
Marshallers\ObjectUnwrapperResolver.cs (1)
36Debug.Assert(info.MarshallingAttributeInfo is ObjectUnwrapperInfo);
UnmanagedToManagedStubGenerator.cs (1)
56Debug.Assert(statements.CleanupCalleeAllocated.IsEmpty);
VirtualMethodPointerStubGenerator.cs (1)
86Debug.Assert(methodStub.TypeKeyOwner.Syntax is NameSyntax);
VtableIndexStubGenerator.cs (1)
231Debug.Assert(virtualMethodIndexAttr is not null);
Microsoft.Interop.JavaScript.JSImportGenerator (3)
JSExportGenerator.cs (1)
187Debug.Assert(jsExportAttr is not null);
JSGeneratorFactory.cs (1)
18Debug.Assert(context != null);
JSImportGenerator.cs (1)
167Debug.Assert(jsImportAttr is not null);
Microsoft.Interop.LibraryImportGenerator (2)
LibraryImportGenerator.cs (2)
267Debug.Assert(generatedDllImportAttr is not null); 499Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
DownlevelLibraryImportGenerator.cs (2)
190Debug.Assert(generatedDllImportAttr is not null); 374Debug.Assert(target.StringMarshalling == StringMarshalling.Utf16);
Microsoft.Interop.SourceGeneration (12)
BoundGenerators.cs (3)
39Debug.Assert(managedExceptionInfo == null); 51Debug.Assert(managedReturnMarshaller == defaultBoundGenerator); 56Debug.Assert(nativeReturnMarshaller == defaultBoundGenerator);
DiagnosticOr.cs (3)
99Debug.Assert(value is not null); 108Debug.Assert(value is not null); 109Debug.Assert(diagnostics is not null);
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)
91Debug.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);
NativeMarshallingAttributeParser.cs (1)
24Debug.Assert(attributeData.AttributeClass!.ToDisplayString() == TypeNames.NativeMarshallingAttribute);
Microsoft.JSInterop (3)
Infrastructure\DotNetDispatcher.cs (1)
227Debug.Assert(count == receivedBytes);
JSRuntime.cs (1)
317Debug.Assert(dotNetObjectReference.ObjectId != 0);
src\Components\Shared\src\ArrayBuilder.cs (1)
180Debug.Assert(newCapacity > _items.Length);
Microsoft.JSInterop.Tests (2)
JSRuntimeTest.cs (2)
148Debug.Assert(poco != null); 173Debug.Assert(poco != null);
Microsoft.Maui (2)
Hosting\ImageSources\ImageSourceToImageSourceServiceTypeMapping.cs (1)
34 Debug.Assert(typeof(IImageSource).IsAssignableFrom(type));
Hosting\Internal\RegisteredHandlerServiceTypeSet.cs (1)
32 Debug.Assert(typeof(IElement).IsAssignableFrom(type));
Microsoft.Maui.Controls (4)
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.Xaml (5)
XamlParser.cs (5)
54 Debug.Assert(reader.NodeType == XmlNodeType.Element); 67 Debug.Assert(reader.Name == elementName); //make sure we close the right element 139 Debug.Assert(reader.NodeType == XmlNodeType.Element); 151 Debug.Assert(reader.Name == name); 206 Debug.Assert(reader.NodeType == XmlNodeType.Element);
Microsoft.Maui.Graphics (1)
Color.cs (1)
757 Debug.Assert(charsWritten == value.Length);
Microsoft.ML.AutoML.Samples (1)
Sweepable\SearchSpaceExample.cs (1)
37Debug.Assert(myParameterSearchSpace.GetHashCode() == myParameterSearchSpace2.GetHashCode());
Microsoft.ML.Core (8)
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);
Microsoft.ML.Data (1)
Utilities\StreamUtils.cs (1)
213Debug.Assert(minimumBytes <= buffer.Length);
Microsoft.ML.DataView (46)
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));
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); 219Debug.Assert(_image.Info.BitsPerPixel == 32); 275Debug.Assert(_image.Info.ColorType != SKColorType.Bgra8888 && _image.Info.ColorType != SKColorType.Rgba8888);
Microsoft.ML.InternalCodeAnalyzer (3)
ContractsCheckNameofFixProvider.cs (1)
50Debug.Assert(nameArg.Parent.Parent.IsKind(SyntaxKind.InvocationExpression));
INamedTypeSymbolExtensions.cs (1)
23Debug.Assert(factAttribute is object);
NameFixProvider.cs (1)
94Debug.Assert(!Enum.IsDefined(typeof(NameType), desiredName));
Microsoft.ML.Tokenizers (65)
Model\BertTokenizer.cs (1)
32Debug.Assert(options is not null);
Model\CodeGenTokenizer.cs (3)
475Debug.Assert(mappingBuffer is not null); 1159Debug.Assert(mappingBuffer is not null); 1223Debug.Assert(mappingBuffer is not null);
Model\EnglishRobertaTokenizer.cs (5)
917Debug.Assert(index + tokens[i].Value.Length <= indexMapping.Length); 959Debug.Assert(token[0] < charToString.Length); 967Debug.Assert(c < charToString.Length); 1150Debug.Assert(rank < _symbols.Count); 1248Debug.Assert(stream is not null);
Model\SentencePieceTokenizer.cs (19)
272Debug.Assert(_specialTokensRegex is not null); 595Debug.Assert(_specialTokensRegex is not null); 596Debug.Assert(maxTokens > 0); 929Debug.Assert(_specialTokensRegex is not null); 930Debug.Assert(maxTokens > 0); 1290Debug.Assert(_specialTokensRegex is not null); 1291Debug.Assert(maxTokens > 0); 1292Debug.Assert(text.Length > 0); 1619Debug.Assert(bytesPoolArray is not null); 1658Debug.Assert(sb[suffixIndex] == SentencePieceNormalizer.DummyPrefix); 1659Debug.Assert(sb.Length > suffixIndex); 1678Debug.Assert(bytesCount >= 1); 1679Debug.Assert(bytesPoolArray is not null); 1902Debug.Assert(bytesPoolArray is not null); 1961Debug.Assert(destination[suffixIndex] == ' '); 2020Debug.Assert(bytesCount >= 1); 2021Debug.Assert(bytesPoolArray is not null); 2174Debug.Assert(text.Length > 0); 2175Debug.Assert(symbols.Length >= text.Length);
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 (2)
198Debug.Assert(bufferIndex < span.Length - 1); 231Debug.Assert(bufferIndex < span.Length);
Normalizer\UpperCaseNormalizer.cs (1)
48Debug.Assert(length == original.Length);
Utils\Helpers.cs (7)
24Debug.Assert(!text.IsEmpty); 25Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 26Debug.Assert(indexMapping.Length >= destination.Length); 78Debug.Assert(!text.IsEmpty); 79Debug.Assert(Encoding.UTF8.GetMaxByteCount(text.Length) <= destination.Length); 80Debug.Assert(indexMapping.Length >= destination.Length); 133Debug.Assert(utf16Chars.Length >= Encoding.UTF8.GetMaxCharCount(utf8Bytes.Length));
Utils\Helpers.netstandard.cs (1)
126Debug.Assert(textIndex < text.Length);
Utils\ValueStringBuilder.cs (5)
40Debug.Assert(value >= 0); 41Debug.Assert(value <= _chars.Length); 51Debug.Assert(capacity >= 0); 87Debug.Assert(index < _pos); 394Debug.Assert(additionalCapacityBeyondPos > 0);
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.Net.Http.Headers (1)
SetCookieHeaderValue.cs (1)
269Debug.Assert(formatted);
Microsoft.VisualBasic.Core (48)
Microsoft\VisualBasic\Collection.vb (6)
78Debug.Assert(BeforeNode IsNot Nothing) 93Debug.Assert(AfterNode IsNot Nothing) 156Debug.Assert(node IsNot Nothing) 170Debug.Assert(node Is Nothing) 213Debug.Assert(node IsNot Nothing) 337Debug.Assert(CultureInfo IsNot Nothing)
Microsoft\VisualBasic\CompilerServices\LateBinding.vb (2)
293Debug.Assert(OperatingSystem.IsWindows()) 851Debug.Assert(False)
Microsoft\VisualBasic\CompilerServices\Operators.vb (12)
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 (1)
1348Debug.Assert(parameter IsNot Nothing AndAlso parameterType IsNot Nothing)
Microsoft\VisualBasic\CompilerServices\Symbols.vb (1)
1393Debug.Assert(rawMethod IsNot Nothing)
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 (1)
1060Diagnostics.Debug.Assert(AmbiguousCount > 0)
Microsoft\VisualBasic\FileIO\FileSystem.vb (3)
1313Debug.Assert(ByteCount <= ByteBuffer.Length) 1600Debug.Assert([Enum].IsDefined(Operation)) 1601Debug.Assert([Enum].IsDefined(TargetType))
Microsoft\VisualBasic\Helpers\ForEachEnum.vb (2)
69Debug.Assert(Not mAtBeginning) 80Debug.Assert(mNext Is Nothing)
Microsoft.VisualStudio.IntegrationTest.Setup (1)
TestExtensionManager.cs (1)
26Debug.Assert(exception is not OperationCanceledException);
Microsoft.VisualStudio.LanguageServices (85)
ChangeSignature\ChangeSignatureDialog.xaml.cs (1)
196Debug.Assert(addParameterViewModel.IsCallsiteRegularValue);
ChangeSignature\ChangeSignatureDialogViewModel.cs (2)
448Debug.Assert(CanMoveUp); 457Debug.Assert(CanMoveDown);
CodeMarkers\ManagedCodeMarkers.cs (2)
509Debug.Assert(end != default(int)); 536Debug.Assert(end != default(int));
ColorSchemes\ColorSchemeApplier.ColorScheme.cs (2)
71Debug.Assert(backgroundType == __VSCOLORTYPE.CT_INVALID || background.HasValue); 75Debug.Assert(foregroundType == __VSCOLORTYPE.CT_INVALID || foreground.HasValue);
DebuggerIntelliSense\DebuggerIntellisenseFilter.cs (1)
166Debug.Assert(_context == null);
DocumentOutline\DocumentOutlineViewModel.cs (1)
145Debug.Assert(_isNavigating_doNotAccessDirectly != value);
FindReferences\Contexts\AbstractTableDataSourceFindUsagesContext.cs (4)
143Debug.Assert(_findReferencesWindow.Manager.Sources.Count == 0); 335Debug.Assert(_tableDataSink == null); 653Debug.Assert(_findReferencesWindow.Manager.Sources.Count == 1); 654Debug.Assert(_findReferencesWindow.Manager.Sources[0] == this);
FindReferences\Contexts\WithReferencesFindUsagesContext.cs (1)
148Debug.Assert(addToEntriesWhenGroupingByDefinition || addToEntriesWhenNotGroupingByDefinition);
GenerateType\GenerateTypeDialogViewModel.cs (2)
205Debug.Assert(_generateTypeDialogOptions.TypeKindOptions != TypeKindOptions.None); 428Debug.Assert(this.AccessSelectIndex != -1);
Interactive\VsInteractiveWindowProvider.cs (2)
78Debug.Assert(_vsInteractiveWindow == null); 123Debug.Assert(instanceId == 0);
Interactive\VsResetInteractive.cs (3)
125Debug.Assert(!string.IsNullOrEmpty(projectDir)); 126Debug.Assert(!string.IsNullOrEmpty(outputFileName)); 127Debug.Assert(!string.IsNullOrEmpty(relativeOutputPath));
Interop\WeakComHandle.cs (1)
148Debug.Assert(_managedObjectWeakReference != null);
LanguageService\AbstractLanguageService`2.cs (1)
146Debug.Assert(!wpfTextView.Properties.ContainsProperty(typeof(AbstractVsTextViewFilter)));
LanguageService\AbstractLanguageService`2.IVsImmediateStatementCompletion2.cs (6)
128Debug.Assert(false); 135Debug.Assert(false); 142Debug.Assert(false); 148Debug.Assert(false); 154Debug.Assert(false); 160Debug.Assert(false);
Library\ObjectBrowser\AbstractListItemFactory.cs (23)
231Debug.Assert(parentListItem != null); 232Debug.Assert(parentListItem is TypeListItem); 233Debug.Assert(compilation != null); 247Debug.Assert(parentListItem != null); 248Debug.Assert(parentListItem is TypeListItem or 250Debug.Assert(compilation != null); 391Debug.Assert(parentListItem != null); 392Debug.Assert(parentListItem is TypeListItem); 393Debug.Assert(compilation != null); 407Debug.Assert(assemblySymbol != null); 440Debug.Assert(parentListItem != null); 441Debug.Assert(parentListItem is ProjectListItem or 443Debug.Assert(compilation != null); 640Debug.Assert(parentListItem != null); 641Debug.Assert(parentListItem is ProjectListItem); 642Debug.Assert(compilation != null); 720Debug.Assert(parentListItem != null); 721Debug.Assert(parentListItem is NamespaceListItem or 724Debug.Assert(compilation != null); 745Debug.Assert(assemblySymbol != null); 746Debug.Assert(compilation != null); 777Debug.Assert(assemblySymbol != null); 778Debug.Assert(compilation != null);
Library\ObjectBrowser\AbstractObjectBrowserLibraryManager.cs (1)
318Debug.Assert(listKind == ObjectListKind.Projects);
Library\ObjectBrowser\ObjectList.cs (1)
858Debug.Assert(data.type == VSCOMPONENTTYPE.VSCOMPONENTTYPE_Project);
Library\ObjectBrowser\ObjectListItem.cs (1)
36Debug.Assert(ParentList == null);
Options\VisualStudioOptionStorage.cs (1)
42Debug.Assert(!vbKey.Contains(LanguagePlaceholder));
Preview\TopLevelChange.cs (3)
118Debug.Assert(oldDocument != null || updatedDocumentIdOpt != null); 119Debug.Assert((updatedDocumentIdOpt != null) == (updateDocumentTextOpt != null)); 175Debug.Assert(oldDocument.Id == updatedDocumentIdOpt);
PreviewPane\PreviewPane.xaml.cs (1)
104Debug.Assert(_registerPriorityCommandTarget != null);
ProjectSystem\Extensions\ProjectExtensions.cs (1)
20Debug.Assert(containers.Any());
ProjectSystem\MetadataReferences\VisualStudioPortableExecutableReference.cs (1)
46Debug.Assert(Properties.Kind == MetadataImageKind.Assembly);
ProjectSystem\VisualStudioWorkspaceImpl.OpenFileTracker.cs (1)
175Debug.Assert(workspace.CurrentSolution.ContainsAnalyzerConfigDocument(documentId));
Remote\VisualStudioRemoteHostClientProvider.cs (1)
63Debug.Assert(workspaceServices.Workspace is VisualStudioWorkspace or PreviewWorkspace);
Snippets\SnippetExpansionClient.cs (8)
486Debug.Assert(TextView.IsClosed); 516Debug.Assert(_state.IsFullMethodCallSnippet); 524Debug.Assert(!_state.IsFullMethodCallSnippet); 560Debug.Assert(_state._expansionSession != null); 562Debug.Assert(_state._method == null); 819Debug.Assert(TextView.IsClosed); 928Debug.Assert(_state._expansionSession != null); 998Debug.Assert(TextView.IsClosed);
src\Compilers\Core\Portable\FileKey.cs (1)
31Debug.Assert(timestamp.Kind == DateTimeKind.Utc);
src\Compilers\Core\Portable\InternalUtilities\ConcurrentLruCache.cs (1)
102Debug.Assert(_capacity > 0);
StackTraceExplorer\StackFrameViewModel.cs (1)
164Debug.Assert(GetTrailingTrivia(className).IsEmpty);
StackTraceExplorer\StackTraceExplorerToolWindow.cs (1)
156Debug.Assert(result == S_OK);
TaskList\ExternalErrorDiagnosticUpdateSource.cs (1)
144Debug.Assert(diagnostics.All(d => d.IsBuildDiagnostic()));
TaskList\ProjectExternalErrorReporter.cs (3)
50Debug.Assert(projectId != null); 51Debug.Assert(errorCodePrefix != null); 52Debug.Assert(workspace != null);
Utilities\VisualStudioCommandHandlerHelpers.cs (1)
53Debug.Assert(hierarchy != null);
Utilities\VsCodeWindowViewTracker.cs (1)
138Debug.Assert(_trackedTextViews.Count == 0);
Venus\ContainedDocument.cs (2)
770Debug.Assert(ReferenceEquals(parsedDocument.Text, subjectBuffer.CurrentSnapshot.AsText())); 1019Debug.Assert(_hostType == HostType.Razor);
Workspace\GlobalUndoServiceFactory.WorkspaceGlobalUndoTransaction.cs (1)
136Debug.Assert(!_transactionAlive);
Microsoft.VisualStudio.LanguageServices.CSharp (60)
CodeModel\CSharpCodeModelService.CodeModelEventCollector.cs (12)
79Debug.Assert(oldAttribute != null && newAttribute != null); 207Debug.Assert(oldParameter != null && newParameter != null); 234Debug.Assert(oldMember != null && newMember != null); 276Debug.Assert(oldEnumMember != null && newEnumMember != null); 303Debug.Assert(oldProperty != null && newProperty != null); 356Debug.Assert(oldVariableDeclarator != null && newVariableDeclarator != null); 373Debug.Assert(oldField != null && newField != null); 415Debug.Assert(oldMethod != null && newMethod != null); 477Debug.Assert(oldNamespace != null && newNamespace != null); 514Debug.Assert(oldMember != null && newMember != null); 515Debug.Assert(oldMember is BaseTypeDeclarationSyntax or DelegateDeclarationSyntax); 516Debug.Assert(newMember is BaseTypeDeclarationSyntax or DelegateDeclarationSyntax);
CodeModel\CSharpCodeModelService.cs (38)
1271Debug.Assert(node is MemberDeclarationSyntax); 1345Debug.Assert(node is MemberDeclarationSyntax); 1392Debug.Assert(node is MemberDeclarationSyntax); 1513Debug.Assert(parentNode is BasePropertyDeclarationSyntax); 1604Debug.Assert(attributeNode is AttributeSyntax); 1638Debug.Assert(attributeNode is AttributeSyntax); 1659Debug.Assert(attributeArgumentNode is AttributeArgumentSyntax); 1670Debug.Assert(attributeNode is AttributeSyntax); 1678Debug.Assert(attributeNode is AttributeSyntax); 1692Debug.Assert(attributeNode is AttributeListSyntax); 1709Debug.Assert(attributeNode is AttributeSyntax); 1723Debug.Assert(attributeNode is AttributeSyntax); 1812Debug.Assert(attributeArgumentNode is AttributeArgumentSyntax); 2009Debug.Assert(memberNode is MemberDeclarationSyntax); 2028Debug.Assert(memberNode is MemberDeclarationSyntax); 2061Debug.Assert(typeNode is ClassDeclarationSyntax); 2073Debug.Assert(typeNode is ClassDeclarationSyntax); 2124Debug.Assert(variableNode is FieldDeclarationSyntax or 2157Debug.Assert(typeNode is BaseTypeDeclarationSyntax); 2169Debug.Assert(typeNode is BaseTypeDeclarationSyntax); 2220Debug.Assert(typeNode is ClassDeclarationSyntax); 2247Debug.Assert(memberNode is MemberDeclarationSyntax); 2266Debug.Assert(memberNode is MethodDeclarationSyntax or 2383Debug.Assert(typeNode is ClassDeclarationSyntax); 2416Debug.Assert(memberNode is BaseMethodDeclarationSyntax or 2457Debug.Assert(memberNode is BaseMethodDeclarationSyntax or 2515Debug.Assert(memberNode is MemberDeclarationSyntax); 2524Debug.Assert(memberNode is MemberDeclarationSyntax); 2547Debug.Assert(variableNode is MemberDeclarationSyntax or 2566Debug.Assert(variableNode is MemberDeclarationSyntax); 2604Debug.Assert(propertyNode is BasePropertyDeclarationSyntax); 2622Debug.Assert(memberNode is MemberDeclarationSyntax); 2634Debug.Assert(eventNode is EventFieldDeclarationSyntax or 2642Debug.Assert(memberNode is MemberDeclarationSyntax or 2655Debug.Assert(memberNode is MemberDeclarationSyntax); 2678Debug.Assert(memberNode is BasePropertyDeclarationSyntax); 2720Debug.Assert(node is MemberDeclarationSyntax or 3665Debug.Assert(externalLocation != null);
CodeModel\CSharpCodeModelService.NodeLocator.cs (4)
137Debug.Assert(!openBrace.IsMissing); 149Debug.Assert(!openBrace.IsMissing); 150Debug.Assert(!closeBrace.IsMissing); 151Debug.Assert(memberStartColumn >= 0);
CodeModel\CSharpCodeModelService.NodeNameGenerator.cs (2)
156Debug.Assert(node != null); 157Debug.Assert(IsNameableNode(node));
CodeModel\CSharpCodeModelService_Prototype.cs (1)
24Debug.Assert(symbol != null);
ObjectBrowser\DescriptionBuilder.cs (1)
33Debug.Assert(typeSymbol.TypeKind == TypeKind.Delegate);
SemanticSearch\SemanticSearchDocumentNavigationService.cs (2)
30Debug.Assert(workspace is SemanticSearchWorkspace); 31Debug.Assert(documentId == SemanticSearchUtilities.GetQueryDocumentId(workspace.CurrentSolution));
Microsoft.VisualStudio.LanguageServices.DevKit (5)
Logging\VSCodeTelemetryLogger.cs (5)
41Debug.Assert(_telemetrySession == null); 63Debug.Assert(_telemetrySession != null); 72Debug.Assert(_telemetrySession != null); 85Debug.Assert(found); 102Debug.Assert(_telemetrySession != null);
MSBuild (7)
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
WindowsFileSystem.cs (2)
132Debug.Assert(hr != WindowsNative.ErrorFileNotFound); 194Debug.Assert(hr != WindowsNative.ErrorSuccess);
WindowsNative.cs (3)
158Debug.Assert(Status == EnumerateDirectoryStatus.UnknownError); 168Debug.Assert(Status != EnumerateDirectoryStatus.UnknownError && 178Debug.Assert(Status != EnumerateDirectoryStatus.Success);
MSBuildTaskHost (15)
BinaryTranslator.cs (1)
639Debug.Assert(count == 2);
Concurrent\ConcurrentDictionary.cs (10)
128Debug.Assert(_comparer.GetHashCode(key) == hashcode); 162Debug.Assert(_comparer.GetHashCode(key) == hashcode); 191Debug.Assert((prev == null && node == tables._buckets[bucketNo]) || prev._next == node); 374Debug.Assert(newLength % 2 != 0); 458Debug.Assert(bucketNo >= 0 && bucketNo < bucketCount); 470Debug.Assert(bucketNo >= 0 && bucketNo < bucketCount); 471Debug.Assert(lockNo >= 0 && lockNo < lockCount); 487Debug.Assert(locksAcquired == _tables._locks.Length); 497Debug.Assert(fromInclusive <= toExclusive); 522Debug.Assert(fromInclusive <= toExclusive);
Concurrent\ConcurrentQueue.cs (2)
167Debug.Assert(head._frozenForEnqueues); 231Debug.Assert(next == s._nextSegment);
FileUtilities.cs (2)
721Debug.Assert(allowedExtensions?.Length > 0); 729Debug.Assert(!String.IsNullOrEmpty(extension) && extension[0] == '.');
PresentationBuildTasks (88)
Microsoft\Build\Tasks\Windows\GenerateTemporaryTargetAssembly.cs (4)
186Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 187Debug.Assert(targetOutputs[CompileTargetName].Length == 1); 301Debug.Assert(targetOutputs.ContainsKey(CompileTargetName)); 302Debug.Assert(targetOutputs[CompileTargetName].Length == 1);
MS\Internal\MarkupCompiler\MarkupCompiler.cs (26)
260Debug.Assert(!cu.Pass2); 282Debug.Assert(!cu.Pass2); 293Debug.Assert(!cu.Pass2 || _pendingLocalFiles == null); 294Debug.Assert(_pendingLocalFiles == null || _pendingLocalFiles.Count == 0); 581Debug.Assert(_codeContexts.Count == 0); 959Debug.Assert(_ccRoot.StyleConnectorFn.Statements.Count > 0); 961Debug.Assert(ccsConnector != null); 1831Debug.Assert(desc != null); 1903Debug.Assert(pis != null && pis.Length == 2 && KnownTypes.Types[(int)KnownElements.DependencyObject].IsAssignableFrom(pis[0].ParameterType)); 2030Debug.Assert(_ccRoot != null && _ccRoot.SubClass.Length > 0); 2103Debug.Assert(CompilerInfo != null && CompilerInfo.IsCodeDomProviderTypeValid); 2305Debug.Assert(genericName.Length > 0 || t.IsGenericTypeDefinition); 2309Debug.Assert(genericName.Length == 0 && typeArgsList != null); 2395Debug.Assert(typeArgsList != null && typeArgsList.Length == refTypeParams.Length); 2462Debug.Assert(_typeArgsList == null || (baseClass.IsGenericType && baseClass.IsGenericTypeDefinition)); 2463Debug.Assert(_typeArgsList != null || !baseClass.IsGenericType); 2530Debug.Assert(!string.IsNullOrEmpty(baseName)); 2536Debug.Assert(_ccRoot == null); 3041Debug.Assert(_ccRoot != null); 3090Debug.Assert(cc != null); 3094Debug.Assert(_ccRoot == (cc as CodeContextRoot)); 3095Debug.Assert(_ccRoot.CodeClass != null); 3119Debug.Assert(_ccRoot.HookupFn == null); 3173Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot)); 3174Debug.Assert(_ccRoot.ElementType == null || 3198Debug.Assert(_ccRoot == (_codeContexts.Peek() as CodeContextRoot));
MS\Internal\MarkupCompiler\ParserExtension.cs (1)
906Debug.Assert(bamlMemStream != null);
MS\Internal\MarkupCompiler\PathInternal.cs (1)
41Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
MS\Internal\MarkupCompiler\VersionHelper.cs (2)
62Debug.Assert(!allowWildcard || maxValue < ushort.MaxValue); 200Debug.Assert(revision < ushort.MaxValue);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\MS\Internal\Globalization\LocalizationComments.cs (1)
347Debug.Assert(enumPrefix != null && enumNames != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlMapTable.cs (8)
58Debug.Assert(null != xamlTypeMapper); 146Debug.Assert(cmp > 0); 1054Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1090Debug.Assert( 1102Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1285Debug.Assert(ownerTypeName != null); 1286Debug.Assert(attributeName != null); 1504Debug.Assert(targetType != null && memberName != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (7)
766Debug.Assert(null == _writeCache[(int)record.RecordType]); 903Debug.Assert( value <= 3 && value >= 0 ); 1091Debug.Assert(RecordSize < 0); 2387Debug.Assert(value <= ExtensionIdMask); 4543Debug.Assert( SerializerTypeId != 0 ); 4715Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4758Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (10)
134Debug.Assert(null != DocumentStartRecord); 405Debug.Assert(_deferElementDepth == 0); 406Debug.Assert(_deferComplexPropertyDepth == 0); 407Debug.Assert(_staticResourceElementDepth == 0); 408Debug.Assert(_dynamicResourceElementDepth == 0); 409Debug.Assert(_staticResourceRecordList == null); 427Debug.Assert(_staticResourceElementDepth == 0); 876Debug.Assert(_deferElementDepth == 2); 1065Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1082Debug.Assert(typeValue != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\MarkupExtensionParser.cs (2)
1182Debug.Assert(sb.Length > 0); 1183Debug.Assert(!Char.IsWhiteSpace(sb[0]));
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\StyleXamlParser.cs (2)
505Debug.Assert(_inEventSetter); 1217Debug.Assert(!xamlClrEventNode.IsTemplateEvent && _inEventSetter);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\TemplateXamlParser.cs (3)
563Debug.Assert(_setterOrTriggerValueNode != null); 1332Debug.Assert(_styleModeStack.Mode == StyleMode.VisualTree); 1342Debug.Assert(!xamlClrEventNode.IsStyleSetterEvent);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlParser.cs (1)
1140Debug.Assert(SkipActionDepthCount == -1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (13)
360Debug.Assert(null != XmlReader); 1507Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName) 2070Debug.Assert(false == endTagHasBeenRead); 2220Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2229Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2238Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2247Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2256Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2265Debug.Assert (attributeFound || !IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri)); 2758Debug.Assert(unknownTagName != null || null != parentType); 3703Debug.Assert(typeAndSerializer == null || 4818Debug.Assert( collectionTypeID >= 0 5496Debug.Assert(currentPos > 0 && currentPos < s.Length - 1);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (3)
2305Debug.Assert(memberName != null); 2308Debug.Assert(memberInfo != null); 2323Debug.Assert(targetType != null);
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XmlnsDictionary.cs (1)
709Debug.Assert(prefix != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\TokenizerHelper.cs (1)
314Debug.Assert(null != numberFormat);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
35Debug.Assert( baseReader is not null);
PresentationCore (1614)
MS\Internal\AppModel\CookieHandler.cs (1)
109Debug.Assert(size > 0);
MS\Internal\FontCache\FamilyCollection.cs (1)
647Debug.Assert(i == FamilyCount);
MS\Internal\FontCache\FontCacheUtil.cs (1)
40Debug.Assert(stream.Position == 0);
MS\Internal\FontCache\FontResourceCache.cs (3)
60Debug.Assert(uri.IsAbsoluteUri && uri.Scheme == PackUriHelper.UriSchemePack && BaseUriHelper.IsPackApplicationUri(uri)); 73Debug.Assert(escapedPath.EndsWith(FakeFileName, StringComparison.OrdinalIgnoreCase)); 141Debug.Assert(!folderResourceMap.ContainsKey(resourceFullName));
MS\Internal\FontCache\FontSource.cs (3)
72Debug.Assert(_isInternalCompositeFont || String.IsNullOrEmpty(_fontUri.Fragment)); 335Debug.Assert(memoryFontSize <= fileReadBufferSize); 400Debug.Assert(_memoryHandle.IsAllocated);
MS\Internal\FontFace\CompositeFontInfo.cs (3)
204Debug.Assert(IsFamilyMapRangesValid(familyMapRanges)); 212Debug.Assert(begin < end && end <= _familyMaps.Count); 240Debug.Assert(count == FirstFamilyMapRange);
MS\Internal\FontFace\PhysicalFontFamily.cs (4)
120Debug.Assert(bestMatch != null); 204Debug.Assert(bestStyleTypeface != null); 332Debug.Assert(advance <= unicodeString.Length); 338Debug.Assert(advance + sizeofChar <= unicodeString.Length);
MS\Internal\FontFace\TypefaceCollection.cs (2)
82Debug.Assert((_family != null && _familyTypefaceCollection == null)|| (_familyTypefaceCollection != null && _family == null)); 133Debug.Assert((typefaceCollection._family != null && typefaceCollection._familyTypefaceCollection == null)
MS\Internal\Generic\Span.cs (1)
138Debug.Assert(fc <= first);
MS\Internal\Ink\Bezier.cs (2)
111Debug.Assert(to - from >= 4); 352Debug.Assert(data.Node(to) - data.Node(from) > data.Node(j) - data.Node(from));
MS\Internal\Ink\CuspData.cs (1)
280Debug.Assert(bReverse);
MS\Internal\Ink\EllipticalNodeOperations.cs (9)
24System.Diagnostics.Debug.Assert((nodeShape != null) && nodeShape.IsEllipse); 171System.Diagnostics.Debug.Assert(node.IsEmpty == false); 574System.Diagnostics.Debug.Assert(result.IsEmpty); 612System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(beginRadius, endRadius) == false); 644System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 653System.Diagnostics.Debug.Assert(DoubleUtil.IsBetweenZeroAndOne(x) == false); 655System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 671System.Diagnostics.Debug.Assert(!double.IsNaN(findex)); 683System.Diagnostics.Debug.Assert(!double.IsNaN(findex));
MS\Internal\Ink\ErasingStroke.cs (6)
30System.Diagnostics.Debug.Assert(erasingShape != null); 56System.Diagnostics.Debug.Assert((path != null) && (IEnumerablePointHelper.GetCount(path) != 0)); 97System.Diagnostics.Debug.Assert(iterator != null); 136System.Diagnostics.Debug.Assert(iterator != null); 137System.Diagnostics.Debug.Assert(intersections != null); 259System.Diagnostics.Debug.Assert(path.Length > 1);
MS\Internal\Ink\ExtendedPropertyCollection.cs (1)
173System.Diagnostics.Debug.Assert(propertyToRemove != null);
MS\Internal\Ink\GestureRecognizer\NativeRecognizer.cs (8)
45Debug.Assert(NativeRecognizer.RecognizerHandleSingleton != null); 347Debug.Assert(recContext != null && !recContext.IsInvalid); 394Debug.Assert(recContext != null && !recContext.IsInvalid); 483Debug.Assert(stylusPoints != null); 484Debug.Assert(propertyGuids.Length == StylusPointDescription.RequiredCountOfProperties); 618Debug.Assert(ApplicationGestureHelper.IsDefined(gesture)); 705Debug.Assert(pProps->cbPropertyValue == sizeof(uint) / sizeof(byte)); 717Debug.Assert(ApplicationGestureHelper.IsDefined(gesture));
MS\Internal\Ink\InkSerializedFormat\AlgoModule.cs (4)
211Debug.Assert(outputBufferIndex < outputBuffer.Length); 220Debug.Assert(outputBufferIndex < outputBuffer.Length); 272Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1); 333Debug.Assert(countPerItem == 4 || countPerItem == 2 || countPerItem == 1);
MS\Internal\Ink\InkSerializedFormat\CustomAttributeSerializer.cs (2)
310Debug.Assert(strm != null); 425System.Diagnostics.Debug.Assert(guid == Guid.Empty);
MS\Internal\Ink\InkSerializedFormat\DrawingAttributeSerializer.cs (13)
332System.Diagnostics.Debug.Assert(penTip == PenTip.Rectangle); 421Debug.Assert(DrawingAttributes.MaxHeight == DrawingAttributes.MaxWidth && 450System.Diagnostics.Debug.Assert(compressionAlgorithm == 0); 451System.Diagnostics.Debug.Assert(fTag == true); 453Debug.Assert(stream != null); 479Debug.Assert(bw != null); 485Debug.Assert(bw != null); 505Debug.Assert(bw != null); 518Debug.Assert(bw != null); 536Debug.Assert(bw != null); 605Debug.Assert(bw != null); 659Debug.Assert(bw != null); 670Debug.Assert(bw != null);
MS\Internal\Ink\InkSerializedFormat\GorillaCodec.cs (5)
218Debug.Assert(intReader != null); 219Debug.Assert(shortReader != null); 231Debug.Assert(shortReader != null); 529Debug.Assert(outputBufferIndex < outputBuffer.Length); 546Debug.Assert(outputBufferIndex < outputBuffer.Length);
MS\Internal\Ink\InkSerializedFormat\HuffCodec.cs (9)
81Debug.Assert(input != null); 82Debug.Assert(input.Length >= 2); 83Debug.Assert(startIndex == 1); 84Debug.Assert(outputBuffer != null); 85Debug.Assert(outputBuffer.Length != 0); 97Debug.Assert(outputBufferIndex < outputBuffer.Length); 112Debug.Assert(outputBufferIndex < outputBuffer.Length); 174Debug.Assert(nDataLen > 0 && nDataLen - 1 <= Int32.MaxValue); 178Debug.Assert(nDataLen <= Int32.MaxValue);
MS\Internal\Ink\InkSerializedFormat\InkSerializer.cs (7)
91System.Diagnostics.Debug.Assert(inkData.Length > isfBase64PrefixLength); 236Debug.Assert(inkdata != null); 294Debug.Assert(inputStream != null); 2088Debug.Assert(data != null); 2467Debug.Assert(sizeOfHeaderInBytes == bytesWritten); 2506Debug.Assert(sizes[i] == bytesWritten); 2706System.Diagnostics.Debug.Assert(strokes != null);
MS\Internal\Ink\InkSerializedFormat\LZCodec.cs (4)
28Debug.Assert(input != null); 29Debug.Assert(input.Length > 1); 30Debug.Assert(inputIndex < input.Length); 31Debug.Assert(inputIndex >= 0);
MS\Internal\Ink\InkSerializedFormat\MultiByteCodec.cs (3)
65Debug.Assert(input != null); 66Debug.Assert(inputIndex < input.Length); 100Debug.Assert(input != null); //already validated at the AlgoModule level
MS\Internal\Ink\InkSerializedFormat\StrokeSerializer.cs (1)
960Debug.Assert(stream != null);
MS\Internal\Ink\Lasso.cs (19)
49System.Diagnostics.Debug.Assert(_points != null); 63System.Diagnostics.Debug.Assert(_points != null); 77System.Diagnostics.Debug.Assert(_points != null); 78System.Diagnostics.Debug.Assert((0 <= index) && (index < _points.Count)); 90System.Diagnostics.Debug.Assert(null != points); 104System.Diagnostics.Debug.Assert(_points != null); 120System.Diagnostics.Debug.Assert(_points != null); 171System.Diagnostics.Debug.Assert(lassoSegment.Y != 0); 186System.Diagnostics.Debug.Assert(_points != null); 187System.Diagnostics.Debug.Assert(iterator != null); 335System.Diagnostics.Debug.Assert(!crossing.IsEmpty && crossing.StartNode.IsValid && crossing.EndNode.IsValid); 338System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 345System.Diagnostics.Debug.Assert(!mcrossing.IsEmpty && mcrossing.StartNode.IsValid && mcrossing.EndNode.IsValid); 422System.Diagnostics.Debug.Assert(DoubleUtil.AreClose(si.InBegin, StrokeFIndices.BeforeFirst)); 557System.Diagnostics.Debug.Assert(!newFIndices.IsEmpty); 558System.Diagnostics.Debug.Assert(strokeNode.IsValid); 601System.Diagnostics.Debug.Assert(obj is LassoCrossing); 706System.Diagnostics.Debug.Assert(intersection >= 0 && intersection <= points.Count - 2); 811System.Diagnostics.Debug.Assert(hitEnd != hitBegin && orgBegin != orgEnd);
MS\Internal\Ink\Renderer.cs (8)
38Debug.Assert(renderer != null); 425System.Diagnostics.Debug.Assert(sender == _strokes); 475System.Diagnostics.Debug.Assert(_strokes.IndexOf(sender as Stroke) != -1); 526System.Diagnostics.Debug.Assert(_strokes != null); 532Debug.Assert(visual is not null); 626System.Diagnostics.Debug.Assert(stroke != null); 635System.Diagnostics.Debug.Assert(stroke != null); 647System.Diagnostics.Debug.Assert(drawingAttributes != null);
MS\Internal\Ink\StrokeFIndices.cs (1)
180System.Diagnostics.Debug.Assert(!double.IsNaN(_beginFIndex) && !double.IsNaN(_endFIndex) && DoubleUtil.LessThan(_beginFIndex, _endFIndex));
MS\Internal\Ink\StrokeIntersection.cs (6)
185System.Diagnostics.Debug.Assert(intersections != null); 186System.Diagnostics.Debug.Assert(intersections.Length > 0); 191System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty); 217System.Diagnostics.Debug.Assert(intersections != null); 218System.Diagnostics.Debug.Assert(intersections.Length > 0); 223System.Diagnostics.Debug.Assert(!intersections[j].IsEmpty);
MS\Internal\Ink\StrokeNode.cs (17)
36System.Diagnostics.Debug.Assert(operations != null); 37System.Diagnostics.Debug.Assert((nodeData.IsEmpty == false) && (index >= 0)); 286Debug.Assert(!endNodeRect.Contains(point)); 898System.Diagnostics.Debug.Assert(!double.IsNaN(cutAt.BeginFIndex) && !double.IsNaN(cutAt.EndFIndex)); 916System.Diagnostics.Debug.Assert(IsValid && (_index >= 0)); 923System.Diagnostics.Debug.Assert(fragment.BeginFIndex >= 0 && fragment.BeginFIndex <= 1); 928System.Diagnostics.Debug.Assert(fragment.EndFIndex >= 0 && fragment.EndFIndex <= 1); 947System.Diagnostics.Debug.Assert(IsValid); 959System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.BeginFIndex, 0f)); 961System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.BeginFIndex, 1f)); 975System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThanOrClose(fragment.EndFIndex, 0f)); 977System.Diagnostics.Debug.Assert(DoubleUtil.LessThanOrClose(fragment.EndFIndex, 1f)); 1001System.Diagnostics.Debug.Assert(IsValid); 1019System.Diagnostics.Debug.Assert(IsValid); 1037System.Diagnostics.Debug.Assert(IsValid); 1041System.Diagnostics.Debug.Assert(findex == 0); 1045System.Diagnostics.Debug.Assert((findex >= _index - 1) && (findex <= _index));
MS\Internal\Ink\StrokeNodeData.cs (2)
45System.Diagnostics.Debug.Assert(DoubleUtil.GreaterThan((double)pressure, 0d)); 56Debug.Assert(DoubleUtil.AreClose(0, s_empty._pressure));
MS\Internal\Ink\StrokeNodeOperations.cs (19)
42System.Diagnostics.Debug.Assert(nodeShape != null); 73System.Diagnostics.Debug.Assert((boundingBox.X <= 0) && (boundingBox.Y <= 0)); 119System.Diagnostics.Debug.Assert(node.IsEmpty == false); 317System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 368System.Diagnostics.Debug.Assert(count > 0); 394System.Diagnostics.Debug.Assert(count > 0); 416System.Diagnostics.Debug.Assert(count > 0); 477System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 618System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 632System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1); 769System.Diagnostics.Debug.Assert(true == DoubleUtil.IsBetweenZeroAndOne(findex)); 957System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 982System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 1014System.Diagnostics.Debug.Assert(!quad.IsEmpty); 1084System.Diagnostics.Debug.Assert(i < count); 1124System.Diagnostics.Debug.Assert(count > 0); 1146System.Diagnostics.Debug.Assert(count > 0); 1219System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(pressureFactor) == false); 1290System.Diagnostics.Debug.Assert(findex >= 0 && findex <= 1);
MS\Internal\Ink\StrokeNodeOperations2.cs (3)
40System.Diagnostics.Debug.Assert((null != vertices) && (2 < vertices.Length)); 78System.Diagnostics.Debug.Assert(quad.IsEmpty == false); 504System.Diagnostics.Debug.Assert((false == DoubleUtil.IsZero(shortest.X)) || (false == DoubleUtil.IsZero(shortest.Y)));
MS\Internal\Ink\StrokeRenderer.cs (26)
37Debug.Assert(iterator != null); 38Debug.Assert(drawingAttributes != null); 71System.Diagnostics.Debug.Assert(true == strokeNode.IsValid); 153Debug.Assert(index == iterator.Count - 1); 211Debug.Assert(iterator != null && drawingAttributes != null); 483Debug.Assert(pathFigureDCSide.Count == 0); 625Debug.Assert(!strokeNode.IsValid); 647Debug.Assert(pathFigureDCSide.Count == 0); 673Debug.Assert(pathFigureABSide.Count == 0); 708Debug.Assert(pathFigureDCSide.Count == 0); 754Debug.Assert(pointBuffer1 != null); 755Debug.Assert(pointBuffer2 != null); 756Debug.Assert(pointBuffer3 != null); 757Debug.Assert(context != null); 830Debug.Assert(percentIntersect >= 0.0 && percentIntersect <= 100.0d); 866Debug.Assert(context != null); 867Debug.Assert(points != null); 868Debug.Assert(points.Count > 0); 894Debug.Assert(context != null); 895Debug.Assert(abPoints != null && dcPoints != null); 896Debug.Assert(abPoints.Count > 0 && dcPoints.Count > 0); 916Debug.Assert(context != null); 917Debug.Assert(abPoints != null && dcPoints != null); 918Debug.Assert(polyLinePoints != null); 947Debug.Assert(i + 2 < points.Count); 1097System.Diagnostics.Debug.Assert(da.IsHighlighter = true);
MS\Internal\Ink\StylusShape.cs (4)
157System.Diagnostics.Debug.Assert(value.HasInverse); 227System.Diagnostics.Debug.Assert(vertices.Length == 4); 252System.Diagnostics.Debug.Assert(clockWiseIndex == vertices.Length || counterClockIndex == vertices.Length); 270System.Diagnostics.Debug.Assert(m_tip == StylusTip.Ellipse);
MS\Internal\IO\Packaging\NetStream.cs (8)
808Debug.Assert(offset >= 0); 809Debug.Assert(length >= 0); 834Debug.Assert(value >= 0); 847Debug.Assert(value >= 0); 893Debug.Assert(_offset <= b._offset); 894Debug.Assert(Mergeable(b)); 942Debug.Assert(block.Length > 0); 1042Debug.Assert(block.Length > 0);
MS\Internal\LoadedOrUnloadedOperation.cs (1)
22Debug.Assert(callback != null && target != null);
MS\Internal\Media\VisualTreeUtils.cs (1)
114Debug.Assert(element == null);
MS\Internal\Media3D\GeneralTransform3DTo2DTo3D.cs (1)
28Debug.Assert(transform3DTo2D != null && transform2DTo3D != null);
MS\Internal\Media3D\M3DUtil.cs (2)
145Debug.Assert(matrix.IsAffine); 323Debug.Assert(!matrix.IsAffine);
MS\Internal\PartialArray.cs (1)
23Debug.Assert(initialIndex >= 0 && initialIndex + count <= array.Length);
MS\Internal\Shaping\OpenTypeCommon.cs (7)
228Debug.Assert(TableTag==OpenTypeTags.GSUB || TableTag==OpenTypeTags.GPOS); 229Debug.Assert(FirstGlyph<AfterLastGlyph); 230Debug.Assert(AfterLastGlyph<=GlyphInfo.Length); 731Debug.Assert(featureDescription.Parameter != 0); 781Debug.Assert( FlagToSet==GlyphFlags.NotChanged || 925Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1696Debug.Assert(Index < SubTableCount());
MS\Internal\Shaping\OpenTypeLayoutCache.cs (16)
74Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 314Debug.Assert(totalSize <= maxCacheSize); 318Debug.Assert(totalSize <= maxCacheSize); 385Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 405Debug.Assert(false); 538Debug.Assert(lastLookup >= 0); // There are lookups, so there was an index 565Debug.Assert(cacheSize > 0); // We've calcucalted them at least ones, and 566Debug.Assert(glyphCount > 0); // if there is no records, we already should've exited 632Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 637Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 670Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 675Debug.Assert((pList - pCache) * sizeof(ushort) < cacheSize); 687Debug.Assert((pList - pCache) * sizeof(ushort) == cacheSize); // We exactly filled up the cache 688Debug.Assert((pGlyphs - pCache) * sizeof(ushort) == (4 + glyphCount * 2) * sizeof(ushort)); // Glyphs ended where lists start. 834Debug.Assert(tableTag == OpenTypeTags.GSUB || tableTag == OpenTypeTags.GPOS); 1052Debug.Assert(recordCount > 0); // Otherwise, we would go into (glyph > maxGlyphLookup);
MS\Internal\Shaping\ShaperBuffers.cs (2)
99Debug.Assert(_charMap.Length == charCount); 110Debug.Assert(_glyphInfoList.Length == glyphCount);
MS\Internal\Shaping\TypefaceMap.cs (7)
159Debug.Assert(ichItem == unicodeString.Length); 174Debug.Assert(index >= 0); 575Debug.Assert(cchMap <= unicodeString.Length - ich); 812Debug.Assert(cchNextValid > 0 && cchNextValid <= unicodeString.Length - ich); 830Debug.Assert(cchNextValid == 0); 840Debug.Assert(recursionDepth > 0 || advance == unicodeString.Length); 1052Debug.Assert(cch > 0);
MS\Internal\Span.cs (2)
105Debug.Assert(cp >= 0); 157Debug.Assert(spanIndex > 0);
MS\Internal\SynchronizedInputHelper.cs (3)
186Debug.Assert(mbArgs != null); 234Debug.Assert(mbArgs != null); 284Debug.Assert(false);
MS\Internal\TextFormatting\FormatSettings.cs (3)
209Debug.Assert(offsetToFirstCp == 0); 217Debug.Assert(offsetToFirstCp == 0); 230Debug.Assert(offsetToFirstCp == 0);
MS\Internal\TextFormatting\FormattedTextSymbols.cs (6)
49Debug.Assert(symbols != null); 72Debug.Assert(shapeables != null && shapeables.Count > 0); 86Debug.Assert(current != null); 198Debug.Assert(_glyphs != null); 221Debug.Assert(_glyphs != null); 364Debug.Assert(glyphAdvances.Length <= glyphIndices.Length);
MS\Internal\TextFormatting\FullTextLine.cs (18)
195Debug.Assert(_metrics._formatter != null); 453Debug.Assert(_collapsingSymbol == null && symbol != null); 475Debug.Assert(lineLength > 0); 686Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0); 740Debug.Assert(_fullText != null); 745Debug.Assert(_metrics._height > 0); 821Debug.Assert(HasCollapsed); 1221Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1410Debug.Assert(direction == CaretDirection.Backward || direction == CaretDirection.Backspace); 1462Debug.Assert(_collapsingSymbol != null); 1557Debug.Assert(false); 1715Debug.Assert(boundsList != null); 2079Debug.Assert(textRun != null); 2083Debug.Assert(cchAcc > 0); 2096Debug.Assert(cchAcc > 0); 2100Debug.Assert(cchLeft == 0); 2442Debug.Assert(_ploline != IntPtr.Zero); 2495Debug.Assert(_ploline != IntPtr.Zero);
MS\Internal\TextFormatting\FullTextState.cs (1)
298Debug.Assert(!TextStore.IsMarker(plsrun));
MS\Internal\TextFormatting\LineServicesCallbacks.cs (15)
206Debug.Assert(lsrun.RunProp != null); 487Debug.Assert(Draw.CurrentLine.FullTextState != null); 495Debug.Assert(lsrun.Shapeable != null && stringLength > 0); 695Debug.Assert(ulInfo.dvpFirstUnderlineSize >= 0); 744Debug.Assert(stInfo.dvpLowerStrikethroughSize >= 0); 1604Debug.Assert(lsrunFirst.Shapeable != null); 1605Debug.Assert(cchText > 0); // LineServices should not pass in zero character count; 1764Debug.Assert(TextStore.IsContent(plsrun) && lsruns[i] != null); 1800Debug.Assert(TextStore.IsContent(plsrun) && lsrun.Shapeable != null); 2362Debug.Assert(textObject != null); 2422Debug.Assert(false); 2445Debug.Assert(lsrun.Type == Plsrun.InlineObject); 2457Debug.Assert(textObject != null); 2458Debug.Assert(textFlow != LsTFlow.lstflowWS || runDirection != 0); 3157Debug.Assert(lsrun.Shapeable != null);
MS\Internal\TextFormatting\LineServicesRun.cs (2)
234Debug.Assert(_shapeable != null); 907Debug.Assert(lsruns != null && lsruns.Length > 0 && lsruns[0] != null);
MS\Internal\TextFormatting\SimpleTextLine.cs (1)
565Debug.Assert((_statusFlags & StatusFlags.BoundingBoxComputed) != 0);
MS\Internal\TextFormatting\TextFormatterImp.cs (2)
529Debug.Assert(context.Owner == null); 554Debug.Assert(context != null);
MS\Internal\TextFormatting\TextMarkerSource.cs (5)
49Debug.Assert(markerStyle != TextMarkerStyle.None); 97Debug.Assert(autoNumberingIndex > 0); 136Debug.Assert(_characterArray != null); 268Debug.Assert(number >= 0); 400Debug.Assert(number >= 0 && number <= 9);
MS\Internal\TextFormatting\TextMetrics.cs (1)
153Debug.Assert(_cchLength > 0);
MS\Internal\TextFormatting\TextStore.cs (16)
257Debug.Assert(stringLength > 0 && runInfo.Length > 0); 315Debug.Assert( 491Debug.Assert(textEffects != null && textEffects.Count != 0); 630Debug.Assert(runInfo.StringLength > 0 && runInfo.Length > 0); 834Debug.Assert(runInfo.StringLength >= stringLength); 859Debug.Assert(cch <= runInfo.StringLength); 1408Debug.Assert(ichRun < ichEnd); 1436Debug.Assert(ichRun == cchUniform); 1534Debug.Assert(runInfo.OffsetToFirstChar + offsetToFirstChar + lsrunLength <= runInfo.CharacterBuffer.Count); 1554Debug.Assert(offsetToFirstChar == 0); 1600Debug.Assert(uniformBidiLevel == (Pap.RightToLeft ? 1 : 0)); 1629Debug.Assert(lsrunLength > 0); 1696Debug.Assert(false); 1709Debug.Assert(cch > 0 && cch <= stringLength - ich); 1948Debug.Assert(i < _plsrunVector.Count); 2369Debug.Assert(metrics != null);
MS\Internal\TextFormatting\ThousandthOfEmRealDoubles.cs (2)
32Debug.Assert(capacity >= 0); 42Debug.Assert(realValues != null);
MS\Internal\TextFormatting\ThousandthOfEmRealPoints.cs (2)
28Debug.Assert(capacity >= 0); 37Debug.Assert(pointValues != null);
MS\Win32\UnsafeNativeMethodsTablet.cs (3)
91Debug.Assert(handle != IntPtr.Zero); 131Debug.Assert(handle != IntPtr.Zero); 143System.Diagnostics.Debug.Assert(_recognizerHandle == null);
src\Microsoft.DotNet.Wpf\src\Common\Graphics\exports.cs (25)
97Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbFrom) % 4 == 0); 98Debug.Assert((cbData == 0) || ((Int64)(IntPtr)pbTo) % 4 == 0); 99Debug.Assert(cbData % 4 == 0); 100Debug.Assert(cbData >= 0); 524Debug.Assert(!handle.IsNull); 554Debug.Assert(!handle.IsNull); 912Debug.Assert(channel != null); 932Debug.Assert(channel != null); 934Debug.Assert(_debugOnly_Channel == channel); 950Debug.Assert(_debugOnly_Channel == channel); 1127Debug.Assert(_others.Count > 0); 1152Debug.Assert(index == 0); 1386Debug.Assert(index <= 1); 1464Debug.Assert(index == 0); 1502Debug.Assert(channel != null); 1527Debug.Assert(sourceChannel != null); 1532Debug.Assert(found); 1539Debug.Assert(!(_map.Get(targetChannel, out duplicate))); 1565Debug.Assert(channel != null); 1570Debug.Assert(found); 1633Debug.Assert(channel != null); 1638Debug.Assert(found); 1906Debug.Assert(!hCompositionNode.IsNull); 1932Debug.Assert(!hCompositionNode.IsNull); 2110Debug.Assert(!hCompositionNode.IsNull);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\AppDomainShutdownMonitor.cs (1)
35Debug.Assert(listener.TryGetTarget(out _));
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Ink\BitStream.cs (2)
23Debug.Assert(buffer != null); 36Debug.Assert(buffer != null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\LegacyPriorityQueue.cs (2)
130Debug.Assert(_count > 0); 183Debug.Assert(_count != 0);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\PartialList.cs (1)
47Debug.Assert(initialIndex >= 0 && initialIndex + count <= list.Count);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
268Debug.Assert(target is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Media\TypeConverterHelper.cs (1)
70Debug.Assert(inputString is Uri);
System\Windows\Duration.cs (1)
39Debug.Assert(durationType == DurationType.Automatic || durationType == DurationType.Forever);
System\Windows\DurationConverter.cs (1)
118Debug.Assert(duration == Duration.Automatic); // Only other legal duration type
System\Windows\FontStretch.cs (2)
26Debug.Assert(1 <= stretch && stretch <= 9); 55Debug.Assert(1 <= RealStretch && RealStretch <= 9);
System\Windows\FontStyle.cs (3)
23Debug.Assert(0 <= style && style <= 2); 118Debug.Assert(0 <= _style && _style <= 2); 137Debug.Assert(_style == 2);
System\Windows\FontWeight.cs (1)
24Debug.Assert(1 <= weight && weight <= 999);
System\Windows\FreezableCollection.cs (1)
159Debug.Assert(_collection.Count == 0);
System\Windows\Ink\DrawingAttributes.cs (13)
41System.Diagnostics.Debug.Assert(extendedProperties != null); 52System.Diagnostics.Debug.Assert(_extendedProperties != null); 71Debug.Assert(Colors.Black == (Color)GetDefaultDrawingAttributeValue(KnownIds.Color)); 95Debug.Assert(StylusTip.Ellipse == (StylusTip)GetDefaultDrawingAttributeValue(KnownIds.StylusTip)); 101Debug.Assert(StylusTip.Rectangle == (StylusTip)GetExtendedPropertyBackedProperty(KnownIds.StylusTip)); 124Debug.Assert(Matrix.Identity == (Matrix)GetDefaultDrawingAttributeValue(KnownIds.StylusTipTransform)); 153Debug.Assert(DrawingAttributes.DefaultHeight == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusHeight)); 180Debug.Assert(DrawingAttributes.DefaultWidth == (double)GetDefaultDrawingAttributeValue(KnownIds.StylusWidth)); 269Debug.Assert(false == (bool)GetDefaultDrawingAttributeValue(KnownIds.IsHighlighter)); 274Debug.Assert(true == (bool)GetExtendedPropertyBackedProperty(KnownIds.IsHighlighter)); 764System.Diagnostics.Debug.Assert(null != DrawingAttributes.GetDefaultDrawingAttributeValue(guid)); 786System.Diagnostics.Debug.Assert(sender != null); 787System.Diagnostics.Debug.Assert(args != null);
System\Windows\Ink\IncrementalHitTester.cs (18)
50System.Diagnostics.Debug.Assert(_strokes != null); 73System.Diagnostics.Debug.Assert(_strokes != null); 119System.Diagnostics.Debug.Assert(strokes != null); 162System.Diagnostics.Debug.Assert((_strokes != null) && (_strokeInfos != null) && (_strokes == sender)); 262Debug.Assert(_strokeInfos.Count == _strokes.Count); 265Debug.Assert(_strokeInfos[x].Stroke == _strokes[x]); 310System.Diagnostics.Debug.Assert((percentageWithinLasso >= 0) && (percentageWithinLasso <= 100)); 321System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points)!= 0)); 458System.Diagnostics.Debug.Assert(eventArgs != null); 499System.Diagnostics.Debug.Assert(eraserShape != null); 512System.Diagnostics.Debug.Assert((points != null) && (IEnumerablePointHelper.GetCount(points) != 0)); 513System.Diagnostics.Debug.Assert(_erasingStroke != null); 558System.Diagnostics.Debug.Assert(strokeHitEventArgCollection.Count != 0); 563System.Diagnostics.Debug.Assert(eventArgs.HitStroke != null); 574System.Diagnostics.Debug.Assert(eventArgs != null); 672System.Diagnostics.Debug.Assert(stroke != null && hitFragments != null && hitFragments.Length > 0); 713System.Diagnostics.Debug.Assert(stroke != null); 820System.Diagnostics.Debug.Assert(stylusPoints != null && index >= 0 && index < stylusPoints.Count);
System\Windows\Ink\Stroke.cs (21)
114Debug.Assert(_cachedGeometry == null || _cachedGeometry.IsFrozen); 251Debug.Assert(bezierPoints != null && bezierPoints.Count > 0); 304Debug.Assert(stylusPointsCount > stylusPointsIndex); 322Debug.Assert(bezierLength >= prevUnbezierLength); 715System.Diagnostics.Debug.Assert(cutAt != null); 716System.Diagnostics.Debug.Assert(cutAt.Length != 0); 747System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 757System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(fragment.BeginFIndex, fragment.EndFIndex)); 777System.Diagnostics.Debug.Assert(cutAt != null); 778System.Diagnostics.Debug.Assert(cutAt.Length != 0); 803System.Diagnostics.Debug.Assert(false == ((!DoubleUtil.AreClose(cutAt[cutAt.Length - 1].EndFIndex, StrokeFIndices.AfterLast)) && 821System.Diagnostics.Debug.Assert(DoubleUtil.LessThan(beginFIndex, fragment.BeginFIndex)); 850Debug.Assert(sourceStylusPoints != null); 863System.Diagnostics.Debug.Assert(pointCount >= 1); 873System.Diagnostics.Debug.Assert(sourceStylusPoints.Count > i + beginIndex); 877System.Diagnostics.Debug.Assert(stylusPoints.Count == pointCount); 1003System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[0])); 1014System.Diagnostics.Debug.Assert(x == 0); 1017System.Diagnostics.Debug.Assert(IsValidStrokeFIndices(fragments[x]) && fragments[x].EndFIndex > current); 1147Debug.Assert(ienum != null); 1166Debug.Assert(ienum != null);
System\Windows\Ink\Stroke2.cs (10)
484System.Diagnostics.Debug.Assert(_cachedGeometry != null && _cachedGeometry.IsFrozen); 516System.Diagnostics.Debug.Assert(false == _drawAsHollow); 545System.Diagnostics.Debug.Assert(geometry != null); 554System.Diagnostics.Debug.Assert(newBounds.IsEmpty == false); 564System.Diagnostics.Debug.Assert(shape != null); 565System.Diagnostics.Debug.Assert(path != null); 584System.Diagnostics.Debug.Assert(lasso != null); 607System.Diagnostics.Debug.Assert(cutAt != null); 631System.Diagnostics.Debug.Assert(cutAt != null); 669System.Diagnostics.Debug.Assert(DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetX) && DoubleUtil.IsZero(originalDa.StylusTipTransform.OffsetY));
System\Windows\Ink\StrokeCollection.cs (5)
114Debug.Assert(stream != null); 115Debug.Assert(stream.CanRead); 534Debug.Assert(stroke != null && IndexOf(stroke) == -1); 642Debug.Assert(e.Removed.Count > 0); 709Debug.Assert(startingIndex >= 0);
System\Windows\Ink\StrokeCollection2.cs (2)
453System.Diagnostics.Debug.Assert(original != null && toReplace != null); 454System.Diagnostics.Debug.Assert(index >= 0 && index < this.Count);
System\Windows\Input\InputMethod.cs (5)
551Debug.Assert(value != InputMethodState.DoNotCare); 612Debug.Assert(value != InputMethodState.DoNotCare); 646Debug.Assert(value != InputMethodState.DoNotCare); 815Debug.Assert((value & ImeConversionModeValues.DoNotCare) == 0); 1066Debug.Assert((value & ImeSentenceModeValues.DoNotCare) == 0);
System\Windows\Input\ManipulationDevice.cs (5)
146Debug.Assert(manipulator != null); 164Debug.Assert(manipulator != null); 348Debug.Assert(!deltaEventArgs.IsInertial); 414Debug.Assert(!completedEventArgs.IsInertial); 443Debug.Assert(_manipulators == null || _manipulators.Count == 0);
System\Windows\Input\ManipulationLogic.cs (2)
222Debug.Assert(_lastManipulationBeforeInertia != null); 641Debug.Assert(_containerLayoutUpdated != null);
System\Windows\Input\Stylus\Common\DynamicRenderer.cs (3)
500Debug.Assert(si!=null); // should never get here unless we are transitioning a stroke. 936Debug.Assert(si.StrokeHV.Clip == null); 938Debug.Assert(_renderCompleteStrokeInfo == null);
System\Windows\Input\Stylus\Common\DynamicRendererThreadManager.cs (1)
167Debug.Assert(__inkingDispatcher != null); // We should have a valid ref here
System\Windows\Input\Stylus\Common\MultiTouchSystemGestureLogic.cs (2)
69Debug.Assert(_firstStylusDeviceId != null && _firstStylusDeviceId != stylusInputReport.StylusDeviceId); 70Debug.Assert(_secondStylusDeviceId == null);
System\Windows\Input\Stylus\Common\RawStylusInput.cs (1)
35System.Diagnostics.Debug.Assert(tabletToElementTransform.IsFrozen);
System\Windows\Input\Stylus\Common\StylusLogic.cs (2)
404Debug.Assert(_transformToDeviceMatrices[hwndSource.CompositionTarget.CurrentDpiScale].HasInverse); 722Debug.Assert(GetFlickAction(flickData) == FlickAction.Scroll); // Make sure scroll action is set in flickdata.
System\Windows\Input\Stylus\Common\StylusPlugInCollection.cs (4)
56System.Diagnostics.Debug.Assert(this.Count > 0); // If active must have more than one plugin already 565System.Diagnostics.Debug.Assert(_element.IsEnabled == (bool)e.NewValue); 571System.Diagnostics.Debug.Assert(_element.IsVisible == (bool)e.NewValue); 577System.Diagnostics.Debug.Assert(_element.IsHitTestVisible == (bool)e.NewValue);
System\Windows\Input\Stylus\Common\StylusPoint.cs (2)
249Debug.Assert(value != null && 505Debug.Assert(StylusPointDescription.AreCompatible(stylusPoint1.Description, stylusPoint2.Description));
System\Windows\Input\Stylus\Common\StylusPointCollection.cs (3)
364Debug.Assert(count <= this.Count); 533Debug.Assert(additionalData.Length == countToCopy); 609Debug.Assert( this.Description.ButtonCount > 0 ?
System\Windows\Input\Stylus\Common\StylusPointDescription.cs (4)
298Debug.Assert( stylusPointDescription1._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 303Debug.Assert( stylusPointDescription2._stylusPointPropertyInfos.Length >= RequiredCountOfProperties && 339Debug.Assert(stylusPointDescription._stylusPointPropertyInfos.Length >= 3 && 344Debug.Assert(stylusPointDescriptionPreserveInfo._stylusPointPropertyInfos.Length >= 3 &&
System\Windows\Input\Stylus\Common\TabletDeviceBase.cs (1)
258Debug.Assert(properties != null);
System\Windows\Input\Stylus\Pointer\PointerStylusDevice.cs (2)
804Debug.Assert(transformToElement != null); 1118Debug.Assert(transformToElement != null);
System\Windows\Input\Stylus\Pointer\PointerStylusPlugInManager.cs (1)
160System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenContext.cs (6)
103Debug.Assert(!_contexts._inputSource.CheckAccess()); 106Debug.Assert(_pimcContext != null); 134Debug.Assert(_statusPropertyIndex != -1); // We should always see this. 323System.Diagnostics.Debug.Assert(stylusPointerId != 0); 426Debug.Assert(numPackets != 0); 427Debug.Assert(data != null);
System\Windows\Input\Stylus\Wisp\PenContexts.cs (2)
467System.Diagnostics.Debug.Assert(!inputReport.StylusDevice.CheckAccess()); 486System.Diagnostics.Debug.Assert(data.Length % pointLength == 0);
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (4)
515Debug.Assert(penContext != null); 542Debug.Assert(penContext != null); 1036Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero); 1090Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Input\Stylus\Wisp\WispLogic.cs (12)
99Debug.Assert(systemGesture != SystemGesture.None); // We should ever see this as input. 833Debug.Assert((actions & ~(RawMouseActions.Button3Press | RawMouseActions.Button3Release | 1737Debug.Assert(ShouldPromoteToMouse(stylusDevice) && stylusDevice.TouchDevice.PromotingToOther); 2515Debug.Assert(stylusDevice.InAir); 2529Debug.Assert(stylusDevice.InAir); 2800System.Diagnostics.Debug.Assert(stylusDevice != null); 2829System.Diagnostics.Debug.Assert(stylusDevice != null); 2896System.Diagnostics.Debug.Assert(stylusDevice != null); 3042Debug.Assert(__stylusDeviceMap.ContainsKey(stylusDevice.Id)); 3052Debug.Assert(Dispatcher.CheckAccess()); 3238Debug.Assert(Dispatcher.CheckAccess()); 3286Debug.Assert(Dispatcher.CheckAccess());
System\Windows\Input\Stylus\Wisp\WispStylusDevice.cs (3)
1343Debug.Assert(transformToElement != null); 1399Debug.Assert(report.TabletDeviceId == _tabletDevice.Id); 1400Debug.Assert((report.Actions & RawStylusActions.None) == 0);
System\Windows\Input\Stylus\Wisp\WispTabletDevice.cs (2)
177Debug.Assert(_stylusDeviceCollection != null); 219Debug.Assert(CheckAccess());
System\Windows\Input\Stylus\Wisp\WispTabletDeviceCollection.cs (3)
540Debug.Assert(index <= Count); 541Debug.Assert(tabletDevice.Type != (TabletDeviceType)(-1)); // make sure not the mouse tablet device! 560System.Diagnostics.Debug.Assert(index < Count && Count > 0);
System\Windows\Input\TextComposition.cs (1)
306Debug.Assert((_resultText.Length == 1) && Char.IsControl(_resultText[0]));
System\Windows\Input\TextCompositionManager.cs (1)
728Debug.Assert(_altNumpadEntryMode);
System\Windows\Input\TouchDevice.cs (1)
931Debug.Assert(element != null);
System\Windows\InterOp\D3DImage.cs (8)
582Debug.Assert(timeout != Duration.Automatic); 623Debug.Assert(e.OldValue != e.NewValue); 660Debug.Assert(_isDirty); 661Debug.Assert(_isWaitingForPresent); 662Debug.Assert(_lockCount == 0); 683Debug.Assert(_duceResource.IsOnChannel(channel)); 766Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 841Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\InterOp\HwndAppCommandInputProvider.cs (1)
30Debug.Assert(null != _source);
System\Windows\InterOp\HwndKeyboardInputProvider.cs (4)
53Debug.Assert( null != _source ); 700Debug.Assert( null != _source ); 733Debug.Assert( null != _source ); 805Debug.Assert( null != _source );
System\Windows\InterOp\HwndMouseInputProvider.cs (3)
120Debug.Assert(_source is not null); 1182Debug.Assert(_source is not null); 1227Debug.Assert(_source is not null);
System\Windows\InterOp\HwndSource.cs (3)
739Debug.Assert(_weakMenuModeMessageHandler == null); 763Debug.Assert(_weakMenuModeMessageHandler != null); 1524Debug.Assert(_adjustSizingForNonClientArea == true);
System\Windows\InterOp\HwndTarget.cs (11)
474Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 508Debug.Assert(normalizedHwnd.Handle != IntPtr.Zero); 596Debug.Assert(mode == RenderingMode.Software || mode == RenderingMode.Default); 722Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 723Debug.Assert(!_compositionTarget.IsOnChannel(outOfBandChannel)); 742Debug.Assert(resourceCreated); 1342Debug.Assert(_restoreDT == sourceDT); 2377Debug.Assert(!_compositionTarget.IsOnChannel(channel)); 2581Debug.Assert(hwndTarget != null); 2598Debug.Assert(hwndTarget != null); 2601Debug.Assert(_hwndTargetCount >= 0);
System\Windows\Media\Animation\Animatable.cs (1)
299Debug.Assert(reference is WeakReference);
System\Windows\Media\Animation\AnimationClockResource.cs (6)
68Debug.Assert(sender as System.Windows.Threading.DispatcherObject != null); 69Debug.Assert(((System.Windows.Threading.DispatcherObject)sender).Dispatcher != null); 70Debug.Assert(_animationClock != null); 122Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 163Debug.Assert(_duceResource.IsOnChannel(channel)); 179Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\AnimationLayer.cs (13)
17Debug.Assert(ownerStorage != null); 28Debug.Assert( 104Debug.Assert(_animationClocks != null); 119Debug.Assert(animationClocks != null); 120Debug.Assert(animationClocks.Count > 0); 121Debug.Assert(!animationClocks.Contains(null)); 122Debug.Assert(_animationClocks == null); 186Debug.Assert(newAnimationClocks != null); 187Debug.Assert(newAnimationClocks.Count > 0); 188Debug.Assert(!newAnimationClocks.Contains(null)); 221Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 241Debug.Assert(_snapshotValue != DependencyProperty.UnsetValue); 262Debug.Assert(count > 0);
System\Windows\Media\Animation\AnimationStorage.cs (26)
50Debug.Assert( _propertyTriggerLayers == null 79Debug.Assert(animationClock != null); 80Debug.Assert(_dependencyObject.Target != null); 81Debug.Assert(_currentTimeInvalidatedHandler != null); 107Debug.Assert(animationClock != null); 108Debug.Assert(_currentTimeInvalidatedHandler != null); 120Debug.Assert(_dependencyObject == null); 121Debug.Assert(_dependencyProperty == null); 145Debug.Assert(_propertyTriggerLayers != null); 146Debug.Assert(_propertyTriggerLayers.ContainsValue(layer)); 150Debug.Assert(index >= 0); 246Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue); 650Debug.Assert(animationClocks[i] != null); 658Debug.Assert(handoffBehavior == HandoffBehavior.Compose); 659Debug.Assert(storage != null); 660Debug.Assert(storage._animationClocks != null); 704Debug.Assert(animationClocks != null); 705Debug.Assert(!animationClocks.Contains(null)); 777Debug.Assert(animation == null || IsAnimationValid(dp, animation)); 778Debug.Assert(IsPropertyAnimatable(d, dp)); 917Debug.Assert(storage._snapshotValue != DependencyProperty.UnsetValue); 929Debug.Assert(currentPropertyValue != DependencyProperty.UnsetValue); 939Debug.Assert(count > 0); 971Debug.Assert(clocksCount > 0); 972Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue); 1083Debug.Assert( AnimatedPropertyMapField.GetValue(d)[dp.GlobalIndex] == DependencyProperty.UnsetValue
System\Windows\Media\Animation\Clock.cs (121)
52Debug.Assert(timeline != null); 162Debug.Assert(!IsTimeManager); 191Debug.Assert(!IsTimeManager); 209Debug.Assert(!IsTimeManager); 231Debug.Assert(!IsTimeManager); 269Debug.Assert(!IsTimeManager); 282Debug.Assert(!IsTimeManager); 300Debug.Assert(!IsTimeManager); 327Debug.Assert(!IsTimeManager); 355Debug.Assert(!IsTimeManager); 487Debug.Assert(!IsTimeManager); 573Debug.Assert(!clock.IsTimeManager); 623Debug.Assert(!current.IsTimeManager); // We should not yet be connected to the TimeManager 701Debug.Assert(!IsTimeManager); 776Debug.Assert(!IsTimeManager); 783Debug.Assert(!(IsInteractivelyPaused && PendingInteractivePause)); 784Debug.Assert(!(!IsInteractivelyPaused && PendingInteractiveResume)); 821Debug.Assert(!IsTimeManager); 828Debug.Assert( !(IsInteractivelyPaused && PendingInteractivePause)); 829Debug.Assert( !(!IsInteractivelyPaused && PendingInteractiveResume)); 856Debug.Assert(IsRoot); 878Debug.Assert(IsRoot); 949Debug.Assert(IsRoot); 960Debug.Assert(IsRoot); 991Debug.Assert(IsRoot); 1072Debug.Assert(!IsTimeManager); 1108Debug.Assert(!IsTimeManager); 1130Debug.Assert(!IsTimeManager); 1149Debug.Assert(!IsTimeManager); 1228Debug.Assert(!IsTimeManager); 1376Debug.Assert(!IsTimeManager); 1413Debug.Assert(!IsTimeManager); 1414Debug.Assert(_parent != null && !_parent.IsTimeManager); 1786Debug.Assert(IsRoot); // root clocks only; non-roots have constant begin time 1787Debug.Assert(_rootData != null); 1792Debug.Assert(!RootBeginPending); // we can have either a begin or a seek, not both 1863Debug.Assert(_beginTime.HasValue); 1914Debug.Assert(IsRoot); 1920Debug.Assert(_rootData.DesiredFrameRate > 0); 1940Debug.Assert(!IsTimeManager); 1941Debug.Assert(!IsInteractivelyStopped); 1942Debug.Assert(_parent._currentClockState != ClockState.Stopped); 1943Debug.Assert(_currentClockState != ClockState.Stopped); 1945Debug.Assert(_beginTime.HasValue); 1947Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill 1962Debug.Assert(_currentClockState != ClockState.Active); 2171Debug.Assert(_currentClockState == ClockState.Active 2254Debug.Assert(!IsTimeManager); 2255Debug.Assert(!IsInteractivelyStopped); 2256Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2257Debug.Assert(_beginTime.HasValue); 2306Debug.Assert(!IsTimeManager); 2307Debug.Assert(!IsInteractivelyStopped); 2308Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2309Debug.Assert(_currentClockState == ClockState.Active); // Must be active at this point 2336Debug.Assert(!IsTimeManager); 2337Debug.Assert(!IsInteractivelyStopped); 2338Debug.Assert(_parent._currentClockState != ClockState.Stopped); 2339Debug.Assert(_currentClockState != ClockState.Stopped); 2429Debug.Assert(!IsTimeManager); 2471Debug.Assert(!IsTimeManager); 2472Debug.Assert(!IsInteractivelyStopped || IsRoot); 2522Debug.Assert(_beginTime.HasValue); // _currentIterationBeginTime.HasValue implies _beginTime.HasValue 2551Debug.Assert(repeatBehavior == RepeatBehavior.Forever); // Only other valid enum value 2645Debug.Assert(!IsTimeManager); 2646Debug.Assert(!IsInteractivelyStopped || IsRoot); 2658Debug.Assert(_beginTime.HasValue); 2687Debug.Assert(IsRoot); 2730Debug.Assert(_beginTime == null); 2731Debug.Assert(_currentClockState == ClockState.Stopped); 2755Debug.Assert(!IsInteractivelyPaused); // Enforce invariant: cannot be pausePending when already paused 2756Debug.Assert(!PendingInteractiveResume); // Enforce invariant: cannot be both pause and resumePending 2773Debug.Assert(IsInteractivelyPaused); 2774Debug.Assert(!PendingInteractivePause); 2802Debug.Assert(endOfActivePeriod.HasValue); 2880Debug.Assert(!IsTimeManager); 2905Debug.Assert(parentTime.HasValue); // If parent isn't stopped, it must have valid time and speed 2906Debug.Assert(parentSpeed.HasValue); 2932Debug.Assert(parentTime.HasValue); // Cannot be true unless parent is stopped 2953Debug.Assert(_beginTime.HasValue); 2954Debug.Assert(parentTime.HasValue); 2999Debug.Assert(!IsTimeManager); 3000Debug.Assert(!IsInteractivelyStopped); 3001Debug.Assert(_parent._currentClockState != ClockState.Stopped); 3002Debug.Assert(_beginTime.HasValue); 3074Debug.Assert(!IsTimeManager); 3075Debug.Assert(!IsInteractivelyStopped || IsRoot); 3157Debug.Assert(!IsTimeManager); 3158Debug.Assert(_parent != null); 3159Debug.Assert(_parent.CurrentState != ClockState.Stopped); 3162Debug.Assert(HasSeekOccuredAfterLastTick || 3166Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3167Debug.Assert(CanSlip || _timeline is ParallelTimeline && ((ParallelTimeline)_timeline).SlipBehavior == SlipBehavior.Slip); 3169Debug.Assert(_syncData != null); 3170Debug.Assert(!_syncData.IsInSyncPeriod); 3173Debug.Assert(_timeline.AutoReverse == false); 3174Debug.Assert(_timeline.AccelerationRatio == 0); 3175Debug.Assert(_timeline.DecelerationRatio == 0); 3222Debug.Assert(syncClockDuration == Duration.Automatic); 3290Debug.Assert(!IsTimeManager); 3291Debug.Assert(_parent != null); 3292Debug.Assert(_syncData != null); 3293Debug.Assert(_syncData.IsInSyncPeriod); 3296Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this); 3300Debug.Assert(!parentIntervalCollection.IsEmpty); // The parent isn't Stopped, so it must have a TIC 3304Debug.Assert(parentIntervalCollection.IsEmptyOfRealPoints || parentIntervalCollection.FirstNodeTime <= currentParentTimePT); 3305Debug.Assert(currentParentSpeed >= 0); 3435Debug.Assert(!IsTimeManager); 3516Debug.Assert(_rootData.DesiredFrameRate > 0); 3544Debug.Assert(!IsTimeManager); 3567Debug.Assert(!IsTimeManager); 3568Debug.Assert(_parent == null); 3569Debug.Assert(_timeManager == null); 3660Debug.Assert(factor != 0); // Divide by zero 3744Debug.Assert(IsRoot); // This should only be called on root-child clocks 3780Debug.Assert(!IsTimeManager); 3859Debug.Assert(!IsTimeManager); 3977Debug.Assert(syncClock != null); 3978Debug.Assert(syncClock.GetCanSlip()); 3979Debug.Assert(syncClock.IsRoot || syncClock._timeline.BeginTime.HasValue); // Only roots may later validate their _beginTime 4068Debug.Assert(_syncClockBeginTime.HasValue); // This should never be queried on a root without beginTime
System\Windows\Media\Animation\ClockGroup.cs (11)
51Debug.Assert(!IsTimeManager); 64Debug.Assert(!IsTimeManager); 77Debug.Assert(IsTimeManager); 95Debug.Assert(timelineGroup != null); 184Debug.Assert(IsTimeManager); 212Debug.Assert(IsTimeManager); 249Debug.Assert(IsTimeManager); 295Debug.Assert(group != null); // We should only have this flag set for ClockGroups 309Debug.Assert(_children != null); 433Debug.Assert(IsRoot); 459Debug.Assert(_timeManager != null); // RootActivate should be called by our own TimeManager
System\Windows\Media\Animation\DoubleAnimationUsingPath.cs (2)
164Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 257Debug.Assert(!_isValid);
System\Windows\Media\Animation\Generated\BooleanAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\BooleanKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ByteAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ByteAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ByteKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\CharAnimationUsingKeyFrames.cs (1)
312Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\CharKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ColorAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ColorAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ColorIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\ColorKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DecimalAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DecimalAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DecimalKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\DoubleAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DoubleAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\DoubleIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\DoubleKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int16Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int16AnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int16KeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int32Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int32AnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int32KeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Int64Animation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int64AnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Int64KeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\MatrixAnimationUsingKeyFrames.cs (1)
312Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\MatrixIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\MatrixKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\ObjectAnimationUsingKeyFrames.cs (1)
312Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ObjectKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Point3DAnimation.cs (1)
208Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Point3DAnimationUsingKeyFrames.cs (1)
314Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Point3DIndependentAnimationStorage.cs (1)
37Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Point3DKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\PointAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\PointAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\PointIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\PointKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\QuaternionAnimation.cs (1)
208Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\QuaternionAnimationUsingKeyFrames.cs (1)
314Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\QuaternionIndependentAnimationStorage.cs (1)
37Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\QuaternionKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\RectAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\RectAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\RectIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\RectKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Rotation3DAnimation.cs (1)
208Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Rotation3DAnimationUsingKeyFrames.cs (1)
314Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Rotation3DKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SingleAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SingleAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SingleKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\SizeAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SizeAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\SizeIndependentAnimationStorage.cs (1)
36Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\SizeKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\StringAnimationUsingKeyFrames.cs (1)
312Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\StringKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\Vector3DAnimation.cs (1)
208Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Vector3DAnimationUsingKeyFrames.cs (1)
314Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\Vector3DIndependentAnimationStorage.cs (1)
37Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\Generated\Vector3DKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Generated\VectorAnimation.cs (1)
207Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\VectorAnimationUsingKeyFrames.cs (1)
313Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\VectorKeyFrameCollection.cs (1)
477Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\IndependentAnimationStorage.cs (14)
63Debug.Assert(d != null); 67Debug.Assert(d.Dispatcher != null); 70Debug.Assert(d.CheckAccess()); 92Debug.Assert(_duceResource.IsOnChannel(channel)); 108Debug.Assert(d != null); 111Debug.Assert(d.Dispatcher != null); 114Debug.Assert(d.CheckAccess()); 179Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 211Debug.Assert(d != null); 215Debug.Assert(_duceResource.IsOnAnyChannel); 231Debug.Assert(d != null); 232Debug.Assert(dp != null); 233Debug.Assert(d is Animatable ? ((Animatable)d).HasAnimatedProperties : true); 243Debug.Assert(storage._duceResource.IsOnChannel(channel));
System\Windows\Media\Animation\KeySpline.cs (3)
254Debug.Assert(_isDirty); 306Debug.Assert(_isSpecified); 328Debug.Assert(_isSpecified);
System\Windows\Media\Animation\MatrixAnimationUsingPath.cs (2)
243Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 306Debug.Assert(!_isValid);
System\Windows\Media\Animation\PointAnimationUsingPath.cs (2)
135Debug.Assert(animationClock.CurrentState != ClockState.Stopped); 208Debug.Assert(!_isValid);
System\Windows\Media\Animation\RepeatBehavior.cs (1)
68Debug.Assert(behaviorType == RepeatBehaviorType.Forever);
System\Windows\Media\Animation\TimeIntervalCollection.cs (83)
106Debug.Assert(_minimumCapacity >= 2); 133Debug.Assert(IsEmpty); // We should start with a new or Clear()-ed collection first 140Debug.Assert(_nodeIsInterval[0] == false); 189Debug.Assert(_count == 0); // The boolean constructor already did the job for us 251Debug.Assert(_count > 0); 297Debug.Assert(IsSingleInterval); 299Debug.Assert(0 < _count && _count <= 2); 308Debug.Assert(beginTime <= _nodeTime[1]); 412Debug.Assert(_nodeTime[index] < time); 544Debug.Assert(fromIndex <= toIndex); 555Debug.Assert(toIndex >= 0); // Since fromIndex!=toIndex, toIndex must be >= 0 562Debug.Assert(fromIndex + 1 < toIndex); 618Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 682Debug.Assert(!tic1.IsEmptyOfRealPoints); // We shouldn't reach here if either TIC is empty 683Debug.Assert(!tic2.IsEmptyOfRealPoints); 711Debug.Assert(!intersectionFound); // If an intersection was already found, we should not reach this far 721Debug.Assert(tic2.CurrentNodeIsPoint || tic2.CurrentNodeIsInterval); 739Debug.Assert(!tic1.CurrentIsAtLastNode); // Thus tic1._current can be safely advanced now 745Debug.Assert(tic1.CurrentNodeTime >= tic2.CurrentNodeTime); 748Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 749Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 781Debug.Assert(tic1.NextNodeTime == tic2.NextNodeTime); 789Debug.Assert(tic1.CurrentIsAtLastNode && tic2.CurrentIsAtLastNode); 797Debug.Assert(tic2.CurrentIsAtLastNode || (tic1.CurrentNodeTime < tic2.NextNodeTime)); 798Debug.Assert(tic1.CurrentIsAtLastNode || (tic2.CurrentNodeTime < tic1.NextNodeTime)); 809Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 857Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 876Debug.Assert(beginTime <= CurrentNodeTime); // The PTIC is clipped by the active period, and we are a subset of the active period 877Debug.Assert(CurrentIsAtLastNode || beginTime < NextNodeTime); 984Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1032Debug.Assert(projection.IsEmpty); // Make sure the projection was properly cleared first 1033Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1034Debug.Assert(beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1036Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the postfill zone. So we cannot be empty. 1037Debug.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 1038Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1155Debug.Assert(projection.IsEmpty); 1156Debug.Assert(!_invertCollection); // Make sure we never leave inverted mode enabled 1157Debug.Assert(!endTime.HasValue || beginTime <= endTime); // Ensure legitimate begin/end clipping parameters 1159Debug.Assert(!IsEmptyOfRealPoints); // We assume this function is ONLY called when this collection overlaps the active zone. So we cannot be empty. 1160Debug.Assert(!endTime.HasValue || endTime >= _nodeTime[0]); // EndTime must come at or after our first node (it can be infinite) 1161Debug.Assert(_nodeTime[_count - 1] >= beginTime); // Our last node must come at least at begin time (since we must intersect the active period) 1162Debug.Assert(endTime.HasValue || fillDuration == TimeSpan.Zero); // Either endTime is finite, or it's infinite hence we cannot have any fill zone 1163Debug.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 1164Debug.Assert(!_nodeIsInterval[_count - 1]); // We should not have an infinite domain set 1238Debug.Assert(!IsEmptyOfRealPoints); 1239Debug.Assert(projection.IsEmpty); 1278Debug.Assert(_current > 0); // The only way _current could stay at zero is if the collection begins at (or past) the end of active period 1283Debug.Assert(endTime.HasValue && CurrentNodeTime >= endTime.Value); 1308Debug.Assert(!IsEmptyOfRealPoints); // The entire projection process assumes we are not empty (have an intersection with the active zone). 1309Debug.Assert(periodInTicks > 0); // We do not handle the degenerate case here. 1313Debug.Assert(CurrentNodeTime >= TimeSpan.Zero); // Verify that we are already clipped 1330Debug.Assert(CurrentNodeIsPoint); 1350Debug.Assert(CurrentNodeIsPoint); // We should only call this method when we project a legitimate point 1351Debug.Assert(!CurrentNodeIsInterval); 1422Debug.Assert(timeBeforeNextPeriod > 0); 1495Debug.Assert(intervalLength > 0); 1578Debug.Assert(index == -1 || _nodeTime[index] < point); 1609Debug.Assert(from < to); // Our code should never call MergeInterval for a point or reversed interval 1625Debug.Assert(_nodeTime.Length >= _minimumCapacity); // Assert that we indeed have memory allocated 1663Debug.Assert(_nodeTime[fromIndex] == from); 1694Debug.Assert(_nodeTime[toIndex] == to); 1695Debug.Assert(fromIndex < toIndex); 1726Debug.Assert(_count + netIncreaseInNodes >= 2); // We should never shrink past size 2 1774Debug.Assert(_nodeIsPoint == null); 1775Debug.Assert(_nodeIsInterval == null); 1783Debug.Assert(_nodeIsPoint != null); 1784Debug.Assert(_nodeIsInterval != null); 1815Debug.Assert(periodInTicks > 0); 1816Debug.Assert(accelRatio + decelRatio > 0); 2130Debug.Assert(_count > 0); // Count cannot be negative 2156Debug.Assert(right == _count - 1); 2186Debug.Assert(_current <= _count); 2201Debug.Assert(_current < _count); 2206Debug.Assert(_current < _count); 2215Debug.Assert(_current < _count); 2220Debug.Assert(_current < _count); 2229Debug.Assert(_current < _count); 2234Debug.Assert(_current < _count); 2243Debug.Assert(_current + 1 < _count); 2252Debug.Assert(_current + 1 < _count); 2261Debug.Assert(_current + 1 < _count); 2276Debug.Assert(_invertCollection != mode); // Make sure we aren't redundantly setting the mode
System\Windows\Media\Animation\Timeline.cs (1)
923Debug.Assert(sourceStore.Count > 0);
System\Windows\Media\Animation\WeakRefEnumerator.cs (2)
55Debug.Assert(_valid); 73Debug.Assert(_valid);
System\Windows\Media\BitmapCacheBrush.cs (10)
197Debug.Assert(!_pendingLayout); 255Debug.Assert(element != null); 275Debug.Assert(_pendingLayout); 279Debug.Assert(element != null); 290Debug.Assert(_DispatcherLayoutResult != null); 291Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 293Debug.Assert(abortStatus); 305Debug.Assert(_pendingLayout); 308Debug.Assert(element != null); 346Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\BoundsDrawingContextWalker.cs (4)
502Debug.Assert(_pushTypeStack != null); 503Debug.Assert(_pushTypeStack.Count > 0); 512Debug.Assert(_transformStack != null); 513Debug.Assert(_transformStack.Count > 0);
System\Windows\Media\ByteStreamGeometryContext.cs (7)
313Debug.Assert(sizeof(MIL_PATHGEOMETRY) <= _currOffset); 314Debug.Assert(_currentPathGeometryData.Size == (uint)_currOffset); 543Debug.Assert(_currentPathFigureDataOffset + sizeof(MIL_PATHFIGURE) <= _currOffset); 583Debug.Assert(_currentPolySegmentDataOffset + sizeof(MIL_SEGMENT_POLY) <= _currOffset); 666Debug.Assert(points != null); 667Debug.Assert(count > 0); 716Debug.Assert((_currentPolySegmentDataOffset != -1) &&
System\Windows\Media\ColorContext.cs (2)
150Debug.Assert(_profileUri is null); 576Debug.Assert(stm != null);
System\Windows\Media\ColorTransformHelper.cs (2)
72Debug.Assert(success); 74Debug.Assert(success);
System\Windows\Media\CombinedGeometry.cs (1)
189Debug.Assert(false);
System\Windows\Media\CompositionTarget.cs (6)
49Debug.Assert(channel != null); 50Debug.Assert(!_contentRoot.IsOnChannel(channel)); 52Debug.Assert(outOfBandChannel != null); 53Debug.Assert(!_contentRoot.IsOnChannel(outOfBandChannel)); 64Debug.Assert(resourceCreated); 441Debug.Assert(_cachedRenderContext == null);
System\Windows\Media\Drawing.cs (1)
73Debug.Assert(ctx != null);
System\Windows\Media\DrawingContextDrawingContextWalker.cs (1)
26Debug.Assert (drawingContext != null);
System\Windows\Media\DrawingContextWalker.cs (2)
31Debug.Assert(false); 41Debug.Assert(false);
System\Windows\Media\DrawingDrawingContext.cs (3)
1289Debug.Assert(geometry != null); 1377Debug.Assert(newDrawing != null); 1383Debug.Assert(_currentDrawingGroup == null);
System\Windows\Media\DrawingGroup.cs (3)
81Debug.Assert(_open); 82Debug.Assert(rootDrawingGroupChildren != null); 161Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\DrawingGroupDrawingContext.cs (2)
21Debug.Assert(null != drawingGroup); 39Debug.Assert(null != _drawingGroup);
System\Windows\Media\DrawingVisual.cs (4)
51Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 136Debug.Assert(_proxy.IsOnChannel(channel)); 206Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 207Debug.Assert(_proxy.IsOnChannel(channel));
System\Windows\Media\DrawingVisualDrawingContext.cs (2)
23Debug.Assert(null != ownerVisual); 39Debug.Assert(null != _ownerVisual);
System\Windows\Media\Effects\Generated\BlurEffect.cs (2)
160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 204Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\DropShadowEffect.cs (2)
226Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 293Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ImplicitInputBrush.cs (2)
97Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 174Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\PixelShader.cs (1)
162Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\Generated\ShaderEffect.cs (3)
95Debug.Assert(!channel.IsOutOfBandChannel); 96Debug.Assert(!targetResource.GetHandle(channel).IsNull); 180Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\PixelShader.cs (3)
82Debug.Assert(newUri.IsAbsoluteUri); 145Debug.Assert(len == lengthRead); 168Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\Effects\ShaderEffect.cs (7)
401Debug.Assert(false); 541Debug.Assert(!channel.IsOutOfBandChannel); 542Debug.Assert(!targetResource.GetHandle(channel).IsNull); 555Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 709Debug.Assert(sizeof(DUCE.ResourceHandle) == sizeof(Int32)); 788Debug.Assert(_duceResource.IsOnChannel(channel)); 938Debug.Assert(false);
System\Windows\Media\FactoryMaker.cs (2)
101Debug.Assert(s_pFactory != IntPtr.Zero); 117Debug.Assert(s_pImagingFactory != IntPtr.Zero);
System\Windows\Media\FamilyMap.cs (1)
351Debug.Assert(first <= last);
System\Windows\Media\FontFamilyConverter.cs (3)
164Debug.Assert(name != null); 169Debug.Assert(name != null); 174Debug.Assert(name != null);
System\Windows\Media\FormattedText.cs (4)
991Debug.Assert(_nextLine == null); 1011Debug.Assert(_totalHeight + _currentLine.Height <= _that._maxTextHeight); 1098Debug.Assert(_that._text.Length > 0 && textSourcePosition + line.Length <= _that._text.Length + 1); 1114Debug.Assert(_that._trimming == TextTrimming.WordEllipsis);
System\Windows\Media\Generated\BitmapCache.cs (2)
161Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 205Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\BitmapCacheBrush.cs (10)
98Debug.Assert(!channel.IsOutOfBandChannel); 99Debug.Assert(!targetResource.GetHandle(channel).IsNull); 135Debug.Assert(element != null); 138Debug.Assert(target._DispatcherLayoutResult != null); 139Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 141Debug.Assert(abortStatus); 159Debug.Assert(!channel.IsOutOfBandChannel); 160Debug.Assert(!targetResource.GetHandle(channel).IsNull); 294Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 382Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Brush.cs (4)
103Debug.Assert(!channel.IsOutOfBandChannel); 104Debug.Assert(!targetResource.GetHandle(channel).IsNull); 147Debug.Assert(!channel.IsOutOfBandChannel); 148Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\CombinedGeometry.cs (6)
97Debug.Assert(!channel.IsOutOfBandChannel); 98Debug.Assert(!targetResource.GetHandle(channel).IsNull); 141Debug.Assert(!channel.IsOutOfBandChannel); 142Debug.Assert(!targetResource.GetHandle(channel).IsNull); 234Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 299Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DashStyle.cs (2)
140Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 208Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingBrush.cs (4)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 153Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 256Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\DrawingContextWalker.cs (24)
36Debug.Assert(false); 56Debug.Assert(false); 78Debug.Assert(false); 102Debug.Assert(false); 134Debug.Assert(false); 172Debug.Assert(false); 206Debug.Assert(false); 246Debug.Assert(false); 268Debug.Assert(false); 286Debug.Assert(false); 306Debug.Assert(false); 321Debug.Assert(false); 348Debug.Assert(false); 366Debug.Assert(false); 378Debug.Assert(false); 390Debug.Assert(false); 404Debug.Assert(false); 420Debug.Assert(false); 432Debug.Assert(false); 444Debug.Assert(false); 455Debug.Assert(false); 472Debug.Assert(false); 487Debug.Assert(false); 496Debug.Assert(false);
System\Windows\Media\Generated\DrawingGroup.cs (18)
112Debug.Assert(!channel.IsOutOfBandChannel); 113Debug.Assert(!targetResource.GetHandle(channel).IsNull); 125Debug.Assert(resource != null); 136Debug.Assert(resource != null); 179Debug.Assert(!channel.IsOutOfBandChannel); 180Debug.Assert(!targetResource.GetHandle(channel).IsNull); 230Debug.Assert(!channel.IsOutOfBandChannel); 231Debug.Assert(!targetResource.GetHandle(channel).IsNull); 274Debug.Assert(!channel.IsOutOfBandChannel); 275Debug.Assert(!targetResource.GetHandle(channel).IsNull); 318Debug.Assert(!channel.IsOutOfBandChannel); 319Debug.Assert(!targetResource.GetHandle(channel).IsNull); 521Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 630Debug.Assert(_duceResource.IsOnChannel(channel)); 684Debug.Assert(!channel.IsOutOfBandChannel); 685Debug.Assert(!thisResource.GetHandle(channel).IsNull); 709Debug.Assert(!channel.IsOutOfBandChannel); 710Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\DrawingImage.cs (4)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 153Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 197Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\EllipseGeometry.cs (2)
160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 234Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Geometry.cs (2)
101Debug.Assert(!channel.IsOutOfBandChannel); 102Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\GeometryDrawing.cs (8)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 134Debug.Assert(!channel.IsOutOfBandChannel); 135Debug.Assert(!targetResource.GetHandle(channel).IsNull); 178Debug.Assert(!channel.IsOutOfBandChannel); 179Debug.Assert(!targetResource.GetHandle(channel).IsNull); 271Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 325Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GeometryGroup.cs (10)
119Debug.Assert(!channel.IsOutOfBandChannel); 120Debug.Assert(!targetResource.GetHandle(channel).IsNull); 132Debug.Assert(resource != null); 143Debug.Assert(resource != null); 220Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 304Debug.Assert(_duceResource.IsOnChannel(channel)); 352Debug.Assert(!channel.IsOutOfBandChannel); 353Debug.Assert(!thisResource.GetHandle(channel).IsNull); 377Debug.Assert(!channel.IsOutOfBandChannel); 378Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\GlyphRunDrawing.cs (6)
75Debug.Assert(!channel.IsOutOfBandChannel); 76Debug.Assert(!targetResource.GetHandle(channel).IsNull); 119Debug.Assert(!channel.IsOutOfBandChannel); 120Debug.Assert(!targetResource.GetHandle(channel).IsNull); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 246Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\GuidelineSet.cs (2)
163Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 238Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageBrush.cs (4)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 153Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 256Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ImageDrawing.cs (4)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 175Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 227Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LinearGradientBrush.cs (1)
159Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\LineGeometry.cs (2)
138Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 206Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\MatrixTransform.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 158Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\PathGeometry.cs (1)
164Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\Pen.cs (6)
91Debug.Assert(!channel.IsOutOfBandChannel); 92Debug.Assert(!targetResource.GetHandle(channel).IsNull); 177Debug.Assert(!channel.IsOutOfBandChannel); 178Debug.Assert(!targetResource.GetHandle(channel).IsNull); 345Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 412Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RadialGradientBrush.cs (1)
203Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RectangleGeometry.cs (2)
160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 234Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\RenderData.cs (11)
512Debug.Assert(_duceResource.IsOnChannel(channel)); 524Debug.Assert(cbExtraData <= (uint)Int32.MaxValue); 540Debug.Assert((_buffer != null) || (_curOffset == 0)); 543Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1085Debug.Assert(false); 1109Debug.Assert((_buffer != null) || (_curOffset == 0)); 1112Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1425Debug.Assert(false); 1449Debug.Assert((_buffer != null) || (_curOffset == 0)); 1452Debug.Assert((_buffer == null) || (_curOffset <= _buffer.Length)); 1777Debug.Assert(false);
System\Windows\Media\Generated\RenderDataDrawingContext.cs (25)
59Debug.Assert(sizeof(MILCMD_DRAW_LINE) == 40); 117Debug.Assert(sizeof(MILCMD_DRAW_LINE_ANIMATE) == 48); 169Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE) == 40); 228Debug.Assert(sizeof(MILCMD_DRAW_RECTANGLE_ANIMATE) == 48); 292Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE) == 56); 373Debug.Assert(sizeof(MILCMD_DRAW_ROUNDED_RECTANGLE_ANIMATE) == 72); 439Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE) == 40); 522Debug.Assert(sizeof(MILCMD_DRAW_ELLIPSE_ANIMATE) == 56); 574Debug.Assert(sizeof(MILCMD_DRAW_GEOMETRY) == 16); 622Debug.Assert(sizeof(MILCMD_DRAW_IMAGE) == 40); 676Debug.Assert(sizeof(MILCMD_DRAW_IMAGE_ANIMATE) == 40); 720Debug.Assert(sizeof(MILCMD_DRAW_GLYPH_RUN) == 8); 760Debug.Assert(sizeof(MILCMD_DRAW_DRAWING) == 8); 806Debug.Assert(sizeof(MILCMD_DRAW_VIDEO) == 40); 858Debug.Assert(sizeof(MILCMD_DRAW_VIDEO_ANIMATE) == 40); 894Debug.Assert(sizeof(MILCMD_PUSH_CLIP) == 8); 933Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_MASK) == 24); 974Debug.Assert(sizeof(MILCMD_PUSH_OPACITY) == 8); 1021Debug.Assert(sizeof(MILCMD_PUSH_OPACITY_ANIMATE) == 16); 1059Debug.Assert(sizeof(MILCMD_PUSH_TRANSFORM) == 8); 1137Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_SET) == 8); 1176Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y1) == 8); 1221Debug.Assert(sizeof(MILCMD_PUSH_GUIDELINE_Y2) == 16); 1264Debug.Assert(sizeof(MILCMD_PUSH_EFFECT) == 8); 1308Debug.Assert(sizeof(MILCMD_POP) == 1);
System\Windows\Media\Generated\RotateTransform.cs (2)
160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 214Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\ScaleTransform.cs (2)
182Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 242Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SkewTransform.cs (2)
182Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 242Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\SolidColorBrush.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 199Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\TransformGroup.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 124Debug.Assert(resource != null); 135Debug.Assert(resource != null); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 262Debug.Assert(_duceResource.IsOnChannel(channel)); 307Debug.Assert(!channel.IsOutOfBandChannel); 308Debug.Assert(!thisResource.GetHandle(channel).IsNull); 332Debug.Assert(!channel.IsOutOfBandChannel); 333Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media\Generated\TranslateTransform.cs (2)
138Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 186Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VideoDrawing.cs (4)
75Debug.Assert(!channel.IsOutOfBandChannel); 76Debug.Assert(!targetResource.GetHandle(channel).IsNull); 160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 212Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Generated\VisualBrush.cs (8)
77Debug.Assert(element != null); 80Debug.Assert(target._DispatcherLayoutResult != null); 81Debug.Assert(target._DispatcherLayoutResult.Status == System.Windows.Threading.DispatcherOperationStatus.Pending); 83Debug.Assert(abortStatus); 101Debug.Assert(!channel.IsOutOfBandChannel); 102Debug.Assert(!targetResource.GetHandle(channel).IsNull); 188Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 292Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\Geometry.cs (5)
181Debug.Assert(pWorldMatrix != null); 287Debug.Assert(pbPathData != (byte*)0); 405Debug.Assert(pbPathData != (byte*)0); 604Debug.Assert(pbPathData != (byte*)0); 687Debug.Assert(pbPathData != (byte*)0);
System\Windows\Media\GeometryDrawing.cs (1)
56Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GeometryGroup.cs (1)
49Debug.Assert(pg.CanFreeze);
System\Windows\Media\GlyphRun.cs (6)
603Debug.Assert(clusterMap[currentClusterStart] < lastGlyphInCluster); 1307Debug.Assert(!IsSideways); 1566Debug.Assert(!IsSideways); 1847Debug.Assert(_glyphTypeface != null); 2349Debug.Assert(!IsInitializing); 2360Debug.Assert(!IsInitialized);
System\Windows\Media\GlyphRunDrawing.cs (1)
52Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\GlyphsSerializer.cs (5)
90Debug.Assert(_clusters[characterIndex] > glyphClusterStart); 101Debug.Assert(_indices.Count > glyphClusterStart - _glyphClusterInitialOffset); 107Debug.Assert(_characters == null || _characters.Count == 0 || _indices.Count == _characters.Count); 155Debug.Assert(_glyphStringBuider.Length == 0); 307Debug.Assert(caretStopStringLength == sb.ToString().Length);
System\Windows\Media\GlyphTypeface.cs (2)
1384Debug.Assert(charBufferRange.Length > 0); 1459Debug.Assert(glyphIndices != null || glyphMetrics != null);
System\Windows\Media\GuidelineCollection.cs (2)
49Debug.Assert(!isDynamic || guidelinesX.Length % 2 == 0); 58Debug.Assert(!isDynamic || guidelinesY.Length % 2 == 0);
System\Windows\Media\HitTestWithGeometryDrawingContextWalker.cs (8)
30Debug.Assert(geometry != null); 330Debug.Assert(_modifierStack != null); 331Debug.Assert(_modifierStack.Count > 0); 341Debug.Assert((_modifierStack.Count > 0) || (_currentTransform == null)); 349Debug.Assert((_modifierStack.Count > 0) || (_currentClip == null)); 353Debug.Assert(currentModifier == null); 379Debug.Assert(_intersectionDetail != IntersectionDetail.FullyContains); 384Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
System\Windows\Media\HitTestWithPointDrawingContextWalker.cs (7)
334Debug.Assert(_pointStack != null); 335Debug.Assert(_pointStack.Count > 0); 371Debug.Assert(_noOpLayerDepth >= 1); 408Debug.Assert(!_currentLayerIsNoOp); 409Debug.Assert(_noOpLayerDepth == 0); 419Debug.Assert(_currentLayerIsNoOp); 420Debug.Assert(_noOpLayerDepth == 0);
System\Windows\Media\HostVisual.cs (9)
135Debug.Assert(target != null); 136Debug.Assert(target.Dispatcher.Thread == Thread.CurrentThread); 188Debug.Assert(_target != null); 189Debug.Assert(_target.Dispatcher.Thread == Thread.CurrentThread); 211Debug.Assert(!targetsHandle.IsNull); 247Debug.Assert(IsOnChannel(channel)); 260Debug.Assert(_target._contentRoot.IsOnChannel(channel)); 261Debug.Assert(_target.OutOfBandChannel == MediaContext.CurrentMediaContext.OutOfBandChannel); 263Debug.Assert(!created);
System\Windows\Media\Imaging\BitmapCodecInfo.cs (9)
35Debug.Assert(codecInfoHandle != null); 86Debug.Assert(length >= 0); 129Debug.Assert(length >= 0); 172Debug.Assert(length >= 0); 215Debug.Assert(length >= 0); 258Debug.Assert(length >= 0); 301Debug.Assert(length >= 0); 344Debug.Assert(length >= 0); 387Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapDecoder.cs (4)
928Debug.Assert(_syncObject != null); 1010Debug.Assert((uri.Scheme == Uri.UriSchemeHttp) || (uri.Scheme == Uri.UriSchemeHttps)); 1011Debug.Assert(stream.CanSeek); 1163Debug.Assert(decoder != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapDownload.cs (1)
383Debug.Assert(false);
System\Windows\Media\Imaging\BitmapEncoder.cs (2)
362Debug.Assert(_supportsGlobalThumbnail); 394Debug.Assert(_supportsGlobalMetadata);
System\Windows\Media\Imaging\BitmapFrameDecode.cs (7)
36Debug.Assert(decoder != null); 126Debug.Assert(decoder != null); 428Debug.Assert(_decoder != null); 682Debug.Assert(_decoder is LateBoundBitmapDecoder); 683Debug.Assert(IsDownloading == false); 688Debug.Assert(_decoder.InternalDecoder != null); 693Debug.Assert(_syncObject != null);
System\Windows\Media\Imaging\BitmapFrameEncode.cs (2)
34Debug.Assert(source != null); 163Debug.Assert(sourceBitmapFrameEncode._source != null);
System\Windows\Media\Imaging\BitmapImage.cs (5)
218Debug.Assert(_decoder != null); 356Debug.Assert(decoder.SyncObject != null); 362Debug.Assert(!_decoder.IsDownloading); 431Debug.Assert(oldWidth > 0 && oldHeight > 0); 458Debug.Assert(false);
System\Windows\Media\Imaging\BitmapMetadata.cs (4)
484Debug.Assert(blockWriter != null); 485Debug.Assert(blockWriter.MetadataBlocks != null); 912Debug.Assert(length >= 0); 954Debug.Assert(length >= 0);
System\Windows\Media\Imaging\BitmapMetadataEnumerator.cs (1)
163Debug.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)
287Debug.Assert(key < c_maxPalettes);
System\Windows\Media\Imaging\BitmapSizeOptions.cs (4)
201Debug.Assert(_preservesAspectRatio == true); 208Debug.Assert(_preservesAspectRatio == true); 215Debug.Assert(_preservesAspectRatio == false); 256Debug.Assert(false);
System\Windows\Media\Imaging\BitmapSource.cs (5)
546Debug.Assert(_syncObject != null); 783Debug.Assert(_isSourceCached); 962Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 994Debug.Assert(_duceResource.IsOnChannel(channel)); 1180Debug.Assert(destFmt == colorConvertedBitmap.Format);
System\Windows\Media\Imaging\BitmapSourceSafeMILHandle.cs (1)
87Debug.Assert(wicBitmap != IntPtr.Zero);
System\Windows\Media\Imaging\BitmapVisualManager.cs (2)
78Debug.Assert ((sizeX > 0) && (sizeY > 0)); 79Debug.Assert ((dpiX > 0) && (dpiY > 0));
System\Windows\Media\Imaging\InteropBitmapSource.cs (4)
51Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 82Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 129Debug.Assert (_unmanagedSource != null && !_unmanagedSource.IsInvalid); 375Debug.Assert(_sizeOptions.Rotation == Rotation.Rotate0);
System\Windows\Media\Imaging\LateBoundBitmapDecoder.cs (1)
291Debug.Assert(newStream.CanSeek == true);
System\Windows\Media\Imaging\RenderTargetBitmap.cs (2)
249Debug.Assert(renderTargetBitmap != null && !renderTargetBitmap.IsInvalid); 255Debug.Assert(bitmapSource != null && !bitmapSource.IsInvalid);
System\Windows\Media\Imaging\TransformedBitmap.cs (1)
134Debug.Assert(DoubleUtil.IsZero(m.M11) && DoubleUtil.IsZero(m.M22));
System\Windows\Media\Imaging\WriteableBitmap.cs (12)
211Debug.Assert(locked); 584Debug.Assert(_pBackBufferLock == null); 631Debug.Assert(!_isWaitingForCommit); 806Debug.Assert(!(backwardsCompat && (sourceRect.X < 0 || sourceRect.Y < 0 || sourceRect.Width < 0 || sourceRect.Height < 0))); 843Debug.Assert(!(backwardsCompat && sourceBufferStride < 1)); 848Debug.Assert(!backwardsCompat); 1170Debug.Assert(_duceResource.IsOnChannel(channel)); 1213Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 1277Debug.Assert(_isWaitingForCommit); // How else are we here? 1280Debug.Assert(_lockCount == 0); // How else are we here? 1281Debug.Assert(_hasDirtyRects); // How else are we here? 1291Debug.Assert(_duceResource.IsOnChannel(channel)); // How else are we here?
System\Windows\Media\LinearGradientBrush.cs (1)
122Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\MatrixStack.cs (4)
159Debug.Assert(!IsEmpty); 171Debug.Assert(!IsEmpty); 187Debug.Assert(_size == 0); // The stack must be empty before this is called. 188Debug.Assert(_highWaterMark <= _items.Length);
System\Windows\Media\MediaContext.cs (23)
189Debug.Assert(dispatcher.Reserved0 == null); 345Debug.Assert(CheckAccess()); 1346Debug.Assert(Channel != null); 1372Debug.Assert(dispatcher.Reserved0 == cm); 1395Debug.Assert(CheckAccess()); 1404Debug.Assert(CheckAccess()); 1435Debug.Assert(_timeManager != null); 1464Debug.Assert(dispatcher != null); 1465Debug.Assert(iv != null); 1477Debug.Assert(!_isDisposed); 1478Debug.Assert(iv != null); 1505Debug.Assert(dispatcher != null); 1506Debug.Assert(iv != null); 1517Debug.Assert(iv != null); 1567Debug.Assert(callback != null); 1572Debug.Assert(arg != null); 1611Debug.Assert(op != null); 1649Debug.Assert(CheckAccess()); 1773Debug.Assert(CheckAccess()); 1774Debug.Assert( 2015Debug.Assert(CheckAccess()); 2017Debug.Assert(!_isDisposed); 2018Debug.Assert(_registeredICompositionTargets != null);
System\Windows\Media\MediaContextNotificationWindow.cs (1)
133Debug.Assert(_ownerMediaContext != null);
System\Windows\Media\MediaPlayer.cs (1)
554Debug.Assert(_duceResource._duceResource.IsOnChannel(channel));
System\Windows\Media\MediaPlayerState.cs (2)
864Debug.Assert(absoluteUri.IsAbsoluteUri); 964Debug.Assert(_nativeMedia != null && !_nativeMedia.IsInvalid);
System\Windows\Media\MediaSystem.cs (1)
123Debug.Assert(s_refCount > 0);
System\Windows\Media\MILUtilities.cs (10)
84Debug.Assert(pD3DMatrix[2] == 0.0f || Single.IsNaN(pD3DMatrix[2])); 85Debug.Assert(pD3DMatrix[3] == 0.0f || Single.IsNaN(pD3DMatrix[3])); 93Debug.Assert(pD3DMatrix[6] == 0.0f || Single.IsNaN(pD3DMatrix[6])); 94Debug.Assert(pD3DMatrix[7] == 0.0f || Single.IsNaN(pD3DMatrix[7])); 100Debug.Assert(pD3DMatrix[8] == 0.0f || Single.IsNaN(pD3DMatrix[8])); 101Debug.Assert(pD3DMatrix[9] == 0.0f || Single.IsNaN(pD3DMatrix[9])); 102Debug.Assert(pD3DMatrix[10] == 1.0f || Single.IsNaN(pD3DMatrix[10])); 103Debug.Assert(pD3DMatrix[11] == 0.0f || Single.IsNaN(pD3DMatrix[11])); 111Debug.Assert(pD3DMatrix[14] == 0.0f || Single.IsNaN(pD3DMatrix[14])); 112Debug.Assert(pD3DMatrix[15] == 1.0f || Single.IsNaN(pD3DMatrix[15]));
System\Windows\Media\PathGeometry.cs (30)
114Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_PATHGEOMETRY)); 135Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_PATHFIGURE)); 155Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT)); 156Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT)); 165Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 166Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_LINE)); 180Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 181Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_BEZIER)); 197Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 198Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_QUADRATICBEZIER)); 213Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 214Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_ARC)); 234Debug.Assert(pathData.SerializedData.Length >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 235Debug.Assert(pathData.Size >= currentOffset + sizeof(MIL_SEGMENT_POLY)); 239Debug.Assert(pSegmentPoly->Count <= Int32.MaxValue); 246Debug.Assert(pathData.SerializedData.Length >= 250Debug.Assert(pathData.Size >= 344Debug.Assert(result != null); 363Debug.Assert(figureCollection != null); 480Debug.Assert(sameSegCount == 1); 511Debug.Assert(sameSegCount == 1); 570Debug.Assert(pbPathData != (byte*)0); 614Debug.Assert(pPathData1 != (byte*)0); 618Debug.Assert(pPathData2 != (byte*)0); 751Debug.Assert(!pathData.IsEmpty()); 767Debug.Assert(pbPathData != (byte*)0); 823Debug.Assert(pbPathData1 != (byte*)0); 827Debug.Assert(pbPathData2 != (byte*)0); 856Debug.Assert(detail != IntersectionDetail.NotCalculated); 978Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\PathStreamGeometryContext.cs (17)
67Debug.Assert(figureCount > 0); 78Debug.Assert(segmentCount > 0); 89Debug.Assert(_currentFigure != null); 104Debug.Assert(_currentFigure == null || _figures != null); 231Debug.Assert(_figures != null); 232Debug.Assert(_currentFigure != null); 289Debug.Assert(false); 301Debug.Assert(_currentSegmentPoints == null); 311Debug.Assert(points != null); 328Debug.Assert(_figures != null); 329Debug.Assert(_currentFigure != null); 331Debug.Assert(count != 0); 357Debug.Assert(_currentFigure != null); 361Debug.Assert(count > 0); 408Debug.Assert(count % 3 == 0); 429Debug.Assert(count % 2 == 0); 440Debug.Assert(false);
System\Windows\Media\Pen.cs (7)
84Debug.Assert((MIL_PEN_CAP)PenLineCap.Flat == MIL_PEN_CAP.MilPenCapFlat); 85Debug.Assert((MIL_PEN_CAP)PenLineCap.Square == MIL_PEN_CAP.MilPenCapSquare); 86Debug.Assert((MIL_PEN_CAP)PenLineCap.Round == MIL_PEN_CAP.MilPenCapRound); 87Debug.Assert((MIL_PEN_CAP)PenLineCap.Triangle == MIL_PEN_CAP.MilPenCapTriangle); 94Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Miter == MIL_PEN_JOIN.MilPenJoinMiter); 95Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Bevel == MIL_PEN_JOIN.MilPenJoinBevel); 96Debug.Assert((MIL_PEN_JOIN)PenLineJoin.Round == MIL_PEN_JOIN.MilPenJoinRound);
System\Windows\Media\PixelFormat.cs (7)
54Debug.Assert(mask != null); 151Debug.Assert(Unsafe.SizeOf<Guid>() == 16); 338Debug.Assert(pixelFormatInfo != IntPtr.Zero); 349Debug.Assert(channelCount >= 1); 360Debug.Assert(cbBytes > 0); 369Debug.Assert(cbBytes == channelMask.Length); 437Debug.Assert(pixelFormatInfo != IntPtr.Zero);
System\Windows\Media\RadialGradientBrush.cs (1)
63Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel));
System\Windows\Media\RenderCapability.cs (3)
36Debug.Assert(mediaContext != null); 163Debug.Assert(mediaContext != null); 174Debug.Assert(mediaContext != null);
System\Windows\Media\RenderContext.cs (1)
82Debug.Assert(channel != null);
System\Windows\Media\RenderData.cs (16)
76Debug.Assert(cbRecordSize >= 0); 79Debug.Assert((_curOffset % 8) == 0); 80Debug.Assert((cbRecordSize % 8) == 0); 81Debug.Assert((sizeof(RecordHeader) % 8) == 0); 99Debug.Assert((_buffer != null) && (_buffer.Length >= newOffset)); 102Debug.Assert(_buffer.Length > 0); 127Debug.Assert(ctx != null); 229Debug.Assert(!this.IsFrozen); 269Debug.Assert(_dependentResources[i] as Freezable == null); 358Debug.Assert(_duceResource.IsOnChannel(channel)); 385Debug.Assert(_duceResource.IsOnChannel(channel)); 437Debug.Assert(_duceResource.IsOnChannel(channel)); 452Debug.Assert(cbRequiredSize >= 0); 462Debug.Assert(_buffer.Length < cbRequiredSize); 472Debug.Assert(newSize >= cbRequiredSize); 498Debug.Assert(index <= (uint)Int32.MaxValue);
System\Windows\Media\StreamGeometry.cs (5)
92Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 116Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 136Debug.Assert((_data != null) && (_data.Length >= sizeof(MIL_PATHGEOMETRY))); 374Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 442Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media\textformatting\TextCharacters.cs (3)
192Debug.Assert(characterBufferReference.CharacterBuffer == _characterBufferReference.CharacterBuffer); 193Debug.Assert(offsetToFirstChar >= 0 && offsetToFirstChar < _length); 283Debug.Assert(shapeables != null);
System\Windows\Media\Typeface.cs (1)
513Debug.Assert(i > 0);
System\Windows\Media\VideoDrawing.cs (1)
41Debug.Assert(!ctx.ShouldStopWalking);
System\Windows\Media\Visual.cs (23)
561Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 639Debug.Assert(IsOnChannel(channel)); 640Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 841Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 867Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 892Debug.Assert(cyclicBrushToChannelsMap != null); 893Debug.Assert(cyclicBrushToChannelsMap.ContainsKey(cyclicBrush)); 894Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0); 915Debug.Assert(channelsToCyclicBrushMap != null); 916Debug.Assert(channelsToCyclicBrushMap.ContainsKey(channel)); 917Debug.Assert(channelsToCyclicBrushMap[channel] > 0); 1293Debug.Assert(CheckFlagsAnd(VisualFlags.ReentrancyFlag)); // Exit must be matched with Enter. See Enter comments. 2072Debug.Assert(BitmapEffectStateField.GetValue(this) != null); 2203Debug.Assert(bitmapEffectState != null); 2242Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2300Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 2364Debug.Assert(resultCallback != null); 2425Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3198Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen); 3267Debug.Assert(bitmapEffectState != null); 4468Debug.Assert(ancestor != null); 4585Debug.Assert((group == null) || (group.Children.Count > 0)); 4660Debug.Assert(ancestor != null);
System\Windows\Media\VisualBrush.cs (10)
179Debug.Assert(!_pendingLayout); 222Debug.Assert(element != null); 244Debug.Assert(_pendingLayout); 248Debug.Assert(element != null); 259Debug.Assert(_DispatcherLayoutResult != null); 260Debug.Assert(_DispatcherLayoutResult.Status == DispatcherOperationStatus.Pending); 262Debug.Assert(abortStatus); 274Debug.Assert(_pendingLayout); 277Debug.Assert(element != null); 315Debug.Assert(_reentrancyFlag); // Exit must be matched with Enter. See Enter comments.
System\Windows\Media\VisualCollection.cs (16)
71Debug.Assert(_owner != null); 77Debug.Assert(_owner != null); 83Debug.Assert(_owner != null); 90Debug.Assert(_owner != null); 254Debug.Assert(_items != null); 379Debug.Assert(value != null); 380Debug.Assert(_items[index] == null); 381Debug.Assert(value._parent == null); 382Debug.Assert(!value.IsRootElement); 397Debug.Assert(_items[index] != null); 453Debug.Assert(_items[addedPosition] == null); 532Debug.Assert(visual._parent != null); 647Debug.Assert(_items[i]._parent == _owner); 815Debug.Assert(visual._parent != null); 816Debug.Assert(destination == null || destination._parent == visual._parent); 968Debug.Assert(_index == -2);
System\Windows\Media\VisualProxy.cs (7)
152Debug.Assert(count == 0); 174Debug.Assert(count == 1); 290Debug.Assert(index != PROXY_NOT_FOUND); 345Debug.Assert(index >= 0 && index < Count); 388Debug.Assert(index >= 0 && index < Count); 467Debug.Assert(index >= 0 && index < Count); 568Debug.Assert(delta % 2 == 0 && newLength >= 2);
System\Windows\Media\VisualTarget.cs (5)
46Debug.Assert(!_connected); 71Debug.Assert(channel != null); 72Debug.Assert(outOfBandChannel != null); 94Debug.Assert(!resourceCreated); 184Debug.Assert(_connected);
System\Windows\Media\VisualTreeHelper.cs (1)
160Debug.Assert(reference == null);
System\Windows\Media3D\Generated\AmbientLight.cs (2)
97Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 159Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\AxisAngleRotation3D.cs (2)
142Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 190Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Camera.cs (2)
91Debug.Assert(!channel.IsOutOfBandChannel); 92Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\DiffuseMaterial.cs (4)
104Debug.Assert(!channel.IsOutOfBandChannel); 105Debug.Assert(!targetResource.GetHandle(channel).IsNull); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 243Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\DirectionalLight.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 184Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\EmissiveMaterial.cs (4)
97Debug.Assert(!channel.IsOutOfBandChannel); 98Debug.Assert(!targetResource.GetHandle(channel).IsNull); 175Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 220Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\GeometryModel3D.cs (8)
90Debug.Assert(!channel.IsOutOfBandChannel); 91Debug.Assert(!targetResource.GetHandle(channel).IsNull); 139Debug.Assert(!channel.IsOutOfBandChannel); 140Debug.Assert(!targetResource.GetHandle(channel).IsNull); 188Debug.Assert(!channel.IsOutOfBandChannel); 189Debug.Assert(!targetResource.GetHandle(channel).IsNull); 281Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 350Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MaterialGroup.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 124Debug.Assert(resource != null); 135Debug.Assert(resource != null); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 262Debug.Assert(_duceResource.IsOnChannel(channel)); 307Debug.Assert(!channel.IsOutOfBandChannel); 308Debug.Assert(!thisResource.GetHandle(channel).IsNull); 332Debug.Assert(!channel.IsOutOfBandChannel); 333Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\MatrixCamera.cs (2)
138Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 194Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MatrixTransform3D.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 151Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\MeshGeometry3D.cs (2)
183Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 280Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Model3D.cs (2)
91Debug.Assert(!channel.IsOutOfBandChannel); 92Debug.Assert(!targetResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\Model3DGroup.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 124Debug.Assert(resource != null); 135Debug.Assert(resource != null); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 280Debug.Assert(_duceResource.IsOnChannel(channel)); 328Debug.Assert(!channel.IsOutOfBandChannel); 329Debug.Assert(!thisResource.GetHandle(channel).IsNull); 353Debug.Assert(!channel.IsOutOfBandChannel); 354Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\OrthographicCamera.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 208Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PerspectiveCamera.cs (2)
116Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 208Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\PointLight.cs (2)
97Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 189Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\QuaternionRotation3D.cs (2)
119Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 161Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\RotateTransform3D.cs (4)
119Debug.Assert(!channel.IsOutOfBandChannel); 120Debug.Assert(!targetResource.GetHandle(channel).IsNull); 231Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 295Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\ScaleTransform3D.cs (2)
244Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 316Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpecularMaterial.cs (4)
97Debug.Assert(!channel.IsOutOfBandChannel); 98Debug.Assert(!targetResource.GetHandle(channel).IsNull); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 243Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\SpotLight.cs (2)
160Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 270Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Generated\Transform3DGroup.cs (10)
111Debug.Assert(!channel.IsOutOfBandChannel); 112Debug.Assert(!targetResource.GetHandle(channel).IsNull); 124Debug.Assert(resource != null); 135Debug.Assert(resource != null); 197Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 262Debug.Assert(_duceResource.IsOnChannel(channel)); 307Debug.Assert(!channel.IsOutOfBandChannel); 308Debug.Assert(!thisResource.GetHandle(channel).IsNull); 332Debug.Assert(!channel.IsOutOfBandChannel); 333Debug.Assert(!thisResource.GetHandle(channel).IsNull);
System\Windows\Media3D\Generated\TranslateTransform3D.cs (2)
169Debug.Assert(!skipOnChannelCheck || _duceResource.IsOnChannel(channel)); 223Debug.Assert(_duceResource.IsOnChannel(channel));
System\Windows\Media3D\Matrix3D.cs (7)
1031Debug.Assert(IsDistinguishedIdentity); 1043Debug.Assert(IsDistinguishedIdentity); 1059Debug.Assert(IsDistinguishedIdentity); 1185Debug.Assert(!IsDistinguishedIdentity); 1186Debug.Assert(IsAffine); 1202Debug.Assert(!IsDistinguishedIdentity); 1203Debug.Assert(IsAffine);
System\Windows\Media3D\Rect3D.cs (1)
42Debug.Assert(size.IsEmpty == IsEmpty);
System\Windows\Media3D\Viewport2DVisual3D.cs (3)
578Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 606Debug.Assert(Geometry == null || Geometry is MeshGeometry3D); 634Debug.Assert(Geometry == null || Geometry is MeshGeometry3D);
System\Windows\Media3D\Viewport3DVisual.cs (6)
329Debug.Assert(child != null); 330Debug.Assert(child.InternalVisualParent == null); 377Debug.Assert(child != null); 378Debug.Assert(child.InternalVisualParent == this); 711Debug.Assert(IsOnChannel(channel)); 800Debug.Assert(IsOnChannel(channel));
System\Windows\Media3D\Visual3D.cs (13)
237Debug.Assert(child != null); 238Debug.Assert(child.InternalVisualParent == null); 285Debug.Assert(child != null); 286Debug.Assert(child.InternalVisualParent == this); 950Debug.Assert(InternalVisualParent == newParent); 958Debug.Assert(InternalVisualParent == newParent); 1080Debug.Assert(model != null); 1260Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 1261Debug.Assert(IsOnChannel(channel)); 1452Debug.Assert(IsOnChannel(channel)); 1453Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected)); 1650Debug.Assert(ancestor != null); 1792Debug.Assert(ancestor != null);
System\Windows\Navigation\BaseUriHelper.cs (2)
163Debug.Assert(uri is not null && uri.IsAbsoluteUri && string.Equals(uri.Scheme, PackUriHelper.UriSchemePack, StringComparison.OrdinalIgnoreCase) && IsPackApplicationUri(uri)); 180Debug.Assert(string.Equals(partName, uri.GetComponents(UriComponents.Path, UriFormat.UriEscaped), StringComparison.OrdinalIgnoreCase));
System\Windows\PresentationSource.cs (1)
521Debug.Assert(uie is UIElement3D or UIElement);
System\Windows\ReverseInheritProperty.cs (1)
202Debug.Assert(originChangedAction != null);
System\Windows\UIElement.cs (5)
3105Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated); 3190Debug.Assert(_proxy.IsOnChannel(channel)); 3257Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected)); 3258Debug.Assert(_proxy.IsOnChannel(channel)); 4132Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
System\Windows\UIElement3D.cs (1)
1331Debug.Assert(value == Visibility.Visible || value == Visibility.Hidden || value == Visibility.Collapsed);
PresentationFramework (1110)
MS\Internal\Annotations\Anchoring\FixedTextSelectionProcessor.cs (1)
290Debug.Assert(tv != null);
MS\Internal\Annotations\Anchoring\TextSelectionProcessor.cs (2)
385Debug.Assert(target != null); 455Debug.Assert(startNode != null);
MS\Internal\Annotations\Anchoring\TextViewSelectionProcessor.cs (1)
223Debug.Assert(textView != null);
MS\Internal\AppModel\Journaling.cs (11)
121Debug.Assert(value.JEGroupState == this); 122Debug.Assert(_groupExitEntry == null || _groupExitEntry.ContentId == value.ContentId); 217Debug.Assert(this.KeepAliveRoot == contentObject); // set by ctor; shouldn't change 224Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 225Debug.Assert(this.KeepAliveRoot != null); 408Debug.Assert(pageFunction != null && pageFunction.KeepAlive); 453Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 458Debug.Assert(pf != null); 490Debug.Assert(!pageFunction.KeepAlive); 556Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 569Debug.Assert(pageFunction != null);
MS\Internal\AppModel\JournalNavigationScope.cs (2)
274Debug.Assert(journal != null); 450Debug.Assert(sender == _journal);
MS\Internal\Commands\CommandHelpers.cs (3)
96Debug.Assert(controlType != null); 97Debug.Assert(command != null); 98Debug.Assert(executedRoutedEventHandler != null);
MS\Internal\Controls\CustomCategoryAttribute.cs (1)
18Debug.Assert("Content".Equals(name, StringComparison.Ordinal)
MS\Internal\Controls\InkCanvasFeedbackAdorner.cs (1)
147Debug.Assert(_frameSize != new Size(0, 0));
MS\Internal\Controls\InkCanvasInnerCanvas.cs (1)
32Debug.Assert(inkCanvas != null);
MS\Internal\Controls\StickyNote\StickyNoteAnnotations.cs (10)
79Debug.Assert(annotation != null); 121Debug.Assert((token & AllValues) != 0); 609Debug.Assert(false); 624Debug.Assert(cargo != null); 648Debug.Assert(false); 696Debug.Assert(false); 805Debug.Assert(snc.IsExpanded); 813Debug.Assert(snc.IsExpanded); 1251Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation); 1265Debug.Assert(_attachedAnnotation != null && _attachedAnnotation.Annotation == args.Annotation);
MS\Internal\Controls\StickyNote\StickyNoteContentControl.cs (3)
201Debug.Assert(node != null && !IsEmpty); 228Debug.Assert(node != null); 373Debug.Assert(node != null && !IsEmpty);
MS\Internal\Controls\StickyNote\StickyNoteHelper.cs (2)
59Debug.Assert(!helper.IsLocked(flag)); 69Debug.Assert(_helper.IsLocked(_flag));
MS\Internal\Data\CollectionViewGroupInternal.cs (2)
514Debug.Assert(subgroup != null); 535Debug.Assert(subgroup != null);
MS\Internal\Data\CompositeCollectionView.cs (1)
452Debug.Assert(args.Action == NotifyCollectionChangedAction.Remove);
MS\Internal\Data\DefaultValueConverter.cs (1)
473Debug.Assert(sourceType != targetType);
MS\Internal\Data\DisplayMemberTemplateSelector.cs (1)
25Debug.Assert(!(String.IsNullOrEmpty(displayMemberPath) && String.IsNullOrEmpty(stringFormat)));
MS\Internal\Data\XmlBindingWorker.cs (2)
34Debug.Assert(_xpath != null); 442Debug.Assert(ContextNode != null);
MS\Internal\DataStreams.cs (1)
305Debug.Assert(state != null);
MS\Internal\Documents\ColumnResult.cs (1)
173Debug.Assert(_paragraphs != null && _paragraphs.Count > 0);
MS\Internal\Documents\ContentElementCollection.cs (5)
36Debug.Assert(owner != null); 171Debug.Assert(Items[item.Index] == item); 307Debug.Assert(collection != null); 699Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 709Debug.Assert(BelongsToOwner(Items[i + 1]));
MS\Internal\Documents\HostedElements.cs (5)
70Debug.Assert(_currentTextSegment == 0); 87Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0 && 98Debug.Assert(((ITextPointer)_currentPosition).CompareTo(_textSegments[_currentTextSegment].Start) >= 0); 176Debug.Assert(_currentPosition.GetAdjacentElementFromOuterPosition(LogicalDirection.Forward) is IInputElement); 180Debug.Assert(_currentPosition.GetAdjacentElement(LogicalDirection.Forward) is IInputElement);
MS\Internal\Documents\TableColumnCollectionInternal.cs (8)
44Debug.Assert(Items[index] == null); 63Debug.Assert(BelongsToOwner(Items[i])); 110Debug.Assert(BelongsToOwner(Items[i])); 135Debug.Assert(item != null && item.Index == -1); 136Debug.Assert(Items[index] == null); 172Debug.Assert(item != null); 287Debug.Assert(BelongsToOwner(Items[i])); 295Debug.Assert(BelongsToOwner(Items[i + count]));
MS\Internal\Documents\TableTextElementCollectionInternal.cs (8)
68Debug.Assert(BelongsToOwner(Items[i])); 237Debug.Assert(BelongsToOwner(Items[i])); 257Debug.Assert(item != null && item.Index == -1); 258Debug.Assert(Items[index] == null); 286Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item); 300Debug.Assert(BelongsToOwner(Items[i + 1])); 369Debug.Assert(BelongsToOwner(Items[i])); 386Debug.Assert(BelongsToOwner(item) && Items[item.Index] == item);
MS\Internal\Documents\TextParagraphView.cs (10)
149Debug.Assert(lines != null && lines.Count > 0); 155Debug.Assert(false); 267Debug.Assert(lines != null && lines.Count > 0); 271Debug.Assert(lineIndex >= 0 && lineIndex < lines.Count); 327Debug.Assert(lineIndex < lines.Count); 413Debug.Assert(dcp >= lines[lineIndex].StartPositionCP); 414Debug.Assert(dcp < lines[lineIndex].EndPositionCP || 526Debug.Assert(lines != null && lines.Count > 0); 563Debug.Assert(lines != null && lines.Count > 0); 690Debug.Assert(lines != null && lines.Count > 0);
MS\Internal\Documents\UndoManager.cs (3)
111Debug.Assert(((UndoManager)undoManager)._scope == null); 146Debug.Assert(((UndoManager)undoManager)._scope == scope); 276Debug.Assert(false);
MS\Internal\Globalization\BamlResourceSerializer.cs (1)
74Debug.Assert(elementNode != null);
MS\Internal\Globalization\BamlTreeMap.cs (1)
560Debug.Assert(node.NodeType == BamlNodeType.StartElement);
MS\Internal\Globalization\BamlTreeNode.cs (2)
569Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit); 703Debug.Assert(value.Category != LocalizationCategory.Ignore && value.Category != LocalizationCategory.Inherit);
MS\Internal\Globalization\LocalizableResourceBuilder.cs (1)
446Debug.Assert(inheritableAttribute != null);
MS\Internal\Globalization\LocalizationComments.cs (1)
347Debug.Assert(enumPrefix != null && enumNames != null);
MS\Internal\Helper.cs (2)
400Debug.Assert( fe != null ); 835Debug.Assert(item != null);
MS\Internal\Ink\ClipboardProcessor.cs (5)
79Debug.Assert(dataObject != null && _preferredClipboardData!= null); 125Debug.Assert(inkCanvasSelection.SelectedStrokes.Count == orderedStrokes.Count); 183Debug.Assert(dataObject != null && _preferredClipboardData!= null); 253Debug.Assert(_preferredClipboardData != null); 262Debug.Assert(value != null);
MS\Internal\Ink\EditingCoordinator.cs (3)
244Debug.Assert(behavior != null); 348Debug.Assert(behavior == ActiveEditingBehavior); 596Debug.Assert(newEditingBehavior != null);
MS\Internal\Ink\EraserBehavior.cs (3)
97Debug.Assert(_cachedEraseMode != mode); 150Debug.Assert(newEraseMode == InkCanvasEditingMode.EraseByPoint 342Debug.Assert(null != e.HitStroke);
MS\Internal\Ink\InkCanvasSelection.cs (2)
130Debug.Assert( _inkCanvas.EditingCoordinator.UserIsEditing == true ); 196Debug.Assert(strokes != null && elements != null);
MS\Internal\Ink\LassoHelper.cs (1)
164System.Diagnostics.Debug.Assert((0 <= percentIntersect) && (100 >= percentIntersect));
MS\Internal\Ink\LassoSelectionBehavior.cs (6)
273Debug.Assert(tappedElement == null); 279Debug.Assert(tappedStroke == null); 368System.Diagnostics.Debug.Assert(null != _lassoHelper); 385Debug.Assert(canvas != null); 386Debug.Assert(childElement != null); 388Debug.Assert(canvas.CheckAccess());
MS\Internal\Ink\SelectionEditingBehavior.cs (2)
65Debug.Assert(_hitResult != InkCanvasSelectionHitResult.None); 322Debug.Assert(false);
MS\Internal\IO\Packaging\ByteStream.cs (3)
38Debug.Assert(stream != null); 44Debug.Assert(_access == FileAccess.Read); 113Debug.Assert(_length > 0);
MS\Internal\IO\Packaging\PackageFilter.cs (7)
458Debug.Assert(false); 467Debug.Assert(false); 557Debug.Assert(contentType != null && contentType.ToString().Length > 0); 583Debug.Assert(dottedExtensionName != null); 611Debug.Assert(pathWithGaps != null && stopGaps != null); 620Debug.Assert(stopGaps.Length > nextStopGapToUse); 628Debug.Assert(stopGaps.Length == nextStopGapToUse);
MS\Internal\IO\Packaging\XamlFilter.cs (8)
273Debug.Assert(bufferCharacterCount >= 0); 339Debug.Assert(_fixedPageContentExtractor != null); 374Debug.Assert(_contextStack.Count == 0); 380Debug.Assert(_topLevelReader != null); 387Debug.Assert(false); 490Debug.Assert(topOfStack.HasIndexableContent); 752Debug.Assert(_xamlReader != null); 774Debug.Assert(string.Equals(_xamlReader.LocalName, _fixedPageName, StringComparison.Ordinal));
MS\Internal\IO\Packaging\XmlFixedPageInfo.cs (1)
35Debug.Assert(_pageNode != null);
MS\Internal\IO\Packaging\XmlGlyphRunInfo.cs (1)
39Debug.Assert(_glyphsNode != null
MS\Internal\PtsHost\BaseParaClient.cs (2)
65Debug.Assert(_paraHandle == IntPtr.Zero || _paraHandle == pfspara); 101Debug.Assert(oldParaClient._visual != null);
MS\Internal\PtsHost\BaseParagraph.cs (1)
179Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\CellParaClient.cs (4)
79Debug.Assert(calculatedColumns != null 356Debug.Assert(tableParaClient != null); 359Debug.Assert( calculatedColumns != null 373Debug.Assert(0 <= durCellWidth);
MS\Internal\PtsHost\CellParagraph.cs (3)
71Debug.Assert(Cell.Table != null); 140Debug.Assert(Cell.Table != null); 169Debug.Assert(Cell.Table != null);
MS\Internal\PtsHost\ColumnPropertiesGroup.cs (1)
39internal double ColumnWidth { get { Debug.Assert(!double.IsNaN(_columnWidth)); return _columnWidth; } }
MS\Internal\PtsHost\ContainerParagraph.cs (12)
217Debug.Assert(_ur.ChangeType == PTS.FSKCHANGE.fskchInside); // Inconsistent UpdateRecord data 284Debug.Assert(_ur == null); // UpdateRecord has been already created. 347Debug.Assert(StructuralCache.CurrentFormatContext.FinitePage || _ur != null); // For bottomless case UpdateRecord needs to be created in UpdGetFirstChangeInSegment. 352Debug.Assert(_ur == null); 465Debug.Assert(iArea == 0); 631Debug.Assert(iArea == 0); 716Debug.Assert(pmcsclientOut == IntPtr.Zero); 761Debug.Assert(iArea == 0); 846Debug.Assert(pmcsclientOut == IntPtr.Zero); 900Debug.Assert(ParagraphEndCharacterPosition >= startPosition); 1041Debug.Assert(textPointer is TextPointer); 1167Debug.Assert(ur.Next.FirstPara == null || ur.Next.FirstPara.Next == null);
MS\Internal\PtsHost\DtrList.cs (1)
311Debug.Assert(_dtrs.Length > 0);
MS\Internal\PtsHost\FigureParaClient.cs (4)
399Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 420Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 434Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 604Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FigureParagraph.cs (1)
429Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FloaterParaClient.cs (4)
406Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 427Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 441Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual); 613Debug.Assert(arrayColumnDesc.Length == 1);
MS\Internal\PtsHost\FloaterParagraph.cs (4)
251Debug.Assert(pmcsclientOut == IntPtr.Zero); 501Debug.Assert(pmcsclientOut == IntPtr.Zero); 520Debug.Assert(pmcsclientOut == IntPtr.Zero); 603Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\FlowDocumentPage.cs (8)
314Debug.Assert(child != null); 457Debug.Assert(pageDetails.u.complex.cSections == 1); // Only one section is supported right now. 473Debug.Assert(sectionDetails.u.withpagenotes.cEndnoteColumns == 0); // Footnotes are not supported yet. 475Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 476Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 513Debug.Assert(false); // Complex columns are not supported yet. 918Debug.Assert(e != null); 921Debug.Assert(_structuralCache.TextContainer is not null);
MS\Internal\PtsHost\Line.cs (2)
660Debug.Assert(dcp >= 0 && (dcp + cch <= _line.Length)); 680Debug.Assert(cchGlyphRuns > 0 && glyphRunsCollection.Count > 0);
MS\Internal\PtsHost\ListMarkerSourceInfo.cs (1)
341Debug.Assert(number >= 0 && number <= 9);
MS\Internal\PtsHost\PageVisual.cs (2)
67Debug.Assert(vc.Count <= 1); 73Debug.Assert(vc.Count <= 1);
MS\Internal\PtsHost\Pts.cs (1)
159Debug.Assert(false);
MS\Internal\PtsHost\PtsHelper.cs (2)
588Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 589Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\PtsHost.cs (5)
384Debug.Assert(cnms == 1); // Only one section is supported right now. 2549Debug.Assert(false); 2944Debug.Assert(false); 3164Debug.Assert(false); 3243Debug.Assert(false);
MS\Internal\PtsHost\PtsPage.cs (12)
157Debug.Assert(!canUpdate || _section.CanUpdate); 914Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 915Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 962Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 963Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1042Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 1125Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1126Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1328Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1329Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0); 1389Debug.Assert(sectionDetails.u.withpagenotes.cSegmentDefinedColumnSpanAreas == 0); 1390Debug.Assert(sectionDetails.u.withpagenotes.cHeightDefinedColumnSpanAreas == 0);
MS\Internal\PtsHost\RowParagraph.cs (3)
193Debug.Assert(cCells == Row.FormatCellCount); 257Debug.Assert (_spannedCells[j] != null); 276Debug.Assert(Row.Index - cell.RowIndex + 1 == cell.RowSpan);
MS\Internal\PtsHost\SubpageParaClient.cs (3)
335Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is ContainerVisual); 356Debug.Assert(fskupd != PTS.FSKUPDATE.fskupdNoChange); 370Debug.Assert(visualChildren.Count == 1 && visualChildren[0] is SectionVisual);
MS\Internal\PtsHost\SubpageParagraph.cs (3)
442Debug.Assert(pmcsclientOut == IntPtr.Zero); 601Debug.Assert(pmcsclientOut == IntPtr.Zero); 646Debug.Assert(ParagraphEndCharacterPosition >= startPosition);
MS\Internal\PtsHost\TableParaClient.cs (22)
59Debug.Assert( Table != null 318Debug.Assert( TableParagraph.Table != null 361Debug.Assert( TableParagraph.Table != null 432Debug.Assert(TableParagraph.Table != null 601Debug.Assert( TableParagraph.Table != null 820Debug.Assert( TableParagraph.Table != null 891Debug.Assert( TableParagraph.Table != null 945Debug.Assert( TableParagraph.Table != null 1026Debug.Assert( TableParagraph.Table != null 1120Debug.Assert( TableParagraph.Table != null 1148Debug.Assert(false); 1170Debug.Assert(Table != null); 1196Debug.Assert(Table != null); 1378Debug.Assert(TableParagraph == (TableParagraph)(PtsContext.HandleToObject(tableObjDetails.fsnmTable))); 1408Debug.Assert(tableDetails.cRows == cRowsActual); 1457Debug.Assert(tableRowDetails.cCells == cCellsActual); 1586Debug.Assert( cellParaClient.Visual != null 1715Debug.Assert( cellParaClient.Visual != null 2044Debug.Assert(0 <= _calculatedColumns[i].DurMinWidth && 0 <= _calculatedColumns[i].DurMaxWidth); 2099Debug.Assert(0 < iP || DoubleUtil.IsZero(iP)); 2369Debug.Assert(_calculatedColumns[i].UserWidth.IsAbsolute); 2393Debug.Assert(_calculatedColumns[i].DurMinWidth <= _calculatedColumns[i].DurMaxWidth);
MS\Internal\PtsHost\TableParagraph.cs (1)
303Debug.Assert(Table.RowGroups.Count > 0);
MS\Internal\PtsHost\TextParaClient.cs (32)
131Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 158Debug.Assert(!((TextParagraph) Paragraph).HasFiguresFloatersOrInlineObjects()); 229Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 251Debug.Assert(Paragraph.Element as ContentElement != e); 318Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 371Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 713Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 794Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 826Debug.Assert(position is TextPointer); 857Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 876Debug.Assert(position is TextPointer); 907Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1064Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1366Debug.Assert(textDetails.fsktd == PTS.FSKTEXTDETAILS.fsktdCached); 1386Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 1466Debug.Assert(insertionIndex >= 0 && insertionIndex <= lineVisuals.Count); 2618Debug.Assert(index > 0); 2748Debug.Assert(index == 0); 2749Debug.Assert(elIndex == 0); 2763Debug.Assert(index > 0); 2787Debug.Assert(elIndex == arrayLineElement.Length - 1); 2788Debug.Assert(index == arrayLineDesc.Length - 1); 2908Debug.Assert(index > 0); 2956Debug.Assert(backspaceCaretPosition != null); 3005Debug.Assert(index == 0); 3006Debug.Assert(elIndex == 0); 3020Debug.Assert(index > 0); 3367Debug.Assert(!PTS.ToBoolean(textDetails.fLinesComposite)); 3485Debug.Assert(_lineIndexFirstVisual == lineIndexFirstVisible); 3514Debug.Assert(visualChildren.Count == (lineIndexFirstInvisible - lineIndexFirstVisible)); 3924Debug.Assert(localEnd > localStart); 4124Debug.Assert(localEnd > localStart);
MS\Internal\PtsHost\TextParagraph.cs (1)
138Debug.Assert(iArea == 0);
MS\Internal\PtsHost\TextParaLineResult.cs (4)
53Debug.Assert(false); 69Debug.Assert(false); 82Debug.Assert(false); 98Debug.Assert(false);
MS\Internal\PtsHost\UpdateRecord.cs (1)
39Debug.Assert(Next != null); // This is the last UR, cannot merge with next.
MS\Internal\PtsTable\CalculatedColumn.cs (1)
49Debug.Assert(0 <= durMinWidth && durMinWidth <= durMaxWidth);
MS\Internal\PtsTable\RowSpanVector.cs (10)
77Debug.Assert(cell != null 85Debug.Assert( start < _entries[i].Cell.ColumnIndex 91Debug.Assert(_index < _size); 92Debug.Assert(_index == 0 || _entries[_index - 1].Start < start); 93Debug.Assert(start < _entries[_index].Start); 139Debug.Assert(0 <= _index && _index < _size); 147Debug.Assert(0 <= _index && _index < _size); 180Debug.Assert(_entries[i].Cell != null); 181Debug.Assert(i >= j); 247Debug.Assert( _entries.Length > 0
MS\Internal\Text\ComplexLine.cs (1)
80Debug.Assert(dcp >= 0);
MS\Internal\Text\DynamicPropertyReader.cs (5)
38Debug.Assert(element != null); 50Debug.Assert(element != null); 68Debug.Assert(element != null); 227Debug.Assert(element != null); 252Debug.Assert(!position.IsNull);
MS\Internal\Text\LineMetrics.cs (2)
112get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _width; } 127get { Debug.Assert((_packedData & HasBeenUpdatedMask) != 0); return _start; }
MS\Internal\Text\SimpleLine.cs (1)
125Debug.Assert(content != null);
MS\Internal\Text\TextLineResult.cs (4)
52Debug.Assert(false); 64Debug.Assert(false); 75Debug.Assert(false); 87Debug.Assert(false);
MS\Internal\Text\TextProperties.cs (1)
255Debug.Assert(element != null);
MS\Internal\Text\TypographyProperties.cs (1)
103Debug.Assert((uint)PropertyId.PropertyCount <= 32);
MS\Internal\WindowsRuntime\Generated\WinRT.cs (1)
161System.Diagnostics.Debug.Assert(_CanUnloadNow == null || _CanUnloadNow() == 0); // S_OK
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
27Debug.Assert(CurrentFrame is not null); 28Debug.Assert(CurrentFrame.Depth == Depth); 88Debug.Assert(iteratorFrame is not null); 114Debug.Assert(CurrentFrame.Depth == Depth); 127Debug.Assert(CurrentFrame.Depth == Depth);
System\Windows\Application.cs (1)
2008Debug.Assert(!uri.IsAbsoluteUri || BaseUriHelper.IsPackApplicationUri(uri));
System\Windows\Automation\Peers\DataGridAutomationPeer.cs (1)
199Debug.Assert(false);
System\Windows\Automation\Peers\DateTimeAutomationPeer.cs (1)
689Debug.Assert((int)owningButton.GetValue(Grid.RowProperty) > 0);
System\Windows\BroadcastEventHelper.cs (7)
20Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 41Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 45Debug.Assert(loadedPending.Length == 3); 68Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 89Debug.Assert(d is FrameworkElement || d is FrameworkContentElement); 93Debug.Assert(unloadedPending.Length == 3); 507Debug.Assert( fo.IsFE );
System\Windows\Controls\Calendar.cs (14)
209Debug.Assert(c != null); 265Debug.Assert(c != null); 326Debug.Assert(c != null); 383Debug.Assert(c != null); 414Debug.Assert(false); 541Debug.Assert(c != null); 627Debug.Assert(c != null); 923Debug.Assert(false); 942Debug.Assert(false); 982Debug.Assert(false); 1015Debug.Assert(false); 1084Debug.Assert(false); 1186Debug.Assert(this.DisplayMode == CalendarMode.Year); 1199Debug.Assert(this.DisplayMode == CalendarMode.Decade);
System\Windows\Controls\CalendarBlackoutDatesCollection.cs (2)
113Debug.Assert(dayInterval != 0); 328Debug.Assert(day != null);
System\Windows\Controls\ColumnDefinition.cs (14)
92Debug.Assert(_items != null); 114Debug.Assert(_items != null); 154Debug.Assert( _items[i] != null 172Debug.Assert(_items[item.Index] == item); 187Debug.Assert(_items[value.Index] == value); 323Debug.Assert( _items[i] != null 332Debug.Assert( _items[i + count] != null 588Debug.Assert(value != null && value.Index == -1); 589Debug.Assert(_items[index] == null); 606Debug.Assert(value != null); 639Debug.Assert( _items[i] != null 657Debug.Assert( _items[value.Index] == value 670Debug.Assert( _items[i + 1] != null 696Debug.Assert(value >= _size);
System\Windows\Controls\ComboBox.cs (1)
622Debug.Assert(_editableTextBoxSite == sender);
System\Windows\Controls\ContentPresenter.cs (3)
1019Debug.Assert(tc.CanConvertTo(typeof(UIElement))); 1089Debug.Assert(!(content is String) && !(content is UIElement)); // these are handled by different templates 1128Debug.Assert(!(tc != null && tc.CanConvertTo(typeof(UIElement)))); // this is handled by a different template
System\Windows\Controls\DataGrid.cs (2)
5242Debug.Assert(!IsUpdatingSelectedCells); 5248Debug.Assert(IsUpdatingSelectedCells);
System\Windows\Controls\DataGridCellsPanel.cs (1)
1146Debug.Assert(startIndex >= 0);
System\Windows\Controls\DataGridColumn.cs (1)
592Debug.Assert(Width.IsStar);
System\Windows\Controls\DataGridColumnCollection.cs (2)
543Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex)); 687Debug.Assert(removedDisplayIndex >= 0);
System\Windows\Controls\DataGridColumnHeaderCollection.cs (1)
47Debug.Assert(_columns.Contains(column));
System\Windows\Controls\DataGridRow.cs (1)
226Debug.Assert(stateCode != DATAGRIDROW_stateNullCode);
System\Windows\Controls\DatePicker.cs (11)
206Debug.Assert(dp != null); 252Debug.Assert(dp != null); 317Debug.Assert(dp != null); 335Debug.Assert(dp != null); 362Debug.Assert(dp != null); 434Debug.Assert(dp != null); 530Debug.Assert(dp != null); 582Debug.Assert(dp != null); 947Debug.Assert(c != null); 948Debug.Assert(args != null); 970Debug.Assert(e.AddedItems.Count < 2);
System\Windows\Controls\DateTimeHelper.cs (1)
179Debug.Assert(DateTime.Compare(start, end) < 1);
System\Windows\Controls\DefinitionBase.cs (6)
319Debug.Assert(value >= -1 && _parentIndex != value); 710Debug.Assert(sharedSizeGroup != null); 726Debug.Assert(_registry.Contains(key)); 743Debug.Assert(sharedSizeScope != null && sharedSizeGroupId != null); 756Debug.Assert(!_registry.Contains(member)); 840Debug.Assert( _userSize.GridUnitType == GridUnitType.Auto
System\Windows\Controls\Frame.cs (21)
438Debug.Assert(_ownJournalScope != null); 450Debug.Assert(_ownJournalScope == null); 492Debug.Assert(_journalOwnership == (JournalOwnership)GetValue(JournalOwnershipProperty)); 614Debug.Assert(sender == this && _ownJournalScope != null); 620Debug.Assert(sender == this && _ownJournalScope != null); 627Debug.Assert(sender == this && _ownJournalScope != null); 633Debug.Assert(sender == this && _ownJournalScope != null); 640Debug.Assert(sender == this && _ownJournalScope != null); 659Debug.Assert(sender == this && _ownJournalScope != null); 664Debug.Assert(sender == this && _ownJournalScope != null); 671Debug.Assert(sender == this && _ownJournalScope != null); 734Debug.Assert(d as Frame != null && ((Frame)d).NavigationService != null); 807Debug.Assert(canGoFwd == (bool)GetValue(CanGoForwardProperty)); 822Debug.Assert(canGoBack == (bool)GetValue(CanGoBackProperty)); 981Debug.Assert(backStack == GetValue(BackStackProperty)); 993Debug.Assert(fwdStack == GetValue(ForwardStackProperty)); 1155Debug.Assert(GetValue(BackStackProperty) == _ownJournalScope.BackStack); 1199Debug.Assert(JournalEntry.GetType().IsSerializable); 1227Debug.Assert(_journalOwnership == JournalOwnership.OwnsJournal); 1317Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal); 1347Debug.Assert(_ownJournalScope == null ^ _journalOwnership == JournalOwnership.OwnsJournal);
System\Windows\Controls\Grid.cs (21)
413Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 669Debug.Assert(DefinitionsU.Length > 0 && DefinitionsV.Length > 0); 915Debug.Assert(0 <= cell.ColumnIndex && cell.ColumnIndex < DefinitionsU.Length); 916Debug.Assert(0 <= cell.RowIndex && cell.RowIndex < DefinitionsV.Length); 1014Debug.Assert(ExtData.DefinitionsU != null && ExtData.DefinitionsU.Length > 0); 1061Debug.Assert(ExtData.DefinitionsV != null && ExtData.DefinitionsV.Length > 0); 1109Debug.Assert(false); 1374Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1401Debug.Assert(0 < count && 0 <= start && (start + count) <= definitions.Length); 1429Debug.Assert(1 < count && 0 <= start && (start + count) <= definitions.Length); 1462Debug.Assert( minSize <= preferredSize 1493Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1502Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1510Debug.Assert(_IsZero(sizeToDistribute)); 1530Debug.Assert(!tempDefinitions[i].UserSize.IsAuto); 1541Debug.Assert(tempDefinitions[i].UserSize.IsAuto); 1550Debug.Assert(_IsZero(sizeToDistribute)); 1571Debug.Assert( !double.IsInfinity(totalRemainingSize) 2080Debug.Assert(!definitions[i].IsShared || !definitions[i].UserSize.IsStar); 2154Debug.Assert(nonStarIndex == starDefinitionsCount); 3869Debug.Assert(grid != null);
System\Windows\Controls\GridSplitter.cs (2)
421Debug.Assert(_decorator != null); 444Debug.Assert(_decorator != null);
System\Windows\Controls\GridViewHeaderRowPresenter.cs (4)
637Debug.Assert(column != null); 987Debug.Assert(header != null || index != -1); 1070Debug.Assert(header != null); 1079Debug.Assert(header != null);
System\Windows\Controls\GridViewRowPresenter.cs (1)
283Debug.Assert(column != null);
System\Windows\Controls\InkCanvas.cs (4)
2269System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s)); 2567System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes)); 2706Debug.Assert(inkCanvas != null); 2779Debug.Assert(inkCanvas != null);
System\Windows\Controls\InkPresenter.cs (3)
473System.Diagnostics.Debug.Assert(sender == this.Strokes); 523System.Diagnostics.Debug.Assert(stroke != null); 532System.Diagnostics.Debug.Assert(stroke != null);
System\Windows\Controls\ItemCollection.cs (12)
710Debug.Assert(_deferLevel == 0 || _collectionView == null || _deferInnerRefresh != null); 713Debug.Assert(_deferLevel != 0 || _deferInnerRefresh == null); 1549Debug.Assert(_isInitializing == false); 1557Debug.Assert(_isInitializing == true); 1904Debug.Assert(sender == _collectionView); 1910Debug.Assert(sender == _collectionView); 1937Debug.Assert(_collectionView != null); 1948Debug.Assert(_collectionView == null || _deferInnerRefresh != null); 2173Debug.Assert(e.NewStartingIndex >= 0); 2184Debug.Assert(e.OldStartingIndex >= 0); 2192Debug.Assert(e.OldStartingIndex >= 0); 2202Debug.Assert(e.OldStartingIndex >= 0);
System\Windows\Controls\ItemsControl.cs (1)
3132Debug.Assert(direction == FocusNavigationDirection.Up ||
System\Windows\Controls\PasswordTextNavigator.cs (1)
297Debug.Assert(false);
System\Windows\Controls\PopupControlService.cs (1)
417Debug.Assert(_currentToolTip == null);
System\Windows\Controls\Primitives\CalendarItem.cs (9)
226Debug.Assert(false); 391Debug.Assert(mode != CalendarMode.Month); 463Debug.Assert(false); 545Debug.Assert(e != null); 563Debug.Assert(b != null); 920Debug.Assert(this.Owner.DisplayMode == CalendarMode.Year); 1045Debug.Assert(childButton != null); 1235Debug.Assert(childButton != null); 1282Debug.Assert(childButton != null);
System\Windows\Controls\Primitives\DataGridRowHeader.cs (1)
489Debug.Assert(stateCode != DATAGRIDROWHEADER_stateNullCode);
System\Windows\Controls\Primitives\DatePickerTextBox.cs (1)
165Debug.Assert(e.NewValue is bool);
System\Windows\Controls\Primitives\MenuBase.cs (4)
235Debug.Assert(menu.HasPushedMenuMode); 889Debug.Assert(_pushedMenuMode == null); 891Debug.Assert(_pushedMenuMode != null); 900Debug.Assert(_pushedMenuMode != null);
System\Windows\Controls\Primitives\Popup.cs (1)
2504Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement));
System\Windows\Controls\Primitives\ScrollContentPresenter.cs (2)
791Debug.Assert(IsScrollClient); 826Debug.Assert(IsScrollClient);
System\Windows\Controls\Primitives\Selector.cs (9)
581Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 1524Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 1552Debug.Assert(IsSynchronizedWithCurrentItemPrivate); 2172Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2271Debug.Assert(_owner.CheckAccess()); 2284Debug.Assert(_owner.CheckAccess()); 2493Debug.Assert(_owner.CheckAccess()); 2550Debug.Assert(_owner.CheckAccess()); 2588Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\RowDefinition.cs (14)
87Debug.Assert(_items != null); 109Debug.Assert(_items != null); 149Debug.Assert( _items[i] != null 167Debug.Assert(_items[item.Index] == item); 182Debug.Assert(_items[value.Index] == value); 318Debug.Assert( _items[i] != null 327Debug.Assert( _items[i + count] != null 583Debug.Assert(value != null && value.Index == -1); 584Debug.Assert(_items[index] == null); 601Debug.Assert(value != null); 634Debug.Assert( _items[i] != null 652Debug.Assert( _items[value.Index] == value 665Debug.Assert( _items[i + 1] != null 691Debug.Assert(value >= _size);
System\Windows\Controls\ScrollViewer.cs (3)
1318Debug.Assert(!MeasureDirty); 1726Debug.Assert(_panningInfo != null); 1860Debug.Assert(_panningInfo != null);
System\Windows\Controls\SelectedDatesCollection.cs (3)
410Debug.Assert(false); 428Debug.Assert(!_isAddingRange); 434Debug.Assert(_isAddingRange);
System\Windows\Controls\SoundPlayerAction.cs (2)
142Debug.Assert(m_player.IsLoadCompleted); 220Debug.Assert(m_player.IsLoadCompleted);
System\Windows\Controls\Stack.cs (2)
804Debug.Assert(measureElement.IsScrolling); 829Debug.Assert(logicalOffset == 0 || (logicalOffset > 0 && logicalOffset < children.Count));
System\Windows\Controls\TextBlock.cs (23)
1408Debug.Assert(lineCount == LineCount); 1521Debug.Assert(lineCount == LineCount); 1673Debug.Assert(lineCount == LineCount); 1777Debug.Assert(lineCount == LineCount); 1782Debug.Assert(lineIndex < lineCount); 1793Debug.Assert(lineCount == LineCount); 1795Debug.Assert(lineIndex < lineCount); 1821Debug.Assert(lineBounds.Count > 0); 2042Debug.Assert(lineCount == LineCount); 2186Debug.Assert(lineCount == LineCount); 2457Debug.Assert(lineIndex > 0); 2460Debug.Assert(dcp >= 0); 2475Debug.Assert(lineIndex < lineCount - 1); 2585Debug.Assert(lineIndex > 0); 2588Debug.Assert(dcp >= 0); 3397Debug.Assert(IsLayoutDataValid); 3398Debug.Assert(CheckFlags(Flags.RequiresAlignment)); 3416Debug.Assert(lineCount == LineCount); 3590Debug.Assert(lineCount == LineCount); 3627Debug.Assert(e != null); 3630Debug.Assert(_complexContent.TextContainer is TextContainer); 3901Debug.Assert(owner != null); 3902Debug.Assert(textContainer != null);
System\Windows\Controls\TextSearch.cs (2)
768Debug.Assert(_attachedTo != null); 783Debug.Assert(_attachedTo != null);
System\Windows\Controls\VirtualizedCellInfoCollection.cs (10)
975Debug.Assert(rowIndex >= 0); 1003Debug.Assert(rowIndex >= 0); 1042Debug.Assert(rowIndex >= 0); 1058Debug.Assert(oldIndex >= 0); 1059Debug.Assert(newIndex >= 0); 1148Debug.Assert(columnIndex >= 0); 1191Debug.Assert(columnIndex >= 0); 1230Debug.Assert(columnIndex >= 0); 1249Debug.Assert(oldIndex >= 0); 1250Debug.Assert(newIndex >= 0);
System\Windows\Controls\VirtualizingStackPanel.cs (4)
3696Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1); 9328Debug.Assert(_cleanupDelay != null); 9349Debug.Assert(_cleanupOperation != null); 9440Debug.Assert(startIndex >= 0 && count > 0);
System\Windows\Controls\WebBrowser.cs (2)
538Debug.Assert(clsid.ToString("D") == CLSID.WebBrowser); 576Debug.Assert(_axIWebBrowser2 != null);
System\Windows\Data\BindingListCollectionView.cs (1)
728Debug.Assert(true);
System\Windows\Data\ObjectDataProvider.cs (4)
159Debug.Assert((_objectInstance == null) ? (_objectType == null) : (_objectType == _objectInstance.GetType())); 346Debug.Assert(_mode != SourceMode.FromType); 439Debug.Assert(_objectType != null); 509Debug.Assert(_objectType != null);
System\Windows\Data\RelativeSource.cs (3)
171Debug.Assert(_mode == RelativeSourceMode.FindAncestor); 209Debug.Assert((!IsUninitialized) || (_mode == RelativeSourceMode.FindAncestor)); 273Debug.Assert(IsUninitialized);
System\Windows\Data\XmlDataProvider.cs (1)
761Debug.Assert(doc != null);
System\Windows\Documents\AdornerLayer.cs (2)
638Debug.Assert(adorner != null); 710Debug.Assert(element != null);
System\Windows\Documents\ChildDocumentBlock.cs (4)
47Debug.Assert(childContainer != null); 54Debug.Assert(docRef != null); 72Debug.Assert(newBlock != null); 127Debug.Assert(ChildContainer.Highlights.GetLayer(typeof(TextSelection)) == null);
System\Windows\Documents\ColumnResizeAdorner.cs (1)
33Debug.Assert(scope != null);
System\Windows\Documents\CompositionAdorner.cs (1)
56Debug.Assert(textView != null && textView.RenderScope != null);
System\Windows\Documents\DocumentSequence.cs (9)
252Debug.Assert(innerDP != null); 273Debug.Assert(innerDP != null); 553Debug.Assert(docRef != null); 560Debug.Assert(paginator != null); 568Debug.Assert(paginator != null); 1052Debug.Assert(documentSequence != null); 1053Debug.Assert(documentPaginator != null); 1054Debug.Assert(documentPage != null); 1162Debug.Assert(false);
System\Windows\Documents\DocumentSequenceHighlightLayer.cs (1)
75Debug.Assert(ranges.Count > 0);
System\Windows\Documents\DocumentSequenceTextContainer.cs (12)
29Debug.Assert(parent != null); 30Debug.Assert(parent is FixedDocumentSequence); 217Debug.Assert(_start != null); 230Debug.Assert(_end != null); 381Debug.Assert(docRef != null); 497Debug.Assert(_parent != null); 645Debug.Assert(sender != null); 646Debug.Assert(args != null); 647Debug.Assert(args.Ranges != null); 696Debug.Assert(args.Ranges.Count > 0 && ((TextSegment)args.Ranges[0]).Start.CompareTo(((TextSegment)args.Ranges[0]).End) < 0); 990Debug.Assert(parentTextPointer != null); 1013Debug.Assert(parentChangePosition != null);
System\Windows\Documents\DocumentSequenceTextPointer.cs (7)
30Debug.Assert(childBlock != null); 31Debug.Assert(childPosition != null); 560Debug.Assert(_childTp != null); 888Debug.Assert(direction == LogicalDirection.Backward); 933Debug.Assert(tp != null); 945Debug.Assert(thisTp.ChildBlock.ChildContainer == tp.ChildBlock.ChildContainer); 989Debug.Assert(xGapAwareCompareTo(tp1, tp2) <= 0);
System\Windows\Documents\FixedDocument.cs (9)
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 && ((TextSegment)args.Ranges[0]).Start.CompareTo(((TextSegment)args.Ranges[0]).End) < 0); 1161Debug.Assert(pageNo >= 0 && pageNo<PageCount); 1350Debug.Assert(panel != null && page != null);
System\Windows\Documents\FixedElement.cs (3)
133Debug.Assert((object)_start == (object)_end); 191Debug.Assert(_object == null && e._type == ElementType.Object); 258Debug.Assert(false);
System\Windows\Documents\FixedFindEngine.cs (13)
35Debug.Assert(start != null); 36Debug.Assert(end != null); 37Debug.Assert( ((start is DocumentSequenceTextPointer) && (end is DocumentSequenceTextPointer)) || 39Debug.Assert(findPattern != null); 48Debug.Assert(paginator != null); 85Debug.Assert(firstSearchPageStart != null); 86Debug.Assert(firstSearchPageEnd != null); 120Debug.Assert(fixedDoc != null); 306Debug.Assert(endAsFTP != null); 326Debug.Assert(startAsFTP != null); 337Debug.Assert(doc != null); 338Debug.Assert(translatedPageNo >= 0 && translatedPageNo < doc.PageCount); 363Debug.Assert(pageStream != null);
System\Windows\Documents\FixedFlowMap.cs (2)
130Debug.Assert(fp >= 0 && fp < _flowOrder.Count); 162Debug.Assert(flowOld.Type == FlowNodeType.Virtual || flowNew != null);
System\Windows\Documents\FixedHighlight.cs (3)
38Debug.Assert(element != null && beginOffset >= 0 && endOffset >= 0); 138Debug.Assert(_gBeginOffset >= 0); 139Debug.Assert(_gEndOffset <= chrct);
System\Windows\Documents\FixedNode.cs (5)
79Debug.Assert(childLevels >= 1); 95Debug.Assert(childPath != null); 133Debug.Assert(path != null && path.Length >= 2); // At least a page index and an element index 340Debug.Assert(level < _path.Length); 351Debug.Assert(_path.Length >= 2);
System\Windows\Documents\FixedPage.cs (4)
857Debug.Assert(e != null); 893Debug.Assert(currentLevelIndex >= 0 && currentLevelIndex <= ((Canvas)element).Children.Count); 1024Debug.Assert(currentChildrens != null); 1166Debug.Assert(pageStructure != null);
System\Windows\Documents\FixedPageStructure.cs (13)
35Debug.Assert(pageIndex >= 0); 99Debug.Assert(lineResult != null); 111Debug.Assert(_lineResults != null); 149Debug.Assert(_lineResults != null); 203Debug.Assert(flowStart != null && flowStart.Type != FlowNodeType.Virtual); 204Debug.Assert(flowEnd != null && flowEnd.Type != FlowNodeType.Virtual); 213Debug.Assert(!rect.IsEmpty); 467Debug.Assert(false); 531Debug.Assert(glyphs!= null); 547Debug.Assert(false); 618Debug.Assert(false); 635Debug.Assert(false); 673Debug.Assert(_fixedSOMPageConstructor != null);
System\Windows\Documents\FixedSOMContainer.cs (7)
34Debug.Assert(compared != null); 35Debug.Assert(This != null); 43Debug.Assert(compareHor != SpatialComparison.None); 44Debug.Assert(compareVer != SpatialComparison.None); 99Debug.Assert(false); 106Debug.Assert(false); 220Debug.Assert(container != null);
System\Windows\Documents\FixedSOMFixedBlock.cs (1)
159Debug.Assert(SemanticBoxes[i] is FixedSOMTextRun || SemanticBoxes[i] is FixedSOMImage);
System\Windows\Documents\FixedSOMGroup.cs (5)
36Debug.Assert(compared != null); 47Debug.Assert(compareHor != SpatialComparison.None); 48Debug.Assert(compareVer != SpatialComparison.None); 98Debug.Assert(false); 105Debug.Assert(false);
System\Windows\Documents\FixedSOMImage.cs (1)
68Debug.Assert(path.Fill is ImageBrush);
System\Windows\Documents\FixedSOMLineCollection.cs (2)
54Debug.Assert(point1.X == point2.X); 60Debug.Assert(point1.Y == point2.Y);
System\Windows\Documents\FixedSOMPageConstructor.cs (10)
222Debug.Assert(fixedPage != null); 238Debug.Assert(_fixedPage != null); 243Debug.Assert(obj != null); 371Debug.Assert(obj is Image || obj is Path); 400Debug.Assert(glyphs != null); 574Debug.Assert (fixedBlock.SemanticBoxes.Count > 0); 629Debug.Assert(textRunRect.Height != 0 && fixedBlock.LineHeight != 0); 1007Debug.Assert(false); 1134Debug.Assert(currentPageElement != null); 1144Debug.Assert(nextPageElement != null);
System\Windows\Documents\FixedSOMSemanticBox.cs (3)
91Debug.Assert(o != null); 101Debug.Assert(compareHor != SpatialComparison.None && compareVer != SpatialComparison.None); 297Debug.Assert(false);
System\Windows\Documents\FixedSOMTable.cs (2)
164Debug.Assert(row != null); 180Debug.Assert(row != null);
System\Windows\Documents\FixedSOMTextRun.cs (1)
39Debug.Assert(otherRun != null);
System\Windows\Documents\FixedTextBuilder.cs (24)
181Debug.Assert(!_IsBoundaryPage(pageIndex)); 198Debug.Assert(page != null); 199Debug.Assert(page.IsInitialized); 368Debug.Assert(fn.Type == FlowNodeType.Start); 458Debug.Assert(pStart.CompareTo(pEnd) < 0); 497Debug.Assert(fixes.Length == 1); 573Debug.Assert(flowNode.Type == FlowNodeType.Run); 577Debug.Assert(flowNode.Type == FlowNodeType.Run); 578Debug.Assert(fixes != null); 791Debug.Assert(pathPrefix != null); 814Debug.Assert(prevRun != null); 815Debug.Assert(currentRun != null); 989Debug.Assert(pathPrefix == null); 990Debug.Assert(level1Index >= 0); 1000Debug.Assert(newPathPrefix != null); 1006Debug.Assert(pathPrefix == null && newPathPrefix == null); 1070Debug.Assert(false); 1273Debug.Assert(false); 1296Debug.Assert(e is Image); 1393Debug.Assert(elem is FixedPage || elem is Canvas); 1543Debug.Assert(false); 1657Debug.Assert(run.EndIndex - run.StartIndex == run.Text.Length); 1733Debug.Assert(uiElement != null); 1754Debug.Assert(newLineResult != null);
System\Windows\Documents\FixedTextContainer.cs (8)
34Debug.Assert(parent != null && parent is FixedDocument); 186Debug.Assert(_start != null); 199Debug.Assert(_end != null); 377Debug.Assert(res); 393Debug.Assert(highlights != null); 511Debug.Assert(_fixedTextBuilder != null); 520Debug.Assert(_containerElement != null); 602Debug.Assert(start.CompareTo(end) <= 0);
System\Windows\Documents\FixedTextView.cs (11)
113Debug.Assert(pos != null); 161Debug.Assert(ftp != null); 235Debug.Assert(startPosition != null && this.Contains(startPosition)); 236Debug.Assert(endPosition != null && this.Contains(endPosition)); 402Debug.Assert(pos != null); 460Debug.Assert(false); 851 Debug.Assert(itp != null); 949Debug.Assert(hitGlyphs != null); 1001Debug.Assert(charStart - charCount == 1); 1012Debug.Assert(charEnd - charCount == 1); 1119Debug.Assert(symbolType == TextPointerContext.Text || symbolType == TextPointerContext.EmbeddedElement);
System\Windows\Documents\FlowNode.cs (2)
51Debug.Assert( (type != FlowNodeType.Run) || ((int)cookie != 0)); 96Debug.Assert(_fp != fn._fp || (_fp == fn._fp) && (_scopeId == fn._scopeId));
System\Windows\Documents\FlowPosition.cs (12)
38Debug.Assert(!FlowNode.IsNull(node)); 127Debug.Assert(flow != null); 174Debug.Assert(dir == LogicalDirection.Forward || dir == LogicalDirection.Backward); 182Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 199Debug.Assert(GetPointerContext(dir) == TextPointerContext.Text); 240Debug.Assert(type == FlowNodeType.Object || type == FlowNodeType.Noop || type == FlowNodeType.Start || type == FlowNodeType.End); 371Debug.Assert(this._OverlapAwareCompare(pEnd) < 0); 424Debug.Assert(dir == LogicalDirection.Backward); 582Debug.Assert(dir == LogicalDirection.Backward); 632Debug.Assert(dir == LogicalDirection.Backward); 722Debug.Assert(flow != null); 750Debug.Assert(this._flowNode.Equals(flow._flowNode));
System\Windows\Documents\Glyphs.cs (4)
63Debug.Assert(_glyphRunProperties != null); 227Debug.Assert(glyphRunProperties.glyphIndices != null); 251Debug.Assert(0 <= nibble && nibble <= 15); 325Debug.Assert(parsedGlyphs.Count == glyphCount);
System\Windows\Documents\HighlightVisual.cs (4)
166Debug.Assert(highlights != null); 237Debug.Assert(bg != null); 243Debug.Assert(highlightGeometry != null); 261Debug.Assert(highlightGeometry != null);
System\Windows\Documents\Hyperlink.cs (1)
561Debug.Assert(targetUri != null);
System\Windows\Documents\ImmComposition.cs (2)
296Debug.Assert((oldSource == null) || (oldSource == _source)); 316Debug.Assert(newSource == _source);
System\Windows\Documents\NullTextContainer.cs (2)
179Debug.Assert(_start != null); 192Debug.Assert(_end != null);
System\Windows\Documents\NullTextNavigator.cs (5)
45Debug.Assert(position is NullTextPointer || position is NullTextPointer); 61Debug.Assert(position is NullTextPointer || position is NullTextPointer); 194Debug.Assert(distance == 0); 311Debug.Assert(false); // must never call this 319Debug.Assert(false); // must never call this
System\Windows\Documents\PageContentAsyncResult.cs (2)
51Debug.Assert(source == null || source.IsAbsoluteUri); 90get { Debug.Assert(false); return null; }
System\Windows\Documents\RtfToXamlLexer.cs (1)
422Debug.Assert(false);
System\Windows\Documents\RtfToXamlReader.cs (39)
2711Debug.Assert(HasBorder); 5150Debug.Assert(dnRow != null); // Need row 5151Debug.Assert(dnRow != null && !dnRow.IsPending); // Row props attached when row is closed 5152Debug.Assert(dnRow != null && dnRow.FormatState.RowFormat != null); 5581Debug.Assert(Type == DocumentNodeType.dnTable); 5914Debug.Assert(value >= 0); 5915Debug.Assert(!IsPending); 5976Debug.Assert(value == null || !value.IsPending); 6245Debug.Assert(nUnfilledRowIndex != 0); 6337Debug.Assert(nStart + nChild < Count); 6423Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6434Debug.Assert(nStart + nChild < Count); 6452Debug.Assert(nAt + dn.ChildCount <= nEnd); 6453Debug.Assert(!dn.IsTerminated); 6462Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6484Debug.Assert(Count == 0 || (nStart >= 0 && nStart < Count)); 6495Debug.Assert(nStart + nChild < Count); 6513Debug.Assert(nAt + dn.ChildCount <= nEnd); 6514Debug.Assert(!dn.IsTerminated); 6526Debug.Assert(dnChild.ChildCount == 0 && dnChild.IsTerminated); 6551Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6552Debug.Assert(index + nChildCount < Count); 6581Debug.Assert(Count == 0 || (index >= 0 && index < Count)); 6623Debug.Assert(EntryAt(i).ClosedParent != null); 6626Debug.Assert(nAt + dn.ChildCount < Count); 6630Debug.Assert(dnPa.IsPending || (nAt > dnPa.Index && nAt <= dnPa.Index + dnPa.ChildCount)); 6648Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTable); 6651Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnTableBody); 6654Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnRow); 6657Debug.Assert(dnPa != null && dnPa.Type == DocumentNodeType.dnList); 6924Debug.Assert(false); 7101Debug.Assert(_fMain); 7148Debug.Assert(dnPa.LastChildIndex >= nAt + nExcise - 1); 8228Debug.Assert(dn.ChildCount == 0); 8256Debug.Assert(dn.ChildCount == 0); 9897Debug.Assert(nInsertAt >= 0 && nChildren > 0 && nInsertAt + nChildren - 1 < dna.Count); 11108Debug.Assert(dna.Count > 0 && dna.EntryAt(dna.Count - 1).Type == DocumentNodeType.dnParagraph); 11323Debug.Assert(!dnPara.IsTerminated); 11543Debug.Assert(!dnTop.IsTerminated);
System\Windows\Documents\RubberbandSelector.cs (2)
312Debug.Assert(range.first != null && range.second != null); 467Debug.Assert(end >= begin);
System\Windows\Documents\Table.cs (2)
413Debug.Assert(table != null); 465Debug.Assert(_currentChildType != ChildrenTypes.BeforeFirst);
System\Windows\Documents\TableCell.cs (1)
387Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableColumn.cs (1)
165Debug.Assert (value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRow.cs (5)
185Debug.Assert(rowSpanVector != null); 212Debug.Assert(i <= firstAvailableIndex); 232Debug.Assert(_spannedCells != null); 242Debug.Assert(_cells.Count <= _formatCellCount); 298Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\TableRowGroup.cs (1)
236Debug.Assert(value >= -1 && _parentIndex != value);
System\Windows\Documents\XamlToRtfWriter.cs (3)
231Debug.Assert(openLists.Count > 0); 405Debug.Assert(openLists.Count > 0); 436Debug.Assert(openLists.Count > 0);
System\Windows\EventTrigger.cs (1)
306Debug.Assert( eventTrigger._routedEventHandler == null && eventTrigger._source == null);
System\Windows\FrameworkContentElement.cs (7)
628Debug.Assert(entry.Value == DependencyProperty.UnsetValue); 1462Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1463Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1464Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 1477Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 1478Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 1479Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20);
System\Windows\FrameworkElement.cs (12)
1923Debug.Assert( IsTemplatedParentAnFE ); 2335Debug.Assert( foTemplatedParent.IsFE ); 2600Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2601Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2602Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2615Debug.Assert((uint)InternalFlags.InheritanceBehavior0 == 0x08); 2616Debug.Assert((uint)InternalFlags.InheritanceBehavior1 == 0x10); 2617Debug.Assert((uint)InternalFlags.InheritanceBehavior2 == 0x20); 2974Debug.Assert(fe != null || fce != null); 3016Debug.Assert( feTemplatedParent != null ); 4084Debug.Assert(sourceTransform != null); 4093Debug.Assert(_transform != null);
System\Windows\FrameworkElementFactory.cs (2)
715Debug.Assert( _frameworkTemplate != null ); 791Debug.Assert( _frameworkTemplate != null );
System\Windows\FrameworkTemplate.cs (2)
762Debug.Assert(fo.TemplatedParent == templatedParent); 1131Debug.Assert(!(rootElement is FrameworkElement) ||
System\Windows\Input\KeyboardNavigation.cs (2)
3104Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1)); 3105Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\HwndHost.cs (1)
975Debug.Assert(hwnd != null);
System\Windows\Localization.cs (1)
116Debug.Assert(property == AttributesProperty);
System\Windows\Markup\Baml2006\Baml2006KeyRecord.cs (1)
67Debug.Assert(StaticResources[StaticResources.Count - 1] is StaticResource);
System\Windows\Markup\Baml2006\Baml2006Reader.cs (4)
1536Debug.Assert(dataByteSize == 1); 1676Debug.Assert(ownerType != null); 1964Debug.Assert(sr != null); 2588Debug.Assert(property.Type.UnderlyingType == typeof(DependencyProperty));
System\Windows\Markup\Baml2006\Baml2006SchemaContext.cs (1)
183Debug.Assert(wpfMember.DependencyProperty != null);
System\Windows\Markup\Baml2006\WpfSharedBamlSchemaContext.cs (2)
134Debug.Assert(bamlType != null); 164Debug.Assert(bamlMember != null);
System\Windows\Markup\Baml2006\WpfXamlMember.cs (1)
129Debug.Assert(!IsAttachable && !IsEvent);
System\Windows\Markup\BamlMapTable.cs (18)
58Debug.Assert(null != xamlTypeMapper); 146Debug.Assert(cmp > 0); 252Debug.Assert(type.IsEnum); 257Debug.Assert(ReflectionHelper.IsNullableType(type)); 541Debug.Assert(propType.IsEnum); 552Debug.Assert(ReflectionHelper.IsNullableType(propType)); 610Debug.Assert(-id <= _knownStrings.Length); 615Debug.Assert(id < StringIdMap.Count); 854Debug.Assert(memberId < 0); 1090Debug.Assert( 1102Debug.Assert(bamlAssemblyInfoRecord.AssemblyId >= 0); 1113Debug.Assert(AssemblyIdMap.Count == record.AssemblyId || 1268Debug.Assert(TypeIdMap.Count == record.TypeId || 1285Debug.Assert(ownerTypeName != null); 1286Debug.Assert(attributeName != null); 1504Debug.Assert(targetType != null && memberName != null); 1646Debug.Assert(AttributeIdMap.Count == record.AttributeId || 1662Debug.Assert(StringIdMap.Count == record.StringId ||
System\Windows\Markup\BamlRecordReader.cs (35)
92Debug.Assert(null != bamlStream); 93Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 118Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper); 327Debug.Assert(bamlRecord.RecordType == BamlRecordType.LinePosition); 510Debug.Assert( stackDepth == ReaderContextStack.Count ); 526Debug.Assert(bamlConnectionIdRecord.ConnectionId > 0); 538Debug.Assert(0 == ReaderContextStack.Count); // if not zero we missed an EndElement 622Debug.Assert(false); 711Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType); 793Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType || 998Debug.Assert(_rootElement != null); 1048Debug.Assert(null == ParentContext); 1215Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr ); 1216Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP ); 1268Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams); 1298Debug.Assert(parent is DependencyObject); 1417Debug.Assert(param is String); 1460Debug.Assert(paramString != null); 2096Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter); 2523Debug.Assert(o is DependencyObject); 2739Debug.Assert(element is DependencyObject); 2975Debug.Assert(!holder.ReadOnly); // this is being checked in XamlReaderHelper, just assert 3000Debug.Assert(arrayExt != null); 3119Debug.Assert (holder.Collection == null); 3626Debug.Assert(null != CurrentContext && 3686Debug.Assert(false); 3695Debug.Assert(currentTarget is DependencyObject); 3709Debug.Assert(false); // We do not expect to be here after all checks done in propertyType identification above 3771Debug.Assert(genericType != null); 3814Debug.Assert(memberInfo is MethodInfo); 3830Debug.Assert(null != CurrentContext && 3879Debug.Assert(null != CurrentContext && 4882Debug.Assert(contentProperty != null); 5730Debug.Assert(_attributeInfo != null); 5825Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (8)
766Debug.Assert(null == _writeCache[(int)record.RecordType]); 903Debug.Assert( value <= 3 && value >= 0 ); 1091Debug.Assert(RecordSize < 0); 2387Debug.Assert(value <= ExtensionIdMask); 2717Debug.Assert(!ValueObjectSet); 4543Debug.Assert( SerializerTypeId != 0 ); 4715Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null); 4758Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlRecordWriter.cs (11)
116Debug.Assert(null != DocumentStartRecord); 134Debug.Assert(null != DocumentStartRecord); 405Debug.Assert(_deferElementDepth == 0); 406Debug.Assert(_deferComplexPropertyDepth == 0); 407Debug.Assert(_staticResourceElementDepth == 0); 408Debug.Assert(_dynamicResourceElementDepth == 0); 409Debug.Assert(_staticResourceRecordList == null); 427Debug.Assert(_staticResourceElementDepth == 0); 876Debug.Assert(_deferElementDepth == 2); 1065Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension); 1082Debug.Assert(typeValue != null);
System\Windows\Markup\BamlWriter.cs (4)
385Debug.Assert(typeValue != null); 1274Debug.Assert(stackNode != null); 1282Debug.Assert(stackNode != null); 1290Debug.Assert(stackNode != null);
System\Windows\Markup\Localizer\BamlLocalizableResource.cs (1)
57Debug.Assert(other != null);
System\Windows\Markup\MarkupExtensionParser.cs (2)
1182Debug.Assert(sb.Length > 0); 1183Debug.Assert(!Char.IsWhiteSpace(sb[0]));
System\Windows\Markup\ParserContext.cs (1)
760Debug.Assert(canDecrement);
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
41Debug.Assert(instance != null); 717Debug.Assert(obj != null); 741Debug.Assert(descriptor != null); 790Debug.Assert(DO != null);
System\Windows\Markup\Primitives\FrameworkElementFactoryMarkupObject.cs (1)
24Debug.Assert(factory != null);
System\Windows\Markup\Primitives\MarkupWriter.cs (4)
254Debug.Assert( (object)key != null); 438Debug.Assert(item != null && _writer != null); 828Debug.Assert(property.PropertyDescriptor != null); 1032Debug.Assert(property.Value != null);
System\Windows\Markup\XamlFigureLengthSerializer.cs (1)
238Debug.Assert( unit == FigureUnitType.Pixel
System\Windows\Markup\XamlGridLengthSerializer.cs (1)
238Debug.Assert( unit == GridUnitType.Pixel
System\Windows\Markup\XamlReader.cs (1)
1106Debug.Assert(parent == null || root == parent);
System\Windows\Markup\XamlTypeMapper.cs (6)
857Debug.Assert(propertyOwnerType != null); 886Debug.Assert(attachedPropertyInfo.IsPublic || 2124Debug.Assert( propertyMember is DependencyProperty); 2305Debug.Assert(memberName != null); 2308Debug.Assert(memberInfo != null); 2323Debug.Assert(targetType != null);
System\Windows\Markup\XmlnsDictionary.cs (1)
709Debug.Assert(prefix != null);
System\Windows\Media\Animation\BeginStoryboard.cs (1)
186Debug.Assert( frameworkTemplate != null );
System\Windows\Media\Animation\ControllableStoryboardAction.cs (1)
71Debug.Assert( frameworkTemplate != null );
System\Windows\Media\Animation\Generated\ThicknessAnimation.cs (1)
206Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ThicknessAnimationUsingKeyFrames.cs (1)
317Debug.Assert(animationClock.CurrentState != ClockState.Stopped);
System\Windows\Media\Animation\Generated\ThicknessKeyFrameCollection.cs (1)
476Debug.Assert(_keyFrames[index] != null);
System\Windows\Media\Animation\Storyboard.cs (1)
265Debug.Assert( nameScope == null );
System\Windows\Navigation\Journal.cs (7)
249Debug.Assert(ValidateIndexes()); 259Debug.Assert(ValidateIndexes()); 272Debug.Assert(journalEntry.ContentId != 0); 322Debug.Assert(ValidateIndexes()); 417Debug.Assert(ValidateIndexes()); 465Debug.Assert(je.GetType().IsSerializable); 564Debug.Assert(ValidateIndexes());
System\Windows\Navigation\JournalEntry.cs (2)
281Debug.Assert(_jeGroupState.JournalDataStreams == null); 298Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
System\Windows\Navigation\NavigationService.cs (29)
81Debug.Assert(_navigateQueueItem == null || _navigateQueueItem.IsPosted == false); 244Debug.Assert(IsConsistent(navInfo)); 276Debug.Assert(navMode != NavigationMode.Refresh); // because of !IsSameUri() above 297Debug.Assert(_navStatus == NavigationStatus.Navigating); 442Debug.Assert(!(_bp is Visual)); 575Debug.Assert(_parentNavigationService == newParent); 848Debug.Assert(_navigateQueueItem == null && _navStatus == NavigationStatus.Navigated); 872Debug.Assert(finishingChildPageFunction == null || 891Debug.Assert(finishingChildPageFunction._Return == null); 922Debug.Assert(pfReturnInfo == null); 928Debug.Assert(pf.ParentPageFunctionId != Guid.Empty); 967Debug.Assert(IsConsistent(navInfo)); 992Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 996Debug.Assert(_navigateQueueItem == null); 1153Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation); 1170Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward); 1173Debug.Assert(_contentId != 0); 1177Debug.Assert(_journalEntryGroupState == null || 2058Debug.Assert(navigateInfo.IsConsistent); 2199Debug.Assert(_navStatus == NavigationStatus.Navigated); 2539Debug.Assert(sender == _bp); 3022Debug.Assert(IsConsistent(navigateInfo)); 3054Debug.Assert(destinationJournalEntry == null 3133Debug.Assert(_contentId != 0 && 3633Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction() 3737Debug.Assert(parentPF._Return == null); 3839Debug.Assert(parentEntryIndex < journal.CurrentIndex); 4344Debug.Assert(_postedOp == null); 4435Debug.Assert(child != null);
System\Windows\Navigation\NavigationWindow.cs (2)
212Debug.Assert(_navigationService == null && _JNS == null); 304Debug.Assert(_JNS != null);
System\Windows\Navigation\PageFunction.cs (2)
269Debug.Assert((returnEventArgs == null) || (ra != null)); 273Debug.Assert(eh != null);
System\Windows\PropertyPath.cs (1)
432Debug.Assert(aryIPI.Length > 0);
System\Windows\ResourceDictionary.cs (9)
187Debug.Assert(classicResourceUri != null); 201Debug.Assert(genericResourceUri != null); 1085Debug.Assert(deferrableContent.Stream != null); 1086Debug.Assert(deferrableContent.SchemaContext != null); 1087Debug.Assert(deferrableContent.ObjectWriterFactory != null); 1088Debug.Assert(deferrableContent.ServiceProvider != null); 1089Debug.Assert(deferrableContent.RootObject != null); 1268Debug.Assert(staticResources != null && staticResources.Count > 0); 1306Debug.Assert(obj is DeferredResourceReference);
System\Windows\ResourceReferenceExpression.cs (1)
555Debug.Assert(!_resource.IsFrozen);
System\Windows\Shapes\Shape.cs (5)
629Debug.Assert(mode != Stretch.None); 651Debug.Assert(mode == Stretch.UniformToFill); 683Debug.Assert(geometry != null); 723Debug.Assert(geometry != null); 734Debug.Assert(_renderedGeometry != null);
System\Windows\Shell\JumpList.cs (12)
449Debug.Assert(_initializing == false); 680Debug.Assert(removedList != null); 681Debug.Assert(shellObject != null); 755Debug.Assert(false); 761Debug.Assert(shellObjects != null); 798Debug.Assert(jumpItems.Count != 0); 799Debug.Assert(cdl != null); 854Debug.Assert(jumpItems.Count != linksOnlyList.Count); 860Debug.Assert(HRESULT.DESTS_E_NO_MATCHING_ASSOC_HANDLER != hr); 876Debug.Assert(jumpTask != null); 989Debug.Assert(jumpPath != null); 1059Debug.Assert(false);
System\Windows\Shell\ThumbButtonInfo.cs (1)
278Debug.Assert(command != null);
System\Windows\StyleHelper.cs (54)
55Debug.Assert(fe != null || fce != null); 94Debug.Assert(fe != null || fce != null); 158Debug.Assert((fe != null && fce == null)|| (fe == null && fce != null)); 348Debug.Assert(frameworkTemplate != null ); 365Debug.Assert( !frameworkTemplate.HasXamlNodeContent ); 369Debug.Assert(frameworkTemplate != null); 407Debug.Assert( frameworkTemplate != null ); 765Debug.Assert(childIndex >= 0); 1279Debug.Assert( childIndex != 0 ); // This should go to the other AddDelegateToFireTrigger overload 1337Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1369Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1370Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1371Debug.Assert(newStyle != null || newFrameworkTemplate != null ); 1433Debug.Assert((fe != null && fce == null) || (fe == null && fce != null)); 1434Debug.Assert((fe != null && fe == container) || (fce != null && fce == container)); 1435Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1669Debug.Assert(oldStyle != null || oldFrameworkTemplate != null ); 1687Debug.Assert(dataField == ThemeStyleDataField); 1769Debug.Assert(frameworkTemplate != null ); 2043Debug.Assert(frameworkTemplate != null ); 2178Debug.Assert(feContainer != null || fceContainer != null); 2213Debug.Assert(oldFrameworkTemplate != null ); 2262Debug.Assert( oldFrameworkTemplate != null ); 2476Debug.Assert( feTemplatedParent != null ); 2500Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 2512Debug.Assert( frameworkTemplate != null ); 2881Debug.Assert(dataField == ThemeStyleDataField); 3020Debug.Assert(frameworkTemplate != null ); 3034Debug.Assert(frameworkTemplate != null ); 3145Debug.Assert(fe != null || fce != null); 3227Debug.Assert(fe != null || fce != null); 3299Debug.Assert(feContainer != null); 3308Debug.Assert(feContainer != null); 3348Debug.Assert(feContainer != null); 3371Debug.Assert(feContainer != null); 3399Debug.Assert(feContainer != null); 3443Debug.Assert(fe != null || fce != null); 3444Debug.Assert(container == fe || container == fce); 3484Debug.Assert(fe != null || fce != null); 3485Debug.Assert(container == fe || container == fce); 3898Debug.Assert(sourceType == ValueLookupType.Simple || 3928Debug.Assert(sourceType == ValueLookupType.Trigger || 3982Debug.Assert(sourceType == ValueLookupType.Simple || 4192Debug.Assert(child.FE != null || child.FCE != null); 4301Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4372Debug.Assert(ownerStyle != null || frameworkTemplate != null ); 4543Debug.Assert( ft != null ); 5305Debug.Assert(frameworkTemplate != null ); 5312Debug.Assert(frameworkTemplate != null); 5336Debug.Assert(frameworkTemplate != null); 5381Debug.Assert(frameworkTemplate != null ); 5386Debug.Assert(frameworkTemplate != null); 5439Debug.Assert( 5549Debug.Assert(routedEvent != null);
System\Windows\SystemResources.cs (8)
1089Debug.Assert(_hwndNotify != null); 1090Debug.Assert(_hwndNotifyHook != null); 1091Debug.Assert(callerName.Equals(nameof(EnsureResourceChangeListener), StringComparison.InvariantCulture)); 1119Debug.Assert(!_hwndNotify.ContainsKey(hwndDpiInfo)); 1120Debug.Assert(hwndDpiInfo.DpiAwarenessContextValue == dpiContextValue); 1157Debug.Assert(dpiContextValue == DpiAwarenessContextValue.Unaware || dpiContextValue == DpiAwarenessContextValue.SystemAware); 1548Debug.Assert(hwndDpiInfo != null); 1820Debug.Assert(_inflatedList != null);
System\Windows\SystemThemeKey.cs (1)
27Debug.Assert(id > SystemResourceKeyID.InternalSystemThemeStylesStart &&
System\Windows\TemplateContent.cs (11)
40Debug.Assert(_xamlType == null); 233Debug.Assert(TemplateLoadData.Reader != null); 321Debug.Assert(childIndex == lastIndex); 611Debug.Assert(sharedValue != null); 751Debug.Assert(xamlReader.NodeType == Xaml.XamlNodeType.StartObject); 752Debug.Assert(xamlReader.Type.UnderlyingType == typeof(StaticResourceExtension)); 774Debug.Assert(resource != null); 797Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartMember); 892Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.StartObject); 1150Debug.Assert(xamlReader.NodeType == System.Xaml.XamlNodeType.EndMember); 1229Debug.Assert(templateChildName != null);
System\Windows\TemplateNameScope.cs (2)
162Debug.Assert(_affectedChildren.Count == childIndex); 212Debug.Assert(fo.IsFE);
System\Windows\TriggerActionCollection.cs (1)
280Debug.Assert (Owner == null);
System\Windows\TriggerCollection.cs (1)
105Debug.Assert (Owner == null);
System\Windows\Window.cs (16)
721Debug.Assert(false); 2295Debug.Assert( _swh != null ); 2304Debug.Assert( _swh != null ); 3880Debug.Assert(hMonitor != IntPtr.Zero); 6476Debug.Assert(0 != (int)_overlaySize.Width); 6477Debug.Assert(0 != (int)_overlaySize.Height); 6520Debug.Assert(null != _taskbarList); 6546Debug.Assert(false); 6565Debug.Assert(null != _taskbarList); 6579Debug.Assert(0 <= taskbarInfo.ProgressValue && taskbarInfo.ProgressValue <= 1); 6587Debug.Assert(null != _taskbarList); 6612Debug.Assert(null != _taskbarList); 6683Debug.Assert(null != _taskbarList); 6711Debug.Assert(null != _taskbarList); 7145Debug.Assert( _swh != null ); 7363Debug.Assert( sourceWindow != null );
PresentationFramework.Aero (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
PresentationFramework.Aero2 (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
PresentationFramework.AeroLite (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
PresentationFramework.Classic (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
PresentationFramework.Luna (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
PresentationFramework.Royale (1)
src\Microsoft.DotNet.Wpf\src\Themes\Shared\Microsoft\Windows\Themes\PlatformCulture.cs (1)
28Debug.Assert(_platformCulture != null);
ReachFramework (42)
AlphaFlattener\BrushProxy.cs (18)
1192Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1224Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute); 1384Debug.Assert(!_bounds.IsEmpty); 1392Debug.Assert(_brushList != null && _bounds.IsEmpty); 1731Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1732Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 1987Debug.Assert(g.GradientStops != null); 2042Debug.Assert(g.GradientStops.Count > 0); 3785Debug.Assert(false); // Optimization is needed before reaching here 3791Debug.Assert(false); // Optimization is needed before reaching here 3796Debug.Assert(steps > 0); 3836Debug.Assert((i >= 0) && (i < steps)); 3850Debug.Assert(false); 3947Debug.Assert(di >= 0); 4049Debug.Assert(_left <= left); 4050Debug.Assert(_right >= right); 4276Debug.Assert(_left <= left); 4277Debug.Assert(_right >= right);
AlphaFlattener\DrawingContext.cs (1)
477Debug.Assert(one != null);
AlphaFlattener\ImageProxy.cs (2)
56Debug.Assert(image != null); 128Debug.Assert(
AlphaFlattener\MetroDevice.cs (2)
448Debug.Assert(ticket != null); 492Debug.Assert(ticketXMLString == null);
AlphaFlattener\Optimizer.cs (1)
73Debug.Assert(GetPrimitiveIntersectAction() == PrimitiveIntersectAction.ClipToCluster);
AlphaFlattener\Primitive.cs (1)
750Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute);
AlphaFlattener\SegmentTree.cs (1)
54Debug.Assert(count >= 2);
AlphaFlattener\Utility.cs (4)
1384Debug.Assert( 1732Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute); 1733Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute); 2367Debug.Assert(!rect.IsEmpty);
MS\Internal\Printing\MostFrequentlyUsedCache.cs (1)
33Debug.Assert(this._dictionary.Count <= this._maxEntries);
PrintConfig\PTProvider.cs (1)
596Debug.Assert(resultLength >= 0);
Serialization\DrawingContextFlattener.cs (7)
138Debug.Assert(_fullTransform.Count == _fullClip.Count); 360Debug.Assert(visual != null); 474Debug.Assert(rHalfChord2 >= rFuzz2); // Otherewise we have no guarantee that the radius is not 0, 571Debug.Assert(cPieces > 0); 641Debug.Assert(rDot >= -rRadSquared * .1); // angle < 90 degrees 642Debug.Assert(rDot <= rRadSquared * 1.1); // as dot product of 2 radius vectors 886Debug.Assert(context != null);
Serialization\VisualSerializer.cs (1)
2007Debug.Assert(Utility.IsScaleTranslate(bitmapToDrawingTransform));
Serialization\VisualTreeFlattener.cs (2)
346Debug.Assert(treeWalkProgress != null); 361Debug.Assert(treeWalkProgress != null);
Replay (8)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
504Debug.Assert(reason is object);
src\Compilers\Core\Portable\InternalUtilities\Debug.cs (3)
15/// <inheritdoc cref="Debug.Assert(bool)"/> 17public static void Assert([DoesNotReturnIf(false)] bool condition) => Debug.Assert(condition); 41/// Generally <see cref="Debug.Assert(bool)"/> is a sufficient method for enforcing DEBUG
src\Compilers\Shared\BuildServerConnection.cs (4)
68Debug.Assert(workingDirectory is object); 179Debug.Assert(pipeName is object); 703Debug.Assert(Stream is null); 741Debug.Assert(Stream is not null);
Roslyn.Test.PdbUtilities (9)
EditAndContinue\EditAndContinueTest.cs (2)
193Debug.Assert(oldSymbol != null); 194Debug.Assert(newSymbol != null);
EditAndContinue\EditAndContinueTest.GenerationInfo.cs (1)
34Debug.Assert(diff is null ^ compilationVerifier is null);
EditAndContinue\EditAndContinueTest.GenerationVerifier.cs (5)
146Debug.Assert(generationInfo.CompilationDifference != null); 153Debug.Assert(generationInfo.CompilationDifference != null); 166Debug.Assert(generationInfo.CompilationDifference != null); 188Debug.Assert(generationInfo.CompilationDifference != null); 201Debug.Assert(generationInfo.CompilationDifference != null);
Reader\MockSymUnmanagedReader.cs (1)
362Debug.Assert((bufferLength == 0) || (bufferLength == count));
RunTests (4)
AssemblyScheduler.cs (1)
219Debug.Assert(tests.Any());
HelixTestRunner.cs (1)
109onOutputDataReceived: (e) => { Debug.Assert(e.Data is not null); ConsoleUtil.WriteLine(e.Data); },
ProcDumpUtil.cs (2)
20Debug.Assert(IsAdministrator()); 30Debug.Assert(IsAdministrator());
SemanticSearch.BuildTask (10)
GenerateFilteredReferenceAssembliesTask.cs (10)
305Debug.Assert(id is [_, ':', ..]); 362Debug.Assert(headers.PEHeader != null); 403Debug.Assert(metadataReader.GetGuid(moduleDef.Mvid) == ReadGuid(writableStream)); 448Debug.Assert((TypeAttributes)ReadUInt32(writer.BaseStream) == typeDef.Attributes); 451Debug.Assert(BitConverter.IsLittleEndian); 482Debug.Assert((MethodAttributes)ReadUInt16(writer.BaseStream) == def.Attributes); 485Debug.Assert(BitConverter.IsLittleEndian); 516Debug.Assert((FieldAttributes)ReadUInt16(writer.BaseStream) == def.Attributes); 519Debug.Assert(BitConverter.IsLittleEndian); 534Debug.Assert(stream.Read(buffer, 0, buffer.Length) == buffer.Length);
Shared (17)
ServerSentEvents\ArrayBuffer.cs (9)
41Debug.Assert(initialSize > 0 || usePool); 53Debug.Assert(buffer.Length > 0); 78Debug.Assert(_usePool); 79Debug.Assert(_bytes is not null); 118Debug.Assert(byteCount <= AvailableLength); 134Debug.Assert(AvailableLength < byteCount); 138Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 150Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
ServerSentEvents\Helpers.cs (4)
35Debug.Assert(buffer.Length >= MaxDecimalDigits); 38Debug.Assert(success); 53Debug.Assert(value.Length <= buffer.Length); 67Debug.Assert(maxByteCount <= buffer.Length);
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);
System.CodeDom (2)
Microsoft\CSharp\CSharpCodeGenerator.cs (1)
2409Debug.Assert(names.Length > 0);
Microsoft\VisualBasic\VBCodeGenerator.cs (1)
2329Debug.Assert(names.Length > 0);
System.Collections (101)
src\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\BitArray.cs (12)
97Debug.Assert(byteSpan.Length >= 0 && byteSpan.Length < 4); 227Debug.Assert(bits.m_array.Length <= arrayLength); 801Debug.Assert(span.Length > 0); 802Debug.Assert(m_array.Length > quotient); 997Debug.Assert(GetInt32ArrayLengthFromBitLength(m_length) > 0); 998Debug.Assert(intCount == GetInt32ArrayLengthFromBitLength(m_length) - 1); 1027Debug.Assert(GetInt32ArrayLengthFromBitLength(m_length) > 0); 1028Debug.Assert(intCount == GetInt32ArrayLengthFromBitLength(m_length) - 1); 1071Debug.Assert(n >= 0); 1077Debug.Assert(n >= 0); 1085Debug.Assert(n >= 0); 1178Debug.Assert(index >= _bitArray.m_length);
System\Collections\Generic\OrderedDictionary.cs (26)
381Debug.Assert(modified); 407Debug.Assert(0 <= keyIndex && keyIndex < _count); 409Debug.Assert(_entries is not null); 435Debug.Assert(index <= _count); 445Debug.Assert(entries is not null); 475Debug.Assert(0 <= keyIndex && keyIndex < _count); 515Debug.Assert(collection is not null); 538Debug.Assert(_entries is not null); 673Debug.Assert(comparer is not null); 753Debug.Assert(_entries is not null); 780Debug.Assert(entries is not null); 801Debug.Assert(_entries is not null); 820Debug.Assert(_entries is not null); 834Debug.Assert(_comparer is not null); 933Debug.Assert(_entries is not null); 961Debug.Assert(entries is not null); 1011Debug.Assert(shiftAmount is 1 or -1); 1014Debug.Assert(entries is not null); 1104Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1106Debug.Assert(_comparer is not null); 1107Debug.Assert(_comparer is not NonRandomizedStringEqualityComparer); 1139Debug.Assert(buckets is not null); 1174Debug.Assert(_entries is not null); 1434Debug.Assert(dictionary._entries is not null); 1513Debug.Assert(entries is not null); 1702Debug.Assert(entries is not null);
System\Collections\Generic\PriorityQueue.cs (10)
62Debug.Assert(Log2Arity > 0 && Math.Pow(2, Log2Arity) == Arity); 631Debug.Assert(_nodes.Length < minCapacity); 726Debug.Assert(_comparer is null); 727Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 758Debug.Assert(_comparer is not null); 759Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 792Debug.Assert(_comparer is null); 793Debug.Assert(0 <= nodeIndex && nodeIndex < _size); 840Debug.Assert(_comparer is not null); 841Debug.Assert(0 <= nodeIndex && nodeIndex < _size);
System\Collections\Generic\SortedList.cs (1)
158Debug.Assert(count == this.keys.Length);
System\Collections\Generic\SortedSet.cs (34)
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)); 801Debug.Assert(set1 != null); 1139Debug.Assert(other != null); 1140Debug.Assert(HasEqualComparer(other)); 1145Debug.Assert(result); 1151Debug.Assert(other != null); 1152Debug.Assert(count >= 0 && count <= other.Length); 1168Debug.Assert(result); 1631Debug.Assert(count == GetCount()); 1665Debug.Assert(IsNonNullRed(sibling.Left) || IsNonNullRed(sibling.Right)); 1667Debug.Assert(HasChildren(current, sibling)); 1681Debug.Assert(node != null); 1682Debug.Assert(node == Left ^ node == Right); 1691Debug.Assert(Left != null); 1692Debug.Assert(Right != null); 1709Debug.Assert(removeRed.IsRed); 1714Debug.Assert(removeRed.IsRed); 1718Debug.Assert(Right!.Left!.IsRed); 1721Debug.Assert(Left!.Right!.IsRed); 1786Debug.Assert(IsRed); 1787Debug.Assert(Left!.Is2Node); 1788Debug.Assert(Right!.Is2Node); 1804Debug.Assert(HasChild(child)); 1824Debug.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); 409Debug.Assert(_index == -1 || _index == -2);
System.Collections.Concurrent (71)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Concurrent\BlockingCollection.cs (9)
212Debug.Assert(boundedCapacity > 0 || boundedCapacity == NON_BOUNDED); 226Debug.Assert(boundedCapacity > 0); 492Debug.Assert((_currentAdders & ~COMPLETE_ADDING_ON_MASK) > 0); 711Debug.Assert(_boundedCapacity != NON_BOUNDED); 998Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count)); 1033Debug.Assert(result); 1050Debug.Assert(collections != null); 1097Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite); 1396Debug.Assert((index == WaitHandle.WaitTimeout) || (index >= 0 && index < handles.Count));
System\Collections\Concurrent\ConcurrentBag.cs (20)
149Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 304Debug.Assert(copied == count); 321Debug.Assert(Monitor.IsEntered(GlobalQueuesLock)); 392Debug.Assert(copied == count); 521Debug.Assert(count >= 0); 605Debug.Assert(_locals != null); 617Debug.Assert(!Monitor.IsEntered(GlobalQueuesLock)); 644Debug.Assert(Monitor.IsEntered(GlobalQueuesLock) == lockTaken); 724Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 750Debug.Assert(_headIndex - _tailIndex <= 0); 844Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 861Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 936Debug.Assert(Environment.CurrentManagedThreadId == _ownerThreadId); 1027Debug.Assert(Monitor.IsEntered(this)); 1028Debug.Assert(_frozen); 1029Debug.Assert(array != null); 1030Debug.Assert(arrayIndex >= 0 && arrayIndex <= array.Length); 1039Debug.Assert(arrayIndex <= array.Length - count); 1060Debug.Assert(Monitor.IsEntered(this)); 1095Debug.Assert(array != null);
System\Collections\Concurrent\ConcurrentDictionary.cs (19)
308Debug.Assert(comparer is not null); 330Debug.Assert(comparer is not null); 542Debug.Assert(comparer is not null); 576Debug.Assert(comparer is not null); 638Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 914Debug.Assert(buckets is not null); 951Debug.Assert(nullableHashcode is null || nullableHashcode == hashcode); 2096Debug.Assert(locksAcquired == _tables._locks.Length); 2109Debug.Assert(locksAcquired == 0); 2110Debug.Assert(!Monitor.IsEntered(locks[0])); 2126Debug.Assert(Monitor.IsEntered(locks[0])); 2127Debug.Assert(locksAcquired == 1); 2135Debug.Assert(locksAcquired == locks.Length); 2142Debug.Assert(locksAcquired >= 0); 2177Debug.Assert(i == count); 2213Debug.Assert(i == count); 2303Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 2344Debug.Assert(tables is not null); 2367Debug.Assert(dictionary is not null);
System\Collections\Concurrent\PartitionerStatic.cs (21)
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); 743Debug.Assert(requestedChunkSize > 0); 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);
System.Collections.Immutable (172)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
System\Collections\Frozen\FrozenDictionary.AlternateLookup.cs (3)
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 (5)
107Debug.Assert(newDictionary is not null); 108Debug.Assert(newDictionary.Comparer.Equals(comparer)); 178Debug.Assert(minLength >= 0 && maxLength >= minLength); 346Debug.Assert(keys.Length == values.Length); 636Debug.Assert(keys.Length == values.Length);
System\Collections\Frozen\FrozenHashTable.cs (8)
30Debug.Assert(hashCodes.Length != 0); 31Debug.Assert(buckets.Length != 0); 112Debug.Assert(count == hashtableHashcodes.Length); 148Debug.Assert(hashCodes.Length != 0); 149Debug.Assert(!hashCodesAreUnique || new HashSet<int>(hashCodes.ToArray()).Count == hashCodes.Length); 173Debug.Assert(uniqueCodesCount != 0); 209Debug.Assert(maxPrimeIndexExclusive != 0); 303Debug.Assert(count > 0);
System\Collections\Frozen\FrozenSet.AlternateLookup.cs (3)
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 (3)
90Debug.Assert(newSet is not null); 91Debug.Assert(newSet.Comparer.Equals(comparer)); 154Debug.Assert(minLength >= 0 && maxLength >= minLength);
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\Integer\DenseIntegralFrozenDictionary.cs (1)
92Debug.Assert(length > 0);
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)
80Debug.Assert(KeyAnalyzer.IsAllAscii(s));
System\Collections\Frozen\String\KeyAnalyzer.cs (2)
34Debug.Assert(!uniqueStrings.IsEmpty); 246Debug.Assert(IsAllAscii(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)
1086Debug.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); 1279Debug.Assert(!this.IsEmpty); 1280Debug.Assert(!_right!.IsEmpty); 1291Debug.Assert(!this.IsEmpty); 1292Debug.Assert(!_left!.IsEmpty); 1303Debug.Assert(!this.IsEmpty); 1304Debug.Assert(!_right!.IsEmpty); 1305Debug.Assert(!_right!._left!.IsEmpty); 1321Debug.Assert(!this.IsEmpty); 1322Debug.Assert(!_left!.IsEmpty); 1323Debug.Assert(!_left._right!.IsEmpty); 1343Debug.Assert(!this.IsEmpty); 1384Debug.Assert(!this.IsEmpty); 1385Debug.Assert(this.IsLeftHeavy); 1396Debug.Assert(!this.IsEmpty); 1397Debug.Assert(this.IsRightHeavy); 1413Debug.Assert(tree._left != null && tree._right != null); 1419Debug.Assert(tree._left != null); 1425Debug.Assert(tree._right != null); 1446Debug.Assert(!this.IsEmpty); 1471Debug.Assert(!this.IsEmpty); 1495Debug.Assert(!this.IsEmpty); 1535Debug.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 (4)
235Debug.Assert(newSet != null); 359Debug.Assert(result != null); 1144Debug.Assert(list.Count > 0); 1202Debug.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.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.ComponentModel.Annotations (9)
System\ComponentModel\DataAnnotations\MaxLengthAttribute.cs (1)
119Debug.Assert(value != null);
System\ComponentModel\DataAnnotations\ValidationAttribute.cs (3)
106Debug.Assert(_defaultErrorMessage is null && _errorMessageResourceName is null && _errorMessage is null && _errorMessageResourceType is null); 264Debug.Assert(_errorMessageResourceType != null); 265Debug.Assert(!string.IsNullOrEmpty(_errorMessageResourceName));
System\ComponentModel\DataAnnotations\ValidationAttributeStore.cs (2)
120Debug.Assert(type != null); 271Debug.Assert(propertyType != null);
System\ComponentModel\DataAnnotations\Validator.cs (3)
338Debug.Assert(validationContext != null); 408Debug.Assert(instance != null); 613Debug.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); 727Debug.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.TypeConverter (23)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
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\Design\DesigntimeLicenseContextSerializer.cs (1)
97Debug.Assert(_readFirstByte);
System\ComponentModel\Design\PropertyTabAttribute.cs (1)
102Debug.Assert(_tabClassNames != null);
System\ComponentModel\Design\Serialization\MemberRelationshipService.cs (2)
49Debug.Assert(source.Member != null); 62Debug.Assert(source.Member != null);
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\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\ReflectTypeDescriptionProvider.cs (3)
925Debug.Assert(td != null); 933Debug.Assert(td != null); 1592Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
System\ComponentModel\UInt128Converter.cs (2)
25Debug.Assert(radix == 16); 26Debug.Assert(value is not null);
System.Composition.Hosting (1)
System\Composition\Hosting\CompositionHost.cs (1)
27Debug.Assert(rootLifetimeContext != null);
System.Composition.Runtime (2)
System\Composition\Runtime\Util\Formatters.cs (2)
24Debug.Assert(closedGenericType != null); 25Debug.Assert(closedGenericType.IsConstructedGenericType);
System.Configuration.ConfigurationManager (20)
System\Configuration\BaseConfigurationRecord.cs (6)
2171Debug.Assert(UrlPath.IsSubpath(_parent.ConfigPath, input.SectionXmlInfo.TargetConfigPath)); 2249Debug.Assert(FindFactoryRecord(configKey, true) != null); 2265Debug.Assert(mode != OverrideMode.Inherit); // Remember that the default is never Inherit 2280Debug.Assert(mode != OverrideMode.Inherit); 3750Debug.Assert(x.SectionXmlInfo.ConfigKey == y.SectionXmlInfo.ConfigKey); 3778Debug.Assert(StringUtil.EqualsIgnoreCase(yTargetConfigPath, xTargetConfigPath));
System\Configuration\ConfigPathUtility.cs (1)
96Debug.Assert(index != configPath.Length - 1);
System\Configuration\ConfigurationElement.cs (5)
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);
System\Configuration\MgmtConfigurationRecord.cs (3)
338Debug.Assert(sectionRecord != null); 351Debug.Assert(input != null); 2707Debug.Assert(LocationSubPath == null);
System\Configuration\OverrideModeSetting.cs (3)
114Debug.Assert((x._mode & ApiDefinedAny) != 0); 192Debug.Assert(useLegacy || ((_mode & ApiDefinedNewMode) != 0)); 204Debug.Assert(useLegacy || ((_mode & XmlDefinedNewMode) != 0));
System\Configuration\SectionRecord.cs (1)
168Debug.Assert(sectionInput != null);
System\Configuration\UpdateConfigHost.cs (1)
33Debug.Assert(!string.IsNullOrEmpty(oldStreamname));
System.Console (43)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Console.cs (3)
198Debug.Assert(!Monitor.IsEntered(s_syncObject)); 578Debug.Assert(s_sigQuitRegistration is null); 986Debug.Assert(ctx.Signal == PosixSignal.SIGINT || ctx.Signal == PosixSignal.SIGQUIT);
System\ConsolePal.Unix.cs (11)
256Debug.Assert(left >= 0); 433Debug.Assert(!Console.IsInputRedirected); 476Debug.Assert(!string.IsNullOrEmpty(TerminalFormatStrings.CursorPositionReport)); 513Debug.Assert(readBytesPos > 0 && readBytesPos <= readBytes.Length); 514Debug.Assert(escPos == 0 && bracketPos > escPos && semiPos > bracketPos && rPos > semiPos); 515Debug.Assert(readBytes[escPos] == Esc); 516Debug.Assert(readBytes[bracketPos] == '['); 517Debug.Assert(readBytes[semiPos] == ';'); 518Debug.Assert(readBytes[rPos] == 'R'); 943Debug.Assert(result <= buffer.Length); 951Debug.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\TermInfo.cs (5)
188Debug.Assert(char.IsAsciiDigit(format[pos])); 199Debug.Assert(char.IsAsciiDigit(format[pos])); 207Debug.Assert(format[pos + 2] == '\''); 298Debug.Assert(format[pos] == 'e' || format[pos] == ';'); 361Debug.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 (370)
System\Data\Common\DataStorage.cs (1)
381Debug.Assert(storageType != StorageType.Empty);
System\Data\Common\DbConnectionStringBuilder.cs (4)
147Debug.Assert(keyword != null); 444Debug.Assert(reflected != null); 473Debug.Assert(keyword != null); 558Debug.Assert(property != null);
System\Data\Common\DbDataAdapter.cs (1)
1366Debug.Assert(rowUpdatedEvent.Rows != null);
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\FieldNameLookup.cs (1)
31Debug.Assert(null != fieldNames[i]);
System\Data\ConstraintCollection.cs (3)
32Debug.Assert(table != null); 667Debug.Assert(name != null); 795Debug.Assert(constr._parentTableName != null);
System\Data\DataColumn.cs (4)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName)); 456Debug.Assert(value != null); 1096Debug.Assert(table != null || !Unique); 1826Debug.Assert(_table != null);
System\Data\DataColumnCollection.cs (1)
821Debug.Assert(name != null);
System\Data\DataRelation.cs (1)
716Debug.Assert(destination != null);
System\Data\DataRelationCollection.cs (2)
399Debug.Assert(name != null); 628Debug.Assert(relation != null);
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 (4)
328Debug.Assert(info != null); 3008Debug.Assert(dataSet != null); 3026Debug.Assert(dataSet != null); 3078Debug.Assert(table != null);
System\Data\DataTable.cs (19)
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); 2143Debug.Assert(ndx != null); 3373Debug.Assert(key.HasValue); 5036Debug.Assert(result.Max >= result.Min); 6592Debug.Assert(DataSet != null); 6831Debug.Assert(table != null); 6882Debug.Assert(ds != null); 7074Debug.Assert(column._table != null);
System\Data\DataTableCollection.cs (1)
737Debug.Assert(name != null);
System\Data\EnumerableRowCollection.cs (1)
280Debug.Assert(pred != null);
System\Data\EnumerableRowCollectionExtensions.cs (1)
153Debug.Assert(source != null);
System\Data\Filter\BinaryNode.cs (1)
144Debug.Assert(IsConstant());
System\Data\ForeignKeyConstraint.cs (4)
260Debug.Assert(row.Table.DataSet != null); 360Debug.Assert(row.Table.DataSet != null); 405Debug.Assert(Table?.DataSet != null && row.Table.DataSet != null); 498Debug.Assert(Table?.DataSet != null);
System\Data\LinqDataView.cs (1)
111Debug.Assert(base.Sort != null);
System\Data\Merger.cs (4)
45Debug.Assert(_dataSet != null); 234Debug.Assert(_dataSet != null); 469Debug.Assert(_dataSet != null); 521Debug.Assert(_dataSet != null);
System\Data\ProviderBase\SchemaMapping.cs (8)
310Debug.Assert(_readerDataValues != null); 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);
System\Data\Select.cs (12)
60Debug.Assert(_candidateColumns != null); 183Debug.Assert(_candidateColumns != null); 237Debug.Assert(_candidateColumns != null); 316Debug.Assert(_candidateColumns != null); 475Debug.Assert(_candidateColumns != null); 515Debug.Assert(_candidateColumns != null); 714Debug.Assert(_index != null && _candidateColumns != null); 750Debug.Assert(_index != null); 769Debug.Assert(_index != null); 787Debug.Assert(_index != null); 806Debug.Assert(_index != null); 835Debug.Assert(_index != null);
System\Data\Selection.cs (1)
113Debug.Assert(indexFields != null);
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)
121Debug.Assert(timeticks == s_maxTime + 1); 242Debug.Assert(time == s_maxTime + 1);
System\Data\SQLTypes\SQLDecimal.cs (22)
786Debug.Assert(rglData.Length >= 4); 834Debug.Assert(!IsNull); 840Debug.Assert(!IsNull); 1252Debug.Assert(ResInteger <= MaxPrecision); 1256Debug.Assert(ResScale <= MaxScale); 1265Debug.Assert(ResPrec - ResInteger >= 0); 1315Debug.Assert(dwlAccum < s_ulInt32Base); 1515Debug.Assert(dwlAccum < s_ulInt32Base * 2); 1518Debug.Assert(dwlAccum < s_ulInt32Base); // can never final accum > 1 more UI4 1534Debug.Assert(s_NUMERIC_MAX_PRECISION == ResPrec); 2096Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27); 2168Debug.Assert(dwlAccum < s_ulInt32Base); 2237Debug.Assert(dwlAccum < dwlDivisor); 2239Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base); 2266Debug.Assert(dwlAccum < s_ulInt32Base); 2504Debug.Assert(iulX > s_uiZero); 2537Debug.Assert(rgulU.Length == s_cNumeMax); 2605Debug.Assert(rgulU.Length == s_cNumeMax); 2606Debug.Assert(rgulD.Length == s_cNumeMax); 3018Debug.Assert(uiDigit < 10); 3025Debug.Assert(rguiData.Length == 4); 3034Debug.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 (4)
263Debug.Assert(!IsNull); 728Debug.Assert(cbX % 2 == 0); 729Debug.Assert(cbY % 2 == 0); 775Debug.Assert(!x.IsNull && !y.IsNull);
System\Data\TypeLimiter.cs (4)
25Debug.Assert(scope != null); 200Debug.Assert(allowedTypes != null); 223Debug.Assert(type != null); 265Debug.Assert(type != null);
System\Data\xmlsaver.cs (11)
1018Debug.Assert(ds == null || dt == null); 1019Debug.Assert(_dsElement != null); 1243Debug.Assert(_prefixes != null); 1425Debug.Assert(_prefixes != null); 1426Debug.Assert(_dc != null); 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);
System\Xml\DataPointer.cs (22)
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); 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 (17)
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); 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 (129)
56Debug.Assert(_pointers.ContainsValue(pointer) == false); 66Debug.Assert(temp != null); 102Debug.Assert(_dataSet == null); 103Debug.Assert(ds != null); 193Debug.Assert(_ignoreXmlEvents); 208Debug.Assert(DocumentElement == null || !fLoadFromDataSet); 241Debug.Assert(_fDataRowCreatedSpecial == false); 242Debug.Assert(_fBoundToDataSet == false && _fBoundToDocument == false); 249Debug.Assert(_fDataRowCreatedSpecial); 267Debug.Assert(_dataSet != null); 344Debug.Assert((_fBoundToDataSet == false) && (_fBoundToDocument == false)); 346Debug.Assert(_fBoundToDataSet ? _fBoundToDocument : (!_fBoundToDocument)); 360Debug.Assert(_fDataRowCreatedSpecial == false); 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 == false); 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 == false); 968Debug.Assert(newNode != null); 986Debug.Assert(_ignoreDataSetEvents); 987Debug.Assert(_ignoreXmlEvents); 988Debug.Assert(IsFoliationEnabled == false); 1029Debug.Assert(clone.FirstChild == null); 1191Debug.Assert(reader is XmlTextReader); 1217Debug.Assert(DocumentElement != null); 1254Debug.Assert(r.Element == null); 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)); 1518Debug.Assert(e != null); 1578Debug.Assert(relation.ChildTable == row.Table); 1587Debug.Assert(args.Row.RowState != DataRowState.Deleted); 1605Debug.Assert(be != null); 1622Debug.Assert(row != null); 1623Debug.Assert(rowElement != null); 1651Debug.Assert(_ignoreXmlEvents); 1695Debug.Assert(pointer != null); 1724Debug.Assert(child.Element == childElement && childElement.Row == child); 1726Debug.Assert(_ignoreXmlEvents); 1756Debug.Assert(colInParent != null); 1770Debug.Assert(fChildElementConnected == IsConnected(childElement)); 1771Debug.Assert(IsRowLive(child) ? IsConnected(childElement) : !IsConnected(childElement)); 1794Debug.Assert(DataSet.EnforceConstraints == false); 1830Debug.Assert(DataSet.EnforceConstraints == false); 1843Debug.Assert(oldParent == null); 1884Debug.Assert(DataSet.EnforceConstraints == false); 1893Debug.Assert(args.NewParent == null); 1957Debug.Assert(!IsRowLive(row)); 1966Debug.Assert(!IsRowLive(be.Row)); 1998Debug.Assert(rowElement != null); 2209Debug.Assert(!(args.Action == CollectionChangeAction.Add || args.Action == CollectionChangeAction.Remove) || rel!.Nested == false); 2257Debug.Assert(child.ParentNode != prevSibling.ParentNode); 2259Debug.Assert(prevSibling.ParentNode != null); 2260Debug.Assert(IsFoliationEnabled == false); 2261Debug.Assert(IgnoreXmlEvents); 2263Debug.Assert(prevSibling != DocumentElement); 2267Debug.Assert(child.ParentNode == null); 2274Debug.Assert(parent != null); 2275Debug.Assert(parent.NodeType != XmlNodeType.Attribute); // We need to get the grand-parent region 2276Debug.Assert(parent != DocumentElement); // We cannot promote children of the DocumentElement 2286Debug.Assert(iter.CurrentNode is XmlBoundElement && ((XmlBoundElement)(iter.CurrentNode)).Row != null); 2296Debug.Assert(parent != null); 2379Debug.Assert(col.ColumnMapping != MappingType.Hidden); 2389Debug.Assert(xmlText != null); 2390Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2396Debug.Assert(oVal != null && !(oVal is DBNull)); 2419Debug.Assert(row != null); 2456Debug.Assert(rowElement != null); 2457Debug.Assert(rowElement.Row != null); 2458Debug.Assert(DataSet.EnforceConstraints == false); 2461Debug.Assert(row != null); 2505Debug.Assert(c.Table == row.Table); 2694Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2698Debug.Assert(subRowElem != null); 2713Debug.Assert(!IsRowLive(be.Row!)); 2723Debug.Assert(rowElemList[0] != null && rowElemList[0] is XmlBoundElement); 2745Debug.Assert(rowElem.Row != null); 2756Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2780Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2801Debug.Assert(IsRowLive(rowElem.Row)); 2807Debug.Assert(rowElem.Row != null); 2818Debug.Assert(row.Table.DataSet!.EnforceConstraints == false); 2852Debug.Assert(!IsRowLive(rowElem.Row)); 2862Debug.Assert(row != null); 2878Debug.Assert(row != null); 2880Debug.Assert(row.RowState == DataRowState.Detached || row.RowState == DataRowState.Deleted); 2889Debug.Assert(childRowElem.Row != null); 2905Debug.Assert(parentRowElem.Row != null); 2945Debug.Assert(node.OwnerDocument == this || node == this); 2963Debug.Assert(be.IsFoliated); 2985Debug.Assert(IsRowLive(rowElement.Row)); 2990Debug.Assert(rowElement!.Row != null); 2991Debug.Assert(IsRowLive(rowElement.Row)); 3008Debug.Assert(!IsRowLive(rowElement.Row)); 3013Debug.Assert(rowElement!.Row != null); 3014Debug.Assert(!IsRowLive(rowElement.Row));
System\Xml\XPathNodePointer.cs (32)
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); 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 (21)
Common\System\Data\Common\DBConnectionString.cs (1)
539Debug.Assert(0 >= StringComparer.Ordinal.Compare(restrictionValues[i - 1], restrictionValues[i]));
Common\System\Data\ProviderBase\DbConnectionPool.cs (3)
488Debug.Assert(_state == State.Running || _state == State.ShuttingDown); 530Debug.Assert(destroyObject == false); 543Debug.Assert(returnToGeneralPool || destroyObject);
src\libraries\Common\src\System\Data\ProviderBase\DbConnectionInternal.cs (1)
221Debug.Assert(Pool != null);
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\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\OdbcDataReader.cs (4)
1023Debug.Assert(cbMissing == -1 && lengthOrIndicator <= cbMaxData); 2308Debug.Assert(_metadata != null); 2472Debug.Assert(_metadata != null); 2891Debug.Assert(quotePrefix != null && quoteSuffix != null);
System\Data\Odbc\OdbcMetaDataFactory.cs (2)
82Debug.Assert(restrictionCollectionName != null); 503Debug.Assert(allRestrictions.Length >= restrictionsCount);
System\Data\Odbc\OdbcParameter.cs (2)
622Debug.Assert(command.Connection != null); 792Debug.Assert(command.Connection != null);
System.Diagnostics.DiagnosticSource (65)
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\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Diagnostics\Activity.cs (9)
392Debug.Assert(activity != null); 1330Debug.Assert(!string.IsNullOrEmpty(Parent.Id)); 1336Debug.Assert(ParentId.Length != 0); 1425Debug.Assert(_traceId is null); 1447Debug.Assert(!W3CIdFlagsSet); 1697Debug.Assert(_last != null); 1786Debug.Assert(_last != null); 2011Debug.Assert(outBytes.Length == 16 || outBytes.Length == 8); 2028Debug.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 (3)
375Debug.Assert(activity != null); 387Debug.Assert(activity != null); 399Debug.Assert(activity != null);
System\Diagnostics\DiagLinkedList.cs (3)
28Debug.Assert(e is not null); 56Debug.Assert(_first is not null); 57Debug.Assert(_last is not null);
System\Diagnostics\DiagnosticListener.cs (1)
360Debug.Assert(Monitor.IsEntered(s_allListenersLock)); // We should only be called when we hold this lock
System\Diagnostics\DiagnosticSourceEventSource.cs (1)
415Debug.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); 100Debug.Assert(_wildcardSpec != null || _specsBySourceNameAndActivityName != null); 120Debug.Assert(_activityListener == null); 121Debug.Assert(_wildcardSpec != null 221Debug.Assert(activitySourceName != null);
System\Diagnostics\DsesFilterAndTransform.cs (11)
111Debug.Assert(filterAndPayloadSpec != null && startIdx >= 0 && startIdx <= endIdx && endIdx <= filterAndPayloadSpec.Length); 206Debug.Assert(endIdx - startIdx >= 4); 207Debug.Assert(IsActivitySourceEntry(filterAndPayloadSpec, startIdx, endIdx)); 587Debug.Assert(transformSpec != null && startIdx >= 0 && startIdx < endIdx && endIdx <= transformSpec.Length); 680Debug.Assert(obj != null || IsStatic); 820Debug.Assert(typeof(TObject).GetTypeInfo().IsAssignableFrom(type.GetTypeInfo())); 825Debug.Assert(obj is TObject); 839Debug.Assert(typeof(TStruct) == type); 844Debug.Assert(obj is TStruct); 878Debug.Assert(enumerable is not null); 941Debug.Assert(obj is IEnumerable<ElementType>);
System\Diagnostics\Metrics\AggregationManager.cs (5)
121Debug.Assert(collectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 132Debug.Assert(cookie is not null); 160Debug.Assert(_collectThread == null && !_cts.IsCancellationRequested); 161Debug.Assert(CollectionPeriod.TotalSeconds >= MinCollectionTimeSecs); 199Debug.Assert(collectionIntervalSecs >= MinCollectionTimeSecs);
System\Diagnostics\Metrics\AggregatorStore.cs (1)
88Debug.Assert(match);
System\Diagnostics\Metrics\ExponentialHistogramAggregator.cs (1)
128Debug.Assert(count == 0);
System\Diagnostics\Metrics\Instrument.cs (1)
191Debug.Assert(false);
System\Diagnostics\Metrics\Meter.cs (5)
40Debug.Assert(options.Name is not null); 44Debug.Assert(Name is not null); 75Debug.Assert(Name is not null); 526Debug.Assert(instrumentList is not null); 553Debug.Assert(instrumentList is not null);
System\Diagnostics\Metrics\MeterOptions.cs (1)
55Debug.Assert(_name is not null);
System\Diagnostics\Metrics\MetricsEventSource.cs (1)
449Debug.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.Process (47)
Microsoft\Win32\SafeHandles\SafeProcessHandle.Unix.cs (1)
44Debug.Assert(_handle != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.ParseMapModules.cs (1)
36Debug.Assert(lines != null);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (2)
126Debug.Assert(valueParsed); 141Debug.Assert(!string.IsNullOrEmpty(path));
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ForkAndExecProcess.cs (1)
71Debug.Assert(bytesWritten == byteLength);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetSetPriority.cs (1)
40Debug.Assert((nice >= -20) && (nice <= 20));
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\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Diagnostics\Process.ConfigureTerminalForChildProcesses.Unix.cs (4)
15Debug.Assert(increment != 0); 20Debug.Assert(s_processStartLock.IsReadLockHeld); 21Debug.Assert(configureConsole); 28Debug.Assert(s_processStartLock.IsWriteLockHeld);
System\Diagnostics\Process.Linux.cs (1)
296Debug.Assert(bytesRead < buffer.Length);
System\Diagnostics\Process.Unix.cs (10)
178Debug.Assert(_waitHandle == null); 179Debug.Assert(_registeredWaitHandle == null); 206Debug.Assert(exited || milliseconds != Timeout.Infinite); 272Debug.Assert(pri >= -20 && pri <= 20); 468Debug.Assert(stdinFd >= 0); 475Debug.Assert(stdoutFd >= 0); 481Debug.Assert(stderrFd >= 0); 532Debug.Assert(childPid >= 0); 848Debug.Assert(fd >= 0); 969Debug.Assert(!string.IsNullOrEmpty(startInfo.UserName));
System\Diagnostics\ProcessManager.Linux.cs (2)
166Debug.Assert(pid >= 0); 283Debug.Assert(procSelfPid.HasValue);
System\Diagnostics\ProcessWaitState.Unix.cs (11)
168Debug.Assert(foundState); 228Debug.Assert(processId >= 0); 238Debug.Assert(!Monitor.IsEntered(_gate)); 253Debug.Assert(Monitor.IsEntered(_gate)); 266Debug.Assert(!Monitor.IsEntered(_gate)); 299Debug.Assert(_exited); 348Debug.Assert(Monitor.IsEntered(_gate)); 397Debug.Assert(!Monitor.IsEntered(_gate)); 506Debug.Assert(Monitor.IsEntered(_gate)); 507Debug.Assert(!_isChild); 546Debug.Assert(!_exited);
System.Diagnostics.StackTrace (1)
System\Diagnostics\StackTraceSymbols.cs (1)
145Debug.Assert(inMemoryPdbAddress != IntPtr.Zero);
System.Diagnostics.TextWriterTraceListener (3)
System\Diagnostics\XmlWriterTraceListener.cs (3)
399Debug.Assert(charsWritten > 0); 411Debug.Assert(charsWritten == span.Length); 423Debug.Assert(charsWritten > 0);
System.Diagnostics.TraceSource (2)
System\Diagnostics\CorrelationManager.cs (1)
57Debug.Assert(stack != null);
System\Diagnostics\TraceSource.cs (1)
105Debug.Assert(_listeners != null);
System.Drawing.Primitives (8)
src\libraries\Common\src\System\Drawing\ColorConverterCommon.cs (2)
14Debug.Assert(culture != null); 105Debug.Assert(culture != null);
System\Drawing\Color.cs (1)
395Debug.Assert(name != null);
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); 541Debug.Assert(Color.IsKnownColorSystem(color));
System.Formats.Asn1 (80)
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 (3)
216Debug.Assert(minCharAllowed <= maxCharAllowed); 217Debug.Assert(maxCharAllowed <= 0x7F); 237Debug.Assert(isAllowed[c] == false);
System\Formats\Asn1\AsnDecoder.BitString.cs (4)
367Debug.Assert(unusedBitCount == 0); 492Debug.Assert(length != null); 626Debug.Assert(bytesWritten == contentLength); 663Debug.Assert(contentsLength.HasValue);
System\Formats\Asn1\AsnDecoder.cs (5)
440Debug.Assert(bytesRead > 0); 533Debug.Assert(validity != LengthValidity.Valid); 647Debug.Assert(offset >= 0); 659Debug.Assert(offset >= 0); 695Debug.Assert(ruleSet >= AsnEncodingRules.BER && ruleSet <= AsnEncodingRules.DER);
System\Formats\Asn1\AsnDecoder.GeneralizedTime.cs (4)
192Debug.Assert(!contents.IsEmpty); 194Debug.Assert(state == GetNextState(octet)); 267Debug.Assert(!contents.IsEmpty); 269Debug.Assert(state == GetNextState(octet));
System\Formats\Asn1\AsnDecoder.Integer.cs (2)
434Debug.Assert(sizeLimit <= sizeof(long)); 473Debug.Assert(sizeLimit <= sizeof(ulong));
System\Formats\Asn1\AsnDecoder.NamedBitList.cs (1)
368Debug.Assert(valueSpan.Length <= sizeof(long));
System\Formats\Asn1\AsnDecoder.OctetString.cs (4)
212Debug.Assert(contentLength.HasValue); 355Debug.Assert(length != null); 472Debug.Assert(bytesWritten == contentLength); 485Debug.Assert(rented == null);
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 (2)
177Debug.Assert( 193Debug.Assert(contents.IsEmpty);
System\Formats\Asn1\AsnWriter.BitString.cs (3)
111Debug.Assert(contentLength > MaxCERContentSize); 119Debug.Assert( 147Debug.Assert(payload.Length > MaxCERContentSize);
System\Formats\Asn1\AsnWriter.Boolean.cs (2)
31Debug.Assert(!tag.IsConstructed); 35Debug.Assert(_offset < _buffer.Length);
System\Formats\Asn1\AsnWriter.cs (15)
93Debug.Assert(_buffer != null); 181Debug.Assert(bytesWritten == _offset); 418Debug.Assert(length >= -1); 430Debug.Assert(length >= 0); 461Debug.Assert(idx == _offset); 602Debug.Assert(tagType == UniversalTagNumber.SetOf); 622Debug.Assert(containedLength >= 0); 662Debug.Assert(_offset == expectedEnd); 685Debug.Assert(_offset - lenOffset - 1 == shiftSize); 691Debug.Assert(buffer != null); 692Debug.Assert(end >= start); 729Debug.Assert(pos == end); 744Debug.Assert(pos == len); 847Debug.Assert(writer._nestingStack != null); 862Debug.Assert(_writer == null || _writer._nestingStack != null);
System\Formats\Asn1\AsnWriter.GeneralizedTime.cs (3)
93Debug.Assert(fraction[0] == (byte)'0'); 94Debug.Assert(fraction[1] == (byte)'.'); 110Debug.Assert(!tag.IsConstructed);
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 (2)
106Debug.Assert(payload.Length > MaxCERSegmentSize); 117Debug.Assert(
System\Formats\Asn1\AsnWriter.Oid.cs (2)
138Debug.Assert(!tag.IsConstructed); 193Debug.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 (1)
118Debug.Assert(size > AsnReader.MaxCERSegmentSize);
System\Formats\Asn1\AsnWriter.UtcTime.cs (1)
80Debug.Assert(!tag.IsConstructed);
System.Formats.Cbor (31)
System\Formats\Cbor\CborConformanceLevel.cs (1)
234Debug.Assert(!left.IsEmpty && !right.IsEmpty);
System\Formats\Cbor\Reader\CborReader.cs (6)
207Debug.Assert(_nestedDataItems?.Count > 0); 235Debug.Assert(_definiteLength is null || _definiteLength - _itemsRead > 0); 257Debug.Assert(_offset + length <= _data.Length); 266Debug.Assert(position <= _data.Length); 387Debug.Assert(_nestedDataItems != null); 420Debug.Assert(CurrentDepth == checkpoint.Depth);
System\Formats\Cbor\Reader\CborReader.Map.cs (4)
104Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 == 0); 125Debug.Assert(_currentKeyOffset != null && _itemsRead % 2 != 0); 132Debug.Assert(_currentKeyOffset != null); 160Debug.Assert(_currentKeyOffset != null);
System\Formats\Cbor\Reader\CborReader.PeekState.cs (2)
32Debug.Assert(!AllowMultipleRootLevelValues); 74Debug.Assert(AllowMultipleRootLevelValues);
System\Formats\Cbor\Reader\CborReader.SkipValue.cs (1)
43Debug.Assert(0 <= depth && depth <= CurrentDepth);
System\Formats\Cbor\Reader\CborReader.String.cs (3)
344Debug.Assert(target.IsEmpty); 407Debug.Assert(target.IsEmpty); 485Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString);
System\Formats\Cbor\Writer\CborWriter.Array.cs (1)
72Debug.Assert(majorType == CborMajorType.Array || majorType == CborMajorType.Map);
System\Formats\Cbor\Writer\CborWriter.cs (4)
245Debug.Assert(MaxArrayLength == Array.MaxLength); 303Debug.Assert(_nestedDataItems?.Count > 0); // implied by previous check 390Debug.Assert(_definiteLength == null); 405Debug.Assert(_itemsWritten % 2 == 0);
System\Formats\Cbor\Writer\CborWriter.Map.cs (4)
95Debug.Assert(_currentKeyOffset != null && _currentValueOffset == null); 119Debug.Assert(_currentKeyOffset != null && _currentValueOffset != null); 152Debug.Assert(_keyValuePairEncodingRanges != null); 171Debug.Assert(s.IsEmpty);
System\Formats\Cbor\Writer\CborWriter.String.cs (5)
52Debug.Assert(_currentIndefiniteLengthStringRanges != null); 149Debug.Assert(_currentIndefiniteLengthStringRanges != null); 200Debug.Assert(type == CborMajorType.ByteString || type == CborMajorType.TextString); 201Debug.Assert(_currentIndefiniteLengthStringRanges != null); 224Debug.Assert(s.IsEmpty);
System.Formats.Nrbf (7)
System\Formats\Nrbf\ArrayInfo.cs (1)
43Debug.Assert(FlattenedLength <= MaxArrayLength);
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\RectangularArrayRecord.cs (1)
33Debug.Assert(elementType == typeof(string) || elementType == typeof(SerializationRecord));
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 (118)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Formats\Tar\PaxTarEntry.cs (3)
57Debug.Assert(_header._mTime != default); 99Debug.Assert(_header._mTime != default); 161Debug.Assert(!useMTime || (useMTime && _header._mTime != default));
System\Formats\Tar\PosixTarEntry.cs (2)
37Debug.Assert(other._header._uName != null); 38Debug.Assert(other._header._gName != null);
System\Formats\Tar\SeekableSubReadStream.cs (2)
57Debug.Assert(count >= 0); 58Debug.Assert(count <= origCount);
System\Formats\Tar\SubReadStream.cs (3)
119Debug.Assert(count >= 0); 120Debug.Assert(count <= origCount); 157Debug.Assert(!_hasReachedEnd);
System\Formats\Tar\TarEntry.cs (11)
31Debug.Assert(header._format == format); 41Debug.Assert(!isGea || entryType is TarEntryType.GlobalExtendedAttributes); 347Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 348Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 442Debug.Assert(EntryType is not (TarEntryType.RegularFile or TarEntryType.V7RegularFile or TarEntryType.ContiguousFile)); 450Debug.Assert(Directory.Exists(Path.GetDirectoryName(filePath))); 451Debug.Assert(!Directory.Exists(filePath)); 464Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 470Debug.Assert(!string.IsNullOrEmpty(linkTargetPath)); 535Debug.Assert(!Path.Exists(destinationFileName)); 551Debug.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)
358Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 359Debug.Assert(!string.IsNullOrEmpty(destinationFileName)); 477Debug.Assert(!string.IsNullOrEmpty(sourceFileName)); 478Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryFullPath)); 523Debug.Assert(!string.IsNullOrEmpty(sourceDirectoryName)); 524Debug.Assert(destination != null); 525Debug.Assert(Path.IsPathFullyQualified(sourceDirectoryName)); 526Debug.Assert(destination.CanWrite); 532Debug.Assert(source != null); 533Debug.Assert(!string.IsNullOrEmpty(destinationDirectoryPath)); 534Debug.Assert(Path.IsPathFullyQualified(destinationDirectoryPath)); 535Debug.Assert(source.CanRead);
System\Formats\Tar\TarHeader.cs (2)
117Debug.Assert(_ea == null); 118Debug.Assert(existing != null);
System\Formats\Tar\TarHeader.Read.cs (1)
78Debug.Assert(header._format is TarEntryFormat.Ustar or TarEntryFormat.Pax or TarEntryFormat.Gnu);
System\Formats\Tar\TarHeader.Write.cs (43)
35Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 36Debug.Assert(_dataStream == null || _dataStream.CanSeek); 51Debug.Assert(format is > TarEntryFormat.Unknown and <= TarEntryFormat.Gnu); 52Debug.Assert(_dataStream == null || _dataStream.CanSeek); 68Debug.Assert(destinationStream.CanSeek); 69Debug.Assert(_dataStream != null); 70Debug.Assert(!_dataStream.CanSeek); 120Debug.Assert(destinationStream.CanSeek); 121Debug.Assert(_dataStream != null); 122Debug.Assert(!_dataStream.CanSeek); 213Debug.Assert(_typeFlag is TarEntryType.GlobalExtendedAttributes); 214Debug.Assert(globalExtendedAttributesEntryNumber >= 0); 219Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 233Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 246Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 260Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 275Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 276Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 318Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 319Debug.Assert(_typeFlag is not TarEntryType.GlobalExtendedAttributes); 362Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 368Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 377Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 397Debug.Assert(archiveStream.CanSeek || _dataStream == null || _dataStream.CanSeek); 404Debug.Assert(longLinkHeader._dataStream != null && longLinkHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 413Debug.Assert(longPathHeader._dataStream != null && longPathHeader._dataStream.CanSeek); // We generate the long metadata data stream, should always be seekable 432Debug.Assert(entryType is TarEntryType.LongPath or TarEntryType.LongLink); 462Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 471Debug.Assert(_dataStream == null || (extendedAttributes.Count > 0 && _dataStream.CanSeek)); // We generate the extended attributes data stream, should always be seekable 478Debug.Assert(isGea && globalExtendedAttributesEntryNumber >= 0 || !isGea && globalExtendedAttributesEntryNumber < 0); 596Debug.Assert(prefix.Length != 1 || !PathInternal.Utf8DirectorySeparators.Contains(prefix[0])); 613Debug.Assert(!string.IsNullOrEmpty(_linkName) ^ (_typeFlag is not TarEntryType.SymbolicLink and not TarEntryType.HardLink)); 672Debug.Assert(_dataStream.CanSeek); 780Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 796Debug.Assert(paddingAfterData <= TarHelpers.RecordSize); 857Debug.Assert(length == CountDigits(length) + 3 + Encoding.UTF8.GetByteCount(attribute) + Encoding.UTF8.GetByteCount(value)); 871Debug.Assert(formatted); 894Debug.Assert(value >= 0); 918Debug.Assert(_typeFlag is TarEntryType.SymbolicLink or TarEntryType.HardLink); 1023Debug.Assert(destination.Length > 1); 1037Debug.Assert(destination.Length > 1); 1173Debug.Assert(globalExtendedAttributesEntryNumber >= 1); 1189Debug.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 (18)
123Debug.Assert(_archiveStream.CanRead); 188Debug.Assert(_archiveStream.CanRead); 209Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 251Debug.Assert(_previouslyReadEntry._header._endOfHeaderAndDataAndBlockAlignment > 0); 319Debug.Assert(!_reachedEndMarkers); 361Debug.Assert(!_reachedEndMarkers); 504Debug.Assert(header._linkName != null); 505Debug.Assert(secondHeader._name != null); 512Debug.Assert(header._name != null); 513Debug.Assert(secondHeader._linkName != null); 525Debug.Assert(header._linkName != null); 530Debug.Assert(header._name != null); 580Debug.Assert(header._linkName != null); 581Debug.Assert(secondHeader._name != null); 588Debug.Assert(header._name != null); 589Debug.Assert(secondHeader._linkName != null); 601Debug.Assert(header._linkName != null); 606Debug.Assert(header._name != null);
System\Formats\Tar\TarWriter.Unix.cs (2)
21Debug.Assert(!string.IsNullOrEmpty(fullPath)); 99Debug.Assert(entry._header._dataStream == null);
System.IO.Compression (99)
System\IO\Compression\Crc32Helper.ZLib.cs (1)
14Debug.Assert((buffer != null) && (offset >= 0) && (length >= 0) && (offset <= buffer.Length - length));
System\IO\Compression\DeflateManaged\DeflateManagedStream.cs (1)
30Debug.Assert(method == ZipArchiveEntry.CompressionMethodValues.Deflate64);
System\IO\Compression\DeflateManaged\InflaterManaged.cs (3)
351Debug.Assert(_literalLengthTree != null); 425Debug.Assert(_distanceTree != null); 570Debug.Assert(_codeLengthTree != null);
System\IO\Compression\DeflateManaged\InputBuffer.cs (10)
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);
System\IO\Compression\DeflateZLib\Deflater.cs (5)
33Debug.Assert(windowBits >= minWindowBits && windowBits <= maxWindowBits); 92Debug.Assert(!inputBuffer.IsEmpty); 106Debug.Assert(inputBufferPtr != null); 107Debug.Assert(count > 0); 139Debug.Assert(outputBuffer?.Length > 0);
System\IO\Compression\DeflateZLib\DeflateStream.cs (26)
113Debug.Assert(stream != null); 143Debug.Assert(_buffer == null); 221Debug.Assert(_deflater != null && _buffer != null); 236Debug.Assert(flushSuccessful == (compressedBytes > 0)); 267Debug.Assert(_inflater != null); 297Debug.Assert(_inflater != null); 346Debug.Assert(bytesRead == 0); 435Debug.Assert(_inflater != null); 551Debug.Assert(_deflater != null); 568Debug.Assert(_deflater != null && _buffer != null); 587Debug.Assert(_deflater != null && _buffer != null); 598Debug.Assert(flushSuccessful == (compressedBytes > 0)); 618Debug.Assert(_deflater != null && _buffer != null); 665Debug.Assert(_deflater != null && _buffer != null); 849Debug.Assert(_deflater != null); 868Debug.Assert(_deflater != null && _buffer != null); 921Debug.Assert(deflateStream != null); 922Debug.Assert(destination != null); 923Debug.Assert(bufferSize > 0); 936Debug.Assert(_deflateStream._inflater != null); 972Debug.Assert(_deflateStream._inflater != null); 1004Debug.Assert(buffer != _arrayPoolBuffer); 1029Debug.Assert(_deflateStream._inflater is not null); 1052Debug.Assert(buffer != _arrayPoolBuffer); 1066Debug.Assert(_deflateStream._inflater != null); 1115Debug.Assert(_activeAsyncOperation);
System\IO\Compression\DeflateZLib\Inflater.cs (10)
36Debug.Assert(windowBits >= MinWindowBits && windowBits <= MaxWindowBits); 57Debug.Assert(bytesRead == 0 || bytesRead == 1); 146Debug.Assert(!NeedsInput()); 147Debug.Assert(IsGzipStream()); 148Debug.Assert(IsInputBufferHandleAllocated); 186Debug.Assert(inputBuffer != null); 187Debug.Assert(startIndex >= 0 && count >= 0 && count + startIndex <= inputBuffer.Length); 188Debug.Assert(!IsInputBufferHandleAllocated); 196Debug.Assert(!IsInputBufferHandleAllocated); 330Debug.Assert(IsInputBufferHandleAllocated);
System\IO\Compression\ZipArchive.cs (7)
187Debug.Assert(mode == ZipArchiveMode.Update); 313Debug.Assert(_mode == ZipArchiveMode.Update || _mode == ZipArchiveMode.Create); 441internal void DebugAssertIsStillArchiveStreamOwner(ZipArchiveEntry entry) => Debug.Assert(_archiveStreamOwner == entry); 445Debug.Assert(_archiveStreamOwner == entry); 610Debug.Assert(eocdProper); // we just found this using the signature finder, so it should be okay 667Debug.Assert(zip64eocdLocatorProper); // we just found this using the signature finder, so it should be okay 703Debug.Assert(_readEntries);
System\IO\Compression\ZipArchiveEntry.cs (19)
355Debug.Assert(_archive.Mode == ZipArchiveMode.Update); 371Debug.Assert(entryStringBytes != null); 490Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 491Debug.Assert(_fileComment.Length <= ushort.MaxValue); 623Debug.Assert(IsOpenable(false, true, out _)); 675Debug.Assert(CompressionMethod == CompressionMethodValues.Deflate 726Debug.Assert(CompressionMethod == CompressionMethodValues.Stored); 908Debug.Assert(_storedEntryNameBytes.Length <= ushort.MaxValue); 924Debug.Assert(_compressedSize == 0); 925Debug.Assert(_uncompressedSize == 0); 926Debug.Assert(_crc32 == 0); 939Debug.Assert(_crc32 == 0); 1064Debug.Assert(_compressedBytes != null); 1198Debug.Assert((_generalPurposeBitFlag & BitFlagValues.DataDescriptor) != 0); 1362Debug.Assert(CanWrite); 1382Debug.Assert(CanWrite); 1411Debug.Assert(CanWrite); 1434Debug.Assert(CanWrite); 1442Debug.Assert(CanWrite);
System\IO\Compression\ZipBlocks.cs (2)
634Debug.Assert(buffer.Length >= BlockConstantSectionSize); 795Debug.Assert(archiveComment.Length <= ZipFileCommentMaxLength);
System\IO\Compression\ZipCustomStreams.cs (8)
297Debug.Assert(count >= 0); 298Debug.Assert(count <= origCount); 320Debug.Assert(count >= 0); 321Debug.Assert(count <= origCount); 508Debug.Assert(CanWrite); 528Debug.Assert(CanWrite); 556Debug.Assert(CanWrite); 582Debug.Assert(CanWrite);
System\IO\Compression\ZipHelper.cs (7)
91Debug.Assert(ValidZipDate_YearMin <= dateTime.Year && dateTime.Year <= ValidZipDate_YearMax); 108Debug.Assert(signatureToFind.Length != 0); 109Debug.Assert(maxBytesToRead > 0); 140Debug.Assert(bufferPointer < bufferSpan.Length); 179Debug.Assert(overlap <= buffer.Length); 230Debug.Assert(totalCodePoints > 0); 231Debug.Assert(totalCodePoints <= bytes.Length);
System.IO.Compression.Brotli (13)
System\IO\Compression\BrotliStream.cs (1)
193Debug.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 (2)
215Debug.Assert(lastResult == OperationStatus.DestinationTooSmall); 218Debug.Assert(bytesWritten == 0);
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 (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\System\IO\Archiving.Utils.cs (2)
14Debug.Assert(buffer != null); 15Debug.Assert(min > 0);
System\IO\Compression\ZipFileExtensions.ZipArchive.Create.Unix.cs (2)
14Debug.Assert(!OperatingSystem.IsWindows()); 19Debug.Assert((uint)entry.ExternalAttributes == DefaultFileExternalAttributes);
System.IO.FileSystem.DriveInfo (1)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
System.IO.FileSystem.Watcher (25)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\IO\FileSystemWatcher.Linux.cs (17)
278Debug.Assert(watcher != null); 279Debug.Assert(inotifyHandle != null && !inotifyHandle.IsInvalid && !inotifyHandle.IsClosed); 280Debug.Assert(directoryPath != null); 286Debug.Assert(_buffer != null && _buffer.Length > (c_INotifyEventSize + NAME_MAX + 1)); 478Debug.Assert(_includeSubdirectories); 516Debug.Assert(result >= 0); 533Debug.Assert(result >= 0); // ignore errors; they're non-fatal, but they also shouldn't happen 788Debug.Assert(_buffer != null); 789Debug.Assert(_buffer.Length > 0); 790Debug.Assert(_bufferAvailable >= 0 && _bufferAvailable <= _buffer.Length); 791Debug.Assert(_bufferPos >= 0 && _bufferPos <= _bufferAvailable); 805Debug.Assert(_bufferAvailable <= this._buffer.Length); 813Debug.Assert(_bufferAvailable >= 0); 820Debug.Assert(_bufferAvailable >= c_INotifyEventSize); 832Debug.Assert(_bufferPos + c_INotifyEventSize <= _bufferAvailable); 855Debug.Assert(position > 0); 856Debug.Assert(nameLength >= 0 && (position + nameLength) <= _buffer.Length);
System.IO.Hashing (63)
System\IO\Hashing\Crc32.Vectorized.cs (1)
86Debug.Assert(length >= 16);
System\IO\Hashing\Crc64.Vectorized.cs (1)
119Debug.Assert(length >= 16);
System\IO\Hashing\NonCryptographicHashAlgorithm.cs (1)
293Debug.Assert(destination.Length == HashLengthInBytes);
System\IO\Hashing\XxHash128.cs (6)
252Debug.Assert(length >= 1 && length <= 3); 277Debug.Assert(length >= 4 && length <= 8); 303Debug.Assert(length >= 9 && length <= 16); 329Debug.Assert(length >= 17 && length <= 128); 355Debug.Assert(length >= 129 && length <= 240); 388Debug.Assert(length > 240);
System\IO\Hashing\XxHash3.cs (7)
223Debug.Assert(length >= 1 && length <= 3); 241Debug.Assert(length >= 4 && length <= 8); 258Debug.Assert(length >= 9 && length <= 16); 277Debug.Assert(length >= 17 && length <= 128); 306Debug.Assert(length >= 129 && length <= 240); 324Debug.Assert((length - 16 * 8) / 16 == 7); 355Debug.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)
117Debug.Assert(new Span<byte>(secret, SecretLengthBytes).SequenceEqual(DefaultSecret)); 120Debug.Assert(InternalBufferLengthBytes % StripeLengthBytes == 0); 123Debug.Assert(ReadLE64(defaultSecretUInt64[0]) == DefaultSecretUInt64_0); 124Debug.Assert(ReadLE64(defaultSecretUInt64[1]) == DefaultSecretUInt64_1); 125Debug.Assert(ReadLE64(defaultSecretUInt64[2]) == DefaultSecretUInt64_2); 126Debug.Assert(ReadLE64(defaultSecretUInt64[3]) == DefaultSecretUInt64_3); 127Debug.Assert(ReadLE64(defaultSecretUInt64[4]) == DefaultSecretUInt64_4); 128Debug.Assert(ReadLE64(defaultSecretUInt64[5]) == DefaultSecretUInt64_5); 129Debug.Assert(ReadLE64(defaultSecretUInt64[6]) == DefaultSecretUInt64_6); 130Debug.Assert(ReadLE64(defaultSecretUInt64[7]) == DefaultSecretUInt64_7); 131Debug.Assert(ReadLE64(defaultSecretUInt64[8]) == DefaultSecretUInt64_8); 132Debug.Assert(ReadLE64(defaultSecretUInt64[9]) == DefaultSecretUInt64_9); 133Debug.Assert(ReadLE64(defaultSecretUInt64[10]) == DefaultSecretUInt64_10); 134Debug.Assert(ReadLE64(defaultSecretUInt64[11]) == DefaultSecretUInt64_11); 135Debug.Assert(ReadLE64(defaultSecretUInt64[12]) == DefaultSecretUInt64_12); 136Debug.Assert(ReadLE64(defaultSecretUInt64[13]) == DefaultSecretUInt64_13); 137Debug.Assert(ReadLE64(defaultSecretUInt64[14]) == DefaultSecretUInt64_14); 138Debug.Assert(ReadLE64(defaultSecretUInt64[15]) == DefaultSecretUInt64_15); 141Debug.Assert(ReadLE64(defaultSecret3UInt64[0]) == DefaultSecret3UInt64_0); 142Debug.Assert(ReadLE64(defaultSecret3UInt64[1]) == DefaultSecret3UInt64_1); 143Debug.Assert(ReadLE64(defaultSecret3UInt64[2]) == DefaultSecret3UInt64_2); 144Debug.Assert(ReadLE64(defaultSecret3UInt64[3]) == DefaultSecret3UInt64_3); 145Debug.Assert(ReadLE64(defaultSecret3UInt64[4]) == DefaultSecret3UInt64_4); 146Debug.Assert(ReadLE64(defaultSecret3UInt64[5]) == DefaultSecret3UInt64_5); 147Debug.Assert(ReadLE64(defaultSecret3UInt64[6]) == DefaultSecret3UInt64_6); 148Debug.Assert(ReadLE64(defaultSecret3UInt64[7]) == DefaultSecret3UInt64_7); 149Debug.Assert(ReadLE64(defaultSecret3UInt64[8]) == DefaultSecret3UInt64_8); 150Debug.Assert(ReadLE64(defaultSecret3UInt64[9]) == DefaultSecret3UInt64_9); 151Debug.Assert(ReadLE64(defaultSecret3UInt64[10]) == DefaultSecret3UInt64_10); 152Debug.Assert(ReadLE64(defaultSecret3UInt64[11]) == DefaultSecret3UInt64_11); 153Debug.Assert(ReadLE64(defaultSecret3UInt64[12]) == DefaultSecret3UInt64_12); 154Debug.Assert(ReadLE64(defaultSecret3UInt64[13]) == DefaultSecret3UInt64_13); 204Debug.Assert(length > 240); 220Debug.Assert(stripes <= stripesPerBlock); // can handle max 1 scramble per invocation 221Debug.Assert(stripesSoFar < stripesPerBlock); 242Debug.Assert(state.BufferedCount <= InternalBufferLengthBytes); 272Debug.Assert(sourceIndex < source.Length); 278Debug.Assert(NumStripesPerBlock >= state.StripesProcessedInCurrentBlock); 282Debug.Assert(stripesToEnd <= stripes); 301Debug.Assert(sourceIndex < source.Length); // at least some bytes left 323Debug.Assert(sourceIndex < source.Length); 324Debug.Assert(remaining.Length <= InternalBufferLengthBytes); 325Debug.Assert(state.BufferedCount == 0); 362Debug.Assert(state.BufferedCount > 0); 778Debug.Assert(shift >= 0 && shift < 64);
System.IO.IsolatedStorage (2)
System\IO\IsolatedStorage\IsolatedStorageFile.cs (2)
609Debug.Assert(parentDirectory != null); 628Debug.Assert(parentDirectory != null);
System.IO.MemoryMappedFiles (19)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
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 (2)
266Debug.Assert(charsWritten == 32); 269Debug.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.Packaging (31)
System\IO\Packaging\ContentType.cs (2)
219Debug.Assert(!string.IsNullOrEmpty(_type) || !string.IsNullOrEmpty(_subType)); 257Debug.Assert(!IsLinearWhiteSpaceChar(contentType[0]) && !IsLinearWhiteSpaceChar(contentType[contentType.Length - 1]));
System\IO\Packaging\InterleavedZipPackagePartStream.cs (5)
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); 480Debug.Assert(CanSeek);
System\IO\Packaging\InterleavedZipPackagePartStream.PieceDirectory.cs (5)
78Debug.Assert(stream != null); 79Debug.Assert(pieceStart >= 0); 113Debug.Assert(sortedPieceInfoList.Count > 0); 257Debug.Assert(pieceNumber <= _lastPieceIndex); 446Debug.Assert(_pieceStreamInfoList.Count == 0);
System\IO\Packaging\InternalRelationshipCollection.cs (1)
558Debug.Assert(targetMode == TargetMode.Internal);
System\IO\Packaging\PackagePart.cs (1)
337Debug.Assert(!IsStreamClosed(s));
System\IO\Packaging\PackagingUtilities.cs (1)
31Debug.Assert(reader != null && reader.ReadState == ReadState.Initial);
System\IO\Packaging\PackUriHelper.cs (5)
374Debug.Assert(partUriString != null && partUriString.Length == 0); 379Debug.Assert(!string.IsNullOrEmpty(partUriString)); 765Debug.Assert(!string.IsNullOrEmpty(partUriString)); 813Debug.Assert(segments.Length > 0 && segments[0].Length == 0); 816Debug.Assert(Path.GetExtension(segments[segments.Length - 1]) == RelationshipPartUpperCaseExtension);
System\IO\Packaging\PartBasedPackageProperties.cs (7)
324Debug.Assert(_xmlWriter == null); 376Debug.Assert(!initializing || reader != null); 418Debug.Assert(_propertyPart == null); // This gets called exclusively from constructor. 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 (2)
429Debug.Assert(opcName != null && opcName.Length > 0); 540Debug.Assert(sortedPieceInfoList != null);
System.IO.Pipelines (31)
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 (10)
232Debug.Assert(segment.MemoryOwner is null); 233Debug.Assert(sizeHint >= 0); 301Debug.Assert(_writingHead != null); 416Debug.Assert(_writerAwaitable.IsCompleted || _readerAwaitable.IsCompleted); 504Debug.Assert(examinedBytes > 0); 802Debug.Assert(completionCallbacks != null); 836Debug.Assert(completionData.SynchronizationContext != null || completionData.ExecutionContext != null); 868Debug.Assert(completionData.ExecutionContext != null); 971Debug.Assert(_readTail != null); 1099Debug.Assert(_writingHead != null);
System\IO\Pipelines\PipeAwaitable.cs (3)
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 (4)
112Debug.Assert(_bufferedBytes >= 0); 273Debug.Assert(length + reader._readTail.End <= reader._readTail.AvailableMemory.Length); 495Debug.Assert(_readTail == null); 501Debug.Assert(_readTail != null);
System\IO\Pipelines\StreamPipeWriter.cs (4)
132Debug.Assert(_tail != null); 154Debug.Assert(sizeHint >= 0); 304Debug.Assert(_tail != null); 381Debug.Assert(_tail != null);
System.IO.Pipes (12)
Microsoft\Win32\SafeHandles\SafePipeHandle.Unix.cs (2)
52Debug.Assert(!IsInvalid); 110Debug.Assert(socket != null);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
System\IO\Pipes\NamedPipeServerStream.Unix.cs (5)
253Debug.Assert(!string.IsNullOrEmpty(path)); 254Debug.Assert(maxCount >= 1); 283Debug.Assert(server._currentCount >= 0 && server._currentCount < server._maxCount); 293Debug.Assert(_currentCount >= 1 && _currentCount <= _maxCount); 298Debug.Assert(removed);
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 (5)
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
System\IO\Ports\SafeSerialDeviceHandle.Unix.cs (1)
21Debug.Assert(portName != null);
System\IO\Ports\SerialStream.Unix.cs (3)
682Debug.Assert(_handle != null); 854Debug.Assert(ret >= 0); 1132Debug.Assert(Buffer.Length == 0);
System.Linq (196)
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); 185Debug.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 (6)
173Debug.Assert(!_hasOnlyCollections || collection is not null); 183Debug.Assert(node._tail is Concat2Iterator<TSource>); 193Debug.Assert(!_hasOnlyCollections); 225Debug.Assert(_hasOnlyCollections); 228Debug.Assert(count >= 0); 342Debug.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 (12)
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);
System\Linq\Lookup.cs (9)
84Debug.Assert(source is not null); 85Debug.Assert(keySelector is not null); 86Debug.Assert(elementSelector is not null); 99Debug.Assert(source is not null); 100Debug.Assert(keySelector is not null); 147Debug.Assert(g is not null); 166Debug.Assert(g is not null); 188Debug.Assert(g is not null); 279Debug.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 (2)
464Debug.Assert(_buffer is not null); 465Debug.Assert(_map is not null);
System\Linq\PartialArrayEnumerator.cs (1)
19Debug.Assert(array is not null);
System\Linq\Range.cs (2)
41Debug.Assert(count > 0); 55Debug.Assert(_start != _end);
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)
52Debug.Assert(source is not null); 66Debug.Assert(_state == -1 || _state == 0); 88Debug.Assert(_buffer is not null);
System\Linq\SegmentedArrayBuilder.cs (1)
62Debug.Assert(segmentsCount > 0);
System\Linq\Select.cs (11)
101Debug.Assert(source is not null); 102Debug.Assert(selector is not null); 130Debug.Assert(_enumerator is not null); 161Debug.Assert(source is not null); 162Debug.Assert(selector is not null); 163Debug.Assert(source.Length > 0); // Caller should check this beforehand and return a cached result 205Debug.Assert(source is not null); 206Debug.Assert(selector is not null); 255Debug.Assert(source is not null); 256Debug.Assert(selector is not null); 274Debug.Assert(_enumerator is not null);
System\Linq\Select.SpeedOpt.cs (33)
144Debug.Assert(source.Length > 0); 155Debug.Assert(source.Length > 0); 189Debug.Assert(count > 0); 200Debug.Assert(count > 0); 221Debug.Assert(_source.Length > 0); // See assert in constructor 229Debug.Assert(_source.Length > 0); // See assert in constructor 244Debug.Assert(start < end); 245Debug.Assert((uint)(end - start) <= (uint)int.MaxValue); 246Debug.Assert(selector is not null); 265Debug.Assert(_start < _end - index); 314Debug.Assert(count > 0); 326Debug.Assert(count > 0); 350Debug.Assert(_end > _start); 357Debug.Assert(_end > _start); 417Debug.Assert(count > 0); 423Debug.Assert(count > 0); 520Debug.Assert(count > 0); 526Debug.Assert(count > 0); 581Debug.Assert(source is not null); 582Debug.Assert(selector is not null); 599Debug.Assert(_enumerator is not null); 629Debug.Assert(count > 0); 636Debug.Assert(count > 0); 667Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 686Debug.Assert(count > 0); 687Debug.Assert(count == _source.GetCount(onlyIfCheap: true)); 707Debug.Assert(_source.GetCount(onlyIfCheap: true) == -1); 794Debug.Assert(source is not null); 795Debug.Assert(selector is not null); 796Debug.Assert(minIndexInclusive >= 0); 797Debug.Assert(minIndexInclusive <= maxIndexInclusive); 829Debug.Assert(count > 0); 836Debug.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\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 (12)
24Debug.Assert(source is not null); 25Debug.Assert(minIndexInclusive >= 0); 26Debug.Assert(minIndexInclusive <= maxIndexInclusive); 212Debug.Assert(source is not null); 214Debug.Assert(minIndexInclusive >= 0); 215Debug.Assert(maxIndexInclusive >= -1); 220Debug.Assert(maxIndexInclusive == -1 || minIndexInclusive <= maxIndexInclusive); 294Debug.Assert(_enumerator is not null); 304Debug.Assert(_enumerator is not null); 405Debug.Assert(!HasLimit || Limit > 0); 522Debug.Assert(index >= 0); 528Debug.Assert(en is not null);
System\Linq\Sum.cs (3)
83Debug.Assert(span.Length >= Vector<T>.Count * 4); 84Debug.Assert(Vector<T>.Count > 2); 85Debug.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 144Debug.Assert(queue.Count == Math.Min(count, startIndex)); 149Debug.Assert(endIndex - startIndex <= queue.Count); 158Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\Take.SizeOpt.cs (3)
13Debug.Assert(count > 0); 24Debug.Assert(source is not null); 25Debug.Assert(startIndex >= 0 && startIndex < endIndex);
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\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)
96Debug.Assert(source is not null); 97Debug.Assert(predicate is not null); 124Debug.Assert(_enumerator is not null); 160Debug.Assert(source is not null && source.Length > 0); 161Debug.Assert(predicate is not null); 208Debug.Assert(source is not null); 209Debug.Assert(predicate is not null); 263Debug.Assert(source is not null && source.Length > 0); 264Debug.Assert(predicate is not null); 265Debug.Assert(selector is not null); 312Debug.Assert(source is not null); 313Debug.Assert(predicate is not null); 314Debug.Assert(selector is not null); 367Debug.Assert(source is not null); 368Debug.Assert(predicate is not null); 369Debug.Assert(selector is not null); 398Debug.Assert(_enumerator is not null);
System.Linq.AsyncEnumerable (31)
System\Linq\Chunk.cs (1)
78Debug.Assert(local.Length == size);
System\Linq\OrderBy.cs (13)
204Debug.Assert(keySelector is Func<TElement, TKey> or Func<TElement, CancellationToken, ValueTask<TKey>>); 302Debug.Assert(typeof(TKey) == typeof(TElement)); 332Debug.Assert(keys is not null); 364Debug.Assert(typeof(TKey).IsValueType); 365Debug.Assert(_comparer == Comparer<TKey>.Default); 366Debug.Assert(_next is null); 367Debug.Assert(!_descending); 370Debug.Assert(keys is not null); 380Debug.Assert(typeof(TKey).IsValueType); 381Debug.Assert(_comparer == Comparer<TKey>.Default); 382Debug.Assert(_next is null); 383Debug.Assert(_descending); 386Debug.Assert(keys is not null);
System\Linq\Take.cs (10)
69Debug.Assert(startIndex >= 0); 70Debug.Assert(endIndex >= 0); 92Debug.Assert(source is not null); 93Debug.Assert(startIndex >= 0 && startIndex < endIndex); 130Debug.Assert(source is not null); 131Debug.Assert(isStartIndexFromEnd || isEndIndexFromEnd); 132Debug.Assert(isStartIndexFromEnd 175Debug.Assert(queue.Count == Math.Min(count, startIndex)); 184Debug.Assert(endIndex - startIndex <= queue.Count); 193Debug.Assert(!isStartIndexFromEnd && isEndIndexFromEnd);
System\Linq\ToLookupAsync.cs (7)
204Debug.Assert(source is not null); 205Debug.Assert(keySelector is not null); 226Debug.Assert(source is not null); 227Debug.Assert(keySelector is not null); 257Debug.Assert(g is not null); 335Debug.Assert(g is not null); 354Debug.Assert(g is not null);
System.Linq.Expressions (450)
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\DynamicObject.cs (2)
579Debug.Assert(binder is ConvertBinder && fallbackInvoke == null); 583Debug.Assert(convert.Method == null);
System\Dynamic\ExpandoObject.cs (6)
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);
System\Dynamic\Utils\ContractUtils.cs (6)
41Debug.Assert(!string.IsNullOrEmpty(paramName)); 67Debug.Assert(!string.IsNullOrEmpty(paramName)); 110Debug.Assert(!string.IsNullOrEmpty(arrayName)); 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); 248Debug.Assert(current != null); 264Debug.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 (25)
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 (3)
231Debug.Assert(local != null); 263Debug.Assert(_method is DynamicMethod); 288Debug.Assert(_method is DynamicMethod);
System\Linq\Expressions\Compiler\LambdaCompiler.Expressions.cs (23)
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<>)); 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 (17)
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); 278Debug.Assert(b.Method!.IsStatic); 384Debug.Assert(b.Method!.IsStatic); 458Debug.Assert(node.Type == typeof(bool)); 508Debug.Assert(node.NodeType == ExpressionType.Equal || node.NodeType == ExpressionType.NotEqual); 509Debug.Assert(!node.IsLiftedToNull); 530Debug.Assert(!node.Right.Type.IsValueType); 544Debug.Assert(!node.Left.Type.IsValueType); 583Debug.Assert(node.NodeType == ExpressionType.AndAlso || node.NodeType == ExpressionType.OrElse); 584Debug.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 (3)
133Debug.Assert(result.Node != null); 1043Debug.Assert(original != null); 1044Debug.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 (12)
25Debug.Assert(_offset == Unknown && offset != Unknown); 59Debug.Assert(_offset != Unknown); 81Debug.Assert(_offset != Unknown); 104Debug.Assert(_offset != Unknown); 148Debug.Assert(_offset != Unknown); 166Debug.Assert(_labelIndex != UnknownInstrIndex); 172Debug.Assert(_labelIndex != UnknownInstrIndex); 179Debug.Assert(_labelIndex != UnknownInstrIndex); 325Debug.Assert(!(unwrappedException is RethrowException)); 415Debug.Assert(tryHandler != null); 567Debug.Assert(!frame.IsJumpHappened()); 590Debug.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 (2)
239Debug.Assert(Count > 0); 770Debug.Assert(_instructions[_instructions.Count - 1] == NullCheckInstruction.Instance);
System\Linq\Expressions\Interpreter\InterpretedFrame.cs (1)
213Debug.Assert(_pendingContinuation >= 0);
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 (34)
43Debug.Assert(exceptionType != null); 71Debug.Assert((FinallyStartIndex != Instruction.UnknownInstrIndex) == (FinallyEndIndex != Instruction.UnknownInstrIndex)); 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)); 1366Debug.Assert(expr.Method.IsStatic); 1548Debug.Assert(node.Type == typeof(void)); 1644Debug.Assert(!hasValue); 1688Debug.Assert(!hasValue); 1744Debug.Assert(label != null); 1787Debug.Assert(_labelBlock != null && _labelBlock.Kind == kind); 1990Debug.Assert(enterTryInstr != null); 2071Debug.Assert(startOfFinally != null); 2087Debug.Assert(exHandlers != null); 2100Debug.Assert(expr.Finally == null); 2101Debug.Assert(expr.Handlers.Count == 0); 2107Debug.Assert(enterTryInstr == _instructions.GetInstruction(tryStart)); 2154Debug.Assert(parameters.Length == arguments.ArgumentCount); 2324Debug.Assert(member.Member is PropertyInfo); 2426Debug.Assert(type.IsValueType); 2451Debug.Assert(!forBinding); 2517Debug.Assert(typeof(NewArrayExpression).GetCustomAttribute<RequiresDynamicCodeAttribute>() is not null); 2534Debug.Assert(node.NodeType == ExpressionType.NewArrayBounds); 2900Debug.Assert(expr.NodeType == ExpressionType.TypeEqual); 2923Debug.Assert(expr.NodeType == ExpressionType.TypeIs); 3009Debug.Assert(_instructions.CurrentStackDepth == startingStackDepth);
System\Linq\Expressions\Interpreter\LightDelegateCreator.cs (2)
18Debug.Assert(interpreter != null); 19Debug.Assert(lambda != null);
System\Linq\Expressions\Interpreter\LocalAccess.cs (1)
273Debug.Assert(defaultValue != null);
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 (7)
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\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\CallSiteBinder.cs (1)
221Debug.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 (518)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (11)
258Debug.Assert(_producerChunk != null); 289Debug.Assert(chunk != null); 315Debug.Assert(_consumerEvent != null); 327Debug.Assert(_producerEvent != null); 383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize); 410Debug.Assert(_consumerChunk == null); 488Debug.Assert(_consumerChunk == null); 606Debug.Assert(!IsChunkBufferEmpty); 630Debug.Assert(_producerEvent != null); 664Debug.Assert(_producerEvent != null); 665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Channels\SynchronousChannel.cs (4)
67Debug.Assert(_queue != null); 89Debug.Assert(_queue != null); 117Debug.Assert(_queue != null && array != null); 132Debug.Assert(_queue != null);
System\Linq\Parallel\Enumerables\AggregationMinMaxHelpers.cs (2)
25Debug.Assert(source != null); 26Debug.Assert(sign == -1 || sign == 1);
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 (2)
31Debug.Assert(source != null); 89Debug.Assert(_wrappedEnumerable != null);
System\Linq\Parallel\Merging\ArrayMergeHelper.cs (1)
86Debug.Assert(_outputArray != null);
System\Linq\Parallel\Merging\AsynchronousChannelMergeEnumerator.cs (5)
48Debug.Assert(channels != null); 50foreach (AsynchronousChannel<T> c in channels) Debug.Assert(c != null); 226Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 227Debug.Assert(_consumerEvent != null); 271Debug.Assert(currChannelIndex == _channels.Length);
System\Linq\Parallel\Merging\DefaultMergeHelper.cs (7)
48Debug.Assert(partitions != null); 67Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 86Debug.Assert(_asyncChannels == null || _asyncChannels.Length == partitions.PartitionCount); 87Debug.Assert(_syncChannels == null || _syncChannels.Length == partitions.PartitionCount); 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 (8)
53Debug.Assert(partitions != null); 54Debug.Assert(partitions.PartitionCount > 0); 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 (7)
122Debug.Assert(partitions != null); 139Debug.Assert(typeof(TKey) == typeof(int)); 415Debug.Assert(_mergeHelper._producerDone[producer]); 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 (12)
69Debug.Assert(source != null); 70Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 71Debug.Assert(repartitionStream != null); 72Debug.Assert(barrier != null); 73Debug.Assert(valueExchangeMatrix != null); 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));
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 (15)
71Debug.Assert(source != null); 72Debug.Assert(keySelector != null || typeof(THashKey) == typeof(NoKeyMemoizationRequired)); 73Debug.Assert(repartitionStream != null); 74Debug.Assert(barrier != null); 75Debug.Assert(valueExchangeMatrix != null); 78Debug.Assert(0 <= partitionIndex && partitionIndex < partitionCount); 124Debug.Assert(!ParallelEnumerable.SinglePartitionMode); 133Debug.Assert(mutables._currentBufferIndex != ENUMERATION_NOT_STARTED); 145Debug.Assert(mutables._currentKeyBuffer != null); 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)); 249Debug.Assert(keyBuffer == null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (21)
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); 251Debug.Assert(sectionSize > 0); 277Debug.Assert(mutables != null); 278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 422Debug.Assert(sectionSize > 0); 448Debug.Assert(mutables != null); 449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize); 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 (5)
40Debug.Assert(partitionCount > 0); 57Debug.Assert(_partitions != null); 63Debug.Assert(_partitions != null); 64Debug.Assert(value != null); 78Debug.Assert(_partitions != null);
System\Linq\Parallel\QueryOperators\AssociativeAggregationOperator.cs (7)
105Debug.Assert(_finalReduce != null); 106Debug.Assert(_resultSelector != null); 242Debug.Assert(source != null); 243Debug.Assert(reduceOperator != null); 261Debug.Assert(_reduceOperator != null); 286Debug.Assert(typeof(TInput) == typeof(TIntermediate)); 319Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Binary\ConcatQueryOperator.cs (8)
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 (12)
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 (6)
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 (11)
69Debug.Assert(leftSource != null); 70Debug.Assert(rightLookupBuilder != null); 71Debug.Assert(resultSelector != null); 72Debug.Assert(outputKeyBuilder != null); 96Debug.Assert(_leftSource != null); 97Debug.Assert(_rightLookupBuilder != null); 133Debug.Assert(mutables._rightHashLookup != null); 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 (12)
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 (5)
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 (10)
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 (6)
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 (2)
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 (2)
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 (2)
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\IntAverageAggregationOperator.cs (2)
96Debug.Assert(source != null); 145Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Inlined\IntMinMaxAggregationOperator.cs (2)
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 (2)
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 (2)
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 (2)
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 (2)
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 (2)
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 (2)
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\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\QuerySettings.cs (12)
40Debug.Assert(_cancellationState != null); 93Debug.Assert(_cancellationState != null); 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 (5)
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 (5)
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 (7)
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 (8)
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 (5)
75Debug.Assert(intKeyStream.OrdinalIndexState == OrdinalIndexState.Indexable); 182Debug.Assert(source != null); 183Debug.Assert(index >= 0); 184Debug.Assert(resultFoundFlag != null); 225Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\FirstQueryOperator.cs (6)
76Debug.Assert(partitionCount == 1); 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 (5)
47Debug.Assert(_elementAction != null); 65Debug.Assert(enumerator == null); 136Debug.Assert(source != null); 137Debug.Assert(elementAction != null); 173Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\GroupByQueryOperator.cs (22)
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 (6)
71Debug.Assert(!ExchangeUtilities.IsWorseThan(indexState, OrdinalIndexState.Correct)); 103Debug.Assert(typeof(TKey) == typeof(int)); 145Debug.Assert(source != null); 146Debug.Assert(selector != null); 217Debug.Assert(_childQueryResults.IsIndexible); 226Debug.Assert(_childCount >= 0);
System\Linq\Parallel\QueryOperators\Unary\IndexedWhereQueryOperator.cs (4)
97Debug.Assert(typeof(TKey) == typeof(int)); 152Debug.Assert(source != null); 153Debug.Assert(predicate != null); 188Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\LastQueryOperator.cs (6)
76Debug.Assert(partitionCount == 1); 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 (7)
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 (15)
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); 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); 449Debug.Assert(_mutables != null); 462Debug.Assert(_currentRightSourceAsOutput != null);
System\Linq\Parallel\QueryOperators\Unary\SelectQueryOperator.cs (6)
104Debug.Assert(source != null); 105Debug.Assert(selector != null); 163Debug.Assert(op._selector != null); 165Debug.Assert(_childQueryResults.IsIndexible); 181Debug.Assert(index >= 0); 182Debug.Assert(index < ElementsCount);
System\Linq\Parallel\QueryOperators\Unary\SingleQueryOperator.cs (3)
113Debug.Assert(source != null); 114Debug.Assert(totalElementCount != null); 127Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\SortQueryOperator.cs (3)
180Debug.Assert(source != null); 195Debug.Assert(_source != null); 209Debug.Assert(_source != null);
System\Linq\Parallel\QueryOperators\Unary\TakeOrSkipQueryOperator.cs (13)
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); 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 (11)
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);
System\Linq\Parallel\QueryOperators\Unary\WhereQueryOperator.cs (3)
116Debug.Assert(source != null); 117Debug.Assert(predicate != null); 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 (4)
35Debug.Assert(groupState != null); 46Debug.Assert(o != null); 75Debug.Assert(o != null); 94Debug.Assert(unused == null);
System\Linq\Parallel\Scheduling\QueryTaskGroupState.cs (2)
86Debug.Assert(_rootTask != null); 158Debug.Assert(_cancellationState.TopLevelDisposedFlag.Value);
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 (1)
121Debug.Assert(!_dict.ContainsKey(grouping.Key));
System\Linq\Parallel\Utils\Sorting.cs (28)
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); 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); 585Debug.Assert(keys.Length >= indices.Length); 586Debug.Assert(left <= right); 587Debug.Assert(0 <= left && left < keys.Length); 588Debug.Assert(0 <= right && right < keys.Length);
System\Linq\Parallel\Utils\WrapperEqualityComparer.cs (2)
29Debug.Assert(_comparer != null); 35Debug.Assert(_comparer != null);
System\Linq\ParallelEnumerable.cs (8)
1524Debug.Assert(source != null); 1525Debug.Assert(reduce != null); 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>>);
System.Linq.Queryable (2)
System\Linq\EnumerableRewriter.cs (2)
247Debug.Assert(matchingMethods.Length > 1); 278Debug.Assert(left.Length == right.Length);
System.Memory (53)
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);
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); 560Debug.Assert(positionSequenceObject != null); 578Debug.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.Net.Http (761)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HeaderField.cs (1)
20Debug.Assert(name.Length > 0);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\HPackEncoder.cs (17)
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);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\Huffman.cs (2)
680Debug.Assert(dst.Length > 0); 745Debug.Assert(bitsInAcc < 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerDecoder.cs (1)
39Debug.Assert(prefixLength >= 1 && prefixLength <= 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http2\Hpack\IntegerEncoder.cs (2)
25Debug.Assert(value >= 0); 26Debug.Assert(numBits >= 1 && numBits <= 8);
src\libraries\Common\src\System\Net\Http\aspnetcore\Http3\Helpers\VariableLengthIntegerHelper.cs (8)
69Debug.Assert((firstByte & LengthMask) == InitialEightByteLengthMask); 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\libraries\Common\src\System\Net\Http\aspnetcore\Http3\QPack\HeaderField.cs (1)
17Debug.Assert(name.Length > 0);
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\libraries\Common\src\System\Net\HttpKnownHeaderNames.TryGetHeaderName.cs (18)
35Debug.Assert(length >= 0); 55Debug.Assert(name != null); 89Debug.Assert(key != null); 90Debug.Assert(startIndex >= 0); 91Debug.Assert(length >= 0); 92Debug.Assert(charAt != null); 93Debug.Assert(equals != null); 335Debug.Assert(potentialHeader != null); 345Debug.Assert(known != null); 346Debug.Assert(known.Length > 0); 347Debug.Assert(startIndex >= 0); 348Debug.Assert(length > 0); 349Debug.Assert(equals != null); 353Debug.Assert(known.Length == length); 367Debug.Assert(left != null); 368Debug.Assert(right != IntPtr.Zero); 369Debug.Assert(rightLength > 0); 372Debug.Assert(left.Length == rightLength);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (31)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 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); 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); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\Security\SslClientAuthenticationOptionsExtensions.cs (1)
39Debug.Assert(properties.Length == 13);
src\libraries\Common\src\System\Text\SimpleRegex.cs (1)
68Debug.Assert(patternPos <= pattern.Length);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Net\Http\DiagnosticsHandler.cs (2)
27Debug.Assert(IsGloballyEnabled()); 28Debug.Assert(innerHandler is not null && propagator is not null);
System\Net\Http\DiagnosticsHelper.cs (2)
23Debug.Assert(uri.IsAbsoluteUri); 123Debug.Assert(statusCode >= 400 && statusCode <= 599);
System\Net\Http\Headers\AltSvcHeaderParser.cs (2)
27Debug.Assert(startIndex >= 0); 28Debug.Assert(startIndex < value.Length);
System\Net\Http\Headers\AuthenticationHeaderValue.cs (3)
48Debug.Assert(source != null); 118Debug.Assert(startIndex >= 0); 237Debug.Assert(input[parseEndIndex] == ',');
System\Net\Http\Headers\ByteArrayHeaderParser.cs (1)
22Debug.Assert(value is byte[]);
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); 210Debug.Assert(startIndex >= 0); 256Debug.Assert((input != null) && (input.Length > 0) && (startIndex < input.Length)); 338Debug.Assert(nameParameter.Value != null); 448Debug.Assert(input != null);
System\Net\Http\Headers\ContentRangeHeaderValue.cs (2)
86Debug.Assert(source != null); 159Debug.Assert(startIndex >= 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 (7)
61Debug.Assert(!string.IsNullOrEmpty(headerName)); 83Debug.Assert(headerName.Length > 0); 104Debug.Assert(index >= 0); 108Debug.Assert(qpackStaticTable.Length == 99); 127Debug.Assert(_descriptor is KnownHeader); 128Debug.Assert(HeaderType != HttpHeaderType.Custom); 253Debug.Assert(candidate is null || candidate.Length == contentTypeValue.Length);
System\Net\Http\Headers\HeaderUtilities.cs (7)
32Debug.Assert(parameters != null); 124Debug.Assert(parameters != null); 208Debug.Assert(xItem != null); 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 (44)
68Debug.Assert((allowedHeaderTypes & treatAsCustomHeaderTypes) == 0); 92Debug.Assert(!Contains(descriptor)); 124Debug.Assert(!Contains(descriptor)); 154Debug.Assert(currentValue is string); 282Debug.Assert(singleValue is not null ^ multiValue is not null); 294Debug.Assert(multiValue is not null && multiValue.Length > 0); 314Debug.Assert(singleValue is not null ^ multiValue is not null); 337Debug.Assert(_headerStore is not null); 379Debug.Assert(value != null); 393Debug.Assert(value != null); 422Debug.Assert(value != null); 500Debug.Assert(value != null); 556Debug.Assert(sourceHeaders != null); 596Debug.Assert(sourceValue is string); 648Debug.Assert(source is not InvalidValue); 694Debug.Assert(!Contains(descriptor)); 700Debug.Assert((descriptor.HeaderType & _treatAsCustomHeaderTypes) == 0); 752Debug.Assert(value is string); 772Debug.Assert(!info.IsEmpty); 785Debug.Assert(rawValue is not null); 790Debug.Assert(info.ParsedAndInvalidValues is not null); 798Debug.Assert(Monitor.IsEntered(info)); 837Debug.Assert(!Contains(descriptor)); 847Debug.Assert(info != null); 848Debug.Assert(descriptor.Parser != null); 923Debug.Assert(value != null); 966Debug.Assert(currentStoreValue is T); 970Debug.Assert(value is T); 1014Debug.Assert(info != null); 1138Debug.Assert(singleValue is not null ^ multiValue is not null); 1147Debug.Assert(sourceValues is string); 1174Debug.Assert(currentIndex == length); 1185Debug.Assert(sourceValues is string); 1199Debug.Assert(length > 0); 1209Debug.Assert(currentIndex == length); 1217Debug.Assert(info != null); 1218Debug.Assert(Monitor.IsEntered(info)); 1243Debug.Assert(item != null); 1253Debug.Assert(value != null); 1270Debug.Assert(value is not null); 1309Debug.Assert(item is not InvalidValue); 1314Debug.Assert(ParsedAndInvalidValues is not InvalidValue); 1499Debug.Assert(dictionary.Count == _count - 1); 1517Debug.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 (5)
14Debug.Assert(!string.IsNullOrEmpty(name)); 15Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 20Debug.Assert(!string.IsNullOrEmpty(name)); 21Debug.Assert(name[0] == ':' || HttpRuleParser.IsToken(name)); 32Debug.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 (2)
43Debug.Assert(source != null); 133Debug.Assert(startIndex >= 0);
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 (2)
67Debug.Assert(source != null); 137Debug.Assert(startIndex >= 0);
System\Net\Http\HttpClient.cs (2)
129Debug.Assert(HttpContent.MaxBufferSize <= int.MaxValue); 605Debug.Assert(_timeout.TotalSeconds > 0);
System\Net\Http\HttpContent.cs (36)
53Debug.Assert(encoding != null); 83Debug.Assert(IsBuffered); 98Debug.Assert(IsBuffered); 116Debug.Assert(firstBuffer.Length >= 4 || firstBuffer.Length == stream.Length); 194Debug.Assert(_bufferedContent != null); 610Debug.Assert(contentLength >= 0); 694Debug.Assert(StreamCopyExceptionNeedsWrapping(e)); 701Debug.Assert(encoding != null); 808Debug.Assert(maxBufferSize >= 0); 809Debug.Assert(expectedFinalSize >= 0); 827Debug.Assert(_pooledBuffers is null); 828Debug.Assert(!_lastBufferIsPooled); 841Debug.Assert(!_shouldPoolFinalSize || _expectedFinalSize == 0); 845Debug.Assert(_pooledBuffers is null); 862Debug.Assert(!_lastBufferIsPooled); 863Debug.Assert(_pooledBuffers is null); 877Debug.Assert(!_lastBufferIsPooled); 878Debug.Assert(_pooledBuffers is null); 879Debug.Assert(_lastBufferOffset == _totalLength); 880Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 887Debug.Assert(_lastBufferIsPooled || _pooledBuffers is null); 923Debug.Assert(_totalLength + buffer.Length <= _maxBufferSize); 951Debug.Assert(newBufferCapacity > 0); 978Debug.Assert(_pooledBuffers is null); 979Debug.Assert(_lastBufferOffset == 0); 980Debug.Assert(_totalLength == 0); 983Debug.Assert(_shouldPoolFinalSize || newBuffer.Length != _expectedFinalSize); 991Debug.Assert(_lastBufferIsPooled); 998Debug.Assert(remainingInCurrentBuffer.Length < buffer.Length); 1024Debug.Assert(bufferCount <= 16); 1040Debug.Assert(destination.Length >= _totalLength); 1044Debug.Assert(buffers.Length > 0 && buffers[0] is not null); 1053Debug.Assert(destination.Length >= buffer.Length); 1060Debug.Assert(_lastBufferOffset <= _lastBuffer.Length); 1061Debug.Assert(_lastBufferOffset <= destination.Length); 1083Debug.Assert(_lastBuffer is not null);
System\Net\Http\HttpMethod.SocketsHttpHandler.cs (1)
56Debug.Assert(Ascii.IsValid(Method));
System\Net\Http\HttpRequestMessage.cs (1)
184Debug.Assert(value);
System\Net\Http\HttpResponseMessage.cs (1)
118Debug.Assert(headers.ContainsTrailingHeaders);
System\Net\Http\HttpRuleParser.cs (11)
34Debug.Assert(input is not null); 51Debug.Assert(IsToken(input)); 58Debug.Assert(input != null); 90Debug.Assert(input != null); 91Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 134Debug.Assert(input != null); 135Debug.Assert(startIndex >= 0); 185Debug.Assert(input != null); 186Debug.Assert((startIndex >= 0) && (startIndex < input.Length)); 221Debug.Assert(input != null); 222Debug.Assert((startIndex >= 0) && (startIndex < input.Length));
System\Net\Http\HttpTelemetry.AnyOS.cs (1)
27Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\HttpTelemetry.cs (4)
55Debug.Assert(request.RequestUri != null && request.RequestUri.IsAbsoluteUri); 217Debug.Assert(count >= 0); 232Debug.Assert(count >= 0); 247Debug.Assert(count >= 0);
System\Net\Http\MessageProcessingHandler.cs (1)
143Debug.Assert(handler != null);
System\Net\Http\MultipartContent.cs (4)
158Debug.Assert(stream != null); 202Debug.Assert(stream != null); 236Debug.Assert(task.IsCompleted); 422Debug.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)
222Debug.Assert(pool.PreAuthCredentials != null); 228Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NegotiateScheme) == null); 229Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, NtlmScheme) == null); 230Debug.Assert(pool.PreAuthCredentials.GetCredential(authUri, DigestScheme) == null); 355Debug.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)
242Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\ChunkedEncodingReadStream.cs (15)
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); 359Debug.Assert(_chunkBytesRemaining > 0); 368Debug.Assert(bytesToConsume > 0 || maxBytesToRead == 0); 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 (3)
42Debug.Assert(activity is not null); 60Debug.Assert(exception is not null); 85Debug.Assert(connectionSetupActivity is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.cs (40)
84Debug.Assert(host is not null || (kind == HttpConnectionKind.Proxy && proxyUri is not null)); 97Debug.Assert(host != null); 98Debug.Assert(port != 0); 99Debug.Assert(sslHostName == null); 100Debug.Assert(proxyUri == null); 106Debug.Assert(host != null); 107Debug.Assert(port != 0); 108Debug.Assert(sslHostName != null); 109Debug.Assert(proxyUri == null); 113Debug.Assert(host == null); 114Debug.Assert(port == 0); 115Debug.Assert(sslHostName == null); 116Debug.Assert(proxyUri != null); 123Debug.Assert(host != null); 124Debug.Assert(port != 0); 125Debug.Assert(sslHostName == null); 126Debug.Assert(proxyUri != null); 133Debug.Assert(host != null); 134Debug.Assert(port != 0); 135Debug.Assert(sslHostName != null); 136Debug.Assert(proxyUri != null); 142Debug.Assert(host != null); 143Debug.Assert(port != 0); 144Debug.Assert(sslHostName == null); 145Debug.Assert(proxyUri != null); 158Debug.Assert(host != null); 159Debug.Assert(port != 0); 160Debug.Assert(proxyUri != null); 193Debug.Assert(Encoding.ASCII.GetString(_hostHeaderLineBytes) == $"Host: {hostHeader}\r\n"); 264Debug.Assert(sslHostName != null); 312Debug.Assert(!Monitor.IsEntered(_http11Connections)); 423Debug.Assert(async); 462Debug.Assert(connection is not null || !_http2Enabled); 511Debug.Assert(retryCount >= 0 && retryCount <= MaxConnectionFailureRetries); 561Debug.Assert(http11ConnectionWaiter is null || http2ConnectionWaiter?.ConnectionCancellationTokenSource is null); 622Debug.Assert(stream != null); 813Debug.Assert(_proxyUri != null); 823Debug.Assert(e is not HttpRequestException); 869Debug.Assert(desiredVersion == 2 || desiredVersion == 3); 882Debug.Assert(!HasSyncObjLock);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http1.cs (11)
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); 416Debug.Assert(_associatedHttp11ConnectionCount > 0); 417Debug.Assert(!disposing || Array.IndexOf(_http11Connections.ToArray(), connection) < 0); 435Debug.Assert(pool.HasSyncObjLock); 436Debug.Assert(connections.Count <= pool._associatedHttp11ConnectionCount);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http2.cs (16)
66Debug.Assert(_kind == HttpConnectionKind.Https || _kind == HttpConnectionKind.SslProxyTunnel || _kind == HttpConnectionKind.Http || _kind == HttpConnectionKind.SocksTunnel || _kind == HttpConnectionKind.SslSocksTunnel); 140Debug.Assert(HasSyncObjLock); 241Debug.Assert(connectionException is not null); 279Debug.Assert(_associatedHttp2ConnectionCount > 0); 280Debug.Assert(_pendingHttp2Connection); 297Debug.Assert(_pendingHttp2Connection); 298Debug.Assert(_associatedHttp2ConnectionCount > 0); 367Debug.Assert(!HasSyncObjLock); 374Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 375Debug.Assert(_associatedHttp2ConnectionCount > (_availableHttp2Connections?.Count ?? 0)); 399Debug.Assert(_pendingHttp2Connection); 436Debug.Assert(!added); 455Debug.Assert(_disposed); 518Debug.Assert(_availableHttp2Connections is null || !_availableHttp2Connections.Contains(connection)); 519Debug.Assert(_associatedHttp2ConnectionCount > 0); 544Debug.Assert(_associatedHttp2ConnectionCount >= _availableHttp2Connections.Count);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionPool.Http3.cs (30)
70Debug.Assert(IsHttp3Supported()); 72Debug.Assert(_kind == HttpConnectionKind.Https); 73Debug.Assert(_http3Enabled); 140Debug.Assert(IsHttp3Supported()); 212Debug.Assert(IsHttp3Supported()); 214Debug.Assert(HasSyncObjLock); 251Debug.Assert(IsHttp3Supported()); 295Debug.Assert(connectionSetupActivity?.IsStopped is not true); 334Debug.Assert(IsHttp3Supported()); 350Debug.Assert(_associatedHttp3ConnectionCount > 0); 351Debug.Assert(_pendingHttp3Connection); 365Debug.Assert(IsHttp3Supported()); 369Debug.Assert(!HasSyncObjLock); 376Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 377Debug.Assert(_associatedHttp3ConnectionCount > (_availableHttp3Connections?.Count ?? 0)); 402Debug.Assert(_pendingHttp3Connection); 439Debug.Assert(!added); 461Debug.Assert(_disposed); 489Debug.Assert(IsHttp3Supported()); 510Debug.Assert(_availableHttp3Connections is null || !_availableHttp3Connections.Contains(connection)); 511Debug.Assert(_associatedHttp3ConnectionCount > 0); 532Debug.Assert(IsHttp3Supported()); 541Debug.Assert(_associatedHttp3ConnectionCount >= _availableHttp3Connections.Count); 568Debug.Assert(IsHttp3Supported()); 674Debug.Assert(_authorityExpireTimer != null || _disposed); 766Debug.Assert(HasSyncObjLock); 805Debug.Assert(badAuthority != null); 855Debug.Assert(_authorityExpireTimer != null); 859Debug.Assert(_altSvcBlocklistTimerCancellation != null); 892Debug.Assert(_authorityExpireTimer != null || _disposed);
System\Net\Http\SocketsHttpHandler\ConnectionPool\HttpConnectionWaiter.cs (2)
29Debug.Assert(typeof(T) == typeof(HttpConnection) || typeof(T) == typeof(Http2Connection)); 59Debug.Assert(connection is not null);
System\Net\Http\SocketsHttpHandler\ConnectionPool\RequestQueue.cs (2)
50Debug.Assert(_size > 0); 166Debug.Assert(_attemptedConnectionsOffset >= 0);
System\Net\Http\SocketsHttpHandler\ContentLengthReadStream.cs (11)
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)
32Debug.Assert(connection._currentRequest != null); 46Debug.Assert(connection._currentRequest != null);
System\Net\Http\SocketsHttpHandler\CookieHelper.cs (1)
19Debug.Assert(response.RequestMessage != null && response.RequestMessage.RequestUri != null);
System\Net\Http\SocketsHttpHandler\CreditManager.cs (4)
22Debug.Assert(owner != null); 23Debug.Assert(!string.IsNullOrWhiteSpace(name)); 105Debug.Assert(waiter != null); 111Debug.Assert(_waitersTail == waiter);
System\Net\Http\SocketsHttpHandler\DecompressionHandler.cs (9)
28Debug.Assert(decompressionMethods != DecompressionMethods.None); 29Debug.Assert(innerHandler != null); 71Debug.Assert(response.Content != null); 157Debug.Assert(task.IsCompleted); 333Debug.Assert(_firstByteStatus == FirstByteStatus.None); 349Debug.Assert(_firstByteStatus == FirstByteStatus.None); 379Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 397Debug.Assert(_firstByteStatus == FirstByteStatus.Consumed); 403Debug.Assert(_firstByteStatus != FirstByteStatus.None);
System\Net\Http\SocketsHttpHandler\Http2Connection.cs (48)
268Debug.Assert(Monitor.IsEntered(SyncObject)); 269Debug.Assert(!_pool.HasSyncObjLock); 289Debug.Assert(!_pool.HasSyncObjLock); 312Debug.Assert(!_pool.HasSyncObjLock); 318Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 322Debug.Assert(_streamsInUse >= _httpStreams.Count); 343Debug.Assert(!_pool.HasSyncObjLock); 369Debug.Assert(Monitor.IsEntered(SyncObject)); 373Debug.Assert(_shutdown != result); 502Debug.Assert(InitialSettingsReceived.Task.IsCompleted); 543Debug.Assert(bytesRead >= 0); 644Debug.Assert(frameHeader.Type == FrameType.Headers); 747Debug.Assert(frameHeader.Type == FrameType.AltSvc); 748Debug.Assert(!Monitor.IsEntered(SyncObject)); 776Debug.Assert(frameHeader.Type == FrameType.Data); 805Debug.Assert(frameHeader.Type == FrameType.Settings); 841Debug.Assert((settings.Length % 6) == 0); 931Debug.Assert(_availableStreamsWaiter is null || _streamsInUse >= _maxConcurrentStreams); 944Debug.Assert(newSize >= 0); 961Debug.Assert(frameHeader.Type == FrameType.Priority); 975Debug.Assert(frameHeader.Type == FrameType.Ping); 990Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1009Debug.Assert(frameHeader.Type == FrameType.WindowUpdate); 1019Debug.Assert(amount >= 0); 1046Debug.Assert(frameHeader.Type == FrameType.RstStream); 1079Debug.Assert(lastStreamId >= 0); 1094Debug.Assert(streamId == kvp.Value.StreamId); 1112Debug.Assert(frameHeader.Type == FrameType.GoAway); 1195Debug.Assert(_shutdown && _streamsInUse == 0); 1300Debug.Assert(sizeof(long) == FrameHeader.PingLength); 1324Debug.Assert(!_pool.HasSyncObjLock); 1509Debug.Assert(request.RequestUri != null); 1641Debug.Assert(headerBytes.Length > 0); 1687Debug.Assert(span.Length == 0); 1767Debug.Assert(amount > 0); 1783Debug.Assert(amount > 0); 1784Debug.Assert(_pendingWindowUpdate < ConnectionWindowThreshold); 1833Debug.Assert(streamId == kvp.Value.StreamId); 1850Debug.Assert(_shutdown); 1851Debug.Assert(_streamsInUse == 0); 1911Debug.Assert(streamId >= 0); 1927Debug.Assert(buffer.Length >= Size); 1939Debug.Assert(destination.Length >= Size); 1940Debug.Assert(type <= FrameType.Last); 1941Debug.Assert((flags & FrameFlags.ValidBits) == flags); 1942Debug.Assert((uint)payloadLength <= MaxPayloadLength); 1994Debug.Assert(async); 1995Debug.Assert(!_pool.HasSyncObjLock);
System\Net\Http\SocketsHttpHandler\Http2Stream.cs (66)
170Debug.Assert(_response != null); 182Debug.Assert(_requestCompletionState == StreamCompletionState.Completed); 187Debug.Assert(_requestBodyCancellationSource != null); 245Debug.Assert(!Monitor.IsEntered(SyncObject)); 255Debug.Assert(_responseCompletionState == StreamCompletionState.Completed); 257Debug.Assert(!ConnectProtocolEstablished); 265Debug.Assert(!sendReset); 269Debug.Assert(!ConnectProtocolEstablished); 287Debug.Assert(!Monitor.IsEntered(SyncObject)); 322Debug.Assert(!ConnectProtocolEstablished); 335Debug.Assert(_request?.Content != null); 364Debug.Assert(Monitor.IsEntered(SyncObject)); 365Debug.Assert(_requestCompletionState != StreamCompletionState.InProgress); 366Debug.Assert(_responseCompletionState != StreamCompletionState.InProgress); 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)); 850Debug.Assert(_requestCompletionState != StreamCompletionState.Failed); 869Debug.Assert(!Monitor.IsEntered(SyncObject)); 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 (14)
66Debug.Assert(Monitor.IsEntered(SyncObj)); 130Debug.Assert(Monitor.IsEntered(SyncObj)); 131Debug.Assert(ShuttingDown); 183Debug.Assert(_availableRequestStreamsCount >= 0); 201Debug.Assert(_availableRequestStreamsCount >= 0); 213Debug.Assert(_connection is null || connection == _connection); 217Debug.Assert(_availableRequestStreamsCount >= 0); 231Debug.Assert(_availableRequestStreamsCount >= 0); 242Debug.Assert(_availableStreamsWaiter is null); 318Debug.Assert(waitForConnectionActivity?.IsStopped != false); 491Debug.Assert(ex.ApplicationErrorCode.HasValue); 508Debug.Assert(payloadLength <= VariableLengthIntegerHelper.OneByteLimit); 552Debug.Assert(ex.ApplicationErrorCode.HasValue); 687Debug.Assert(ex.ApplicationErrorCode.HasValue);
System\Net\Http\SocketsHttpHandler\Http3RequestStream.cs (16)
233Debug.Assert(_response != null && _response.Content != null); 273Debug.Assert(ex.ApplicationErrorCode.HasValue); 297Debug.Assert(ex.ApplicationErrorCode.HasValue); 329Debug.Assert(_requestBodyCancellationSource.IsCancellationRequested); 382Debug.Assert(_response == null); 399Debug.Assert(_response != null); 611Debug.Assert(_sendBuffer.ActiveLength == 0); 635Debug.Assert(request.RequestUri != null); 695Debug.Assert(actualHeadersLengthEncodedSize == headersLengthEncodedSize); 945Debug.Assert(name.Length > 0); 1141Debug.Assert(_response == null); 1214Debug.Assert(_response == null); 1293Debug.Assert(e.ApplicationErrorCode.HasValue); 1298Debug.Assert(e.ApplicationErrorCode.HasValue); 1461Debug.Assert(_response != null); 1474Debug.Assert(_response != null);
System\Net\Http\SocketsHttpHandler\HttpAuthority.cs (1)
21Debug.Assert(host != null);
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (58)
80Debug.Assert(stream != null); 137Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_Completed); 161Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted); 195Debug.Assert(_readAheadTaskStatus != ReadAheadTask_CompletionReserved); 205Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started); 232Debug.Assert(_readAheadTask == default); 246Debug.Assert(_readAheadTask == default); 247Debug.Assert(_readBuffer.ActiveLength == 0); 279Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_CompletionReserved); 305Debug.Assert(bytesToConsume <= _readBuffer.ActiveLength); 311Debug.Assert(request.RequestUri is not null); 332Debug.Assert(request.RequestUri.Scheme == Uri.UriSchemeHttp); 341Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class 351Debug.Assert(Kind != HttpConnectionKind.Proxy); 356Debug.Assert(Kind == HttpConnectionKind.Proxy); 411Debug.Assert(success); 419Debug.Assert(_currentRequest is not null); 491Debug.Assert(Ascii.IsValid(s)); 496Debug.Assert(status == OperationStatus.Done); 497Debug.Assert(bytesWritten == s.Length); 516Debug.Assert(status == OperationStatus.Done); 517Debug.Assert(bytesWritten == s.Length); 601Debug.Assert(_readBuffer.ActiveLength == 0); 610Debug.Assert(_readAheadTask != default); 611Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 856Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed); 944Debug.Assert(request.Content is not null); 970Debug.Assert(stream.BytesWritten == 0); 1143Debug.Assert(_allowedReadLineBytes >= 0); 1320Debug.Assert(added); 1374Debug.Assert(source.Length <= _writeBuffer.AvailableLength); 1532Debug.Assert(formatted); 1538Debug.Assert(_writeBuffer.Capacity >= 8); 1624Debug.Assert(!ReadAheadTaskHasStarted); 1625Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1626Debug.Assert(_readBuffer.AvailableLength >= InitialReadBufferSize); 1640Debug.Assert(_readAheadTask == default); 1680Debug.Assert(_readBuffer.ActiveStartOffset == 0); 1681Debug.Assert(_readBuffer.ActiveLength > searchOffset); 1694Debug.Assert(searchOffset == readLength - 1 && _readBuffer.ActiveReadOnlySpan[searchOffset] == '\n'); 1711Debug.Assert(buffer.Length > 0); 1813Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1846Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity); 1859Debug.Assert(count <= _readBuffer.ActiveLength); 1879Debug.Assert(destination != null); 1898Debug.Assert(remaining > 0); 1915Debug.Assert(destination != null); 1916Debug.Assert(length > 0); 1984Debug.Assert(origReadBuffer.Length > 0); 2005Debug.Assert(_currentRequest == null); 2006Debug.Assert(!_inUse); 2013Debug.Assert(_inUse); 2031Debug.Assert(_inUse); 2069Debug.Assert(_inUse); 2076Debug.Assert(response.Content != null); 2080Debug.Assert(responseStream != null || stream is EmptyReadStream); 2084Debug.Assert(response.RequestMessage == _currentRequest); 2093Debug.Assert(_currentRequest == null);
System\Net\Http\SocketsHttpHandler\HttpConnectionBase.cs (5)
45Debug.Assert(this is HttpConnection or Http2Connection or Http3Connection); 46Debug.Assert(pool != null); 59Debug.Assert(_pool.Settings._metrics is not null); 140Debug.Assert(cache is not null); 209Debug.Assert(task.IsFaulted);
System\Net\Http\SocketsHttpHandler\HttpConnectionPoolManager.cs (5)
259Debug.Assert(uri != null); 263Debug.Assert(uri == proxyUri); 286Debug.Assert(HttpUtilities.IsSupportedProxyScheme(proxyUri.Scheme)); 385Debug.Assert(request.RequestUri != null); 475Debug.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 (1)
75Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\HttpContentWriteStream.cs (1)
18Debug.Assert(connection != null);
System\Net\Http\SocketsHttpHandler\Metrics\SocketsHttpHandlerMetrics.cs (1)
34Debug.Assert(versionMajor is 1 or 2 or 3);
System\Net\Http\SocketsHttpHandler\MultiProxy.cs (8)
51Debug.Assert(failedProxyCache != null); 80Debug.Assert(failedProxyCache != null); 98Debug.Assert(_failedProxyCache != null); 115Debug.Assert(_failedProxyCache != null); 141Debug.Assert(uri != null); 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 (4)
19Debug.Assert(initialInnerHandler != null); 20Debug.Assert(redirectInnerHandler != null); 21Debug.Assert(maxAutomaticRedirections > 0); 34Debug.Assert(request.RequestUri != null);
System\Net\Http\SocketsHttpHandler\SocketsHttpHandler.cs (1)
558Debug.Assert(_decompressionHandlerFactory is not null);
System\Net\Http\SocketsHttpHandler\SocksHelper.cs (6)
162Debug.Assert(bytesWritten == 4); 167Debug.Assert(hostIP.AddressFamily == AddressFamily.InterNetworkV6); 170Debug.Assert(bytesWritten == 16); 270Debug.Assert(isVersion4a); 279Debug.Assert(bytesWritten == 4); 328Debug.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)
121Debug.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.HttpListener (16)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\WebHeaderEncoding.cs (1)
23Debug.Assert(bytes != null && (uint)byteIndex <= (uint)bytes.Length && (uint)(byteIndex + byteCount) <= (uint)bytes.Length);
System\Net\HttpListener.cs (1)
210Debug.Assert(operationStatus == OperationStatus.Done);
System\Net\HttpListenerRequestUriBuilder.cs (3)
176Debug.Assert(_rawPath != null); 229Debug.Assert(_requestUriString != null); 288Debug.Assert(_rawOctets != 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.Mail (19)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Net\Mail\MailAddress.cs (1)
76Debug.Assert(parseSuccess);
System\Net\Mail\MailAddressParser.cs (1)
69Debug.Assert(!string.IsNullOrEmpty(data));
System\Net\Mail\MailBnfHelper.cs (2)
363Debug.Assert(index >= 0); 364Debug.Assert(index < data.Length);
System\Net\Mail\MailPriority.cs (1)
492System.Diagnostics.Debug.Assert(_headersEncoding != null);
System\Net\Mail\MailWriter.cs (1)
55Diagnostics.Debug.Assert(_contentStream == sender);
System\Net\Mail\SmtpReplyReaderFactory.cs (2)
309System.Diagnostics.Debug.Assert(_readState == ReadState.Status0); 394System.Diagnostics.Debug.Assert(_parent._readState == ReadState.Status0);
System\Net\Mime\SmtpDateTime.cs (1)
268Debug.Assert(dateValue.Kind == DateTimeKind.Unspecified);
System.Net.NameResolution (12)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Dns.cs (2)
456Debug.Assert(name != null); 700Debug.Assert(!Monitor.IsEntered(s_tasks));
System\Net\NameResolutionPal.Unix.cs (1)
175Debug.Assert(bytesWritten == rawAddressLength);
System\Net\NameResolutionTelemetry.cs (3)
128Debug.Assert(hostNameOrAddress is not null); 203Debug.Assert(answerValues is not null); 208Debug.Assert(exception is not null);
System.Net.NetworkInformation (11)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\IO\RowConfigReader.cs (1)
66Debug.Assert(_buffer != null);
System\Net\NetworkInformation\NetEventSource.NetworkInformation.cs (1)
24Debug.Assert(IsEnabled());
System\Net\NetworkInformation\NetworkAddressChange.Unix.cs (4)
24Debug.Assert(Monitor.IsEntered(s_gate)); 29Debug.Assert(Monitor.IsEntered(s_gate)); 152Debug.Assert(Monitor.IsEntered(s_gate)); 177Debug.Assert(Monitor.IsEntered(s_gate));
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 (5)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System.Net.Primitives (65)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\CredentialCacheKey.cs (3)
20Debug.Assert(uriPrefix != null); 21Debug.Assert(authenticationType != null); 60Debug.Assert(uri != null);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
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)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
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\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\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Cookie.cs (1)
80Debug.Assert(MaxSupportedVersion.ToString(NumberFormatInfo.InvariantInfo).Equals(MaxSupportedVersionString, StringComparison.Ordinal));
System\Net\CookieContainer.cs (4)
361Debug.Assert(m_maxCookies != 0); 362Debug.Assert(m_maxCookiesPerDomain != 0); 405Debug.Assert(cc != null); 1080Debug.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)
77Debug.Assert(IsIPv4); 82Debug.Assert(IsIPv4); 93Debug.Assert(IsIPv4 || IsIPv4MappedToIPv6); 107Debug.Assert(IsIPv6); 112Debug.Assert(IsIPv6); 159Debug.Assert(numbers.Length == NumberOfLabels); 167Debug.Assert(numbers != null); 168Debug.Assert(numbers.Length == NumberOfLabels); 355Debug.Assert(numbers is { Length: NumberOfLabels }); 395Debug.Assert(_numbers is { Length: NumberOfLabels }); 516Debug.Assert(tmpDestination.Length >= IPAddressParser.MaxIPv4StringLength); 684Debug.Assert(comparand != null); 698Debug.Assert(_numbers.Length == IPAddressParserStatics.IPv6AddressShorts); 699Debug.Assert(comparand._numbers!.Length == IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPAddressParser.cs (3)
40Debug.Assert(typeof(TChar) == typeof(byte) || typeof(TChar) == typeof(char)); 93Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 94Debug.Assert(numbersLength >= IPAddressParserStatics.IPv6AddressShorts);
System\Net\IPNetwork.cs (5)
114Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 116Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes); 209Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 238Debug.Assert(prefixLength >= 0); // Parsing with NumberStyles.None should ensure that prefixLength is always non-negative. 267Debug.Assert(bytesWritten == IPAddressParserStatics.IPv6AddressBytes);
System.Net.Quic (105)
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
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)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (31)
38Debug.Assert(initialBufferSize >= 0); 70Debug.Assert(byteCount >= 0); 112Debug.Assert(toReturn is not null); 120Debug.Assert(byteCount >= 0); 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); 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); 264Debug.Assert(_blocks[i] is null); 269Debug.Assert(_blocks[i] is not null); 274Debug.Assert(_blocks[i] is null); 307Debug.Assert(blocks is not null); 308Debug.Assert(start <= int.MaxValue); 309Debug.Assert(length <= int.MaxValue); 310Debug.Assert(start + length <= blocks.Length * BlockSize); 350Debug.Assert(_blocks is not null);
src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
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)
226Debug.Assert(IsQuicSupported); 238Debug.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\MsQuicSafeHandle.cs (1)
107Debug.Assert(_disposable is null);
System\Net\Quic\Internal\ResettableValueTaskSource.cs (1)
101Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\Internal\ThrowHelper.cs (1)
232Debug.Assert(task.IsCompleted);
System\Net\Quic\Internal\ValueTaskSource.cs (1)
84Debug.Assert(!_keepAlive.IsAllocated);
System\Net\Quic\QuicConnection.cs (3)
390Debug.Assert(host is not null); 849Debug.Assert(_connectedTcs.IsCompleted); 850Debug.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)
297Debug.Assert(task.IsCompleted);
System\Net\Quic\QuicStream.cs (3)
253Debug.Assert(!_startedTcs.IsCompleted); 537Debug.Assert(_decrementStreamCapacity is not null); 749Debug.Assert(_startedTcs.IsCompleted);
System.Net.Requests (15)
src\libraries\Common\src\System\Net\LazyAsyncResult.cs (1)
402Debug.Assert(state is LazyAsyncResult);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
System\Net\HttpWebRequest.cs (6)
1027Debug.Assert(_sendRequestCts != null); 1681Debug.Assert(settings != null); 1683Debug.Assert(fi != null); 1690Debug.Assert(handler.UseCookies); // Default of handler.UseCookies is true. 1704Debug.Assert(handler.UseProxy); // Default of handler.UseProxy is true. 1705Debug.Assert(handler.Proxy == null); // Default of handler.Proxy is null.
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\WebException.cs (1)
82Debug.Assert(exception != null);
System.Net.Security (148)
src\libraries\Common\src\Interop\Unix\System.Net.Security.Native\Interop.GssBuffer.cs (1)
74Debug.Assert(sizeof(GssBuffer) == 16);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.OpenSsl.cs (21)
109Debug.Assert((sslAuthenticationOptions.EnabledSslProtocols & FakeAlpnSslProtocol) == 0); 191Debug.Assert(handle.IsClosed); 196Debug.Assert(!handle.IsClosed); 227Debug.Assert(cipherList.IsEmpty || cipherList[^1] == 0); 230Debug.Assert(cipherSuites == null || (cipherSuites.Length >= 1 && cipherSuites[cipherSuites.Length - 1] == 0)); 264Debug.Assert(result == 1); 319Debug.Assert(sslAuthenticationOptions.CertificateContext.CertificateHandle != null); 320Debug.Assert(sslAuthenticationOptions.CertificateContext.KeyHandle != null); 369Debug.Assert(sslAuthenticationOptions.CertificateContext != null); 402Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero); 436Debug.Assert(success); 468Debug.Assert(certList != null); 782Debug.Assert(ssl != IntPtr.Zero); 783Debug.Assert(session != IntPtr.Zero); 796Debug.Assert(name != IntPtr.Zero); 815Debug.Assert(ctx != IntPtr.Zero && session != IntPtr.Zero); 832Debug.Assert(name != IntPtr.Zero); 845Debug.Assert(count >= 0); 846Debug.Assert(buffer.Length >= count); 896Debug.Assert(certPtr != null && !certPtr.IsInvalid); 897Debug.Assert(keyPtr != null && !keyPtr.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Ssl.cs (1)
273Debug.Assert(stapledResponse.Length > 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.SslCtx.cs (10)
147Debug.Assert(_gch.IsAllocated); 159Debug.Assert(_sslSessions == null); 163Debug.Assert(_gch.IsAllocated); 170Debug.Assert(_sslSessions != null && session != IntPtr.Zero); 178Debug.Assert(targetName != null); 196Debug.Assert(added); 220Debug.Assert(_sslSessions != null); 223Debug.Assert(targetName != null); 249Debug.Assert(_sslSessions != null); 258Debug.Assert(Interop.Ssl.SslGetData(sslHandle) == IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
31Debug.Assert(task.IsCompletedSuccessfully);
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)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SafeHandleCache.cs (3)
94Debug.Assert(handle.IsClosed); 141Debug.Assert(removed); 145Debug.Assert(handle.IsClosed);
src\libraries\Common\src\System\Net\Security\MD4.cs (2)
65Debug.Assert(destination.Length == 128 >> 3); 83Debug.Assert(padLen is >= 0 and <= 120);
src\libraries\Common\src\System\Net\Security\RC4.cs (2)
78Debug.Assert(input.Length == output.Length); 79Debug.Assert(state != null);
src\libraries\Common\src\System\Net\Security\SslKeyLogger.cs (3)
46Debug.Assert(s_fileStream != null); 71Debug.Assert(s_fileStream != null); 72Debug.Assert(!clientRandom.IsEmpty);
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\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
System\Net\CertificateValidationPal.Unix.cs (2)
124Debug.Assert(session != IntPtr.Zero); 182Debug.Assert(storeLocation == StoreLocation.CurrentUser);
System\Net\NegotiateAuthenticationPal.ManagedNtlm.cs (18)
233Debug.Assert(clientOptions.Package == NegotiationInfoClass.NTLM); 271Debug.Assert(incomingBlob.IsEmpty); 287Debug.Assert(!incomingBlob.IsEmpty); 297Debug.Assert(HeaderLength == NtlmHeader.Length); 298Debug.Assert(asBytes.Length == sizeof(NegotiateMessage)); 384Debug.Assert(written == HMACMD5.HashSizeInBytes); 400Debug.Assert(serverChallenge.Length == ChallengeLength); 401Debug.Assert(clientChallenge.Length == ChallengeLength); 402Debug.Assert(ntlm2hash.Length == DigestLength); 448Debug.Assert(written == MD5.HashSizeInBytes); 524Debug.Assert(bytesWritten == spnSize); 650Debug.Assert(payloadOffset == sizeof(AuthenticateMessage) + ChallengeResponseLength + sizeof(NtChallengeResponse) + targetInfoBuffer.Length); 661Debug.Assert(flags.HasFlag(Flags.NegotiateSign) && flags.HasFlag(Flags.NegotiateKeyExchange)); 666Debug.Assert(sessionKeyWritten == HMACMD5.HashSizeInBytes); 678Debug.Assert(_negotiateMessage != null); 697Debug.Assert(payloadOffset == responseBytes.Length); 753Debug.Assert(_clientSeal is not null); 754Debug.Assert(_clientSigningKey is not null);
System\Net\NegotiateAuthenticationPal.ManagedSpnego.cs (1)
83Debug.Assert(clientOptions.Package == NegotiationInfoClass.Negotiate);
System\Net\NegotiateAuthenticationPal.Unix.cs (7)
136Debug.Assert(_securityContext is not null); 334Debug.Assert(_securityContext is not null); 365Debug.Assert(_securityContext is not null); 393Debug.Assert(_securityContext is not null); 424Debug.Assert(_securityContext is not null); 450Debug.Assert(_securityContext is not null); 593Debug.Assert(appDataOffset < channelBinding.Size);
System\Net\Security\NegotiateAuthentication.cs (1)
406Debug.Assert(_extendedProtectionPolicy != null);
System\Net\Security\NegotiateStream.cs (7)
341Debug.Assert(_context is not null); 506Debug.Assert(_context is not null); 507Debug.Assert(_writeBuffer is not null); 724Debug.Assert(_context != null); 753Debug.Assert(_context != null); 862Debug.Assert(_framer != null); 888Debug.Assert(_context != null);
System\Net\Security\NetSecurityTelemetry.cs (4)
148Debug.Assert(sizeof(SslProtocols) == 4); 249Debug.Assert(count >= 0); 252Debug.Assert(count >= 0); 340Debug.Assert(protocolVersion is not null);
System\Net\Security\Pal.Managed\SafeChannelBindingHandle.cs (2)
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\SslStream.cs (2)
88Debug.Assert(length <= DecryptedLength); 775Debug.Assert(bytesRead == 0 || bytesRead == 1);
System\Net\Security\SslStream.IO.cs (5)
301Debug.Assert(consumed == (reAuthenticationData?.Length ?? 0)); 305Debug.Assert(token.Payload != null); 854Debug.Assert(_buffer.EncryptedLength == 0); 859Debug.Assert(_buffer.DecryptedLength == 0); 999Debug.Assert(_buffer.DecryptedLength > 0);
System\Net\Security\SslStream.Protocol.cs (6)
280Debug.Assert(certificate != null); 742Debug.Assert(_sslAuthenticationOptions.CertificateContext != null); 966Debug.Assert(_securityContext != null); 988Debug.Assert(_maxDataSize > 0); 1365Debug.Assert(Payload == null); 1402Debug.Assert(Payload != null || Size == 0);
System\Net\Security\SslStreamCertificateContext.Linux.cs (8)
261Debug.Assert(_rootCertificate != null); 264Debug.Assert(_ocspUrls is not null); 265Debug.Assert(_ocspUrls.Count > 0); 266Debug.Assert(caCert is not null); 270Debug.Assert(subject != 0); 271Debug.Assert(issuer != 0); 379Debug.Assert(baseUri.Length > 0); 380Debug.Assert(encodedRequest.Count > 0);
System\Net\Security\SslStreamPal.Unix.cs (1)
193Debug.Assert(sslAuthenticationOptions.IsClient);
System\Net\Security\TlsFrameHelper.cs (1)
237Debug.Assert(gotHeader);
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 (17)
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 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(maxByteCount <= buffer.Length);
System\Net\ServerSentEvents\SseFormatter.cs (4)
101Debug.Assert(bufferWriter.WrittenCount is 0); 105Debug.Assert(!eventType.ContainsLineBreaks()); 117Debug.Assert(!eventId.ContainsLineBreaks()); 126Debug.Assert(retry >= TimeSpan.Zero);
System.Net.Sockets (105)
src\libraries\Common\src\System\Net\IPEndPointExtensions.cs (1)
46Debug.Assert(written == IPAddressParserStatics.IPv6AddressBytes);
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\SocketAddressExtensions.cs (1)
14Debug.Assert(socketAddress.Family == AddressFamily.InterNetwork || socketAddress.Family == AddressFamily.InterNetworkV6);
src\libraries\Common\src\System\Net\SocketAddressPal.Unix.cs (4)
28Debug.Assert(ipv4 > 0); 29Debug.Assert(ipv6 > 0); 30Debug.Assert(uds > 0); 31Debug.Assert(max >= ipv4 && max >= ipv6 && max >= uds);
System\Net\Sockets\SafeSocketHandle.cs (1)
173Debug.Assert(!IsClosed);
System\Net\Sockets\Socket.cs (10)
89Debug.Assert(_handle.IsInvalid); 95Debug.Assert(!_handle.IsInvalid); 139Debug.Assert(SocketPal.MaximumAddressSize <= 512); 151Debug.Assert(bufferLength <= buffer.Length); 1079Debug.Assert(acceptedSocketHandle.IsInvalid); 1090Debug.Assert(!acceptedSocketHandle.IsInvalid); 3783Debug.Assert(fd != null && !fd.IsInvalid); 3841Debug.Assert(_nonBlockingConnectInProgress == false); 4060Debug.Assert(t.IsCanceled || t.IsFaulted); 4067Debug.Assert(t.Exception != null);
System\Net\Sockets\Socket.Tasks.cs (14)
65Debug.Assert(saea.BufferList is null); 66Debug.Assert(saea.AcceptSocket is null); 113Debug.Assert(cancellationToken.CanBeCanceled); 206Debug.Assert(endPoint.Port == port); 218Debug.Assert(lastException != null); 323Debug.Assert(saea.BufferList == null); 413Debug.Assert(saea.BufferList == null); 453Debug.Assert(saea.BufferList == null); 514Debug.Assert(saea.BufferList == null); 569Debug.Assert(saea.BufferList == null); 587Debug.Assert(saea.BufferList == null); 677Debug.Assert(saea.BufferList == null); 707Debug.Assert(saea.BufferList == null); 805Debug.Assert(index == packetsCount);
System\Net\Sockets\Socket.Unix.cs (2)
58Debug.Assert(!_handle.LastConnectFailed); 112Debug.Assert(rv == 0 || blocking); // ignore failures
System\Net\Sockets\SocketAsyncContext.Unix.cs (24)
246Debug.Assert(_state == State.Canceled); 285Debug.Assert(Event == null); 471Debug.Assert(SocketAddress.Length == 0); 716Debug.Assert(lockObject != null); 720Debug.Assert(!Monitor.IsEntered(_lockObject)); 732Debug.Assert(Monitor.IsEntered(_lockObject)); 798Debug.Assert(_queueLock == null); 817Debug.Assert(sizeof(QueueState) == sizeof(int)); 873Debug.Assert(!_isNextOperationSynchronous); 896Debug.Assert(_tail == null); 923Debug.Assert(error != Interop.Error.SUCCESS); 965Debug.Assert(_isNextOperationSynchronous == (op.Event != null)); 984Debug.Assert(_tail == null); 1004Debug.Assert(!skipAsyncEvents); 1040Debug.Assert(_tail == null); 1068Debug.Assert(_tail == null); 1100Debug.Assert(_tail == null); 1128Debug.Assert(result != OperationResult.Pending); 1135Debug.Assert(op.Event != null); 1144Debug.Assert(_tail == null); 1218Debug.Assert(_state != QueueState.Stopped); 1224Debug.Assert(_state != QueueState.Stopped); 1288Debug.Assert(_isHandleNonBlocking); 2252Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketAsyncEngine.Unix.cs (8)
126Debug.Assert(context.GlobalContextIndex == -1); 145Debug.Assert(s_registeredContexts[index] is null); 164Debug.Assert(context.GlobalContextIndex >= 0); 165Debug.Assert(ReferenceEquals(s_registeredContexts[context.GlobalContextIndex], context)); 268Debug.Assert(stageBeforeUpdate != EventQueueProcessingStage.NotScheduled); 284Debug.Assert(_eventQueueProcessingStage == EventQueueProcessingStage.Scheduled); 307Debug.Assert(stageBeforeUpdate != EventQueueProcessingStage.NotScheduled); 371Debug.Assert((uint)socketEvent.Data < (uint)s_registeredContexts.Length);
System\Net\Sockets\SocketAsyncEventArgs.cs (4)
124Debug.Assert(success); 682Debug.Assert(endPoint.AddressFamily == AddressFamily.Unspecified || 767Debug.Assert(existing.Port == port); 1034Debug.Assert(socketError != SocketError.IOPending);
System\Net\Sockets\SocketAsyncEventArgs.Unix.cs (3)
189Debug.Assert(socketAddress.Length == socketAddressSize); 246Debug.Assert(_sendPacketsElements != null); 333Debug.Assert(NetEventSource.Log.IsEnabled());
System\Net\Sockets\SocketPal.Unix.cs (22)
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); 782Debug.Assert(flags == SocketFlags.None); 841Debug.Assert(flags == SocketFlags.None); 842Debug.Assert(buffers == null); 980Debug.Assert(flags == SocketFlags.None); 981Debug.Assert(buffers == null); 1686Debug.Assert((uint)optionLength <= optionValue.Length); 1881Debug.Assert(refsAdded == 0); 1894Debug.Assert(buffer.Length == socketList.Count); 1989Debug.Assert(refsAdded == 0); 2088Debug.Assert(elements.Length == fileHandles.Length);
System\Net\Sockets\SocketsTelemetry.cs (5)
148Debug.Assert(newCount >= 0); 163Debug.Assert(exceptionMessage is null); 197Debug.Assert(exceptionMessage is null); 211Debug.Assert(count >= 0); 218Debug.Assert(count >= 0);
System\Net\Sockets\TCPClient.cs (1)
373Debug.Assert(_clientSocket == null);
System\Net\Sockets\TCPListener.cs (1)
285Debug.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.WebClient (19)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
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\libraries\Common\src\System\IO\DelegatingStream.cs (1)
65Debug.Assert(innerStream != null);
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\libraries\Common\src\System\Threading\Tasks\RendezvousAwaitable.cs (8)
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 (3)
516Debug.Assert(conversionStatus == OperationStatus.Done); 872Debug.Assert(asyncOp != null); 1009Debug.Assert(asyncOp != null);
System.Net.WebHeaderCollection (1)
System\Net\HeaderInfoTable.cs (1)
142Debug.Assert(headers.Count == Items);
System.Net.WebProxy (1)
System\Net\WebProxy.cs (1)
180Debug.Assert(formatted);
System.Net.WebSockets (54)
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.Associate.cs (1)
35Debug.Assert(IsEnabled());
src\libraries\Common\src\System\Net\Logging\NetEventSource.Common.cs (2)
80Debug.Assert(IsEnabled()); 105Debug.Assert(IsEnabled());
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 (8)
60Debug.Assert(consumed == payload.Length); 95Debug.Assert(written == output.Length); 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 (5)
74Debug.Assert(_available > 0); 98Debug.Assert(_available == 0); 166Debug.Assert(_stream is not null && _stream.AvailIn == 0); 167Debug.Assert(_available == 0); 230Debug.Assert(destination.Length > 0);
System\Net\WebSockets\ManagedWebSocket.cs (6)
437Debug.Assert(_sentCloseFrame); 658Debug.Assert(_sendBuffer != null); 919Debug.Assert(_inflater is not null); 929Debug.Assert(receiveBufferBytesToCopy > 0); 1626Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up 1665Debug.Assert(maskIndex < sizeof(int));
System\Net\WebSockets\ManagedWebSocket.KeepAlive.cs (6)
38Debug.Assert((opcode is MessageOpcode.Pong) || (!IsUnsolicitedPongKeepAlive && opcode is MessageOpcode.Ping)); 53Debug.Assert(_keepAlivePingState != null); 115Debug.Assert(_keepAlivePingState != null); 162Debug.Assert(task.IsFaulted); 236Debug.Assert(Monitor.IsEntered(StateUpdateLock)); 253Debug.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 (13)
System\Net\WebSockets\ClientWebSocket.cs (4)
49Debug.Assert(_state == InternalState.Disposed); 140Debug.Assert(_state == InternalState.Disposed); 177Debug.Assert(_innerWebSocket != null); 178Debug.Assert(_innerWebSocket.WebSocket != null);
System\Net\WebSockets\WebSocketHandle.Managed.cs (9)
152Debug.Assert(subprotocolEnumerableValues is string[]); 194Debug.Assert(connectedStream.CanWrite); 195Debug.Assert(connectedStream.CanRead); 301Debug.Assert(handler.SslOptions.ClientCertificates == null); 440Debug.Assert(builder.Length <= ClientWebSocketDeflateConstants.MaxExtensionLength); 449Debug.Assert(response.Version == HttpVersion.Version11 || response.Version == HttpVersion.Version20); 458Debug.Assert(secValue != null); 494Debug.Assert(success); 503Debug.Assert(bytesWritten == 20 /* SHA1 hash length */);
System.Numerics.Tensors (340)
System\NIndex.cs (1)
180Debug.Assert(formatted);
System\NRange.cs (2)
75Debug.Assert(formatted); 86Debug.Assert(formatted);
System\Numerics\Tensors\netcore\Common\TensorPrimitives.IAggregationOperator.cs (54)
162Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 344Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 526Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 684Debug.Assert(sizeof(T) == 8); 692Debug.Assert(sizeof(T) == 1); 730Debug.Assert(Vector256.IsHardwareAccelerated); 744Debug.Assert(Vector256.IsHardwareAccelerated); 769Debug.Assert(Vector128.IsHardwareAccelerated); 783Debug.Assert(Vector128.IsHardwareAccelerated); 863Debug.Assert(sizeof(T) == 2); 885Debug.Assert(Vector256.IsHardwareAccelerated); 899Debug.Assert(Vector256.IsHardwareAccelerated); 916Debug.Assert(Vector128.IsHardwareAccelerated); 930Debug.Assert(Vector128.IsHardwareAccelerated); 978Debug.Assert(sizeof(T) == 4); 991Debug.Assert(Vector256.IsHardwareAccelerated); 1004Debug.Assert(Vector256.IsHardwareAccelerated); 1016Debug.Assert(Vector128.IsHardwareAccelerated); 1029Debug.Assert(Vector128.IsHardwareAccelerated); 1067Debug.Assert(sizeof(T) == 8); 1076Debug.Assert(Vector256.IsHardwareAccelerated); 1089Debug.Assert(Vector256.IsHardwareAccelerated); 1099Debug.Assert(Vector128.IsHardwareAccelerated); 1112Debug.Assert(Vector128.IsHardwareAccelerated); 1288Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector128<T>)) == 0); 1495Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector256<T>)) == 0); 1702Debug.Assert(((nuint)xPtr % (uint)sizeof(Vector512<T>)) == 0); 1880Debug.Assert(sizeof(T) == 8); 1888Debug.Assert(sizeof(T) == 1); 1926Debug.Assert(Vector256.IsHardwareAccelerated); 1942Debug.Assert(Vector256.IsHardwareAccelerated); 1968Debug.Assert(Vector128.IsHardwareAccelerated); 1984Debug.Assert(Vector128.IsHardwareAccelerated); 2065Debug.Assert(sizeof(T) == 2); 2087Debug.Assert(Vector256.IsHardwareAccelerated); 2103Debug.Assert(Vector256.IsHardwareAccelerated); 2121Debug.Assert(Vector128.IsHardwareAccelerated); 2137Debug.Assert(Vector128.IsHardwareAccelerated); 2186Debug.Assert(sizeof(T) == 4); 2199Debug.Assert(Vector256.IsHardwareAccelerated); 2214Debug.Assert(Vector256.IsHardwareAccelerated); 2227Debug.Assert(Vector128.IsHardwareAccelerated); 2242Debug.Assert(Vector128.IsHardwareAccelerated); 2283Debug.Assert(sizeof(T) == 8); 2292Debug.Assert(Vector256.IsHardwareAccelerated); 2307Debug.Assert(Vector256.IsHardwareAccelerated); 2318Debug.Assert(Vector128.IsHardwareAccelerated); 2333Debug.Assert(Vector128.IsHardwareAccelerated); 2386Debug.Assert(sizeof(T) == 8); 2422Debug.Assert(sizeof(T) == 8); 2458Debug.Assert(sizeof(T) == 8); 2494Debug.Assert(sizeof(T) == 8); 2530Debug.Assert(sizeof(T) == 8); 2566Debug.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.IIndexOfOperator.cs (1)
75Debug.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)
180Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 453Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 726Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 967Debug.Assert(sizeof(T) == 8); 975Debug.Assert(sizeof(T) == 1); 1012Debug.Assert(Vector256.IsHardwareAccelerated); 1030Debug.Assert(Vector256.IsHardwareAccelerated); 1057Debug.Assert(Vector128.IsHardwareAccelerated); 1075Debug.Assert(Vector128.IsHardwareAccelerated); 1183Debug.Assert(sizeof(T) == 2); 1204Debug.Assert(Vector256.IsHardwareAccelerated); 1222Debug.Assert(Vector256.IsHardwareAccelerated); 1241Debug.Assert(Vector128.IsHardwareAccelerated); 1259Debug.Assert(Vector128.IsHardwareAccelerated); 1319Debug.Assert(sizeof(T) == 4); 1331Debug.Assert(Vector256.IsHardwareAccelerated); 1348Debug.Assert(Vector256.IsHardwareAccelerated); 1362Debug.Assert(Vector128.IsHardwareAccelerated); 1379Debug.Assert(Vector128.IsHardwareAccelerated); 1421Debug.Assert(sizeof(T) == 8); 1429Debug.Assert(Vector256.IsHardwareAccelerated); 1446Debug.Assert(Vector256.IsHardwareAccelerated); 1458Debug.Assert(Vector128.IsHardwareAccelerated); 1475Debug.Assert(Vector128.IsHardwareAccelerated); 1654Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 1923Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 2192Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 2430Debug.Assert(sizeof(T) == 8); 2438Debug.Assert(sizeof(T) == 1); 2475Debug.Assert(Vector256.IsHardwareAccelerated); 2495Debug.Assert(Vector256.IsHardwareAccelerated); 2522Debug.Assert(Vector128.IsHardwareAccelerated); 2542Debug.Assert(Vector128.IsHardwareAccelerated); 2650Debug.Assert(sizeof(T) == 2); 2671Debug.Assert(Vector256.IsHardwareAccelerated); 2691Debug.Assert(Vector256.IsHardwareAccelerated); 2710Debug.Assert(Vector128.IsHardwareAccelerated); 2730Debug.Assert(Vector128.IsHardwareAccelerated); 2790Debug.Assert(sizeof(T) == 4); 2802Debug.Assert(Vector256.IsHardwareAccelerated); 2821Debug.Assert(Vector256.IsHardwareAccelerated); 2835Debug.Assert(Vector128.IsHardwareAccelerated); 2854Debug.Assert(Vector128.IsHardwareAccelerated); 2896Debug.Assert(sizeof(T) == 8); 2904Debug.Assert(Vector256.IsHardwareAccelerated); 2923Debug.Assert(Vector256.IsHardwareAccelerated); 2935Debug.Assert(Vector128.IsHardwareAccelerated); 2954Debug.Assert(Vector128.IsHardwareAccelerated); 3133Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector128<T>)) == 0); 3402Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector256<T>)) == 0); 3671Debug.Assert(((nuint)dPtr % (uint)sizeof(Vector512<T>)) == 0); 3909Debug.Assert(sizeof(T) == 8); 3917Debug.Assert(sizeof(T) == 1); 3954Debug.Assert(Vector256.IsHardwareAccelerated); 3974Debug.Assert(Vector256.IsHardwareAccelerated); 4001Debug.Assert(Vector128.IsHardwareAccelerated); 4021Debug.Assert(Vector128.IsHardwareAccelerated); 4129Debug.Assert(sizeof(T) == 2); 4150Debug.Assert(Vector256.IsHardwareAccelerated); 4170Debug.Assert(Vector256.IsHardwareAccelerated); 4189Debug.Assert(Vector128.IsHardwareAccelerated); 4209Debug.Assert(Vector128.IsHardwareAccelerated); 4269Debug.Assert(sizeof(T) == 4); 4281Debug.Assert(Vector256.IsHardwareAccelerated); 4300Debug.Assert(Vector256.IsHardwareAccelerated); 4314Debug.Assert(Vector128.IsHardwareAccelerated); 4333Debug.Assert(Vector128.IsHardwareAccelerated); 4375Debug.Assert(sizeof(T) == 8); 4383Debug.Assert(Vector256.IsHardwareAccelerated); 4402Debug.Assert(Vector256.IsHardwareAccelerated); 4414Debug.Assert(Vector128.IsHardwareAccelerated); 4433Debug.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\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)
39Debug.Assert(typeof(T) == typeof(double)); 52Debug.Assert(typeof(T) == typeof(double)); 65Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Cos.cs (3)
77Debug.Assert(typeof(T) == typeof(float)); 102Debug.Assert(typeof(T) == typeof(float)); 127Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Cosh.cs (3)
85Debug.Assert(typeof(T) == typeof(double)); 106Debug.Assert(typeof(T) == typeof(double)); 127Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.CosPi.cs (3)
54Debug.Assert(typeof(T) == typeof(double)); 77Debug.Assert(typeof(T) == typeof(double)); 100Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.DegreesToRadians.cs (3)
41Debug.Assert(typeof(T) == typeof(float)); 58Debug.Assert(typeof(T) == typeof(float)); 75Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Exp.cs (3)
51Debug.Assert(typeof(T) == typeof(float)); 76Debug.Assert(typeof(T) == typeof(float)); 101Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Floor.cs (3)
39Debug.Assert(typeof(T) == typeof(double)); 52Debug.Assert(typeof(T) == typeof(double)); 65Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.FusedMultiplyAdd.cs (3)
110Debug.Assert(typeof(T) == typeof(float)); 163Debug.Assert(typeof(T) == typeof(float)); 188Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Hypot.cs (3)
45Debug.Assert(typeof(T) == typeof(float)); 62Debug.Assert(typeof(T) == typeof(float)); 79Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.IndexOfMax.cs (3)
150Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 241Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8); 332Debug.Assert(sizeof(T) is 1 or 2 or 4 or 8);
System\Numerics\Tensors\netcore\TensorPrimitives.LeadingZeroCount.cs (2)
80Debug.Assert(AdvSimd.IsSupported); 85Debug.Assert(sizeof(T) == 4);
System\Numerics\Tensors\netcore\TensorPrimitives.Lerp.cs (3)
89Debug.Assert(typeof(T) == typeof(float)); 106Debug.Assert(typeof(T) == typeof(float)); 123Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log.cs (3)
93Debug.Assert(typeof(T) == typeof(float)); 118Debug.Assert(typeof(T) == typeof(float)); 143Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Log2.cs (3)
53Debug.Assert(typeof(T) == typeof(float)); 78Debug.Assert(typeof(T) == typeof(float)); 103Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.MultiplyAddEstimate.cs (3)
133Debug.Assert(typeof(T) == typeof(float)); 167Debug.Assert(typeof(T) == typeof(float)); 191Debug.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)
41Debug.Assert(typeof(T) == typeof(float)); 58Debug.Assert(typeof(T) == typeof(float)); 75Debug.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 (8)
113Debug.Assert(typeof(T) == typeof(double)); 188Debug.Assert(typeof(T) == typeof(float)); 207Debug.Assert(typeof(T) == typeof(float)); 226Debug.Assert(typeof(T) == typeof(float)); 262Debug.Assert(typeof(T) == typeof(double)); 275Debug.Assert(typeof(T) == typeof(double)); 288Debug.Assert(typeof(T) == typeof(double)); 303Debug.Assert(typeof(T) == typeof(float) || typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Sin.cs (3)
67Debug.Assert(typeof(T) == typeof(float)); 92Debug.Assert(typeof(T) == typeof(float)); 117Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorPrimitives.Sinh.cs (3)
69Debug.Assert(typeof(T) == typeof(double)); 94Debug.Assert(typeof(T) == typeof(double)); 119Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.SinPi.cs (3)
54Debug.Assert(typeof(T) == typeof(double)); 77Debug.Assert(typeof(T) == typeof(double)); 100Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.Tan.cs (3)
69Debug.Assert(typeof(T) == typeof(double)); 82Debug.Assert(typeof(T) == typeof(double)); 95Debug.Assert(typeof(T) == typeof(double));
System\Numerics\Tensors\netcore\TensorPrimitives.TrailingZeroCount.cs (1)
44Debug.Assert(PopCountOperator<T>.Vectorizable);
System\Numerics\Tensors\netcore\TensorPrimitives.Truncate.cs (3)
42Debug.Assert(typeof(T) == typeof(float)); 78Debug.Assert(typeof(T) == typeof(float)); 112Debug.Assert(typeof(T) == typeof(float));
System\Numerics\Tensors\netcore\TensorSpanHelpers.cs (7)
93Debug.Assert(strides.Length == indexes.Length); 108Debug.Assert(strides.Length == lengths.Length); 127Debug.Assert(array.Rank == indexes.Length || indexes.Length == 0); 151Debug.Assert(array.Rank == indexes.Length || indexes.Length == 0); 177Debug.Assert(strides.Length == indexes.Length); 277Debug.Assert(array is not null); 278Debug.Assert(array.Rank == lengths.Length);
System\Numerics\Tensors\TensorPrimitives.Helpers.cs (2)
36Debug.Assert(sizeof(TFrom) == sizeof(TTo)); 52Debug.Assert(sizeof(TFrom) == sizeof(TTo));
System.ObjectModel (3)
System\Collections\ObjectModel\KeyedCollection.cs (1)
51Debug.Assert(base.Items is List<TItem>);
System\Collections\ObjectModel\ObservableCollection.cs (1)
307Debug.Assert(collection != null);
System\Collections\Specialized\NotifyCollectionChangedEventArgs.cs (1)
282Debug.Assert(list != null);
System.Private.CoreLib (2809)
src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (1)
697Debug.Assert(false);
src\libraries\Common\src\Interop\Interop.ICU.cs (2)
17Debug.Assert(icuuc != IntPtr.Zero); 18Debug.Assert(icuin != IntPtr.Zero);
src\libraries\Common\src\Interop\Linux\procfs\Interop.ProcFsStat.TryReadStatusFile.cs (1)
126Debug.Assert(valueParsed);
src\libraries\Common\src\Interop\Unix\Interop.IOErrors.cs (1)
13Debug.Assert(errorInfo.Error != Error.SUCCESS);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetUnixVersion.cs (1)
39Debug.Assert(Array.IndexOf<byte>(version, 0) != -1);
src\libraries\Common\src\Interop\Unix\System.Native\Interop.ReadDir.cs (1)
38Debug.Assert(buffer.Length >= Encoding.UTF8.GetMaxCharCount(NameBufferSize - 1 - 1));
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\libraries\Common\src\System\Collections\Generic\BitHelper.cs (2)
24Debug.Assert(bitPosition >= 0); 38Debug.Assert(bitPosition >= 0);
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
src\libraries\Common\src\System\HexConverter.cs (7)
99Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported); 115Debug.Assert(bytes.Length >= Vector128<int>.Count); 166Debug.Assert(chars.Length >= bytes.Length * 2); 246Debug.Assert(Ssse3.IsSupported || AdvSimd.Arm64.IsSupported); 247Debug.Assert(chars.Length <= bytes.Length * 2); 248Debug.Assert(chars.Length % 2 == 0); 249Debug.Assert(chars.Length >= Vector128<ushort>.Count * 2);
src\libraries\Common\src\System\IO\PathInternal.cs (1)
124Debug.Assert(rootLength > 0);
src\libraries\Common\src\System\IO\PathInternal.Unix.cs (1)
31Debug.Assert(DirectorySeparatorChar == AltDirectorySeparatorChar);
src\libraries\Common\src\System\IO\Win32Marshal.cs (1)
29Debug.Assert(errorCode != Interop.Errors.ERROR_SUCCESS);
src\libraries\Common\src\System\Number.Formatting.Common.cs (11)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
37Debug.Assert(digits != null); 45Debug.Assert(!digits.IsEmpty); 65Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint));
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
16Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\Common\src\System\Threading\Tasks\TaskToAsyncResult.cs (1)
138Debug.Assert(task is not null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.ThreadPoolValueTaskSource.cs (3)
82Debug.Assert(_operation >= Operation.Read && _operation <= Operation.WriteGather); 105Debug.Assert(_readScatterBuffers != null); 109Debug.Assert(_writeGatherBuffers != null);
src\libraries\System.Private.CoreLib\src\Microsoft\Win32\SafeHandles\SafeFileHandle.Unix.cs (9)
74Debug.Assert(value == false); // We should only use the setter to disable random access. 95Debug.Assert(path != null); 140Debug.Assert(_path is not null); 180Debug.Assert(fileLength >= 0); 347Debug.Assert(Interop.Sys.LSeek(this, 0, Interop.Sys.SeekWhence.SEEK_CUR) >= 0); 452Debug.Assert(mode == FileMode.Create || mode == FileMode.CreateNew); 467Debug.Assert(lockOperation == Interop.Sys.LockOperations.LOCK_EX || lockOperation == Interop.Sys.LockOperations.LOCK_SH); 515Debug.Assert(!IsClosed); 516Debug.Assert(!IsInvalid);
src\libraries\System.Private.CoreLib\src\System\AggregateException.cs (1)
175Debug.Assert(_innerExceptions[i] != null);
src\libraries\System.Private.CoreLib\src\System\AppContext.AnyOS.cs (1)
72Debug.Assert(s_dataStore is not null);
src\libraries\System.Private.CoreLib\src\System\AppDomain.cs (1)
411Debug.Assert(mi != null);
src\libraries\System.Private.CoreLib\src\System\Array.cs (10)
69Debug.Assert(array != null); 612Debug.Assert(low <= hi); 2317Debug.Assert(hi >= lo); 2318Debug.Assert(depthLimit >= 0); 2325Debug.Assert(partitionSize >= 2); 2360Debug.Assert(hi - lo >= IntrosortSizeThreshold); 2534Debug.Assert(hi >= lo); 2535Debug.Assert(depthLimit >= 0); 2542Debug.Assert(partitionSize >= 2); 2577Debug.Assert(hi - lo >= IntrosortSizeThreshold);
src\libraries\System.Private.CoreLib\src\System\Array.Enumerators.cs (1)
116Debug.Assert(array == null || endIndex == array.Length);
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\libraries\System.Private.CoreLib\src\System\Attribute.cs (1)
116Debug.Assert(thisValueArray.Rank == 1 && thatValueArray.Rank == 1);
src\libraries\System.Private.CoreLib\src\System\Buffer.cs (1)
190Debug.Assert(byteCount > BulkMoveWithWriteBarrierChunk);
src\libraries\System.Private.CoreLib\src\System\Buffers\StandardFormat.cs (1)
160Debug.Assert(destination.Length == FormatStringLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Helper\Base64DecoderHelper.cs (6)
112Debug.Assert(destLength < (int.MaxValue / 4 * 3)); 167Debug.Assert(typeof(TBase64Decoder) == typeof(Base64DecoderByte) ? remaining == 4 : remaining < 8); 609Debug.Assert(source.Length == sourceIndex); 828Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian); 993Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian); 1178Debug.Assert(value >= 0 && value <= ushort.MaxValue);
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); 346Debug.Assert(status == OperationStatus.InvalidData);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Base64Url\Base64UrlEncoder.cs (4)
76Debug.Assert(status == OperationStatus.DestinationTooSmall); 90Debug.Assert(destination.Length == bytesWritten); 127Debug.Assert(status == OperationStatus.DestinationTooSmall); 141Debug.Assert(destination.Length == charsWritten);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((elementOffset + 1) <= powersOf10.Length);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.Int128.cs (2)
36Debug.Assert(value.Upper == 0); 46Debug.Assert(digits == 21);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Formatter\Utf8Formatter.Date.cs (1)
108Debug.Assert(bytesWritten == DateTimeFormat.FormatRLength);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.cs (1)
83Debug.Assert(kind == DateTimeKind.Unspecified);
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. 146Debug.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\libraries\System.Private.CoreLib\src\System\Buffers\Text\Utf8Parser\Utf8Parser.Date.O.cs (1)
227Debug.Assert(offsetChar == Utf8Constants.Plus || offsetChar == Utf8Constants.Minus);
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\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\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\libraries\System.Private.CoreLib\src\System\Buffers\Utilities.cs (1)
27Debug.Assert(maxSize >= 0);
src\libraries\System.Private.CoreLib\src\System\Char.cs (1)
362Debug.Assert(IsLatin1(c));
src\libraries\System.Private.CoreLib\src\System\Collections\Concurrent\ConcurrentQueue.cs (19)
240Debug.Assert(count == i); 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); 719Debug.Assert(head._frozenForEnqueues); 782Debug.Assert(next == s._nextSegment);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ArraySortHelper.cs (40)
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); 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));
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (27)
129Debug.Assert(source._entries is not null); 130Debug.Assert(_entries is not null); 131Debug.Assert(_entries.Length >= source.Count); 132Debug.Assert(_count == 0); 244Debug.Assert(modified); 251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown. 444Debug.Assert(comparer is not null); 519Debug.Assert(_buckets != null); 525Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 567Debug.Assert(comparer is not null); 695Debug.Assert(dictionary is not null); 696Debug.Assert(IsCompatibleKey(dictionary)); 730Debug.Assert(dictionary is not null); 738Debug.Assert(IsCompatibleKey(dictionary)); 781Debug.Assert(actualKey is not null); 970Debug.Assert(dictionary._buckets != null); 981Debug.Assert(comparer is not null); 1084Debug.Assert(dictionary._buckets != null); 1090Debug.Assert(comparer is not null || typeof(TKey).IsValueType); 1123Debug.Assert(comparer is not null); 1250Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType); 1252Debug.Assert(newSize >= _entries.Length); 1261Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1308Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1381Debug.Assert(typeof(TKey).IsValueType || comparer is not null); 1602Debug.Assert(oldEntries is not null); 1609Debug.Assert(_entries is not null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (15)
187Debug.Assert(Count == source.Count); 255Debug.Assert(comparer is not null); 303Debug.Assert(typeof(T).IsValueType || comparer is not null); 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); 472Debug.Assert(comparer is not null); 1289Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType); 1291Debug.Assert(newSize >= _entries.Length); 1300Debug.Assert(_comparer is NonRandomizedStringEqualityComparer); 1417Debug.Assert(_buckets != null); 1456Debug.Assert(comparer is not null); 1517Debug.Assert(location >= 0);
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\libraries\System.Private.CoreLib\src\System\Collections\Generic\NonRandomizedStringEqualityComparer.cs (1)
31Debug.Assert(underlyingComparer != null);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Queue.cs (4)
312Debug.Assert(capacity >= _size); 349Debug.Assert(_size == 0); 397Debug.Assert(_array.Length < capacity); 495Debug.Assert(_index == -1 || _index == -2);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
103Debug.Assert(divisor <= int.MaxValue); 109Debug.Assert(highbits == value % divisor);
src\libraries\System.Private.CoreLib\src\System\Collections\Hashtable.cs (7)
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); 940Debug.Assert(hashcode >= 0); // make sure collision bit (sign bit) wasn't set.
src\libraries\System.Private.CoreLib\src\System\ComAwareWeakReference.cs (5)
64Debug.Assert(pComWeakRef != IntPtr.Zero); 80Debug.Assert(weakHandle != 0); 152Debug.Assert((taggedHandle & ComAwareBit) != 0); 158Debug.Assert((taggedHandle & ComAwareBit) != 0); 175Debug.Assert((taggedHandle & ComAwareBit) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.Base64.cs (1)
153Debug.Assert((consumed % 4) == 0);
src\libraries\System.Private.CoreLib\src\System\Convert.cs (14)
2422Debug.Assert(converted == charLengthRequired); 2461Debug.Assert(converted == charLengthRequired); 2477Debug.Assert(bytes.Length >= Base64VectorizationLengthThreshold); 2478Debug.Assert(chars.Length >= charLengthRequired); 2479Debug.Assert(charLengthRequired % 4 == 0); 2483Debug.Assert(status == OperationStatus.Done && charLengthRequired == bytesWritten); 2688Debug.Assert(chars.Length != 0); // If TryDecodeFromUtf16() consumed the entire buffer, it could not have returned false. 2717Debug.Assert(chars.Length != 0 && !chars[0].IsSpace()); 2765Debug.Assert(tempBuffer.Length != 0); // We only bound-check after writing a character to the tempBuffer. 2828Debug.Assert(0 <= inputLength); 2843Debug.Assert(0 <= resultLength); 2873Debug.Assert(0 <= inputLength); 2896Debug.Assert(0 <= usefulInputLength); 2900Debug.Assert(0 <= padding);
src\libraries\System.Private.CoreLib\src\System\DateOnly.cs (5)
38Debug.Assert(dayNumber <= MaxDayNumber); 692Debug.Assert(result != ParseFailureKind.None); 699Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 757Debug.Assert(charsWritten == destination.Length); 763Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\DateTime.cs (1)
151Debug.Assert((dateData & TicksMask) <= MaxTicks);
src\libraries\System.Private.CoreLib\src\System\DateTimeOffset.cs (3)
73Debug.Assert(validOffsetMinutes is >= MinOffsetMinutes and <= MaxOffsetMinutes); 74Debug.Assert(validDateTime.Kind == DateTimeKind.Unspecified); 75Debug.Assert((ulong)(validDateTime.Ticks + validOffsetMinutes * TimeSpan.TicksPerMinute) <= DateTime.MaxTicks);
src\libraries\System.Private.CoreLib\src\System\Decimal.cs (3)
382Debug.Assert((exponent >= 67) && (exponent <= 95)); 630Debug.Assert(buffer.Length >= 16); 640Debug.Assert(span.Length >= 16);
src\libraries\System.Private.CoreLib\src\System\Decimal.DecCalc.cs (20)
366Debug.Assert(den > bufNum->High64); 391Debug.Assert(den > bufNum.High64); 483Debug.Assert(bufDen.U2 > bufNum.U3); 609Debug.Assert(hiRes < Buf24.Length); 737Debug.Assert(cur + 1 < Buf24.Length); 807Debug.Assert(bufQuo.U2 == 0); 1084Debug.Assert(cur < Buf24.Length); 1096Debug.Assert(hiProd + 1 < Buf24.Length); 1132Debug.Assert(cur < Buf24.Length); 1134Debug.Assert(hiProd < Buf24.Length); 1159Debug.Assert(cur < Buf24.Length); 1613Debug.Assert(dbl < 1E7); 1618Debug.Assert(dbl >= 1E6); 1773Debug.Assert(dbl < 1E15); 1778Debug.Assert(dbl >= 1E14); 1818Debug.Assert(power <= 14); 2275Debug.Assert(d2.High == 0); 2276Debug.Assert(scale == 0); 2333Debug.Assert(high + 1 < Buf28.Length); 2495Debug.Assert(mode == MidpointRounding.ToPositiveInfinity);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Contracts\ContractFailedEventArgs.cs (1)
19Debug.Assert(originalException == null || failureKind == ContractFailureKind.PostconditionOnException);
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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\ActivityTracker.cs (3)
61Debug.Assert((options & EventActivityOptions.Disable) == 0); 505Debug.Assert(value < 16); 506Debug.Assert(ptr < endPtr);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\CounterGroup.cs (10)
48Debug.Assert(e.Command == EventCommand.Enable || e.Command == EventCommand.Disable); 54Debug.Assert(e.Arguments != null); 76Debug.Assert(e.Command == EventCommand.Disable); 93Debug.Assert((s_counterGroupEnabledList == null && !_eventSource.IsEnabled()) 111Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 130Debug.Assert(s_counterGroups != null); 151Debug.Assert(pollingIntervalInSeconds > 0); 152Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 188Debug.Assert(Monitor.IsEntered(s_counterGroupLock)); 204Debug.Assert(Monitor.IsEntered(s_counterGroupLock));
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\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventCounter.cs (2)
80Debug.Assert(Monitor.IsEntered(this)); 174Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventDispatcher.cs (8)
68Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 125Debug.Assert(Volatile.Read(ref m_sessionID) == 0); 139Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 140Debug.Assert(sessionID != 0); 149Debug.Assert(Monitor.IsEntered(m_dispatchControlLock)); 157Debug.Assert(sessionID != 0); 165Debug.Assert(sessionID != 0); 223Debug.Assert((syncTimeUtc.Ticks != 0) && (syncTimeQPC != 0) && (timeQPCFrequency != 0));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeEventProvider.cs (2)
75Debug.Assert(!_gcHandle.IsAllocated); 128Debug.Assert(userDataCount >= 0);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventPipeMetadataGenerator.cs (10)
177Debug.Assert(offset == v1MetadataLength); 207Debug.Assert(totalMetadataLength == offset); 225Debug.Assert(bufferLength >= (offset + srcLength)); 235Debug.Assert(bufferLength >= (offset + sizeof(T))); 311Debug.Assert(property != null); 312Debug.Assert(pMetadataBlob != null); 385Debug.Assert(pMetadataBlob != null); 405Debug.Assert(typeInfo != null); 406Debug.Assert(pMetadataBlob != null); 612Debug.Assert(property != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventProvider.cs (3)
165Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 678Debug.Assert((EventOpcode)eventDescriptor.Opcode == EventOpcode.Send || 1352Debug.Assert(filterData != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\EventSource.cs (62)
476Debug.Assert(EventListener.s_EventSources != null); 786Debug.Assert(m_eventData != null); 787Debug.Assert(m_eventPipeProvider != null); 814Debug.Assert(eventHandle != IntPtr.Zero); 1374Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 1539Debug.Assert(!Monitor.IsEntered(EventListener.EventListenersLock)); 1717Debug.Assert(!m_eventSourceEnabled); // We can't be enabled until we are completely initted. 1791Debug.Assert(data->Size == 4); 1803Debug.Assert(dataType.IsEnum); 1823Debug.Assert(*(int*)dataPointer == (data + 1)->Size); 1838Debug.Assert(!dataType.IsEnum); 1841Debug.Assert(size == 1); 1846Debug.Assert(size == 1); 1851Debug.Assert(size == 2); 1856Debug.Assert(size == 2); 1861Debug.Assert(size == 2); 1898Debug.Assert(size == 16); 1903Debug.Assert(size == 16); 1979Debug.Assert(m_eventData != null); // You must have initialized this if you enabled the source. 2087Debug.Assert(m_eventData != null); 2106Debug.Assert(m_eventData != null); 2135Debug.Assert(m_eventData != null); 2165Debug.Assert(data->Size == 4); 2186Debug.Assert(dispatcher.m_EventEnabled != null); 2361Debug.Assert(m_eventData != null); 2653Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2668Debug.Assert(m_eventData != null); 2726Debug.Assert(commandArgs.perEventSourceSessionId >= -1 && commandArgs.perEventSourceSessionId <= SessionMask.MAX); 2744Debug.Assert(m_eventData != null); 2760Debug.Assert(dispatcher.m_EventEnabled != null); 2820Debug.Assert(m_eventData != null); 2837Debug.Assert(dispatcher.m_EventEnabled != null); 2852Debug.Assert(m_eventData != null); 2868Debug.Assert(Monitor.IsEntered(EventListener.EventListenersLock)); 2872Debug.Assert(m_rawManifest == null); 2874Debug.Assert(m_eventData != null); 2915Debug.Assert(!SelfDescribingEvents); 3019Debug.Assert(attributeType == typeof(EventAttribute) || attributeType == typeof(EventSourceAttribute)); 3034Debug.Assert(data.ConstructorArguments.Count <= 1); 3323Debug.Assert(0 <= startEventId); // Since we reserve id 0, we know that id-1 is <= 0 3362Debug.Assert(eventData != null); 3396Debug.Assert(eventData != null); 3620Debug.Assert(eventAttribute.Task != EventTask.None || eventAttribute.Opcode != EventOpcode.Info); 3867Debug.Assert(((m_config & EventSourceSettings.EtwManifestEventFormat) != 0) != 4333Debug.Assert(s_EventSources != null); 4392Debug.Assert(EventSource.IsSupported); 4396Debug.Assert(s_EventSources != null); 4408Debug.Assert(!Monitor.IsEntered(EventListenersLock)); 4455Debug.Assert(Monitor.IsEntered(EventListenersLock)); 4457Debug.Assert(s_EventSources != null); 4531Debug.Assert(s_EventSources != null); 4598Debug.Assert(s_EventSources != null); 5187Debug.Assert(perEventSourceSessionId < MAX); 5205Debug.Assert(perEventSourceSessionId < MAX); 5210Debug.Assert(perEventSourceSessionId < MAX); 5440Debug.Assert(channel >= EventChannel.Admin && channel <= EventChannel.Debug); 5482Debug.Assert(numParams == 0); 5483Debug.Assert(this.eventName == null); 5561Debug.Assert(eventName != null); 5680Debug.Assert(channelInfo.Name != null); 5713Debug.Assert(localEnumType.IsEnum); 5941Debug.Assert(info!.Attribs != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\NativeRuntimeEventSource.Threading.NativeSinks.cs (5)
91Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 112Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 131Debug.Assert(IsEnabled(EventLevel.Informational, Keywords.ContentionKeyword)); 361Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword)); 375Debug.Assert(IsEnabled(EventLevel.Verbose, Keywords.WaitHandleKeyword));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\DataCollector.cs (6)
98Debug.Assert(buffer != null); 133Debug.Assert(buffer != null); 172Debug.Assert(buffer != null); 213Debug.Assert(value != null && buffer != null); 238Debug.Assert(buffer != null); 271Debug.Assert(buffer != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\EventPayload.cs (1)
19Debug.Assert(payloadNames.Length == payloadValues.Length);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\FieldMetadata.cs (1)
214Debug.Assert(custom != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleEventTypes.cs (1)
33Debug.Assert(instance != null);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\SimpleTypeInfos.cs (1)
319Debug.Assert(typeArgs.Length == 1);
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventHandleTable.cs (1)
41Debug.Assert(Monitor.IsEntered(this));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\TraceLoggingEventSource.cs (4)
420Debug.Assert(eventHandle != IntPtr.Zero); 530Debug.Assert(eventHandle != IntPtr.Zero); 598Debug.Assert(eventHandle != IntPtr.Zero); 790Debug.Assert(ProviderMetadata.SequenceEqual(m_providerMetadata));
src\libraries\System.Private.CoreLib\src\System\Diagnostics\Tracing\TraceLogging\XplatEventLogger.cs (1)
151Debug.Assert(byteArray != null);
src\libraries\System.Private.CoreLib\src\System\Double.cs (7)
295Debug.Assert(IsNaN(value)); 1585Debug.Assert(ax >= ay); 1673Debug.Assert(n == 0); 1712Debug.Assert(IsPositiveInfinity(x)); 1717Debug.Assert(IsNegativeInfinity(x)); 1757Debug.Assert(IsPositiveInfinity(x)); 1762Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Enum.cs (21)
258Debug.Assert(enumType.IsActualEnum); 341Debug.Assert(enumType.IsActualEnum); 371Debug.Assert(enumType.IsActualEnum); 584Debug.Assert(success && result is not null); 604Debug.Assert(success && result is not null); 646Debug.Assert(success); 663Debug.Assert(success); 1545Debug.Assert(success); 1546Debug.Assert(charsWritten == sizeof(TStorage) * 2); 1805Debug.Assert(typeof(TEnum).IsEnum); 1806Debug.Assert(value is not null); 1933Debug.Assert(names.Length == values.Length); 1964Debug.Assert(!isDestinationTooSmall); 1968Debug.Assert(names.Length == values.Length); 2296Debug.Assert( 2311if (typeof(TUnderlying) == typeof(sbyte)) Debug.Assert(typeof(TStorage) == typeof(byte)); 2312else if (typeof(TUnderlying) == typeof(short)) Debug.Assert(typeof(TStorage) == typeof(ushort)); 2313else if (typeof(TUnderlying) == typeof(int)) Debug.Assert(typeof(TStorage) == typeof(uint)); 2314else if (typeof(TUnderlying) == typeof(long)) Debug.Assert(typeof(TStorage) == typeof(ulong)); 2315else if (typeof(TUnderlying) == typeof(nint)) Debug.Assert(typeof(TStorage) == typeof(nuint)); 2316else Debug.Assert(typeof(TUnderlying) == typeof(TStorage));
src\libraries\System.Private.CoreLib\src\System\Enum.EnumInfo.cs (1)
38Debug.Assert(sizeof(TStorage) == sizeof(TResult));
src\libraries\System.Private.CoreLib\src\System\Environment.cs (4)
173Debug.Assert(processId != 0); 199Debug.Assert(processPath != null); 222Debug.Assert(osVersion != null); 251Debug.Assert(target != EnvironmentVariableTarget.Process);
src\libraries\System.Private.CoreLib\src\System\Environment.GetFolderPathCore.Unix.cs (2)
24Debug.Assert(path != null); 42Debug.Assert(option == SpecialFolderOption.Create);
src\libraries\System.Private.CoreLib\src\System\Environment.Variables.Windows.cs (1)
130Debug.Assert(success != Interop.BOOL.FALSE);
src\libraries\System.Private.CoreLib\src\System\Exception.cs (1)
175Debug.Assert(resultSpan.Length == 0);
src\libraries\System.Private.CoreLib\src\System\Gen2GcCallback.cs (2)
70Debug.Assert(_callback1 != null); 92Debug.Assert(_callback0 != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.cs (1)
104Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Icu.cs (9)
37Debug.Assert(!GlobalizationMode.UseNls); 61Debug.Assert(this.saMonthNames != null); 64Debug.Assert(calendarId == CalendarId.HEBREW && saMonthNames.Length == 13); 88Debug.Assert(!GlobalizationMode.Invariant); 89Debug.Assert(!GlobalizationMode.UseNls); 116Debug.Assert(!GlobalizationMode.UseNls); 124Debug.Assert(!GlobalizationMode.Invariant); 222Debug.Assert(index + 3 < modifiedPattern.Length); 385Debug.Assert(calendarId == CalendarId.HEBREW && callbackContext.Results.Count == 14);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Nls.cs (3)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(GlobalizationMode.UseNls); 72Debug.Assert(context->strings != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendarData.Unix.cs (1)
27Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CalendricalCalculationsHelper.cs (7)
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); 388Debug.Assert(day != upperBoundNewYearDay);
src\libraries\System.Private.CoreLib\src\System\Globalization\CharUnicodeInfo.cs (5)
56Debug.Assert(s != null); 366Debug.Assert(index < value.Length); 378Debug.Assert(str.Length > 0); 379Debug.Assert(index >= 0 && index < str.Length); 411Debug.Assert(s != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.cs (2)
396Debug.Assert(offset2 > (string2 == null ? 0 : string2.Length) - length2); 1048Debug.Assert(matchLengthPtr != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Icu.cs (41)
39Debug.Assert(!GlobalizationMode.UseNls); 40Debug.Assert(interopCultureName != null); 52Debug.Assert(!GlobalizationMode.Invariant); 53Debug.Assert(!GlobalizationMode.UseNls); 54Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 68Debug.Assert(!GlobalizationMode.Invariant); 69Debug.Assert(!GlobalizationMode.UseNls); 70Debug.Assert(target.Length != 0); 106Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 221Debug.Assert(!GlobalizationMode.Invariant); 224Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 316Debug.Assert(!GlobalizationMode.Invariant); 317Debug.Assert(!GlobalizationMode.UseNls); 320Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 345Debug.Assert(!GlobalizationMode.Invariant); 348Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 427Debug.Assert(!GlobalizationMode.Invariant); 430Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 500Debug.Assert(!GlobalizationMode.Invariant); 501Debug.Assert(!GlobalizationMode.UseNls); 504Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 529Debug.Assert(!GlobalizationMode.Invariant); 532Debug.Assert(_isAsciiEqualityOrdinal && CanUseAsciiOrdinalForOptions(options)); 612Debug.Assert(!GlobalizationMode.Invariant); 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); 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\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\libraries\System.Private.CoreLib\src\System\Globalization\CompareInfo.Nls.cs (55)
14Debug.Assert(GlobalizationMode.UseNls); 50Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(pSource != null); 58Debug.Assert(pValue != null); 68Debug.Assert(ret >= -1 && ret <= source.Length); 71Debug.Assert(ret >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 79Debug.Assert(!GlobalizationMode.Invariant); 80Debug.Assert(GlobalizationMode.UseNls); 82Debug.Assert(source.Length != 0); 83Debug.Assert(value.Length != 0); 91Debug.Assert(!GlobalizationMode.Invariant); 92Debug.Assert(GlobalizationMode.UseNls); 94Debug.Assert(source != null); 95Debug.Assert(value != null); 108Debug.Assert(!GlobalizationMode.Invariant); 109Debug.Assert(GlobalizationMode.UseNls); 110Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 186Debug.Assert(!GlobalizationMode.Invariant); 187Debug.Assert(GlobalizationMode.UseNls); 189Debug.Assert(count1 > 0); 190Debug.Assert(count2 > 0); 195Debug.Assert(char1 != null); 196Debug.Assert(char2 != null); 210Debug.Assert(!GlobalizationMode.Invariant); 211Debug.Assert(GlobalizationMode.UseNls); 212Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 234Debug.Assert(*pString1 >= 0); // assert that we can always dereference this 235Debug.Assert(*pString2 >= 0); // assert that we can always dereference this 264Debug.Assert(!GlobalizationMode.Invariant); 286Debug.Assert(pSource != null && pValue != null); 300Debug.Assert(result >= -1 && result <= lpStringSource.Length); 303Debug.Assert(result >= 0 || Marshal.GetLastPInvokeError() == Interop.Errors.ERROR_SUCCESS); 311Debug.Assert(!GlobalizationMode.Invariant); 312Debug.Assert(GlobalizationMode.UseNls); 314Debug.Assert(target.Length != 0); 322Debug.Assert(!GlobalizationMode.Invariant); 323Debug.Assert(GlobalizationMode.UseNls); 326Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 343Debug.Assert(!GlobalizationMode.Invariant); 344Debug.Assert(GlobalizationMode.UseNls); 347Debug.Assert((options & (CompareOptions.Ordinal | CompareOptions.OrdinalIgnoreCase)) == 0); 373Debug.Assert(!GlobalizationMode.Invariant); 374Debug.Assert(GlobalizationMode.UseNls); 425Debug.Assert(!GlobalizationMode.Invariant); 426Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 467Debug.Assert(pSource != null); 468Debug.Assert(pSortKey != null); 519Debug.Assert(actualSortKeyLength <= destination.Length); 525Debug.Assert(!GlobalizationMode.Invariant); 526Debug.Assert((options & ValidCompareMaskOffFlags) == 0); 545Debug.Assert(pSource != null); 568Debug.Assert(!GlobalizationMode.Invariant); 569Debug.Assert(GlobalizationMode.UseNls); 621Debug.Assert(!GlobalizationMode.Invariant); 622Debug.Assert(GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (4)
2009Debug.Assert(str != null); 2010Debug.Assert(start >= 0); 2011Debug.Assert(end >= 0); 2237Debug.Assert(_sRealName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Icu.cs (23)
34Debug.Assert(name is not null); 35Debug.Assert(name.Length <= ICU_ULOC_FULLNAME_CAPACITY); 104Debug.Assert(_sRealName != null); 105Debug.Assert(!GlobalizationMode.Invariant); 142Debug.Assert(_sWindowsName != null); 203Debug.Assert(!GlobalizationMode.Invariant); 204Debug.Assert(!GlobalizationMode.UseNls); 219Debug.Assert(!GlobalizationMode.UseNls); 243Debug.Assert(!GlobalizationMode.UseNls); 268Debug.Assert(!GlobalizationMode.UseNls); 291Debug.Assert(!GlobalizationMode.UseNls); 341Debug.Assert(!GlobalizationMode.UseNls); 356Debug.Assert(icuFormatString.Length < ICU_ULOC_FULLNAME_CAPACITY); 443Debug.Assert(!GlobalizationMode.Invariant); 444Debug.Assert(!GlobalizationMode.UseNls); 452Debug.Assert(!GlobalizationMode.UseNls); 462Debug.Assert(!GlobalizationMode.UseNls); 469Debug.Assert(!GlobalizationMode.UseNls); 470Debug.Assert(cultureName != null); 503Debug.Assert(!GlobalizationMode.UseNls); 509Debug.Assert(!GlobalizationMode.Invariant); 510Debug.Assert(!GlobalizationMode.UseNls); 582Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Nls.cs (19)
42Debug.Assert(!GlobalizationMode.Invariant); 49Debug.Assert(ShouldUseUserOverrideNlsData); 58Debug.Assert(ShouldUseUserOverrideNlsData); 66Debug.Assert(IsWin32Installed); 83Debug.Assert(ShouldUseUserOverrideNlsData); 90Debug.Assert(GlobalizationMode.UseNls); 96Debug.Assert(ShouldUseUserOverrideNlsData); 103Debug.Assert(ShouldUseUserOverrideNlsData); 116Debug.Assert(!GlobalizationMode.Invariant); 117Debug.Assert(GlobalizationMode.UseNls); 118Debug.Assert(regionName != null); 140Debug.Assert(GlobalizationMode.UseNls); 160Debug.Assert(GlobalizationMode.UseNls); 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\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.Unix.cs (1)
17Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.cs (3)
175Debug.Assert(cultureData != null); 183Debug.Assert(name != null); 786Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\CultureInfo.Unix.cs (1)
18Debug.Assert(localeName != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormat.cs (19)
167Debug.Assert(minimumLength <= 16); 209Debug.Assert(dayOfWeek >= 0 && dayOfWeek <= 6); 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); 1034Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1410Debug.Assert(dayAbbrev.Length == 3); 1413Debug.Assert(monthAbbrev.Length == 3); 1617Debug.Assert(dayAbbrev.Length == 3); 1620Debug.Assert(monthAbbrev.Length == 3); 1721Debug.Assert(dtfi != null);
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (11)
243Debug.Assert(cultureData != null); 244Debug.Assert(cal != null); 254Debug.Assert(cultureData != null); 370Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 619Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 822Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1004Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1049Debug.Assert(values.Length >= length); 1274Debug.Assert(patterns1 != null); 1275Debug.Assert(patterns2 != null); 1704Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeParse.cs (11)
553Debug.Assert(hourOffset >= 0 && hourOffset <= 99); 554Debug.Assert(minuteOffset >= 0 && minuteOffset <= 99); 2053Debug.Assert(raw.numCount >= 2); 2075Debug.Assert(raw.numCount >= 3); 2793Debug.Assert(result.parsedDate.Kind == DateTimeKind.Unspecified); 3129Debug.Assert(minDigitLen > 0); 3130Debug.Assert(maxDigitLen < 9); 3131Debug.Assert(minDigitLen <= maxDigitLen); 3166Debug.Assert(maxDigitLen <= DateTimeFormat.MaxSecondsFractionDigits); 5893Debug.Assert(number >= 0 && number <= 9); 5915Debug.Assert(sub.index == Index);
src\libraries\System.Private.CoreLib\src\System\Globalization\HebrewNumber.cs (2)
213Debug.Assert(typeof(TChar) == typeof(byte)); 399Debug.Assert(s_numberPassingState.Length == HebrewTokenCount * ((int)HS.S9_DQ + 1));
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\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (1)
157Debug.Assert(inputLength > 0);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Icu.cs (9)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(!GlobalizationMode.UseNls); 14Debug.Assert(unicodeString != null && unicodeString.Length >= count); 56Debug.Assert(!GlobalizationMode.Invariant); 57Debug.Assert(!GlobalizationMode.UseNls); 58Debug.Assert(asciiString != null && asciiString.Length >= count); 81Debug.Assert(!GlobalizationMode.Invariant); 82Debug.Assert(!GlobalizationMode.UseNls); 83Debug.Assert(asciiString != null && asciiString.Length >= count);
src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.Nls.cs (14)
14Debug.Assert(!GlobalizationMode.Invariant); 15Debug.Assert(GlobalizationMode.UseNls); 16Debug.Assert(unicodeString != null && unicodeString.Length >= count); 46Debug.Assert(!GlobalizationMode.Invariant); 47Debug.Assert(GlobalizationMode.UseNls); 48Debug.Assert(unicodeString != null && unicodeString.Length >= count); 55Debug.Assert(length == outputLength); 61Debug.Assert(!GlobalizationMode.Invariant); 62Debug.Assert(GlobalizationMode.UseNls); 63Debug.Assert(asciiString != null && asciiString.Length >= count); 93Debug.Assert(!GlobalizationMode.Invariant); 94Debug.Assert(GlobalizationMode.UseNls); 95Debug.Assert(asciiString != null && asciiString.Length >= count); 102Debug.Assert(length == outputLength);
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\libraries\System.Private.CoreLib\src\System\Globalization\JapaneseCalendar.Icu.cs (3)
20Debug.Assert(!GlobalizationMode.UseNls); 114Debug.Assert(abbrevEnglishEraNames == s_abbreviatedEnglishEraNames || eras.Count <= abbrevEnglishEraNames.Length); 141Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Icu.cs (13)
15Debug.Assert(!GlobalizationMode.Invariant); 16Debug.Assert(!GlobalizationMode.UseNls); 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); 127Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 170Debug.Assert(!GlobalizationMode.Invariant); 171Debug.Assert(!GlobalizationMode.UseNls); 173Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\libraries\System.Private.CoreLib\src\System\Globalization\Normalization.Nls.cs (14)
16Debug.Assert(!GlobalizationMode.Invariant); 17Debug.Assert(GlobalizationMode.UseNls); 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); 88Debug.Assert(realLength > StackallocThreshold); 117Debug.Assert(!GlobalizationMode.Invariant); 118Debug.Assert(GlobalizationMode.UseNls); 120Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD); 167Debug.Assert(!GlobalizationMode.Invariant); 168Debug.Assert(GlobalizationMode.UseNls); 170Debug.Assert(normalizationForm == NormalizationForm.FormC || normalizationForm == NormalizationForm.FormD || normalizationForm == NormalizationForm.FormKC || normalizationForm == NormalizationForm.FormKD);
src\libraries\System.Private.CoreLib\src\System\Globalization\NumberFormatInfo.cs (14)
270Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 362Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 384Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 430Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 515Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 538Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 574Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 595Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 632Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 655Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 691Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 712Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 733Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 755Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Globalization\Ordinal.cs (5)
84Debug.Assert(length >= TVector.ElementCount); 248Debug.Assert(length == 1); 272Debug.Assert(length == 0); 465Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= source.Length); 531Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= source.Length);
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\libraries\System.Private.CoreLib\src\System\Globalization\OrdinalCasing.Icu.cs (15)
158Debug.Assert(!GlobalizationMode.Invariant); 159Debug.Assert(!GlobalizationMode.UseNls); 188Debug.Assert(!GlobalizationMode.Invariant); 189Debug.Assert(!GlobalizationMode.UseNls); 260Debug.Assert(lowSurrogateA != '\0'); 261Debug.Assert(lowSurrogateB != '\0'); 290Debug.Assert(value.Length > 0); 291Debug.Assert(value.Length <= source.Length); 293Debug.Assert(!GlobalizationMode.Invariant); 294Debug.Assert(!GlobalizationMode.UseNls); 354Debug.Assert(value.Length > 0); 355Debug.Assert(value.Length <= source.Length); 357Debug.Assert(!GlobalizationMode.Invariant); 358Debug.Assert(!GlobalizationMode.UseNls); 431Debug.Assert(pageNumber >= 0 && pageNumber < 256);
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\libraries\System.Private.CoreLib\src\System\Globalization\SortKey.cs (2)
54Debug.Assert(key1Data != null); 55Debug.Assert(key2Data != null);
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\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.cs (10)
186Debug.Assert(!GlobalizationMode.Invariant); 213Debug.Assert(destination.Length >= source.Length); 220Debug.Assert(destination.Length >= source.Length); 227Debug.Assert(!GlobalizationMode.Invariant); 228Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 246Debug.Assert(operationStatus == OperationStatus.Done); 260Debug.Assert(typeof(TConversion) == typeof(ToUpperConversion) || typeof(TConversion) == typeof(ToLowerConversion)); 263Debug.Assert(!GlobalizationMode.Invariant); 264Debug.Assert(source != null); 475Debug.Assert(_isAsciiCasingSameAsInvariant == Tristate.True || _isAsciiCasingSameAsInvariant == Tristate.False);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Icu.cs (3)
14Debug.Assert(localeName != null); 21Debug.Assert(!GlobalizationMode.Invariant); 22Debug.Assert(!GlobalizationMode.UseNls);
src\libraries\System.Private.CoreLib\src\System\Globalization\TextInfo.Nls.cs (7)
12Debug.Assert(!GlobalizationMode.Invariant); 13Debug.Assert(GlobalizationMode.UseNls); 14Debug.Assert(pSource != null); 15Debug.Assert(pResult != null); 16Debug.Assert(pSourceLen >= 0); 17Debug.Assert(pResultLen >= 0); 18Debug.Assert(pSourceLen <= pResultLen);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (15)
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); 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); 597Debug.Assert(field == 5);
src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanParse.cs (15)
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); 540Debug.Assert(argumentName != null); 591Debug.Assert(powersOfTen.Length == MaxFractionDigits + 1); 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\libraries\System.Private.CoreLib\src\System\Guid.cs (3)
794Debug.Assert(lookup.Length == 256); 1344Debug.Assert(p == guidChars + charsWritten - ((byte)flags != 0 ? 1 : 0)); 1418Debug.Assert((Ssse3.IsSupported || AdvSimd.Arm64.IsSupported) && BitConverter.IsLittleEndian);
src\libraries\System.Private.CoreLib\src\System\Half.cs (2)
465Debug.Assert(IsNaN(other)); 1538Debug.Assert(IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\HashCode.cs (4)
340Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 345Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 350Debug.Assert(Unsafe.ByteOffset(ref pos, ref end) >= sizeof(int)); 362Debug.Assert(Unsafe.ByteOffset(ref pos, ref blockEnd) >= (sizeof(int) * 4));
src\libraries\System.Private.CoreLib\src\System\Index.cs (1)
160Debug.Assert(formatted);
src\libraries\System.Private.CoreLib\src\System\Int128.cs (5)
526Debug.Assert(value >= -TwoPow127); 527Debug.Assert(double.IsFinite(value)); 528Debug.Assert(value < TwoPow127); 765Debug.Assert((sign == 0) || (sign == -1)); 847Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int16.cs (2)
309Debug.Assert((sign == 0) || (sign == -1)); 384Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int32.cs (2)
329Debug.Assert((sign == 0) || (sign == -1)); 411Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\Int64.cs (2)
326Debug.Assert((sign == 0) || (sign == -1)); 408Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IntPtr.cs (2)
331Debug.Assert((sign == 0) || (sign == -1)); 413Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\IO\BinaryReader.cs (4)
180Debug.Assert(charsRead > 0); 317Debug.Assert(!_disposed); 359Debug.Assert(_stream is MemoryStream); 479Debug.Assert(_stream is MemoryStream);
src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (68)
92Debug.Assert(_stream != null); 100Debug.Assert(_stream != null); 108Debug.Assert(_stream != null); 116Debug.Assert(_buffer != null); 117Debug.Assert(_bufferSize > 0); 132Debug.Assert(_bufferSize > 0); 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); 382Debug.Assert(_stream != null); 393Debug.Assert(_readPos < _readLen); 406Debug.Assert(_stream != null); 419Debug.Assert(_stream != null); 433Debug.Assert(readbytes >= 0); 449Debug.Assert(readbytes >= 0); 477Debug.Assert(_stream != null); 532Debug.Assert(_stream != null); 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); 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); 1090Debug.Assert(buffer.Length == 0); 1094Debug.Assert(buffer.Length >= 0); 1095Debug.Assert(_writePos == _bufferSize); 1096Debug.Assert(_buffer != null); 1102Debug.Assert(bytesWritten == buffer.Length); 1104Debug.Assert(_writePos < _bufferSize); 1112Debug.Assert(_buffer != null); 1113Debug.Assert(totalUserBytes >= _bufferSize); 1175Debug.Assert(_writePos < _bufferSize); 1182Debug.Assert(_stream != null); 1203Debug.Assert(oldPos == _stream.Position + (_readPos - _readLen)); 1237Debug.Assert(_stream != null); 1248Debug.Assert(_stream != null); 1283Debug.Assert(_stream != null);
src\libraries\System.Private.CoreLib\src\System\IO\Directory.Unix.cs (1)
55Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\DirectoryInfo.cs (1)
190Debug.Assert(path != null);
src\libraries\System.Private.CoreLib\src\System\IO\File.cs (8)
935Debug.Assert(writer != null); 936Debug.Assert(contents != null); 1099Debug.Assert(encoding != null); 1242Debug.Assert(bytesRead < rentedArray.Length); 1305Debug.Assert(encoding != null); 1354Debug.Assert(writer != null); 1355Debug.Assert(contents != null); 1485Debug.Assert(bytesRead < buffer.Length);
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); 500Debug.Assert(handle is not null || path.Length > 0); 522Debug.Assert(errorInfo.RawErrno > 0); // Expect a positive integer
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); 713Debug.Assert(sb.Length > 0);
src\libraries\System.Private.CoreLib\src\System\IO\MemoryStream.cs (4)
243Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 330Debug.Assert(_position + n >= 0); // len is less than 2^31 -1. 533Debug.Assert(_position >= _origin); 555Debug.Assert(MemStreamMaxLength == int.MaxValue); // Check parameter validation logic in this method if this fails.
src\libraries\System.Private.CoreLib\src\System\IO\Path.cs (3)
781Debug.Assert(fourth.Length == destination.Length); 797Debug.Assert(bytes != null); 869Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\IO\Path.Unix.cs (2)
57Debug.Assert(!path.Contains('\0')); 120Debug.Assert(path[^1] == 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
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\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (14)
254Debug.Assert(_readPos == _readLen); 352Debug.Assert(!_strategy.CanSeek); 393Debug.Assert(_asyncActiveSemaphore != null); 394Debug.Assert(_strategy.CanSeek); 575Debug.Assert(_writePos <= _bufferSize); 660Debug.Assert(!_strategy.CanSeek); 676Debug.Assert(_asyncActiveSemaphore != null); 677Debug.Assert(_strategy.CanSeek); 780Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 804Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0); 819Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0))); 824Debug.Assert(_writePos == 0 && _readPos == _readLen); 917Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen)); 987Debug.Assert(_readPos < _readLen);
src\libraries\System.Private.CoreLib\src\System\IO\Strategies\OSFileStreamStrategy.cs (1)
189Debug.Assert(value >= 0);
src\libraries\System.Private.CoreLib\src\System\IO\Stream.cs (11)
428Debug.Assert(minimumBytes <= buffer.Length); 550Debug.Assert(readWriteTask != null); 551Debug.Assert(asyncWaiter != null); 573Debug.Assert(readWriteTask != null); 610Debug.Assert(writeTask.Status == TaskStatus.RanToCompletion); 659Debug.Assert(function != null); 660Debug.Assert(stream != null); 685Debug.Assert(completedTask is ReadWriteTask); 688Debug.Assert(callback != null); 704Debug.Assert(callback != null); 888Debug.Assert(minimumBytes <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (6)
99Debug.Assert(this is NullStreamReader); 548Debug.Assert(_checkPreamble); 696Debug.Assert(charsRead == 0); 1134Debug.Assert(n == 0); 1162Debug.Assert(n == 0); 1210Debug.Assert(n == 0);
src\libraries\System.Private.CoreLib\src\System\IO\StreamWriter.cs (2)
165Debug.Assert(GetType() == typeof(NullStreamWriter)); 252Debug.Assert(GetType() == typeof(StreamWriter));
src\libraries\System.Private.CoreLib\src\System\IO\TextWriter.CreateBroadcasting.cs (1)
49Debug.Assert(writers is { Length: > 0 });
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryAccessor.cs (1)
465Debug.Assert(intsWritten == 4);
src\libraries\System.Private.CoreLib\src\System\IO\UnmanagedMemoryStream.cs (2)
435Debug.Assert(ex is not OperationCanceledException); 712Debug.Assert(ex is not OperationCanceledException);
src\libraries\System.Private.CoreLib\src\System\Marvin.OrdinalIgnoreCase.cs (4)
41Debug.Assert(ucount < 2); 77Debug.Assert(ucount <= int.MaxValue); // this should fit into a signed int 83Debug.Assert(count > 0); 89Debug.Assert(charsWritten == count); // invariant case conversion should involve simple folding; preserve code unit count
src\libraries\System.Private.CoreLib\src\System\Math.cs (1)
907Debug.Assert(double.IsSubnormal(x));
src\libraries\System.Private.CoreLib\src\System\MathF.cs (1)
212Debug.Assert(float.IsSubnormal(x));
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\libraries\System.Private.CoreLib\src\System\MemoryExtensions.cs (9)
2155Debug.Assert(lowInclusive is null || highInclusive is null); 4867Debug.Assert(span.Length == other.Length); 5200Debug.Assert(startInclusive <= endExclusive); 5636Debug.Assert(index > 2); 6085Debug.Assert(alignment > value.Length); 6169Debug.Assert(_hasCustomFormatter); 6170Debug.Assert(_provider != null); 6188Debug.Assert(startingPos >= 0 && startingPos <= _pos); 6189Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.cs (6)
64Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 116Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 147Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 182Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 316Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); 354Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Globalization.Utf8.cs (1)
58Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase);
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\libraries\System.Private.CoreLib\src\System\MemoryExtensions.Trim.Utf8.cs (1)
20Debug.Assert(!Rune.IsWhiteSpace(Rune.ReplacementChar));
src\libraries\System.Private.CoreLib\src\System\Net\WebUtility.cs (6)
622Debug.Assert(_numBytes > 0); 663Debug.Assert(_numChars > 0); 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\libraries\System.Private.CoreLib\src\System\Number.BigInteger.cs (26)
369Debug.Assert(carry == 1); 370Debug.Assert(resultIndex == resultLength); 371Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 390Debug.Assert(unchecked((uint)(lhs._length)) <= MaxBlockCount); 391Debug.Assert(unchecked((uint)(rhs._length)) <= MaxBlockCount); 405Debug.Assert(rhsLength == 0); 451Debug.Assert(!rhs.IsZero()); 587Debug.Assert(carry == t + 1); 593Debug.Assert(carry == 1); 756Debug.Assert(unchecked((uint)(resultLength)) < MaxBlockCount); 805Debug.Assert(unchecked((uint)(maxResultLength)) <= MaxBlockCount); 863Debug.Assert(unchecked((uint)result._length) <= MaxBlockCount); 912Debug.Assert((Pow10BigNumTableIndices[^1] + MaxBlockCount + 2) == Pow10BigNumTable.Length); 954Debug.Assert(lhsLength >= 0); 955Debug.Assert(rhsLength >= 0); 956Debug.Assert(lhsLength >= rhsLength); 976Debug.Assert(q <= 0xFFFFFFFF); 1009Debug.Assert(lhsLength >= 0); 1010Debug.Assert(rhsLength >= 0); 1011Debug.Assert(lhsLength >= rhsLength); 1012Debug.Assert(q <= uint.MaxValue); 1064Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1082Debug.Assert(index < _length); 1137Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1226Debug.Assert(unchecked((uint)(length)) < MaxBlockCount); 1255Debug.Assert(unchecked((uint)(length)) < MaxBlockCount);
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\libraries\System.Private.CoreLib\src\System\Number.Dragon4.cs (17)
18Debug.Assert(v > TNumber.Zero); 19Debug.Assert(TNumber.IsFinite(v)); 33Debug.Assert(mantissa != 0); 60Debug.Assert(buffer.Length > 0); 67Debug.Assert(mantissa != 0); 249Debug.Assert(cutoffNumber > 0); 255Debug.Assert(cutoffNumber >= 0); 273Debug.Assert(scale.GetLength() > 0); 282Debug.Assert(hiBlock != 0); 284Debug.Assert((hiBlockLog2 < 3) || (hiBlockLog2 > 27)); 304Debug.Assert(isSignificantDigits); 305Debug.Assert(digitExponent >= cutoffExponent); 314Debug.Assert(outputDigit < 10); 357Debug.Assert((cutoffNumber > 0) || ((cutoffNumber == 0) && !isSignificantDigits)); 367Debug.Assert(outputDigit < 10); 395Debug.Assert((0 < outputDigit) && (outputDigit < 10)); 478Debug.Assert(outputLen <= buffer.Length);
src\libraries\System.Private.CoreLib\src\System\Number.Formatting.cs (82)
326Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 507Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 512Debug.Assert(s is null || typeof(TChar) == typeof(char)); 530Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 584Debug.Assert(((precision != -1) && (precision < TNumber.MaxRoundTripDigits)) || (TNumber.FloatToBits(value) == TNumber.FloatToBits(NumberToFloat<TNumber>(ref number)))); 590Debug.Assert((fmt == 'G') || (fmt == 'g') || (fmt == 'R') || (fmt == 'r')); 604Debug.Assert(precision == TNumber.MaxPrecisionCustomFormat); 612Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 613Debug.Assert(source != null); 815Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 931Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1047Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1164Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1282Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1377Debug.Assert(value < 0); 1389Debug.Assert(p == buffer + sNegative.Length); 1395Debug.Assert(p == buffer); 1402Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1403Debug.Assert(value < 0); 1421Debug.Assert(p == buffer + sNegative.Length); 1427Debug.Assert(p == buffer); 1444Debug.Assert(p == buffer); 1451Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1469Debug.Assert(p == buffer); 1477Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1500Debug.Assert(p == buffer); 1507Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1525Debug.Assert(p == buffer); 1533Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1570Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1571Debug.Assert(value <= 99); 1586Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1587Debug.Assert(value <= 9999); 1615Debug.Assert(value < 10); 1616Debug.Assert(cur == ptr); 1623Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1652Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1686Debug.Assert(value < SmallNumberCacheLength); 1703Debug.Assert(p == buffer); 1719Debug.Assert(p == buffer); 1726Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1735Debug.Assert(p == buffer); 1746Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1759Debug.Assert(p == buffer); 1810Debug.Assert(value < 0); 1822Debug.Assert(p == buffer + sNegative.Length); 1828Debug.Assert(p == buffer); 1835Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1836Debug.Assert(value < 0); 1854Debug.Assert(p == buffer + sNegative.Length); 1860Debug.Assert(p == buffer); 1877Debug.Assert(p == buffer); 1884Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1902Debug.Assert(p == buffer); 1912Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1949Debug.Assert(p == buffer); 1956Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 1974Debug.Assert(p == buffer); 1984Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2045Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2084Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2129Debug.Assert(p == buffer); 2147Debug.Assert(p == buffer); 2154Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2164Debug.Assert(p == buffer); 2186Debug.Assert(p == buffer); 2250Debug.Assert(p == buffer + sNegative.Length); 2256Debug.Assert(p == buffer); 2263Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2284Debug.Assert(p == buffer + sNegative.Length); 2290Debug.Assert(p == buffer); 2309Debug.Assert(p == buffer); 2316Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2336Debug.Assert(p == buffer); 2372Debug.Assert(p == buffer); 2379Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2399Debug.Assert(p == buffer); 2455Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2467Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 2491Debug.Assert(p == buffer); 2509Debug.Assert(p == buffer); 2527Debug.Assert(p == buffer);
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\libraries\System.Private.CoreLib\src\System\Number.NumberToFloatingPointBits.cs (11)
829Debug.Assert((TFloat.DenormalMantissaMask & (1UL << TFloat.DenormalMantissaBits)) == 0); 831Debug.Assert((shiftedExponent & TFloat.DenormalMantissaMask) == 0); 832Debug.Assert((mantissa & ~TFloat.DenormalMantissaMask) == 0); 833Debug.Assert((shiftedExponent & ~(((1UL << TFloat.ExponentBits) - 1) << TFloat.DenormalMantissaBits)) == 0); // exponent fits in its place 895Debug.Assert((1 <= count) && (count <= 9)); 919Debug.Assert((1 <= count) && (count <= 19)); 975Debug.Assert(TFloat.DenormalMantissaBits <= FloatingPointMaxDenormalMantissaBits); 977Debug.Assert(number.DigitsPtr[0] != '0'); 979Debug.Assert(number.Scale <= FloatingPointMaxExponent); 980Debug.Assert(number.Scale >= FloatingPointMinExponent); 982Debug.Assert(number.DigitsCount != 0);
src\libraries\System.Private.CoreLib\src\System\Number.Parsing.cs (5)
130Debug.Assert(p != null); 821Debug.Assert((c == 0) || !hasZeroTail); 904Debug.Assert(typeof(TChar) == typeof(byte)); 922Debug.Assert(typeof(TChar) == typeof(byte)); 940Debug.Assert(typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\Numerics\Vector.cs (10)
392Debug.Assert(sizeof(Vector<double>) == sizeof(Vector128<double>)); 415Debug.Assert(sizeof(Vector<double>) == sizeof(Vector128<double>)); 523Debug.Assert(sizeof(Vector<float>) == sizeof(Vector128<float>)); 690Debug.Assert(sizeof(Vector<T>) == sizeof(Vector128<T>)); 1347Debug.Assert(sizeof(Vector<T>) == sizeof(Vector128<T>)); 1593Debug.Assert(sizeof(Vector<T>) == sizeof(Vector128<T>)); 2685Debug.Assert(sizeof(Vector<uint>) == sizeof(Vector128<uint>)); 2711Debug.Assert(sizeof(Vector<ulong>) == sizeof(Vector128<ulong>)); 3492Debug.Assert((index >= 0) && (index < Vector<T>.Count)); 3500Debug.Assert((index >= 0) && (index < Vector<T>.Count));
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\libraries\System.Private.CoreLib\src\System\Progress.cs (1)
35Debug.Assert(_synchronizationContext != null);
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); 340Debug.Assert(_seedArray is not null);
src\libraries\System.Private.CoreLib\src\System\Random.cs (1)
50Debug.Assert(isThreadSafeRandom);
src\libraries\System.Private.CoreLib\src\System\Random.Xoshiro256StarStarImpl.cs (5)
93Debug.Assert(maxValue >= 0); 100Debug.Assert(minValue <= maxValue); 122Debug.Assert(maxValue >= 0); 129Debug.Assert(minValue <= maxValue); 160Debug.Assert(buffer.Length < sizeof(ulong));
src\libraries\System.Private.CoreLib\src\System\Range.cs (2)
79Debug.Assert(formatted); 90Debug.Assert(formatted);
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\libraries\System.Private.CoreLib\src\System\ReadOnlySpan.cs (1)
125Debug.Assert(length >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\ConstructorInvoker.cs (3)
245Debug.Assert(_argCount <= MaxStackAllocArgCount); 397Debug.Assert(copyOfParameters[i] != null); 398Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
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\libraries\System.Private.CoreLib\src\System\Reflection\FieldAccessor.cs (11)
21Debug.Assert(_fieldInfo.m_declaringType != null); 130Debug.Assert(obj != null); 139Debug.Assert(obj != null); 146Debug.Assert(obj != null); 221Debug.Assert(obj != null); 229Debug.Assert(obj != null); 237Debug.Assert(obj != null); 245Debug.Assert(obj != null); 253Debug.Assert(obj != null); 350Debug.Assert(!IsStatic()); 384Debug.Assert(IsStatic());
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokerEmitUtil.cs (5)
21Debug.Assert(!method.ContainsGenericParameters); 88Debug.Assert(!method.ContainsGenericParameters); 145Debug.Assert(!method.ContainsGenericParameters); 203Debug.Assert(parameterType.IsValueType); 254Debug.Assert(method is DynamicMethod);
src\libraries\System.Private.CoreLib\src\System\Reflection\InvokeUtils.cs (4)
107Debug.Assert(dstObject != null); 108Debug.Assert(dstObject.GetType() == dstType); 121Debug.Assert(srcObject is not Pointer); 265Debug.Assert(destElType == CorElementType.ELEMENT_TYPE_R8);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodBaseInvoker.cs (8)
48Debug.Assert(_argCount == 0); 72Debug.Assert(_argCount == 1); 118Debug.Assert(_argCount <= MaxStackAllocArgCount); 155Debug.Assert(_argCount <= MaxStackAllocArgCount); 189Debug.Assert(_argCount > MaxStackAllocArgCount); 289Debug.Assert(_argCount == 1); 332Debug.Assert(copyOfParameters[i] != null); 333Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvoker.cs (4)
292Debug.Assert(_method is RuntimeConstructorInfo); 298Debug.Assert(_argCount <= MaxStackAllocArgCount); 450Debug.Assert(copyOfParameters[i] != null); 451Debug.Assert(((RuntimeType)copyOfParameters[i]!.GetType()).IsNullableOfT);
src\libraries\System.Private.CoreLib\src\System\Reflection\MethodInvokerCommon.cs (1)
90Debug.Assert(!method.IsStatic);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedFunctionPointerType.cs (1)
21Debug.Assert(unmodifiedType.IsFunctionPointer);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedGenericType.cs (1)
16Debug.Assert(unmodifiedType.IsGenericType);
src\libraries\System.Private.CoreLib\src\System\Reflection\ModifiedHasElementType.cs (1)
19Debug.Assert(unmodifiedType.HasElementType);
src\libraries\System.Private.CoreLib\src\System\Reflection\NullabilityInfoContext.cs (2)
497Debug.Assert(genericParameter.IsGenericParameter); 535Debug.Assert(genericParameter.IsGenericParameter &&
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureArrayType.cs (2)
13Debug.Assert(rank > 0); 14Debug.Assert(rank == 1 || isMultiDim);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureGenericParameterType.cs (1)
12Debug.Assert(position >= 0);
src\libraries\System.Private.CoreLib\src\System\Reflection\SignatureHasElementType.cs (1)
12Debug.Assert(elementType != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (7)
112Debug.Assert(_mediator.NeutralResourcesCulture != null); 208Debug.Assert(_mediator.MainAssembly != null); 357Debug.Assert(_mediator.MainAssembly != null); 419Debug.Assert(_mediator.MainAssembly != null); 427Debug.Assert(_mediator.NeutralResourcesCulture != null); 462Debug.Assert(_mediator.BaseName != null); 473Debug.Assert(_mediator.MainAssembly != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceManager.cs (6)
252Debug.Assert(MainAssembly != null); 289Debug.Assert(_resourceSets != null); 410Debug.Assert(MainAssembly != null); 415Debug.Assert(localResourceSets != null); 430Debug.Assert(culture != null); 431Debug.Assert(_resourceSets != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
341Debug.Assert(Monitor.IsEntered(this)); // uses _store 542Debug.Assert(Monitor.IsEntered(this)); // uses _store 562Debug.Assert(Monitor.IsEntered(this)); // uses _store 624Debug.Assert(Monitor.IsEntered(this)); // uses _store 644Debug.Assert(Monitor.IsEntered(this)); // uses _store 782Debug.Assert(!Monitor.IsEntered(this)); // only called during init 805Debug.Assert(!Monitor.IsEntered(this)); // only called during init 994Debug.Assert(Monitor.IsEntered(this)); // uses _store 1034Debug.Assert(Monitor.IsEntered(this)); // uses _store 1118Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceSet.cs (2)
189Debug.Assert(_table != null); 190Debug.Assert(Reader != null);
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
287Debug.Assert(!Monitor.IsEntered(reader));
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncMethodBuilderCore.cs (1)
91Debug.Assert(stateMachine != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilder.cs (1)
86Debug.Assert(m_task == null);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncTaskMethodBuilderT.cs (5)
290Debug.Assert(s is AsyncStateMachineBox<TStateMachine>); 354Debug.Assert(!IsCompleted); 365Debug.Assert(StateMachine != null); 395Debug.Assert(IsCompleted); 442Debug.Assert(m_task == null);
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\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\ConditionalWeakTable.cs (18)
490Debug.Assert(Monitor.IsEntered(_lock)); 491Debug.Assert(key != null); // key already validated as non-null and not already in table. 557Debug.Assert(parent != null); 558Debug.Assert(BitOperations.IsPow2(InitialCapacity)); 577Debug.Assert(parent != null); 578Debug.Assert(buckets != null); 579Debug.Assert(entries != null); 580Debug.Assert(buckets.Length == entries.Length); 581Debug.Assert(BitOperations.IsPow2(buckets.Length)); 596Debug.Assert(key != null); // key already validated as non-null and not already in table. 597Debug.Assert(HasCapacity); 620Debug.Assert(key != null); // Key already validated as non-null 634Debug.Assert(key != null); // Key already validated as non-null. 711Debug.Assert(entryIndex >= 0 && entryIndex < _firstFreeEntry); 726Debug.Assert(entryIndex != -1); 742Debug.Assert(!HasCapacity); 783Debug.Assert(newSize >= _buckets.Length); 784Debug.Assert(BitOperations.IsPow2(newSize));
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); 160Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 182Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 202Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\DefaultInterpolatedStringHandler.cs (6)
504Debug.Assert(provider is not null); 522Debug.Assert(_hasCustomFormatter); 523Debug.Assert(_provider != null); 539Debug.Assert(startingPos >= 0 && startingPos <= _pos); 540Debug.Assert(alignment != 0); 608Debug.Assert(additionalChars > _chars.Length - _pos);
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); 202Debug.Assert(size > 1); 204Debug.Assert((size & (size - 1)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\RuntimeHelpers.cs (1)
138Debug.Assert(srcET.IsPrimitiveType() && dstET.IsPrimitiveType());
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (3)
195Debug.Assert(stateMachineBox != null); 395Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0); 477Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\Unsafe.cs (2)
951Debug.Assert(nuint.IsPow2(alignment)); 963Debug.Assert(nuint.IsPow2(alignment));
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); 132Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 152Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 171Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\YieldAwaitable.cs (1)
117Debug.Assert(box != null);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\GCHandle.cs (1)
138Debug.Assert(target is Array);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\Marshalling\BStrStringMarshaller.cs (1)
96Debug.Assert(lengthInBytes == Marshal.SysStringByteLen((IntPtr)ptrToFirstChar));
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\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\MemoryMarshal.cs (4)
298Debug.Assert(obj is MemoryManager<T>); 359Debug.Assert(length >= 0); 448Debug.Assert(offset >= 0); 449Debug.Assert(count >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\PosixSignalRegistration.Unix.cs (1)
96Debug.Assert(tokens.Length != 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (1)
29Debug.Assert(osArch >= 0);
src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\SafeHandle.cs (4)
121Debug.Assert(_fullyInitialized); 127Debug.Assert(_fullyInitialized); 160Debug.Assert(_fullyInitialized); 198Debug.Assert(_fullyInitialized || disposeOrFinalizeOperation);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.cs (2)
3962Debug.Assert((index >= 0) && (index < Vector128<T>.Count)); 3970Debug.Assert((index >= 0) && (index < Vector128<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector128.Numerics.cs (2)
138Debug.Assert(Vector<T>.Count >= Vector128<T>.Count); 217Debug.Assert(Vector<T>.Count >= Vector128<T>.Count);
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector256.cs (4)
279Debug.Assert(Vector256<T>.Count >= Vector<T>.Count); 296Debug.Assert(Vector256<T>.Count >= Vector<T>.Count); 3998Debug.Assert((index >= 0) && (index < Vector256<T>.Count)); 4006Debug.Assert((index >= 0) && (index < Vector256<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector512.cs (4)
279Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 296Debug.Assert(Vector512<T>.Count >= Vector<T>.Count); 3991Debug.Assert((index >= 0) && (index < Vector512<T>.Count)); 3999Debug.Assert((index >= 0) && (index < Vector512<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\Vector64.cs (2)
4092Debug.Assert((index >= 0) && (index < Vector64<T>.Count)); 4100Debug.Assert((index >= 0) && (index < Vector64<T>.Count));
src\libraries\System.Private.CoreLib\src\System\Runtime\Intrinsics\VectorMath.cs (25)
317Debug.Assert((typeof(T) != typeof(byte)) 670Debug.Assert(TVectorDouble.GreaterThanOrEqualAll(ax, ay)); 1567Debug.Assert((typeof(T) == typeof(sbyte)) 1654Debug.Assert((typeof(T) == typeof(sbyte)) 2590Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2604Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2618Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2647Debug.Assert(typeof(TVectorSingle) == typeof(Vector<float>)); 2652Debug.Assert(typeof(TVectorSingle) == typeof(Vector64<float>)); 2657Debug.Assert(typeof(TVectorSingle) == typeof(Vector128<float>)); 2662Debug.Assert(typeof(TVectorSingle) == typeof(Vector256<float>)); 2667Debug.Assert(typeof(TVectorSingle) == typeof(Vector512<float>)); 2903Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2921Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 2939Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 2972Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 2977Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 2982Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 2987Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 2992Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>)); 3012Debug.Assert(typeof(TVectorDouble) == typeof(Vector<double>)); 3017Debug.Assert(typeof(TVectorDouble) == typeof(Vector64<double>)); 3022Debug.Assert(typeof(TVectorDouble) == typeof(Vector128<double>)); 3027Debug.Assert(typeof(TVectorDouble) == typeof(Vector256<double>)); 3032Debug.Assert(typeof(TVectorDouble) == typeof(Vector512<double>));
src\libraries\System.Private.CoreLib\src\System\Runtime\Loader\AssemblyLoadContext.cs (3)
121Debug.Assert(IsCollectible); 123Debug.Assert(_state != InternalState.Unloading); 749Debug.Assert(assemblyName.CultureName?.Length > 0);
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\libraries\System.Private.CoreLib\src\System\RuntimeType.cs (16)
437Debug.Assert(IsSetField); 457Debug.Assert(flds != null); 545Debug.Assert(!IsSetField); 552Debug.Assert(isSetProperty); 554Debug.Assert(!IsGetField); 579Debug.Assert(semiFinalist != null); 597Debug.Assert(results.Count > 1); 602Debug.Assert(finalists == null || finalist != null); 649Debug.Assert(results.Count > 1); 797Debug.Assert(!IsGenericParameter); 841Debug.Assert(!IsGenericParameter); 865Debug.Assert(value != null); 907Debug.Assert(type.IsValueType); 908Debug.Assert(!type.IsByRefLike); 913Debug.Assert(type.IsEquivalentTo(value.GetType())); 932Debug.Assert(!sigElementType.IsGenericParameter);
src\libraries\System.Private.CoreLib\src\System\SByte.cs (2)
312Debug.Assert((sign == 0) || (sign == -1)); 365Debug.Assert((sign == 0) || (sign == -1));
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1CharPackedIgnoreCaseSearchValues.cs (1)
20Debug.Assert((value | 0x20) == value);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any1SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 1);
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\libraries\System.Private.CoreLib\src\System\SearchValues\Any2SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 2);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any3SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 3);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any4SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 4);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Any5SearchValues.cs (2)
19Debug.Assert(sizeof(T) == sizeof(TImpl)); 20Debug.Assert(values.Length == 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiByteSearchValues.cs (1)
23Debug.Assert(Ascii.IsValid(values) || (AdvSimd.IsSupported && TUniqueLowNibble.Value));
src\libraries\System.Private.CoreLib\src\System\SearchValues\AsciiCharSearchValues.cs (1)
24Debug.Assert(Ascii.IsValid(values) || (AdvSimd.IsSupported && TUniqueLowNibble.Value));
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitmapCharSearchValues.cs (1)
17Debug.Assert(maxInclusive <= char.MaxValue);
src\libraries\System.Private.CoreLib\src\System\SearchValues\BitVector256.cs (2)
28Debug.Assert(c < 256); 45Debug.Assert(b < 256);
src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (6)
38Debug.Assert((uint)value <= 127); 76Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 101Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 143Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char)); 211Debug.Assert(searchSpaceLength >= Vector128<short>.Count); 238Debug.Assert(searchSpaceLength >= Vector128<short>.Count);
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMap.cs (17)
417Debug.Assert(Avx512Vbmi.VL.IsSupported); 418Debug.Assert(searchSpaceLength >= 16); 461Debug.Assert(searchSpaceLength is > 32 and <= 64); 478Debug.Assert(searchSpaceLength is >= 16 and <= 32); 501Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 502Debug.Assert(searchSpaceLength >= 16); 592Debug.Assert(Avx512Vbmi.VL.IsSupported); 593Debug.Assert(searchSpaceLength >= 16); 609Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 64 * sizeof(char)); 637Debug.Assert(searchSpaceLength is > 32 and <= 64); 638Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 655Debug.Assert(searchSpaceLength is >= 16 and <= 32); 656Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char)); 679Debug.Assert(Sse41.IsSupported || AdvSimd.Arm64.IsSupported); 680Debug.Assert(searchSpaceLength >= 16); 698Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 32 * sizeof(char)); 740Debug.Assert(Unsafe.ByteOffset(ref searchSpace, ref cur) >= 16 * sizeof(char));
src\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticMapState.cs (17)
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\libraries\System.Private.CoreLib\src\System\SearchValues\ProbabilisticWithAsciiCharSearchValues.cs (3)
23Debug.Assert(values.ContainsAnyInRange((char)0, (char)127)); 53Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0)); 150Debug.Assert(_asciiState.Lookup.Contains(0) != _inverseAsciiState.Lookup.Contains(0));
src\libraries\System.Private.CoreLib\src\System\SearchValues\SearchValues.cs (1)
53Debug.Assert(values.Length is 2 or 3 or 4 or 5);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\AsciiStringSearchValuesTeddyBase.cs (11)
121Debug.Assert(!TBucketized.Value); 122Debug.Assert(n is 2 or 3); 137Debug.Assert(TBucketized.Value); 138Debug.Assert(n is 2 or 3); 252Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN2); 304Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN2); 429Debug.Assert(span.Length >= CharsPerIterationAvx2 + MatchStartOffsetN3); 484Debug.Assert(span.Length >= CharsPerIterationAvx512 + MatchStartOffsetN3); 561Debug.Assert(bucket is not null); 606Debug.Assert(bucket is not null); 651Debug.Assert(bucket is not null);
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\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\AhoCorasickBuilder.cs (1)
31Debug.Assert(values[i - 1].Length <= values[i].Length);
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\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\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\RabinKarp.cs (5)
42Debug.Assert(values.Length <= MaxValues); 50Debug.Assert(minimumLength > 1); 111Debug.Assert(typeof(TCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 128Debug.Assert(_buckets is not null); 175Debug.Assert(charsWritten == upperCase.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\StringSearchValuesHelper.cs (10)
20Debug.Assert(searchSpaceLength >= 0); 28Debug.Assert(offset >= 0); 31Debug.Assert(currentByteOffset >= 0); 32Debug.Assert((currentByteOffset & 1) == 0); 36Debug.Assert(offset <= availableLength); 58Debug.Assert(lengthRemaining > 0); 136Debug.Assert(candidate.Length > 1); 158Debug.Assert(candidate.Length is 2 or 3); 190Debug.Assert(candidate.Length > 1); 191Debug.Assert(candidate.ToUpperInvariant() == candidate);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\Helpers\TeddyBucketizer.cs (7)
17Debug.Assert(values.Length <= 8); 29Debug.Assert(char.IsAscii(c)); 50Debug.Assert(valueBuckets.Length <= 8); 62Debug.Assert(char.IsAscii(c)); 79Debug.Assert(values.Length <= RabinKarp.MaxValues); 97Debug.Assert(char.IsAscii(value[j])); 129Debug.Assert(count == strings.Length);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\SingleStringSearchValuesThreeChars.cs (5)
49Debug.Assert(value.Length > 1); 50Debug.Assert((value.Length >= 8) == TValueLength.AtLeast8CharsOrUnknown); 54Debug.Assert(ch3Offset == 0 || ch3Offset > ch2Offset); 336Debug.Assert(bitPos % 2 == 0); 364Debug.Assert(bitPos % 2 == 0);
src\libraries\System.Private.CoreLib\src\System\SearchValues\Strings\StringSearchValues.cs (12)
64Debug.Assert(i == normalizedValues.Length); 91Debug.Assert(charsWritten == upperCase.Length); 109Debug.Assert(newCount <= values.Length - unreachableValues.Count); 110Debug.Assert(newCount > 0); 252Debug.Assert(!(asciiStartLettersOnly && asciiStartUnaffectedByCaseConversion)); 292Debug.Assert(typeof(TStartCaseSensitivity) != typeof(CaseInsensitiveUnicode)); 293Debug.Assert(values.Length > 1); 294Debug.Assert(n is 2 or 3); 317Debug.Assert(n is 2 or 3); 318Debug.Assert(values.Length < maxValues); 329Debug.Assert(char.IsAscii(c)); 373Debug.Assert(newValuesCount == newValues.Length);
src\libraries\System.Private.CoreLib\src\System\Security\SecureString.cs (8)
59Debug.Assert(_buffer != null); 82Debug.Assert(_buffer != null); 102Debug.Assert(_buffer != null); 132Debug.Assert(_buffer != null); 183Debug.Assert(_buffer != null); 230Debug.Assert(_buffer != null); 262Debug.Assert(_buffer != null); 427Debug.Assert(byteLength >= 0);
src\libraries\System.Private.CoreLib\src\System\Single.cs (7)
294Debug.Assert(IsNaN(value)); 1556Debug.Assert(IsNaN(x) || IsNaN(y)); 1589Debug.Assert(n == 0); 1628Debug.Assert(IsPositiveInfinity(x)); 1633Debug.Assert(IsNegativeInfinity(x)); 1673Debug.Assert(IsPositiveInfinity(x)); 1678Debug.Assert(IsNegativeInfinity(x));
src\libraries\System.Private.CoreLib\src\System\Span.cs (1)
130Debug.Assert(length >= 0);
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\libraries\System.Private.CoreLib\src\System\SpanHelpers.ByteMemOps.cs (14)
56Debug.Assert(len > 16 && len <= 64); 97Debug.Assert(len > 16 && len <= 64); 115Debug.Assert(len >= 8 && len <= 16); 131Debug.Assert(len >= 4 && len < 8); 138Debug.Assert(len < 4); 172Debug.Assert(len > 64 && len <= MemmoveNativeThreshold); 228Debug.Assert(len > 0); 239Debug.Assert(len > 0); 260Debug.Assert(len > 16 && len <= 64); 301Debug.Assert(len > 16 && len <= 64); 319Debug.Assert(len >= 8 && len <= 16); 335Debug.Assert(len >= 4 && len < 8); 342Debug.Assert(len < 4); 371Debug.Assert(len > 64 && len <= ZeroMemoryNativeThreshold);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.Char.cs (20)
16Debug.Assert(searchSpaceLength >= 0); 17Debug.Assert(valueLength >= 0); 89Debug.Assert(offset + ch1ch2Distance + Vector512<ushort>.Count <= searchSpaceLength); 156Debug.Assert(offset + ch1ch2Distance + Vector256<ushort>.Count <= searchSpaceLength); 218Debug.Assert(offset + ch1ch2Distance + Vector128<ushort>.Count <= searchSpaceLength); 266Debug.Assert(searchSpaceLength >= 0); 267Debug.Assert(valueLength >= 0); 288Debug.Assert(0 <= offset && offset <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 467Debug.Assert(firstLength >= 0); 468Debug.Assert(secondLength >= 0); 585Debug.Assert(length - offset >= Vector128<ushort>.Count); 646Debug.Assert(lengthToExamine >= Vector512<ushort>.Count); 675Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 698Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 729Debug.Assert(length - offset >= Vector128<ushort>.Count); 763Debug.Assert(lengthToExamine >= Vector256<ushort>.Count); 786Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 817Debug.Assert(length - offset >= Vector128<ushort>.Count); 824Debug.Assert(lengthToExamine >= Vector128<ushort>.Count); 889Debug.Assert(length > 1);
src\libraries\System.Private.CoreLib\src\System\SpanHelpers.cs (8)
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\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\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (28)
191Debug.Assert(searchSpaceLength >= 0); 192Debug.Assert(valueLength >= 0); 204Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 227Debug.Assert(length >= 0); 233Debug.Assert(value is not null); 299Debug.Assert(length >= 0); 304Debug.Assert(value is not null); 388Debug.Assert(length >= 0); 394Debug.Assert(value0 is not null && value1 is not null); 494Debug.Assert(length >= 0); 500Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 599Debug.Assert(searchSpaceLength >= 0); 600Debug.Assert(valueLength >= 0); 670Debug.Assert(searchSpaceLength >= 0); 671Debug.Assert(valueLength >= 0); 689Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength". 710Debug.Assert(length >= 0); 714Debug.Assert(value is not null); 793Debug.Assert(length >= 0); 798Debug.Assert(value0 is not null && value1 is not null); 898Debug.Assert(length >= 0); 903Debug.Assert(value0 is not null && value1 is not null && value2 is not null); 1003Debug.Assert(searchSpaceLength >= 0); 1004Debug.Assert(valueLength >= 0); 1195Debug.Assert(length >= 0); 1287Debug.Assert(firstLength >= 0); 1288Debug.Assert(secondLength >= 0); 3062Debug.Assert(oldValue is not null);
src\libraries\System.Private.CoreLib\src\System\StartupHookProvider.cs (5)
147Debug.Assert(Path.IsPathFullyQualified(startupHook.Path)); 152Debug.Assert(startupHook.AssemblyName != null); 168Debug.Assert(assembly != null); 194Debug.Assert(initializeMethod == null); 206Debug.Assert(initializeMethod != null &&
src\libraries\System.Private.CoreLib\src\System\String.Comparison.cs (15)
25Debug.Assert(strA != null); 26Debug.Assert(strB != null); 27Debug.Assert(strA.Length == strB.Length); 38Debug.Assert(strA != null); 39Debug.Assert(strB != null); 40Debug.Assert(indexA >= 0 && indexB >= 0); 41Debug.Assert(countA >= 0 && countB >= 0); 42Debug.Assert(indexA + countA <= strA.Length && indexB + countB <= strB.Length); 71Debug.Assert(strA.Length == strB.Length); 78Debug.Assert(strA != null); 79Debug.Assert(strB != null); 420Debug.Assert(comparisonType == StringComparison.OrdinalIgnoreCase); // CheckStringComparison validated these earlier 1068Debug.Assert(charsWritten == length); 1196Debug.Assert((uint)comparisonType <= (uint)StringComparison.OrdinalIgnoreCase); 1216Debug.Assert(comparisonType == StringComparison.Ordinal || comparisonType == StringComparison.OrdinalIgnoreCase);
src\libraries\System.Private.CoreLib\src\System\String.cs (5)
227Debug.Assert(numBytes >= 0); 228Debug.Assert(pb <= (pb + numBytes)); 535Debug.Assert(bytes != null); 536Debug.Assert(byteLength >= 0); 540Debug.Assert(stringLength >= 0);
src\libraries\System.Private.CoreLib\src\System\String.Manipulation.cs (17)
47Debug.Assert(char.IsWhiteSpace((char)i) == sv.Contains((char)i)); 58Debug.Assert(dest != null); 59Debug.Assert(src != null); 60Debug.Assert(src.Length <= dest.Length - destPos); 138Debug.Assert(s != null); 684Debug.Assert(index > 2); 1223Debug.Assert(compareInfo != null); 1413Debug.Assert(indices.Length > 0); 1444Debug.Assert(this.Length - thisIdx == dstSpan.Length - dstIdx); 1818Debug.Assert(count >= 0); 1862Debug.Assert(count >= 2); 1899Debug.Assert(count >= 2); 1952Debug.Assert(arrIndex < maxItems); 2038Debug.Assert(sourceSpan.Length >= Vector128<ushort>.Count); 2257Debug.Assert(startIndex == 0); 2499Debug.Assert(trimChars != null); 2500Debug.Assert(trimCharsLength > 0);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.CaseConversion.cs (7)
185Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 199Debug.Assert(numElementsActuallyConverted <= (nuint)buffer.Length); 211Debug.Assert(typeof(TFrom) == typeof(byte) || typeof(TFrom) == typeof(ushort)); 212Debug.Assert(typeof(TTo) == typeof(byte) || typeof(TTo) == typeof(ushort)); 213Debug.Assert(typeof(TCasing) == typeof(ToUpperConversion) || typeof(TCasing) == typeof(ToLowerConversion)); 346Debug.Assert(Vector128.IsHardwareAccelerated); 405Debug.Assert(Vector128.IsHardwareAccelerated);
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\libraries\System.Private.CoreLib\src\System\Text\Ascii.Equality.cs (6)
46Debug.Assert( 70Debug.Assert(Vector512<TLeft>.Count == Vector512<TRight>.Count 100Debug.Assert(Vector256<TLeft>.Count == Vector256<TRight>.Count 200Debug.Assert( 550Debug.Assert(Vector256<byte>.Count == Vector256<ushort>.Count * 2); 575Debug.Assert(Vector512<byte>.Count == Vector512<ushort>.Count * 2);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Transcoding.cs (2)
40Debug.Assert(numElementsActuallyConverted <= numElementsToConvert); 75Debug.Assert(numElementsActuallyConverted <= numElementsToConvert);
src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (23)
49Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 75Debug.Assert((mask != 0) ? index < 16 : index >= 16); 338Debug.Assert(sseMask != uint.MaxValue); 339Debug.Assert(Sse2.IsSupported); 346Debug.Assert(advSimdIndex != uint.MaxValue); 347Debug.Assert(AdvSimd.IsSupported); 612Debug.Assert(bufferLength < SizeOfVector128); 740Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 968Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 1163Debug.Assert(bufferLength < SizeOfVector128InChars); 1247Debug.Assert(AllCharsInUInt64AreAscii(value)); 1301Debug.Assert(AllCharsInUInt32AreAscii(value)); 1365Debug.Assert(currentOffset <= elementCount); 1577Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1588Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1611Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1629Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort)); 1699Debug.Assert(elementCount >= 2 * SizeOfVector128); 1817Debug.Assert(elementCount >= 2 * Vector256.Size); 1934Debug.Assert(elementCount >= 2 * Vector512.Size); 2063Debug.Assert(currentOffset <= elementCount); 2233Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>)); 2247Debug.Assert(AllBytesInUInt32AreAscii(value));
src\libraries\System.Private.CoreLib\src\System\Text\CompositeFormat.cs (8)
35Debug.Assert(format is not null); 39Debug.Assert(segments is not null); 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\libraries\System.Private.CoreLib\src\System\Text\DecoderNLS.cs (5)
76Debug.Assert(_encoding is not null); 129Debug.Assert(_encoding is not null); 183Debug.Assert(_encoding is not null); 237Debug.Assert(_encoding is not null); 295Debug.Assert(_encoding is not null);
src\libraries\System.Private.CoreLib\src\System\Text\EncoderFallback.cs (2)
197Debug.Assert(encoding != null); 247Debug.Assert(encoding != null);
src\libraries\System.Private.CoreLib\src\System\Text\EncoderNLS.cs (7)
72Debug.Assert(_encoding is not null); 115Debug.Assert(_encoding is not null); 169Debug.Assert(_encoding is not null); 213Debug.Assert(_encoding is not null); 284Debug.Assert(_encoding is not null); 307Debug.Assert(_fallbackBuffer is not null); 358Debug.Assert(_encoding is not null);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.cs (2)
631Debug.Assert(byteCount == bytesReceived); 657Debug.Assert(byteCount == bytesReceived);
src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (3)
688Debug.Assert(encoder is null); 1272Debug.Assert(fallbackBuffer.Remaining == 0); 1285Debug.Assert(decoder is null);
src\libraries\System.Private.CoreLib\src\System\Text\EncodingTable.cs (6)
57Debug.Assert(EncodingNameIndices.Length == CodePagesByName.Length + 1); 58Debug.Assert(EncodingNameIndices[^1] == EncodingNames.Length); 68Debug.Assert(index < EncodingNameIndices.Length - 1); 91Debug.Assert(left < EncodingNameIndices.Length - 1); 131Debug.Assert(arrayEncodingInfoIdx == arrayEncodingInfo.Length); 137Debug.Assert(encodingInfoList != null);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (11)
40Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 204Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char)); 451Debug.Assert(bufferLength < SizeOfVector128InChars); 630Debug.Assert(currentOffset <= elementCount); 779Debug.Assert(Sse2.IsSupported); 780Debug.Assert(BitConverter.IsLittleEndian); 781Debug.Assert(elementCount >= 2 * SizeOfVector128); 971Debug.Assert(Sse2.IsSupported); 972Debug.Assert(BitConverter.IsLittleEndian); 997Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char)); 1071Debug.Assert(!Sse2.IsSupported);
src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.Helpers.cs (2)
51Debug.Assert(AllCharsInUInt64AreLatin1(value)); 95Debug.Assert(AllCharsInUInt32AreLatin1(value));
src\libraries\System.Private.CoreLib\src\System\Text\Rune.cs (7)
196Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf16CharsPerRune); 213Debug.Assert(codeUnitCount > 0 && codeUnitCount <= MaxUtf8BytesPerRune); 466Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0080, 0x07FF)); 517Debug.Assert(UnicodeUtility.IsInRangeInclusive(tempValue, 0x0800, 0xFFFF)); 546Debug.Assert(1 <= bytesConsumed && bytesConsumed <= 4); // Valid subsequences are always length [1..4] 552Debug.Assert(0 <= index && index <= 3); // Incomplete subsequences are always length 0..3 559Debug.Assert(1 <= index && index <= 3); // Invalid subsequences are always length 1..3
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (35)
245Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity); 246Debug.Assert(currentBlock.m_ChunkChars != null); 248Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length); 249Debug.Assert(currentBlock.m_ChunkLength >= 0); 250Debug.Assert(currentBlock.m_ChunkOffset >= 0); 255Debug.Assert(currentBlock.m_ChunkOffset == 0); 259Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength); 559Debug.Assert(next.m_ChunkPrevious != null); 585Debug.Assert(stringBuilder != null); 638Debug.Assert(stringBuilder != null); 849Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count); 905Debug.Assert(chunk != null); 957Debug.Assert(insertingChars + this.Length < int.MaxValue); 1237Debug.Assert(values != null); 1239Debug.Assert(separatorLength >= 0); 1590Debug.Assert(format[pos - 1] == '{'); 1591Debug.Assert(ch != '{'); 1694Debug.Assert(format[pos] == '}'); 1922Debug.Assert(index > 2); 2011Debug.Assert(thisChunk != null && sbChunk != null); 2048Debug.Assert(offset == Length); 2243Debug.Assert(chunk.m_ChunkPrevious != null); 2506Debug.Assert(0 <= index && index <= Length); 2511Debug.Assert(result.m_ChunkPrevious != null); 2515Debug.Assert(result != null); 2549Debug.Assert(minBlockCharCount > 0); 2639Debug.Assert(count > 0); 2640Debug.Assert(index >= 0); 2651Debug.Assert(chunk.m_ChunkPrevious != null); 2708Debug.Assert(size > 0); 2709Debug.Assert(maxCapacity > 0); 2734Debug.Assert(startIndex >= 0 && startIndex < Length); 2762Debug.Assert(chunk.m_ChunkPrevious != null); 3135Debug.Assert(_hasCustomFormatter); 3136Debug.Assert(_provider != null);
src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.Debug.cs (2)
24Debug.Assert(head.m_ChunkPrevious != null); 35Debug.Assert(current.m_ChunkPrevious != null);
src\libraries\System.Private.CoreLib\src\System\Text\TranscodingStream.cs (4)
55Debug.Assert(innerStream != null); 56Debug.Assert(innerEncoding != null); 57Debug.Assert(thisEncoding != null); 150Debug.Assert(pendingData.Count != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.cs (10)
45Debug.Assert(AllCharsInUInt32AreAscii(value)); 75Debug.Assert(AllCharsInUInt32AreAscii(value)); 104Debug.Assert(AllCharsInUInt64AreAscii(value)); 133Debug.Assert(AllCharsInUInt64AreAscii(value)); 161Debug.Assert(AllCharsInUInt32AreAscii(value)); 186Debug.Assert(AllCharsInUInt32AreAscii(value)); 212Debug.Assert(AllCharsInUInt32AreAscii(valueA)); 213Debug.Assert(AllCharsInUInt32AreAscii(valueB)); 269Debug.Assert(AllCharsInUInt64AreAscii(valueA)); 270Debug.Assert(AllCharsInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf16Utility.Validation.cs (3)
33Debug.Assert(0 <= numAsciiCharsConsumedJustNow && numAsciiCharsConsumedJustNow <= inputLength); 75Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer); 271Debug.Assert(pHighestAddressWhereCanReadOneVector >= pInputBuffer);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8.cs (8)
654Debug.Assert(_hasCustomFormatter); 655Debug.Assert(_provider is not null); 675Debug.Assert(value is ISpanFormattable); 685Debug.Assert(value is ISpanFormattable); 722Debug.Assert(typeof(T).IsEnum); 732Debug.Assert(value is ISpanFormattable); 766Debug.Assert(startingPos >= 0 && startingPos <= _pos); 767Debug.Assert(alignment != 0);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.cs (8)
62Debug.Assert(AllBytesInUInt32AreAscii(value)); 92Debug.Assert(AllBytesInUInt32AreAscii(value)); 121Debug.Assert(AllBytesInUInt64AreAscii(value)); 150Debug.Assert(AllBytesInUInt64AreAscii(value)); 179Debug.Assert(AllBytesInUInt32AreAscii(valueA)); 180Debug.Assert(AllBytesInUInt32AreAscii(valueB)); 242Debug.Assert(AllBytesInUInt64AreAscii(valueA)); 243Debug.Assert(AllBytesInUInt64AreAscii(valueB));
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Helpers.cs (9)
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);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (8)
62Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 132Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord)); 150Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 222Debug.Assert(outputCharsRemaining == 1); 896Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer); 1068Debug.Assert(!Utf16Utility.AllCharsInUInt64AreAscii(possibleNonAsciiQWord)); // this condition should've been checked earlier 1135Debug.Assert(!Utf16Utility.AllCharsInUInt32AreAscii(thisDWord)); // this should have been handled earlier 1412Debug.Assert(inputLength < CharsPerDWord);
src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Validation.cs (5)
177Debug.Assert((AdvSimd.Arm64.IsSupported && BitConverter.IsLittleEndian) || Sse2.IsSupported); 185Debug.Assert(trailingZeroCount < 16); 221Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier 647Debug.Assert(inputLength < 4); 657Debug.Assert(inputBufferRemainingBytes < 4);
src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (1)
858Debug.Assert(baseDecoder is not null);
src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (1)
62Debug.Assert(_base64Bytes.Length == 64);
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\libraries\System.Private.CoreLib\src\System\Text\ValueStringBuilder.AppendFormat.cs (3)
85Debug.Assert(format[pos - 1] == '{'); 86Debug.Assert(ch != '{'); 189Debug.Assert(format[pos] == '}');
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\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (11)
327Debug.Assert(IsCancellationRequested); 590Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>); 774Debug.Assert(node.Registrations.Source == this); 775Debug.Assert(node.Prev == null); 991Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>); 1037Debug.Assert(_locked); 1088Debug.Assert(node.Prev == null); 1093Debug.Assert(node.Prev != null); 1187Debug.Assert(_locked); 1216Debug.Assert(Callback != null); 1224Debug.Assert(node.Callback != null);
src\libraries\System.Private.CoreLib\src\System\Threading\DeferredDisposableLifetime.cs (1)
81Debug.Assert(oldCount != 0 && oldCount != -1);
src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (17)
84Debug.Assert(isFlowSuppressed != m_isFlowSuppressed); 250Debug.Assert(threadPoolThread == Thread.CurrentThread); 314Debug.Assert(currentThread == Thread.CurrentThread); 315Debug.Assert(contextToRestore != currentContext); 350Debug.Assert(!Thread.IsThreadStartSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 357Debug.Assert(previousExecutionCtx != nextExecutionCtx); 364Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null); 372Debug.Assert(previousExecutionCtx!.m_localValues != null); 373Debug.Assert(nextExecutionCtx!.m_localValues != null); 407Debug.Assert(previousExecutionCtx!.m_localValues != null); 421Debug.Assert(nextExecutionCtx!.m_localValues != null); 456Debug.Assert(!current.IsDefault); 470Debug.Assert(!current.IsDefault); 493Debug.Assert(!current.IsDefault); 513Debug.Assert(newChangeNotifications != null); 514Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0); 556Debug.Assert(currentThread == Thread.CurrentThread);
src\libraries\System.Private.CoreLib\src\System\Threading\Interlocked.cs (2)
283Debug.Assert(sizeof(T) == 8); 538Debug.Assert(sizeof(T) == 8);
src\libraries\System.Private.CoreLib\src\System\Threading\IOCompletionCallbackHelper.cs (2)
34Debug.Assert(pNativeOverlapped != null); 52Debug.Assert(callback is IOCompletionCallbackHelper);
src\libraries\System.Private.CoreLib\src\System\Threading\LazyInitializer.cs (3)
70Debug.Assert(target != null); 116Debug.Assert(target != null); 272Debug.Assert(target != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.cs (55)
77Debug.Assert(currentThreadId.IsInitialized); 84Debug.Assert(currentThreadId.IsInitialized); 85Debug.Assert(currentThreadId.Id == _owningThreadId); 234Debug.Assert(timeoutMs >= -1); 239Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 240Debug.Assert(_recursionCount == 0); 273Debug.Assert(currentThreadId.IsInitialized); 274Debug.Assert(currentThreadId.Id == ThreadId.Current_NoInitialize.Id); 287Debug.Assert(new ThreadId(_owningThreadId).IsInitialized); 288Debug.Assert(_owningThreadId == ThreadId.Current_NoInitialize.Id); 289Debug.Assert(new State(this).IsLocked); 312Debug.Assert(timeoutMs >= -1); 319Debug.Assert(_owningThreadId != currentThreadId.Id); 327Debug.Assert(new State(this).IsLocked); 372Debug.Assert(IsAdaptiveSpinEnabled(minSpinCountForAdaptiveSpin)); 429Debug.Assert(tryLockResult == TryLockResult.Wait); 451Debug.Assert(tryLockResult == TryLockResult.Wait); 458Debug.Assert(tryLockResult != TryLockResult.Spin); 464Debug.Assert(tryLockResult == TryLockResult.Locked); 467Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 468Debug.Assert(_recursionCount == 0); 559Debug.Assert(!new ThreadId(_owningThreadId).IsInitialized); 560Debug.Assert(_recursionCount == 0); 636Debug.Assert(_waitEvent != null); 638Debug.Assert(signaled); 651Debug.Assert(!isHeld || new State(this).IsLocked); 663Debug.Assert(_waitEvent != null); 729Debug.Assert(!IsLocked); 737Debug.Assert(!ShouldNotPreemptWaiters); 738Debug.Assert(HasAnyWaiters); 745Debug.Assert(ShouldNotPreemptWaiters); 753Debug.Assert(HasAnyWaiters || !ShouldNotPreemptWaiters); 773Debug.Assert(HasAnySpinners); 781Debug.Assert(HasAnyWaiters); 782Debug.Assert(NeedToSignalWaiter); 789Debug.Assert(IsWaiterSignaledToWake); 801Debug.Assert(lockObj._state == 0); 824Debug.Assert(HasAnyWaiters); 832Debug.Assert(HasAnyWaiters); 881Debug.Assert(IsLockedMask == 1); 884Debug.Assert(!state.IsLocked); 920Debug.Assert(spinCount >= 0); 942Debug.Assert(!newState.ShouldNotPreemptWaiters); 976Debug.Assert(state.HasAnySpinners); 1004Debug.Assert(new State(state._state + SpinnerCountIncrement).HasAnySpinners); 1008Debug.Assert(state.HasAnyWaiters || !state.ShouldNotPreemptWaiters); 1068Debug.Assert(state.HasAnyWaiters || waiterStartTimeWasReset); 1092Debug.Assert(state.HasAnyWaiters); 1093Debug.Assert(state.IsWaiterSignaledToWake); 1124Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1148Debug.Assert(new State(state._state + IsWaiterSignaledToWakeMask).IsWaiterSignaledToWake); 1153Debug.Assert(state.HasAnyWaiters); 1183Debug.Assert(!state.ShouldNotPreemptWaiters || waiterStartTimeWasRecorded); 1207Debug.Assert(state.HasAnyWaiters); 1237Debug.Assert(state.HasAnyWaiters);
src\libraries\System.Private.CoreLib\src\System\Threading\Lock.NonNativeAot.cs (4)
53Debug.Assert(!IsInitialized); 54Debug.Assert(t_threadId == 0); 65Debug.Assert(id != 0); 76Debug.Assert(IsInitialized);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLifoSemaphore.cs (19)
26Debug.Assert(initialSignalCount >= 0); 27Debug.Assert(initialSignalCount <= maximumSignalCount); 28Debug.Assert(maximumSignalCount > 0); 29Debug.Assert(spinCount >= 0); 42Debug.Assert(timeoutMs >= -1); 57Debug.Assert(counts.SignalCount <= _maximumSignalCount); 153Debug.Assert(timeoutMs > 0 || timeoutMs == -1); 173Debug.Assert(counts.WaiterCount != 0); 211Debug.Assert(releaseCount > 0); 212Debug.Assert(releaseCount <= _maximumSignalCount); 248Debug.Assert(releaseCount <= _maximumSignalCount - counts.SignalCount); 287Debug.Assert(value <= uint.MaxValue - SignalCount); 295Debug.Assert(SignalCount != 0); 307Debug.Assert(WaiterCount < ushort.MaxValue); 313Debug.Assert(WaiterCount != 0); 320Debug.Assert(countsAfterUpdate.WaiterCount != ushort.MaxValue); // underflow check 331Debug.Assert(SpinnerCount < byte.MaxValue); 337Debug.Assert(SpinnerCount != 0); 359Debug.Assert(CountOfWaitersSignaledToWake != 0);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelLock.cs (9)
62Debug.Assert(!isLocked || (_state & LockedMask) != 0); 72Debug.Assert(_ownerThread == Thread.CurrentThread); 74Debug.Assert((_state & LockedMask) != 0); 82Debug.Assert(_ownerThread != Thread.CurrentThread); 90Debug.Assert(_ownerThread == null); 159Debug.Assert((_state & LockedMask) != 0); 187Debug.Assert((uint)state >= WaiterCountIncrement); 192Debug.Assert((_state & LockedMask) != 0); 198Debug.Assert((_state & LockedMask) != 0);
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\libraries\System.Private.CoreLib\src\System\Threading\LowLevelMonitor.Unix.cs (1)
49Debug.Assert(timeoutMilliseconds >= -1);
src\libraries\System.Private.CoreLib\src\System\Threading\LowLevelSpinWaiter.cs (3)
21Debug.Assert(condition != null); 56Debug.Assert(spinIndex >= 0); 57Debug.Assert(sleep0Threshold >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\ManualResetEventSlim.cs (3)
86Debug.Assert(m_eventObj != null); 280Debug.Assert(m_lock != null); // if waiters>0, then m_lock has already been created. 658Debug.Assert(mre.m_lock != null); // the lock should have been created before this callback is registered for use.
src\libraries\System.Private.CoreLib\src\System\Threading\Overlapped.cs (3)
181Debug.Assert(GCHandleCountRef(pNativeOverlapped) == handleCount); 227Debug.Assert(target is Overlapped); 230Debug.Assert(overlapped._pNativeOverlapped == pNativeOverlapped);
src\libraries\System.Private.CoreLib\src\System\Threading\PeriodicTimer.cs (1)
258Debug.Assert(!Monitor.IsEntered(this));
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\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.cs (2)
326Debug.Assert(t_completionCountObject == null); 349Debug.Assert(threadLocalCompletionCountObject != null);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.GateThread.cs (4)
227Debug.Assert(numRuns >= 0); 228Debug.Assert(numRuns <= MaxRuns); 297Debug.Assert(nextDelay <= GateActivitiesPeriodMs); 315Debug.Assert(HasBlockingAdjustmentDelay);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.HillClimbing.cs (3)
438Debug.Assert(numSamples >= period); // can't measure a wave that doesn't fit 439Debug.Assert(period >= 2); // can't measure above the Nyquist frequency 440Debug.Assert(numSamples <= samples.Length); // can't measure more samples than we have
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.ThreadCounts.cs (6)
37Debug.Assert(value >= 0); 42Debug.Assert(value >= 0); 55Debug.Assert(value >= 0); 60Debug.Assert(value >= 0); 73Debug.Assert(value > 0); 78Debug.Assert(value > 0);
src\libraries\System.Private.CoreLib\src\System\Threading\PortableThreadPool.WaitThread.cs (10)
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); 317Debug.Assert(j < numUserWaits); 405Debug.Assert(success);
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\libraries\System.Private.CoreLib\src\System\Threading\ProcessorIdCache.cs (1)
36Debug.Assert(s_processorIdRefreshRate <= ProcessorIdCacheCountDownMask);
src\libraries\System.Private.CoreLib\src\System\Threading\ReaderWriterLockSlim.cs (24)
149Debug.Assert(_spinLock.IsHeld); 157Debug.Assert(_spinLock.IsHeld); 553Debug.Assert(_fIsReentrant); 554Debug.Assert(_fUpgradeThreadHoldingRead); 611Debug.Assert((_owners & WRITER_HELD) > 0); 692Debug.Assert((_owners & WRITER_HELD) > 0); 799Debug.Assert(lrwc.readercount == 1); 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); 1469Debug.Assert( 1489Debug.Assert(DeprioritizeEnterAnyReadIncrement == (1 << 16)); 1498Debug.Assert(DeprioritizeEnterAnyWriteIncrement == 1); 1505Debug.Assert((reason & EnterSpinLockReason.Wait) != 0 || reason == (reason & EnterSpinLockReason.OperationMask)); 1506Debug.Assert( 1515Debug.Assert( 1526Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) == 0); 1530Debug.Assert((GetEnterDeprioritizationStateChange(reason) & DeprioritizeEnterAnyWriteIncrement) != 0); 1595Debug.Assert(
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Portable.cs (8)
91Debug.Assert(!IsInfiniteTimeout); 99Debug.Assert(WaitThread != null); 175Debug.Assert(handleValue == handle!.DangerousGetHandle()); 197Debug.Assert(_numRequestedCallbacks != 0); 275Debug.Assert(IsBlocking); 276Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user. 285Debug.Assert(!IsBlocking); 286Debug.Assert(_unregisterCalled); // Should only be called when the wait is unregistered by the user.
src\libraries\System.Private.CoreLib\src\System\Threading\RegisteredWaitHandle.Unix.cs (1)
35Debug.Assert(_waitHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Semaphore.Windows.cs (3)
22Debug.Assert(initialCount >= 0); 23Debug.Assert(maximumCount >= 1); 24Debug.Assert(initialCount <= maximumCount);
src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (1)
811Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount);
src\libraries\System.Private.CoreLib\src\System\Threading\SpinLock.cs (3)
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\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\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (1)
211Debug.Assert(state is ConcurrentExclusiveSchedulerPair);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Future.cs (3)
410Debug.Assert(success); 487Debug.Assert(m_action != null); 1422Debug.Assert(task != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\FutureFactory.cs (9)
1270Debug.Assert(thisRef != null); 1634Debug.Assert(continuationAction != null); 1679Debug.Assert(state is Func<Task[], TResult>); 1686Debug.Assert(continuationAction != null); 1691Debug.Assert(state is Action<Task[]>); 1999Debug.Assert(state is Func<Task, TResult>); 2006Debug.Assert(continuationAction != null); 2010Debug.Assert(state is Action<Task>); 2052Debug.Assert(continuationAction != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (35)
639Debug.Assert(continuation != null); 1992Debug.Assert(userDelegateExecute || m_contingentProperties != null); 2154Debug.Assert(childTask != null); 2199Debug.Assert(props != null); 2221Debug.Assert(exceptionHolder != null); 2383Debug.Assert(obj is Task); 2416Debug.Assert(unhandledException != null); 2486Debug.Assert(continuationAction != null); 2557Debug.Assert(stateMachineBox != null); 2863Debug.Assert(source != null); 2864Debug.Assert(millisecondsDelay != 0); 2918Debug.Assert(completingTask.IsCompleted); 3011Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite); 3246Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default); 3267Debug.Assert(m_contingentProperties!.m_cancellationToken == default); 3460Debug.Assert(continuationObject != null); 3562Debug.Assert(currentContinuation is TaskContinuation); 3599Debug.Assert(currentContinuation is ITaskCompletionAction); 4619Debug.Assert(tc != null); 5364Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion); 5366Debug.Assert(signaledTaskIndex >= 0); 5495Debug.Assert(exception != null); 5509Debug.Assert(exception != null); 5802Debug.Assert(millisecondsDelay != 0); 5861Debug.Assert(token.CanBeCanceled); 6127Debug.Assert(failedOrCanceled is List<Task>); 6150Debug.Assert(completed); 6182Debug.Assert(failedOrCanceled is Task); 6200Debug.Assert(IsCompleted); 6448Debug.Assert(task.Status == TaskStatus.RanToCompletion); 6622Debug.Assert(task1 != null && task2 != null); 6658Debug.Assert(task1 != null && task2 != null); 6659Debug.Assert(task1.IsCompleted || task2.IsCompleted); 6930Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending); 7051Debug.Assert(outerTask != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskAsyncEnumerableExtensions.ToBlockingEnumerable.cs (2)
48Debug.Assert(moveNextTask.IsCompleted); 66Debug.Assert(disposeTask.IsCompleted);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (19)
39Debug.Assert(m_action != null); 85Debug.Assert(m_action != null); 131Debug.Assert(m_action != null); 177Debug.Assert(m_action != null); 216Debug.Assert(task != null); 217Debug.Assert(task.m_taskScheduler != null); 291Debug.Assert(completedTask != null); 295Debug.Assert(continuationTask != null); 369Debug.Assert(state is Action); 385Debug.Assert(context != null); 418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation); 466Debug.Assert(scheduler != null); 534Debug.Assert(action != null); 549Debug.Assert(action != null); 550Debug.Assert(scheduler != null); 669Debug.Assert(state is Action); 683Debug.Assert(callback != null); 684Debug.Assert(currentTask == Task.t_currentTask); 826Debug.Assert(m_action != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory.cs (3)
1598Debug.Assert(tasksCopy != null); 1668Debug.Assert(tasksCopy != null); 2338Debug.Assert(tasks != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskScheduler.cs (2)
232Debug.Assert(task != null); 605Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
34Debug.Assert(s is Task);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TplEventSource.cs (1)
546Diagnostics.Debug.Assert(stateMachineBox != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ValueTask.cs (12)
175Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 301Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 324Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 346Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 373Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 394Debug.Assert(obj == null || obj is Task || obj is IValueTaskSource); 575Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 707Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 730Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 752Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 779Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>); 803Debug.Assert(obj == null || obj is Task<TResult> || obj is IValueTaskSource<TResult>);
src\libraries\System.Private.CoreLib\src\System\Threading\Thread.cs (10)
43Debug.Assert(state != null); 283Debug.Assert(startHelper != null); 398Debug.Assert(ThreadState.HasFlag(ThreadState.Unstarted) || this == CurrentThread); 399Debug.Assert(IsThreadPoolThread); 411Debug.Assert(this == CurrentThread); 412Debug.Assert(!IsThreadStartSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 423Debug.Assert(this == CurrentThread); 424Debug.Assert(!IsThreadStartSupported || IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads 425Debug.Assert(_mayNeedResetForThreadPool); 697Debug.Assert(slot.Data != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadBlockingInfo.cs (8)
66Debug.Assert(objectPtr != null); 77Debug.Assert(_objectPtr != null); 78Debug.Assert(t_first != null); 79Debug.Assert(t_first->_next == _next); 95Debug.Assert(_objectPtr != null); 114Debug.Assert(_objectKind == ObjectKind.Condition); 134Debug.Assert(_objectPtr != null); 147Debug.Assert(_objectKind == ObjectKind.Condition);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadInt64PersistentCounter.cs (6)
30Debug.Assert(threadLocalCountObject is ThreadLocalNode); 37Debug.Assert(threadLocalCountObject is ThreadLocalNode); 99Debug.Assert(counter != null); 139Debug.Assert(count != 0); 154Debug.Assert(count != 0); 180Debug.Assert(node != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadLocal.cs (4)
519Debug.Assert(table.Length < minLength); 557Debug.Assert(minSize > 0); 712Debug.Assert(slotArray != null); 751Debug.Assert(linkedSlot._previous != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.Portable.cs (1)
81Debug.Assert(wrapper._boundHandle != null);
src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolWorkQueue.cs (33)
42Debug.Assert(queue != null); 46Debug.Assert(Array.IndexOf(oldQueues, queue) < 0); 60Debug.Assert(queue != null); 193Debug.Assert(m_headIndex <= m_tailIndex); 211Debug.Assert(unused == null || unused == obj); 476Debug.Assert(s_assignableWorkItemQueueCount > 0); 487Debug.Assert(count >= 0); 518Debug.Assert(s_assignableWorkItemQueueCount > 0); 533Debug.Assert(_assignedWorkItemQueueThreadCounts[queueIndex] >= 0); 556Debug.Assert(s_assignableWorkItemQueueCount > 0); 564Debug.Assert(newCount >= 0); 592Debug.Assert(ThreadPoolWorkQueueThreadLocals.threadLocals == null); 633Debug.Assert((callback is IThreadPoolWorkItem) ^ (callback is Task)); 702Debug.Assert((workItem is IThreadPoolWorkItem) ^ (workItem is Task)); 843Debug.Assert(!tl.isProcessingHighPriorityWorkItems); 941Debug.Assert(workQueue._separated.queueProcessingStage == QueueProcessingStage.Scheduled); 970Debug.Assert(workQueue._separated.queueProcessingStage != QueueProcessingStage.NotScheduled); 984Debug.Assert(stageBeforeUpdate != QueueProcessingStage.NotScheduled); 1017Debug.Assert(workQueue._nextWorkItemToProcess == null); 1028Debug.Assert(workQueue._separated.queueProcessingStage != QueueProcessingStage.NotScheduled); 1042Debug.Assert(stageBeforeUpdate != QueueProcessingStage.NotScheduled); 1200Debug.Assert(ThreadPool.EnableWorkerTracking); 1201Debug.Assert(currentThread == Thread.CurrentThread); 1228Debug.Assert(workItem is IThreadPoolWorkItem); 1469Debug.Assert(quwi._callback != null); 1478Debug.Assert(context != null); 1501Debug.Assert(callback != null); 1512Debug.Assert(_callback != null); 1527Debug.Assert(callback != null); 1538Debug.Assert(_callback != null); 1555Debug.Assert(callback != null); 1566Debug.Assert(_callback != null); 1911Debug.Assert(null != workItem);
src\libraries\System.Private.CoreLib\src\System\Threading\TimeoutHelper.cs (1)
33Debug.Assert(originalWaitMillisecondsTimeout != Timeout.Infinite);
src\libraries\System.Private.CoreLib\src\System\Threading\Timer.cs (7)
408Debug.Assert(timer._short); 413Debug.Assert(!timer._short); 434Debug.Assert(ActiveCount >= 0); 585Debug.Assert(toSignal != null); 651Debug.Assert( 702Debug.Assert(toSignal is WaitHandle || toSignal is Task); 740Debug.Assert(state is TimerQueueTimer);
src\libraries\System.Private.CoreLib\src\System\Threading\TimerQueue.Portable.cs (2)
31Debug.Assert(s_scheduledTimers == null); 52Debug.Assert((int)actualDuration >= 0);
src\libraries\System.Private.CoreLib\src\System\Threading\WaitHandle.cs (9)
113Debug.Assert(millisecondsTimeout >= -1); 242Debug.Assert(waitHandles.Length > 0); 243Debug.Assert(waitHandles.Length <= MaxWaitHandles); 282Debug.Assert(lastSafeWaitHandle != null); 367Debug.Assert(safeWaitHandles.Length != 0); 368Debug.Assert(safeWaitHandles.Length <= MaxWaitHandles); 369Debug.Assert(millisecondsTimeout >= -1); 380Debug.Assert(safeWaitHandles[i] != null); 390Debug.Assert(safeWaitHandles[i] != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.cs (4)
109Debug.Assert(dataArray![dataIndex] == data); 117Debug.Assert(callback != null); 188Debug.Assert(!data._completed); 218Debug.Assert(state != null);
src\libraries\System.Private.CoreLib\src\System\Threading\Win32ThreadPoolNativeOverlapped.OverlappedData.cs (1)
23Debug.Assert(_boundHandle == null); //not in use
src\libraries\System.Private.CoreLib\src\System\ThrowHelper.cs (1)
714Debug.Assert(array.Length - offset < count);
src\libraries\System.Private.CoreLib\src\System\TimeOnly.cs (4)
862Debug.Assert(result != ParseFailureKind.None); 869Debug.Assert(result == ParseFailureKind.Format_DateTimeOnlyContainsNoneDateParts); 929Debug.Assert(charsWritten == destination.Length); 935Debug.Assert(charsWritten == destination.Length);
src\libraries\System.Private.CoreLib\src\System\TimeSpan.cs (2)
442System.Diagnostics.Debug.Assert(minUnits < 0); 443System.Diagnostics.Debug.Assert(maxUnits > 0);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.cs (5)
316Debug.Assert(_adjustmentRules != null); 842Debug.Assert(dateTime.Kind != DateTimeKind.Utc); 2044Debug.Assert(zone != null); 2055Debug.Assert(Monitor.IsEntered(cachedData)); 2123Debug.Assert(!Invariant);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.FullGlobalizationData.Unix.cs (1)
77Debug.Assert(!GlobalizationMode.Invariant);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.cs (4)
289Debug.Assert(Monitor.IsEntered(cachedData)); 315Debug.Assert(Monitor.IsEntered(cachedData)); 926Debug.Assert(date[0] == 'J'); 957Debug.Assert(i > 0 && i < days.Length);
src\libraries\System.Private.CoreLib\src\System\TimeZoneInfo.Unix.NonAndroid.cs (5)
75Debug.Assert(!Invariant); 416Debug.Assert(!Invariant); 458Debug.Assert(!Invariant); 521Debug.Assert(!Invariant); 595Debug.Assert(!Invariant);
src\libraries\System.Private.CoreLib\src\System\TypedReference.cs (1)
56Debug.Assert(targetType.IsValueType);
src\libraries\System.Private.CoreLib\src\System\UInt128.cs (12)
547Debug.Assert(value >= 0); 548Debug.Assert(double.IsFinite(value)); 549Debug.Assert(value < TwoPow128); 1094Debug.Assert(left.Length >= right.Length); 1114Debug.Assert(q <= 0xFFFFFFFF); 1168Debug.Assert(left.Length >= 1); 1169Debug.Assert(right.Length >= 1); 1170Debug.Assert(left.Length >= right.Length); 1234Debug.Assert(carry == (t + 1)); 1240Debug.Assert(carry == 1); 1264Debug.Assert(left.Length >= right.Length); 1265Debug.Assert(q <= 0xFFFFFFFF);
src\libraries\System.Private.CoreLib\src\System\Version.cs (3)
85Debug.Assert(version != null); 175Debug.Assert(success); 205Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\System.Private.CoreLib\src\System\WeakReference.cs (1)
223Debug.Assert(this.GetType() != typeof(WeakReference));
src\libraries\System.Reflection.Metadata\src\System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
25Debug.Assert(genericArgs.Length > 0); 189Debug.Assert(rankOrModifier >= 2);
src\System\Array.CoreCLR.cs (12)
111Debug.Assert(elementType.IsPrimitiveType()); 128Debug.Assert(sourceArray.Rank == destinationArray.Rank); 251Debug.Assert(!destTH.IsTypeDesc && destTH.AsMethodTable()->IsValueType); 252Debug.Assert(!RuntimeHelpers.GetMethodTable(sourceArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 293Debug.Assert(!srcTH.IsTypeDesc && srcTH.AsMethodTable()->IsValueType); 294Debug.Assert(!RuntimeHelpers.GetMethodTable(destinationArray)->GetArrayElementTypeHandle().AsMethodTable()->IsValueType); 380Debug.Assert(totalByteLength % (nuint)sizeof(IntPtr) == 0); 427Debug.Assert(Rank == 1); 443Debug.Assert(indices.Length == Rank); 457Debug.Assert((nuint)flattenedIndex < (nuint)LongLength); 482Debug.Assert((nuint)flattenedIndex < NativeLength); 523Debug.Assert((nuint)flattenedIndex < NativeLength);
src\System\Attribute.CoreCLR.cs (13)
18Debug.Assert(element != null); 19Debug.Assert(type != null); 20Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 88Debug.Assert(property != null); 122Debug.Assert(element != null); 123Debug.Assert(type != null); 124Debug.Assert(type.IsSubclassOf(typeof(Attribute)) || type == typeof(Attribute)); 162Debug.Assert(ev != null); 180Debug.Assert(element != null); 211Debug.Assert(param != null); 239Debug.Assert(param != null); 328Debug.Assert(param != null); 329Debug.Assert(type != null);
src\System\Collections\Generic\ComparerHelpers.cs (2)
30Debug.Assert(type != null && type is RuntimeType); 64Debug.Assert(type != null && type is RuntimeType);
src\System\Delegate.CoreCLR.cs (3)
437Debug.Assert(type.IsAssignableTo(typeof(MulticastDelegate))); 498Debug.Assert(ptr != null); 499Debug.Assert(ptr == GetMulticastInvoke(pMT));
src\System\Enum.CoreCLR.cs (4)
20Debug.Assert(rt.IsActualEnum); 69Debug.Assert(s_underlyingTypes[(int)CorElementType.ELEMENT_TYPE_U] == typeof(nuint)); 74Debug.Assert(underlyingType != null); 116Debug.Assert(values!.GetType() == typeof(TStorage[]));
src\System\Exception.CoreCLR.cs (1)
71Debug.Assert(methodInfo != null);
src\System\GC.CoreCLR.cs (7)
536Debug.Assert(status == StartNoGCRegionStatus.Succeeded); 727Debug.Assert(false); 740Debug.Assert(pWorkItem->scheduled); 876Debug.Assert(name != null); 877Debug.Assert(configurationContext != null); 880Debug.Assert(context.Configurations != null); 991Debug.Assert(status == RefreshMemoryStatus.Succeeded);
src\System\MulticastDelegate.CoreCLR.cs (4)
125Debug.Assert(d != null); 126Debug.Assert(_invocationList is object[]); 135Debug.Assert(invocationList[i] is Delegate); 297Debug.Assert(_invocationList is object[]);
src\System\Object.CoreCLR.cs (1)
31Debug.Assert(clone != this);
src\System\Reflection\Associates.cs (2)
48Debug.Assert(declaredType != null); 49Debug.Assert(reflectedType != null);
src\System\Reflection\Emit\DynamicILGenerator.cs (1)
739Debug.Assert(m_exceptions != null);
src\System\Reflection\Emit\DynamicMethod.CoreCLR.cs (2)
105Debug.Assert(_methodHandle != null); 106Debug.Assert(_parameterTypes != null);
src\System\Reflection\Emit\RuntimeAssemblyBuilder.cs (1)
89Debug.Assert(name is not null);
src\System\Reflection\Emit\RuntimeILGenerator.cs (17)
30Debug.Assert(incoming != null); 87Debug.Assert(methodBuilder != null); 88Debug.Assert(methodBuilder is MethodBuilder || methodBuilder is DynamicMethod); 158Debug.Assert(m_depthAdjustment >= 0); 159Debug.Assert(m_curDepth >= 0); 317Debug.Assert(depth >= -1); 318Debug.Assert(targetDepth >= -1); 332Debug.Assert(m_depthAdjustment >= 0); 362Debug.Assert(m_RelocFixupList == null); 1099Debug.Assert(depth >= -1); 1372Debug.Assert(m_currentCatch > 0); 1373Debug.Assert(m_catchAddr[m_currentCatch - 1] > 0); 1374Debug.Assert(m_catchEndAddr[m_currentCatch - 1] == -1); 1449Debug.Assert(exc != null); 1450Debug.Assert(m_currentCatch > 0); 1451Debug.Assert(exc.m_currentCatch > 0); 1461Debug.Assert(exc.GetEndAddress() != GetEndAddress());
src\System\Reflection\Emit\RuntimeMethodBuilder.cs (7)
867Debug.Assert(tryStartOffset >= 0); 868Debug.Assert(tryEndOffset >= 0); 869Debug.Assert(filterOffset >= 0); 870Debug.Assert(handlerStartOffset >= 0); 871Debug.Assert(handlerEndOffset >= 0); 872Debug.Assert(IsValidKind((ExceptionHandlingClauseOptions)kind)); 873Debug.Assert(kind != (int)ExceptionHandlingClauseOptions.Clause || (exceptionTypeToken & 0x00FFFFFF) != 0);
src\System\Reflection\Emit\RuntimeModuleBuilder.cs (7)
129Debug.Assert(method != null); 139Debug.Assert(method != null); 152Debug.Assert(runtimeField != null); 413Debug.Assert(methodBase is RuntimeMethodInfo || methodBase is RuntimeConstructorInfo); 417Debug.Assert(masmi != null); 457Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 1065Debug.Assert(methodInfo != null);
src\System\Reflection\Emit\RuntimeTypeBuilder.cs (4)
47Debug.Assert(m_con != null); 360Debug.Assert(declMeth != null); 374Debug.Assert(declType != null); 1474Debug.Assert(m_isHiddenGlobalType || typeInfo != null);
src\System\Reflection\Emit\SignatureHelper.cs (6)
273Debug.Assert(clsArgument != null); 291Debug.Assert(!MetadataToken.IsNullToken(token)); 313Debug.Assert(!MetadataToken.IsNullToken(token)); 734Debug.Assert(clsArgument != null); 754Debug.Assert(!MetadataToken.IsNullToken(token)); 777Debug.Assert(!MetadataToken.IsNullToken(token));
src\System\Reflection\MdImport.cs (3)
194Debug.Assert(0 <= index && index < Length); 284Debug.Assert(marshalTypeName is not null); 363Debug.Assert(stringMetadataEncoding != null);
src\System\Reflection\RuntimeAssembly.cs (1)
766Debug.Assert((type != null) != (exception != null)); // Exactly one of these must be non-null.
src\System\Reflection\RuntimeConstructorInfo.CoreCLR.cs (2)
39Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 206Debug.Assert((InvocationFlags & InvocationFlags.RunClassConstructor) != 0);
src\System\Reflection\RuntimeCustomAttributeData.cs (64)
20Debug.Assert(target is not null); 30Debug.Assert(target is not null); 40Debug.Assert(target is not null); 50Debug.Assert(target is not null); 57Debug.Assert(target is not null); 64Debug.Assert(target is not null); 71Debug.Assert(target is not null); 81Debug.Assert(target is not null); 90Debug.Assert(target is not null); 100Debug.Assert(pseudoAttributes.Count != 0); 404Debug.Assert(allCtors.Length == 1); 405Debug.Assert(allCtors[0].GetParametersAsSpan().Length == 0); 475Debug.Assert(p.MemberInfo is not null); 546Debug.Assert(type is not null); 671Debug.Assert(customAttributeCtorParameters is not null); 672Debug.Assert(customAttributeNamedParameters is not null); 784Debug.Assert(namedArgType.EncodedEnumType == argType.EncodedEnumType); 930Debug.Assert(size <= (_blob.Length - _curr)); 1080Debug.Assert(parameterType is not null); 1118Debug.Assert(type is not null); 1147Debug.Assert(method is not null); 1148Debug.Assert(caType is not null); 1174Debug.Assert(ctor is not null); 1175Debug.Assert(caType is not null); 1184Debug.Assert(property is not null); 1185Debug.Assert(caType is not null); 1194Debug.Assert(e is not null); 1195Debug.Assert(caType is not null); 1204Debug.Assert(field is not null); 1205Debug.Assert(caType is not null); 1215Debug.Assert(parameter is not null); 1216Debug.Assert(caType is not null); 1226Debug.Assert(assembly is not null); 1227Debug.Assert(caType is not null); 1235Debug.Assert(module is not null); 1236Debug.Assert(caType is not null); 1245Debug.Assert(type is not null); 1246Debug.Assert(caType is not null); 1290Debug.Assert(method is not null); 1291Debug.Assert(caType is not null); 1332Debug.Assert(ctor != null); 1333Debug.Assert(caType != null); 1342Debug.Assert(property is not null); 1343Debug.Assert(caType is not null); 1352Debug.Assert(e is not null); 1353Debug.Assert(caType is not null); 1362Debug.Assert(field is not null); 1363Debug.Assert(caType is not null); 1374Debug.Assert(parameter is not null); 1375Debug.Assert(caType is not null); 1386Debug.Assert(assembly is not null); 1387Debug.Assert(caType is not null); 1397Debug.Assert(module is not null); 1398Debug.Assert(caType is not null); 1431Debug.Assert(attributeCtorToken == 0); 1450Debug.Assert(attributeFilterType is null); 1992Debug.Assert(type is not null); 1993Debug.Assert(caType is not null); 2036Debug.Assert(method is not null); 2037Debug.Assert(caType is not null); 2076Debug.Assert(parameter is not null); 2077Debug.Assert(caType is not null); 2132Debug.Assert(field is not null); 2133Debug.Assert(caType is not null);
src\System\Reflection\RuntimeEventInfo.cs (3)
30Debug.Assert(declaredType != null); 31Debug.Assert(reflectedTypeCache != null); 32Debug.Assert(!reflectedTypeCache.IsGlobal);
src\System\Reflection\RuntimeMethodInfo.CoreCLR.cs (3)
38Debug.Assert((flags & InvocationFlags.Initialized) == InvocationFlags.Initialized); 59Debug.Assert(!handle.IsNullHandle()); 60Debug.Assert(methodAttributes == RuntimeMethodHandle.GetAttributes(handle));
src\System\Reflection\RuntimeParameterInfo.cs (15)
16Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 23Debug.Assert(method is RuntimeMethodInfo || method is RuntimeConstructorInfo); 35Debug.Assert(ReferenceEquals(methodHandle, member)); 130Debug.Assert(result != null); 164Debug.Assert(m_originalMember != null); 183Debug.Assert(member != null); 184Debug.Assert(MdToken.IsNullToken(tkParamDef) == scope.Equals((MetadataImport)default)); 185Debug.Assert(MdToken.IsNullToken(tkParamDef) || MdToken.IsTokenOfType(tkParamDef, MetadataTokenType.ParamDef)); 221Debug.Assert(m_signature != null); 229Debug.Assert(parameterType != null); 335Debug.Assert(!m_noMetadata); 376Debug.Assert(attr.Constructor.DeclaringType == typeof(DecimalConstantAttribute)); 378Debug.Assert(args.Count == 5); 397Debug.Assert(attr.Constructor.DeclaringType == typeof(DateTimeConstantAttribute)); 398Debug.Assert(attr.ConstructorArguments.Count == 1);
src\System\Reflection\RuntimePropertyInfo.cs (6)
34Debug.Assert(declaredType != null); 35Debug.Assert(reflectedTypeCache != null); 36Debug.Assert(!reflectedTypeCache.IsGlobal); 106Debug.Assert(Name.Equals(target.Name)); 107Debug.Assert(this != target); 108Debug.Assert(this.ReflectedType == target.ReflectedType);
src\System\Reflection\TypeNameResolver.CoreCLR.cs (1)
122Debug.Assert(type != null);
src\System\Runtime\CompilerServices\CastHelpers.cs (10)
249Debug.Assert(result != CastResult.CannotCast); 421Debug.Assert(index >= 0); 438Debug.Assert(index >= 0); 480Debug.Assert(obj != null); 494Debug.Assert(obj != null); 497Debug.Assert(elementType != RuntimeHelpers.GetMethodTable(obj)); // Should be handled by caller 512Debug.Assert(obj != null); 552Debug.Assert(typeMT->InstantiationArg0() == **typeMT->PerInstInfo); 618Debug.Assert(srcMT->IsNullable); 646Debug.Assert(pMT1->IsValueType);
src\System\Runtime\CompilerServices\RuntimeHelpers.CoreCLR.cs (17)
53Debug.Assert(!elementTH.AsMethodTable()->ContainsGCPointers); 102Debug.Assert(!th.IsTypeDesc); // TypeDesc can't be used as generic parameter 109Debug.Assert(uint.IsPow2(targetTypeSize)); 411Debug.Assert(ObjectHasComponentSize(array)); 419Debug.Assert(GetMultiDimensionalArrayRank(array) > 0); 827Debug.Assert(HasComponentSize); 839Debug.Assert(HasComponentSize); 892Debug.Assert(HasComponentSize); 919Debug.Assert(IsNullable); 920Debug.Assert((NullableValueAddrOffset + NullableValueSize) == GetNumInstanceFieldBytes()); 929Debug.Assert(ContainsGCPointers); 930Debug.Assert((BaseSize - (nuint)(2 * sizeof(IntPtr)) == GetNumInstanceFieldBytes())); 1014Debug.Assert(HasCheckedCanCompareBitsOrUseFastGetHashCode); 1025Debug.Assert(HasCheckedStreamOverride); 1034Debug.Assert(HasCheckedStreamOverride); 1104Debug.Assert(!IsTypeDesc); 1116Debug.Assert(IsTypeDesc);
src\System\RuntimeHandles.cs (20)
293Debug.Assert(!type.GetNativeTypeHandle().IsTypeDesc); 304Debug.Assert(!type.GetNativeTypeHandle().IsTypeDesc); 327Debug.Assert(rt != null); 472Debug.Assert(type.IsFunctionPointer); 534Debug.Assert(!IsGenericVariable(type)); 555Debug.Assert(!IsGenericVariable(type)); 608Debug.Assert(type != null); 720Debug.Assert(IsGenericVariable(type)); 1087Debug.Assert(!method.IsNullHandle()); 1104Debug.Assert(method != null); 1116Debug.Assert(method != null); 1193Debug.Assert(destNullableType.IsNullableOfT); 1516Debug.Assert(!field.IsNullHandle()); 1518Debug.Assert(pMT != null); 1660Debug.Assert(!th.IsTypeDesc); 2038Debug.Assert(_returnTypeORfieldType != null); 2051Debug.Assert((_managedCallingConventionAndArgIteratorFlags & 0xffffff00) == 0); 2086Debug.Assert(_arguments != null); 2124Debug.Assert(offset == -1); 2142Debug.Assert(offset == -1);
src\System\RuntimeType.ActivatorCache.cs (5)
38Debug.Assert(rt != null); 98Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public 108Debug.Assert(_ctorIsPublic); // implicit parameterless ctor is always considered public 113Debug.Assert(_pfnValueCtor == null); // Non-value types shouldn't have a value constructor. 147Debug.Assert(_originalRuntimeType.IsValueType);
src\System\RuntimeType.BoxCache.cs (2)
34Debug.Assert(rt != null); 114Debug.Assert(rt != null);
src\System\RuntimeType.CoreCLR.cs (58)
76Debug.Assert(index < Count); 175Debug.Assert(retVal || RequiresStringComparison()); 555Debug.Assert(false); 570Debug.Assert(cachedMembers![freeSlotIndex] == null); 587Debug.Assert(declaringType != null); 602Debug.Assert(!methodHandle.IsNullHandle()); 607Debug.Assert( 660Debug.Assert(!methodHandle.IsNullHandle()); 666Debug.Assert( 698Debug.Assert( 715Debug.Assert((methodAttributes & (MethodAttributes.Virtual | MethodAttributes.Abstract)) == 0); 764Debug.Assert(!methodHandle.IsNullHandle()); 770Debug.Assert( 845Debug.Assert(count > result.Length); 858Debug.Assert(declaringType != null); 859Debug.Assert(ReflectedType != null); 874Debug.Assert(!runtimeFieldHandle.IsNullHandle()); 904Debug.Assert(declaringType != null); 905Debug.Assert(ReflectedType != null); 921Debug.Assert(MdToken.IsTokenOfType(tkField, MetadataTokenType.FieldDef)); 922Debug.Assert(!MdToken.IsNullToken(tkField)); 1008Debug.Assert(interfaceType.IsInterface); 1114Debug.Assert(ReflectedType != null); 1163Debug.Assert(!MdToken.IsNullToken(tkEvent)); 1164Debug.Assert(MdToken.IsTokenOfType(tkEvent, MetadataTokenType.Event)); 1206Debug.Assert(ReflectedType != null); 1212Debug.Assert(declaringType != null); 1268Debug.Assert((declaringType.IsInterface && isInterface && csPropertyInfos == null) || 1275Debug.Assert(!MdToken.IsNullToken(tkProperty)); 1276Debug.Assert(MdToken.IsTokenOfType(tkProperty, MetadataTokenType.Property)); 1317Debug.Assert(associateMethod.IsVirtual); 1392Debug.Assert(listType == MemberListType.All); 1482Debug.Assert(type.IsFunctionPointer); 1566Debug.Assert(enclosingType != typeof(void)); 1612Debug.Assert(m_runtimeType.IsGenericType); 1794Debug.Assert(!methodHandle.IsNullHandle()); 2011Debug.Assert(genericArguments.Length == genericParameters.Length); 2040Debug.Assert(fullname.Equals(ns + "." + name)); 2128Debug.Assert(name != null); 2149Debug.Assert(memberInfo != null); 2150Debug.Assert(name is null || (bindingFlags & BindingFlags.IgnoreCase) == 0 || (name.ToLowerInvariant().Equals(name))); 2223Debug.Assert(type is not null); 2224Debug.Assert(type is RuntimeType); 2256Debug.Assert(methodBase != null); 2304Debug.Assert((callConv & CallingConventions.VarArgs) != 0); 2423Debug.Assert(cache == null || cache is RuntimeTypeCache); 2440Debug.Assert(cache is RuntimeTypeCache); 2469Debug.Assert(cache != null); 2705Debug.Assert(i == members.Length); 2723Debug.Assert(interfaceType.IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2724Debug.Assert(!IsInterface); // VerifyInterfaceIsImplemented enforces this invariant 2745Debug.Assert(ifaceMethodBase is RuntimeMethodInfo); 2762Debug.Assert(rtTypeMethodBase is null || rtTypeMethodBase is RuntimeMethodInfo); 3105Debug.Assert(i == compressMembers.Length); 3709Debug.Assert(targetType.IsPointer || targetType.IsEnum || targetType.IsPrimitive || targetType.IsFunctionPointer); 3791Debug.Assert(parameters.Length > 0); 3924Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) == 4025Debug.Assert(IsValueType);
src\System\RuntimeType.CreateUninitializedCache.CoreCLR.cs (2)
31Debug.Assert(rt != null); 64Debug.Assert(rt != null);
src\System\StubHelpers.cs (4)
34Debug.Assert(cbAllocLength <= 512); // Some arbitrary upper limit, in most cases SystemMaxDBCSCharSize is expected to be 1 or 2. 1518Debug.Assert(success); 1537Debug.Assert(success); 1556Debug.Assert(success);
src\System\Text\StringBuilder.CoreCLR.cs (1)
15Debug.Assert(requiredCapacity <= m_MaxCapacity);
src\System\Threading\LowLevelLifoSemaphore.Unix.cs (7)
20Debug.Assert(maximumSignalCount > 0); 26Debug.Assert(_semaphore != null); 27Debug.Assert(timeoutMs >= -1); 30Debug.Assert(waitResult == WaitHandle.WaitSuccess || waitResult == WaitHandle.WaitTimeout); 39Debug.Assert(_semaphore != null); 40Debug.Assert(count > 0); 47Debug.Assert(_semaphore != null);
src\System\Threading\Monitor.CoreCLR.cs (1)
48Debug.Assert(lockTaken);
src\System\Threading\Thread.CoreCLR.cs (7)
105Debug.Assert(startHelper != null); 246Debug.Assert(value); 247Debug.Assert(!_isDead); 248Debug.Assert(((ThreadState & ThreadState.Unstarted) != 0) 460Debug.Assert(this == CurrentThread); 471Debug.Assert(this == CurrentThread); 472Debug.Assert(_mayNeedResetForThreadPool);
src\System\TypedReference.CoreCLR.cs (1)
59Debug.Assert(pMethodTable is not null);
src\System\ValueType.cs (2)
138Debug.Assert(fieldSize != 0); 143Debug.Assert(fieldMT != null);
System.Private.CoreLib.Generators (5)
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
System.Private.DataContractSerialization (328)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
System\Runtime\Serialization\ClassDataContract.cs (6)
189Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 219Debug.Assert(UnderlyingType != Globals.TypeOfSchemaDefinedType); 385Debug.Assert(context != null); 957Debug.Assert(Members != null); 1105Debug.Assert(method.DeclaringType != null); 1122Debug.Assert(method.DeclaringType != null);
System\Runtime\Serialization\CodeGenerator.cs (6)
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));
System\Runtime\Serialization\CollectionDataContract.cs (8)
617Debug.Assert(KeyName != null); 618Debug.Assert(ValueName != null); 1159Debug.Assert(knownInterfaceType != null); 1169Debug.Assert(getEnumeratorMethod != null); 1230Debug.Assert(addMethodTypeArray != null); 1235Debug.Assert(getEnumeratorMethod != null); 1558Debug.Assert(context != null); 1569Debug.Assert(context != null);
System\Runtime\Serialization\DataContract.cs (3)
1025Debug.Assert(value != null); 1035Debug.Assert(value != null); 2424Debug.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 (5)
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 (2)
133Debug.Assert(context != null); 142Debug.Assert(context != null);
System\Runtime\Serialization\Json\JsonEncodingStreamWrapper.cs (6)
185Debug.Assert(_bytes != null); 186Debug.Assert(_chars != null); 261Debug.Assert(_bytes != null); 262Debug.Assert(_chars != null); 356Debug.Assert(_bytes != null); 420Debug.Assert(_bytes != null);
System\Runtime\Serialization\Json\JsonFormatGeneratorStatics.cs (33)
96Debug.Assert(s_boxPointer != null); 109Debug.Assert(s_collectionItemNameProperty != null); 129Debug.Assert(s_ienumeratorGetCurrentMethod != null); 142Debug.Assert(s_getItemContractMethod != null); 155Debug.Assert(s_getJsonDataContractMethod != null); 168Debug.Assert(s_getJsonMemberIndexMethod != null); 181Debug.Assert(s_getRevisedItemContractMethod != null); 194Debug.Assert(s_getUninitializedObjectMethod != null); 207Debug.Assert(s_isStartElementMethod0 != null); 219Debug.Assert(s_isStartElementMethod2 != null); 231Debug.Assert(s_localNameProperty != null); 243Debug.Assert(s_namespaceProperty != null); 255Debug.Assert(s_ienumeratorMoveNextMethod != null); 267Debug.Assert(s_moveToContentMethod != null); 279Debug.Assert(s_nodeTypeProperty != null); 291Debug.Assert(s_onDeserializationMethod != null); 305Debug.Assert(s_readJsonValueMethod != null); 317Debug.Assert(s_serializationExceptionCtor != null); 330Debug.Assert(s_throwDuplicateMemberExceptionMethod != null); 342Debug.Assert(s_throwMissingRequiredMembersMethod != null); 354Debug.Assert(s_typeHandleProperty != null); 366Debug.Assert(s_unboxPointer != null); 378Debug.Assert(s_useSimpleDictionaryFormatReadProperty != null); 390Debug.Assert(s_useSimpleDictionaryFormatWriteProperty != null); 402Debug.Assert(s_writeAttributeStringMethod != null); 414Debug.Assert(s_writeEndElementMethod != null); 427Debug.Assert(s_writeJsonISerializableMethod != null); 439Debug.Assert(s_writeJsonNameWithMappingMethod != null); 452Debug.Assert(s_writeJsonValueMethod != null); 464Debug.Assert(s_writeStartElementMethod != null); 477Debug.Assert(s_writeStartElementStringMethod != null); 490Debug.Assert(s_parseEnumMethod != null); 503Debug.Assert(s_getJsonMemberNameMethod != null);
System\Runtime\Serialization\Json\JsonFormatReaderGenerator.cs (3)
685Debug.Assert(growingCollection != null); 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 (1)
418Debug.Assert(_charactersToSkipOnNextRead != null);
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 (3)
25Debug.Assert(classDataContract != null); 63Debug.Assert(memberNamespaces != null); 126Debug.Assert(collectionContract.Kind == CollectionKind.Dictionary || collectionContract.Kind == CollectionKind.GenericDictionary);
System\Runtime\Serialization\SchemaExporter.cs (1)
309Debug.Assert(genericArgumentCounts != null);
System\Runtime\Serialization\SchemaImporter.cs (6)
484Debug.Assert(dataContract != null); // Throws above if false 664Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 836Debug.Assert(dataContract.BaseClassContract != null); // ImportBaseContract will always set this... or throw. 997Debug.Assert(dataContract.Members != null); // This method is only called from ImportClass() after that method has initialized the Members collection. 998Debug.Assert(memberName != null); // At this point, elements without a name should have been handled. 1060Debug.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); 85Debug.Assert(s_dictionaryEnumeratorCtor != null); 99Debug.Assert(s_ienumeratorMoveNextMethod != null); 113Debug.Assert(s_ienumeratorGetCurrentMethod != null); 128Debug.Assert(s_getItemContractMethod != null); 142Debug.Assert(s_isStartElementMethod2 != null); 156Debug.Assert(s_isStartElementMethod0 != null); 171Debug.Assert(s_getUninitializedObjectMethod != null); 185Debug.Assert(s_onDeserializationMethod != null); 202Debug.Assert(s_nodeTypeProperty != null); 224Debug.Assert(s_hashtableCtor != null); 238Debug.Assert(s_getStreamingContextMethod != null); 252Debug.Assert(s_getCollectionMemberMethod != null); 266Debug.Assert(s_storeCollectionMemberInfoMethod != null); 280Debug.Assert(s_resetCollectionMemberInfoMethod != null); 294Debug.Assert(s_storeIsGetOnlyCollectionMethod != null); 308Debug.Assert(s_resetIsGetOnlyCollection != null); 322Debug.Assert(s_throwNullValueReturnedForGetOnlyCollectionExceptionMethod != null); 336Debug.Assert(s_throwArrayExceededSizeExceptionMethod != null); 350Debug.Assert(s_incrementItemCountMethod != null); 365Debug.Assert(s_internalDeserializeMethod != null); 379Debug.Assert(s_moveToNextElementMethod != null); 394Debug.Assert(s_getMemberIndexMethod != null); 409Debug.Assert(s_getMemberIndexWithRequiredMembersMethod != null); 423Debug.Assert(s_throwRequiredMemberMissingExceptionMethod != null); 437Debug.Assert(s_skipUnknownElementMethod != null); 452Debug.Assert(s_readIfNullOrRefMethod != null); 466Debug.Assert(s_readAttributesMethod != null); 480Debug.Assert(s_resetAttributesMethod != null); 494Debug.Assert(s_getObjectIdMethod != null); 508Debug.Assert(s_getArraySizeMethod != null); 522Debug.Assert(s_addNewObjectMethod != null); 536Debug.Assert(s_addNewObjectWithIdMethod != null); 550Debug.Assert(s_replaceDeserializedObjectMethod != null); 565Debug.Assert(s_getExistingObjectMethod != null); 579Debug.Assert(s_getRealObjectMethod != null); 593Debug.Assert(s_ensureArraySizeMethod != null); 607Debug.Assert(s_trimArraySizeMethod != null); 621Debug.Assert(s_checkEndOfArrayMethod != null); 635Debug.Assert(s_getArrayLengthMethod != null); 650Debug.Assert(s_readSerializationInfoMethod != null); 664Debug.Assert(s_createUnexpectedStateExceptionMethod != null); 679Debug.Assert(s_internalSerializeReferenceMethod != null); 694Debug.Assert(s_internalSerializeMethod != null); 709Debug.Assert(s_writeNullMethod != null); 723Debug.Assert(s_incrementArrayCountMethod != null); 737Debug.Assert(s_incrementCollectionCountMethod != null); 751Debug.Assert(s_incrementCollectionCountGenericMethod != null); 765Debug.Assert(s_getDefaultValueMethod != null); 787Debug.Assert(s_getNullableValueMethod != null); 801Debug.Assert(s_throwRequiredMemberMustBeEmittedMethod != null); 815Debug.Assert(s_getHasValueMethod != null); 830Debug.Assert(s_writeISerializableMethod != null); 852Debug.Assert(s_writeXmlValueMethod != null); 867Debug.Assert(s_readXmlValueMethod != null); 881Debug.Assert(s_namespaceProperty != null); 895Debug.Assert(s_contractNamespacesField != null); 909Debug.Assert(s_memberNamesField != null); 927Debug.Assert(s_childElementNamespacesProperty != null); 941Debug.Assert(s_collectionItemNameProperty != null); 956Debug.Assert(s_childElementNamespaceProperty != null); 970Debug.Assert(s_getDateTimeOffsetMethod != null); 984Debug.Assert(s_getDateTimeOffsetAdapterMethod != null); 998Debug.Assert(s_getMemoryStreamMethod != null); 1012Debug.Assert(s_getMemoryStreamAdapterMethod != null); 1026Debug.Assert(s_getTypeHandleMethod != null); 1040Debug.Assert(s_getTypeMethod != null); 1054Debug.Assert(s_throwInvalidDataContractExceptionMethod != null); 1068Debug.Assert(s_serializeReadOnlyTypesProperty != null); 1082Debug.Assert(s_classSerializationExceptionMessageProperty != null); 1096Debug.Assert(s_collectionSerializationExceptionMessageProperty != null);
System\Runtime\Serialization\XmlFormatReaderGenerator.cs (12)
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);
System\Runtime\Serialization\XmlFormatWriterGenerator.cs (1)
418Debug.Assert(collectionContract.GetEnumeratorMethod != null);
System\Runtime\Serialization\XmlObjectSerializerReadContext.cs (10)
153Debug.Assert(attributes != null); 296Debug.Assert(attributes != null); 327Debug.Assert(attributes != null); 339Debug.Assert(attributes != null); 592Debug.Assert(attributes != null); 713Debug.Assert(attributes != null); 767Debug.Assert(attributes != null); 809Debug.Assert(attributes != null); 866Debug.Assert(attributes != null); 1099Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerReadContextComplex.cs (2)
63Debug.Assert(_serializationSurrogateProvider != null); 123Debug.Assert(attributes != null);
System\Runtime\Serialization\XmlObjectSerializerWriteContext.cs (2)
146Debug.Assert(rootTypeDataContract != null); 602Debug.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 (7)
103Debug.Assert(_type == StringHandleType.UTF8); 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 (19)
511Debug.Assert(bytes != null); 542Debug.Assert(str[i] < 128); 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 (12)
87Debug.Assert(nodeType == XmlBinaryNodeType.Chars8Text || nodeType == XmlBinaryNodeType.Bytes8Text || nodeType == XmlBinaryNodeType.UnicodeChars8Text); 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 (1)
1088Debug.Assert(BufferReader.GetByte() == '&');
System.Private.Uri (93)
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\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
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)); 216Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 326Debug.Assert(parts[0] <= 0xFF); 333Debug.Assert(parts[0] <= 0xFF); 334Debug.Assert(parts[1] <= 0xFF); 341Debug.Assert(parts[0] <= 0xFF); 342Debug.Assert(parts[1] <= 0xFF); 343Debug.Assert(parts[2] <= 0xFF);
src\libraries\Common\src\System\Net\IPv6AddressHelper.Common.cs (3)
101Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte)); 125Debug.Assert(start < end); 314Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\DomainNameHelper.cs (3)
75Debug.Assert(index == -1 || char.IsAsciiLetterUpper(str[start + index])); 220Debug.Assert(ReferenceEquals(hostname, UriHelper.StripBidiControlCharacters(hostname, hostname))); 277Debug.Assert(charsWritten == label.Length);
System\IPv6AddressHelper.cs (5)
38Debug.Assert(success); 43Debug.Assert(success); 48Debug.Assert(success); 53Debug.Assert(success); 82Debug.Assert(success);
System\IriHelper.cs (2)
32Debug.Assert(char.IsHighSurrogate(highSurr)); 134Debug.Assert(charactersRead > 0);
System\PercentEncodingHelper.cs (14)
18Debug.Assert(length >= 3); 19Debug.Assert(input[0] == '%'); 20Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) != Uri.c_DummyChar); 21Debug.Assert(UriHelper.DecodeHexChars(input[1], input[2]) >= 128); 61Debug.Assert(value >= 128); 80Debug.Assert(totalCharsConsumed % 3 == 0); 81Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3 || bytesLeftInBuffer == 4); 82Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00000080 : 0x80000000)) != 0); 83Debug.Assert((fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00008000 : 0x00800000)) != 0); 84Debug.Assert(bytesLeftInBuffer < 3 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x00800000 : 0x00008000)) != 0); 85Debug.Assert(bytesLeftInBuffer < 4 || (fourByteBuffer & (BitConverter.IsLittleEndian ? 0x80000000 : 0x00000080)) != 0); 116Debug.Assert(bytesLeftInBuffer < 4); 121Debug.Assert(bytesLeftInBuffer == 2 || bytesLeftInBuffer == 3); 164Debug.Assert(bytesLeftInBuffer == 0 || bytesLeftInBuffer == 1);
System\Uri.cs (22)
148Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0); 202Debug.Assert(_syntax != null); 207Debug.Assert(sizeof(Flags) == sizeof(ulong)); 327Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 714Debug.Assert(IsAbsoluteUri); 965Debug.Assert(_info != null); 966Debug.Assert(_info.Host != null); 1908Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 1933Debug.Assert((err is ParsingError.None) == (syntax is not null)); 1951Debug.Assert(_syntax != null && !_syntax.IsSimple); 1952Debug.Assert((_flags & Flags.CustomParser_ParseMinimalAlreadyCalled) != 0); 1978Debug.Assert(_syntax != null); 1989Debug.Assert(ReferenceEquals(_string, OriginalString)); 2663Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2702Debug.Assert(_info != null && (_flags & Flags.MinimalUriInfoSet) != 0); 2900Debug.Assert(success); 3366Debug.Assert(_syntax.InFact(UriSyntaxFlags.MayHaveFragment)); 3618Debug.Assert(err == ParsingError.None); 3619Debug.Assert((flags & Flags.Debug_LeftConstructor) == 0); 3717Debug.Assert(error == ParsingError.None); 3787Debug.Assert((_flags & Flags.Debug_LeftConstructor) == 0 || (!_syntax.IsSimple && Monitor.IsEntered(_info))); 3797Debug.Assert((_flags & Flags.HasUserInfo) == 0 && (_flags & Flags.HostTypeMask) == 0);
System\UriBuilder.cs (3)
247Debug.Assert(_uri is not null); 280Debug.Assert(_uri is not null); 363Debug.Assert(success);
System\UriExt.cs (6)
31Debug.Assert(_originalUnicodeString is null && _info is null && _syntax is null && _flags == Flags.Zero); 595Debug.Assert(backingString is null || backingString.Length == charsToUnescape.Length); 666Debug.Assert(newLength <= charsToUnescape.Length); 681Debug.Assert(vsb.RawChars.Overlaps(destination)); 782Debug.Assert(syntax != null); 1065Debug.Assert(!InFact(Flags.HasUnicode) || otherUri.IsNotAbsoluteUri);
System\UriHelper.cs (10)
18Debug.Assert(charsWritten == buffer.Length); 155Debug.Assert(newLength > charsToEscape.Length); 170Debug.Assert(vsb.RawChars.Overlaps(destination)); 192Debug.Assert(backingString is null || backingString.Length == charsToEscape.Length); 254Debug.Assert(stringToEscape.EnumerateRunes() is { } e && e.MoveNext() && e.Current == r); 255Debug.Assert(charsConsumed is 1 or 2); 297Debug.Assert(charsToCopy > 0); 500Debug.Assert(charactersRead > 0); 596Debug.Assert(backingString is null || strToClean.Length == backingString.Length); 629Debug.Assert(buffer.Length == destIndex);
System\UriScheme.cs (1)
77Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System\UriSyntax.cs (1)
271Debug.Assert(sizeof(Uri.Flags) == sizeof(ulong));
System.Private.Windows.Core (34)
System\Collections\Generic\ArrayBuilder.cs (4)
57Debug.Assert(_count == _items.Length); 60Debug.Assert(_items.Length > 0); 70Debug.Assert(_count == _maxCount); 71Debug.Assert(_count == _items.Length);
System\Private\Windows\BinaryFormat\Deserializer\ArrayRecordDeserializer.cs (1)
22Debug.Assert(arrayRecord.RecordType is not (SerializationRecordType.ArraySingleString or SerializationRecordType.ArraySinglePrimitive));
System\Private\Windows\BinaryFormat\Deserializer\ClassRecordFieldInfoDeserializer.cs (1)
43Debug.Assert(_fieldInfo is not null);
System\Private\Windows\BinaryFormat\Deserializer\DefaultTypeResolver.cs (1)
31Debug.Assert(typeName.AssemblyName is not null);
System\Private\Windows\BinaryFormat\Deserializer\Deserializer.cs (2)
261Debug.Assert(Options.SurrogateSelector is not null); 358Debug.Assert(_pendingUpdates is not null);
System\Private\Windows\Nrbf\FullyQualifiedTypeName.cs (2)
15Debug.Assert(!string.IsNullOrWhiteSpace(assemblyName)); 16Debug.Assert(!string.IsNullOrWhiteSpace(fullTypeName));
System\Private\Windows\Nrbf\SerializationRecordExtensions.cs (1)
308Debug.Assert(record.RecordType is SerializationRecordType.MemberPrimitiveTyped);
System\Private\Windows\Ole\DataStore.cs (1)
40Debug.Assert(mappedFormat != format);
System\SpanHelpers.cs (1)
15Debug.Assert(!destination.IsEmpty);
System\SpanReader.cs (3)
259Debug.Assert((uint)count <= (uint)_unread.Length); 269Debug.Assert((uint)length <= (uint)span.Length); 279Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\SpanWriter.cs (2)
95Debug.Assert((uint)count <= (uint)_unwritten.Length); 102Debug.Assert((uint)start <= (uint)span.Length && (uint)length <= (uint)(span.Length - start));
System\Text\ValueStringBuilder.cs (5)
40Debug.Assert(value >= 0); 41Debug.Assert(value <= _chars.Length); 51Debug.Assert(capacity >= 0); 88Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Value.cs (2)
56Debug.Assert(type.IsArray); 671Debug.Assert(Unsafe.SizeOf<T>() <= sizeof(ulong));
System\Value.PackedDateTimeOffset.cs (1)
57Debug.Assert(hours is >= 0 and <= 28);
Windows\Win32\Foundation\HRESULT.cs (1)
38Debug.Assert(IsNtStatus);
Windows\Win32\Graphics\Gdi\ARGB.cs (2)
27Debug.Assert(BitConverter.IsLittleEndian); 37Debug.Assert(BitConverter.IsLittleEndian);
Windows\Win32\PInvokeCore.GetSysColorBrush.cs (1)
27Debug.Assert(systemColor.IsSystemColor);
Windows\Win32\System\Com\AgileComPointer.cs (1)
49Debug.Assert(count >= 0);
Windows\Win32\System\Variant\VARIANT.cs (2)
275Debug.Assert(hr == HRESULT.S_OK); 433Debug.Assert(hr == HRESULT.S_OK);
System.Private.Windows.GdiPlus (1)
Windows\Win32\PInvokeGdiPlus.cs (1)
25Debug.Assert(initialized);
System.Private.Xml (2412)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
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 (5)
85Debug.Assert(rgulU.Length == s_cNumeMax); 136Debug.Assert(uiDigit < 10); 323Debug.Assert(val >= 0 && val < 100); 329Debug.Assert(val > -10000 && val < 10000); 341Debug.Assert(val >= 0 && val < 1000);
System\Xml\BinaryXml\XmlBinaryReader.cs (33)
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); 817Debug.Assert(_textXmlReader != null); 866Debug.Assert(_textXmlReader != null); 904Debug.Assert(_textXmlReader != null); 911Debug.Assert(decl != null); 943Debug.Assert(_textXmlReader != null); 1810Debug.Assert(_textXmlReader != null); 1850Debug.Assert(_textXmlReader != null); 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); 2950Debug.Assert(_mark < 0); 3075Debug.Assert(_pos >= 3); 3080Debug.Assert(_pos >= 1); 3086Debug.Assert(_pos >= 2); 3182Debug.Assert(_prevNameInfo != null); 3234Debug.Assert(_textXmlReader != null);
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\Cache\XPathDocumentBuilder.cs (24)
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); 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); 569Debug.Assert(_pageParent != null); 632Debug.Assert(pageElem == null || pageElem[idxElem].NodeType == XPathNodeType.Element); 662Debug.Assert(xptyp != XPathNodeType.Namespace); 734Debug.Assert(xptyp != XPathNodeType.Root && xptyp != XPathNodeType.Namespace); 744Debug.Assert(_pageParent != null); 751Debug.Assert(_idxParent + 1 == idxNew || idxNew == 1); 755Debug.Assert(_pageSibling != null); 903Debug.Assert((int)XPathNodeType.Text < (int)XPathNodeType.SignificantWhitespace); 904Debug.Assert((int)XPathNodeType.SignificantWhitespace < (int)XPathNodeType.Whitespace);
System\Xml\Cache\XPathDocumentNavigator.cs (16)
36Debug.Assert(pageCurrent != null && idxCurrent != 0); 37Debug.Assert((pageParent == null) == (idxParent == 0)); 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 (4)
173Debug.Assert(pageNode != null); 361Debug.Assert(info != null && idxParent <= ushort.MaxValue); 400Debug.Assert(NodeType == XPathNodeType.Element); 411Debug.Assert(NodeType == XPathNodeType.Element);
System\Xml\Cache\XPathNodeHelper.cs (13)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element); 75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute); 119Debug.Assert(idx != 0); 120Debug.Assert(page != null); 180Debug.Assert(idxNode <= ushort.MaxValue); 181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue); 200Debug.Assert(idx != 0); 312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace); 332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute); 348Debug.Assert(pagePrec != null); 369Debug.Assert(idxAnc != 0 && pageAnc != null); 454Debug.Assert(page != null); 669Debug.Assert(pageNode != null);
System\Xml\Cache\XPathNodeInfoAtom.cs (6)
123Debug.Assert(localName != null && namespaceUri != null && prefix != null && doc != null); 291Debug.Assert(other != null); 292Debug.Assert((object?)_doc == (object?)other._doc); 293Debug.Assert(_pageInfo == null); 326Debug.Assert(_localName != null); 333Debug.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 (7)
97Debug.Assert(_state == State.InReadContent); 140Debug.Assert(_state == State.InReadContent); 183Debug.Assert(_state == State.InReadElementContent); 226Debug.Assert(_state == State.InReadElementContent); 276Debug.Assert(_reader.NodeType == XmlNodeType.Element); 330Debug.Assert(_decoder != null); 355Debug.Assert(_valueOffset == _valueChunkLength);
System\Xml\Core\ReadContentAsBinaryHelperAsync.cs (7)
48Debug.Assert(_state == State.InReadContent); 92Debug.Assert(_state == State.InReadContent); 136Debug.Assert(_state == State.InReadElementContent); 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 (2)
51Debug.Assert(checkCharacters || ignoreWhitespace || ignoreComments || ignorePis || (int)dtdProcessing != -1); 643Debug.Assert(readerAsNSResolver != null);
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); 875Debug.Assert(_bufPos == 1); 912Debug.Assert(pSrc <= pSrcEnd); 1035Debug.Assert(pSrc <= pSrcEnd); 1136Debug.Assert(s != null); 1166Debug.Assert(pSrc <= pSrcEnd); 1231Debug.Assert(pSrc <= pSrcEnd); 1351Debug.Assert(pSrc <= pSrcEnd); 1502Debug.Assert(pSrc <= pSrcEnd); 1610Debug.Assert(XmlCharType.IsSurrogate(*pSrc)); 1636Debug.Assert(!XmlCharType.IsWhiteSpace((char)ch)); 1637Debug.Assert(!XmlCharType.IsAttributeValueChar((char)ch)); 1686Debug.Assert(_inTextContent != value); 1687Debug.Assert(_inTextContent || ((_lastMarkPos & 1) == 0)); 1698Debug.Assert(_lastMarkPos + 1 == _textContentMarks!.Length); 1963Debug.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); 707Debug.Assert(_bufPos == 1); 747Debug.Assert(pSrc <= pSrcEnd); 952Debug.Assert(pSrc <= pSrcEnd); 1192Debug.Assert(pSrc <= pSrcEnd); 1259Debug.Assert(text1 != null); 1260Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1261Debug.Assert(text3 != null || (text4 == null)); 1317Debug.Assert(text1 != null); 1318Debug.Assert(text2 != null || (text3 == null && text4 == null)); 1319Debug.Assert(text3 != null || (text4 == null)); 1368Debug.Assert(pSrc <= pSrcEnd); 1570Debug.Assert(pSrc <= pSrcEnd); 1760Debug.Assert(pSrc <= pSrcEnd); 1922Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null);
System\Xml\Core\XmlEventCache.cs (2)
125Debug.Assert(idxPage + 1 == _pages.Count); 279Debug.Assert(idxPage + 1 == _pages.Count);
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 (41)
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); 550Debug.Assert(reader.Depth >= _initialDepth); 587Debug.Assert(reader.Depth >= _initialDepth); 601Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 616Debug.Assert(reader.Depth >= _initialDepth); 868Debug.Assert(_binDecoder != null); 875Debug.Assert(AttributeCount > 0); 1006Debug.Assert(_binDecoder != null); 1013Debug.Assert(AttributeCount > 0); 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); 1560Debug.Assert(_state == State.Interactive ||
System\Xml\Core\XmlSubtreeReaderAsync.cs (12)
42Debug.Assert(reader.Depth >= _initialDepth); 52Debug.Assert(reader.NodeType == XmlNodeType.Element && !reader.IsEmptyElement); 113Debug.Assert(reader.Depth >= _initialDepth); 127Debug.Assert(reader.NodeType == XmlNodeType.EndElement || 142Debug.Assert(reader.Depth >= _initialDepth); 274Debug.Assert(_binDecoder != null); 281Debug.Assert(AttributeCount > 0); 412Debug.Assert(_binDecoder != null); 419Debug.Assert(AttributeCount > 0); 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 (252)
317Debug.Assert(nt != null); 330Debug.Assert(_index == 0); 371Debug.Assert(_nameTableFromSettings == false); 393Debug.Assert(_index == 0); 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); 789Debug.Assert(_laterInitParam != null); 790Debug.Assert(_laterInitParam.inputTextReader != null); 791Debug.Assert(_reportedBaseUri != null); 812Debug.Assert(xmlFragment != null); 1195Debug.Assert(_laterInitParam != null); 1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent); 1237Debug.Assert(!_ps.appendMode); 1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 1270Debug.Assert(_curNode.type == XmlNodeType.Element); 1394Debug.Assert(_curNode.type == XmlNodeType.EndElement); 1395Debug.Assert(_parsingFunction != ParsingFunction.Eof); 1415Debug.Assert(_namespaceManager != null); 1498Debug.Assert(_parsingMode == ParsingMode.Full); 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); 2137Debug.Assert(_namespaceManager != null); 2166Debug.Assert(_stringBuilder.Length == 0); 2207Debug.Assert(_outerReader is XmlTextReader); 2243Debug.Assert(_outerReader is XmlTextReader); 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); 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); 3314Debug.Assert(_ps.encoding != null); 3315Debug.Assert(_ps.chars != null); 3341Debug.Assert(_ps.chars != null); 3364Debug.Assert(_ps.bytes != null); 3423Debug.Assert(_ps.bytes != null); 3438Debug.Assert(_ps.bytes != null); 3477Debug.Assert(_ps.charsUsed < _ps.chars.Length); 3488Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null); 3489Debug.Assert(_ps.chars != null); 3490Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1); 3514Debug.Assert(maxCharsCount >= charsCount); 3529Debug.Assert(_ps.decoder != null); 3530Debug.Assert(_ps.bytes != null); 3531Debug.Assert(_ps.chars != null); 3579Debug.Assert(_ps.chars != null); 3609Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 3653Debug.Assert(_ps.encoding != null); 3730Debug.Assert(attr != null); 3762Debug.Assert(attr != null); 3788Debug.Assert(attr != null); 3804Debug.Assert(attr != null); 3819Debug.Assert(!isTextDecl); 3825Debug.Assert(attr != null); 3871Debug.Assert(_ps.encoding != null); 3895Debug.Assert(_ps.chars != null); 4077Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 4097Debug.Assert(_index == 0); 4120Debug.Assert(_ps.chars != null); 4294Debug.Assert(_ps.chars != null); 4360Debug.Assert(_namespaceManager != null); 4452Debug.Assert(_curNode.type == XmlNodeType.Element); 4453Debug.Assert(_dtdInfo != null); 4545Debug.Assert(_ps.chars != null); 4634Debug.Assert(_index > 0); 4639Debug.Assert(_curNode == startTagNode); 4656Debug.Assert(_ps.chars != null); 4666Debug.Assert(startTag.type == XmlNodeType.EntityReference); 4675Debug.Assert(_ps.chars != null); 4679Debug.Assert(_attrCount == 0); 4728Debug.Assert(_curNode.type == XmlNodeType.Element); 4736Debug.Assert(_curNode.type == XmlNodeType.Element); 4840Debug.Assert(attrNameLineNo == _ps.LineNo); 4962Debug.Assert(_curNode.type == XmlNodeType.Element); 5096Debug.Assert(_ps.chars != null); 5103Debug.Assert(_stringBuilder.Length == 0); 5258Debug.Assert(_ps.entity != null); 5315Debug.Assert(_ps.isEof); 5373Debug.Assert(attr.nextAttrValueChunk == null); 5402Debug.Assert(_stringBuilder.Length == 0); 5418Debug.Assert(endPos - startPos > 0); 5419Debug.Assert(_ps.chars != null); 5442Debug.Assert(_stringBuilder.Length > 0); 5463Debug.Assert(endPos - startPos > 0); 5464Debug.Assert(_ps.chars != null); 5539Debug.Assert(_ps.chars != null); 5729Debug.Assert(_ps.isEof); 5771Debug.Assert(_stringBuilder.Length == 0); 5772Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || 5786Debug.Assert(_stringBuilder.Length > 0); 5840Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk || 5850Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk); 5855Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5867Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary); 5872Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent); 5900Debug.Assert(_stringBuilder.Length == 0); 5904Debug.Assert(_ps.chars != null); 5942Debug.Assert(_ps.chars != null); 5943Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5952Debug.Assert(_ps.chars != null); 5953Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5968Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex); 6046Debug.Assert(entity != null); 6163Debug.Assert(_lastEntity != null); 6169Debug.Assert(_curNode.depth == _index); 6182Debug.Assert(_curNode.type == XmlNodeType.EntityReference); 6183Debug.Assert(_lastEntity != null); 6184Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName)); 6203Debug.Assert(_stringBuilder.Length == 0); 6207Debug.Assert(_ps.chars != null); 6230Debug.Assert(_ps.charPos < _ps.charsUsed); 6274Debug.Assert(_stringBuilder.Length == 0); 6308Debug.Assert(_ps.chars != null); 6330Debug.Assert(!_ps.eolNormalized); 6477Debug.Assert(_stringBuilder.Length == 0); 6480Debug.Assert(_ps.chars != null); 6513Debug.Assert(_ps.chars != null); 6537Debug.Assert(!_ps.eolNormalized); 6686Debug.Assert(_ps.chars != null); 6719Debug.Assert(_dtdProcessing == DtdProcessing.Ignore); 6751Debug.Assert(_ps.chars != null); 6848Debug.Assert(_ps.chars != null); 6867Debug.Assert(_ps.chars != null); 7048Debug.Assert(_ps.isEof); 7064Debug.Assert(_ps.chars != null); 7149Debug.Assert(_ps.isEof); 7158Debug.Assert(_ps.chars != null); 7159Debug.Assert(_ps.chars[startPos] == '&'); 7192Debug.Assert(_ps.chars != null); 7193Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7213Debug.Assert(_ps.chars != null); 7214Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#'); 7269Debug.Assert(badDigitExceptionString != null); 7321Debug.Assert(pos > 0); 7355Debug.Assert(_ps.chars != null); 7356Debug.Assert(_ps.chars[_ps.charPos] == '&'); 7376Debug.Assert(startPos < _ps.charsUsed); 7377Debug.Assert(_ps.chars != null); 7378Debug.Assert(_ps.chars[startPos] == '&'); 7379Debug.Assert(_ps.chars[startPos + 1] != '#'); 7487Debug.Assert(pos > 0); 7512Debug.Assert(_ps.chars != null); 7575Debug.Assert(_ps.chars != null); 7608Debug.Assert(_ps.chars != null); 7623Debug.Assert(nodeIndex < _nodes.Length); 7624Debug.Assert(_nodes[_nodes.Length - 1] == null); 7637Debug.Assert(nodeIndex < _nodes.Length); 7644Debug.Assert(nodeIndex < _nodes.Length); 7661Debug.Assert(_ps.chars != null); 7714Debug.Assert(attr.type == XmlNodeType.Attribute); 7730Debug.Assert(_namespaceManager != null); 7749Debug.Assert(_ps.isEof); 7762Debug.Assert(_namespaceManager != null); 7800Debug.Assert(_namespaceManager != null); 7813Debug.Assert(_xmlContext.defaultNamespace == uri); 7850Debug.Assert(_curNode.xmlContextPushed); 7892Debug.Assert(_xmlResolver != null); 7950Debug.Assert(_xmlResolver != null); 7987Debug.Assert(entity.IsExternal); 7991Debug.Assert(_xmlResolver != null); 8002Debug.Assert(_ps.appendMode); 8033Debug.Assert(!entity.IsExternal); 8099Debug.Assert(_parsingStatesStackTop == -1); 8115Debug.Assert(_parsingStatesStackTop >= 0); 8116Debug.Assert(_parsingStatesStack != null); 8163Debug.Assert(_incReadDecoder != null); 8173Debug.Assert(_incReadDecoder != null); 8174Debug.Assert(_ps.chars != null); 8223Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>")); 8231Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->")); 8239Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>")); 8264Debug.Assert(_incReadState == IncrementalReadState.Text || 8373Debug.Assert(_ps.charPos - pos == 0); 8374Debug.Assert(_ps.charPos - startPos == 0); 8413Debug.Assert(_ps.charPos - pos == 0); 8414Debug.Assert(_ps.charPos - startPos == 0); 8534Debug.Assert(_fragmentType == XmlNodeType.Attribute); 8551Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue); 8564Debug.Assert(_ps.chars != null); 8579Debug.Assert(_stringBuilder.Length == 0); 8783Debug.Assert(_ps.chars != null); 8796Debug.Assert(_ps.charPos < _ps.charsUsed); 8861Debug.Assert(_ps.chars != null); 8874Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo); 8890Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary); 8917Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 8918Debug.Assert(_curNode.type == XmlNodeType.Element); 9001Debug.Assert(context != null); 9022Debug.Assert(nt != null); 9039Debug.Assert(_nameTableFromSettings == false); 9064Debug.Assert(_dtdInfo == null); 9224Debug.Assert(attr != null); 9245Debug.Assert(_namespaceManager != null); 9248Debug.Assert(prefix != null); 9266Debug.Assert(attr != null); 9298Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9316Debug.Assert(_nodes[_index].type == XmlNodeType.Element); 9317Debug.Assert(_namespaceManager != null); 9351Debug.Assert(_incReadDecoder != null); 9385Debug.Assert(_ps.chars != null); 9464Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary); 9520Debug.Assert(characters >= 0); 9562Debug.Assert(startPos >= 0); 9563Debug.Assert(endPos < chars.Length); 9564Debug.Assert(startPos <= endPos); 9571Debug.Assert(startPos >= 0); 9572Debug.Assert(endPos < str.Length); 9573Debug.Assert(startPos <= endPos);
System\Xml\Core\XmlTextReaderImplAsync.cs (72)
94Debug.Assert(_reportedBaseUri != null); 125Debug.Assert(_reportedBaseUri != null); 178Debug.Assert(!_ps.appendMode); 198Debug.Assert(_parsingFunction == ParsingFunction.ElementContent || 203Debug.Assert(_curNode.type == XmlNodeType.Element); 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); 1003Debug.Assert(_ps.stream != null); 1161Debug.Assert(_ps.charsUsed < _ps.chars.Length); 1193Debug.Assert(_stringBuilder.Length == 0 || isTextDecl); 1399Debug.Assert(!isTextDecl); 1597Debug.Assert(pos == _ps.charsUsed && !_ps.isEof); 1712Debug.Assert(_index == 0); 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); 2613Debug.Assert(_stringBuilder.Length == 0); 2830Debug.Assert(_ps.isEof); 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); 4791Debug.Assert(_ps.isEof); 4891Debug.Assert(_ps.isEof); 4920Debug.Assert(_ps.chars[_ps.charPos] == '&'); 4954Debug.Assert(_ps.chars[_ps.charPos] == '&'); 5161Debug.Assert(_xmlResolver != null); 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 (22)
284Debug.Assert(internalDtd != null); 417Debug.Assert(type == XmlNodeType.Element); 430Debug.Assert(type == XmlNodeType.Attribute); 451Debug.Assert(_chars != null); 462Debug.Assert(_chars != null); 467Debug.Assert(_value != null); 511Debug.Assert(value != null); 537Debug.Assert(localName != null); 538Debug.Assert(localName.Length > 0); 567Debug.Assert(_valueStartPos != -1); 568Debug.Assert(_chars != null); 578Debug.Assert(_valueStartPos != -1); 579Debug.Assert(_chars != null); 599Debug.Assert(_valueStartPos != -1); 600Debug.Assert(_chars != null); 625Debug.Assert(_valueStartPos != -1); 626Debug.Assert(_chars != null); 643Debug.Assert(_chars != null); 648Debug.Assert(_value != null); 668Debug.Assert(nameWPrefix == null); 725Debug.Assert(x == null || x is NodeData || x is IDtdDefaultAttributeInfo); 726Debug.Assert(y == null || y is NodeData || y is IDtdDefaultAttributeInfo);
System\Xml\Core\XmlTextWriter.cs (7)
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 (4)
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 (3)
175Debug.Assert(_parserContext != null); 176Debug.Assert(_coreReaderImpl.DtdInfo == null); 193Debug.Assert(_coreReader.NodeType == XmlNodeType.EntityReference);
System\Xml\Core\XmlWellFormedWriter.cs (21)
240Debug.Assert(writer != null); 241Debug.Assert(settings != null); 242Debug.Assert(MaxNamespacesWalkCount <= 3); 456Debug.Assert(prefix.Length == 0); 484Debug.Assert(_attrHashTable != null); 743Debug.Assert(_attrValueCache != null); 785Debug.Assert(_curDeclPrefix != null); 1262Debug.Assert(i >= 0); 1273Debug.Assert(i >= 0); 1581Debug.Assert(_stateTable == s_stateTableAuto); 1625Debug.Assert(prefix == "xmlns"); 1779Debug.Assert(_nsHashtable != null); 1795Debug.Assert(_nsHashtable != null); 1817Debug.Assert(_useNsHashtable); 1818Debug.Assert(_nsHashtable != null); 1819Debug.Assert(indexFrom <= indexTo); 1822Debug.Assert(_nsHashtable.ContainsKey(_nsStack[i].prefix)); 2031Debug.Assert(ncname != null && ncname.Length > 0); 2123Debug.Assert(_attrHashTable.Count == 0); 2148Debug.Assert(_attrHashTable != null); 2166Debug.Assert(prev >= 0 && _attrStack[prev].localName == localName);
System\Xml\Core\XmlWellFormedWriterAsync.cs (3)
229Debug.Assert(prefix.Length == 0); 645Debug.Assert(_attrValueCache != null); 690Debug.Assert(_curDeclPrefix != null);
System\Xml\Core\XmlWellFormedWriterHelpers.cs (3)
96Debug.Assert(kind == NamespaceKind.NeedToWrite); 505Debug.Assert(_singleStringValue != null); 506Debug.Assert(_lastItem == -1);
System\Xml\Core\XmlWellFormedWriterHelpersAsync.cs (1)
31Debug.Assert(kind == NamespaceKind.NeedToWrite);
System\Xml\Core\XmlWrappingReader.cs (1)
25Debug.Assert(baseReader != null);
System\Xml\Core\XmlWrappingWriter.cs (1)
23Debug.Assert(baseWriter != null);
System\Xml\Core\XmlWriterSettings.cs (1)
367Debug.Assert(Encoding.UTF8.WebName == "utf-8");
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 (48)
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); 2626Debug.Assert(_cachingReader != null); 2646Debug.Assert(_cachingReader != null); 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 (19)
24Debug.Assert(_cachedNode != 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 (34)
179Debug.Assert(_source.Value != null); 220Debug.Assert(value != null); 527Debug.Assert(attributes != null); 547Debug.Assert(attributes != null && attributes.parent != null); 578Debug.Assert(_namespaceParent != null); 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); 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); 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)
217Debug.Assert((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix)); 218Debug.Assert(n.LocalName == localName); 219Debug.Assert((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI)); 226Debug.Assert(n == null || ((prefix == null) ? (n.Prefix.Length == 0) : (prefix == n.Prefix))); 227Debug.Assert(n == null || n.LocalName == localName); 228Debug.Assert(n == null || ((namespaceURI == null) ? (n.NamespaceURI.Length == 0) : (n.NamespaceURI == namespaceURI))); 235Debug.Assert((prefix == null) ? (xmlName.Prefix.Length == 0) : (prefix == xmlName.Prefix)); 236Debug.Assert(xmlName.LocalName == localName); 237Debug.Assert((namespaceURI == null) ? (xmlName.NamespaceURI.Length == 0) : (xmlName.NamespaceURI == namespaceURI)); 977Debug.Assert(((XmlAttribute)node).Specified); 1042Debug.Assert(toNode.NodeType != XmlNodeType.EntityReference); 1772Debug.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)
30Debug.Assert(doc != null); 61Debug.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 (17)
57Debug.Assert(_reader != null); 58Debug.Assert(parentDoc != null); 148Debug.Assert(parent.NodeType == XmlNodeType.Element); 170Debug.Assert(parent == null); 225Debug.Assert(node != null); 251Debug.Assert(_reader!.NodeType == XmlNodeType.Attribute); 292Debug.Assert(node != null); 301Debug.Assert(_reader!.IsDefault); 350Debug.Assert(node != null); 358Debug.Assert(_reader!.NodeType == XmlNodeType.EntityReference); 381Debug.Assert(_reader!.NodeType == XmlNodeType.XmlDeclaration); 419Debug.Assert(_reader!.NodeType == XmlNodeType.DocumentType); 494Debug.Assert(parent!.NodeType == XmlNodeType.Element); 549Debug.Assert(node != null); 749Debug.Assert(parentNode.NodeType != XmlNodeType.Document); 751Debug.Assert(_doc != null); 944Debug.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\XmlNode.cs (9)
44Debug.Assert(doc != null); 56Debug.Assert(nodeIterator.Current != null); 128Debug.Assert(parentNode != null); 187Debug.Assert(parentNode != null); 791Debug.Assert(firstNode.NodeType == XmlNodeType.Text 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\Resolvers\XmlPreloadedResolver.cs (2)
214Debug.Assert(s_rss091_Dtd.Length == 1); 352Debug.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 (5)
211Debug.Assert(_dstruct != null); 219Debug.Assert(_dstruct != null); 363Debug.Assert(arr1 != null); 378Debug.Assert(arr2 != null); 398Debug.Assert(dim > 0);
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 (34)
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 || 625Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 1494Debug.Assert(idTokenType == Token.PUBLIC); 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); 3528Debug.Assert(startPos < _charsUsed);
System\Xml\Schema\DtdParserAsync.cs (15)
136Debug.Assert(ParsingInternalSubset); 142Debug.Assert(_externalEntitiesDepth == 0); 163Debug.Assert(_readerAdapter.EntityStackLength == 0 || 233Debug.Assert(_curPos > 0 && _chars[_curPos - 1] == ']'); 245Debug.Assert(_readerAdapter.EntityStackLength == 0 || 269Debug.Assert(_scanningFunction == ScanningFunction.SubsetContent); 993Debug.Assert(_internalSubsetValueSb != null); 1021Debug.Assert(_internalSubsetValueSb != null); 1119Debug.Assert(idTokenType == Token.PUBLIC); 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 (5)
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 (6)
278Debug.Assert(compiledAttributes != null); //AttributeUses is never null 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);
System\Xml\Schema\NamespaceList.cs (5)
29Debug.Assert(targetNamespace != null); 69Debug.Assert(_set != null); 179Debug.Assert(super._type == ListType.Set); 197Debug.Assert(o1 != o2); 315Debug.Assert(o1 != o2); //clause 1
System\Xml\Schema\Parser.cs (7)
89Debug.Assert(_schemaType == SchemaType.XDR); 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 (3)
304Debug.Assert(import != null); 823Debug.Assert(_currentSchema != null); 977Debug.Assert((currentSchemaObject as XmlSchema) == null); // The current object should not be schema
System\Xml\Schema\SchemaCollectionCompiler.cs (7)
54Debug.Assert(!members.Contains(element)); 514Debug.Assert(group.CanonicalParticle != null); 1030Debug.Assert(baseType.ElementDecl.ContentValidator != null); 1859Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2252Debug.Assert(xe.ElementSchemaType != null); 2486Debug.Assert(particle == XmlSchemaParticle.Empty); 2531Debug.Assert(!p.IsEmpty);
System\Xml\Schema\SchemaSetCompiler.cs (10)
128Debug.Assert(_schemaForSchema != null); 499Debug.Assert(examplar != null); //Headelement presence is checked while building subst groups 596Debug.Assert(group.CanonicalParticle != null); 2224Debug.Assert(attribute.Use != XmlSchemaUse.Prohibited); 2711Debug.Assert(xe.ElementSchemaType != null); 2730Debug.Assert(decl != null); 2912Debug.Assert(!((XmlSchemaParticle)particles[i]).IsEmpty); 3086Debug.Assert(baseFixedValue != null); 3093Debug.Assert(derivedFixedValue != null); 3109Debug.Assert(simpleFixedValue != null);
System\Xml\Schema\XdrBuilder.cs (1)
623Debug.Assert(_GroupDef != null);
System\Xml\Schema\XmlAtomicValue.cs (1)
169Debug.Assert(qname != null); //string representation is handled in a different overload
System\Xml\Schema\XmlSchema.cs (2)
232Debug.Assert(_isPreprocessed); 529Debug.Assert(extList != null && schema != null);
System\Xml\Schema\XmlSchemaObjectTable.cs (8)
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);
System\Xml\Schema\XmlSchemaSet.cs (2)
869Debug.Assert(ns != null); 880Debug.Assert(schema.BaseUri!.Equals(schemaUri));
System\Xml\Schema\XmlSchemaSimpleType.cs (1)
15Debug.Assert(SchemaContentType == XmlSchemaContentType.TextOnly);
System\Xml\Schema\XmlSchemaValidator.cs (32)
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); 782Debug.Assert(names.Count > 0); 910Debug.Assert(_context.Validity != XmlSchemaValidity.Valid); 1059Debug.Assert(attSchemaInfo != null); 1282Debug.Assert(typedValue != null); 1429Debug.Assert(currentElementDecl.Datatype != null); 1491Debug.Assert(simpleValue != null); 1505Debug.Assert(decl != null && decl.SchemaType != null); 1547Debug.Assert(_validationStack.Length > 1); 1628Debug.Assert(_partialValidationType is XmlSchemaAttribute); 1666Debug.Assert(elementDecl.DefaultValueTyped != null); 1818Debug.Assert(elementDecl.ContentValidator!.ContentType == XmlSchemaContentType.Mixed && elementDecl.DefaultValueTyped != null); 1831Debug.Assert(decl != null); 1842Debug.Assert(_xmlResolver != null); 1934Debug.Assert(dtype != null); 1950Debug.Assert(typedValue != null); 1973Debug.Assert(dtype != null); 1982Debug.Assert(typedValue != null); 2098Debug.Assert(currentElementDecl != null); 2312Debug.Assert(datatype != null); 2519Debug.Assert(contentValidator is DfaContentValidator || contentValidator is NfaContentValidator || contentValidator is RangeContentValidator || contentValidator is AllElementsContentValidator); 2543Debug.Assert(names.Count > 0); 2576Debug.Assert(schemaSet != null); 2595Debug.Assert(names.Count > 0); 2634Debug.Assert(builder.Length != 0); 2645Debug.Assert(nextParticle != null); 2745Debug.Assert(nsList.Length > 0);
System\Xml\Schema\XmlValueConverter.cs (2)
282Debug.Assert(_clrTypeDefault!.IsArray); 3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Schema\XsdBuilder.cs (2)
705Debug.Assert(_currentEntry.InitFunc != null); 708Debug.Assert(_xso != null);
System\Xml\Schema\XsdDateTime.cs (1)
491Debug.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 (1)
494Debug.Assert(attnDef.SchemaType != null);
System\Xml\Serialization\CodeGenerator.cs (33)
46System.Diagnostics.Debug.Assert(typeBuilder != null); 60Debug.Assert(iType.IsInterface); 131System.Diagnostics.Debug.Assert(_argList != null && _argList.ContainsKey(name)); 137System.Diagnostics.Debug.Assert(_currentScope != null && _currentScope.ContainsKey(name)); 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); 930Debug.Assert(_currentScope!.ContainsKey(name)); 942Debug.Assert(local.LocalType == type); 953Debug.Assert(_currentScope!.ContainsKey(name)); 955Debug.Assert(local.LocalType == type); 1039Debug.Assert(!opCode.Equals(OpCodes.Nop)); 1246Debug.Assert(ifState != null); 1280Debug.Assert(_initElseIfStack == -1); 1290Debug.Assert(_initIfStack == -1); 1310Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1331Debug.Assert(_initIfStack == -1 && _initElseIfStack == -1); 1615Debug.Assert(this.MethodBuilder.ReturnType == returnType); 1616Debug.Assert(this.MethodBuilder.Attributes == attributes); 1617Debug.Assert(this.ParameterTypes.Length == parameterTypes.Length); 1620Debug.Assert(this.ParameterTypes[i] == parameterTypes[i]);
System\Xml\Serialization\CodeIdentifier.cs (1)
175Debug.Assert(ident != null);
System\Xml\Serialization\Compiler.cs (1)
75Debug.Assert(originalAssemblyInfo != null);
System\Xml\Serialization\Mappings.cs (4)
754Debug.Assert(a1 != null); 755Debug.Assert(a2 != null); 867Debug.Assert(m1 != null); 868Debug.Assert(m2 != null);
System\Xml\Serialization\ReflectionXmlSerializationReader.cs (1)
2061Debug.Assert(!typeof(TObj).IsValueType);
System\Xml\Serialization\ReflectionXmlSerializationWriter.cs (3)
167Debug.Assert(a != null); 290Debug.Assert(o is byte[]); 800Debug.Assert(ai is byte[]);
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 (2)
1085Debug.Assert(propertyInfo != null); 1086Debug.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)
254Debug.Assert(_idNameFields.ContainsKey(id)); 311Debug.Assert(node == "null" || node == "(object)p"); 680System.Diagnostics.Debug.Assert(source == "Reader.ReadElementString()" || source == "Reader.ReadString()" 790System.Diagnostics.Debug.Assert(source == "Reader.Value" || source == "Reader.ReadElementString()" || source == "vals[i]"); 908System.Diagnostics.Debug.Assert(source == "false"); 1052Debug.Assert(get_TableName != null); 1742System.Diagnostics.Debug.Assert(source == "Reader"); 2011System.Diagnostics.Debug.Assert(elseCall == "UnknownNode"); 2310Debug.Assert(anyText != null); 2631Debug.Assert(!soapRefs); 2711Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA2"].Value); 2712Debug.Assert(match.Groups["locA1"].Value == match.Groups["locA3"].Value); 2713Debug.Assert(match.Groups["locI1"].Value == match.Groups["locI2"].Value); 2757System.Diagnostics.Debug.Assert(CodeGenerator.GetVariableType(ilg.GetVariable(match.Groups["a"].Value)).IsArray); 2781Debug.Assert(elementType != null && variable is LocalBuilder); 2791Debug.Assert(memberInfos.ContainsKey(source.Substring(3))); 2819Debug.Assert(!localA.LocalType.IsGenericType || (localA.LocalType.GetGenericArguments().Length == 1 && localA.LocalType.GetGenericArguments()[0].IsAssignableFrom(elementType))); 2825Debug.Assert(Add != null); 2838System.Diagnostics.Debug.Assert(varType.IsArray); 2865Debug.Assert(memberInfos.ContainsKey(source.Substring(3)));
System\Xml\Serialization\XmlSerializationWriterILGen.cs (11)
1042System.Diagnostics.Debug.Assert(xmlnsSource.StartsWith("o.@", StringComparison.Ordinal)); 1362System.Diagnostics.Debug.Assert(parent == "o" || parent == "p"); 2184Debug.Assert(!local.LocalType.IsValueType); 2366Debug.Assert(type.IsValueType); 2501Debug.Assert(initValue.MemberInfo != null); 2502Debug.Assert(initValue.MemberInfo.Name == initValue.Arg.Substring(3)); 2549Debug.Assert(typeName == arrayTypeDesc.CSharpName || typeName == $"{arrayTypeDesc.CSharpName}[]"); 2558Debug.Assert(type != null); 2559Debug.Assert(ilg != null); 2566Debug.Assert(arrayType != null); 2567Debug.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 (3)
227Debug.Assert(invCharIndex < data.Length); 228Debug.Assert(invCharIndex < length); 229Debug.Assert(length <= data.Length);
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 (1)
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 (1)
124Debug.Assert(prefix != null);
System\Xml\XPath\Internal\DescendantoverDescendantQuery.cs (3)
63Debug.Assert(currentNode != null); 75Debug.Assert(currentNode != null); 86Debug.Assert(currentNode != null);
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 (4)
19Debug.Assert( 70Debug.Assert(cmp != null); 97Debug.Assert(op == Operator.Op.EQ || op == Operator.Op.NE); 130Debug.Assert(
System\Xml\XPath\Internal\MergeFilterQuery.cs (1)
62Debug.Assert(current != null);
System\Xml\XPath\Internal\NamespaceQuery.cs (1)
58Debug.Assert(e.NodeType == XPathNodeType.Namespace);
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\Query.cs (1)
147Debug.Assert(0 <= l && l < r);
System\Xml\XPath\Internal\QueryBuilder.cs (3)
420Debug.Assert(root.Prefix != null); 421Debug.Assert(root.Name != null); 464Debug.Assert(root != null);
System\Xml\XPath\Internal\SortQuery.cs (6)
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);
System\Xml\XPath\Internal\StringFunctions.cs (10)
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 (3)
26Debug.Assert(iterator != null); 69Debug.Assert(firstNotEmpty <= item && item < arr.Length); 74Debug.Assert(it.Current != null && itNext.Current != null);
System\Xml\XPath\Internal\XPathParser.cs (4)
415Debug.Assert(nodeType != XPathNodeType.Root); 464Debug.Assert(IsPrimaryExpr); 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 (4)
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 (9)
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 (2)
515Debug.Assert(value == null); 641Debug.Assert(XPathNodeType.Namespace == _nav.NodeType);
System\Xml\XPath\XPathNodeIterator.cs (1)
66Debug.Assert(_current.Current != null);
System\Xml\Xsl\IlGen\GenerateHelper.cs (8)
1098Debug.Assert(nameType == GenerateNameType.TagNameAndNamespace); 1134Debug.Assert(_locXOut != null); 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); 1734Debug.Assert(opcode.Equals(OpCodes.Brtrue) || opcode.Equals(OpCodes.Brtrue_S) ||
System\Xml\Xsl\IlGen\IteratorDescriptor.cs (3)
337Debug.Assert(_hasNext); 406Debug.Assert(_storage.IsCached); 479Debug.Assert(brctxt != BranchingContext.None);
System\Xml\Xsl\IlGen\OptimizerPatterns.cs (3)
245Debug.Assert(Enum.IsDefined(pattern)); 246Debug.Assert((int)pattern < 32); 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\XmlILConstructAnalyzer.cs (14)
196Debug.Assert(value); 220Debug.Assert(value); 244Debug.Assert(value); 442Debug.Assert(ndContent != null); 491case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break; 492case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break; 493case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break; 497case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break; 715Debug.Assert(!typ.IsSingleton); 751Debug.Assert(!typ.IsSingleton); 801Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor); 839Debug.Assert(binaryNode != null); 858Debug.Assert(ndName != null); 1059Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl);
System\Xml\Xsl\IlGen\XmlILModule.cs (1)
79Debug.Assert(!(useLRE && emitSymbols));
System\Xml\Xsl\IlGen\XmlILOptimizerVisitor.cs (1)
5489Debug.Assert(left.NodeType == right.NodeType);
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (43)
93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter); 223Debug.Assert(iter.NodeType == QilNodeType.Parameter); 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); 986Debug.Assert(itemStorageType == typeof(bool)); 1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst); 1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton); 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); 2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter); 3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer); 3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst); 3751Debug.Assert(ndCopy.Left.XmlType!.IsNode); 3763Debug.Assert(ndCopy.Left.XmlType.IsNode); 3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null); 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); 4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne); 4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None); 4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI); 4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element); 4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content); 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);
System\Xml\Xsl\QIL\QilPatternFactory.cs (5)
26Debug.Assert(f != null); 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);
System\Xml\Xsl\QIL\QilValidationVisitor.cs (1)
36Debug.Assert(node != null);
System\Xml\Xsl\QIL\SubstitutionList.cs (1)
51Debug.Assert(_s.Count % 2 == 0);
System\Xml\Xsl\QueryReaderSettings.cs (1)
26Debug.Assert(xmlNameTable != null);
System\Xml\Xsl\Runtime\ContentIterators.cs (2)
116Debug.Assert(nodeType != XPathNodeType.Attribute && nodeType != XPathNodeType.Namespace); 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\EarlyBoundInfo.cs (1)
22Debug.Assert(namespaceUri != null && ebType != null);
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\StringConcat.cs (1)
55Debug.Assert(value != null);
System\Xml\Xsl\Runtime\TreeIterators.cs (3)
498Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 523Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext); 834Debug.Assert(_state == IteratorState.HaveCurrentHaveNext || _state == IteratorState.HaveCurrentNoNext);
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 (6)
87Debug.Assert(!string.IsNullOrEmpty(localName) && prefix != null && ns != null); 96Debug.Assert(_numEntries != 0); 144Debug.Assert(text != null); 145Debug.Assert(_arrAttrs != null && _numEntries != 0); 157Debug.Assert(_arrAttrs != null && _numEntries != 0); 361Debug.Assert(_numEntries == _arrAttrs.Length);
System\Xml\Xsl\Runtime\XmlCollation.cs (1)
104Debug.Assert(((int)value & Mask) == 0);
System\Xml\Xsl\Runtime\XmlExtensionFunction.cs (2)
221Debug.Assert(methMatch.ContainsGenericParameters == false); 308Debug.Assert(that != null);
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\XmlQueryOutput.cs (13)
231Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All)); 538Debug.Assert(prefix != null && ns != null); 542Debug.Assert(prefix.Length == 0 || ns.Length != 0); 699Debug.Assert(prefix != null && ns != null); 1037Debug.Assert(navigator != null); 1205Debug.Assert(navigator.NodeType == XPathNodeType.Element); 1257Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction); 1288Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace); 1319Debug.Assert(_nsmgr != null); 1351Debug.Assert(prefix.Length != 0 && ns.Length != 0); 1399Debug.Assert(prefix != null && !string.IsNullOrEmpty(ns)); 1505Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length); 1554Debug.Assert(_stkNames != null);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (9)
72Debug.Assert(data != null); 332Debug.Assert(_atomizedNames != null); 341Debug.Assert(_filters != null); 395Debug.Assert(_prefixMappingsList != null); 462Debug.Assert(_types != null); 829Debug.Assert(_collations != null); 890Debug.Assert(context != null); 927Debug.Assert(context != null); 1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\Runtime\XmlQuerySequence.cs (1)
582Debug.Assert(cmp == XmlNodeOrder.Before || cmp == XmlNodeOrder.Unknown);
System\Xml\Xsl\Runtime\XmlQueryStaticData.cs (1)
41Debug.Assert(defaultWriterSettings != null && staticData != null);
System\Xml\Xsl\Runtime\XmlSortKey.cs (6)
70Debug.Assert(_nextKey != null && that._nextKey != null); 74Debug.Assert(_priority != that._priority); 85Debug.Assert(that != null && !(this is XmlEmptySortKey)); 125Debug.Assert(obj is XmlSortKey); 342Debug.Assert(_dblVal == double.NegativeInfinity || _dblVal == double.PositiveInfinity); 348Debug.Assert(that._dblVal == double.NegativeInfinity || that._dblVal == double.PositiveInfinity);
System\Xml\Xsl\Runtime\XslNumber.cs (5)
33Debug.Assert(startIdx >= 0 && tokLen > 0); 50Debug.Assert(startIdx >= 0 && tokLen > 0); 128Debug.Assert(groupingSeparator.Length <= 1); 274Debug.Assert(1 <= dblVal && dblVal < double.PositiveInfinity); 319Debug.Assert(groupSeparator.Length == 1);
System\Xml\Xsl\Runtime\XsltFunctions.cs (6)
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); 345Debug.Assert(stringValue != null); 531Debug.Assert(lang != null);
System\Xml\Xsl\Runtime\XsltLibrary.cs (7)
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);
System\Xml\Xsl\SourceLineInfo.cs (3)
70Debug.Assert(lineInfo.Start.Line == lineInfo.End.Line); 71Debug.Assert(lineInfo.Start.Pos == 0 && lineInfo.End.Pos == 0); 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 (2)
136Debug.Assert(_qil.Root != null); 210Debug.Assert(ndParam.NodeType == QilNodeType.Parameter);
System\Xml\Xsl\XmlQueryCardinality.cs (1)
24Debug.Assert(0x00 <= value && value <= 0x07);
System\Xml\Xsl\XmlQueryType.cs (1)
509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue);
System\Xml\Xsl\XmlQueryTypeFactory.cs (3)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union); 470Debug.Assert(!isNillable); 513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic);
System\Xml\Xsl\XPath\XPathBuilder.cs (17)
115Debug.Assert(op != XPathOperator.Unknown); 118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null)); 136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And); 147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String); 169Debug.Assert(val.XmlType!.IsSingleton); 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); 301Debug.Assert(op == XPathOperator.Union); 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 (4)
26Debug.Assert(_scanner == null && _builder == null); 27Debug.Assert(scanner != null && builder != null); 262Debug.Assert(scanner.Name == "processing-instruction"); 509Debug.Assert(IsPrimaryExpr());
System\Xml\Xsl\XPath\XPathQilFactory.cs (2)
133Debug.Assert(op == QilNodeType.Eq || op == QilNodeType.Ne); 149Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge);
System\Xml\Xsl\XPath\XPathScanner.cs (20)
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));
System\Xml\Xsl\XPathConvert.cs (116)
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); 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); 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); 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 (1)
164Debug.Assert(lineInfo == null || lineInfo.Uri != null);
System\Xml\Xsl\Xslt\Compiler.cs (9)
75Debug.Assert(stylesheet != null); 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); 302Debug.Assert((_savedErrorCount = -1) < 0); 305Debug.Assert((_savedErrorCount = -1) < 0); 452Debug.Assert(characters.Length == 8);
System\Xml\Xsl\Xslt\CompilerScopeManager.cs (6)
201Debug.Assert(varName.LocalName != null && varName.NamespaceUri != null); 209Debug.Assert(prefix != null); 249Debug.Assert(nsUri != null); 257Debug.Assert(recPrefix == null); 301Debug.Assert(localName != null); 415Debug.Assert(_scope._records[_currentRecord].IsNamespace);
System\Xml\Xsl\Xslt\Focus.cs (4)
47Debug.Assert(focusType != SingletonFocusType.Iterator); 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");
System\Xml\Xsl\Xslt\InvokeGenerator.cs (2)
104Debug.Assert(argName != null); 151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\KeyMatchBuilder.cs (4)
48Debug.Assert(base.numFixupLast == 0); 49Debug.Assert(base.numFixupPosition == 0); 77Debug.Assert(node != null); 78Debug.Assert(fixup != null);
System\Xml\Xsl\Xslt\MatcherBuilder.cs (6)
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 (3)
60Debug.Assert(prefix != null); 61Debug.Assert(uri != null); 142Debug.Assert(prefix != null);
System\Xml\Xsl\Xslt\QilGenerator.cs (36)
136Debug.Assert(compiler != null); 227Debug.Assert(IsDebug && _curLoop.IsFocusSet); 436Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS)); 437Debug.Assert(var.Binding is QilList); 446Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl); 447Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl); 478Debug.Assert(tmpl != null && tmpl.Function == null); 479Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template); 508Debug.Assert(tmpl.NodeType == XslNodeType.Template); 643Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown); 700Debug.Assert(instructions != null); 983Debug.Assert(pos < source.Length); 1019Debug.Assert(i == source.Length || source[i] == '{'); 1073Debug.Assert(avt != null); 1125Debug.Assert(_curLoop.IsFocusSet); 1179Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1215Debug.Assert(node.NodeType == XslNodeType.ApplyImports); 1417Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise); 1460Debug.Assert(node.NodeType == XslNodeType.Variable); 1470Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam); 1502Debug.Assert(varValue.SourceLine == null); 1508Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 1718Debug.Assert(result.XmlType == T.StringX); 1726Debug.Assert(sort.NodeType == XslNodeType.Sort); 2119Debug.Assert(num.Level == NumberLevel.Any); 2139Debug.Assert(sheet.TemplateMatches.Count == 0); 2223Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2259Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param); 2346Debug.Assert(expr != null); 2375Debug.Assert(pttrn != null); 2401Debug.Assert(pttrn != null); 2515Debug.Assert( 2800Debug.Assert(n.SourceLine == null); 2824Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS)); 2869Debug.Assert(let.NodeType == QilNodeType.Let); 2875Debug.Assert(0 <= varScope && varScope <= _vars.Count);
System\Xml\Xsl\Xslt\QilGeneratorEnv.cs (6)
76Debug.Assert(ns != null); 146Debug.Assert(ns != null); 409Debug.Assert(name.XmlType == T.StringX && key.XmlType == T.StringX); 439Debug.Assert(defList != null && defList.Count > 0); 456Debug.Assert(defList != null && defList.Count > 0); 667Debug.Assert(propValue.ValueType == typeof(double));
System\Xml\Xsl\Xslt\QilStrConcatenator.cs (3)
28Debug.Assert(!_inUse); 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 (2)
86Debug.Assert(var.NodeType == XslNodeType.Variable || var.NodeType == XslNodeType.Param); 104Debug.Assert(template.ImportPrecedence == 0);
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (18)
28Debug.Assert(environment != null); 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)); 80Debug.Assert(op == XPathOperator.Union); 81Debug.Assert(left != null); 82Debug.Assert(right != null); 122Debug.Assert( 190Debug.Assert(left != null); 191Debug.Assert(right != null); 195Debug.Assert(nop.Child == _fixupNode); 200Debug.Assert(left.NodeType == QilNodeType.Filter); 209Debug.Assert(nop.Child != null); 213Debug.Assert(right.NodeType == QilNodeType.Filter); 215Debug.Assert(lastParent != null); 291Debug.Assert(prefix.Length == 0); 355Debug.Assert(parent.NodeType == QilNodeType.Filter); 430Debug.Assert(current != null);
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 (8)
286Debug.Assert(tmpl.Match != null); 408Debug.Assert(target != null); 429Debug.Assert(instr.NodeType == XslNodeType.WithParam); 1014Debug.Assert(op != XPathOperator.Unknown); 1407Debug.Assert(split > 0); 1436Debug.Assert(scoperecord.IsNamespace || scoperecord.ncName == null); 1437Debug.Assert(!Compiler.IsPhantomNamespace(scoperecord.nsUri!)); 1478Debug.Assert(parent.Content.Count == split + 1);
System\Xml\Xsl\Xslt\XsltInput.cs (21)
43Debug.Assert(reader != null); 44Debug.Assert(atoms != null); 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); 332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference); 441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace); 488Debug.Assert(_reader.NodeType == XmlNodeType.Element); 650Debug.Assert(IsKeyword(_atoms.Version)); 714Debug.Assert(NodeType == XmlNodeType.Element); 715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length); 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); 1179Debug.Assert(input.NodeType == XmlNodeType.EndElement); 1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (29)
43Debug.Assert(compiler != null); 102Debug.Assert(compiler.Root != null); 298Debug.Assert(_input.NodeType == XmlNodeType.Element); 323Debug.Assert(!_input.IsXsltNamespace()); 324Debug.Assert(_curTemplate == null); 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); 993Debug.Assert(name.Equals(format.Name)); 1112Debug.Assert(_input.NodeType == XmlNodeType.Text); 1123Debug.Assert(_curTemplate == null); 1124Debug.Assert(_input.CanHaveApplyImports == false); 1141Debug.Assert(_curTemplate == null); 1455Debug.Assert(_input.NodeType == XmlNodeType.Text); 1503Debug.Assert(_input.NodeType == XmlNodeType.Text); 1716Debug.Assert(_input.NodeType == XmlNodeType.Text); 1921Debug.Assert(nodeType != XslNodeType.Unknown); 2034Debug.Assert(_input.NodeType == XmlNodeType.Element); 2480Debug.Assert(_input.NodeType == XmlNodeType.Element); 2523Debug.Assert(content != null && withParam != null); 2524Debug.Assert(withParam.NodeType == XslNodeType.WithParam); 2537Debug.Assert(content != null); 2546Debug.Assert(content != null); 3073Debug.Assert(node != null); 3080Debug.Assert(node != null); 3090Debug.Assert(to != null);
System\Xml\Xsl\Xslt\XsltQilFactory.cs (2)
140Debug.Assert(format != null); 153Debug.Assert(format != null);
System\Xml\Xsl\XsltOld\ActionFrame.cs (7)
100Debug.Assert(_variables != null && index < _variables.Length); 106Debug.Assert(_variables != null && index < _variables.Length); 129Debug.Assert(nodeSet != null); 136Debug.Assert(nodeSet != null); 143Debug.Assert(0 < sortarray.Count); 184Debug.Assert(parent != null); 221Debug.Assert(_action is ContainerAction);
System\Xml\Xsl\XsltOld\ApplyImportsAction.cs (1)
29Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\ApplyTemplatesAction.cs (7)
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);
System\Xml\Xsl\XsltOld\AttributeAction.cs (1)
118Debug.Assert(processor != null && frame != null);
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 (2)
26Debug.Assert(input != null); 27Debug.Assert(input.NodeType != XPathNodeType.Namespace);
System\Xml\Xsl\XsltOld\BuilderInfo.cs (1)
85Debug.Assert(info.NodeType != XmlNodeType.Text || XmlCharType.IsOnlyWhitespace(info.Value));
System\Xml\Xsl\XsltOld\CallTemplateAction.cs (2)
30Debug.Assert(_name == null); 84Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\CommentAction.cs (1)
26Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\Compiler.cs (33)
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. 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( 898Debug.Assert(start <= avt.Length); 922Debug.Assert(avtText != null);
System\Xml\Xsl\XsltOld\ContainerAction.cs (7)
168Debug.Assert(compiler.Input.NodeType == XPathNodeType.Element); 230Debug.Assert(uri != null); 674Debug.Assert(Ref.Equal(input.NamespaceURI, input.Atoms.UriXsl)); 758Debug.Assert(action != null); 854Debug.Assert((object)this == (object)compiler.RootAction); 953Debug.Assert(processor != null && frame != null); 981Debug.Assert(actionIndex == 0 || this.containedActions != null);
System\Xml\Xsl\XsltOld\CopyAction.cs (1)
52Debug.Assert(processor != null && frame != null);
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 (5)
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);
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 (2)
70Debug.Assert(_empty == false); 103Debug.Assert(processor != null && frame != null);
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 (3)
65Debug.Assert(processor != null && frame != null); 72Debug.Assert(_testKey != Compiler.InvalidQueryKey); 88Debug.Assert(frame.Container != null);
System\Xml\Xsl\XsltOld\InputScope.cs (1)
92Debug.Assert(variable != null);
System\Xml\Xsl\XsltOld\InputScopeManager.cs (9)
32Debug.Assert(_scopeStack != null); 33Debug.Assert(_scopeStack.Parent != null); 76Debug.Assert(prefix != null); 77Debug.Assert(nspace != null); 96Debug.Assert(!string.IsNullOrEmpty(prefix)); 119Debug.Assert(prefix != null); 129Debug.Assert(prefix != null); 140Debug.Assert(nsList != null); 163Debug.Assert(nsList != null);
System\Xml\Xsl\XsltOld\MessageAction.cs (2)
46Debug.Assert(processor != null && frame != null); 58Debug.Assert(recOutput != null);
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 (2)
28Debug.Assert(record != null); 40Debug.Assert(record.AttributeList[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\newinstructionaction.cs (1)
51Debug.Assert(processor != null && frame != null);
System\Xml\Xsl\XsltOld\NumberAction.cs (12)
84Debug.Assert(dblVal >= 1); 256Debug.Assert( 342Debug.Assert(nav.NodeType != XPathNodeType.Attribute && nav.NodeType != XPathNodeType.Namespace); 343Debug.Assert(MatchCountKey(processor, contextNode, 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); 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 (2)
61Debug.Assert(processor != null && frame != null); 88Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\Processor.cs (28)
128Debug.Assert(_execResult == ExecResult.Continue); 280Debug.Assert(!_stringBuilderLocked); 437Debug.Assert(_actionStack != null); 445Debug.Assert(_builder != null); 477Debug.Assert(frame != null); 506Debug.Assert(_templateLookup != null); 513Debug.Assert(key != Compiler.InvalidQueryKey); 519Debug.Assert(key != Compiler.InvalidQueryKey); 534Debug.Assert(key != Compiler.InvalidQueryKey); 603Debug.Assert(nav.NodeType == XPathNodeType.Element); 722Debug.Assert(_builder != null); 732Debug.Assert(_xsm != null); 746Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 747Debug.Assert(ExecutionResult == ExecResult.Continue); 751Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 775Debug.Assert(_xsm != null); 788Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 789Debug.Assert(ExecutionResult == ExecResult.Continue); 793Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 810Debug.Assert(_xsm != null); 824Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State); 934Debug.Assert(navigator != null); 957Debug.Assert(output != null); 968Debug.Assert(_builder != null); 1017Debug.Assert(saveStackSize == _actionStack.Length); 1030Debug.Assert(1 < _actionStack.Length); 1043Debug.Assert(2 < _actionStack.Length); 1086Debug.Assert(2 <= _debuggerStack!.Length);
System\Xml\Xsl\XsltOld\ReaderOutput.cs (28)
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); 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 (5)
187Debug.Assert(mark == null); 252Debug.Assert(processor != null && frame != null); 269Debug.Assert(frame.State == QueryInitialized); 271Debug.Assert(Processor.IsRoot(frame.Node!)); 284Debug.Assert(frame.State == RootProcessed);
System\Xml\Xsl\XsltOld\SequentialOutput.cs (11)
109Debug.Assert(record.MainNode.NodeType == XmlNodeType.Element); 407Debug.Assert(_outputCache[record] is BuilderInfo); 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); 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 (6)
48Debug.Assert(_templateId == 0); 96Debug.Assert(_matchKey == Compiler.InvalidQueryKey); 101Debug.Assert(_name == null); 106Debug.Assert(double.IsNaN(_priority)); 115Debug.Assert(_mode == null); 225Debug.Assert(processor != null && frame != null);
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 (1)
69Debug.Assert(processor != null && frame != null);
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 (2)
26Debug.Assert(Ref.Equal(compiler.Input.LocalName, compiler.Atoms.UseAttributeSets)); 29Debug.Assert(_useAttributeSets == null);
System\Xml\Xsl\XsltOld\ValueOfAction.cs (9)
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); 95Debug.Assert(processor != null && frame != null); 100Debug.Assert(frame != null); 101Debug.Assert(frame.NodeSet != null); 117Debug.Assert(frame.StoredOutput != null);
System\Xml\Xsl\XsltOld\VariableAction.cs (4)
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);
System\Xml\Xsl\XsltOld\WithParamAction.cs (2)
34Debug.Assert(processor != null && frame != null); 61Debug.Assert(recOutput is NavigatorOutput);
System\Xml\Xsl\XsltOld\WriterOutput.cs (2)
91Debug.Assert(list.Count >= count); 94Debug.Assert(list[attrib] is BuilderInfo);
System\Xml\Xsl\XsltOld\XsltCompileContext.cs (7)
255Debug.Assert(thisUri != null && baseUri != null); 656Debug.Assert(it != null); 920Debug.Assert(resultCollection.Count != 0); 921Debug.Assert(newList.Count != 0); 925Debug.Assert(resultCollection[0] is XPathNavigator); 962Debug.Assert(extension != null); 963Debug.Assert(method != null);
System\Xml\Xsl\XsltOld\XsltOutput.cs (1)
147Debug.Assert(_encoding != null);
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 (13)
src\libraries\Common\src\System\Collections\Generic\EnumerableHelpers.cs (1)
33Debug.Assert(Array.MaxLength == ArrayMaxLength);
System\Xml\Linq\XContainer.cs (1)
1247Debug.Assert(content != null);
System\Xml\Linq\XElement.cs (1)
1982Debug.Assert(e != null);
System\Xml\Linq\XHelper.cs (1)
13Debug.Assert(type != null);
System\Xml\Linq\XNode.cs (1)
65Debug.Assert(parent.content != null);
System\Xml\Linq\XObject.cs (1)
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 (1)
883Debug.Assert(navigator.UnderlyingObject != null);
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)
265Debug.Assert(types == null || types.Length == 0); 277Debug.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)
22Debug.Assert(position >= -1);
System\Reflection\Context\Virtual\VirtualPropertyBase.cs (3)
29Debug.Assert(context != null); 88Debug.Assert(getMethod != null || setMethod != null); 219Debug.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); 296Debug.Assert(baseCtor != null); 405Debug.Assert(ei.EventHandlerType != null); 623Debug.Assert(!target.IsByRef); 629Debug.Assert(!isAddress); 640Debug.Assert(!opCode.Equals(OpCodes.Nop)); 645Debug.Assert(source.IsAssignableFrom(target)); 662Debug.Assert(source.IsAssignableFrom(target) || target.IsInterface || source.IsInterface); 722Debug.Assert(_paramTypes[i].IsByRef);
System.Reflection.Emit (27)
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 (2)
482Debug.Assert(labelStartDepth >= -1); 483Debug.Assert(targetDepth >= -1);
System\Reflection\Emit\ModuleBuilderImpl.cs (8)
157Debug.Assert(typeBuilder._handle.Equals(typeHandle)); 368Debug.Assert(method._handle == handle); 498Debug.Assert(previousNonHiddenStartColumn < 0); 576Debug.Assert(deltaLines != 0 || deltaColumns != 0 || sequencePoint.IsHidden); 586Debug.Assert(deltaLines > 0); 639Debug.Assert(field._handle == handle); 1000Debug.Assert(tb.IsCreated()); 1007Debug.Assert(eb._typeBuilder.IsCreated());
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 (366)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Reflection\AssemblyNameFormatter.cs (1)
16Debug.Assert(name.Length != 0);
src\libraries\Common\src\System\Reflection\AssemblyNameParser.cs (1)
66Debug.Assert(input.Length > 0);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
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)
49Debug.Assert(CountBits(alignment) == 1); 62Debug.Assert(position >= 0 && alignment > 0); 63Debug.Assert(CountBits(alignment) == 1);
System\Reflection\Internal\Utilities\BlobUtilities.cs (6)
16Debug.Assert(buffer.Length > 0); 82Debug.Assert(written); 119Debug.Assert(byteCount >= charCount); 131Debug.Assert(*charPtr <= 0x7f); 185Debug.Assert(ptr == bufferPtr + start + byteCount); 186Debug.Assert(charPtr == strEnd);
System\Reflection\Internal\Utilities\EncodingHelper.netcoreapp.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); 597Debug.Assert(byteCount >= 0); 616Debug.Assert(byteCount <= MinChunkSize); 945Debug.Assert(unchecked((ushort)reference) == reference); 1077Debug.Assert(start >= 0); 1078Debug.Assert(length >= 0); 1079Debug.Assert(start + length <= str.Length);
System\Reflection\Metadata\BlobBuilder.Enumerators.cs (1)
22Debug.Assert(builder.IsHead);
System\Reflection\Metadata\BlobReader.cs (3)
40Debug.Assert(block.Length >= 0 && (block.Pointer != null || block.Length == 0)); 138Debug.Assert(remainder >= 0 && remainder < alignment); 514Debug.Assert(bytesRead == 4);
System\Reflection\Metadata\BlobWriter.cs (5)
40Debug.Assert(buffer != null); 41Debug.Assert(count >= 0); 42Debug.Assert(count <= buffer.Length - start); 109Debug.Assert(value >= 0); 359Debug.Assert(unchecked((ushort)reference) == reference);
System\Reflection\Metadata\BlobWriterImpl.cs (1)
18Debug.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( 319Debug.Assert( 414Debug.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)
67Debug.Assert(baseTableRowCounts != null); 271Debug.Assert(sizes[generation] == size); 304Debug.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); 97Debug.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)
61Debug.Assert(BlobUtilities.GetUTF8ByteCount(DefaultMetadataVersionString) == DefaultMetadataVersionString.Length);
System\Reflection\Metadata\Ecma335\MetadataSizes.cs (18)
127Debug.Assert(rowCounts.Length == MetadataTokens.TableCount); 128Debug.Assert(externalRowCounts.Length == MetadataTokens.TableCount); 129Debug.Assert(heapSizes.Length == MetadataTokens.HeapCount); 155Debug.Assert((PresentTablesMask & ExternalTablesMask) == 0); 275Debug.Assert(rowCounts[(int)TableIndex.FieldPtr] == 0); 277Debug.Assert(rowCounts[(int)TableIndex.MethodPtr] == 0); 279Debug.Assert(rowCounts[(int)TableIndex.ParamPtr] == 0); 291Debug.Assert(rowCounts[(int)TableIndex.EventPtr] == 0); 294Debug.Assert(rowCounts[(int)TableIndex.PropertyPtr] == 0); 305Debug.Assert(rowCounts[(int)TableIndex.AssemblyProcessor] == 0); 306Debug.Assert(rowCounts[(int)TableIndex.AssemblyOS] == 0); 308Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefProcessor] == 0); 309Debug.Assert(rowCounts[(int)TableIndex.AssemblyRefOS] == 0); 362Debug.Assert(RegularStreamHeaderSizes == 369Debug.Assert(EncDeltaMarkerStreamHeaderSize == GetMetadataStreamHeaderSize("#JTD")); 370Debug.Assert(StandalonePdbStreamHeaderSize == GetMetadataStreamHeaderSize("#Pdb")); 445Debug.Assert(result % StreamAlignment == 0); 480Debug.Assert(RowCounts[(int)table] == 0 || ExternalRowCounts[(int)table] == 0);
System\Reflection\Metadata\Ecma335\PortablePdbBuilder.cs (3)
63Debug.Assert(BlobUtilities.GetUTF8ByteCount(MetadataVersion) == MetadataVersion.Length); 116Debug.Assert(_serializedMetadata.Sizes.CalculateStandalonePdbStreamSize() == endPosition - startPosition); 150Debug.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); 233Debug.Assert(child != null && parent != null); 234Debug.Assert(!child.Handle.IsNil); 247Debug.Assert(realChild.Handle.HasFullName); 327Debug.Assert(table != null); 359Debug.Assert(table != null); 377Debug.Assert(namespaceHandle.HasFullName); 397Debug.Assert(_namespaceTable != null);
System\Reflection\Metadata\Internal\StringHeap.cs (11)
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); 300Debug.Assert(asciiChar != 0 && asciiChar <= 0x7f); 309Debug.Assert(!rawHandle.IsVirtual); 319Debug.Assert(!rawHandle.IsVirtual);
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); 1909Debug.Assert(NumberOfRows == 1); 1915Debug.Assert(NumberOfRows == 1); 1925Debug.Assert(NumberOfRows == 1); 1931Debug.Assert(NumberOfRows == 1); 1937Debug.Assert(NumberOfRows == 1); 1943Debug.Assert(NumberOfRows == 1);
System\Reflection\Metadata\MetadataReader.cs (5)
129Debug.Assert(AssemblyTable.NumberOfRows <= 1); 787Debug.Assert(local.Length == external.Length); 1429Debug.Assert(!enclosingClass.IsNil); 1443Debug.Assert(builder == groupedNestedTypes[enclosingClass]); 1466Debug.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\CustomDebugInformation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\Document.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
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\ImportScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalConstant.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalScope.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\LocalVariable.cs (2)
23Debug.Assert(reader != null); 24Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\PortablePdb\MethodDebugInformation.cs (1)
23Debug.Assert(reader != null);
System\Reflection\Metadata\PortablePdb\SequencePointCollection.cs (1)
101Debug.Assert(_previousNonHiddenStartColumn == 0);
System\Reflection\Metadata\TypeNameParserHelpers.cs (2)
25Debug.Assert(genericArgs.Length > 0); 189Debug.Assert(rankOrModifier >= 2);
System\Reflection\Metadata\TypeSystem\AssemblyDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\AssemblyFile.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\AssemblyReference.cs (3)
20Debug.Assert(reader != null); 21Debug.Assert(treatmentAndRowId != 0); 24Debug.Assert((treatmentAndRowId & ~(TokenTypeIds.VirtualBit | TokenTypeIds.RIDMask)) == 0);
System\Reflection\Metadata\TypeSystem\Constant.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\CustomAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\DeclarativeSecurityAttribute.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\EventDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ExportedType.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(rowId != 0);
System\Reflection\Metadata\TypeSystem\FieldDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\GenericParameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\GenericParameterConstraint.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
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)
18Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 101Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 184Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 267Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 362Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 445Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 528Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 611Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 694Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 777Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 860Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 943Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1026Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1109Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1192Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1275Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1358Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1441Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1524Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1629Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1635Debug.Assert(virtualIndex < VirtualIndex.Count); 1725Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1808Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1891Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 1974Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2057Debug.Assert(TokenTypeIds.IsValidRowId(rowId)); 2149Debug.Assert((offset & 0xFF000000) == 0); 2299Debug.Assert((value & StringHandleType.TypeMask) == StringHandleType.String || 2314Debug.Assert(virtualIndex < VirtualIndex.Count); 2325Debug.Assert(StringKind == StringKind.Plain); 2331Debug.Assert(StringKind == StringKind.Plain); 2337Debug.Assert(StringKind == StringKind.Plain); 2338Debug.Assert(prefixByteLength >= 0); 2383Debug.Assert(!IsVirtual || StringKind == StringKind.WinRTPrefixed); 2389Debug.Assert(IsVirtual && StringKind != StringKind.WinRTPrefixed); 2395Debug.Assert(IsNil || IsVirtual && StringKind == StringKind.Virtual); 2462Debug.Assert(virtualIndex != 0); 2507Debug.Assert(!IsVirtual); 2518Debug.Assert(HasFullName); 2588Debug.Assert(virtualIndex < VirtualIndex.Count); 2596Debug.Assert(blob.Length >= TemplateParameterOffset_AttributeUsageTarget + 4); 2633Debug.Assert(!IsVirtual); 2639Debug.Assert(IsVirtual);
System\Reflection\Metadata\TypeSystem\InterfaceImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ManifestResource.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MemberReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodDefinition.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\MethodImplementation.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\MethodSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\ModuleDefinition.cs (1)
14Debug.Assert(reader != null);
System\Reflection\Metadata\TypeSystem\ModuleReference.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\NamespaceDefinition.cs (1)
16Debug.Assert(data != null);
System\Reflection\Metadata\TypeSystem\Parameter.cs (2)
17Debug.Assert(reader != null); 18Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\PropertyDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\StandaloneSignature.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(!handle.IsNil);
System\Reflection\Metadata\TypeSystem\TypeDefinition.cs (2)
19Debug.Assert(reader != null); 20Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeReference.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(treatmentAndRowId != 0);
System\Reflection\Metadata\TypeSystem\TypeSpecification.cs (2)
18Debug.Assert(reader != null); 19Debug.Assert(!handle.IsNil);
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 (16)
150Debug.Assert(MetadataSize % 4 == 0); 151Debug.Assert(ResourceDataSize % 4 == 0); 190Debug.Assert(MappedFieldDataSize % MappedFieldDataAlignment == 0); 251Debug.Assert(builder.Count == 0); 252Debug.Assert(metadataBuilder.Count == MetadataSize); 253Debug.Assert(metadataBuilder.Count % 4 == 0); 254Debug.Assert(ilBuilder.Count == ILStreamSize); 255Debug.Assert((mappedFieldDataBuilderOpt?.Count ?? 0) == MappedFieldDataSize); 256Debug.Assert((resourceBuilderOpt?.Count ?? 0) == ResourceDataSize); 257Debug.Assert((resourceBuilderOpt?.Count ?? 0) % 4 == 0); 311Debug.Assert(builder.Count == ComputeSizeOfTextSection()); 333Debug.Assert(builder.Count - start == SizeOfImportAddressTable); 370Debug.Assert(builder.Count - start == SizeOfImportTable); 380Debug.Assert(builder.Count - start == SizeOfNameTable); 435Debug.Assert(builder.Count - start == CorHeaderSize); 436Debug.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 (5)
118Debug.Assert(stampWriter.RemainingBytes == 0); 157Debug.Assert(DosHeader.Length == DosHeaderSize); 497Debug.Assert(peImage != null); 498Debug.Assert(signatureProvider != null); 533Debug.Assert(segment.Count > 0);
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 (145)
System\CoreRtBridge.cs (1)
21Debug.Assert(t.IsGenericTypeDefinition);
System\Reflection\DefaultBinder.cs (1)
234Debug.Assert(returnType != null);
System\Reflection\MetadataLoadContext.CoreAssembly.cs (1)
17Debug.Assert(_coreAssembly == null);
System\Reflection\MetadataLoadContext.Resolving.cs (3)
27Debug.Assert(refName != null); 48Debug.Assert(refName != null); 59Debug.Assert(refName != null);
System\Reflection\PathAssemblyResolver.cs (1)
57Debug.Assert(assemblyName.Name != null);
System\Reflection\Runtime\BindingFlagSupport\ConstructorPolicies.cs (1)
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.
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 (1)
28Debug.Assert(index < Count);
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)
110Debug.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\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\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 (2)
21Debug.Assert(!handle.IsNil); 22Debug.Assert(reader != null);
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 (4)
92Debug.Assert(rank == 1 || multiDim); 209Debug.Assert(fullName != null); 233Debug.Assert(name != null); 316Debug.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 (6)
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); 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)
89Debug.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 (20)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
152Debug.Assert(_resourceList != null); 517Debug.Assert(writer != null);
src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (10)
341Debug.Assert(Monitor.IsEntered(this)); // uses _store 542Debug.Assert(Monitor.IsEntered(this)); // uses _store 562Debug.Assert(Monitor.IsEntered(this)); // uses _store 624Debug.Assert(Monitor.IsEntered(this)); // uses _store 644Debug.Assert(Monitor.IsEntered(this)); // uses _store 782Debug.Assert(!Monitor.IsEntered(this)); // only called during init 805Debug.Assert(!Monitor.IsEntered(this)); // only called during init 994Debug.Assert(Monitor.IsEntered(this)); // uses _store 1034Debug.Assert(Monitor.IsEntered(this)); // uses _store 1118Debug.Assert(!Monitor.IsEntered(_reader));
src\libraries\System.Private.CoreLib\src\System\Resources\RuntimeResourceSet.cs (1)
287Debug.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 (2)
266Debug.Assert(Options.SurrogateSelector is not null); 363Debug.Assert(_pendingUpdates is not null);
System\Resources\Extensions\PreserializedResourceWriter.cs (2)
109Debug.Assert(primitiveValue.GetType() == primitiveType); 230Debug.Assert(record != null);
System.Resources.Writer (3)
src\libraries\Common\src\System\Resources\ResourceWriter.cs (2)
152Debug.Assert(_resourceList != null); 517Debug.Assert(writer != null);
System\Resources\ResourceWriter.core.cs (1)
51Debug.Assert(data != null);
System.Runtime.Caching (5)
System\Runtime\Caching\CacheExpires.cs (2)
594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry); 775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheMemoryMonitor.cs (1)
173Debug.Assert(SAMPLE_COUNT == 2);
System\Runtime\Caching\MemoryCacheKeyEqualityComparer.cs (2)
13Debug.Assert(x != null && x is MemoryCacheKey); 14Debug.Assert(y != null && y is MemoryCacheKey);
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 (231)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Number.Formatting.Common.cs (11)
144Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 281Debug.Assert(format is 'G' or 'g'); 293Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 716Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 750Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 865Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 886Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 913Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 935Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 959Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte)); 1013Debug.Assert(sizeof(TChar) == sizeof(char) || sizeof(TChar) == sizeof(byte));
src\libraries\Common\src\System\Number.NumberBuffer.cs (3)
37Debug.Assert(digits != null); 45Debug.Assert(!digits.IsEmpty); 65Debug.Assert((Kind == NumberBufferKind.Integer) || (Kind == NumberBufferKind.Decimal) || (Kind == NumberBufferKind.FloatingPoint));
src\libraries\Common\src\System\Number.Parsing.Common.cs (11)
16Debug.Assert(str != null); 17Debug.Assert(strEnd != null); 18Debug.Assert(str <= strEnd); 19Debug.Assert((styles & (NumberStyles.AllowHexSpecifier | NumberStyles.AllowBinarySpecifier)) == 0); 28Debug.Assert(number.DigitsCount == 0); 29Debug.Assert(number.Scale == 0); 30Debug.Assert(!number.IsNegative); 31Debug.Assert(!number.HasNonZeroTail); 228Debug.Assert(numberOfTrailingZeros >= 0); 283Debug.Assert(info != null); 339Debug.Assert((p != null) && (pEnd != null) && (p <= pEnd));
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Buffers\Text\FormattingHelpers.CountDigits.cs (2)
25Debug.Assert(log2ToPow10.Length == 64); 55Debug.Assert((elementOffset + 1) <= powersOf10.Length);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
System\Number.BigInteger.cs (28)
275Debug.Assert(leading != 0); 362Debug.Assert(intDigits.Length % PowersOf1e9.MaxPartialDigits == 0); 369Debug.Assert(intDigits.Length == 0); 445Debug.Assert(bits.Trim(0u).Length == 0); 446Debug.Assert(BigIntegerParseNaiveThresholdInRecursive > 1); 463Debug.Assert(multiplier1E9Length < base1E9.Length && base1E9.Length <= multiplier1E9Length * 2); 505Debug.Assert(bits[resultLength] == 0); 514Debug.Assert(bits[resultLength] == 0); 530Debug.Assert(bits[resultLength] == 0); 553Debug.Assert(format == 'x' || format == 'X'); 562Debug.Assert(success); 643Debug.Assert(success); 647Debug.Assert(!bytes.IsEmpty); 656Debug.Assert(arrayToReturnToPool is not null); 664Debug.Assert(digits < Array.MaxLength); 703Debug.Assert(sb.Length == charsIncludeDigits); 749Debug.Assert(formatString == null || formatString.Length == formatSpan.Length); 779Debug.Assert(formatString != null); 791Debug.Assert((long)BigInteger.MaxLength * (MaxPartialDigits + 1) / MaxPartialDigits + 1 < (long)int.MaxValue); // won't overflow 805Debug.Assert(base1E9Buffer[iuDst] < TenPowMaxPartial); 1055Debug.Assert(pow1E9.Length >= 1); 1056Debug.Assert(Indexes[6] == LeadingPowers1E9.Length); 1069Debug.Assert(2 * src.Length - (Indexes[i + 1] - Indexes[i]) is 0 or 1); 1077Debug.Assert(toExclusive == pow1E9.Length || pow1E9[toExclusive] == 0); 1114Debug.Assert(trailingZeroCount >= 0); 1151Debug.Assert(fi + 1 < Indexes.Length); 1176Debug.Assert(Unsafe.AreSame(ref bits[0], ref powersOfTen2[0])); 1237Debug.Assert(destination.Length * TParser.DigitsPerBlock == input.Length);
System\Number.Polyfill.cs (11)
84Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 92Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 100Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 108Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 116Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 124Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 132Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 140Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 148Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 156Debug.Assert(typeof(TChar) == typeof(Utf16Char)); 164Debug.Assert(typeof(TChar) == typeof(Utf16Char));
System\Numerics\BigInteger.cs (45)
171Debug.Assert(sign == +1 || sign == -1); 179Debug.Assert(man < (1UL << 53)); 180Debug.Assert(exp <= 0 || man >= (1UL << 52)); 209Debug.Assert(0 <= cbit && cbit < kcbitUint); 210Debug.Assert(cu >= 1); 230Debug.Assert(bits.Length == 4 && (bits[3] & DecimalScaleFactorMask) == 0); 559Debug.Assert((int)value[length - 1] < 0); 769Debug.Assert(dividend._bits != null); 796Debug.Assert(divisor._bits != null); 889Debug.Assert(right._bits != null); 897Debug.Assert(left._bits != null); 903Debug.Assert(left._bits != null && right._bits != null); 917Debug.Assert(BigIntegerCalculator.Compare(leftBits, rightBits) >= 0); 1379Debug.Assert(bits.Length > 0); 1380Debug.Assert(bits[bits.Length - 1] != 0); 1390Debug.Assert(highDword <= uint.MaxValue - 1); 1396Debug.Assert(sign == 1); 1477Debug.Assert(msbIndex >= 0 && msbIndex <= 3); 1496Debug.Assert(isBigEndian || (!needExtraByte && curByte == length - 1) || (needExtraByte && curByte == length - 2)); 1498Debug.Assert(!isBigEndian || (!needExtraByte && curByte == 0) || (needExtraByte && curByte == 1)); 1517Debug.Assert(_bits is null || _sign == 0 ? buffer.Length == 2 : buffer.Length >= _bits.Length + 1); 1656Debug.Assert(!rightBits.IsEmpty); 1668Debug.Assert(!leftBits.IsEmpty); 1680Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1692Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 1734Debug.Assert(!rightBits.IsEmpty); 1746Debug.Assert(!leftBits.IsEmpty); 1768Debug.Assert(!leftBits.IsEmpty && !rightBits.IsEmpty); 2709Debug.Assert(!right.IsEmpty); 2721Debug.Assert(!left.IsEmpty); 2743Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2756Debug.Assert(!left.IsEmpty && !right.IsEmpty); 2798Debug.Assert(dividend._bits != null); 2818Debug.Assert(dividend._bits != null && divisor._bits != null); 2863Debug.Assert(dividend._bits != null); 2868Debug.Assert(dividend._bits != null && divisor._bits != null); 3113Debug.Assert(_bits is null ? xd.Length == 1 : xd.Length == _bits.Length); 3132Debug.Assert(_sign == 1 || _sign == -1); 3134Debug.Assert(_bits.Length > 0); 3136Debug.Assert(_bits.Length > 1 || _bits[0] >= kuMaskHighBit); 3138Debug.Assert(_bits[_bits.Length - 1] != 0); 3140Debug.Assert(_bits.Length <= MaxLength); 3145Debug.Assert(_sign > int.MinValue); 3689Debug.Assert(Unsafe.AreSame(ref startAddress, ref Unsafe.Add(ref address, sizeof(uint)))); 3790Debug.Assert(Unsafe.AreSame(ref lastAddress, ref Unsafe.Subtract(ref address, sizeof(uint))));
System\Numerics\BigIntegerCalculator.AddSub.cs (15)
21Debug.Assert(left.Length >= 1); 22Debug.Assert(bits.Length == left.Length + 1); 29Debug.Assert(right.Length >= 1); 30Debug.Assert(left.Length >= right.Length); 31Debug.Assert(bits.Length == left.Length + 1); 61Debug.Assert(left.Length >= right.Length); 87Debug.Assert(carry == 0); 92Debug.Assert(left.Length >= 1); 93Debug.Assert(left[0] >= right || left.Length >= 2); 94Debug.Assert(bits.Length == left.Length); 101Debug.Assert(right.Length >= 1); 102Debug.Assert(left.Length >= right.Length); 103Debug.Assert(Compare(left, right) >= 0); 104Debug.Assert(bits.Length == left.Length); 134Debug.Assert(left.Length >= right.Length);
System\Numerics\BigIntegerCalculator.DivRem.cs (28)
13Debug.Assert(left.Length >= 1); 14Debug.Assert(quotient.Length == left.Length); 34Debug.Assert(left.Length >= 1); 35Debug.Assert(quotient.Length == left.Length); 51Debug.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); 78Debug.Assert(left.Length >= 1); 79Debug.Assert(right.Length >= 1); 80Debug.Assert(left.Length >= right.Length); 81Debug.Assert(quotient.Length == left.Length - right.Length + 1); 102Debug.Assert(left.Length >= 1); 103Debug.Assert(right.Length >= 1); 104Debug.Assert(left.Length >= right.Length); 105Debug.Assert(remainder.Length >= left.Length); 115Debug.Assert(left.Length >= 1); 116Debug.Assert(right.Length >= 1); 117Debug.Assert(left.Length >= right.Length); 118Debug.Assert(bits.Length == left.Length - right.Length + 1 177Debug.Assert(carry == t + 1); 183Debug.Assert(carry == 1); 198Debug.Assert(left.Length >= right.Length); 217Debug.Assert(left.Length >= right.Length); 218Debug.Assert(q <= 0xFFFFFFFF); 242Debug.Assert(q <= 0xFFFFFFFF);
System\Numerics\BigIntegerCalculator.FastReducer.cs (9)
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); 46Debug.Assert(value.Length <= _modulus.Length * 2); 70Debug.Assert(!right.IsEmpty); 71Debug.Assert(!bits.IsEmpty); 72Debug.Assert(bits.Length + k >= left.Length + right.Length);
System\Numerics\BigIntegerCalculator.GcdInv.cs (20)
46Debug.Assert(left.Length >= 1); 47Debug.Assert(right != 0); 59Debug.Assert(left.Length >= 2); 60Debug.Assert(right.Length >= 2); 61Debug.Assert(Compare(left, right) >= 0); 62Debug.Assert(result.Length == left.Length); 80Debug.Assert(left.Length >= 2); 81Debug.Assert(right.Length >= 2); 82Debug.Assert(left.Length >= right.Length); 205Debug.Assert(buffer.Length >= 2); 225Debug.Assert(xBuffer.Length >= 3); 226Debug.Assert(yBuffer.Length >= 3); 227Debug.Assert(xBuffer.Length >= yBuffer.Length); 272Debug.Assert(x >= y); 280Debug.Assert(x.Length >= 1); 281Debug.Assert(y.Length >= 1); 282Debug.Assert(x.Length >= y.Length); 283Debug.Assert(a <= 0x7FFFFFFF && b <= 0x7FFFFFFF); 284Debug.Assert(c <= 0x7FFFFFFF && d <= 0x7FFFFFFF); 306Debug.Assert(bits.Length >= maxLength);
System\Numerics\BigIntegerCalculator.PowMod.cs (11)
23Debug.Assert(bits.Length == PowBound(power, value.Length)); 50Debug.Assert(value.Length >= valueLength); 51Debug.Assert(temp.Length == result.Length); 52Debug.Assert(value.Length == temp.Length); 72Debug.Assert(leftLength <= left.Length); 95Debug.Assert(valueLength <= value.Length); 96Debug.Assert(temp.Length >= valueLength + valueLength); 211Debug.Assert(!modulus.IsEmpty); 212Debug.Assert(bits.Length == modulus.Length + modulus.Length); 260Debug.Assert(!modulus.IsEmpty); 261Debug.Assert(bits.Length == modulus.Length + modulus.Length);
System\Numerics\BigIntegerCalculator.SquMul.cs (18)
23Debug.Assert(bits.Length == value.Length + value.Length); 133Debug.Assert(bits.Length == left.Length + 1); 161Debug.Assert(left.Length >= right.Length); 162Debug.Assert(bits.Length >= left.Length + right.Length); 163Debug.Assert(bits.Trim(0u).IsEmpty); 164Debug.Assert(MultiplyKaratsubaThreshold >= 2); 214Debug.Assert(leftLow.Length >= leftHigh.Length); 249Debug.Assert(left.Length >= right.Length); 250Debug.Assert(2 * n - left.Length is 0 or 1); 251Debug.Assert(right.Length > n); 252Debug.Assert(bits.Length >= left.Length + right.Length); 272Debug.Assert(leftLow.Length >= leftHigh.Length); 273Debug.Assert(rightLow.Length >= rightHigh.Length); 274Debug.Assert(bitsLow.Length >= bitsHigh.Length); 320Debug.Assert(ActualLength(core) <= left.Length + 1); 333Debug.Assert(right.Length < MultiplyKaratsubaThreshold); 364Debug.Assert(left.Length >= right.Length); 365Debug.Assert(core.Length >= left.Length);
System\Numerics\BigIntegerCalculator.Utils.cs (2)
20Debug.Assert(left.Length <= right.Length || left.Slice(right.Length).ContainsAnyExcept(0u)); 21Debug.Assert(left.Length >= right.Length || right.Slice(left.Length).ContainsAnyExcept(0u));
System\Numerics\Complex.cs (4)
300Debug.Assert((x >= 0.0) || double.IsNaN(x)); 529Debug.Assert((x >= 0.0) || double.IsNaN(x)); 530Debug.Assert((y >= 0.0) || double.IsNaN(y)); 2209Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
System\Numerics\NumericsHelpers.cs (2)
59Debug.Assert((man & 0xFFF0000000000000) == 0x0010000000000000); 82Debug.Assert(bits != 0);
System.Runtime.Serialization.Formatters (18)
src\libraries\System.Private.CoreLib\src\System\Collections\HashHelpers.cs (2)
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 (8)
181Debug.Assert(holder.SerializationInfo != null); 224Debug.Assert(holder.IsIncompleteObjectReference); 243Debug.Assert(holder.ObjectValue != null); 313Debug.Assert(tempHolder != null); 443Debug.Assert(holderValue != null); 499Debug.Assert(holder.ObjectValue is Array); 510Debug.Assert(fixupInfo is MemberInfo); 596Debug.Assert(temp != null);
System\Runtime\Serialization\SerializationFieldInfo.cs (2)
17Debug.Assert(field != null); 18Debug.Assert(namePrefix != null);
System\Runtime\Serialization\SurrogateSelector.cs (2)
122Debug.Assert(tempPrev != null); 182Debug.Assert(type != null);
System.Runtime.Serialization.Schema (32)
System\Runtime\Serialization\Schema\CodeExporter.cs (30)
262Debug.Assert(classContract.Is(DataContractType.ClassDataContract)); 314Debug.Assert(contractCodeDomInfo.TypeReference != null); 577Debug.Assert(typeReference != null); 602Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 631Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 649Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 661Debug.Assert(itemContract != null); 662Debug.Assert(itemContract.DataMembers.Count >= 2); 780Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 787Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 827Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 935Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 972Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 973Debug.Assert(classDataContract.KnownDataContracts != null); 985Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 995Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1060Debug.Assert(enumDataContract.Is(DataContractType.EnumDataContract)); 1067Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1109Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract)); 1123Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1159Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type 1169Debug.Assert(keyValueContract == null || keyValueContract.Is(DataContractType.ClassDataContract)); 1191Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract)); 1237Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1250Debug.Assert(keyName != null); 1251Debug.Assert(valueName != null); 1268Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1374Debug.Assert(contractCodeDomInfo.TypeDeclaration != null); 1495Debug.Assert(clrNamespace != null); 1496Debug.Assert(codeNamespace != null);
System\Runtime\Serialization\Schema\ContractCodeDomInfo.cs (1)
60Debug.Assert(!names.Contains(memberName));
System\Runtime\Serialization\Schema\XsdDataContractImporter.cs (1)
140Debug.Assert(elementNames != null && elementNames.Count > 0);
System.Security.Cryptography (512)
src\libraries\Common\src\Interop\Unix\System.Native\Interop.GetPwUid.cs (1)
69Debug.Assert(passwd.Name != null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Dsa.cs (4)
46Debug.Assert(size * 2 < DsaEncodedSignatureSize(dsa)); 181Debug.Assert(i >= 0); 194Debug.Assert(value1 >= 0); 195Debug.Assert(value2 >= 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Encode.cs (2)
43Debug.Assert(size == size2); 79Debug.Assert(size == size2);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Kdf.cs (4)
87Debug.Assert(ret == 0); 112Debug.Assert(ret == 0); 137Debug.Assert(ret == 0); 165Debug.Assert(ret == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.KdfAlgs.cs (1)
41Debug.Assert(kdf.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.Mac.cs (6)
83Debug.Assert(ret == 0); 95Debug.Assert(ret == 0); 107Debug.Assert(ret == 0); 136Debug.Assert(ret == 0); 148Debug.Assert(ret == 0); 160Debug.Assert(ret == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EVP.MacAlgs.cs (1)
38Debug.Assert(mac.IsInvalid);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.cs (6)
157Debug.Assert(written == size); 208Debug.Assert(written == size); 230Debug.Assert(engineName is not null); 231Debug.Assert(keyName is not null); 260Debug.Assert(engineName is not null); 261Debug.Assert(keyName is not null);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Ecdh.cs (5)
24Debug.Assert(pkey != null); 25Debug.Assert(!pkey.IsInvalid); 26Debug.Assert(peerKey != null); 27Debug.Assert(!peerKey.IsInvalid); 38Debug.Assert(written == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.EcDsa.cs (2)
38Debug.Assert(written == -1); 77Debug.Assert(ret == -1);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.EvpPkey.Rsa.cs (5)
19Debug.Assert(rsa != IntPtr.Zero); 78Debug.Assert(written == -1); 115Debug.Assert(written == -1); 156Debug.Assert(written == -1); 205Debug.Assert(ret == -1);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.Hmac.cs (1)
50Debug.Assert(result == 0);
src\libraries\Common\src\Interop\Unix\System.Security.Cryptography.Native\Interop.RAND.cs (1)
13Debug.Assert(count >= 0);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeDsaHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeEcKeyHandle.Unix.cs (1)
32Debug.Assert(handle != IntPtr.Zero);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeHandleCache.cs (2)
41Debug.Assert(currentHandle.IsInvalid); 51Debug.Assert(handle != null);
src\libraries\Common\src\Microsoft\Win32\SafeHandles\SafeInteriorHandle.cs (1)
46Debug.Assert(addedRef);
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\Http\X509ResourceClient.cs (1)
31Debug.Assert(task.IsCompletedSuccessfully);
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (2)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
86Debug.Assert(attribute != null);
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\libraries\Common\src\System\Security\Cryptography\DSAOpenSsl.cs (1)
246Debug.Assert(bytesWritten == p1363SignatureSize);
src\libraries\Common\src\System\Security\Cryptography\EccKeyFormatHelper.cs (7)
167Debug.Assert((x == null) == (y == null)); 538Debug.Assert(oid.FriendlyName != null); 546Debug.Assert(ecParameters.Curve.IsPrime || ecParameters.Curve.IsCharacteristic2); 588Debug.Assert(ecParameters.Curve.IsCharacteristic2); 614Debug.Assert(k2 < 0); 615Debug.Assert(k1 > 0); 853Debug.Assert(ecParameters.Q.Y != null);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanDerivation.cs (11)
23Debug.Assert(otherPartyPublicKey != null); 24Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 32Debug.Assert(secretAgreement == null); 48Debug.Assert(otherPartyPublicKey != null); 49Debug.Assert(!string.IsNullOrEmpty(hashAlgorithm.Name)); 63Debug.Assert(hmacKey != null); 82Debug.Assert(secretAgreement == null); 109Debug.Assert(otherPartyPublicKey != null); 121Debug.Assert(secretAgreement != null); 151Debug.Assert(ret.Length == OutputSize); 198Debug.Assert(hashOutputSize is Sha1Size or Md5Size);
src\libraries\Common\src\System\Security\Cryptography\ECDiffieHellmanOpenSsl.Derive.cs (3)
79Debug.Assert(secretAgreement is not null); 88Debug.Assert(otherPartyPublicKey != null); 89Debug.Assert(_key is not null); // Callers should validate prior.
src\libraries\Common\src\System\Security\Cryptography\ECDsaOpenSsl.cs (1)
132Debug.Assert(bytesWritten == encodedSize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.cs (4)
53Debug.Assert(key != null); 54Debug.Assert(!key.IsInvalid); 55Debug.Assert(!key.IsClosed); 121Debug.Assert(keySize == createdKeySize);
src\libraries\Common\src\System\Security\Cryptography\ECOpenSsl.ImportExport.cs (3)
109Debug.Assert(parameters.Curve.IsNamed); 126Debug.Assert(parameters.Curve.IsPrime); 146Debug.Assert(parameters.Curve.IsCharacteristic2);
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (1)
71Debug.Assert(!integer.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (2)
82Debug.Assert(oidValue != null); 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (15)
29Debug.Assert(pbeParameters != null); 32Debug.Assert(pbeParameters.IterationCount > 0); 75Debug.Assert(destination.Length >= encryptedData.Length); 148Debug.Assert(digestAlgorithmName.Name != null); 149Debug.Assert(cipher != null); 201Debug.Assert(written == buf.Length); 238Debug.Assert(pbeParameters != null); 305Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 353Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 393Debug.Assert(pwdTmpBytes!.Length == 0); 406Debug.Assert(encryptor.CanTransformMultipleBlocks); 486Debug.Assert(written == buf.Length); 940Debug.Assert(decryptor.CanTransformMultipleBlocks);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
212Debug.Assert(macKey.Length <= 128);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
379Debug.Assert(pbeParameters != null); 380Debug.Assert(pbeParameters.IterationCount >= 1); 463Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (5)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0);
src\libraries\Common\src\System\Security\Cryptography\RSAKeyFormatHelper.cs (1)
210Debug.Assert(copyFrom == null || pkcs1PrivateKey.IsEmpty);
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (13)
174Debug.Assert(!key.IsInvalid); 193Debug.Assert(padding.OaepHashAlgorithm.Name != null); 260Debug.Assert(padding.OaepHashAlgorithm.Name != null); 271Debug.Assert(written == rsaSize); 389Debug.Assert(read == spki.Length); 400Debug.Assert(read == spki.Length); 443Debug.Assert(read == spki.Length); 547Debug.Assert(!newKey.IsInvalid); 594Debug.Assert(!newKey.IsInvalid); 770Debug.Assert(bytesWritten == bytesRequired); 812Debug.Assert(read == pkcs8.Length); 865Debug.Assert(padding == RSASignaturePadding.Pkcs1); 869Debug.Assert(padding == RSASignaturePadding.Pss);
src\libraries\Common\src\System\Security\Cryptography\RsaPaddingProcessor.cs (13)
182Debug.Assert(source.Length > 11); 206Debug.Assert(lenIfBad < 0); 234Debug.Assert((selector | (selector - 1)) == -1); 321Debug.Assert(hasher.HashLengthInBytes == hLen); 357Debug.Assert(hLen is >= 0 and <= 64); 426Debug.Assert(hasher.HashLengthInBytes == hLen); 428Debug.Assert(hLen is >= 0 and <= 64); 486Debug.Assert(em.Length >= emLen); 526Debug.Assert(hasher.HashLengthInBytes == hLen); 564Debug.Assert(hLen is >= 0 and <= 64); 609Debug.Assert(bytesWritten == hLen); 614Debug.Assert(hLen is >= 0 and <= 64); 623Debug.Assert(bytesWritten == hLen);
src\libraries\Common\src\System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (1)
81Debug.Assert(current > 0);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.cs (2)
567Debug.Assert(rented is null != mapped is null); 641Debug.Assert(decoded.HasValue);
src\libraries\Common\src\System\Security\Cryptography\X509Certificates\X509CertificateLoader.Pkcs12.cs (10)
664Debug.Assert(_decryptBuffer.Length >= upperBound); 673Debug.Assert(_decryptBuffer is not null); 674Debug.Assert(_decryptBuffer.Length - _decryptBufferOffset >= encryptedContent.Length); 740Debug.Assert(_certBags is not null); 749Debug.Assert(_keyBags is not null); 769Debug.Assert(_keyBags is not null); 857Debug.Assert(decrypted.Array is not null); 858Debug.Assert(_keyDecryptBuffer.Length - _keyDecryptBufferOffset >= decrypted.Count); 886Debug.Assert(_certBags is not null); 887Debug.Assert(_keyBags is not null);
src\libraries\Common\src\System\Text\UrlBase64Encoding.cs (2)
26Debug.Assert(charsWritten == base64Len); 65Debug.Assert(source[0] == '=');
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\IO\PersistedFiles.Unix.cs (1)
101Debug.Assert(passwd.HomeDirectory != null);
System\Security\Cryptography\AesCcm.OpenSsl.cs (1)
22Debug.Assert(_keyBox is null);
System\Security\Cryptography\AesGcm.cs (1)
162Debug.Assert(tagSizeInBytes.IsLegalSize(TagByteSizes));
System\Security\Cryptography\AsnFormatter.cs (2)
21Debug.Assert(sArray != null && sArray.Length != 0); 41Debug.Assert(j == hexOrder.Length);
System\Security\Cryptography\AsymmetricAlgorithmHelpers.Der.cs (4)
35Debug.Assert(input.Length % 2 == 0); 36Debug.Assert(input.Length > 1); 68Debug.Assert(destination.Length >= encodedSize); 127Debug.Assert(payloadLength >= 0);
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); 226Debug.Assert(written == outputSize); 295Debug.Assert(bytesToTransform >= 4); 300Debug.Assert(_inputIndex < _inputBuffer.Length); 308Debug.Assert(consumed == bytesToTransform); 312Debug.Assert(status == OperationStatus.InvalidData);
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\CngAlgorithm.cs (3)
57Debug.Assert(_algorithm != null); 74Debug.Assert(_algorithm != null); 80Debug.Assert(_algorithm != null);
System\Security\Cryptography\CngAlgorithmGroup.cs (3)
58Debug.Assert(_algorithmGroup != null); 75Debug.Assert(_algorithmGroup != null); 81Debug.Assert(_algorithmGroup != null);
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\CryptoConfig.cs (3)
96Debug.Assert(ht.Count <= capacity); // if more entries are added in the future, increase initial capacity. 274Debug.Assert(ht.Count <= capacity); // // if more entries are added in the future, increase initial capacity. 588Debug.Assert(encodedOidNumsIndex == encodedOidNumsLength);
System\Security\Cryptography\CryptographicOperations.cs (17)
119Debug.Assert(hashAlgorithm.Name is not null); 123Debug.Assert(written == hashSizeInBytes); 188Debug.Assert(hashAlgorithm.Name is not null); 197Debug.Assert(bytesWritten == hashSizeInBytes); 230Debug.Assert(hashAlgorithm.Name is not null); 266Debug.Assert(hashAlgorithm.Name is not null); 270Debug.Assert(written == hashSizeInBytes); 316Debug.Assert(hashAlgorithm.Name is not null); 364Debug.Assert(hashAlgorithm.Name is not null); 423Debug.Assert(hashAlgorithm.Name is not null); 427Debug.Assert(written == hashSizeInBytes); 503Debug.Assert(hashAlgorithm.Name is not null); 512Debug.Assert(bytesWritten == hashSizeInBytes); 578Debug.Assert(hashAlgorithm.Name is not null); 616Debug.Assert(hashAlgorithm.Name is not null); 708Debug.Assert(hashAlgorithm.Name is not null); 754Debug.Assert(hashAlgorithm.Name is not null);
System\Security\Cryptography\CryptoStream.cs (9)
265Debug.Assert(_outputBuffer != null); 296Debug.Assert(completedValueTask.IsCompleted); 328Debug.Assert(_outputBufferIndex == 0); 331Debug.Assert(_inputBufferIndex == 0); 543Debug.Assert(_inputBuffer != null); 569Debug.Assert(_inputBuffer != null && _outputBuffer != null); 624Debug.Assert(_outputBuffer != null); 639Debug.Assert(_inputBuffer != null); 654Debug.Assert(segment.Array is not null);
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\DSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\ECCurve.cs (1)
242Debug.Assert(CurveType == ECCurveType.Implicit);
System\Security\Cryptography\ECDiffieHellmanWrapper.cs (2)
14Debug.Assert(wrapped != null); 179Debug.Assert(wrapped != null);
System\Security\Cryptography\ECDsa.cs (1)
1203Debug.Assert(tmp.Length == HashBufferStackSize);
System\Security\Cryptography\ECDsaWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\HashProvider.cs (1)
45Debug.Assert(written == HashSizeInBytes);
System\Security\Cryptography\HashProviderDispenser.OpenSsl.cs (3)
41Debug.Assert(macHandle is not null); 48Debug.Assert(evpType != IntPtr.Zero); 55Debug.Assert(ret == 0);
System\Security\Cryptography\HashProviderDispenser.Unix.cs (5)
41Debug.Assert(evpType != IntPtr.Zero); 52Debug.Assert(written == hashSize); 59Debug.Assert(evpType != IntPtr.Zero); 75Debug.Assert(ret == 0); 79Debug.Assert(length == hashSize);
System\Security\Cryptography\Helpers.cs (2)
122Debug.Assert(index < cbHex); 133Debug.Assert(index == cbHex);
System\Security\Cryptography\HKDF.OpenSsl.cs (6)
21Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 22Debug.Assert(hashAlgorithmName.Name is not null); 41Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 42Debug.Assert(hashAlgorithmName.Name is not null); 62Debug.Assert(Interop.Crypto.EvpKdfAlgs.Hkdf is not null); 63Debug.Assert(hashAlgorithmName.Name is not null);
System\Security\Cryptography\HKDFManagedImplementation.cs (2)
14Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength); 21Debug.Assert(Helpers.HashLength(hashAlgorithmName) == hashLength);
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 (3)
48Debug.Assert(HashSizeValue == HashSizeInBits); 109Debug.Assert(written == buffer.Length); 159Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA1.cs (3)
47Debug.Assert(HashSizeValue == HashSizeInBits); 113Debug.Assert(written == buffer.Length); 161Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA256.cs (3)
46Debug.Assert(HashSizeValue == HashSizeInBits); 105Debug.Assert(written == buffer.Length); 153Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_256.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_384.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA3_512.cs (3)
68Debug.Assert(HashSizeValue == _hMacCommon.HashSizeInBits); 141Debug.Assert(written == buffer.Length); 191Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA384.cs (3)
45Debug.Assert(HashSizeValue == HashSizeInBits); 122Debug.Assert(written == buffer.Length); 170Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\HMACSHA512.cs (2)
119Debug.Assert(written == buffer.Length); 167Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\IncrementalHash.cs (15)
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)); 395Debug.Assert(!HMACSHA3_256.IsSupported); 398Debug.Assert(!HMACSHA3_384.IsSupported); 401Debug.Assert(!HMACSHA3_512.IsSupported);
System\Security\Cryptography\Kmac128.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\Kmac256.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof128.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\KmacXof256.cs (4)
112Debug.Assert(written == outputLength); 130Debug.Assert(written == destination.Length); 153Debug.Assert(written == outputLength); 170Debug.Assert(written == destination.Length);
System\Security\Cryptography\LiteHash.OpenSsl.cs (1)
40Debug.Assert(!algorithm.IsInvalid);
System\Security\Cryptography\LiteHash.Unix.cs (13)
40Debug.Assert(algorithm != IntPtr.Zero); 109Debug.Assert(result == 0); 125Debug.Assert(algorithm != IntPtr.Zero); 159Debug.Assert(destination.Length >= _hashSizeInBytes); 164Debug.Assert(length == _hashSizeInBytes); 177Debug.Assert(length == _hashSizeInBytes); 199Debug.Assert(result == 0); 214Debug.Assert(algorithm != IntPtr.Zero); 245Debug.Assert(destination.Length >= _hashSizeInBytes); 249Debug.Assert(length == _hashSizeInBytes); 255Debug.Assert(destination.Length >= _hashSizeInBytes); 259Debug.Assert(length == _hashSizeInBytes); 286Debug.Assert(result == 0);
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\MD5.cs (2)
71Debug.Assert(written == buffer.Length); 117Debug.Assert(bytesWritten == HashSizeInBytes);
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.OpenSsl.cs (1)
26Debug.Assert(friendlyNamePtr != IntPtr.Zero);
System\Security\Cryptography\OpenSslCipher.cs (4)
37Debug.Assert(input.Length > 0); 38Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 44Debug.Assert((input.Length % PaddingSizeInBytes) == 0); 45Debug.Assert(input.Length <= output.Length);
System\Security\Cryptography\OpenSslCipherLite.cs (1)
32Debug.Assert(algorithm != IntPtr.Zero);
System\Security\Cryptography\PasswordDeriveBytes.cs (1)
201Debug.Assert(_hash != null);
System\Security\Cryptography\Pbkdf2Implementation.OpenSsl.cs (2)
17Debug.Assert(!destination.IsEmpty); 18Debug.Assert(hashAlgorithmName.Name is not null);
System\Security\Cryptography\PemEncoding.cs (11)
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); 792Debug.Assert(bytesConsumed == bytes.Length);
System\Security\Cryptography\PemKeyHelpers.cs (2)
150Debug.Assert(bytesWritten == base64size); 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.OpenSsl.cs (1)
12Debug.Assert(count > 0);
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 (4)
185Debug.Assert(_blockSize > 0); 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\RSAOpenSsl.cs (1)
48Debug.Assert(!pkey.IsInvalid);
System\Security\Cryptography\RSAWrapper.cs (1)
16Debug.Assert(wrapped != null);
System\Security\Cryptography\SHA1.cs (2)
68Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA256.cs (2)
67Debug.Assert(written == buffer.Length); 112Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_256.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_384.cs (2)
93Debug.Assert(written == buffer.Length); 146Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA3_512.cs (2)
93Debug.Assert(written == buffer.Length); 145Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA384.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SHA512.cs (2)
67Debug.Assert(written == buffer.Length); 111Debug.Assert(bytesWritten == HashSizeInBytes);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationManaged.cs (2)
33Debug.Assert(destination.Length <= 0x1FFFFFFF); 68Debug.Assert(hmacBufferWritten > destination.Length);
System\Security\Cryptography\SP800108HmacCounterKdfImplementationOpenSsl.cs (2)
29Debug.Assert(Interop.Crypto.EvpKdfAlgs.Kbkdf is { IsInvalid: false }); 79Debug.Assert(Interop.Crypto.EvpKdfAlgs.Kbkdf is { IsInvalid: false });
System\Security\Cryptography\SymmetricPadding.cs (1)
13Debug.Assert(plaintextLength >= 0);
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 (2)
54Debug.Assert(inputBuffer.Length >= _heldoverCipher.Length); 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\X509Certificates\CertCollectionLoader.cs (2)
28Debug.Assert(collection != null); 31Debug.Assert(localCerts != null);
System\Security\Cryptography\X509Certificates\CertificateRequest.cs (1)
503Debug.Assert(_generator != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.cs (1)
31Debug.Assert(revoked != null);
System\Security\Cryptography\X509Certificates\CertificateRevocationListBuilder.Load.cs (1)
285Debug.Assert(bytesConsumed == bytesWritten);
System\Security\Cryptography\X509Certificates\ChainPal.OpenSsl.cs (2)
196Debug.Assert(reportedLeaf != null); 197Debug.Assert(!ReferenceEquals(cert, reportedLeaf.Pal));
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\ManagedCertificateFinder.cs (2)
298Debug.Assert(written == SHA1.HashSizeInBytes); 348Debug.Assert(!ReferenceEquals(cert, clone));
System\Security\Cryptography\X509Certificates\OpenSslCachedDirectoryStoreProvider.cs (1)
81Debug.Assert(ret != null);
System\Security\Cryptography\X509Certificates\OpenSslCachedSystemStoreProvider.cs (4)
108Debug.Assert(ret != null); 166Debug.Assert(s_rootStoreDirectories is not null); 167Debug.Assert(s_directoryLastWrite is not null); 364Debug.Assert(set.Count == 0);
System\Security\Cryptography\X509Certificates\OpenSslDirectoryBasedStoreProvider.cs (3)
47Debug.Assert(!X509Store.DisallowedStoreName.Equals(storeName, StringComparison.OrdinalIgnoreCase)); 75Debug.Assert(collection != null); 331Debug.Assert(storeName != null);
System\Security\Cryptography\X509Certificates\OpenSslPkcsFormatReader.cs (1)
221Debug.Assert(readPals != null); // null if single == true
System\Security\Cryptography\X509Certificates\OpenSslSingleCertLoader.cs (2)
26Debug.Assert(collection != null); 29Debug.Assert(localCert != null);
System\Security\Cryptography\X509Certificates\OpenSslX509CertificateReader.cs (6)
35Debug.Assert(cert.Pal != null); 44Debug.Assert(password != null); 53Debug.Assert(cert is not null); 110Debug.Assert(bioPosition >= 0); 793Debug.Assert(bytes != null); 836Debug.Assert(exported != null);
System\Security\Cryptography\X509Certificates\OpenSslX509ChainProcessor.cs (6)
379Debug.Assert(revocationFlag == X509RevocationFlag.EntireChain); 482Debug.Assert(refErrors.HasRevocationUnknown()); 518Debug.Assert(chainSize == 1 || revocationFlag != X509RevocationFlag.EndCertificateOnly); 566Debug.Assert(workingChain.LastError <= start - 1); 830Debug.Assert(baseUri.Length > 0); 831Debug.Assert(resource.Length > 0);
System\Security\Cryptography\X509Certificates\OpenSslX509Encoder.cs (1)
101Debug.Assert(bioPosition >= 0);
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\StorePal.cs (1)
58Debug.Assert(_coll is not null);
System\Security\Cryptography\X509Certificates\StorePal.OpenSsl.cs (5)
21Debug.Assert(password != null); 30Debug.Assert(singleCert != null); 40Debug.Assert(certPals != null); 79Debug.Assert(bioPosition >= 0); 153Debug.Assert(storeLocation == StoreLocation.LocalMachine);
System\Security\Cryptography\X509Certificates\UnixExportProvider.cs (2)
47Debug.Assert(password != null); 108Debug.Assert(_certs is not null);
System\Security\Cryptography\X509Certificates\X500DistinguishedNameBuilder.cs (1)
231Debug.Assert(written == 2);
System\Security\Cryptography\X509Certificates\X500NameEncoder.cs (11)
114Debug.Assert(dnSeparators.Length != 0); 288Debug.Assert(tagStart >= 0); 390Debug.Assert(hasTagOid); 391Debug.Assert(valueEnd != -1); 392Debug.Assert(valueStart != -1); 452Debug.Assert(!hadEscapedQuote); 459Debug.Assert(valueStart != -1); 460Debug.Assert(valueEnd != -1); 562Debug.Assert(destination.Length >= chars.Length); 577Debug.Assert(skippedQuote == (c == '"')); 641Debug.Assert(lookup.Count == LookupDictionarySize);
System\Security\Cryptography\X509Certificates\X500NameEncoder.ManagedDecode.cs (1)
151Debug.Assert(tavReader.RuleSet == AsnEncodingRules.DER);
System\Security\Cryptography\X509Certificates\X500RelativeDistinguishedName.cs (1)
65Debug.Assert(offset > 0);
System\Security\Cryptography\X509Certificates\X509AuthorityInformationAccessExtension.cs (1)
179Debug.Assert(_decoded is not null);
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
140Debug.Assert(pal != null);
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
1300Debug.Assert(rawSAN.GetType() == typeof(X509Extension));
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.OpenSsl.cs (1)
33Debug.Assert(bioPosition >= 0);
System\Security\Cryptography\X509Certificates\X509CertificateLoader.Unix.cs (9)
57Debug.Assert(matchIndex >= 0); 152Debug.Assert(!string.IsNullOrEmpty(path)); 227Debug.Assert(safeBag.BagId == Oids.Pkcs12CertBag); 232Debug.Assert(certBag.CertId == Oids.Pkcs12X509CertBagType); 236Debug.Assert(pal is not null); 287Debug.Assert(safeBag.BagId == Oids.Pkcs12ShroudedKeyBag); 508Debug.Assert(sizeHint > 0); 573Debug.Assert(bytesRead == pkcs8.Length); 592Debug.Assert(_rented is null);
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\X509Store.cs (1)
82Debug.Assert(_storePal != null);
System\Security\Cryptography\X509Certificates\X509SubjectAlternativeNameExtension.cs (1)
72Debug.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 (4)
79Debug.Assert(buf != null); 124Debug.Assert(name.Length > 0); 125Debug.Assert(value.Length > 0); 126Debug.Assert(builder != null);
System.Security.Cryptography.Cose (41)
System\Security\Cryptography\Cose\CoseHeaderMap.cs (2)
353Debug.Assert(!map.ContainsKey(CoseHeaderLabel.Algorithm)); 377Debug.Assert(bytesWritten == ComputeEncodedSize(map, algHeaderValueToSlip));
System\Security\Cryptography\Cose\CoseHelpers.cs (8)
118Debug.Assert(keyType == KeyType.RSA); 119Debug.Assert(signer.RSASignaturePadding != null); 131Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 152Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 210Debug.Assert(keyType == KeyType.RSA); 274Debug.Assert(keyType == KeyType.RSA); 285Debug.Assert(algorithm >= KnownCoseAlgorithms.RS512); 290Debug.Assert(algorithm >= KnownCoseAlgorithms.PS512 && algorithm <= KnownCoseAlgorithms.PS256);
System\Security\Cryptography\Cose\CoseMessage.cs (10)
162Debug.Assert(reader.BytesRemaining == 0); 248Debug.Assert(reader.BytesRemaining == 0); 403Debug.Assert(reader.BytesRemaining == 0); 499Debug.Assert(context == SigStructureContext.Signature1); 500Debug.Assert(signProtected.Length == 0); 511Debug.Assert(bytesWritten == ComputeToBeSignedEncodedSize(context, bodyProtected.Length, signProtected.Length, associatedData.Length, content.Length)); 530Debug.Assert(context == SigStructureContext.Signature1); 531Debug.Assert(signProtectedLength == 0); 568Debug.Assert(length > 0); 599Debug.Assert(bytesWritten == buffer.Length);
System\Security\Cryptography\Cose\CoseMultiSignMessage.cs (5)
219Debug.Assert(expectedSize == bytesWritten); 290Debug.Assert(buffer.Length == bytesWritten); 365Debug.Assert(expectedSize == bytesWritten); 513Debug.Assert(protectedHeadersSize == 1); 628Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSign1Message.cs (9)
180Debug.Assert(contentStream == null || (isDetached && contentBytes.Length == 0)); 188Debug.Assert(expectedSize == bytesWritten); 240Debug.Assert(buffer.Length == bytesWritten); 303Debug.Assert(expectedSize == bytesWritten); 611Debug.Assert(contentStream == null || contentBytes.Length == 0); 746Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 757Debug.Assert(keyType == KeyType.RSA); 758Debug.Assert(padding != null); 834Debug.Assert(bytesWritten == GetEncodedLength());
System\Security\Cryptography\Cose\CoseSignature.cs (4)
63Debug.Assert(_message != null); 454Debug.Assert(hasher.HashLengthInBytes <= 512 / 8); // largest hash we can get (SHA512). 467Debug.Assert(keyType == KeyType.RSA); 468Debug.Assert(padding != null);
System\Security\Cryptography\Cose\CoseSigner.cs (3)
189Debug.Assert(_keyType == KeyType.RSA); 190Debug.Assert(RSASignaturePadding != null); 203Debug.Assert(RSASignaturePadding == RSASignaturePadding.Pkcs1);
System.Security.Cryptography.Pkcs (90)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (1)
141Debug.Assert(asn.Parameters != null);
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (2)
35Debug.Assert(certificate != null); 159Debug.Assert(algorithmIdentifier != null);
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 (1)
98Debug.Assert(cert != null);
Internal\Cryptography\PkcsHelpers.cs (5)
32Debug.Assert(oid != null); 88Debug.Assert(arr != null); 89Debug.Assert(idx >= 0); 90Debug.Assert(idx < arr.Length); 326Debug.Assert((normalizedString.Length & 0x1) == 0);
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Security\Cryptography\Asn1\Pkcs12\PfxAsn.manual.cs (2)
19Debug.Assert(MacData.HasValue); 59Debug.Assert((uint)expectedOutputSize <= 64); // SHA512 is the largest digest size we know about
src\libraries\Common\src\System\Security\Cryptography\CryptographicAttributeObjectCollection.cs (1)
86Debug.Assert(attribute != null);
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\libraries\Common\src\System\Security\Cryptography\Oids.Shared.cs (2)
82Debug.Assert(oidValue != null); 163Debug.Assert(oid is not null);
src\libraries\Common\src\System\Security\Cryptography\PasswordBasedEncryption.cs (15)
29Debug.Assert(pbeParameters != null); 32Debug.Assert(pbeParameters.IterationCount > 0); 75Debug.Assert(destination.Length >= encryptedData.Length); 148Debug.Assert(digestAlgorithmName.Name != null); 149Debug.Assert(cipher != null); 201Debug.Assert(written == buf.Length); 238Debug.Assert(pbeParameters != null); 305Debug.Assert(hmacOid == Oids.HmacWithSha1 || !isPkcs12); 353Debug.Assert(password.Length > 0 || passwordBytes.IsEmpty); 354Debug.Assert(pbeParameters.HashAlgorithm == HashAlgorithmName.SHA1); 378Debug.Assert(pwdTmpBytes!.Length == passwordBytes.Length); 393Debug.Assert(pwdTmpBytes!.Length == 0); 406Debug.Assert(encryptor.CanTransformMultipleBlocks); 486Debug.Assert(written == buf.Length); 940Debug.Assert(decryptor.CanTransformMultipleBlocks);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
212Debug.Assert(macKey.Length <= 128);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
37Debug.Assert(value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContents.cs (3)
379Debug.Assert(pbeParameters != null); 380Debug.Assert(pbeParameters.IterationCount >= 1); 463Debug.Assert(ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeContentsBag.cs (2)
26Debug.Assert(copyFrom != null); 27Debug.Assert(copyFrom.ConfidentialityMode == Pkcs12ConfidentialityMode.None);
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SecretBag.cs (1)
52Debug.Assert(secretTypeOid != null && secretTypeOid.Value != null);
src\libraries\Common\src\System\Security\Cryptography\Pkcs12Kdf.cs (5)
86Debug.Assert(iterationCount >= 1); 104Debug.Assert(v <= 1024); 238Debug.Assert(into.Length == addend.Length); 252Debug.Assert(bytes.Length > 0); 273Debug.Assert(destination.Length % 2 == 0);
System\Security\Cryptography\Pkcs\CmsSignature.cs (2)
88Debug.Assert(processor is not null); 93Debug.Assert(processor is not null);
System\Security\Cryptography\Pkcs\CmsSignature.DSA.cs (2)
67Debug.Assert(Helpers.IsDSASupported); 117Debug.Assert(Helpers.IsDSASupported);
System\Security\Cryptography\Pkcs\EnvelopedCms.cs (1)
78Debug.Assert(_decryptorPal != null);
System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (3)
48Debug.Assert(algorithmId != null); 200Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span)); 231Debug.Assert(!ret.PrivateKeyBytes.Span.Overlaps(decryptedMemory.Span));
System\Security\Cryptography\Pkcs\PublicKeyInfo.cs (2)
13Debug.Assert(algorithm != null); 14Debug.Assert(keyValue != null);
System\Security\Cryptography\Pkcs\RecipientInfo.cs (2)
19Debug.Assert(pal is KeyTransRecipientInfoPal); 23Debug.Assert(pal is KeyAgreeRecipientInfoPal);
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (2)
64Debug.Assert(status == Rfc3161RequestResponseStatus.Accepted); 389Debug.Assert(token != null);
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (5)
210Debug.Assert(tsaCertificate != null); 211Debug.Assert(signer != null); 212Debug.Assert(tokenInfo != null); 486Debug.Assert(signerCert != null); 487Debug.Assert(certId.HasValue || certId2.HasValue);
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (1)
161Debug.Assert(_tsaNameBytes.HasValue);
System\Security\Cryptography\Pkcs\SignedCms.cs (8)
145Debug.Assert(_signedData.EncapContentInfo.Content != null); 293Debug.Assert(contentType != Oids.Pkcs7Data); 387Debug.Assert(_heldContent != null); 388Debug.Assert(_contentType == contentType); 430Debug.Assert(_heldContent.HasValue); 476Debug.Assert(_heldContent != null); 626Debug.Assert(signers != null); 652Debug.Assert(signers != null);
System\Security\Cryptography\Pkcs\SignerInfo.cs (1)
55Debug.Assert(_signedAttributes != null);
System\Security\Cryptography\Pkcs\SignerInfoCollection.cs (3)
22Debug.Assert(signerInfos != null); 29Debug.Assert(signedDataSignerInfos != null); 83Debug.Assert(signer != null);
System\Security\Cryptography\Pkcs\SignerInfoEnumerator.cs (1)
16Debug.Assert(signerInfos != null);
System\Security\Cryptography\Pkcs\SubjectIdentifier.cs (3)
22Debug.Assert(value != null); 27Debug.Assert(value is X509IssuerSerial); 31Debug.Assert(value is string);
System\Security\Cryptography\Pkcs\SubjectIdentifierOrKey.cs (4)
14Debug.Assert(value != null); 19Debug.Assert(value is X509IssuerSerial); 23Debug.Assert(value is string); 27Debug.Assert(value is PublicKeyInfo);
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)
32Debug.Assert(result); 33Debug.Assert(outputData != null); 70Debug.Assert(result); 71Debug.Assert(outputData != null); 185Debug.Assert(result); 186Debug.Assert(outputData != null); 224Debug.Assert(result); 225Debug.Assert(outputData != null);
System.Security.Cryptography.Xml (8)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
System\Security\Cryptography\Xml\CryptoHelpers.cs (1)
98Debug.Assert(!typeof(Transform).IsAssignableFrom(typeof(T)));
System\Security\Cryptography\Xml\SignedXml.cs (5)
588System.Diagnostics.Debug.Assert(cloneElem != null); 822Debug.Assert(_refProcessed != null); 823Debug.Assert(_refLevelCache != null); 973System.Diagnostics.Debug.Assert(a != null); 974System.Diagnostics.Debug.Assert(b != null);
System\Security\Cryptography\Xml\Utils.cs (1)
126Debug.Assert(IsNamespaceNode(a) || IsXmlNamespaceNode(a));
System.ServiceModel.Syndication (7)
System\ServiceModel\Syndication\ServiceDocumentFormatter.cs (3)
39Debug.Assert(categories != null); 47Debug.Assert(collection != null); 55Debug.Assert(workspace != null);
System\ServiceModel\Syndication\SyndicationFeedFormatter.cs (4)
525Debug.Assert(item != null); 533Debug.Assert(category != null); 541Debug.Assert(link != null); 549Debug.Assert(person != null);
System.Text.Encoding.CodePages (20)
System\Text\BaseCodePageEncoding.cs (4)
107Debug.Assert(bytesRead == codePageDataFileHeader.Length); 145Debug.Assert(bytesRead == codePageIndex.Length); 191Debug.Assert(bytesRead == codePageHeader.Length); 370Debug.Assert(pNativeMemory != null);
System\Text\BaseCodePageEncoding.netcoreapp.cs (1)
18Debug.Assert(bytesRead == codePageIndex.Length);
System\Text\DBCSCodePageEncoding.cs (1)
87Debug.Assert(m_codePageHeader?.Length > 0);
System\Text\DecoderFallbackBufferHelper.cs (3)
25Debug.Assert(_fallbackBuffer != null); 47Debug.Assert(_fallbackBuffer != null); 103Debug.Assert(_fallbackBuffer != null);
System\Text\EncoderFallbackBufferHelper.cs (3)
34Debug.Assert(_fallbackBuffer != null); 56Debug.Assert(_fallbackBuffer != null); 75Debug.Assert(_fallbackBuffer != null);
System\Text\EncodingTable.cs (7)
71Debug.Assert(encodingNameIndices.Length == CodePagesByName.Length + 1); 72Debug.Assert(encodingNameIndices[encodingNameIndices.Length - 1] == EncodingNames.Length); 82Debug.Assert(index < encodingNameIndices.Length - 1); 104Debug.Assert(left < encodingNameIndices.Length - 1); 145Debug.Assert(MappedCodePages.Length + 1 == indices.Length); 146Debug.Assert(indices[indices.Length - 1] == names.Length); 161Debug.Assert(i < indices.Length - 1);
System\Text\SBCSCodePageEncoding.cs (1)
62Debug.Assert(m_codePageHeader?.Length > 0);
System.Text.Encodings.Web (43)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\IO\TextWriterExtensions.cs (2)
19Debug.Assert(writer != null); 20Debug.Assert(value != null);
System\Text\Encodings\Web\AllowedBmpCodePointsBitmap.cs (1)
70Debug.Assert(definedCharsBitmapAsLittleEndian.Length == thisAllowedCharactersBitmap.Length * sizeof(uint));
System\Text\Encodings\Web\AsciiByteMap.cs (2)
20Debug.Assert(key < BufferSize); 21Debug.Assert(value != 0);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.AdvSimd64.cs (10)
16Debug.Assert(AdvSimd.Arm64.IsSupported); 17Debug.Assert(BitConverter.IsLittleEndian); 115Debug.Assert(lengthInBytes - i <= 3); 129Debug.Assert(resultScalar != ulong.MaxValue); 136Debug.Assert(resultScalar != ulong.MaxValue); 150Debug.Assert(AdvSimd.Arm64.IsSupported); 151Debug.Assert(BitConverter.IsLittleEndian); 230Debug.Assert(lengthInChars - i <= 3); 244Debug.Assert(resultScalar != ulong.MaxValue); 251Debug.Assert(resultScalar != ulong.MaxValue);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.cs (7)
40Debug.Assert(scalarEscaper != null); 297Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtfXX should've set replacement character on failure 369Debug.Assert(0 <= asciiBytesSkippedNInt && asciiBytesSkippedNInt <= (uint)dataOriginalLength); 376Debug.Assert(asciiBytesSkipped == data.Length); 390Debug.Assert(!data.IsEmpty); 430Debug.Assert(0 <= idx && idx <= lengthInChars); 467Debug.Assert(0 <= idx && idx <= lengthInChars);
System\Text\Encodings\Web\OptimizedInboxTextEncoder.Ssse3.cs (8)
15Debug.Assert(Ssse3.IsSupported); 16Debug.Assert(BitConverter.IsLittleEndian); 108Debug.Assert(lengthInBytes - i <= 3); 122Debug.Assert(pmovmskb != 0); 135Debug.Assert(Ssse3.IsSupported); 136Debug.Assert(BitConverter.IsLittleEndian); 210Debug.Assert(lengthInChars - i <= 3); 224Debug.Assert(pmovmskb != 0);
System\Text\Encodings\Web\TextEncoder.cs (5)
345Debug.Assert(scalarValue == Rune.ReplacementChar); // DecodeFromUtf8 should've performed substitution 467Debug.Assert(scalarValue == Rune.ReplacementChar); // should be replacement char 514Debug.Assert(output != null); 578Debug.Assert(!string.IsNullOrEmpty(source)); 598Debug.Assert(unicodeScalar < ushort.MaxValue);
System\Text\Unicode\UnicodeHelpers.cs (2)
29Debug.Assert(0x10000 <= scalar && scalar <= UNICODE_LAST_CODEPOINT); 45Debug.Assert(scalar <= UNICODE_LAST_CODEPOINT);
System.Text.Json (1292)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Net\ArrayBuffer.cs (9)
40Debug.Assert(initialSize > 0 || usePool); 52Debug.Assert(buffer.Length > 0); 77Debug.Assert(_usePool); 78Debug.Assert(_bytes is not null); 117Debug.Assert(byteCount <= AvailableLength); 133Debug.Assert(AvailableLength < byteCount); 137Debug.Assert(_usePool && _activeStart == 0 && _availableStart == 0); 149Debug.Assert(byteCount <= AvailableLength); 179Debug.Assert(byteCount <= AvailableLength);
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\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (1)
18Debug.Assert(char.IsPunctuation(separator));
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\Text\Json\BitStack.cs (4)
144Debug.Assert(_array != null); 164Debug.Assert(_array != null); 166Debug.Assert(minSize >= 0 && minSize >= _array.Length); 169Debug.Assert(nextDouble > minSize);
System\Text\Json\Document\JsonDocument.cs (22)
44Debug.Assert(!utf8Json.IsEmpty); 47Debug.Assert(isDisposable || 51Debug.Assert(extraRentedArrayPoolBytes == null || extraPooledByteBufferWriter == null); 127Debug.Assert(!isPropertyName || row.TokenType is JsonTokenType.PropertyName); 258Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 320Debug.Assert(status != OperationStatus.DestinationTooSmall); 328Debug.Assert(status == OperationStatus.Done); 369Debug.Assert(idx != -1); 393Debug.Assert(row.TokenType is JsonTokenType.PropertyName); 415Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 684Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 719Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 754Debug.Assert(segment.IndexOf(JsonConstants.BackSlash) == -1); 883Debug.Assert(row.TokenType == JsonTokenType.String || row.TokenType == JsonTokenType.PropertyName); 914Debug.Assert(row.TokenType == JsonTokenType.PropertyName); 968Debug.Assert(reader.TokenStartIndex <= int.MaxValue); 1055Debug.Assert(tokenStart < int.MaxValue); 1064Debug.Assert(!inArray); 1068Debug.Assert(tokenType >= JsonTokenType.String && tokenType <= JsonTokenType.Null); 1080Debug.Assert(tokenStart < int.MaxValue); 1098Debug.Assert(reader.BytesConsumed == utf8JsonSpan.Length); 1123Debug.Assert(readerOptions.CommentHandling >= 0 && readerOptions.CommentHandling <= JsonCommentHandling.Allow);
System\Text\Json\Document\JsonDocument.DbRow.cs (5)
57Debug.Assert(sizeof(DbRow) == Size); 63Debug.Assert(jsonTokenType > JsonTokenType.None && jsonTokenType <= JsonTokenType.Null); 64Debug.Assert((byte)jsonTokenType < 1 << 4); 65Debug.Assert(location >= 0); 66Debug.Assert(sizeOrLength >= UnknownSize);
System\Text\Json\Document\JsonDocument.MetadataDb.cs (9)
178Debug.Assert(_data != null); 219Debug.Assert( 244Debug.Assert(MaxArrayLength == Array.MaxLength); 269Debug.Assert(index >= 0); 277Debug.Assert(length >= 0); 285Debug.Assert(numberOfRows >= 1 && numberOfRows <= 0x0FFFFFFF); 309Debug.Assert(lookupType == JsonTokenType.StartObject || lookupType == JsonTokenType.StartArray); 353Debug.Assert(endIndex <= Length); 395Debug.Assert(newDbInts[i] >= locationOffset);
System\Text\Json\Document\JsonDocument.Parse.cs (15)
126Debug.Assert(drained.Array != null); 151Debug.Assert(utf8Json != null); 154Debug.Assert(drained.Array != null); 176Debug.Assert(json != null); 215Debug.Assert(drained.Array != null); 235Debug.Assert(drained.Array != null); 275Debug.Assert(expectedByteCount == actualByteCount); 301Debug.Assert(expectedByteCount == actualByteCount); 508Debug.Assert( 559Debug.Assert(payloadLength > 1); 603Debug.Assert(!reader.HasValueSequence); 683Debug.Assert(tokenType == JsonTokenType.Null); 729Debug.Assert( 788Debug.Assert(rented.Length >= utf8Bom.Length); 871Debug.Assert(rented.Length >= JsonConstants.Utf8Bom.Length);
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 != 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 (5)
27Debug.Assert(idx >= 0); 1320Debug.Assert(!arrayEnumerator2.MoveNext()); 1324Debug.Assert(kind is JsonValueKind.Object); 1361Debug.Assert(!objectEnumerator2.MoveNext()); 1668Debug.Assert(_parent != null);
System\Text\Json\Document\JsonElement.ObjectEnumerator.cs (1)
27Debug.Assert(target.TokenType == JsonTokenType.StartObject);
System\Text\Json\JsonEncodedText.cs (2)
34Debug.Assert(utf8Value != null); 94Debug.Assert(expectedByteCount == utf8Bytes.Length);
System\Text\Json\JsonHelpers.cs (11)
23Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 104Debug.Assert(tokenType == reader.TokenType); 173Debug.Assert(result); 223Debug.Assert(dictionary.Comparer is IAlternateEqualityComparer<ReadOnlySpan<char>, string>); 335Debug.Assert(left.Length > 0 && right.Length > 0); 401Debug.Assert(leftFirst.Length == rightFirst.Length); 402Debug.Assert(leftMiddle.Length == rightMiddle.Length); 403Debug.Assert(leftLast.Length == rightLast.Length); 430Debug.Assert(span.Length > 0); 472Debug.Assert(span[i] is (byte)'e' or (byte)'E'); 475Debug.Assert(span.Length >= 10);
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. 539Debug.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 (4)
205Debug.Assert(element.ValueKind == JsonValueKind.Array); 248Debug.Assert(index >= 0); 254Debug.Assert(formatted); 306Debug.Assert(jElement.ValueKind == JsonValueKind.Array);
System\Text\Json\Nodes\JsonObject.cs (2)
71Debug.Assert(element.ValueKind == JsonValueKind.Object); 262Debug.Assert(index >= 0);
System\Text\Json\Nodes\JsonValue.cs (3)
159Debug.Assert(child == null); 166Debug.Assert(jsonTypeInfo.IsConfigured); 167Debug.Assert(value != 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 != null); 174Debug.Assert(result != null);
System\Text\Json\Nodes\JsonValueOfT.cs (3)
17Debug.Assert(value != null); 18Debug.Assert(value is not JsonElement or JsonElement { ValueKind: not JsonValueKind.Null }); 19Debug.Assert(value is not JsonNode);
System\Text\Json\Nodes\JsonValueOfTCustomized.cs (2)
22Debug.Assert(jsonTypeInfo.IsConfigured); 59Debug.Assert(success);
System\Text\Json\Nodes\JsonValueOfTPrimitive.cs (1)
21Debug.Assert(converter is { IsInternalConverter: true, ConverterStrategy: ConverterStrategy.Value });
System\Text\Json\Reader\JsonReaderHelper.cs (9)
84Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 88Debug.Assert(written > 0); 91Debug.Assert(!sourceUnescaped.IsEmpty); 106Debug.Assert(source.Length <= JsonConstants.MaximumEscapedDateTimeOffsetParseLength); 110Debug.Assert(written > 0); 113Debug.Assert(!sourceUnescaped.IsEmpty); 128Debug.Assert(source.Length <= JsonConstants.MaximumEscapedGuidLength); 132Debug.Assert(written > 0); 135Debug.Assert(!utf8Unescaped.IsEmpty);
System\Text\Json\Reader\JsonReaderHelper.Unescaping.cs (37)
23Debug.Assert(written > 0); 26Debug.Assert(!utf8Unescaped.IsEmpty); 53Debug.Assert(written > 0); 56Debug.Assert(!utf8Unescaped.IsEmpty); 80Debug.Assert(written > 0); 83Debug.Assert(!propertyName.IsEmpty); 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 != null); 183Debug.Assert(!utf8Unescaped1.IsEmpty); 187Debug.Assert(!utf8Unescaped2.IsEmpty); 240Debug.Assert(bytesConsumed == utf8Unescaped.Length); 446Debug.Assert(destination.Length >= source.Length); 449Debug.Assert(idx >= 0); 452Debug.Assert(result); 457Debug.Assert(idx >= 0 && idx < source.Length); 458Debug.Assert(source[idx] == JsonConstants.BackSlash); 459Debug.Assert(destination.Length >= source.Length); 462Debug.Assert(result); 471Debug.Assert(idx >= 0); 481Debug.Assert(idx >= 0 && idx < source.Length); 482Debug.Assert(source[idx] == JsonConstants.BackSlash); 494Debug.Assert(source[idx] == JsonConstants.BackSlash); 532Debug.Assert(source.Length >= idx + 5); 535Debug.Assert(result); 536Debug.Assert(bytesConsumed == 4); 547Debug.Assert(JsonHelpers.IsInRangeInclusive((uint)scalar, JsonConstants.HighSurrogateStartValue, JsonConstants.HighSurrogateEndValue)); 558Debug.Assert(result); 559Debug.Assert(bytesConsumed == 4); 582Debug.Assert(bytesWritten <= 4); 606Debug.Assert(nextUnescapedSegmentLength > 0); 628Debug.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() != 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); 1044Debug.Assert((_trailingCommaBeforeComment && _readerOptions.CommentHandling == JsonCommentHandling.Allow) || !_trailingCommaBeforeComment); 1045Debug.Assert((_trailingCommaBeforeComment && marker != JsonConstants.Slash) || !_trailingCommaBeforeComment); 1089Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1136Debug.Assert(span.Length > 0); 1137Debug.Assert(span[0] == 'n' || span[0] == 't' || span[0] == 'f'); 1153Debug.Assert(span.Length > 0 && span[0] == literal[0]); 1174Debug.Assert(indexOfFirstMismatch > 0 && indexOfFirstMismatch < literal.Length); 1198Debug.Assert(firstByte == 'n'); 1218Debug.Assert(IsLastSpan); 1229Debug.Assert( 1281Debug.Assert(_buffer.Length >= _consumed + 1); 1282Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 1326Debug.Assert(idx >= 0 && idx < data.Length); 1327Debug.Assert(data[idx] != JsonConstants.Quote); 1328Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1428Debug.Assert(data.Length > 0); 1439Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1442Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1456Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1472Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1481Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1496Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1505Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1514Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1527Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1567Debug.Assert(data[i] == (byte)'0'); 1740Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1840Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1841Debug.Assert(_tokenType == JsonTokenType.Comment); 1852Debug.Assert(_tokenType != JsonTokenType.Comment); 1882Debug.Assert(first != JsonConstants.Slash); 2004Debug.Assert(first != JsonConstants.CloseBrace); 2026Debug.Assert(first != JsonConstants.CloseBracket); 2043Debug.Assert(_tokenType is JsonTokenType.EndArray or JsonTokenType.EndObject); 2046Debug.Assert(first != JsonConstants.CloseBrace); 2063Debug.Assert(first != JsonConstants.CloseBracket); 2356Debug.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() != null); 320Debug.Assert(!_isMultiSegment || _currentPosition.GetObject() != 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); 628Debug.Assert(span.Length > 0); 645Debug.Assert(indexOfFirstMismatch >= 0 && indexOfFirstMismatch < literal.Length); 664Debug.Assert(firstByte == 'n'); 683Debug.Assert(IsLastSpan); 694Debug.Assert( 746Debug.Assert(_buffer.Length >= _consumed + 1); 747Debug.Assert(_buffer[_consumed] == JsonConstants.Quote); 955Debug.Assert(idx >= 0 && idx < data.Length); 956Debug.Assert(data[idx] != JsonConstants.Quote); 957Debug.Assert(data[idx] == JsonConstants.BackSlash || data[idx] < JsonConstants.Space); 1120Debug.Assert(data.Length > 0); 1134Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1137Debug.Assert(nextByte >= '0' && nextByte <= '9'); 1152Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1168Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1177Debug.Assert(nextByte == '.' || nextByte == 'E' || nextByte == 'e'); 1194Debug.Assert(result == ConsumeNumberResult.OperationIncomplete); 1203Debug.Assert(nextByte == 'E' || nextByte == 'e'); 1214Debug.Assert(signResult == ConsumeNumberResult.OperationIncomplete); 1229Debug.Assert(resultExponent == ConsumeNumberResult.OperationIncomplete); 1252Debug.Assert(i == 0); 1275Debug.Assert(i == 1); 1294Debug.Assert(data[i] == (byte)'0'); 1295Debug.Assert(i == 0 || i == 1); 1572Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Skip); 1681Debug.Assert(_readerOptions.CommentHandling == JsonCommentHandling.Allow); 1682Debug.Assert(_tokenType == JsonTokenType.Comment); 1693Debug.Assert(_tokenType != JsonTokenType.Comment); 1723Debug.Assert(first != JsonConstants.Slash); 1854Debug.Assert(first != JsonConstants.CloseBrace); 1878Debug.Assert(first != JsonConstants.CloseBracket); 1895Debug.Assert(_tokenType == JsonTokenType.EndArray || _tokenType == JsonTokenType.EndObject); 1898Debug.Assert(first != JsonConstants.CloseBrace); 1915Debug.Assert(first != JsonConstants.CloseBracket); 2186Debug.Assert( 2336Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2350Debug.Assert(localBuffer[idx] == JsonConstants.CarriageReturn); 2410Debug.Assert(dangerousLineSeparatorBytesConsumed >= 0 && dangerousLineSeparatorBytesConsumed <= 2); 2420Debug.Assert(dangerousLineSeparatorBytesConsumed >= 1 && dangerousLineSeparatorBytesConsumed <= 2 && localBuffer.Length <= 1); 2451Debug.Assert(localBuffer.Length < 2); 2460Debug.Assert(dangerousLineSeparatorBytesConsumed == 1 || dangerousLineSeparatorBytesConsumed == 2); 2514Debug.Assert(localBuffer.Length > 0); 2560Debug.Assert(marker == JsonConstants.CarriageReturn); 2594Debug.Assert(!localBuffer.IsEmpty);
System\Text\Json\Reader\Utf8JsonReader.TryGet.cs (12)
46Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 81Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 145Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName or JsonTokenType.Number); 161Debug.Assert(success); 197Debug.Assert(_tokenType is JsonTokenType.String or JsonTokenType.PropertyName); 198Debug.Assert(ValueIsEscaped); 262Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 4); 271Debug.Assert((HasValueSequence ? ValueSequence.ToArray() : ValueSpan).Length == 5); 841Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1277Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1342Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1); 1408Debug.Assert(span.IndexOf(JsonConstants.BackSlash) == -1);
System\Text\Json\Schema\JsonSchemaExporter.cs (8)
78Debug.Assert(typeInfo.IsConfigured); 119Debug.Assert(derivedType.TypeDiscriminator is null or int or string); 273Debug.Assert(typeInfo.ElementTypeInfo != null); 323Debug.Assert(typeInfo.ElementTypeInfo != null); 351Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.None); 395Debug.Assert(typeInfo.PolymorphismOptions is not null); 429Debug.Assert(CurrentDepth > 0); 496Debug.Assert(span[pos] == '/');
System\Text\Json\Serialization\Converters\CastingConverter.cs (1)
27Debug.Assert(typeof(T).IsInSubtypeRelationshipWith(sourceConverter.Type!));
System\Text\Json\Serialization\Converters\Collection\IAsyncEnumerableOfTConverter.cs (4)
76Debug.Assert(state.Current.AsyncDisposable is IAsyncEnumerator<TElement>); 82Debug.Assert(state.PendingTask is Task<bool> && state.PendingTask.IsCompleted); 95Debug.Assert(moveNextTask.IsCompleted); 129Debug.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)
104Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IDictionaryOfTKeyTValueConverter.cs (1)
47Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\IEnumerableConverterFactory.cs (2)
172Debug.Assert(typeof(IEnumerable).IsAssignableFrom(typeToConvert)); 195Debug.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)
33Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ImmutableEnumerableOfTConverter.cs (1)
33Debug.Assert(creator != null);
System\Text\Json\Serialization\Converters\Collection\ISetOfTConverter.cs (1)
42Debug.Assert(Type.IsInterface);
System\Text\Json\Serialization\Converters\Collection\JsonCollectionConverter.cs (8)
41Debug.Assert(state.Current.ReturnValue is TCollection); 57Debug.Assert(state.Current.JsonPropertyInfo != null); 166Debug.Assert(!IsValueType); 184Debug.Assert(state.ReferenceId != null); 185Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 186Debug.Assert(state.Current.ReturnValue is TCollection); 266Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 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 != 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\StackOrQueueConverter.cs (2)
19Debug.Assert(addMethodDelegate != null); 40Debug.Assert(typeInfo.AddMethodDelegate != null);
System\Text\Json\Serialization\Converters\FSharp\FSharpTypeConverterFactory.cs (2)
31Debug.Assert(CanConvert(typeToConvert)); 66Debug.Assert(objectFactory.CanConvert(typeToConvert));
System\Text\Json\Serialization\Converters\JsonMetadataServicesConverter.cs (1)
54Debug.Assert(jsonTypeInfo is JsonTypeInfo<T> typeInfo && typeInfo.SerializeHandler != null);
System\Text\Json\Serialization\Converters\Node\JsonArrayConverter.cs (1)
32Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverter.cs (1)
55Debug.Assert(false);
System\Text\Json\Serialization\Converters\Node\JsonNodeConverterFactory.cs (1)
29Debug.Assert(typeof(JsonNode) == typeToConvert);
System\Text\Json\Serialization\Converters\Node\JsonObjectConverter.cs (4)
26Debug.Assert(success); // Node converters are not resumable. 28Debug.Assert(obj is JsonObject); 31Debug.Assert(value == null || value is JsonNode); 57Debug.Assert(false);
System\Text\Json\Serialization\Converters\Object\ObjectConverter.cs (2)
107Debug.Assert(options.UnknownTypeHandling == JsonUnknownTypeHandling.JsonNode); 133Debug.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 (13)
50Debug.Assert(obj != null); 91Debug.Assert(!IsValueType); 127Debug.Assert(state.ReferenceId != null); 128Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 142Debug.Assert(obj != null); 172Debug.Assert(tokenType == JsonTokenType.PropertyName); 178Debug.Assert(options.AllowOutOfOrderMetadataProperties); 196Debug.Assert(state.Current.JsonPropertyInfo != null); 257Debug.Assert(obj != null); 290Debug.Assert(tokenType == JsonTokenType.PropertyName); 348Debug.Assert(success); 363Debug.Assert(success); 397Debug.Assert(jsonPropertyInfo.EffectiveConverter.ConverterStrategy != ConverterStrategy.Value);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.cs (19)
75Debug.Assert(properties != null); 94Debug.Assert(tempReader.TokenType == JsonTokenType.PropertyName); 104Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 154Debug.Assert(!IsValueType); 209Debug.Assert(state.ReferenceId != null); 210Debug.Assert(options.ReferenceHandlingStrategy == JsonKnownReferenceHandler.Preserve); 227Debug.Assert(jsonPropertyInfo.Set != null); 236Debug.Assert(jsonPropertyInfo == state.Current.JsonTypeInfo.ExtensionDataProperty); 261Debug.Assert(obj != null); 300Debug.Assert(tokenType == JsonTokenType.PropertyName); 305Debug.Assert(options.AllowOutOfOrderMetadataProperties); 336Debug.Assert(jsonParameterInfo.MatchingProperty != null); 410Debug.Assert(tokenType == JsonTokenType.PropertyName); 415Debug.Assert(options.AllowOutOfOrderMetadataProperties); 441Debug.Assert(jsonPropertyInfo == null); 538Debug.Assert(jsonPropertyInfo.CanDeserialize); 589Debug.Assert(state.Current.CtorArgumentState != null); 604Debug.Assert(state.Current.JsonTypeInfo.Kind is JsonTypeInfoKind.Object); 605Debug.Assert(state.Current.CtorArgumentState != null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Large.cs (3)
19Debug.Assert(jsonParameterInfo.ShouldDeserialize); 38Debug.Assert(frame.CtorArgumentState != null); 39Debug.Assert(frame.JsonTypeInfo.CreateObjectWithArgs != null);
System\Text\Json\Serialization\Converters\Object\ObjectWithParameterizedConstructorConverter.Small.cs (3)
30Debug.Assert(state.Current.CtorArgumentState!.Arguments != null); 63Debug.Assert(jsonParameterInfo.ShouldDeserialize); 93Debug.Assert(typeInfo.CreateObjectWithArgs != null);
System\Text\Json\Serialization\Converters\Value\BooleanConverter.cs (1)
25Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\ByteConverter.cs (1)
29Debug.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); 62Debug.Assert(formattedSuccessfully && charsWritten == FormatLength); 70Debug.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)
28Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\DoubleConverter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (9)
58Debug.Assert(EnumConverterFactory.Helpers.IsSupportedTypeCode(s_enumTypeCode)); 238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName); 359Debug.Assert(s_enumTypeCode is TypeCode.SByte or TypeCode.Byte); 366Debug.Assert(s_isSignedEnum); 373Debug.Assert(s_enumTypeCode is TypeCode.SByte); 395Debug.Assert(s_enumTypeCode is TypeCode.SByte or TypeCode.Byte); 445Debug.Assert(dictionaryKeyPolicy != null); 531Debug.Assert(names.Length == values.Length); 656Debug.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)
61Debug.Assert(!Half.IsNaN(result) && !Half.IsInfinity(result)); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 183Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int128Converter.cs (2)
68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 117Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\Int16Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int32Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\Int64Converter.cs (1)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\JsonPrimitiveConverter.cs (3)
38Debug.Assert(schemaType is JsonSchemaType.Integer or JsonSchemaType.Number); 39Debug.Assert(!isIeeeFloatingPoint || schemaType is JsonSchemaType.Number); 41Debug.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)
29Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\SingleConverter.cs (1)
30Debug.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)
68Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 117Debug.Assert(formattedSuccessfully);
System\Text\Json\Serialization\Converters\Value\UInt16Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt32Converter.cs (1)
30Debug.Assert(reader.TokenType == JsonTokenType.PropertyName);
System\Text\Json\Serialization\Converters\Value\UInt64Converter.cs (1)
29Debug.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)
37Debug.Assert(reader.TokenType is JsonTokenType.PropertyName or JsonTokenType.String); 96Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength); 122Debug.Assert(formattedSuccessfully && charsWritten >= MinimumVersionLength);
System\Text\Json\Serialization\IgnoreReferenceResolver.cs (2)
16Debug.Assert(_stackForCycleDetection != null); 29Debug.Assert(!_stackForCycleDetection.Contains(wrappedValue));
System\Text\Json\Serialization\JsonConverter.cs (1)
122Debug.Assert(this is not JsonConverterFactory);
System\Text\Json\Serialization\JsonConverter.MetadataHandling.cs (23)
16Debug.Assert(!IsValueType); 17Debug.Assert(CanHaveMetadata); 18Debug.Assert((state.Current.MetadataPropertyNames & MetadataPropertyName.Type) != 0); 19Debug.Assert(state.Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 20Debug.Assert(jsonTypeInfo.PolymorphicTypeResolver?.UsesTypeDiscriminators == true); 27Debug.Assert(!state.IsContinuation); 28Debug.Assert(state.PolymorphicTypeDiscriminator != null); 33Debug.Assert(Type!.IsAssignableFrom(resolvedType.Type)); 51Debug.Assert(Type!.IsAssignableFrom(polymorphicConverter.Type)); 55Debug.Assert(state.Current.PolymorphicJsonTypeInfo is null); 71Debug.Assert(!IsValueType); 72Debug.Assert(value != null && Type!.IsAssignableFrom(value.GetType())); 73Debug.Assert(CanBePolymorphic || jsonTypeInfo.PolymorphicTypeResolver != null); 74Debug.Assert(state.PolymorphicTypeDiscriminator is null); 81Debug.Assert(!state.IsContinuation); 87Debug.Assert(Type == typeof(object)); 94Debug.Assert(jsonTypeInfo.Converter.CanHaveMetadata); 121Debug.Assert(state.IsContinuation); 123Debug.Assert(Type.IsAssignableFrom(polymorphicConverter.Type)); 127Debug.Assert(state.IsContinuation); 140Debug.Assert(!IsValueType); 141Debug.Assert(!state.IsContinuation); 142Debug.Assert(value != null);
System\Text\Json\Serialization\JsonConverterFactory.cs (1)
37Debug.Assert(CanConvert(typeToConvert));
System\Text\Json\Serialization\JsonConverterOfT.cs (23)
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 != null); 461Debug.Assert(Type == typeof(Nodes.JsonObject)); 477Debug.Assert(state.Current.OriginalDepth == 0); 501Debug.Assert(isValueConverter == (ConverterStrategy == ConverterStrategy.Value)); 530Debug.Assert(IsRootLevelMultiContentStreamingConverter); 553Debug.Assert(reader.TokenType == tokenType); 605Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 647Debug.Assert(!IsInternalConverter && Type == typeof(string)); 673Debug.Assert(defaultConverter != this);
System\Text\Json\Serialization\JsonSerializer.Helpers.cs (3)
35Debug.Assert(inputType != null); 55Debug.Assert(context != null); 56Debug.Assert(inputType != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandleMetadata.cs (12)
27Debug.Assert(state.Current.ObjectState == StackFrameObjectState.StartToken); 28Debug.Assert(state.Current.CanContainMetadata); 74Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 161Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 209Debug.Assert(state.Current.PropertyState == StackFramePropertyState.ReadValue); 242Debug.Assert(state.PolymorphicTypeDiscriminator == null); 285Debug.Assert(state.Current.LatestMetadataPropertyName == MetadataPropertyName.None); 473Debug.Assert(metadataValueKind != JsonValueKind.Undefined); 497Debug.Assert(state.Current.MetadataPropertyNames is MetadataPropertyName.None || state.Current.MetadataPropertyNames.HasFlag(MetadataPropertyName.Values)); 509Debug.Assert(reader.TokenType == JsonTokenType.PropertyName); 518Debug.Assert(!typeof(T).IsValueType); 519Debug.Assert(state.ReferenceId != null);
System\Text\Json\Serialization\JsonSerializer.Read.HandlePropertyName.cs (6)
110Debug.Assert(jsonPropertyInfo != null); 120Debug.Assert(underlyingIDictionaryType.IsGenericType); 121Debug.Assert(genericArgs.Length == 2); 122Debug.Assert(genericArgs[0].UnderlyingSystemType == typeof(string)); 123Debug.Assert( 146Debug.Assert(jsonPropertyInfo.Set != null);
System\Text\Json\Serialization\JsonSerializer.Read.Span.cs (4)
152Debug.Assert(jsonTypeInfo.IsConfigured); 163Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues); 169Debug.Assert(jsonTypeInfo.IsConfigured); 180Debug.Assert(reader.BytesConsumed == (actualByteCount ?? utf8Json.Length) || reader.CurrentState.Options.AllowMultipleValues);
System\Text\Json\Serialization\JsonSerializer.Read.Stream.cs (2)
532Debug.Assert(jsonTypeInfo.IsConfigured); 554Debug.Assert(listTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.String.cs (2)
428Debug.Assert(jsonTypeInfo.IsConfigured); 459Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Read.Utf8JsonReader.cs (5)
287Debug.Assert(jsonTypeInfo.IsConfigured); 312Debug.Assert(jsonTypeInfo.IsConfigured); 389Debug.Assert(reader.TokenType is JsonTokenType.EndObject or JsonTokenType.EndArray); 417Debug.Assert(payloadLength > 1); 468Debug.Assert(!valueSpan.IsEmpty ^ !valueSequence.IsEmpty);
System\Text\Json\Serialization\JsonSerializer.Write.ByteArray.cs (2)
140Debug.Assert(jsonTypeInfo.IsConfigured); 157Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Document.cs (2)
133Debug.Assert(jsonTypeInfo.IsConfigured); 154Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.Element.cs (2)
134Debug.Assert(jsonTypeInfo.IsConfigured); 153Debug.Assert(options != 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 != null); 50Debug.Assert(discriminator is int); 58Debug.Assert(writtenMetadata != MetadataPropertyName.None); 79Debug.Assert(state.NewReferenceId == null); 82Debug.Assert(referenceId != null);
System\Text\Json\Serialization\JsonSerializer.Write.Node.cs (2)
135Debug.Assert(jsonTypeInfo.IsConfigured); 153Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializer.Write.String.cs (2)
157Debug.Assert(jsonTypeInfo.IsConfigured); 174Debug.Assert(jsonTypeInfo.IsConfigured);
System\Text\Json\Serialization\JsonSerializerContext.cs (2)
42Debug.Assert(!options.IsReadOnly); 54Debug.Assert(options != null);
System\Text\Json\Serialization\JsonSerializerOptions.Caching.cs (8)
27Debug.Assert(IsReadOnly); 167Debug.Assert(rootValue != null); 193Debug.Assert(IsReadOnly); 280Debug.Assert(!entry.HasResult); 305Debug.Assert(!entry.HasResult); 408Debug.Assert(options._typeInfoResolver != null); 442Debug.Assert(weakRef.TryGetTarget(out _) is false); 492Debug.Assert(left != null && right != null);
System\Text\Json\Serialization\JsonSerializerOptions.cs (5)
646Debug.Assert(value >= 0); 847Debug.Assert(IsReadOnly); 848Debug.Assert(TypeInfoResolver != null); 918Debug.Assert(IsReadOnly); 967Debug.Assert(_typeInfoResolver != null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Converters.cs (5)
84Debug.Assert(converters.Count <= NumberOfSimpleConverters); 115Debug.Assert(converter != null); 135Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 136Debug.Assert(typeToConvert != null); 201Debug.Assert(converter != null);
System\Text\Json\Serialization\Metadata\DefaultJsonTypeInfoResolver.Helpers.cs (11)
98Debug.Assert(!typeInfo.IsReadOnly); 99Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 147Debug.Assert(!typeInfo.IsReadOnly); 148Debug.Assert(currentType.IsAssignableFrom(typeInfo.Type)); 216Debug.Assert(jsonPropertyInfo.Name != null); 288Debug.Assert(typeInfo.Converter.ConstructorInfo != null); 300Debug.Assert(typeInfo.Converter.ConstructorInfo.DeclaringType != null); 331Debug.Assert(jsonPropertyInfo.AttributeProvider == null); 412Debug.Assert(memberInfo is FieldInfo or PropertyInfo); 432Debug.Assert(fieldInfo.IsPublic || useNonPublicAccessors); 484Debug.Assert(propertyInfo.MemberType is MemberTypes.Field);
System\Text\Json\Serialization\Metadata\FSharpCoreReflectionProxy.cs (8)
99Debug.Assert(fsharpCoreAssembly.GetName().Name == "FSharp.Core"); 149Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 158Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpOptionType); 168Debug.Assert(typeof(TFSharpValueOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 177Debug.Assert(typeof(TFSharpOption).GetGenericTypeDefinition() == _fsharpValueOptionType); 186Debug.Assert(typeof(TFSharpList).GetGenericTypeDefinition() == _fsharpListType); 194Debug.Assert(typeof(TFSharpSet).GetGenericTypeDefinition() == _fsharpSetType); 202Debug.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 (7)
91Debug.Assert(typeInfo.Kind != JsonTypeInfoKind.None); 121Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 122Debug.Assert(!typeInfo.IsReadOnly); 136Debug.Assert(typeInfo.Kind is JsonTypeInfoKind.Object); 137Debug.Assert(!typeInfo.IsConfigured); 138Debug.Assert(typeInfo.Type != JsonTypeInfo.ObjectType); 139Debug.Assert(typeInfo.Converter.ElementType is null);
System\Text\Json\Serialization\Metadata\JsonParameterInfo.cs (1)
17Debug.Assert(matchingProperty.PropertyType == parameterInfoValues.ParameterType);
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 (25)
29Debug.Assert(_effectiveConverter != null); 142Debug.Assert(!IsConfigured); 376Debug.Assert(declaringTypeInfo is null || declaringType.IsAssignableFrom(declaringTypeInfo.Type)); 390Debug.Assert(!info.IsForTypeInfo); 391Debug.Assert(!info.CanSerialize); 392Debug.Assert(!info.CanDeserialize); 418Debug.Assert(DeclaringTypeInfo != null); 419Debug.Assert(!IsConfigured); 463Debug.Assert(!IgnoreNullTokensOnRead); 477Debug.Assert(Name != null); 506Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never); 532Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property); 566Debug.Assert(!DeclaringTypeInfo.IsConfigured); 662Debug.Assert(_jsonTypeInfo != null); 663Debug.Assert(_jsonTypeInfo.IsConfigurationStarted); 709Debug.Assert(EffectiveConverter.ElementType != null); 755Debug.Assert(MemberType == MemberTypes.Property || MemberType == MemberTypes.Field || MemberType == default); 793Debug.Assert(_name != null); 878Debug.Assert(propValue is Nodes.JsonObject); 893Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>); 904Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty); 960Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true); 1059Debug.Assert(IsConfigured); 1060Debug.Assert(IsRequired); 1065Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonPropertyInfoOfT.cs (16)
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 != null); 149Debug.Assert(jsonTypeInfo is JsonTypeInfo<T>); 167Debug.Assert(HasGetter); 190Debug.Assert(value == null); 210Debug.Assert(PropertyTypeCanBeNull); 287Debug.Assert(CanDeserialize || EffectiveObjectCreationHandling == JsonObjectCreationHandling.Populate); 311Debug.Assert(!state.IsContinuation); 385Debug.Assert(!state.IsContinuation);
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); 79Debug.Assert(IsConfigured); 176Debug.Assert(frame.PropertyRefCacheBuilder is { Count: > 0 }); 184Debug.Assert(newCache.Length <= PropertyRefCacheBuilder.MaxCapacity);
System\Text\Json\Serialization\Metadata\JsonTypeInfo.cs (30)
278Debug.Assert(!IsReadOnly); 388Debug.Assert(IsConfigured); 389Debug.Assert(_elementTypeInfo is null or { IsConfigurationStarted: true }); 400Debug.Assert(!IsReadOnly); 401Debug.Assert(value is null || value.Type == ElementType); 414Debug.Assert(IsConfigured); 415Debug.Assert(_keyTypeInfo is null or { IsConfigurationStarted: true }); 426Debug.Assert(!IsReadOnly); 427Debug.Assert(value is null || value.Type == KeyType); 658Debug.Assert(!IsReadOnly); 742Debug.Assert(Options.IsReadOnly); 743Debug.Assert(IsReadOnly); 790Debug.Assert(IsConfigured); 791Debug.Assert(Type != typeof(object)); 818Debug.Assert(IsReadOnly); 819Debug.Assert(!IsConfigured); 831Debug.Assert(property.IsConfigured); 855Debug.Assert(IsCompatibleWithCurrentOptions); 979Debug.Assert(jsonTypeInfo.Type == type); 1041Debug.Assert(jsonPropertyInfo.PropertyType == propertyType); 1082Debug.Assert(Kind == JsonTypeInfoKind.Object); 1083Debug.Assert(_propertyCache is null); 1084Debug.Assert(_propertyIndex is null); 1085Debug.Assert(ExtensionDataProperty is null); 1098Debug.Assert(property.DeclaringTypeInfo == this); 1196Debug.Assert(Kind == JsonTypeInfoKind.Object); 1198Debug.Assert(_propertyCache is not null); 1199Debug.Assert(_parameterCache is null); 1349Debug.Assert(converter is ObjectConverter); 1360Debug.Assert(converter is JsonConverterFactory);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (6)
60Debug.Assert(createObject is null or Func<object> or Func<T>); 66Debug.Assert(_createObject == null); 67Debug.Assert(_typedCreateObject == null); 73Debug.Assert(_createObject is null); 74Debug.Assert(_typedCreateObject == null); 93Debug.Assert(createObject is Func<object>);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.ReadHelper.cs (4)
19Debug.Assert(IsConfigured); 27Debug.Assert(IsConfigured); 60Debug.Assert(IsConfigured); 120Debug.Assert(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 != null); 34Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 47Debug.Assert(typeof(T) == typeof(object)); 57Debug.Assert(success); 91Debug.Assert(IsConfigured); 92Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 98Debug.Assert(SerializeHandler != null); 99Debug.Assert(CanUseSerializeHandler); 100Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 142Debug.Assert(typeof(T) == typeof(object)); 176Debug.Assert(!isFinalBlock); 177Debug.Assert(state.PendingTask is not null); 227Debug.Assert(writer.BytesPending == 0); 254Debug.Assert(IsConfigured); 255Debug.Assert(rootValueBoxed is null || rootValueBoxed is T); 261Debug.Assert(SerializeHandler != null); 262Debug.Assert(CanUseSerializeHandler); 263Debug.Assert(Converter is JsonMetadataServicesConverter<T>); 289Debug.Assert(typeof(T) == typeof(object)); 304Debug.Assert(bufferWriter.CanGetUnflushedBytes); 317Debug.Assert(state.PendingTask == null); 325Debug.Assert(writer.BytesPending == 0); 362Debug.Assert(CanUseSerializeHandler);
System\Text\Json\Serialization\Metadata\JsonTypeInfoResolverWithAddedModifiers.cs (1)
15Debug.Assert(modifiers.Length > 0);
System\Text\Json\Serialization\Metadata\PolymorphicTypeResolver.cs (12)
37Debug.Assert(typeDiscriminator is null or int or string); 121Debug.Assert(BaseType.IsAssignableFrom(runtimeType)); 165Debug.Assert(typeDiscriminator is int or string); 166Debug.Assert(UsesTypeDiscriminators); 167Debug.Assert(_discriminatorIdtoType != null); 171Debug.Assert(typeDiscriminator.Equals(result.TypeDiscriminator)); 201Debug.Assert(!type.IsAbstract); 202Debug.Assert(BaseType.IsAssignableFrom(type)); 203Debug.Assert(UnknownDerivedTypeHandling == JsonUnknownDerivedTypeHandling.FallBackToNearestAncestor); 215Debug.Assert(candidate != null); 256Debug.Assert(typeInfo.IsConfigured); 334Debug.Assert(typeDiscriminator is null or int or string);
System\Text\Json\Serialization\Metadata\ReflectionEmitMemberAccessor.cs (18)
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.IsPublic && !constructor.IsStatic); 119Debug.Assert(type != null); 120Debug.Assert(!type.IsAbstract); 121Debug.Assert(!constructor.IsStatic); 137Debug.Assert(index <= JsonConstants.UnboxedParameterCountThreshold); 236Debug.Assert(realMethod != null); 239Debug.Assert(declaringType != null); 266Debug.Assert(!runtimePropertyType.IsValueType); 282Debug.Assert(realMethod != null); 285Debug.Assert(declaringType != null); 303Debug.Assert(!runtimePropertyType.IsValueType); 320Debug.Assert(declaringType != null); 354Debug.Assert(declaringType != null);
System\Text\Json\Serialization\Metadata\ReflectionMemberAccessor.cs (7)
21Debug.Assert(type != null); 22Debug.Assert(ctorInfo is null || ctorInfo.GetParameters().Length == 0); 43Debug.Assert(!type.IsAbstract); 44Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 78Debug.Assert(!type.IsAbstract); 79Debug.Assert(constructor.DeclaringType == type && constructor.IsPublic && !constructor.IsStatic); 83Debug.Assert(parameterCount <= JsonConstants.UnboxedParameterCountThreshold);
System\Text\Json\Serialization\PreserveReferenceResolver.cs (3)
33Debug.Assert(_referenceIdToObjectMap != null); 43Debug.Assert(_objectToReferenceIdMap != null); 62Debug.Assert(_referenceIdToObjectMap != null);
System\Text\Json\Serialization\ReadBufferState.cs (2)
123Debug.Assert(bytesConsumed <= _count); 169Debug.Assert(_buffer.Length >= JsonConstants.Utf8Bom.Length);
System\Text\Json\Serialization\ReadStack.cs (14)
29Debug.Assert(_count > 1); 30Debug.Assert(_stack is not null); 166Debug.Assert(_count > 0); 167Debug.Assert(JsonPath() is not null); 198Debug.Assert(_continuationCount == 0); 212Debug.Assert(!IsContinuation); 213Debug.Assert(Current.PolymorphicJsonTypeInfo == null); 214Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.None); 232Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 233Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 246Debug.Assert(Current.PolymorphicJsonTypeInfo != null); 247Debug.Assert(Current.PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntryStarted); 375Debug.Assert(!IsContinuation); 385Debug.Assert(Current.JsonTypeInfo.UsesParameterizedConstructor);
System\Text\Json\Serialization\ReadStackFrame.cs (3)
135Debug.Assert(RequiredPropertiesSet != null); 143Debug.Assert(RequiredPropertiesSet == null); 156Debug.Assert(RequiredPropertiesSet != null);
System\Text\Json\Serialization\WriteStack.cs (13)
35Debug.Assert(_count - _indexOffset > 0); 36Debug.Assert(_stack is not null); 151Debug.Assert(!IsContinuation); 152Debug.Assert(CurrentDepth == 0); 163Debug.Assert(options.ReferenceHandler != null); 180Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntryStarted); 188Debug.Assert(Current.PolymorphicSerializationState != PolymorphicSerializationState.PolymorphicReEntrySuspended); 236Debug.Assert(_count > 0); 268Debug.Assert(_continuationCount == 0); 283Debug.Assert(CompletedAsyncDisposables?.Count > 0); 314Debug.Assert(Current.AsyncDisposable is null); 320Debug.Assert(_stack[i].AsyncDisposable is null); 368Debug.Assert(!(collectionEnumerator is not null && asyncDisposable is not null));
System\Text\Json\Serialization\WriteStackFrame.cs (4)
120Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.None); 142Debug.Assert(PolymorphicSerializationState is PolymorphicSerializationState.None or PolymorphicSerializationState.PolymorphicReEntryStarted); 154Debug.Assert(PolymorphicSerializationState == PolymorphicSerializationState.PolymorphicReEntrySuspended); 155Debug.Assert(PolymorphicTypeInfo is not null);
System\Text\Json\ThrowHelper.cs (8)
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); 615Debug.Assert(token == JsonConstants.CloseBracket || token == JsonConstants.CloseBrace);
System\Text\Json\ThrowHelper.Node.cs (1)
58Debug.Assert(supportedTypeNames.Length > 0);
System\Text\Json\ThrowHelper.Serialization.cs (10)
156Debug.Assert(propertyName == null); 160Debug.Assert(propertyName != null); 169Debug.Assert(memberInfo == null); 173Debug.Assert(memberInfo != null); 387Debug.Assert(!jsonPropertyInfo.IsForTypeInfo); 432Debug.Assert(ex.Path == null); 465Debug.Assert(ex.Path is null); // do not overwrite existing path information 503Debug.Assert(ex.Path is null); // do not overwrite existing path information 572Debug.Assert(!message.Contains(" Path: ")); 600Debug.Assert(!message.Contains(" Path: "));
System\Text\Json\ValueQueue.cs (2)
40Debug.Assert(_multiple != null); 61Debug.Assert(_multiple != null);
System\Text\Json\Writer\JsonWriterHelper.cs (5)
15Debug.Assert(buffer.Length >= indent); 158Debug.Assert(!utf8FormattedNumber.IsEmpty); 211Debug.Assert(i < utf8FormattedNumber.Length); 291Debug.Assert(status is OperationStatus.Done or OperationStatus.DestinationTooSmall or OperationStatus.InvalidData); 292Debug.Assert(charsRead == source.Length || status is not OperationStatus.Done);
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 (16)
77Debug.Assert(textLength > 0); 78Debug.Assert(firstIndexToEscape >= 0 && firstIndexToEscape < textLength); 84Debug.Assert(encoder != null); 88Debug.Assert(result != OperationStatus.DestinationTooSmall); 89Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 96Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 107Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 189Debug.Assert(result); 190Debug.Assert(bytesWritten == 4); 202Debug.Assert(encoder != null); 206Debug.Assert(result != OperationStatus.DestinationTooSmall); 207Debug.Assert(result != OperationStatus.NeedMoreData || !isFinalBlock); 214Debug.Assert(encoderBytesConsumed == value.Length || (result == OperationStatus.NeedMoreData && !isFinalBlock)); 225Debug.Assert(indexOfFirstByteToEscape >= 0 && indexOfFirstByteToEscape < value.Length); 274Debug.Assert(IsAsciiValue(value)); 310Debug.Assert(charsWritten == 4);
System\Text\Json\Writer\Utf8JsonWriter.cs (49)
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); 360Debug.Assert(_output is null && _stream is null && _arrayBufferWriter is null); 415Debug.Assert(_arrayBufferWriter != null); 434Debug.Assert(_output != null); 524Debug.Assert(_arrayBufferWriter != null); 539Debug.Assert(_output != null); 612Debug.Assert(_options.Indented || !_options.SkipValidation); 625Debug.Assert(!_options.SkipValidation); 651Debug.Assert(!HasPartialStringData); 655Debug.Assert(_tokenType != JsonTokenType.PropertyName); 656Debug.Assert(_tokenType != JsonTokenType.None && _tokenType != JsonTokenType.StartArray); 661Debug.Assert(_tokenType != JsonTokenType.PropertyName); 662Debug.Assert(_tokenType != JsonTokenType.StartObject); 663Debug.Assert(CurrentDepth == 0 && _tokenType != JsonTokenType.None); 671Debug.Assert(indent <= _indentLength * _options.MaxDepth); 728Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 792Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 820Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 821Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 947Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 975Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 976Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 1052Debug.Assert(_options.Indented || !_options.SkipValidation); 1064Debug.Assert(!_options.SkipValidation); 1086Debug.Assert(token == JsonConstants.CloseBrace); 1117Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1118Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.None); 1165Debug.Assert(token == JsonConstants.OpenBrace); 1173Debug.Assert(requiredSize > 0); 1183Debug.Assert(BytesPending != 0); 1187Debug.Assert(_arrayBufferWriter != null); 1194Debug.Assert(_memory.Length >= sizeHint); 1198Debug.Assert(_output != null); 1215Debug.Assert(_memory.Length == 0); 1216Debug.Assert(BytesPending == 0); 1222Debug.Assert(_arrayBufferWriter != null); 1224Debug.Assert(_memory.Length >= sizeHint); 1228Debug.Assert(_output != null);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Bytes.cs (15)
23Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 109Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 125Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 140Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 162Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 163Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 213Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - encodedLength - 6); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - encodedLength - 6); 283Debug.Assert(indent <= _indentLength * _options.MaxDepth); 287Debug.Assert(escapedPropertyName.Length * JsonConstants.MaxExpansionFactorWhileTranscoding < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 305Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 333Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - encodedLength - 7 - _newLineLength); 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTime.cs (15)
27Debug.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.MaximumFormatDateTimeOffsetLength - 6); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 287Debug.Assert(indent <= _indentLength * _options.MaxDepth); 289Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 307Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 336Debug.Assert(indent <= _indentLength * _options.MaxDepth); 338Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 355Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.DateTimeOffset.cs (15)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 251Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDateTimeOffsetLength - 6); 286Debug.Assert(indent <= _indentLength * _options.MaxDepth); 288Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 306Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 335Debug.Assert(indent <= _indentLength * _options.MaxDepth); 337Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDateTimeOffsetLength - 7 - _newLineLength); 354Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Decimal.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDecimalLength - 4); 242Debug.Assert(result); 248Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDecimalLength - 4); 273Debug.Assert(result); 280Debug.Assert(indent <= _indentLength * _options.MaxDepth); 282Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 300Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 319Debug.Assert(result); 326Debug.Assert(indent <= _indentLength * _options.MaxDepth); 328Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDecimalLength - 5 - _newLineLength); 345Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 365Debug.Assert(result); 373Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Double.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 119Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 135Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 149Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 150Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 172Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 173Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 221Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatDoubleLength - 4); 246Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatDoubleLength - 4); 277Debug.Assert(result); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 323Debug.Assert(result); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 332Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatDoubleLength - 5 - _newLineLength); 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 369Debug.Assert(result); 378Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.Float.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 119Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 135Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 149Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 150Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 172Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 173Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 221Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatSingleLength - 4); 246Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatSingleLength - 4); 277Debug.Assert(result); 284Debug.Assert(indent <= _indentLength * _options.MaxDepth); 286Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 304Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 323Debug.Assert(result); 330Debug.Assert(indent <= _indentLength * _options.MaxDepth); 332Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatSingleLength - 5 - _newLineLength); 349Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 369Debug.Assert(result); 377Debug.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); 115Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 131Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 145Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 146Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 168Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 169Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 217Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatGuidLength - 6); 244Debug.Assert(result); 252Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatGuidLength - 6); 279Debug.Assert(result); 288Debug.Assert(indent <= _indentLength * _options.MaxDepth); 290Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 308Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 329Debug.Assert(result); 338Debug.Assert(indent <= _indentLength * _options.MaxDepth); 340Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatGuidLength - 7 - _newLineLength); 357Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 379Debug.Assert(result); 389Debug.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); 237Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 253Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 267Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 268Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 290Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 291Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 339Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 340Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - value.Length - 4); 370Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 371Debug.Assert(escapedPropertyName.Length < int.MaxValue - value.Length - 4); 403Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 404Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - value.Length - 1); 430Debug.Assert(indent <= _indentLength * _options.MaxDepth); 432Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 433Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - value.Length - 5 - _newLineLength); 451Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 476Debug.Assert(indent <= _indentLength * _options.MaxDepth); 478Debug.Assert(value.Length <= JsonConstants.MaxUnescapedTokenSize); 479Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - value.Length - 5 - _newLineLength); 496Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 524Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.SignedNumber.cs (20)
26Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 191Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 207Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 221Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 222Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 244Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 245Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 293Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatInt64Length - 4); 318Debug.Assert(result); 324Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatInt64Length - 4); 349Debug.Assert(result); 356Debug.Assert(indent <= _indentLength * _options.MaxDepth); 358Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 376Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 395Debug.Assert(result); 402Debug.Assert(indent <= _indentLength * _options.MaxDepth); 404Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatInt64Length - 5 - _newLineLength); 421Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 441Debug.Assert(result); 453Debug.Assert(result);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.String.cs (76)
33Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxUnescapedTokenSize - 3); 45Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 98Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 115Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 161Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 162Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 4) / JsonConstants.MaxExpansionFactorWhileTranscoding); 190Debug.Assert(indent <= _indentLength * _options.MaxDepth); 192Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 193Debug.Assert(escapedPropertyName.Length < (int.MaxValue - 5 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding); 247Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 274Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 322Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 323Debug.Assert(escapedPropertyName.Length < int.MaxValue - 4); 352Debug.Assert(escapedPropertyNameSection.Length <= JsonConstants.MaxEscapedTokenSize - 3); 353Debug.Assert(escapedPropertyNameSection.Length < int.MaxValue - 4); 378Debug.Assert(indent <= _indentLength * _options.MaxDepth); 380Debug.Assert(escapedPropertyName.Length <= JsonConstants.MaxEscapedTokenSize); 381Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - 5 - _newLineLength); 398Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 431Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize && utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 604Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 610Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 694Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 700Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 784Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 790Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 856Debug.Assert(utf8Value.Length <= JsonConstants.MaxUnescapedTokenSize); 862Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 911Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 912Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8Value.Length); 934Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 935Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < value.Length); 957Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 958Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < propertyName.Length); 980Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 981Debug.Assert(firstEscapeIndex >= 0 && firstEscapeIndex < utf8PropertyName.Length); 1006Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1007Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1025Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1026Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1044Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length && valueIdx < int.MaxValue / 2); 1045Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length && propertyIdx < int.MaxValue / 2); 1063Debug.Assert(valueIdx >= -1 && valueIdx < value.Length && valueIdx < int.MaxValue / 2); 1064Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length && propertyIdx < int.MaxValue / 2); 1079Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1080Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1139Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1140Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1199Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 1200Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 1259Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 1260Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 1372Debug.Assert(escapedValue.Length <= JsonConstants.MaxUnescapedTokenSize); 1373Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 6) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1407Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1408Debug.Assert(escapedPropertyName.Length < int.MaxValue - escapedValue.Length - 6); 1443Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1444Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1479Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1480Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 6); 1516Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1518Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1519Debug.Assert(escapedPropertyName.Length < ((int.MaxValue - 7 - indent - _newLineLength) / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length); 1537Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1566Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1568Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1569Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - escapedValue.Length - 7 - _newLineLength); 1586Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1617Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1619Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1620Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1638Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 1668Debug.Assert(indent <= _indentLength * _options.MaxDepth); 1670Debug.Assert(escapedValue.Length <= JsonConstants.MaxEscapedTokenSize); 1671Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - escapedValue.Length - 7 - indent - _newLineLength); 1689Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName);
System\Text\Json\Writer\Utf8JsonWriter.WriteProperties.UnsignedNumber.cs (20)
27Debug.Assert(utf8PropertyName.Length <= JsonConstants.MaxUnescapedTokenSize); 200Debug.Assert(propertyIdx >= -1 && propertyIdx < propertyName.Length); 216Debug.Assert(propertyIdx >= -1 && propertyIdx < utf8PropertyName.Length); 230Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= propertyName.Length); 231Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < propertyName.Length); 253Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8PropertyName.Length); 254Debug.Assert(firstEscapeIndexProp >= 0 && firstEscapeIndexProp < utf8PropertyName.Length); 302Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - JsonConstants.MaximumFormatUInt64Length - 4); 327Debug.Assert(result); 333Debug.Assert(escapedPropertyName.Length < int.MaxValue - JsonConstants.MaximumFormatUInt64Length - 4); 358Debug.Assert(result); 365Debug.Assert(indent <= _indentLength * _options.MaxDepth); 367Debug.Assert(escapedPropertyName.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 385Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 404Debug.Assert(result); 411Debug.Assert(indent <= _indentLength * _options.MaxDepth); 413Debug.Assert(escapedPropertyName.Length < int.MaxValue - indent - JsonConstants.MaximumFormatUInt64Length - 5 - _newLineLength); 430Debug.Assert(_options.SkipValidation || _tokenType != JsonTokenType.PropertyName); 450Debug.Assert(result); 462Debug.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)
83Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 4); 100Debug.Assert(status != OperationStatus.DestinationTooSmall); 115Debug.Assert(indent <= _indentLength * _options.MaxDepth); 117Debug.Assert(value.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 4 - _newLineLength); 141Debug.Assert(status != OperationStatus.DestinationTooSmall); 198Debug.Assert(utf8Value.Length < int.MaxValue - 4); 222Debug.Assert(indent <= _indentLength * _options.MaxDepth); 224Debug.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)
171Debug.Assert(utf8JsonLen < int.MaxValue); 244Debug.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); 118Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - 3); 146Debug.Assert(indent <= _indentLength * _options.MaxDepth); 148Debug.Assert(escapedValue.Length < (int.MaxValue / JsonConstants.MaxExpansionFactorWhileTranscoding) - indent - 3 - _newLineLength); 185Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= value.Length); 186Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < value.Length); 233Debug.Assert(valueIdx >= -1 && valueIdx < utf8Value.Length); 265Debug.Assert(escapedValue.Length < int.MaxValue - 3); 293Debug.Assert(indent <= _indentLength * _options.MaxDepth); 295Debug.Assert(escapedValue.Length < int.MaxValue - indent - 3 - _newLineLength); 332Debug.Assert(int.MaxValue / JsonConstants.MaxExpansionFactorWhileEscaping >= utf8Value.Length); 333Debug.Assert(firstEscapeIndexVal >= 0 && firstEscapeIndexVal < utf8Value.Length);
System\Text\Json\Writer\Utf8JsonWriter.WriteValues.StringSegment.cs (33)
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); 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); 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 != null); 73Debug.Assert((rentedWriters == 0) == (ReferenceEquals(state.BufferWriter, bufferWriter) && ReferenceEquals(state.Writer, writer))); 78Debug.Assert(t_threadLocalState != null); 84Debug.Assert((rentedWriters == 0) == ReferenceEquals(state.Writer, writer));
System.Text.Json.SourceGeneration (53)
Helpers\RoslynExtensions.cs (6)
24Debug.Assert(type.FullName != null); 158Debug.Assert(baseType.IsGenericTypeDefinition()); 215Debug.Assert(member is IFieldSymbol or IPropertySymbol); 221Debug.Assert(member is IFieldSymbol or IPropertySymbol); 222Debug.Assert(otherMember is IFieldSymbol or IPropertySymbol); 357Debug.Assert(inputType.IsNullableType());
JsonSourceGenerator.Emitter.cs (15)
102Debug.Assert(_typeIndex.Count == 0); 103Debug.Assert(_propertyNames.Count == 0); 104Debug.Assert(!_emitGetConverterForNullablePropertyMethod); 159Debug.Assert(contextClasses.Count > 0); 248Debug.Assert(typeMetadata.ConverterType != null); 269Debug.Assert(typeMetadata.NullableUnderlyingType != null); 326Debug.Assert(!(typeGenerationSpec.ClassType == ClassType.Dictionary && collectionKeyType == null)); 331Debug.Assert(collectionValueType != null); 368Debug.Assert(keyTypeFQN != null); 372Debug.Assert(keyTypeFQN != null); 414Debug.Assert(typeGenerationSpec.CollectionValueType != null); 467Debug.Assert(typeGenerationSpec.CollectionKeyType != null); 468Debug.Assert(typeGenerationSpec.CollectionValueType != null); 720Debug.Assert(paramCount > 0); 823Debug.Assert(!_propertyNames.TryGetValue(effectiveJsonPropertyName, out string? existingName) || existingName == propertyNameFieldName);
JsonSourceGenerator.Parser.cs (25)
55Debug.Assert(_contextClassLocation != null); 85Debug.Assert(_knownSymbols.JsonSerializerContextType != null); 88Debug.Assert(_typesToGenerate.Count == 0); 89Debug.Assert(_generatedTypes.Count == 0); 90Debug.Assert(_contextClassLocation is null); 93Debug.Assert(contextTypeSymbol != null); 96Debug.Assert(_contextClassLocation is not null); 116Debug.Assert(rootSerializableTypes.Count > 0); 151Debug.Assert(_generatedTypes.Count > 0); 195Debug.Assert(typeSymbol != null); 203Debug.Assert(typeDeclarations?.Count > 0); 234Debug.Assert(_knownSymbols.JsonSerializableAttributeType != null); 235Debug.Assert(_knownSymbols.JsonSourceGenerationOptionsAttributeType != null); 293Debug.Assert(attributeData.ConstructorArguments.Length == 1 & attributeData.ConstructorArguments[0].Type?.Name is nameof(JsonSerializerDefaults)); 454Debug.Assert(attributeData.ConstructorArguments.Length == 1); 481Debug.Assert(attributeLocation != null); 558Debug.Assert(_knownSymbols.JsonStringEnumConverterOfTType != null); 726Debug.Assert(attributeData.ConstructorArguments.Length > 0); 757Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.MemoryByteType)); 765Debug.Assert(!SymbolEqualityComparer.Default.Equals(type, _knownSymbols.ReadOnlyMemoryByteType)); 1122Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1242Debug.Assert(memberInfo is IFieldSymbol or IPropertySymbol); 1461Debug.Assert(constructor != null); 1564Debug.Assert(_knownSymbols.JsonConverterAttributeType.IsAssignableFrom(attributeData.AttributeClass)); 1572Debug.Assert(attributeData.ConstructorArguments.Length == 1 && attributeData.ConstructorArguments[0].Value is null or ITypeSymbol);
src\libraries\Common\src\SourceGenerators\SourceWriter.cs (1)
66Debug.Assert(_indentation == 0 && _sb.Length > 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
src\libraries\System.Text.Json\Common\JsonSeparatorNamingPolicy.cs (1)
18Debug.Assert(char.IsPunctuation(separator));
System.Text.RegularExpressions (440)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
System\Text\RegularExpressions\CaptureCollection.cs (1)
58Debug.Assert(_captures != null);
System\Text\RegularExpressions\Match.cs (4)
101Debug.Assert(Text != null); 267Debug.Assert(mode != RegexRunnerMode.ExistenceRequired); 275Debug.Assert(_textbeg == 0); 296Debug.Assert(!_balancing);
System\Text\RegularExpressions\Regex.Cache.cs (6)
76Debug.Assert(value >= 0); 104Debug.Assert(s_cacheList.Count == value); 105Debug.Assert(s_cacheDictionary.Count == value); 199Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count); 271Debug.Assert(s_cacheList.Count <= s_maxCacheSize); 272Debug.Assert(s_cacheList.Count == s_cacheDictionary.Count);
System\Text\RegularExpressions\Regex.cs (6)
463Debug.Assert(mode <= RegexRunnerMode.BoundsRequired); 467Debug.Assert(startat <= input.Length); 529Debug.Assert(inputString is null || inputSpan.SequenceEqual(inputString)); 530Debug.Assert((uint)startat <= (uint)inputSpan.Length); 547Debug.Assert(match is not null); 612Debug.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 (14)
337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 409Debug.Assert(!set.IsEmpty); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1616Debug.Assert(i == span.Length);
System\Text\RegularExpressions\RegexCompiler.cs (45)
380Debug.Assert(_pool != null); 381Debug.Assert(_local != null); 382Debug.Assert(!_pool.Contains(_local)); 391Debug.Assert(_regexTree != null); 412Debug.Assert(minRequiredLength >= 0); 757Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingString_LeftToRight or 812Debug.Assert(!string.IsNullOrEmpty(prefix)); 844Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 918Debug.Assert(primarySet.Chars.Length > 0); 1100Debug.Assert(needLoop); 1116Debug.Assert(setIndex is 0 or 1); 1119Debug.Assert(needLoop); 1175Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1178Debug.Assert(set.Distance == 0); 1246Debug.Assert(_regexTree.FindOptimizations.LiteralAfterLoop is not null); 1249Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1250Debug.Assert(target.LoopNode.N == int.MaxValue); 1280Debug.Assert(target.Literal.StringComparison is StringComparison.Ordinal); 1426Debug.Assert(_regexTree != null); 1614Debug.Assert(requiredLength > 0); 1652Debug.Assert(childCount >= 2); 1659Debug.Assert(node.Parent is not null); 1847Debug.Assert(sliceStaticPos == 0); 2127Debug.Assert(needsEndConditional); 2333Debug.Assert(resumeAt is not null); 2491Debug.Assert(startingCapturePos != null); 2965Debug.Assert(!rtl || offset is null); 3071Debug.Assert(node.Kind == RegexNodeKind.NonECMABoundary); 3082Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3083Debug.Assert(sliceStaticPos >= 0); 3085Debug.Assert(sliceStaticPos >= 0); 3225Debug.Assert(str.Length >= 2); 3229Debug.Assert(emitLengthCheck); 3291Debug.Assert(node.M < node.N); 3504Debug.Assert(node.M < node.N); 3953Debug.Assert(sliceStaticPos == 0); 4033Debug.Assert(entriesPerIteration >= 1); 4372Debug.Assert(node.N > node.M); 4604Debug.Assert(node.M == 0 && node.N == 1); 4855Debug.Assert(sliceStaticPos == 0); 5009Debug.Assert(startingStackpos is not null); 5285Debug.Assert(count >= 1); 5704Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive); 6195Debug.Assert(values is char[] or string[]); 6196Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexFindOptimizations.cs (11)
112Debug.Assert(!RegexCharClass.IsNegated(charClass)); 119Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 172Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 354Debug.Assert(chars is { Length: 1 }); 482Debug.Assert(FindMode == FindNextStartingPositionMode.NoSearch); 663Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 678Debug.Assert(FixedDistanceLiteral.Distance <= MinRequiredLength); 695Debug.Assert(LeadingStrings is not null); 789Debug.Assert(LiteralAfterLoop is not null); 792Debug.Assert(loopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 793Debug.Assert(loopNode.N == int.MaxValue);
System\Text\RegularExpressions\RegexInterpreter.cs (4)
326Debug.Assert(runregex is not null); 327Debug.Assert(runtrack is not null); 328Debug.Assert(runstack is not null); 329Debug.Assert(runcrawl is not null);
System\Text\RegularExpressions\RegexNode.cs (60)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 332Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 333Debug.Assert(rootNode.Parent is null); 334Debug.Assert(rootNode.ChildCount() == 1); 560Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 577Debug.Assert(Kind == RegexNodeKind.Group); 582Debug.Assert(u.ChildCount() == 1); 605Debug.Assert(Kind == RegexNodeKind.Atomic); 606Debug.Assert(ChildCount() == 1); 647Debug.Assert(branches is not null && branches.Count != 0); 767Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 876Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 925Debug.Assert(Kind == RegexNodeKind.Alternate); 1077Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1172Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1173Debug.Assert(node.ChildCount() >= 2); 1215Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1247Debug.Assert(startingSpan.Length > 0); 1276Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1277Debug.Assert(startingNode.Str!.Length > 0); 1300Debug.Assert(startingSpan.Length > 0); 1323Debug.Assert(startingSpan.Length == 1); 1324Debug.Assert(startingSpan[0] == node.Ch); 1330Debug.Assert(node.Kind == RegexNodeKind.Multi); 1331Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1385Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1386Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1445Debug.Assert(lowInclusive < highInclusive); 1481Debug.Assert(@string is not null); 1487Debug.Assert(setChars is not null); 1500Debug.Assert(Kind == RegexNodeKind.Concatenate); 1542Debug.Assert(Kind == RegexNodeKind.Concatenate); 1543Debug.Assert(Children is List<RegexNode>); 1625Debug.Assert(Kind == RegexNodeKind.Concatenate); 1626Debug.Assert(Children is List<RegexNode>); 1736Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1830Debug.Assert(Children is List<RegexNode>); 1935Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1969Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 1970Debug.Assert(ChildCount() == 1); 1997Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 1998Debug.Assert(ChildCount() is 1 or 2); 2015Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2016Debug.Assert(ChildCount() is 2 or 3); 2069Debug.Assert(subsequent.Kind != RegexNodeKind.Group); 2293Debug.Assert(childCount >= 2); 2326Debug.Assert(ChildCount() == 1); 2410Debug.Assert(childCount >= 2); 2464Debug.Assert(ChildCount() == 1); 2693Debug.Assert(max >= 2); 2738Debug.Assert(Children is List<RegexNode>); 2749Debug.Assert(Children != null); 2750Debug.Assert(index < ChildCount()); 2780Debug.Assert(Children is RegexNode);
System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (6)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert(
System\Text\RegularExpressions\RegexReplacement.cs (2)
215Debug.Assert(_rules.Length <= 1); 216Debug.Assert(_rules.Length == 0 || (_rules[0] == 0 && _strings.Length == 1));
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 (2)
31Debug.Assert(!Enum.IsDefined(BeforeChild)); 32Debug.Assert(!Enum.IsDefined(AfterChild));
System\Text\RegularExpressions\Symbolic\BDD.cs (10)
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); 315Debug.Assert(serialized[i] > 0); 353Debug.Assert((bytes.Length - 1) % bytesPerLong == 0); 381Debug.Assert(oneId < i && zeroId < i); 382Debug.Assert(nodes[oneId] is not null); 383Debug.Assert(nodes[zeroId] is not null);
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 (3)
223Debug.Assert(op is BooleanOperation.Or or BooleanOperation.And or BooleanOperation.Xor); 264Debug.Assert(!set2.IsLeaf); 364Debug.Assert(terminal >= 0);
System\Text\RegularExpressions\Symbolic\DoublyLinkedList.cs (2)
44Debug.Assert(_first is not null); 74Debug.Assert(_last is not null);
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 (1)
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 (17)
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); 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)); 516Debug.Assert(result is not null);
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 (6)
234Debug.Assert(node._set is not null); 244Debug.Assert(node._left is not null); 324Debug.Assert(node._set is not null); 328Debug.Assert(node._left is not null); 332Debug.Assert(node._left is not null && node._right is not null); 356Debug.Assert(node._left is not null);
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 (25)
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); 357Debug.Assert(perThreadData is not null); 416Debug.Assert(matchEnd >= startat - 1); 886Debug.Assert(i >= matchStartBoundary); 928Debug.Assert(lastStart != -1); 975Debug.Assert(lastStart != -1); 1019Debug.Assert(perThreadData.Current is not null && perThreadData.Next is not null); 1030Debug.Assert(next.Count == 0); 1059Debug.Assert(coreStateId != _deadStateId); 1080Debug.Assert(current.Count > 0); 1157Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length); 1158Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length); 1451Debug.Assert(nextStates.Count == 0 || sourceStates.Count > 0); 1546Debug.Assert(matcher._findOpts is not null); 1558Debug.Assert(pos == input.Length); 1577Debug.Assert(matcher._findOpts is not null); 1589Debug.Assert(pos == input.Length); 1608Debug.Assert(!matcher._containsAnyAnchor); 1609Debug.Assert(matcher._findOpts is not null); 1619Debug.Assert(pos == input.Length); 1657Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor); 1686Debug.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 (4)
54Debug.Assert(_minterms is not null); 82Debug.Assert(states.NfaStateSet.Count > 0); 138Debug.Assert(success); 176Debug.Assert(!bdd.IsEmpty);
System\Text\RegularExpressions\Symbolic\SymbolicRegexNode.cs (133)
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); 1379Debug.Assert(_left is not null && _right is not null); 1384Debug.Assert(_left is not null && _right is not null); 1385Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1389Debug.Assert(_left is not null && _right is not null); 1398Debug.Assert(_left is not null); 1402Debug.Assert(_left is not null); 1451Debug.Assert(_left is not null && _right is not null); 1463Debug.Assert(_left is not null && _right is not null); 1464Debug.Assert(_left._info.ContainsEffect && !_right._info.ContainsEffect); 1478Debug.Assert(_left is not null && _right is not null); 1487Debug.Assert(_left is not null); 1504Debug.Assert(_left is not null); 1542Debug.Assert(_left is not null && _right is not null); 1543Debug.Assert(_left.IsNullableFor(context) && _right.IsNullableFor(context)); 1549Debug.Assert(_left is not null); 1553Debug.Assert(_left.IsNullableFor(context)); 1559Debug.Assert(_left is not null && _right is not null); 1568Debug.Assert(_right.IsNullableFor(context)); 1582Debug.Assert(_left is not null); 1649Debug.Assert(_left is not null && _right is not null); 1658Debug.Assert(_left is not null && _right is not null); 1669Debug.Assert(_set is not null); 1674Debug.Assert(_left is not null); 1733Debug.Assert(_left is not null && _right is not null); 1747Debug.Assert(_lower >= 0); 1753Debug.Assert(_lower >= 0); 1759Debug.Assert(_left is not null); 1854Debug.Assert(_set is not null); 1859Debug.Assert(_left is not null); 1864Debug.Assert(_left is not null && _right is not null); 1874Debug.Assert(conc._left is not null && conc._right is not null); 1882Debug.Assert(_left is not null); 1914Debug.Assert(_left is not null); 1919Debug.Assert(_left is not null && _right is not null); 1924Debug.Assert(rest._left is not null && rest._right is not null); 1935Debug.Assert(_left is not null && _right is not null); 1965Debug.Assert(_left is not null); 1991Debug.Assert(_left is not null && _right is not null); 1995Debug.Assert(_left is not null && _right is not null); 1999Debug.Assert(_left is not null); 2012Debug.Assert(kind != SymbolicRegexNodeKind.Singleton); 2032Debug.Assert(left is not null); 2036Debug.Assert(left is not null && right is not null); 2040Debug.Assert(left is not null && right is not null); 2045Debug.Assert(left is not null); 2117Debug.Assert(_left is not null); 2125Debug.Assert(_left is not null && _right is not null); 2129Debug.Assert(left1 is not null && right1 is not null); 2137Debug.Assert(_left is not null && _right is not null); 2141Debug.Assert(left1 is not null && right1 is not null); 2149Debug.Assert(_left is not null && _right is not null); 2157Debug.Assert(_left is not null); 2177Debug.Assert(IsNullableFor(context)); 2191Debug.Assert(_left is not null && _right is not null); 2200Debug.Assert(_right.IsNullableFor(context)); 2205Debug.Assert(_left is not null && _right is not null); 2223Debug.Assert(_left is not null); 2225Debug.Assert(_left._kind is not SymbolicRegexNodeKind.DisableBacktrackingSimulation); 2237Debug.Assert(current._left is not null && current._right is not null); 2238Debug.Assert(current._left._kind is not SymbolicRegexNodeKind.Alternate); 2287Debug.Assert(_left is not null && _right is not null); 2292Debug.Assert(_left is not null && _right is null); 2293Debug.Assert(_lower >= 0 && _upper > 0 && _upper >= _lower); 2303Debug.Assert(_lower > 0); 2318Debug.Assert(_left is not null); 2322Debug.Assert(_left is null && _right is null); 2332Debug.Assert(m >= 0 && n >= 0); 2339Debug.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)
30Debug.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 (155)
RegexGenerator.cs (1)
92Debug.Assert(state is DiagnosticData);
RegexGenerator.Emitter.cs (41)
399Debug.Assert(chars.Length > 3); 739Debug.Assert(minRequiredLength >= 0); 1012Debug.Assert(!string.IsNullOrEmpty(substring)); 1019Debug.Assert(!string.IsNullOrEmpty(substring)); 1023Debug.Assert(!string.IsNullOrEmpty(regexTree.FindOptimizations.FixedDistanceLiteral.String)); 1092Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingStrings_LeftToRight or FindNextStartingPositionMode.LeadingStrings_OrdinalIgnoreCase_LeftToRight); 1138Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1187Debug.Assert(primarySet.Chars.Length > 0); 1285Debug.Assert(setIndex is 0 or 1); 1291Debug.Assert(needLoop); 1326Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 }); 1329Debug.Assert(set.Distance == 0); 1360Debug.Assert(regexTree.FindOptimizations.LiteralAfterLoop is not null); 1363Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic); 1364Debug.Assert(target.LoopNode.N == int.MaxValue); 1634Debug.Assert(requiredLength > 0); 1670Debug.Assert(childCount >= 2); 1677Debug.Assert(node.Parent is not null); 1739Debug.Assert(startingLiteralNode.IsSetFamily); 1810Debug.Assert(numChars != 0); 1852Debug.Assert(remainder is null); 2099Debug.Assert(sliceStaticPos == 0); 3125Debug.Assert(!rtl || offset is null); 3126Debug.Assert(!rtl || !clauseOnly); 3194Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0); 3195Debug.Assert(sliceStaticPos >= 0); 3260Debug.Assert(node.Str is not null); 3266Debug.Assert(str.Length >= 2); 3267Debug.Assert(!clauseOnly || (!emitLengthCheck && !rightToLeft)); 3271Debug.Assert(emitLengthCheck); 3328Debug.Assert(node.M < node.N); 3469Debug.Assert(node.M < node.N); 3797Debug.Assert(sliceStaticPos == 0); 3863Debug.Assert(entriesPerIteration >= 1); 4133Debug.Assert(node.N > node.M); 4250Debug.Assert(node.M == 0 && node.N == 1); 4425Debug.Assert(sliceStaticPos == 0); 4558Debug.Assert(startingStackpos is not null); 4689Debug.Assert(args.Length is >= 1); 4741Debug.Assert(args.Length is >= 1); 5177Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive);
RegexGenerator.Parser.cs (1)
128Debug.Assert(regexMemberSymbol is IPropertySymbol);
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
src\libraries\System.Private.CoreLib\src\System\Collections\Generic\ValueListBuilder.cs (5)
31Debug.Assert(value >= 0); 32Debug.Assert(value <= _span.Length); 41Debug.Assert(index < _pos); 109Debug.Assert(length >= 0); 137Debug.Assert(_pos == _span.Length);
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\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (14)
337Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i)); 409Debug.Assert(!set.IsEmpty); 701Debug.Assert(c != 0); 869Debug.Assert(count <= evaluated); 913Debug.Assert(set1Negated == set2Negated); 947Debug.Assert(!IsNegated(set1) && !IsNegated(set2)); 998Debug.Assert((uint)comparison <= char.MaxValue); 1063Debug.Assert(twoChars.Length >= 2); 1149Debug.Assert(!hasSubtraction); 1278Debug.Assert(ch < 128); 1296Debug.Assert(ch < 128); 1467Debug.Assert(curcat < 0); 1552Debug.Assert(chars[index] < chars[index + 1]); 1616Debug.Assert(i == span.Length);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexFindOptimizations.cs (4)
112Debug.Assert(!RegexCharClass.IsNegated(charClass)); 119Debug.Assert(!RegexCharClass.IsNegated(charClass) || chars is null); 172Debug.Assert(fixedDistanceSets is null || fixedDistanceSets.Count != 0); 354Debug.Assert(chars is { Length: 1 });
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (60)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or 92Debug.Assert(M > 0); 115Debug.Assert(culture is not null); 332Debug.Assert(rootNode.Kind == RegexNodeKind.Capture); 333Debug.Assert(rootNode.Parent is null); 334Debug.Assert(rootNode.ChildCount() == 1); 560Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate); 577Debug.Assert(Kind == RegexNodeKind.Group); 582Debug.Assert(u.ChildCount() == 1); 605Debug.Assert(Kind == RegexNodeKind.Atomic); 606Debug.Assert(ChildCount() == 1); 647Debug.Assert(branches is not null && branches.Count != 0); 767Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 876Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy); 877Debug.Assert(!string.IsNullOrEmpty(Str)); 925Debug.Assert(Kind == RegexNodeKind.Alternate); 1077Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1078Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1098Debug.Assert(children[startingIndex].Children is List<RegexNode> { Count: >= 2 }); 1172Debug.Assert(node.Kind == RegexNodeKind.Alternate); 1173Debug.Assert(node.ChildCount() >= 2); 1215Debug.Assert(alternation.Kind == RegexNodeKind.Alternate); 1216Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 }); 1247Debug.Assert(startingSpan.Length > 0); 1276Debug.Assert(startingNode.Kind == RegexNodeKind.Multi); 1277Debug.Assert(startingNode.Str!.Length > 0); 1300Debug.Assert(startingSpan.Length > 0); 1323Debug.Assert(startingSpan.Length == 1); 1324Debug.Assert(startingSpan[0] == node.Ch); 1330Debug.Assert(node.Kind == RegexNodeKind.Multi); 1331Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal)); 1385Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0)); 1386Debug.Assert((Options & RegexOptions.RightToLeft) == 0); 1445Debug.Assert(lowInclusive < highInclusive); 1481Debug.Assert(@string is not null); 1487Debug.Assert(setChars is not null); 1500Debug.Assert(Kind == RegexNodeKind.Concatenate); 1542Debug.Assert(Kind == RegexNodeKind.Concatenate); 1543Debug.Assert(Children is List<RegexNode>); 1625Debug.Assert(Kind == RegexNodeKind.Concatenate); 1626Debug.Assert(Children is List<RegexNode>); 1736Debug.Assert(matchingCharsInMulti < nextNode.Str.Length); 1830Debug.Assert(Children is List<RegexNode>); 1935Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop); 1969Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround); 1970Debug.Assert(ChildCount() == 1); 1997Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional); 1998Debug.Assert(ChildCount() is 1 or 2); 2015Debug.Assert(Kind == RegexNodeKind.ExpressionConditional); 2016Debug.Assert(ChildCount() is 2 or 3); 2069Debug.Assert(subsequent.Kind != RegexNodeKind.Group); 2293Debug.Assert(childCount >= 2); 2326Debug.Assert(ChildCount() == 1); 2410Debug.Assert(childCount >= 2); 2464Debug.Assert(ChildCount() == 1); 2693Debug.Assert(max >= 2); 2738Debug.Assert(Children is List<RegexNode>); 2749Debug.Assert(Children != null); 2750Debug.Assert(index < ChildCount()); 2780Debug.Assert(Children is RegexNode);
src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexPrefixAnalyzer.cs (6)
247Debug.Assert(childCount >= 2); // otherwise it would have been optimized out 266Debug.Assert(alternateBranchResults.Count > 0); 773Debug.Assert(sameDistance.HasValue); 813Debug.Assert(!s2Negated); 1129Debug.Assert(node.ChildCount() >= 2); 1175Debug.Assert(
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 (2)
112Debug.Assert(syntaxNodeForDiagnostic != null); 144Debug.Assert(syntaxNodeForDiagnostic is not null);
UpgradeToGeneratedRegexCodeFixer.cs (2)
151Debug.Assert(typeDeclarationOrCompilationUnit is not null); 284Debug.Assert(parameterName is UpgradeToGeneratedRegexAnalyzer.OptionsArgumentName or UpgradeToGeneratedRegexAnalyzer.PatternArgumentName);
System.Threading (76)
System\Threading\Barrier.cs (2)
511Debug.Assert(result); 735Debug.Assert(phase < CurrentPhaseNumber);
System\Threading\CountdownEvent.cs (2)
176Debug.Assert(_event != null); 219Debug.Assert(_event != null);
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.Channels (17)
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 (4)
221Debug.Assert(_executionContext == null); 228Debug.Assert(_schedulingContext == null); 291Debug.Assert(ts != null); 317Debug.Assert(_registration == default);
System\Threading\Channels\BoundedChannel.cs (2)
48Debug.Assert(bufferedCapacity > 0); 246Debug.Assert(Monitor.IsEntered(parent.SyncObj));
System\Threading\Channels\ChannelUtilities.cs (3)
59Debug.Assert(error != null); 99Debug.Assert(completed || c.CancellationToken.CanBeCanceled); 112Debug.Assert(error != null);
System\Threading\Channels\SingleConsumerUnboundedChannel.cs (1)
332Debug.Assert(blockedReader != null);
System\Threading\Channels\UnboundedPriorityChannel.cs (1)
141Debug.Assert(Monitor.IsEntered(parent.SyncObj));
System.Threading.RateLimiting (42)
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)
144Debug.Assert(_options.QueueLimit >= _queueCount); 154Debug.Assert(_queueCount >= 0); 188Debug.Assert(_queueCount <= _options.QueueLimit); 215Debug.Assert(_permitCount >= 0); 243Debug.Assert(_permitCount <= _options.PermitLimit); 281Debug.Assert(_permitCount >= 0); 306Debug.Assert(_queueCount >= 0); 316Debug.Assert(_idleSince is null); 382Debug.Assert(count == 0 ? limiter is null : true);
System\Threading\RateLimiting\FixedWindowRateLimiter.cs (8)
162Debug.Assert(_options.QueueLimit >= _queueCount); 172Debug.Assert(_queueCount >= 0); 206Debug.Assert(_queueCount <= _options.QueueLimit); 242Debug.Assert(_permitCount >= 0); 273Debug.Assert(limiter is not null); 338Debug.Assert(_permitCount >= 0); 361Debug.Assert(_queueCount >= 0); 372Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\SlidingWindowRateLimiter.cs (9)
174Debug.Assert(_options.QueueLimit >= _queueCount); 184Debug.Assert(_queueCount >= 0); 218Debug.Assert(_queueCount <= _options.QueueLimit); 246Debug.Assert(_permitCount >= 0); 279Debug.Assert(limiter is not null); 318Debug.Assert(_permitCount <= _options.PermitLimit); 350Debug.Assert(_permitCount >= 0); 374Debug.Assert(_queueCount >= 0); 385Debug.Assert(_idleSince is null);
System\Threading\RateLimiting\TokenBucketRateLimiter.cs (10)
167Debug.Assert(_options.QueueLimit >= _queueCount); 177Debug.Assert(_queueCount >= 0); 211Debug.Assert(_queueCount <= _options.QueueLimit); 222Debug.Assert(_options.TokensPerPeriod > 0); 249Debug.Assert(_tokenCount >= 0); 280Debug.Assert(limiter is not null); 324Debug.Assert(_tokenCount <= _options.TokenLimit); 352Debug.Assert(_tokenCount >= 0); 375Debug.Assert(_queueCount >= 0); 386Debug.Assert(_idleSince is null);
System.Threading.Tasks.Dataflow (7)
Blocks\ActionBlock.cs (5)
136Debug.Assert(_defaultTarget != null); 160Debug.Assert(_defaultTarget != null); 206Debug.Assert(_defaultTarget != null); 232Debug.Assert(_spscTarget != null); 251Debug.Assert(_spscTarget != null);
Blocks\TransformManyBlock.IAsyncEnumerable.cs (1)
43t.ContinueWith(static t => Debug.Assert(t.IsCompletedSuccessfully), CancellationToken.None, TaskContinuationOptions.ExecuteSynchronously, TaskScheduler.Default);
Internal\SourceCore.cs (1)
371Debug.Assert(items != null);
System.Threading.Tasks.Parallel (26)
System\Threading\Tasks\Parallel.cs (7)
923Debug.Assert(typeof(TInt) == typeof(int) || typeof(TInt) == typeof(long)); 1024Debug.Assert(sharedPStateFlags != null); 1029Debug.Assert(sharedPStateFlags != null); 1703Debug.Assert(array != null); 1762Debug.Assert(list != null); 2821Debug.Assert(exObj is Exception); 2833Debug.Assert(first is OperationCanceledException);
System\Threading\Tasks\Parallel.ForEachAsync.cs (11)
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); 653Debug.Assert(!Cancellation.IsCancellationRequested);
System\Threading\Tasks\ParallelLoopState.cs (3)
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 (110)
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\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 (10)
93Debug.Assert(this is RecoveringInternalEnlistment); 103Debug.Assert(this is PromotableInternalEnlistment); 142Debug.Assert(_twoPhaseState != null); 234Debug.Assert(Transaction._phase0Volatiles._preparedVolatileEnlistments <= 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 (7)
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 (3)
300Debug.Assert(tx.PromotedTransaction != null); 304Debug.Assert(tx.State! != null); 355Debug.Assert(_committableTransaction != null);
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\TransactionScope.cs (7)
538Debug.Assert(_threadContextData != null); 559Debug.Assert(rollbackTransaction != null); 792Debug.Assert(rollbackTransaction != null); 818Debug.Assert(_expectedCurrent != null); 938Debug.Assert(ContextKey != null); 985Debug.Assert(_savedCurrentScope.ContextKey != null); 1027Debug.Assert(_threadContextData != null);
System\Transactions\TransactionState.cs (33)
615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0); 618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 664Debug.Assert(tx.promotedToken != null); 845Debug.Assert(tx._promoter != null); 1183Debug.Assert(tx._committableTransaction != null); 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); 2065Debug.Assert(tx.PromotedTransaction != null); 2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2255Debug.Assert(tx.PromotedTransaction != null); 2271Debug.Assert(tx.PromotedTransaction != null); 2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null); 2300Debug.Assert(tx.State != null); 2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2649Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2766Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null); 2777Debug.Assert(tx.PromotedTransaction != null); 2808Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null); 2894Debug.Assert(tx.PromotedTransaction != null); 3364Debug.Assert(tx._durableEnlistment != null); 3535Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <= 3554Debug.Assert(tx._phase1Volatiles._dependentClones >= 0); 3746Debug.Assert(tx._committableTransaction != null); 3847Debug.Assert(tx._durableEnlistment != null); 4307Debug.Assert(tx.PromotedTransaction != null); 4422Debug.Assert(tx._promoter != null); 4616Debug.Assert(tx._durableEnlistment != null); 4652Debug.Assert(tx._durableEnlistment != null);
System\Transactions\TransactionTable.cs (2)
332Debug.Assert(lastBucketSet != null); 377Debug.Assert(tx._tableBucket != null);
System\Transactions\VolatileEnlistmentMultiplexing.cs (8)
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);
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 (7)
src\libraries\Common\src\System\HexConverter.cs (1)
166Debug.Assert(chars.Length >= bytes.Length * 2);
src\libraries\Common\src\System\Text\ValueStringBuilder.cs (5)
38Debug.Assert(value >= 0); 39Debug.Assert(value <= _chars.Length); 49Debug.Assert(capacity >= 0); 85Debug.Assert(index < _pos); 297Debug.Assert(additionalCapacityBeyondPos > 0);
System\Web\Util\HttpEncoder.cs (1)
632Debug.Assert(!_byteBuffer.IsEmpty);
System.Windows.Controls.Ribbon (57)
Microsoft\Windows\Controls\KeyTipAdorner.cs (1)
93Debug.Assert(_keyTipControl == null && keyTipControl.KeyTipAdorner == null);
Microsoft\Windows\Controls\KeyTipService.cs (3)
241Debug.Assert(element != null); 1112Debug.Assert(_currentGlobalScope != null); 1176Debug.Assert(_scopeStack.Count > 0);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryCategoriesPanel.cs (1)
143Debug.Assert(IsScrolling);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGalleryItemsPanel.cs (1)
331Debug.Assert(maxColumnCount >= minColumnCount);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonGroupsPanel.cs (4)
437Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0)); 475Debug.Assert(index >= 0 && index < starInfoList.Count); 502Debug.Assert(distributionCount > 0 && distributionCount <= starInfoList.Count); 503Debug.Assert(DoubleUtil.GreaterThan(remainingSpace, 0));
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonQuickAccessToolBarPanel.cs (15)
184Debug.Assert(generatedChild != null); 306Debug.Assert(GeneratedChildren.Count > InternalChildren.Count); 308Debug.Assert(QAT.OverflowPanel.Children.Count == numItemsExpectedInOverflowPanel); 314Debug.Assert(object.ReferenceEquals(InternalChildren[j], GeneratedChildren[j])); 316Debug.Assert(currentChild != null); 317Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild) == false); 318Debug.Assert(this.Children.Contains(currentChild) == true); 319Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild) == false); 320Debug.Assert(currentChild.IsVisible == this.IsVisible); 321Debug.Assert(currentChild.DesiredSize.Width > 0.0); 328Debug.Assert(object.ReferenceEquals(QAT.OverflowPanel.Children[overflowPanelIndex], GeneratedChildren[k])); 330Debug.Assert(currentChild != null); 331Debug.Assert(RibbonQuickAccessToolBar.GetIsOverflowItem(currentChild) == true); 332Debug.Assert(this.Children.Contains(currentChild) == false); 333Debug.Assert(QAT.OverflowPanel.Children.Contains(currentChild) == true);
Microsoft\Windows\Controls\Ribbon\Primitives\RibbonTabHeadersPanel.cs (3)
247Debug.Assert(ribbon.TabDisplayIndexToIndexMap.ContainsKey(i)); 249Debug.Assert(children.Count > index && index >= 0); 733Debug.Assert(child != null);
Microsoft\Windows\Controls\Ribbon\RibbonComboBox.cs (1)
623Debug.Assert(_editableTextBoxSite == sender);
Microsoft\Windows\Controls\Ribbon\RibbonControlLengthConverter.cs (1)
234Debug.Assert(unit == RibbonControlLengthUnitType.Pixel || unit == RibbonControlLengthUnitType.Item ||
Microsoft\Windows\Controls\Ribbon\RibbonGallery.cs (6)
104Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 112Debug.Assert(_filterMenuButton.ItemContainerGenerator != null); 1490Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText"); 2357Debug.Assert(gallery.ItemContainerGenerator.Status == GeneratorStatus.ContainersGenerated); 2651Debug.Assert(e.RoutedEvent == Mouse.MouseMoveEvent || e.RoutedEvent == Mouse.MouseLeaveEvent); 2652Debug.Assert(_localMousePosition.HasValue);
Microsoft\Windows\Controls\Ribbon\RibbonGroup.cs (1)
1167Debug.Assert(groupSizeDefinition != null && groupSizeDefinition.IsCollapsed);
Microsoft\Windows\Controls\Ribbon\RibbonHelper.cs (7)
207Debug.Assert(property != null); 213Debug.Assert(d != null); 214Debug.Assert(property != null); 215Debug.Assert(v != null); 997Debug.Assert(element != null); 1362Debug.Assert(starLayoutProvider != null); 2472Debug.Assert(parentItemsControl != null);
Microsoft\Windows\Controls\Ribbon\RibbonKeyTipAndContentSyncHelper.cs (5)
32Debug.Assert(element != null); 74Debug.Assert(element != null); 94Debug.Assert(element != null); 119Debug.Assert(element != null); 138Debug.Assert(element != null);
Microsoft\Windows\Controls\Ribbon\RibbonMenuButton.cs (3)
1479Debug.Assert(GetType().IsSubclassOf(type)); // RibbonMenuButton is a subclass of MenuBase 1483Debug.Assert(property != null); 1488Debug.Assert(method != null);
Microsoft\Windows\Controls\Ribbon\RibbonTab.cs (1)
451Debug.Assert(resizeStatusCount > 0);
Microsoft\Windows\Controls\Ribbon\RibbonTwoLineText.cs (2)
338Debug.Assert(_textBlock1 != null && _textBlock2 != null); 372Debug.Assert(_textBlock1 != null && _textBlock2 != null);
Microsoft\Windows\Controls\TextSearchInternal.cs (2)
802Debug.Assert(_attachedTo != null); 817Debug.Assert(_attachedTo != null);
System.Windows.Forms (1467)
System\Resources\ResXDataNode.cs (3)
158Debug.Assert(_name is not null || _nodeInfo?.Name is not null); 177Debug.Assert(FileRefType is not null); 490Debug.Assert(FileRef is not null);
System\Resources\ResXResourceReader.cs (6)
238Debug.Assert(_resData is null && _resMetadata is null); 262Debug.Assert(contentReader is not null); 341Debug.Assert(_resData is not null); 342Debug.Assert(_resMetadata is not null); 527Debug.Assert(_resData is not null); 528Debug.Assert(_resMetadata is not null);
System\Windows\Forms\Accessibility\AccessibleObject.cs (1)
1019Debug.Assert(result.IsEmpty || result.vt == VARENUM.VT_I4);
System\Windows\Forms\ActiveX\AxHost.AxContainer.cs (4)
351Debug.Assert(_components is not null); 377Debug.Assert(_components is not null); 583Debug.Assert(_parent is not null); 670Debug.Assert(hr.Succeeded);
System\Windows\Forms\ActiveX\AxHost.State.cs (1)
205Debug.Assert(_buffer is not null);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.PropertyBagStream.cs (2)
63Debug.Assert(_bag[name] is string); 75Debug.Assert(pVar->vt == VARENUM.VT_BSTR);
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (1)
538Debug.Assert(hr.Succeeded);
System\Windows\Forms\Application.cs (3)
332Debug.Assert(success); 1273Debug.Assert(process is not null); 1279Debug.Assert(arguments is not null && arguments.Length > 0);
System\Windows\Forms\Application.LightThreadContext.cs (1)
32Debug.Assert(uReason != msoloop.FocusWait);
System\Windows\Forms\ApplicationContext.cs (1)
140Debug.Assert(sender is Form);
System\Windows\Forms\BinaryFormat\WinFormsBinaryFormatWriter.cs (1)
25Debug.Assert(success);
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\COM2PropertyDescriptor.cs (1)
152Debug.Assert(_baseAttributes is not null);
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\Control.cs (1)
10692Debug.Assert(scaledFont is not null);
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.ComboBoxAccessibleObject.cs (1)
134Debug.Assert(index < entries.Count);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxUiaTextProvider.cs (1)
35Debug.Assert(_owningComboBox.IsHandleCreated);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (3)
2020Debug.Assert((ModifierKeys & Keys.Alt) == 0); 2038Debug.Assert((ModifierKeys & Keys.Alt) == 0); 3174Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList);
System\Windows\Forms\Controls\DataGridView\DataGridView.AccessibleObject.cs (1)
66Debug.Assert(GetChildCount() == 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.cs (47)
1138Debug.Assert(dataGridViewCell is not null); 1706Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.Y >= 0); 1707Debug.Assert(_ptCurrentCell.X < Columns.Count); 1708Debug.Assert(_ptCurrentCell.Y < Rows.Count); 1775Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count); 1776Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count); 1778Debug.Assert(dataGridViewRow is not null); 1780Debug.Assert(IsSharedCellVisible(dataGridViewCell, _ptCurrentCell.Y)); 1794Debug.Assert(_ptCurrentCell.Y != -1); 1812Debug.Assert(_ptCurrentCell.Y != -1); 1830Debug.Assert(_ptCurrentCell.Y != -1); 1848Debug.Assert(_ptCurrentCell.Y >= 0); 1849Debug.Assert(_ptCurrentCell.Y < Rows.Count); 2301Debug.Assert(firstDisplayedCell.RowIndex >= 0 2337Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows == 0); 2345Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == -1); 2346Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows == 0); 2347Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows == 0); 2399Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol == -1); 2402Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg1 || !Visible || DisplayedBandsInfo.Dirty); 2403Debug.Assert(firstDisplayedColumnIndex == firstDisplayedColumnIndexDbg2 || DisplayedBandsInfo.Dirty); 2471Debug.Assert(totalVisibleFrozenWidth > 0); 2501Debug.Assert(success); 2503Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 2504Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol == value 2551Debug.Assert(totalVisibleFrozenHeight > 0); 2576Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 2581Debug.Assert(rowsToScroll != 0); 2591Debug.Assert(success); 2756Debug.Assert(Columns.DisplayInOrder(DisplayedBandsInfo.FirstDisplayedScrollingCol, oldFirstVisibleScrollingCol)); 2801Debug.Assert(_horizontalOffset == 0); 2917Debug.Assert(dataGridViewCell is not null); 2918Debug.Assert(rowIndex >= 0); 2928Debug.Assert(dataGridViewCell is not null); 2929Debug.Assert(rowIndex >= 0); 2938Debug.Assert(dataGridViewCell is not null); 2939Debug.Assert(rowIndex >= 0); 3020Debug.Assert(value >= 0); 3108Debug.Assert(_individualReadOnlyCells.Count == 0); 3111Debug.Assert(!Columns[columnIndex].ReadOnly); 3117Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.ReadOnly) == 0); 3399Debug.Assert(_rowHeaderWidth != value); 3400Debug.Assert(value >= MinimumRowHeadersWidth); 3599Debug.Assert(HorizontalOffset == 0); 3600Debug.Assert(VerticalOffset == 0); 3887Debug.Assert(_ptCurrentCell.Y >= 0); 3895Debug.Assert(_ptCurrentCell.Y >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (22)
148Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_cancellingRowEdit]); 274Debug.Assert(_props is not null); 311Debug.Assert(sortProperty is null); 327Debug.Assert(_props is not null); 474Debug.Assert(CurrencyManager?.List is not null); 492Debug.Assert(CurrencyManager?.List is not null); 508Debug.Assert(CurrencyManager.List.Count == 1); 513Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew]); 551Debug.Assert(CurrencyManager?.List is not null); 681Debug.Assert(_owner.CurrentCellAddress.X == -1); 736Debug.Assert(CurrencyManager?.List is not null); 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); 828Debug.Assert(CurrencyManager?.List is not null); 837Debug.Assert(_owner.NewRowIndex == CurrencyManager.List.Count - 1); 1141Debug.Assert(rowIndex >= 0); 1174Debug.Assert(rowIndex >= 0); 1222Debug.Assert(dataGridViewColumn is not null); 1229Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (750)
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) == 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); 2107Debug.Assert(_noAutoSizeCount > 0); 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); 2677Debug.Assert(EditingControl is not null); 2691Debug.Assert(EditingControl is not null); 2692Debug.Assert(_editingPanel is not null); 2695Debug.Assert(dgvese.CellStyle is not null); 2762Debug.Assert(_lastColSplitBar == -1); 2785Debug.Assert(_lastRowSplitBar == -1); 2792Debug.Assert(inheritedCellStyle is not null); 2798Debug.Assert(cellStyle is not null); 2802Debug.Assert(columnHeadersStyle is not null); 2805Debug.Assert(dataGridViewStyle is not null); 2923Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2937Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 3043Debug.Assert(_ptCurrentCell.Y != -1); 3076Debug.Assert(success); 3092Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3094Debug.Assert(dataGridViewEditingCell is not null); 3127Debug.Assert(dataGridViewEditingCell is not null); 3135Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0)); 3152Debug.Assert(success); 3180Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3212Debug.Assert(Rows.GetFirstRow(DataGridViewElementStates.Visible) == 0); 3253Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3318Debug.Assert(dataGridViewCurrentCell.OwningColumn is not null); 3447Debug.Assert(_noDimensionChangeCount >= 0); 3585Debug.Assert(_noDimensionChangeCount >= 0); 3612Debug.Assert(firstVisibleFrozenColumn is not null); 3618Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index)); 3651Debug.Assert(hti._col != -1); 3702Debug.Assert(hti._col != -1); 3762Debug.Assert(_ptCurrentCell.X > -1); 3866Debug.Assert(((EditingControl is not null && ((IDataGridViewEditingControl)EditingControl).EditingControlValueChanged) 3877Debug.Assert(_ptCurrentCell.X > -1); 3910Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 3948Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 4024Debug.Assert(_ptCurrentCell.X > -1); 4147Debug.Assert(columnIndex < Columns.Count); 4170Debug.Assert(success); 4188Debug.Assert(dataGridViewRow is not null); 4248Debug.Assert(cx <= _horizontalOffset); 4337Debug.Assert(rowIndex < DisplayedBandsInfo.FirstDisplayedScrollingRow); 4393Debug.Assert(insideLeft.Height >= 0); 4415Debug.Assert(insideLeft.Width >= 0); 4434Debug.Assert(colHeaders.Width >= 0); 4476Debug.Assert(newLayout.Data.X >= 0); 4477Debug.Assert(newLayout.Data.Y >= 0); 4478Debug.Assert(newLayout.Data.Width >= 0); 4479Debug.Assert(newLayout.Data.Height >= 0); 4487Debug.Assert(!_layout._dirty); 4521Debug.Assert(oldNumTotallyVisibleFrozenRows == DisplayedBandsInfo.NumTotallyDisplayedFrozenRows); 4522Debug.Assert(oldNumVisibleScrollingRows == DisplayedBandsInfo.NumDisplayedScrollingRows); 4523Debug.Assert(oldNumTotallyVisibleScrollingRows == DisplayedBandsInfo.NumTotallyDisplayedScrollingRows); 4524Debug.Assert(oldFirstVisibleScrollingRow == DisplayedBandsInfo.FirstDisplayedScrollingRow); 4530Debug.Assert(newFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4535Debug.Assert(oldLastTotallyVisibleScrollingCol == DisplayedBandsInfo.LastTotallyDisplayedScrollingCol); 4536Debug.Assert(oldFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol); 4547Debug.Assert(_vertScrollBar.Maximum > 0); 4562Debug.Assert(VerticalScrollingOffset == _vertScrollBar.Value); 4614Debug.Assert(cx <= Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 4657Debug.Assert(firstDisplayedScrollingCol >= 0); 4679Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4699Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0); 4705Debug.Assert(dataGridViewColumn.Thickness > displayWidth - cx); 4712Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == GetNegOffsetFromHorizontalOffset(_horizontalOffset)); 4732Debug.Assert(jumpFromFirstVisibleScrollingCol >= -1); 4740Debug.Assert(firstDisplayedScrollingCol >= 0); 4763Debug.Assert((DisplayedBandsInfo.NumDisplayedScrollingCols > 0 && DisplayedBandsInfo.FirstDisplayedScrollingCol != -1) 4793Debug.Assert(cy < displayHeight); 4887Debug.Assert(lastDisplayedScrollingRow == -1); 4939Debug.Assert(dataGridViewColumn.DataGridView is null); 4940Debug.Assert(dataGridViewColumn.Index >= 0); 4941Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4958Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 4973Debug.Assert(dataGridViewColumn.DataGridView == this); 4975Debug.Assert(dataGridViewColumn.DisplayIndex >= 0); 4992Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 5007Debug.Assert(anticipatedColumnIndex >= 0 && anticipatedColumnIndex <= Columns.Count); 5016Debug.Assert(dataGridViewColumn.DisplayIndex >= 0 && dataGridViewColumn.DisplayIndex <= Columns.Count); 5136Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 5137Debug.Assert(!_dataGridViewOper[OperationInDisplayIndexAdjustments]); 5199Debug.Assert(Columns[columnIndex].Index == columnIndex); 5206Debug.Assert(insertionCount > 0); 5217Debug.Assert(CurrentCellInternal is not null); 5224Debug.Assert(dataGridViewRow is not null); 5225Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count); 5291Debug.Assert(dataGridViewRow is not null); 5352Debug.Assert(rowIndexDeleted >= 0); 5360Debug.Assert(dataGridViewRow.Index == rowIndex); 5377Debug.Assert(rowIndexInserted >= 0); 5378Debug.Assert(insertionCount > 0); 5386Debug.Assert(dataGridViewRow.Index == rowIndex); 5454Debug.Assert(Rows.Count > 1); 5455Debug.Assert(NewRowIndex != -1); 5465Debug.Assert(NewRowIndex == Rows.Count - 1); 5468Debug.Assert(dataGridViewRow.Index == -1); 5473Debug.Assert(NewRowIndex == -1); 5478Debug.Assert((Rows.GetRowState(NewRowIndex) & DataGridViewElementStates.Visible) != 0); 5479Debug.Assert(_ptCurrentCell.Y == NewRowIndex); 5549Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 5615Debug.Assert(NoSelectionChangeCount == 0); 5738Debug.Assert(_editingPanel is not null); 5739Debug.Assert(_ptCurrentCell.X != -1); 5951Debug.Assert(sender == EditingControl || sender == _editingPanel); 5952Debug.Assert(_ptCurrentCell.X != -1); 5961Debug.Assert(sender == EditingControl || sender == _editingPanel); 5962Debug.Assert(_ptCurrentCell.X != -1); 5971Debug.Assert(sender == EditingControl || sender == _editingPanel); 5977Debug.Assert(sender == EditingControl || sender == _editingPanel); 5983Debug.Assert(sender == EditingControl || sender == _editingPanel); 5989Debug.Assert(sender == EditingControl || sender == _editingPanel); 5992Debug.Assert(EditingControl is not null); 5993Debug.Assert(!_dataGridViewState1[State1_CustomCursorSet]); 6009Debug.Assert(sender == EditingControl || sender == _editingPanel); 6012Debug.Assert(EditingControl is not null); 6031Debug.Assert(sender == EditingControl || sender == _editingPanel); 6037Debug.Assert(sender == EditingControl || sender == _editingPanel); 6127Debug.Assert(proposed >= Columns[_trackColumn].MinimumThickness); 6128Debug.Assert(proposed <= DataGridViewBand.MaxBandThickness); 6239Debug.Assert(_editingPanel is null || _editingPanel.Controls.Count == 0); 6253Debug.Assert(success); 6266Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 6343Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 6395Debug.Assert(rowIndex >= 0); 6396Debug.Assert(rowIndex < Rows.Count); 6397Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 6398Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Frozen) == 0); 6434Debug.Assert(numDisplayedScrollingRows > 0); 6437Debug.Assert(rowIndexTmp != -1); 6450Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 6478Debug.Assert(rowIndexTmp != -1); 6502Debug.Assert(firstDisplayedFrozenRowIndex != -1); 6638Debug.Assert(numDisplayedScrollingCols > 0); 6642Debug.Assert(dataGridViewColumnTmp is not null); 6655Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol != -1); 6683Debug.Assert(dataGridViewColumnTmp is not null); 6984Debug.Assert(rowIndex >= 0); 6985Debug.Assert(dataGridViewCell.OwningColumn is not null); 7107Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count); 7108Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count); 7112Debug.Assert(dataGridViewRow is not null); 7293Debug.Assert(rowIndex != -1); 7820Debug.Assert(firstVisibleColumn is not null); 7821Debug.Assert(lastVisibleColumn is not null); 7845Debug.Assert(firstVisibleRowIndex != -1); 7846Debug.Assert(lastVisibleRowIndex != -1); 7894Debug.Assert(lRowIndex != -1); 7895Debug.Assert(uRowIndex != -1); 7896Debug.Assert(lColumn is not null); 7897Debug.Assert(uColumn is not null); 7898Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index)); 7899Debug.Assert(lRowIndex <= uRowIndex); 7924Debug.Assert(prevDataGridViewColumn is not null); 7987Debug.Assert(nextDataGridViewColumn is not null); 8016Debug.Assert(rowIndex != -1); 8022Debug.Assert(nextRowIndex != -1); 8039Debug.Assert(prevDataGridViewColumn is not null); 8109Debug.Assert(nextDataGridViewColumn is not null); 8188Debug.Assert(destinationBytes[97] == '<'); 8189Debug.Assert(destinationBytes[bytecountEndOfHtml - 1] == '>'); 8190Debug.Assert(destinationBytes[133] == '<'); 8191Debug.Assert(destinationBytes[bytecountEndOfFragment] == '<'); 8205Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 8387Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 8420Debug.Assert(xOffset > 0); 8455Debug.Assert(index < Columns.Count); 8456Debug.Assert(Columns[index].Visible); 8497Debug.Assert(dataGridViewColumn!.Visible && !dataGridViewColumn.Frozen); 8574Debug.Assert(!_vertScrollBar.Enabled 8607Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8643Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8654Debug.Assert(mouseY > rectScrollingArea.Bottom); 8699Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 8750Debug.Assert((!RightToLeftInternal && mouseX > rectScrollingArea.Right) || (RightToLeftInternal && mouseX < rectScrollingArea.Left)); 8824Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 8866Debug.Assert(mouseY >= rectScrollingArea.Top && mouseY <= rectScrollingArea.Bottom); 8967Debug.Assert(mouseX >= rectScrollingArea.Left && mouseX <= rectScrollingArea.Right); 9035Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9143Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9167Debug.Assert(yOffset > 0); 9200Debug.Assert(index >= 0 && index < Rows.Count); 9201Debug.Assert((Rows.GetRowState(index) & DataGridViewElementStates.Visible) != 0); 9237Debug.Assert(indexTmp != -1); 9242Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0 9259Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1); 9349Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9423Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9490Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col)); 9491Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row)); 9611Debug.Assert(rowIndex >= 0); 9632Debug.Assert(_dataGridViewOper[OperationTrackColSelect] || _dataGridViewOper[OperationTrackCellSelect]); 9643Debug.Assert(_horizScrollTimer is not null); 9698Debug.Assert(_ptCurrentCell.X == dataGridViewCell.ColumnIndex); 9726Debug.Assert(EditingControl is not null); 9777Debug.Assert(dataGridViewCell.DataGridView == this); 9817Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 9861Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 9889Debug.Assert(lo <= hi); 9890Debug.Assert(lo < Rows.Count); 9891Debug.Assert(hi < Rows.Count); 9921Debug.Assert(lo <= hi); 9922Debug.Assert(lo > -1); 10180Debug.Assert(_layout.Data.Height >= 0); 10203Debug.Assert(_layout.RowHeaders.Height >= 0); 10224Debug.Assert(_layout.Data.Width >= 0); 10233Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10270Debug.Assert(_layout.Data.Height >= 0); 10281Debug.Assert(_layout.Data.Width >= 0); 10290Debug.Assert(_layout.ColumnHeaders.Width >= 0); 10319Debug.Assert(_horizScrollBar.Maximum > 0); 10361Debug.Assert(_vertScrollBar.Maximum > 0); 10403Debug.Assert(success); 10535Debug.Assert(dataGridViewColumn.Index >= 0); 10536Debug.Assert(dataGridViewColumn.DataGridView == this); 10555Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 10588Debug.Assert(rowIndex >= 0); 10594Debug.Assert(rowIndex == Rows.Count - 1); 10604Debug.Assert(!dataGridViewCell.Selected); 10605Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue); 10615Debug.Assert(dataGridViewCell.OwningColumn is not null); 10626Debug.Assert(rowIndex >= 0); 10840Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 10854Debug.Assert(weightSum <= ushort.MaxValue); 10857Debug.Assert(dataGridViewColumns is not null); 10919Debug.Assert(weightSum <= ushort.MaxValue); 10942Debug.Assert(dataGridViewColumn.CellType is not null); 10960Debug.Assert(dataGridViewColumn.CellType is not null); 11037Debug.Assert(dataGridViewRows is not null); 11077Debug.Assert(!AllowUserToAddRowsInternal); 11167Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11250Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11306Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 11737Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11755Debug.Assert(_noDimensionChangeCount >= 0); 11761Debug.Assert(dataGridViewCell.RowIndex >= -1); 11762Debug.Assert(dataGridViewCell.ColumnIndex >= -1); 11777Debug.Assert(columnIndex >= 0); 11778Debug.Assert(rowIndex >= 0); 11825Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 11843Debug.Assert(_noDimensionChangeCount >= 0); 11908Debug.Assert(hti.Type is not DataGridViewHitTestType.None 11911Debug.Assert(_ptMouseDownCell.X == hti._col); 11912Debug.Assert(_ptMouseDownCell.Y == hti._row); 11960Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 12067Debug.Assert(hti.Type == DataGridViewHitTestType.Cell); 12144Debug.Assert(MultiSelect || _individualSelectedCells.Count <= 1); 12193Debug.Assert(success); 12216Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12272Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 12282Debug.Assert(success); 12299Debug.Assert(_selectedBandIndexes.Count <= 1); 12372Debug.Assert(_selectedBandIndexes.Count <= 1); 12394Debug.Assert(success); 12419Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 12470Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 12477Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 12487Debug.Assert(success); 12505Debug.Assert(_selectedBandIndexes.Count <= 1); 12578Debug.Assert(_selectedBandIndexes.Count <= 1); 12689Debug.Assert(hti.Type is not DataGridViewHitTestType.None 12701Debug.Assert(!_dataGridViewState2[State2_MessageFromEditingCtrls]); 12766Debug.Assert(MultiSelect); 12800Debug.Assert(success); 12816Debug.Assert(dataGridViewCell.RowIndex >= 0); 12860Debug.Assert(dataGridViewCellStyle is not null); 13061Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13083Debug.Assert(_noDimensionChangeCount >= 0); 13107Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 13133Debug.Assert(_noDimensionChangeCount >= 0); 13368Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex); 13426Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13428Debug.Assert(Columns.VerifyColumnDisplayIndexes()); 13436Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]); 13539Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 13618Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.None); 13619Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Fill); 13652Debug.Assert(SortOrder != SortOrder.None); 13678Debug.Assert(hti.Type == DataGridViewHitTestType.ColumnHeader); 13778Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 13808Debug.Assert(_individualSelectedCells.Count == 0); 13852Debug.Assert(success); 13864Debug.Assert(success); 13875Debug.Assert(success); 13880Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 13885Debug.Assert(_selectedBandIndexes.Contains(hti._col)); 14039Debug.Assert(dataGridViewColumn.Width == minimumWidth); 14119Debug.Assert(dataGridViewColumn.DataGridView is null); 14128Debug.Assert(hti._col >= 0); 14129Debug.Assert(MultiSelect); 14226Debug.Assert(success); 14339Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol)); 14392Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 14588Debug.Assert(AllowUserToAddRowsInternal); 14753Debug.Assert(!ReadOnly); 14790Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 14794Debug.Assert(DataConnection is not null); 14795Debug.Assert(DataConnection.CurrencyManager is not null); 14796Debug.Assert(DataConnection.CurrencyManager.Position == _ptCurrentCell.Y); 14854Debug.Assert(!Columns[dataGridViewCell.ColumnIndex].ReadOnly); 14855Debug.Assert(!Rows[dataGridViewCell.RowIndex].ReadOnly); 14856Debug.Assert(!ReadOnly); 15276Debug.Assert(_ptCurrentCell.X == -1); 15285Debug.Assert(success); 15291Debug.Assert(rowIndex >= 0); 15292Debug.Assert(insertionCount > 0); 15306Debug.Assert(rowIndex >= 0); 15314Debug.Assert(_ptCurrentCell.X == -1); 15323Debug.Assert(success); 15329Debug.Assert(rowIndex >= 0); 15330Debug.Assert(dataGridViewRows is not null); 15331Debug.Assert(dataGridViewRows.Length > 0); 15345Debug.Assert(dataGridViewRows is not null); 15346Debug.Assert(dataGridViewRows.Length > 0); 15354Debug.Assert(_ptCurrentCell.X == -1); 15363Debug.Assert(success); 15474Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount); 15547Debug.Assert(success); 15613Debug.Assert(dataGridViewRows is not null); 15922Debug.Assert(dgvcme is not null); 15933Debug.Assert(dgvcme is not null); 15990Debug.Assert(dgvcme is not null); 16013Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True); 16033Debug.Assert(_columnHeadersHeightSizeMode == DataGridViewColumnHeadersHeightSizeMode.EnableResizing); 16040Debug.Assert(dgvcme is not null); 16063Debug.Assert(Rows[rowIndex].Resizable == DataGridViewTriState.True); 16083Debug.Assert(_rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing); 16110Debug.Assert(_ptMouseDownCell.Y != -2); 16330Debug.Assert(_vertScrollTimer is null || !_vertScrollTimer.Enabled); 16331Debug.Assert(_horizScrollTimer is null || !_horizScrollTimer.Enabled); 16487Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA); 16488Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA); 16489Debug.Assert(_cumulativeHorizontalWheelDelta > -PInvoke.WHEEL_DELTA); 16490Debug.Assert(_cumulativeHorizontalWheelDelta < PInvoke.WHEEL_DELTA); 16588Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16597Debug.Assert(totalVisibleFrozenHeight == Rows.GetRowsHeight(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 16598Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 16878Debug.Assert(dataGridViewColumn.Index >= 0); 16879Debug.Assert(dataGridViewColumn.DataGridView is null); 16904Debug.Assert(_ptCurrentCell.X == -1); 16913Debug.Assert(success); 16929Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet); 16955Debug.Assert(_ptCurrentCell.X == -1); 16964Debug.Assert(success); 17031Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count); 17082Debug.Assert(success); 17095Debug.Assert(success); 17111Debug.Assert(columnIndex == 0); 17194Debug.Assert(_horizontalOffset >= dataGridViewColumn.Thickness); 17245Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count); 17268Debug.Assert(NewRowIndex != -1); 17269Debug.Assert(NewRowIndex == Rows.Count - 1); 17283Debug.Assert(rowIndexDeleted < _ptCurrentCell.Y); 17297Debug.Assert(success); 17310Debug.Assert(success); 17567Debug.Assert(rowIndex >= 0); 17660Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 17733Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 17754Debug.Assert(_noDimensionChangeCount >= 0); 17777Debug.Assert(rowIndex >= 0); 17933Debug.Assert(hti.Type == DataGridViewHitTestType.RowHeader); 18038Debug.Assert(success); 18063Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 18093Debug.Assert(_individualSelectedCells.Count == 0); 18123Debug.Assert(_selectedBandIndexes.Contains(hti._row) == 18139Debug.Assert(success); 18146Debug.Assert(success); 18157Debug.Assert(success); 18162Debug.Assert(CurrentCellAddress == new Point(-1, -1)); 18167Debug.Assert(_selectedBandIndexes.Contains(hti._row)); 18306Debug.Assert(rowIndex != -1); 18307Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None); 18327Debug.Assert(columnIndex >= 0 && rowIndex >= 0); 18340Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18361Debug.Assert(_noDimensionChangeCount >= 0); 18407Debug.Assert(hti._row >= 0); 18408Debug.Assert(MultiSelect); 18501Debug.Assert(success); 18561Debug.Assert(rowIndex >= -1); 18763Debug.Assert(_noDimensionChangeCount >= 0); 18787Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count); 18808Debug.Assert(_noDimensionChangeCount >= 0); 18944Debug.Assert(dataGridViewColumnHeaderCell is not null); 18996Debug.Assert(success); 19103Debug.Assert(success); 19113Debug.Assert(success); 19143Debug.Assert(rowIndexTmp != -1); 19150Debug.Assert(rowIndexTmp != -1); 19151Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19171Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Visible) != 0); 19173Debug.Assert(numDisplayedScrollingRows > 0); 19176Debug.Assert(rowIndexTmp != -1); 19183Debug.Assert(rowIndexTmp != -1); 19184Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0); 19282Debug.Assert(bounds.Left == 0); 19283Debug.Assert(bounds.Top == 0); 19368Debug.Assert(cellBounds.Width > 0); 19437Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 19446Debug.Assert(cellBounds.Width > 0); 19485Debug.Assert(clipRegion is not null); 19546Debug.Assert(_dataGridViewOper[OperationTrackColHeadersResize] || _dataGridViewOper[OperationTrackRowResize]); 19551Debug.Assert(_dataGridViewOper[OperationTrackRowHeadersResize] 19626Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Frozen) == 0); 19627Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0); 19772Debug.Assert(_inPerformLayoutCount >= 0); 19801Debug.Assert(EditingControl is not null); 19811Debug.Assert(dataGridViewCell.ColumnIndex == _ptCurrentCell.X); 19812Debug.Assert(dataGridViewCell.RowIndex == _ptCurrentCell.Y || dataGridViewCell.RowIndex == -1); 19956Debug.Assert(rowIndex >= 0); 20022Debug.Assert(dataGridViewRow.Index == -1); 20034Debug.Assert(dataGridViewRow.Index == -1); 20191Debug.Assert(success); 20217Debug.Assert(_ptAnchorCell.Y >= 0); 20269Debug.Assert(success); 20314Debug.Assert(success); 20384Debug.Assert(success); 20444Debug.Assert(success); 20473Debug.Assert(_ptAnchorCell.Y >= 0); 20511Debug.Assert(success); 20556Debug.Assert(success); 20625Debug.Assert(success); 20680Debug.Assert(success); 20702Debug.Assert(_ptAnchorCell.Y >= 0); 20772Debug.Assert(success); 20826Debug.Assert(success); 20924Debug.Assert(success); 20986Debug.Assert(success); 21026Debug.Assert(success); 21511Debug.Assert(_ptCurrentCell.Y != -1); 21512Debug.Assert(CurrentCellInternal is not null); 21513Debug.Assert(EditMode != DataGridViewEditMode.EditOnEnter 21522Debug.Assert(success); 21911Debug.Assert(success); 22122Debug.Assert(success); 22129Debug.Assert(success); 22150Debug.Assert(_ptAnchorCell.X >= 0); 22173Debug.Assert(success); 22183Debug.Assert(success); 22190Debug.Assert(success); 22212Debug.Assert(success); 22233Debug.Assert(success); 22240Debug.Assert(success); 22282Debug.Assert(success); 22292Debug.Assert(success); 22299Debug.Assert(success); 22321Debug.Assert(success); 22342Debug.Assert(success); 22349Debug.Assert(success); 22417Debug.Assert(success); 22427Debug.Assert(success); 22434Debug.Assert(success); 22465Debug.Assert(success); 22484Debug.Assert(success); 22491Debug.Assert(success); 22511Debug.Assert(success); 22546Debug.Assert(success); 22553Debug.Assert(success); 22564Debug.Assert(_ptAnchorCell.X >= 0); 22585Debug.Assert(success); 22607Debug.Assert(success); 22618Debug.Assert(success); 22630Debug.Assert(success); 22652Debug.Assert(success); 22666Debug.Assert(success); 22678Debug.Assert(success); 22695Debug.Assert(_ptAnchorCell.X >= 0); 22698Debug.Assert(success); 22715Debug.Assert(success); 22726Debug.Assert(success); 22733Debug.Assert(success); 22750Debug.Assert(success); 22764Debug.Assert(success); 22771Debug.Assert(success); 22787Debug.Assert(_ptAnchorCell.X >= 0); 22807Debug.Assert(success); 22833Debug.Assert(success); 22844Debug.Assert(success); 22851Debug.Assert(success); 22877Debug.Assert(success); 22889Debug.Assert(success); 22896Debug.Assert(success); 22911Debug.Assert(success); 22957Debug.Assert(firstDisplayedScrollingRowIndex != -1); 22977Debug.Assert(nextScreenVisibleRowIndexTmp != -1); 23015Debug.Assert(success); 23041Debug.Assert(_ptAnchorCell.Y >= 0); 23064Debug.Assert(success); 23081Debug.Assert(_ptAnchorCell.Y >= 0); 23117Debug.Assert(_ptAnchorCell.Y >= 0); 23223Debug.Assert(previousScreenVisibleRowIndexTmp != -1); 23251Debug.Assert(previousScreenVisibleRowIndex != -1); 23300Debug.Assert(_ptAnchorCell.Y >= 0); 23339Debug.Assert(_ptAnchorCell.Y >= 0); 23375Debug.Assert(_ptAnchorCell.Y >= 0); 23501Debug.Assert(success); 23508Debug.Assert(success); 23551Debug.Assert(success); 23561Debug.Assert(success); 23568Debug.Assert(success); 23590Debug.Assert(success); 23611Debug.Assert(success); 23618Debug.Assert(success); 23660Debug.Assert(success); 23670Debug.Assert(success); 23677Debug.Assert(success); 23699Debug.Assert(success); 23720Debug.Assert(success); 23727Debug.Assert(success); 23797Debug.Assert(success); 23807Debug.Assert(success); 23814Debug.Assert(success); 23845Debug.Assert(success); 23864Debug.Assert(success); 23871Debug.Assert(success); 23891Debug.Assert(success); 23926Debug.Assert(success); 23933Debug.Assert(success); 23949Debug.Assert(_ptAnchorCell.X >= 0); 23965Debug.Assert(success); 23972Debug.Assert(success); 23983Debug.Assert(success); 23990Debug.Assert(success); 24007Debug.Assert(success); 24021Debug.Assert(success); 24028Debug.Assert(success); 24050Debug.Assert(_ptAnchorCell.X >= 0); 24053Debug.Assert(success); 24060Debug.Assert(success); 24071Debug.Assert(success); 24078Debug.Assert(success); 24095Debug.Assert(success); 24109Debug.Assert(success); 24116Debug.Assert(success); 24132Debug.Assert(_ptAnchorCell.X >= 0); 24157Debug.Assert(success); 24173Debug.Assert(success); 24184Debug.Assert(success); 24191Debug.Assert(success); 24217Debug.Assert(success); 24229Debug.Assert(success); 24236Debug.Assert(success); 24251Debug.Assert(success); 24282Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24300Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.X)); 24309Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 24327Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.Y)); 24592Debug.Assert(_ptAnchorCell.Y >= 0); 24689Debug.Assert(_ptAnchorCell.Y >= 0); 24791Debug.Assert(_ptAnchorCell.Y >= 0); 24974Debug.Assert(_ptAnchorCell.Y >= 0); 25289Debug.Assert(success); 25300Debug.Assert(dataGridViewCurrentCell is not null); 25313Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25315Debug.Assert(dataGridViewEditingCell is not null); 25344Debug.Assert(NewRowIndex == Rows.Count - 1); 25353Debug.Assert(IsCurrentCellInEditMode); 25407Debug.Assert(dgvcme.Clicks == 1); 25483Debug.Assert(_ptCurrentCell.Y != -1); 25505Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]); 25509Debug.Assert(dataGridViewEditingCell is not null); 25564Debug.Assert(list.Count == rowsCount); 25681Debug.Assert(_noSelectionChangeCount > 0); 25708Debug.Assert(_noSelectionChangeCount > 0); 25730Debug.Assert(dataGridViewCell.ColumnIndex != columnIndexException || dataGridViewCell.RowIndex != rowIndexException); 25749Debug.Assert(_noSelectionChangeCount > 0); 25801Debug.Assert(_noSelectionChangeCount > 0); 25965Debug.Assert(rowIndex >= 0); 25966Debug.Assert(rowIndex < Rows.Count); 26011Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26143Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26160Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0); 26210Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 26211Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingCol < Columns.Count); 26212Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= -1 && DisplayedBandsInfo.LastTotallyDisplayedScrollingCol < Columns.Count); 26213Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26214Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count); 26215Debug.Assert(Columns[columnIndex].Visible); 26216Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0); 26273Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 26303Debug.Assert(firstDisplayedScrollingRow != -1); 26328Debug.Assert(rowCount != 0); 26329Debug.Assert(deltaY != 0); 26330Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen)); 26352Debug.Assert(rowsRect.X > 0); 26359Debug.Assert(rowsRect.Height >= 0); 26363Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow > -1); 26388Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26390Debug.Assert(firstVisibleScrollingRow != -1); 26392Debug.Assert(newScrolledOffRowCount >= rowCount); 26399Debug.Assert(rows != 0); 26400Debug.Assert((rows > 0 && (scrollEventType == ScrollEventType.SmallIncrement || scrollEventType == ScrollEventType.LargeIncrement)) 26404Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26415Debug.Assert(newFirstVisibleScrollingRow != -1); 26433Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == oldFirstVisibleScrollingRow); 26456Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == newFirstVisibleScrollingRow); 26470Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 26496Debug.Assert(newFirstVisibleScrollingRow != -1); 26622Debug.Assert(_noDimensionChangeCount >= 0); 26623Debug.Assert(_noSelectionChangeCount >= 0); 26650Debug.Assert(index >= 0); 26724Debug.Assert(_columnHeadersHeight != columnHeadersHeight); 26725Debug.Assert(columnHeadersHeight >= MinimumColumnHeadersHeight); 26726Debug.Assert(columnHeadersHeight <= MaxHeadersThickness); 26792Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 26860Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 26861Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 26958Debug.Assert(oldCurrentCellY >= 0); 27065Debug.Assert(oldCurrentCellX == _ptCurrentCell.X); 27066Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y); 27121Debug.Assert(oldCurrentCellY >= 0); 27153Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27154Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27155Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27156Debug.Assert(rowIndexFrom <= rowIndexTo); 27157Debug.Assert(_noSelectionChangeCount > 0); 27240Debug.Assert(_noSelectionChangeCount > 0); 27275Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0); 27276Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex); 27277Debug.Assert(_noSelectionChangeCount > 0); 27291Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27318Debug.Assert(_selectedBandIndexes.Contains(columnIndexTo)); 27326Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0); 27327Debug.Assert(rowIndexFrom <= rowIndexTo); 27328Debug.Assert(_noSelectionChangeCount > 0); 27347Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 27356Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27478Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count); 27551Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count); 27587Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count); 27648Debug.Assert(_individualSelectedCells.Contains(dataGridViewCell)); 27666Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27702Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 27767Debug.Assert(_individualSelectedCells.Count <= 1); 27781Debug.Assert(_selectedBandIndexes.Count <= 1); 27819Debug.Assert(_selectedBandIndexes.Count <= 1); 27836Debug.Assert(_selectedBandIndexes.Count <= 1); 27861Debug.Assert(_selectedBandIndexes.Count <= 1); 27879Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27888Debug.Assert(_selectedBandIndexes.Contains(rowIndex) == 27903Debug.Assert(_selectedBandIndexes.Count <= 1); 27920Debug.Assert(_selectedBandIndexes.Count <= 1); 27948Debug.Assert(success); 27969Debug.Assert(!_selectedBandIndexes.Contains(columnIndex)); 27975Debug.Assert(_selectedBandIndexes.Contains(columnIndex)); 27988Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 28000Debug.Assert(_selectedBandIndexes.Count <= 1); 28088Debug.Assert(!_selectedBandIndexes.Contains(rowIndex)); 28095Debug.Assert(_selectedBandIndexes.Contains(rowIndex)); 28108Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1); 28120Debug.Assert(_selectedBandIndexes.Count <= 1); 28226Debug.Assert(!(comparer is not null && DataSource is not null)); 28227Debug.Assert(direction is ListSortDirection.Ascending or ListSortDirection.Descending); 28252Debug.Assert(rowVFIndex != -1); 28254Debug.Assert(Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) == 0); 28316Debug.Assert(rowVIndex != -1); 28320Debug.Assert(rowVIndex != -1); 28331Debug.Assert(_dataGridViewOper[OperationInSort]); 28352Debug.Assert(rowIndex1 != NewRowIndex); 28353Debug.Assert(rowIndex2 != NewRowIndex); 28438Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28462Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0); 28690Debug.Assert(lastVisibleRowIndex != -1); 28827Debug.Assert(_editingPanel is not null); 28838Debug.Assert(EditingControl is not null); 28902Debug.Assert(dataGridViewColumnTmp is not null); 28906Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 28919Debug.Assert(numDisplayedScrollingCols > 0); 28923Debug.Assert(dataGridViewColumnTmp is not null); 28927Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp)); 29063Debug.Assert(rowVisible); 29125Debug.Assert(rowIndexTmp != -1); 29141Debug.Assert(numDisplayedScrollingRows > 0); 29144Debug.Assert(rowIndexTmp != -1); 29224Debug.Assert(anchorColumnIndex >= 0); 29225Debug.Assert(anchorRowIndex >= 0); 29226Debug.Assert(newEdgeColumnIndex >= 0); 29227Debug.Assert(newEdgeRowIndex >= 0); 29228Debug.Assert(_noSelectionChangeCount > 0); 29410Debug.Assert(oldEdgeRowIndex < anchorRowIndex); 29455Debug.Assert(oldEdgeRowIndex <= anchorRowIndex); 29638Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29786Debug.Assert(oldEdgeRowIndex >= anchorRowIndex); 29872Debug.Assert(_dataGridViewOper[OperationTrackRowSelect] || _dataGridViewOper[OperationTrackCellSelect]); 29928Debug.Assert(_editingPanel is not null); 29939Debug.Assert(EditingControl is not null); 29993Debug.Assert(hti._row == -1); 29997Debug.Assert(hti._col == -1); 30001Debug.Assert(hti._row == -1); 30002Debug.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)
149Debug.Assert(!IsRow); 154Debug.Assert(value != Displayed); 192Debug.Assert(!IsRow); 253Debug.Assert(dataGridViewColumnHeaderCell is not null); 298Debug.Assert(value.OwningRow is null); 319Debug.Assert(dataGridViewColumnHeaderCell.SortGlyphDirection == SortOrder.None); 320Debug.Assert(value.OwningColumn is null); 324Debug.Assert(value.DataGridView is null); 400Debug.Assert(!IsRow); 429Debug.Assert(Index >= 0); 466Debug.Assert(value != ReadOnly); 476Debug.Assert(DataGridView is not null); 486Debug.Assert(!IsRow); 540Debug.Assert(!IsRow); 562Debug.Assert(Index >= 0); 581Debug.Assert(value != Selected); 672Debug.Assert(_thickness != value); 673Debug.Assert(value >= _minimumThickness); 674Debug.Assert(value <= MaxBandThickness); 686Debug.Assert(!IsRow); 785Debug.Assert(IsRow); 790Debug.Assert(rowIndex > -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewButtonCell.cs (12)
45Debug.Assert((value & ~(ButtonState.Normal | ButtonState.Pushed | ButtonState.Checked)) == 0); 76Debug.Assert(value is >= FlatStyle.Flat and <= FlatStyle.System); 201Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 273Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 505Debug.Assert(RowIndex >= 0); // Cell is not in a shared row. 519Debug.Assert(DataGridView.CellMouseDownInContentBounds); 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); 875Debug.Assert(valBounds.Height <= 0 || valBounds.Width <= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.cs (69)
163Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 182Debug.Assert(RowIndex >= -1); 228Debug.Assert(RowIndex >= -1); 265Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 444Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 459Debug.Assert(ColumnIndex >= 0); 514Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 546Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 561Debug.Assert(ColumnIndex >= 0); 576Debug.Assert(value != Selected); 693Debug.Assert(RowIndex >= -1); 698Debug.Assert(RowIndex >= -1); 751Debug.Assert(DataGridView.Rows.GetRowState(RowIndex) == DataGridView.Rows.SharedRow(RowIndex).State); 888Debug.Assert(DataGridView is not null); 889Debug.Assert(ColumnIndex >= 0); 958Debug.Assert(DataGridView is not null); 979Debug.Assert(rowIndex == -1); 992Debug.Assert(this is DataGridViewRowHeaderCell); 1003Debug.Assert(OwningColumn is null); 1004Debug.Assert(OwningRow is null); 1005Debug.Assert(rowIndex == -1); 1071Debug.Assert(dataGridView.EditingControl.ParentInternal == dataGridView.EditingPanel); 1072Debug.Assert(dataGridView.EditingPanel.Controls.Contains(dataGridView.EditingControl)); 1074Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1087Debug.Assert(dataGridView.EditingPanel.ParentInternal == dataGridView); 1088Debug.Assert(dataGridView.Controls.Contains(dataGridView.EditingPanel)); 1090Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1093Debug.Assert(dataGridView.EditingControl.ParentInternal is null); 1094Debug.Assert(dataGridView.EditingPanel.ParentInternal is null); 1095Debug.Assert(dataGridView.EditingPanel.Controls.Count == 0); 1117Debug.Assert(DataGridView?.EditingControl is not null); 1372Debug.Assert(csv); 1431Debug.Assert(DataGridView is not null); 1486Debug.Assert(DataGridView is not null); 1719Debug.Assert(OwningRow is not null); 1735Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1778Debug.Assert(RowIndex == -1); 1800Debug.Assert(OwningColumn is not null); 1801Debug.Assert(OwningRow is not null); 1802Debug.Assert(ColumnIndex >= 0); 1865Debug.Assert(state == stateDebug || DataGridView.Rows.SharedRow(rowIndex).Index == -1); 1885Debug.Assert(ColumnIndex < DataGridView.Columns.Count); 1908Debug.Assert(cellStyle is not null); 1915Debug.Assert(rowStyle is not null); 1922Debug.Assert(columnStyle is not null); 1926Debug.Assert(dataGridViewStyle is not null); 2190Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 2217Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 2281Debug.Assert(width > 0); 2319Debug.Assert(maxWidth > 0); 2336Debug.Assert(height > 0); 2360Debug.Assert(OwningColumn is not null); 2361Debug.Assert(OwningRow is not null); 2423Debug.Assert(ColumnIndex < dataGridView.Columns.Count); 2452Debug.Assert(rowIndex >= 0); 2453Debug.Assert(ColumnIndex >= 0); 2477Debug.Assert(!dgv.EditingPanel.ContainsFocus); 2479Debug.Assert(dgv.EditingPanel.ParentInternal is null); 2482Debug.Assert(dgv.IsSharedCellVisible(this, rowIndex)); 2485Debug.Assert(dgv.EditingControl.ParentInternal == dgv.EditingPanel); 2486Debug.Assert(dgv.EditingPanel.ParentInternal == dgv); 2659Debug.Assert(textSize.Height <= maxHeight); 2701Debug.Assert(DataGridView is not null); 2714Debug.Assert(DataGridView.IsCurrentCellInEditMode); 2748Debug.Assert(this is DataGridViewHeaderCell); 2980Debug.Assert(CurrentMouseLocation != FlagAreaNotSet); 3640Debug.Assert(DataGridView is not null); 3934Debug.Assert(rowIndex >= 0); 3935Debug.Assert(ColumnIndex >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewCell.DataGridViewCellAccessibleObject.cs (8)
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 (21)
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); 970Debug.Assert(DataGridView is not null); 971Debug.Assert((columnIndex >= 0) && (columnIndex < DataGridView.Columns.Count)); 972Debug.Assert((rowIndex >= 0) && (rowIndex < DataGridView.Rows.Count)); 1049Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 1050Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 1051Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 1052Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 1053Debug.Assert(cellStyle is not null); 1071Debug.Assert(DataGridView is not null); 1382Debug.Assert(FlatStyle == FlatStyle.Popup); 1566Debug.Assert(formattedValue is null || FormattedValueType is null || FormattedValueType.IsAssignableFrom(formattedValue.GetType())); 1699Debug.Assert(DataGridView is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewColumn.cs (11)
306Debug.Assert(value >= -1); 307Debug.Assert(value < int.MaxValue); 358Debug.Assert(value > 0); 433Debug.Assert(columnStyle is not null); 443Debug.Assert(dataGridViewStyle is not null); 532Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 542Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 779Debug.Assert(value > 0); 910Debug.Assert(dataGridView is null || Index > -1); 918Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header 926Debug.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 (36)
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()); 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()); 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 (36)
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); 691Debug.Assert(sender == DataSource); 692Debug.Assert(DataSource is ISupportInitializeNotification); 693Debug.Assert(_flags.HasFlag(DataGridViewComboBoxCellFlags.DataSourceInitializedHookedUp)); 784Debug.Assert(contentBoundsDebug.Equals(contentBounds)); 890Debug.Assert(errorIconBoundsDebug.Equals(errorIconBounds)); 1047Debug.Assert(item is not null); 1231Debug.Assert(EditingComboBox is not null); 1234Debug.Assert(rowIndex > -1); 1253Debug.Assert(DataGridView is not null && 1255Debug.Assert(!ReadOnly); 1415Debug.Assert(property is not null); 1416Debug.Assert(DataManager is not null); 1447Debug.Assert(!string.IsNullOrEmpty(field)); 1536Debug.Assert(value is not null); 1537Debug.Assert(ValueMemberProperty is not null || DisplayMemberProperty is not null || 1580Debug.Assert(DisplayMemberProperty is not null || ValueMemberProperty is not null || 1636Debug.Assert(TemplateComboBoxColumn.CellTemplate == this); 1668Debug.Assert(e.ColumnIndex == ColumnIndex); 1874Debug.Assert(paint || computeContentBounds || computeErrorIconBounds || computeDropDownButtonRect); 1875Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect); 1876Debug.Assert(!paint || !computeContentBounds || !computeDropDownButtonRect || !computeErrorIconBounds); 1877Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint || !computeDropDownButtonRect); 1878Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !computeDropDownButtonRect || !paint); 1879Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds || !computeDropDownButtonRect); 1880Debug.Assert(!computeErrorIconBounds || !paint || !computeDropDownButtonRect || !computeContentBounds); 1881Debug.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 (12)
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); 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\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)); 891Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 892Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 893Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 894Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 895Debug.Assert(cellStyle is not null); 967Debug.Assert(computeContentBounds);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.cs (28)
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); 789Debug.Assert(inheritedRowStyle is not null); 790Debug.Assert(rowIndex >= 0); 791Debug.Assert(DataGridView is not null); 797Debug.Assert(rowStyle is not null); 801Debug.Assert(dataGridViewStyle is not null); 804Debug.Assert(rowsDefaultCellStyle is not null); 807Debug.Assert(alternatingRowsDefaultCellStyle is not null); 979Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet); 997Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet); 1125Debug.Assert(Cells.Count == dataGridView.Columns.Count); 1165Debug.Assert(Index == -1); 1166Debug.Assert(!Selected); 1269Debug.Assert(rowIndex >= -1); 1393Debug.Assert(DataGridView is not null); 1401Debug.Assert(DataGridView is not null); 1523Debug.Assert(cellBounds.Width > 0); 1602Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen); 1613Debug.Assert(cellBounds.Width > 0); 1700Debug.Assert(cellBounds.Width > 0); 1748Debug.Assert(Index == -1); 1790Debug.Assert(values is not null);
System\Windows\Forms\Controls\DataGridView\DataGridViewRow.DataGridViewRowAccessibleObject.cs (1)
275Debug.Assert(index >= 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowCollection.cs (106)
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)); 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); 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 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 (2)
20Debug.Assert(rowComparer is not null); 21Debug.Assert(Count > 0);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowErrorTextNeededEventArgs.cs (1)
10Debug.Assert(rowIndex >= -1);
System\Windows\Forms\Controls\DataGridView\DataGridViewRowHeaderCell.cs (20)
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); 655Debug.Assert(DataGridView is not null); 683Debug.Assert(ButtonState == ButtonState.Pushed); 836Debug.Assert(valBounds.Width >= 0); 837Debug.Assert(valBounds.Height >= 0); 1024Debug.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)); 382Debug.Assert(errorBoundsDebug.Equals(errorBounds)); 510Debug.Assert(DataGridView is not null && 512Debug.Assert(!ReadOnly); 577Debug.Assert(e.ColumnIndex == ColumnIndex); 653Debug.Assert(paint || computeContentBounds || computeErrorIconBounds); 654Debug.Assert(!paint || !computeContentBounds || !computeErrorIconBounds); 655Debug.Assert(!computeContentBounds || !computeErrorIconBounds || !paint); 656Debug.Assert(!computeErrorIconBounds || !paint || !computeContentBounds); 657Debug.Assert(cellStyle is not null); 766Debug.Assert(cellEdited || formattedString is null); 767Debug.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\ImageList\ImageList.cs (5)
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.NativeImageList.cs (1)
27Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\Labels\LinkLabel.cs (3)
511Debug.Assert(g is not null); 978Debug.Assert(Text.Length == 0); 1018Debug.Assert((_linkFont is null && _hoverLinkFont is null)
System\Windows\Forms\Controls\ListBoxes\ListBox.ItemAccessibleObject.cs (1)
47Debug.Assert(id.Length >= 3);
System\Windows\Forms\Controls\ListBoxes\ListBox.ObjectCollection.cs (1)
181Debug.Assert(items is not null);
System\Windows\Forms\Controls\ListControl\ListControl.cs (1)
260Debug.Assert(dataManager is not null);
System\Windows\Forms\Controls\ListView\ListView.cs (2)
4994Debug.Assert(retval != 0); 5683Debug.Assert(result != -1);
System\Windows\Forms\Controls\ListView\ListViewGroup.ListViewGroupAccessibleObject.cs (1)
116Debug.Assert(id.Length >= 2);
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.ListViewSubItemAccessibleObject.cs (1)
109Debug.Assert(id.Length >= 4);
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarAccessibleObject.cs (1)
42Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarBodyAccessibleObject.cs (1)
50Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.CalendarRowAccessibleObject.cs (1)
94Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\MonthCalendar\MonthCalendar.MonthCalendarAccessibleObject.cs (1)
80Debug.Assert(OsVersion.IsWindows8OrGreater());
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (1)
3648Debug.Assert(oldObject is not null && newObject is not null && oldObject.GetType() == newObject.GetType());
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 (2)
3172Debug.Assert(_scrollBar is not null); 5337Debug.Assert(_editTextBox is not null);
System\Windows\Forms\Controls\PropertyGrid\PropertyGridToolStrip.PropertyGridToolStripAccessibleObject.cs (1)
75Debug.Assert(target is not null);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.cs (1)
3035Debug.Assert(IsHandleCreated);
System\Windows\Forms\Controls\RichTextBox\RichTextBox.OleCallback.cs (1)
51Debug.Assert(hr.Succeeded);
System\Windows\Forms\Controls\TextBox\TextBoxBase.TextBoxBaseUiaTextProvider.cs (2)
437Debug.Assert(Owner.IsHandleCreated); 453Debug.Assert(Owner.IsHandleCreated);
System\Windows\Forms\Controls\ToolStrips\ToolStripDropDown.ToolStripDropDownAccessibleObject.cs (1)
55Debug.Assert(owner is not null);
System\Windows\Forms\Controls\ToolStrips\ToolStripMenuItem.ToolStripMenuItemInternalLayout.cs (1)
126Debug.Assert(image is not null);
System\Windows\Forms\Controls\TrackBar\TrackBar.cs (2)
800Debug.Assert((bool)(BOOL)lresult); 862Debug.Assert(_autoDrawTicks == ShouldAutoDrawTicks());
System\Windows\Forms\Controls\WebBrowser\WebBrowserContainer.cs (1)
50Debug.Assert(_parent is not null);
System\Windows\Forms\DataBinding\Binding.BindToObject.cs (2)
54Debug.Assert(owner is not null); 63Debug.Assert(_waitingOnDataSource);
System\Windows\Forms\DataBinding\Binding.cs (1)
676Debug.Assert(type is not null);
System\Windows\Forms\DataBinding\BindingSource.cs (2)
1263Debug.Assert(cm is not null); 1274Debug.Assert(cm is not null);
System\Windows\Forms\DataBinding\ListBindingHelper.cs (1)
448Debug.Assert(listAccessors is not null);
System\Windows\Forms\Design\ComponentEditorForm.cs (1)
470Debug.Assert(_activePage != -1);
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\TaskDialog\TaskDialog.cs (5)
654Debug.Assert(_handle == IntPtr.Zero); 918Debug.Assert(_boundPage is not null); 974Debug.Assert(!_raisedPageCreated); 1171Debug.Assert(linkHref is not null); 1521Debug.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.ErrorWindow.cs (2)
223Debug.Assert(_timer is not null); 249Debug.Assert(shownTooltips <= 1);
System\Windows\Forms\Form.cs (3)
4866Debug.Assert(result); 4910Debug.Assert(result); 5987Debug.Assert(containerControl is not null);
System\Windows\Forms\Form.EnumThreadWindowsCallback.cs (1)
45Debug.Assert(oldValue == (nint)_formHandle.Value);
System\Windows\Forms\Input\InputLanguageCollection.cs (1)
19Debug.Assert(value is not null);
System\Windows\Forms\Layout\Containers\ContainerControl.cs (3)
467Debug.Assert(control is not null); 535Debug.Assert(value is null || (value.ParentInternal is not null && this == value.ParentInternal.GetContainerControl())); 1667Debug.Assert(_activeControl is null || _activeControl.ParentInternal.GetContainerControl() == this);
System\Windows\Forms\Layout\FlowLayout.cs (12)
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\MDI\MDIClient.cs (1)
255Debug.Assert(result);
System\Windows\Forms\NativeWindow.cs (3)
299Debug.Assert(!hwnd.IsNull); 304Debug.Assert(_priorWindowProcHandle is not null); 707Debug.Assert(!hwnd.IsNull);
System\Windows\Forms\NativeWindow.WindowClass.cs (2)
49Debug.Assert(_targetWindow is not null); 109Debug.Assert(string.Equals(
System\Windows\Forms\OLE\Clipboard.cs (1)
71Debug.Assert(proxyDataObject.IsNull);
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\TableLayoutPanel\TableLayoutStyle.cs (1)
74Debug.Assert(size >= 0);
System\Windows\Forms\PropertyStore.cs (1)
212Debug.Assert(sizeof(T) > 8);
System\Windows\Forms\Rendering\ControlPaint.cs (2)
2451Debug.Assert(replaceBlack.A == 255); 2452Debug.Assert(replaceWhite.A == 255);
System\Windows\Forms\Rendering\DrawingEventArgs.cs (2)
55Debug.Assert(type is OBJ_TYPE.OBJ_DC 99Debug.Assert(!_hdc.IsNull);
System\Windows\Forms\Rendering\FontCache.Data.cs (2)
41Debug.Assert(PInvoke.GetMapMode(hdc) == HDC_MAP_MODE.MM_TEXT); 120Debug.Assert(!hfont.IsNull);
System\Windows\Forms\Rendering\GdiCache.cs (1)
93Debug.Assert(font is not null);
System\Windows\Forms\Rendering\ScreenDcCache.cs (5)
34Debug.Assert(cacheSpace >= 0); 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); 115Debug.Assert(matrix.IsIdentity);
System\Windows\Forms\WindowSubclassHandler.cs (2)
107Debug.Assert(_originalWindowProc != _windowProcDelegatePtr); 268Debug.Assert(hWnd == _handle);
System.Windows.Forms.Design (40)
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.cs (2)
353Debug.Assert(Context is not null); 366Debug.Assert(Context is not null);
System\ComponentModel\Design\ComponentDesigner.cs (1)
503Debug.Assert(Component.Site is not null);
System\ComponentModel\Design\DesignerActionPanel.cs (3)
342Debug.Assert(false); // should never get here 608Debug.Assert(relatedComponent is not null); 880Debug.Assert(newLine.GetType() == newLineInfo.LineType);
System\ComponentModel\Design\MultilineStringEditor.OleCallback.cs (2)
43Debug.Assert(hr.Succeeded); 119Debug.Assert(success);
System\ComponentModel\Design\Serialization\BasicDesignerLoader.cs (1)
737Debug.Assert(mgr is not null && thisSurface is not null);
System\Drawing\Design\ToolboxItem.cs (1)
641Debug.Assert(type is not null);
System\Windows\Forms\Design\Behavior\DragAssistanceManager.cs (2)
842Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingRight); 866Debug.Assert(lines[i].PaddingLineType == PaddingLineType.PaddingBottom);
System\Windows\Forms\Design\Behavior\SelectionManager.cs (1)
137Debug.Assert(_currentSelectionBounds is not null);
System\Windows\Forms\Design\BorderSidesEditor.BorderSidesEditorUI.cs (1)
365Debug.Assert(edSvc is not null);
System\Windows\Forms\Design\ControlDesigner.cs (3)
216Debug.Assert(_host is not null); 898Debug.Assert(child is not null); 902Debug.Assert(child.IsHandleCreated);
System\Windows\Forms\Design\DataGridViewColumnCollectionDialog.cs (3)
663Debug.Assert(selectedIndex > -1 && selectedIndex < _selectedColumns.Items.Count - 1); 709Debug.Assert(selectedIndex > 0); 825Debug.Assert(_selectedColumns.SelectedIndex != -1);
System\Windows\Forms\Design\DataGridViewColumnDesigner.cs (3)
145Debug.Assert(_selectionService is not null); 181Debug.Assert(_behavior is not null); 197Debug.Assert(_behavior is not null);
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\ParentControlDesigner.cs (1)
1762Debug.Assert(_graphics is null);
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\TableLayoutPanelDesigner.cs (1)
1816Debug.Assert(currentIndex != index);
System\Windows\Forms\Design\ToolStripTemplateNode.cs (1)
1451Debug.Assert(_addItemButton.DropDownItems.Count > 0);
System.Windows.Forms.Primitives (21)
System\Windows\Forms\Automation\UiaTextRange.cs (1)
118Debug.Assert(!typeof(UiaTextRange).IsAssignableTo(typeof(IDisposable)));
System\Windows\Forms\DeviceContextExtensions.cs (2)
45Debug.Assert(!hbrush.IsNull); 82Debug.Assert((lines.Length % 4) == 0);
System\Windows\Forms\Internals\ScaleHelper.cs (2)
86Debug.Assert(Enum.IsDefined(processDpiAwareness)); 269Debug.Assert(dpi >= 96);
System\Windows\Forms\Internals\ThemingScope.cs (2)
34Debug.Assert(success); 43Debug.Assert(success);
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.LoadLibrary.cs (1)
18Debug.Assert(Path.IsPathFullyQualified(customPath));
Windows\Win32\PInvoke.PrintDlg.cs (1)
16Debug.Assert(RuntimeInformation.ProcessArchitecture == Architecture.X86);
Windows\Win32\System\Ole\ClassPropertyDispatchAdapter.cs (1)
190Debug.Assert(!bindingFlags.HasFlag(BindingFlags.NonPublic));
System.Windows.Forms.Tests (1)
System\Windows\Forms\DynamicAxHost.cs (1)
24Debug.Assert(clsid == _factory.ClassId);
System.Windows.Input.Manipulations (77)
System\Windows\Input\Manipulations\Exceptions.cs (12)
102Debug.Assert(paramName1 != null); 103Debug.Assert(paramName2 != null); 120Debug.Assert(paramName1 != null); 121Debug.Assert(paramName2 != null); 140Debug.Assert(paramName1 != null); 141Debug.Assert(paramName2a != null); 142Debug.Assert(paramName2b != null); 200Debug.Assert(paramName != null); 201Debug.Assert(messageFormat != null); 219Debug.Assert(paramName != null); 220Debug.Assert(paramName.Length > 0); 239Debug.Assert(format != null);
System\Windows\Input\Manipulations\InertiaParameters2D.cs (3)
30Debug.Assert(isEqual != null); 31Debug.Assert(setNewValue != null); 32Debug.Assert(paramName != null);
System\Windows\Input\Manipulations\InertiaProcessor2D.cs (33)
361Debug.Assert(!IsRunning); 414Debug.Assert(handler != null); 684Debug.Assert(!DoubleUtil.IsZero(state.InitialVelocity)); 724Debug.Assert(state.Duration >= 0); 725Debug.Assert(!double.IsNaN(state.Deceleration)); 726Debug.Assert(!double.IsNaN(state.Offset)); 744Debug.Assert(this.processorState == ProcessorState.Running); 845Debug.Assert(!DoubleUtil.IsZero(previousExpansionValue)); 904Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialValue)); 905Debug.Assert(!double.IsNaN(initialVelocity) && !double.IsInfinity(initialVelocity)); 906Debug.Assert(!double.IsNaN(deceleration) && !double.IsInfinity(deceleration)); 907Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 921Debug.Assert(!double.IsNaN(timeDelta) && !double.IsInfinity(timeDelta) && timeDelta >= 0); 1008Debug.Assert(false); 1042Debug.Assert(!double.IsInfinity(value)); 1060Debug.Assert(!double.IsNaN(length) && length >= 0 && !double.IsInfinity(length)); 1061Debug.Assert(!double.IsInfinity(baseVector.X)); 1062Debug.Assert(!double.IsInfinity(baseVector.Y)); 1229Debug.Assert(initialState != null); 1230Debug.Assert(initialState.AbsoluteDeceleration >= 0 || double.IsNaN(initialState.AbsoluteDeceleration)); 1231Debug.Assert(initialState.AbsoluteOffset >= 0 || double.IsNaN(initialState.AbsoluteOffset)); 1251Debug.Assert(elapsedTimeSinceInitialTimestamp >= 0); 1263Debug.Assert(Validations.IsFinite((float)result)); 1289Debug.Assert(this.ExtrapolationResult == ExtrapolationResult.Skip); 1293Debug.Assert(!double.IsNaN(this.InitialValue) && !double.IsInfinity(this.InitialValue)); 1294Debug.Assert(!double.IsNaN(this.InitialVelocity) && !double.IsInfinity(this.InitialVelocity)); 1295Debug.Assert(!double.IsNaN(this.Offset)); // can be infinity 1296Debug.Assert(!double.IsNaN(this.AbsoluteDeceleration) && this.AbsoluteDeceleration >= 0 && !double.IsInfinity(this.InitialVelocity)); 1297Debug.Assert(!double.IsNaN(this.Duration) && this.Duration >= 0); // can be infinity 1298Debug.Assert(!double.IsNaN(this.FinalValue)); // can be infinity 1337Debug.Assert(!double.IsNaN(value) && !double.IsInfinity(value)); 1338Debug.Assert(!double.IsNaN(delta) && !double.IsInfinity(delta)); 1339Debug.Assert(!double.IsNaN(total) && !double.IsInfinity(total));
System\Windows\Input\Manipulations\Lazy.cs (1)
32Debug.Assert(getValue != null);
System\Windows\Input\Manipulations\Manipulation2DStartedEventArgs.cs (2)
42Debug.Assert(Validations.IsFinite(originX)); 43Debug.Assert(Validations.IsFinite(originY));
System\Windows\Input\Manipulations\ManipulationPivot2D.cs (1)
142Debug.Assert(processor != null);
System\Windows\Input\Manipulations\ManipulationProcessor2D.cs (3)
330Debug.Assert(sender != null); 353Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation)); 367Debug.Assert(object.ReferenceEquals(sender, this.currentManipulation));
System\Windows\Input\Manipulations\ManipulationSequence.cs (16)
276Debug.Assert(!float.IsNaN(result) && !float.IsInfinity(result)); 593Debug.Assert(this.log.Length > 0); // makes a good breakpoint to read the log 752Debug.Assert(!double.IsNaN(value)); 796Debug.Assert(this.manipulatorStates != null); 830Debug.Assert(!float.IsNaN(smoothedRotation) && !float.IsInfinity(smoothedRotation)); 836Debug.Assert(!float.IsNaN(smoothedExpansion) && !float.IsInfinity(smoothedExpansion)); 842Debug.Assert(!float.IsNaN(smoothedScale) && !float.IsInfinity(smoothedScale)); 1011Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1032Debug.Assert(this.manipulatorStates != null && this.manipulatorStates.Count > 0); 1071Debug.Assert(queue != null); 1133Debug.Assert(queue != null); 1550Debug.Assert(!float.IsNaN(position.X) && !float.IsNaN(position.Y)); 1551Debug.Assert(!float.IsInfinity(position.Y) && !float.IsInfinity(position.Y)); 1552Debug.Assert(!float.IsNaN(scale) && !float.IsInfinity(scale) && scale > 0); 1553Debug.Assert(!float.IsNaN(expansion) && !float.IsInfinity(expansion)); 1554Debug.Assert(!float.IsNaN(orientation) && !float.IsInfinity(orientation));
System\Windows\Input\Manipulations\ManipulationVelocities2D.cs (4)
86Debug.Assert(Validations.IsFinite(linearVelocityX)); 87Debug.Assert(Validations.IsFinite(linearVelocityY)); 88Debug.Assert(Validations.IsFinite(angularVelocity)); 89Debug.Assert(Validations.IsFinite(expansionVelocity));
System\Windows\Input\Manipulations\Validations.cs (2)
31Debug.Assert(paramName != null); 55Debug.Assert(paramName != null);
System.Xaml (117)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\SafeSecurityHelper.cs (1)
268Debug.Assert(target is not null);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Internal\Xaml\Context\XamlContextStack.cs (5)
27Debug.Assert(CurrentFrame is not null); 28Debug.Assert(CurrentFrame.Depth == Depth); 88Debug.Assert(iteratorFrame is not null); 114Debug.Assert(CurrentFrame.Depth == Depth); 127Debug.Assert(CurrentFrame.Depth == Depth);
src\Microsoft.DotNet.Wpf\src\Shared\MS\Utility\FrugalList.cs (2)
1296Debug.Assert(collection is not null); 1304Debug.Assert(collection is not null);
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlCompatibilityReader.cs (1)
340Debug.Assert(Scope.ShouldProcessContent(namespaceName, Reader.LocalName));
src\Microsoft.DotNet.Wpf\src\Shared\System\Windows\Markup\XmlWrappingReader.cs (1)
35Debug.Assert( baseReader is not null);
System\Xaml\Context\ContextServices.cs (1)
18Debug.Assert(xamlContext.ParentProperty is not null);
System\Xaml\Context\NameFixupGraph.cs (8)
57Debug.Assert(fixupToken.Target.Instance is null && 60Debug.Assert(_deferredRootProvideValue is null); 70Debug.Assert(parentObject is not null); 76Debug.Assert(fixupToken.FixupType == FixupType.UnresolvedChildren || 80Debug.Assert(!_dependenciesByChildObject.ContainsKey(fixupToken.ReferencedObject)); 86Debug.Assert(fixupToken.FixupType != FixupType.UnresolvedChildren && 452Debug.Assert(outEdge.FixupType == FixupType.UnresolvedChildren); 466Debug.Assert(parentDependencies.Contains(token));
System\Xaml\Context\NameFixupToken.cs (1)
131Debug.Assert(_runtime is null);
System\Xaml\Context\ObjectWriterContext.cs (6)
134Debug.Assert(!_nameResolutionComplete || value); 422Debug.Assert(frame is not null); 463Debug.Assert(frame is not null); 830Debug.Assert(frame.NameScopeDictionary is not null || frame.Depth == 0); 844Debug.Assert(nameScopeDictionary is not null); 880Debug.Assert(rootFrame.Depth == 1);
System\Xaml\Context\XamlContext.cs (1)
269Debug.Assert(typeName.Namespace is not null);
System\Xaml\InfosetObjects\DeferredWriter.cs (2)
149Debug.Assert(!property.IsDirective && !property.IsUnknown); 201Debug.Assert(_deferredTreeDepth == 0);
System\Xaml\InfosetObjects\XamlObjectWriter.cs (19)
401Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 433Debug.Assert(_context.LiveDepth > 0); 511Debug.Assert(_context.LiveDepth > 1); 617Debug.Assert(_context.LiveDepth > 0); 832Debug.Assert(_context.CurrentProperty.DeferringLoader is not null); 1197Debug.Assert(inst is not null); // runtime throws before it returns null. 1430Debug.Assert(ctx.ParentProperty == XamlLanguage.Key); 1644Debug.Assert(inst == ctx.ParentInstance); 1732Debug.Assert(parentInstance is not null || (parentProperty is not null && parentProperty.IsDirective) || ctx.LiveDepth == 1); 1778Debug.Assert(ctx.LiveDepth > 1); 1916Debug.Assert(ctx.CurrentProperty is null); 2135Debug.Assert(token.Target.Property == XamlLanguage.Key); 2397Debug.Assert(!_inNameResolution); 2400Debug.Assert(_nameFixupGraph is not null); 2490Debug.Assert(token.NeededNames.Count == 0 || nameResolutionIsComplete); 2587Debug.Assert(token.FixupType == FixupType.MarkupExtensionFirstRun && _lastInstance == token.ReferencedObject); 2614Debug.Assert(token.Target.KeyHolder.Key == token); 2624Debug.Assert(pendingAdd.Key == token); 2634Debug.Assert(pendingAdd.Item == token);
System\Xaml\Parser\GenericTypeNameParser.cs (4)
167Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.NAME); 198Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.OPEN); 230Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.COMMA); 241Debug.Assert(_scanner.Token == GenericTypeNameScannerToken.SUBSCRIPT);
System\Xaml\Parser\GenericTypeNameScanner.cs (3)
311Debug.Assert(_multiCharTokenStartIdx == -1 && _multiCharTokenLength == 0); 319Debug.Assert(_multiCharTokenStartIdx != -1 && _multiCharTokenLength > 0); 373Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\MeScanner.cs (1)
564Debug.Assert(KnownStrings.WhitespaceChars.Length == 5);
System\Xaml\Parser\NodeStreamSorter.cs (5)
580Debug.Assert(deepestIdx != -1); 588Debug.Assert(_sortingInfoArray[start].XamlNodeType == XamlNodeType.StartMember); 614Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 636Debug.Assert(_sortingInfoArray[current].XamlNodeType == XamlNodeType.StartMember); 688Debug.Assert(length1 > 0 && length2 > 0);
System\Xaml\Parser\XamlScanner.cs (4)
247Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 284Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 429Debug.Assert(_xmlReader.NodeType == XmlNodeType.Element); 788Debug.Assert(prop.IsUnknown);
System\Xaml\Parser\XamlScannerStack.cs (2)
75Debug.Assert(_stack.Count != 0); 85Debug.Assert(_stack.Count != 0);
System\Xaml\Parser\XamlText.cs (2)
271Debug.Assert(start > 0); 272Debug.Assert(end < text.Length);
System\Xaml\Runtime\DynamicMethodRuntime.cs (2)
131Debug.Assert(schemaContext is not null); 132Debug.Assert(accessLevel is not null);
System\Xaml\Schema\Reflector.cs (3)
274Debug.Assert(attributeType == typeof(XamlDeferLoadAttribute)); 275Debug.Assert(count == 2); 388Debug.Assert(value || (bitMask & bitToSet) == 0);
System\Xaml\Schema\TypeReflector.cs (2)
358Debug.Assert(!IsUnknown); 1148Debug.Assert(value);
System\Xaml\Schema\XamlDirective.cs (2)
23Debug.Assert(immutableXamlNamespaces is not null); 26Debug.Assert(ns is not null);
System\Xaml\Schema\XamlNamespace.cs (3)
159Debug.Assert(typeArgs[n] is not null); 160Debug.Assert(typeArgs[n].UnderlyingType is not null); 180Debug.Assert(_assemblyNamespaces.Count == 1);
System\Xaml\XamlBackgroundReader.cs (1)
160Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlMember.cs (1)
1073Debug.Assert(xamlMember2.IsDirective);
System\Xaml\XamlNodeList.cs (1)
79Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlNodeQueue.cs (1)
70Debug.Assert(XamlNode.IsEof_Helper(nodeType, data));
System\Xaml\XamlObjectReader.cs (2)
296Debug.Assert(false); // should never reach here 1771Debug.Assert(Object is not null);
System\Xaml\XamlType.cs (4)
1268Debug.Assert(typeArgs.Length == 1); 1310Debug.Assert(typeArgs.Length == 1); 1932Debug.Assert(xamlType1.IsUnknown); 1933Debug.Assert(xamlType2.IsUnknown);
System\Xaml\XamlXmlWriter.cs (26)
347Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartMember); 388Debug.Assert(ns is not null); 389Debug.Assert(prefix is not null); 508Debug.Assert(objectFrame.AllocatingNodeType == XamlNodeType.StartObject || 531Debug.Assert(frame.AllocatingNodeType == nodeType); 816Debug.Assert(writer.namespaceScopes.Count > 1); 819Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 834Debug.Assert(writer.namespaceScopes.Count > 1); 837Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartMember); 958Debug.Assert(writer.namespaceScopes.Count == 1); 1007Debug.Assert(writer.namespaceScopes.Count > 0); 1094Debug.Assert(writer.namespaceScopes.Count > 0); 1167Debug.Assert(writer.namespaceScopes.Count > 0); 1168Debug.Assert(writer.namespaceScopes.Peek().AllocatingNodeType == XamlNodeType.StartObject || 1245Debug.Assert(writer.namespaceScopes.Count > 0); 1380Debug.Assert(writer.namespaceScopes.Count > 0); 1445Debug.Assert(writer.namespaceScopes.Count > 0); 1447Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1581Debug.Assert(writer.namespaceScopes.Count > 0); 1583Debug.Assert(memberFrame.AllocatingNodeType == XamlNodeType.StartMember || 1776Debug.Assert(value is not null); 1922Debug.Assert(frame.AllocatingNodeType == XamlNodeType.StartObject); 1925Debug.Assert(objectXamlType is not null); 1966Debug.Assert(member is not null); 2095Debug.Assert(writer.ppStateInfo.CurrentDepth != 0); 2096Debug.Assert(writer.ppStateInfo.NodesList.Count != 0);
Templates.Blazor.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Templates.Blazor.WebAssembly.Auth.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Templates.Blazor.WebAssembly.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Templates.Mvc.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
Templates.Tests (2)
src\Shared\CertificateGeneration\CertificateManager.cs (1)
618Debug.Assert(pemEnvelope != null);
src\Shared\CertificateGeneration\MacOSCertificateManager.cs (1)
90Debug.Assert(oldTrustLevel == TrustLevel.Full); // Mac trust is all or nothing
UIAutomationClient (10)
MS\Internal\Automation\HwndProxyElementProvider.cs (1)
40Debug.Assert( hwnd != NativeMethods.HWND.NULL );
MS\Internal\Automation\SelectionPatternProviderSideWrapper.cs (1)
27Debug.Assert(target != null);
MS\Internal\Automation\UiaCoreApi.cs (1)
456Debug.Assert(offsets.Length == treeStructures.Length);
System\Windows\Automation\AutomationElement.cs (1)
756Debug.Assert(responses.Length == 1);
System\Windows\Automation\BasePattern.cs (1)
26Debug.Assert(el != null);
System\Windows\Automation\CacheRequest.cs (1)
550Debug.Assert( _request != null );
System\Windows\Automation\Text\TextRange.cs (2)
58Debug.Assert(!hTextRange.IsInvalid); 59Debug.Assert(pattern != null);
System\Windows\Automation\TextPattern.cs (2)
33Debug.Assert(el != null); 34Debug.Assert(!hPattern.IsInvalid);
UIAutomationClientSideProviders (38)
MS\Internal\AutomationProxies\Accessible.cs (7)
317Debug.Assert(parent != null); 328Debug.Assert(false); 344Debug.Assert(parent != null); 355Debug.Assert(false); 729Debug.Assert(_idChild == NativeMethods.CHILD_SELF); 774Debug.Assert(false); 983Debug.Assert(_accessibleChildrenIndex < 0);
MS\Internal\AutomationProxies\CommonXSendMessage.cs (1)
95System.Diagnostics.Debug.Assert(remoteTextArea.ToInt32() == remoteTextArea.ToInt64());
MS\Internal\AutomationProxies\Misc.cs (2)
1971Debug.Assert(System.Environment.OSVersion.Version.Major < 6); 2042Debug.Assert(System.Environment.OSVersion.Version.Major >= 6);
MS\Internal\AutomationProxies\MSAAEventDispatcher.cs (2)
125Debug.Assert(refcount >= 0); 362Debug.Assert(eventId == NativeMethods.EVENT_OBJECT_REORDER);
MS\Internal\AutomationProxies\MSAANativeProvider.cs (5)
53Debug.Assert(hwnd != IntPtr.Zero); 225Debug.Assert(_hwnd == UnsafeNativeMethods.WindowFromPhysicalPoint((int)x, (int)y)); 341Debug.Assert(false); 1025Debug.Assert(!IsRoot); 1078Debug.Assert(_hwnd != IntPtr.Zero);
MS\Internal\AutomationProxies\WindowsEditBox.cs (4)
515Debug.Assert(!IsMultiline); 522Debug.Assert(IsMultiline); 962Debug.Assert(floor >= 0); 973Debug.Assert(i >= floor);
MS\Internal\AutomationProxies\WindowsEditBoxRange.cs (1)
40Debug.Assert(provider != null);
MS\Internal\AutomationProxies\WindowsListView.cs (1)
1963System.Diagnostics.Debug.Assert(el is ListViewItemCheckbox);
MS\Internal\AutomationProxies\WindowsRichEdit.cs (4)
227Debug.Assert(_document != null); 267Debug.Assert(_document != null); 274Debug.Assert(range.Start == range.End); 310Debug.Assert(_document != null);
MS\Internal\AutomationProxies\WindowsRichEditRange.cs (11)
24Debug.Assert(range != null); 25Debug.Assert(pattern != null); 241Debug.Assert(text == null || text.Length == maxLength); 1117Debug.Assert(charMoved == 0 || charMoved == 1); 1120Debug.Assert(paraMoved == 0 || paraMoved == 1); 1146Debug.Assert(charMoved == 0 || charMoved == -1); 1149Debug.Assert(paraMoved == 0 || paraMoved == -1); 1175Debug.Assert(charMoved == 0 || charMoved == 1); 1178Debug.Assert(paraMoved == 0 || paraMoved == 1); 1204Debug.Assert(charMoved == 0 || charMoved == -1); 1207Debug.Assert(paraMoved == 0 || paraMoved == -1);
UIAutomationTypes (2)
src\Microsoft.DotNet.Wpf\src\Shared\MS\Win32\NativeMethodsOther.cs (1)
17Debug.Assert((0xFFFF0000 & errorCode) == 0);
System\Windows\Automation\AutomationIdentifier.cs (1)
47Debug.Assert(id != 0);
vbc (8)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
504Debug.Assert(reason is object);
src\Compilers\Shared\BuildClient.cs (3)
158Debug.Assert(serverResult.Value.RanOnServer); 239Debug.Assert(buildResponse != null); 274Debug.Assert(false);
src\Compilers\Shared\BuildServerConnection.cs (4)
68Debug.Assert(workingDirectory is object); 179Debug.Assert(pipeName is object); 703Debug.Assert(Stream is null); 741Debug.Assert(Stream is not null);
VBCSCompiler (24)
src\Compilers\Core\CommandLine\BuildProtocol.cs (1)
504Debug.Assert(reason is object);
src\Compilers\Server\VBCSCompiler\MetadataCache.cs (1)
75Debug.Assert(fileKey.HasValue);
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\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); 249Debug.Assert(_listenTask != null); 283Debug.Assert(current.Status == TaskStatus.RanToCompletion);
src\Compilers\Shared\BuildClient.cs (3)
158Debug.Assert(serverResult.Value.RanOnServer); 239Debug.Assert(buildResponse != null); 274Debug.Assert(false);
src\Compilers\Shared\BuildServerConnection.cs (4)
68Debug.Assert(workingDirectory is object); 179Debug.Assert(pipeName is object); 703Debug.Assert(Stream is null); 741Debug.Assert(Stream is not null);
VBCSCompiler.UnitTests (1)
NamedPipeTestUtil.cs (1)
68Debug.Assert(sharedServer is object);
WindowsFormsIntegration (1)
System\Windows\Integration\ApplicationInterop.cs (1)
217Debug.Assert(windowFilter != null);
xunit.console (1)
common\AssemblyResolution\Microsoft.Extensions.DependencyModel\DependencyContextLoader.cs (1)
97Debug.Assert(_fileSystem.File.Exists(location));