63203 references to Debug
aspire (40)
Aspire.Azure.AI.Inference (1)
Aspire.Azure.AI.OpenAI (1)
Aspire.Azure.Data.Tables (1)
Aspire.Azure.Messaging.EventHubs (1)
Aspire.Azure.Messaging.ServiceBus (1)
Aspire.Azure.Messaging.WebPubSub (1)
Aspire.Azure.Npgsql (2)
Aspire.Azure.Npgsql.EntityFrameworkCore.PostgreSQL (2)
Aspire.Azure.Search.Documents (1)
Aspire.Azure.Security.KeyVault (1)
Aspire.Azure.Storage.Blobs (1)
Aspire.Azure.Storage.Files.DataLake (1)
Aspire.Azure.Storage.Queues (1)
Aspire.Confluent.Kafka (2)
Aspire.Dashboard (60)
Aspire.Hosting (39)
Aspire.Hosting.Analyzers (1)
Aspire.Hosting.Azure (2)
Aspire.Hosting.Azure.AppContainers (3)
Aspire.Hosting.Azure.CosmosDB (2)
Aspire.Hosting.Azure.PostgreSQL (1)
Aspire.Hosting.Azure.Redis (2)
Aspire.Hosting.Integration.Analyzers (1)
Aspire.Hosting.RemoteHost (2)
Aspire.Microsoft.Azure.Cosmos (1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (1)
Aspire.Microsoft.Extensions.Configuration.AzureAppConfiguration (1)
Aspire.Playground.Tests (2)
Aspire.RabbitMQ.Client (5)
Aspire.TestUtilities (1)
CodeStyleConfigFileGenerator (5)
ConfigurationSchemaGenerator (31)
crossgen2 (9)
csc (12)
CSharpSyntaxGenerator (7)
dotnet (84)
dotnet-aot (18)
dotnet-dev-certs (3)
dotnet-format (4)
dotnet-sourcelink (1)
dotnet-svcutil-lib (1435)
FrameworkFork\Microsoft.Xml\Xml\BinaryXml\SqlUtils.cs (24)
143Debug.Assert(rguiData.Length == 4);
168Debug.Assert(rgulU.Length == s_cNumeMax);
175Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!");
176Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero");
177Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array");
313Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_lInt32Base", "");
338Debug.Assert(dwlAccum < s_ulInt32Base);
357Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_dwlBaseUI4", "Integer overflow");
407Debug.Assert(dwlAccum < dwlDivisor);
409Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base);
433Debug.Assert(dwlAccum < s_ulInt32Base);
452Debug.Assert(bPrec <= s_maxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision");
458Debug.Assert(uiDigit < 10);
572Debug.Assert(m_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid");
573Debug.Assert(m_bScale <= m_bPrec, "m_bScale <= m_bPrec", "In AssertValid");
574Debug.Assert(m_bScale >= 0, "m_bScale >= 0", "In AssertValid");
575Debug.Assert(m_bPrec > 0, "m_bPrec > 0", "In AssertValid");
576Debug.Assert(CLenFromPrec(m_bPrec) >= m_bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid");
577Debug.Assert(m_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid");
584Debug.Assert(m_bLen == 1, "m_bLen == 1", "In AssertValid");
589Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid");
644Debug.Assert(val >= 0 && val < 100);
650Debug.Assert(val > -10000 && val < 10000);
662Debug.Assert(val >= 0 && val < 1000);
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNode.cs (13)
158Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true.");
213Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized.");
225Debug.Assert(localName == null || (object)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized.");
363Debug.Assert(info != null && idxParent <= UInt16.MaxValue);
374Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, "Line number offset too large or small: " + lineNumOffset);
375Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, "Line position offset too large or small: " + linePosOffset);
385Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, "Collapsed text line position offset too large or small: " + posOffset);
402Debug.Assert(NodeType == XPathNodeType.Element);
413Debug.Assert(NodeType == XPathNodeType.Element);
441Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= UInt16.MaxValue, "Bad argument");
442Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once.");
460Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= UInt16.MaxValue, "Bad argument");
461Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
FrameworkFork\Microsoft.Xml\Xml\Cache\XPathNodeHelper.cs (32)
30Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
74Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
79Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute);
93Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
113Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
123Debug.Assert(idx != 0);
141Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
164Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
182Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
183Debug.Assert(idxNode <= UInt16.MaxValue);
184Debug.Assert(pageNode[0].PageInfo.PageNumber <= Int16.MaxValue);
197Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
203Debug.Assert(idx != 0);
231Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
264Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
302Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
315Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace);
334Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
335Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute);
371Debug.Assert(idxAnc != 0 && pageAnc != null);
397Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
427Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
454Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
516Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
613Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
614Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text.");
615Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case.");
652Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces.");
671Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
672Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case.");
749Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild.");
750Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
FrameworkFork\Microsoft.Xml\Xml\Core\XmlTextReaderImpl.cs (200)
323Debug.Assert(nt != null);
343Debug.Assert(_index == 0);
387Debug.Assert(_nameTableFromSettings == false);
408Debug.Assert(_index == 0);
457Debug.Assert(false);
621Debug.Assert(baseUri == null);
714Debug.Assert(baseUri == null);
774Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both");
822Debug.Assert(xmlFragment != null);
848default: Debug.Assert(false); goto case XmlNodeType.None;
1218Debug.Assert(false, "Invalid InitInputType");
1242Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent);
1245Debug.Assert(!_ps.appendMode);
1273Debug.Assert(_parsingFunction == ParsingFunction.ElementContent ||
1278Debug.Assert(_curNode.type == XmlNodeType.Element);
1342Debug.Assert(false);
1370Debug.Assert(false);
1402Debug.Assert(_curNode.type == XmlNodeType.EndElement);
1403Debug.Assert(_parsingFunction != ParsingFunction.Eof);
1505Debug.Assert(_parsingMode == ParsingMode.Full);
1524Debug.Assert(false);
1550Debug.Assert(false);
1566Debug.Assert(value is XmlTextReader);
1585Debug.Assert(_outerReader is XmlTextReaderImpl);
2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create.");
2076Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create.");
2104Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create.");
2109Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create.");
2128Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create.");
2133Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create.");
2185Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create.");
2226Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create.");
2228Debug.Assert(_stringBuilder.Length == 0);
2268Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create.");
2269Debug.Assert(_outerReader is XmlTextReader);
2310Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create.");
2311Debug.Assert(_outerReader is XmlTextReader);
2347Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create.");
2348Debug.Assert(_outerReader is XmlTextReader);
2479Debug.Assert(value >= 0 && value <= _ps.charsUsed);
2566Debug.Assert(_parsingMode == ParsingMode.Full);
2655Debug.Assert(_parsingStatesStackTop == -1);
2656Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0));
2671Debug.Assert(_ps.appendMode);
2687Debug.Assert(_parsingStatesStackTop == -1);
2688Debug.Assert(internalDtd != null);
2845Debug.Assert(InAttributeValueIterator);
2881Debug.Assert(baseUriStr != null);
2887Debug.Assert(baseUri != null);
2898Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null);
2899Debug.Assert(baseUriStr != null);
2900Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr)));
2991Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null);
2992Debug.Assert(baseUriStr != null);
3022Debug.Assert(_ps.stream == null && _ps.textReader == null);
3023Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0);
3024Debug.Assert(baseUriStr != null);
3025Debug.Assert(str != null);
3080Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl);
3084Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl);
3085Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent);
3109Debug.Assert(context != null && context.HasDtdInfo);
3123Debug.Assert(false, "Unhandled DtdProcessing enumeration value.");
3133Debug.Assert(_url != null && _url.Length > 0);
3140Debug.Assert(_xmlResolver != null || !Microsoft.Xml.XmlReaderSettings.EnableLegacyXmlSettings());
3166Debug.Assert(_ps.bytes != null);
3167Debug.Assert(_ps.bytePos == 0);
3251Debug.Assert(_ps.charPos == 0);
3279Debug.Assert(_ps.stream != null);
3337Debug.Assert(newEncoding.EncodingName != "UTF-8");
3351Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null);
3352Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false");
3354Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range.");
3362Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos,
3370Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos,
3533Debug.Assert(_ps.charsUsed < _ps.chars.Length);
3543Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null);
3544Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1);
3568Debug.Assert(maxCharsCount >= charsCount);
3587Debug.Assert(false, "We should get an exception again.");
3660Debug.Assert(_stringBuilder.Length == 0 || isTextDecl);
3881Debug.Assert(!isTextDecl);
3891Debug.Assert(false);
4147Debug.Assert(pos == _ps.charsUsed && !_ps.isEof);
4171Debug.Assert(_index == 0);
4545Debug.Assert(_curNode.type == XmlNodeType.Element);
4724Debug.Assert(false, "We should never get to this point.");
4733Debug.Assert(_index > 0);
4738Debug.Assert(_curNode == startTagNode);
4765Debug.Assert(startTag.type == XmlNodeType.EntityReference);
4777Debug.Assert(_attrCount == 0);
4837Debug.Assert(_curNode.type == XmlNodeType.Element);
4845Debug.Assert(_curNode.type == XmlNodeType.Element);
4966Debug.Assert(attrNameLineNo == _ps.LineNo);
5015Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!");
5090Debug.Assert(_curNode.type == XmlNodeType.Element);
5227Debug.Assert(_stringBuilder.Length == 0);
5438Debug.Assert(false, "We should never get to this point.");
5441Debug.Assert(_ps.isEof);
5459Debug.Assert(false);
5499Debug.Assert(attr.nextAttrValueChunk == null);
5528Debug.Assert(_stringBuilder.Length == 0);
5542Debug.Assert(endPos - startPos > 0);
5565Debug.Assert(_stringBuilder.Length > 0);
5586Debug.Assert(endPos - startPos > 0);
5853Debug.Assert(_ps.isEof);
5895Debug.Assert(_stringBuilder.Length == 0);
5896Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue ||
5910Debug.Assert(_stringBuilder.Length > 0);
5964Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk ||
5976Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk);
5981Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent);
5993Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary);
5998Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent);
6026Debug.Assert(_stringBuilder.Length == 0);
6067Debug.Assert(_ps.chars[_ps.charPos] == '&');
6076Debug.Assert(_ps.chars[_ps.charPos] == '&');
6091Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex);
6243Debug.Assert(false);
6284Debug.Assert(_lastEntity != null);
6290Debug.Assert(_curNode.depth == _index);
6303Debug.Assert(_curNode.type == XmlNodeType.EntityReference);
6304Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName));
6323Debug.Assert(_stringBuilder.Length == 0);
6349Debug.Assert(_ps.charPos < _ps.charsUsed);
6393Debug.Assert(_stringBuilder.Length == 0);
6451Debug.Assert(!_ps.eolNormalized);
6598Debug.Assert(_stringBuilder.Length == 0);
6659Debug.Assert(!_ps.eolNormalized);
6838Debug.Assert(_dtdProcessing == DtdProcessing.Ignore);
7166Debug.Assert(false, "We should never get to this point.");
7169Debug.Assert(_ps.isEof);
7272Debug.Assert(false, "We should never get to this point.");
7275Debug.Assert(_ps.isEof);
7284Debug.Assert(_ps.chars[startPos] == '&');
7316Debug.Assert(_ps.chars[_ps.charPos] == '&');
7336Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#');
7449Debug.Assert(pos > 0);
7485Debug.Assert(_ps.chars[_ps.charPos] == '&');
7505Debug.Assert(startPos < _ps.charsUsed);
7506Debug.Assert(_ps.chars[startPos] == '&');
7507Debug.Assert(_ps.chars[startPos + 1] != '#');
7615Debug.Assert(pos > 0);
7771Debug.Assert(nodeIndex < _nodes.Length);
7772Debug.Assert(_nodes[_nodes.Length - 1] == null);
7785Debug.Assert(nodeIndex < _nodes.Length);
7792Debug.Assert(nodeIndex < _nodes.Length);
7865Debug.Assert(attr.type == XmlNodeType.Attribute);
7899Debug.Assert(_ps.isEof);
7960Debug.Assert(_xmlContext.defaultNamespace == uri);
7996Debug.Assert(_curNode.xmlContextPushed);
8093Debug.Assert(_xmlResolver != null);
8110Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver");
8131Debug.Assert(entity.IsExternal);
8144Debug.Assert(_ps.appendMode);
8173Debug.Assert(!entity.IsExternal);
8243Debug.Assert(_parsingStatesStackTop == -1);
8259Debug.Assert(_parsingStatesStackTop >= 0);
8360Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 2, 2, "?>"));
8368Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 3, 3, "-->"));
8376Debug.Assert(XmlConvert.StrEqual(_ps.chars, _ps.charPos - 3, 3, "]]>"));
8400Debug.Assert(false);
8403Debug.Assert(_incReadState == IncrementalReadState.Text ||
8515Debug.Assert(_ps.charPos - pos == 0);
8516Debug.Assert(_ps.charPos - startPos == 0);
8555Debug.Assert(_ps.charPos - pos == 0);
8556Debug.Assert(_ps.charPos - startPos == 0);
8653Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full.");
8670Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!");
8676Debug.Assert(_fragmentType == XmlNodeType.Attribute);
8693Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue);
8720Debug.Assert(_stringBuilder.Length == 0);
8734Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!");
8788Debug.Assert(false, "We should never get to this point.");
8843Debug.Assert(false, "We should never get to this point.");
8931Debug.Assert(_ps.charPos < _ps.charsUsed);
9000Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo);
9016Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary);
9042Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
9043Debug.Assert(_curNode.type == XmlNodeType.Element);
9121Debug.Assert(context != null);
9142Debug.Assert(nt != null);
9143Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor.");
9159Debug.Assert(_nameTableFromSettings == false);
9187Debug.Assert(_dtdInfo == null);
9246Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
9348Debug.Assert(attr != null);
9373Debug.Assert(prefix != null);
9394Debug.Assert(attr != null);
9426Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9444Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9478Debug.Assert(_incReadDecoder != null);
9587Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
9646Debug.Assert(characters >= 0);
9688Debug.Assert(startPos >= 0);
9689Debug.Assert(endPos < chars.Length);
9690Debug.Assert(startPos <= endPos);
9700Debug.Assert(startPos >= 0);
9701Debug.Assert(endPos < str.Length);
9702Debug.Assert(startPos <= endPos);
FrameworkFork\Microsoft.Xml\Xml\schema\XmlValueConverter.cs (8)
287Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null");
297Debug.Assert(schemaType.Datatype.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself");
321Debug.Assert(false, "Type code " + typeCode + " is not supported.");
529Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType");
3451Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null,
3583Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
3611Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
3678Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
dotnet-watch (12)
DotNetWatchTasks (1)
GenerateDocumentationAndConfigFiles (560)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
GetDocument.Insider (1)
ILAssembler (13)
ilc (11)
ILCompiler.Compiler (1369)
Compiler\DependencyAnalysis\GenericLookupResult.cs (49)
30Debug.Assert(owningTypeDefinition.Instantiation.Length == TypeInstantiation.Length);
31Debug.Assert(MethodInstantiation.IsNull || MethodInstantiation.Length == 0);
36Debug.Assert(_canonicalOwner is MethodDesc);
38Debug.Assert(owningMethodDefinition.Instantiation.Length == MethodInstantiation.Length);
44Debug.Assert(owningType.Instantiation.Length == TypeInstantiation.Length);
49Debug.Assert(owningMethodDefinition.OwningType.Instantiation.IsNull
120Debug.Assert(InstantiationIsConcrete(dictionary.TypeInstantiation));
121Debug.Assert(InstantiationIsConcrete(dictionary.MethodInstantiation));
167Debug.Assert(x.GetType() == y.GetType());
172Debug.Assert(result != 0);
178Debug.Assert(x.GetType() != y.GetType());
196Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
208Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
255Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
266Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
313Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
324Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
371Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
387Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
434Debug.Assert(method.IsRuntimeDeterminedExactMethod, "Concrete method in a generic dictionary?");
447Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any));
499Debug.Assert(field.OwningType.IsRuntimeDeterminedSubtype, "Concrete field in a generic dictionary?");
510Debug.Assert(!instantiatedField.OwningType.IsCanonicalSubtype(CanonicalFormKind.Any));
555Debug.Assert(method.IsRuntimeDeterminedExactMethod, "Concrete method in a generic dictionary?");
569Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any));
620Debug.Assert(method.IsRuntimeDeterminedExactMethod);
638Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any));
703Debug.Assert(method.IsRuntimeDeterminedExactMethod);
704Debug.Assert(method.IsVirtual);
705Debug.Assert(method.HasInstantiation || method.OwningType.IsInterface);
733Debug.Assert(instantiatedMethod.IsCanonicalMethod(CanonicalFormKind.Any));
783Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?");
784Debug.Assert(type is MetadataType);
795Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
840Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?");
841Debug.Assert(type is MetadataType);
852Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
896Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete static base in a generic dictionary?");
897Debug.Assert(type is MetadataType);
908Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
953Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
964Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
1005Debug.Assert(type.IsRuntimeDeterminedSubtype, "Concrete type in a generic dictionary?");
1016Debug.Assert(!instantiatedType.IsCanonicalSubtype(CanonicalFormKind.Any));
1064Debug.Assert(_constraintType.IsRuntimeDeterminedSubtype || _constrainedMethod.IsRuntimeDeterminedExactMethod, "Concrete type in a generic dictionary?");
1065Debug.Assert(!_constrainedMethod.HasInstantiation || !_directCall, "Direct call to constrained generic method isn't supported");
1094Debug.Assert(!instantiatedConstrainedMethod.IsCanonicalMethod(CanonicalFormKind.Any));
1095Debug.Assert(!instantiatedConstraintType.IsCanonicalSubtype(CanonicalFormKind.Any));
1134Debug.Assert(instantiatedConstraintType.IsValueType || (instantiatedConstrainedMethod.OwningType.IsInterface && instantiatedConstrainedMethod.Signature.IsStatic));
Compiler\DependencyAnalysis\NativeLayoutVertexNode.cs (46)
39Debug.Assert(Marked);
87Debug.Assert(SavedVertex == null || ReferenceEquals(SavedVertex, value));
163Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
171Debug.Assert(_instantiationArgsSig == null || (_instantiationArgsSig != null && _method.Instantiation.Length == _instantiationArgsSig.Length));
284Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
295Debug.Assert(_signature.Length == _parametersSig.Length);
337Debug.Assert(type.IsDefType);
361Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
386Debug.Fail("UNREACHABLE");
405Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
422Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
433Debug.Fail("UNREACHABLE");
445Debug.Assert(type.HasInstantiation && !type.IsGenericDefinition);
465Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
480Debug.Assert(!type.IsRuntimeDeterminedSubtype);
481Debug.Assert(!type.HasInstantiation || type.IsGenericDefinition);
497Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
527Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
644Debug.Assert(method.HasInstantiation);
666Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
674Debug.Assert(NeedsEntrypoint(_method));
709Debug.Assert(nodeFactory.LazyGenericsPolicy.UsesLazyGenerics(owningMethod));
710Debug.Assert(owningMethod.IsCanonicalMethod(CanonicalFormKind.Any));
711Debug.Assert(owningMethod.HasInstantiation);
716Debug.Assert(nodeFactory.LazyGenericsPolicy.UsesLazyGenerics(owningType));
717Debug.Assert(owningType.IsCanonicalSubtype(CanonicalFormKind.Any));
727Debug.Assert(owningMethod.HasInstantiation);
765Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
770Debug.Assert(associatedLayout.Marked);
809Debug.Assert(method.HasInstantiation);
810Debug.Assert(!method.IsGenericMethodDefinition);
811Debug.Assert(method.IsCanonicalMethod(CanonicalFormKind.Any));
812Debug.Assert(method.GetCanonMethodTarget(CanonicalFormKind.Specific) == method, "Assert that the canonical method passed in is in standard canonical form");
849Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
886Debug.Assert(type.IsCanonicalSubtype(CanonicalFormKind.Any));
887Debug.Assert(type.ConvertToCanonForm(CanonicalFormKind.Specific) == type, "Assert that the canonical type passed in is in standard canonical form");
897Debug.Assert(GenericTypesTemplateMap.IsArrayTypeEligibleForTemplate(type));
899Debug.Assert(defType.Instantiation.Length == 1);
1007Debug.Assert(Marked, "WriteVertex should only happen for marked vertices");
1288Debug.Assert(method.HasInstantiation);
1331Debug.Assert(method.HasInstantiation);
1371Debug.Assert(field.OwningType.IsRuntimeDeterminedSubtype);
1465Debug.Assert(_constrainedMethod.OwningType.IsInterface);
1466Debug.Assert(!_constrainedMethod.HasInstantiation || !directCall);
1531Debug.Assert(SignatureKind is FixupSignatureKind.GenericConstrainedMethod);
1537Debug.Assert(SignatureKind is FixupSignatureKind.NonGenericStaticConstrainedMethod or FixupSignatureKind.NonGenericInstanceConstrainedMethod);
ILCompiler.DependencyAnalysisFramework (16)
ILCompiler.MetadataTransform (181)
ILCompiler.ReadyToRun (905)
src\runtime\src\coreclr\tools\Common\Compiler\ObjectWriter\WasmObjectWriter.cs (37)
92Debug.Assert(added,
189Debug.Assert(bytesWritten == encodeSize);
280Debug.Assert(section != null || alignment == 1, $"Section: {sectionIndex} is not a WebcilSection but alignment {alignment} requested");
422Debug.Assert(BitOperations.IsPow2(webcilSection.MinAlignment) && BitOperations.IsPow2(WebcilSectionAlignment) &&
456Debug.Assert(peCliHeaderRva != 0);
462Debug.Assert(peDebugRva != 0);
469Debug.Assert(webcilSections.Length > 0);
470Debug.Assert(webcilSections[webcilSections.Length - 1].Name.ToString() == "reloc");
520Debug.Assert(_sections.Sections.Count == sectionIndex);
537Debug.Assert(MethodCount == totalMethodCount);
560Debug.Assert(added, $"Duplicate global name: {name}");
565Debug.Assert(written == size);
618Debug.Assert(writer.SectionIndex == _sections.Count - 1, "The .reloc section must be the last section we emit.");
648Debug.Assert(outputFileStream.CanSeek, $"EmitObjectFile requires seekable output stream");
735Debug.Assert(section.Header.SizeOfRawData - bytesWritten == section.Padding, $"Unexpected padding: {section.Header.SizeOfRawData - bytesWritten} != {section.Padding}");
745Debug.Assert(webcilStream.Position == _webcilSegment.GetFlatMappedSize(), $"Total Size Mismatch: {webcilStream.Position} != {_webcilSegment.GetFlatMappedSize()}");
794Debug.Assert(_sections[sectionIndex] is WebcilSection);
828Debug.Assert(_sections[pending.SectionIndex] is WebcilSection);
830Debug.Assert(pending.Offset >= 0, "Pending base relocation has a negative offset.");
836Debug.Assert(targetRva != 0); // this section should have been assigned a non-zero VirtualAddress at this point.
872Debug.Assert(sectionStream.Position + (long)decoded <= sectionStream.Length);
911Debug.Assert(writeCursor <= blobs[b].Start, $"Write cursor {writeCursor} is beyond the start of blob {blobs[b].Start}");
929Debug.Assert(sectionStream.Position == firstReloc.Offset, $"Section stream position sectionStream.Position does not match first reloc offset {firstReloc.Offset}");
948Debug.Assert(nextStart == sectionStream.Position);
955Debug.Assert(tempStream.Position <= blob.Size && blob.Size <= tempStream.Length, $"Temp stream position {tempStream.Position} exceeds blob size {blob.Size}");
989Debug.Assert(newBlobs.Count == blobs.Count);
992Debug.Assert(newBlobs[i].Size + blobShrink[i] == blobs[i].Size);
1020Debug.Assert(IsWithinSection(virtualRelocOffset, curSectionAsWebcil));
1031Debug.Assert(IsWithinSection(virtualSymbolImageOffset, symbolWebcilSection));
1078Debug.Assert(symbolWebcilSection != null);
1082Debug.Assert(symbolWebcilSection != null);
1087Debug.Assert(symbolWebcilSection != null);
1091Debug.Assert(symbolWebcilSection != null);
1148Debug.Assert(symbol.IndexSpace == WasmIndexSpace.Tag);
1186Debug.Assert(sectionStream.CanSeek);
1187Debug.Assert(sectionStream.Length >= 0);
1287Debug.Assert(_definedGlobals.ContainsKey("webcilVersion"));
src\runtime\src\coreclr\tools\Common\Internal\Runtime\RiscVLoongArch64FpStruct.cs (30)
61Debug.Assert(index < 2);
63Debug.Assert(size == sizeof(float) || size == sizeof(double));
65Debug.Assert(size >= 1 && size <= 8);
66Debug.Assert((size & (size - 1)) == 0, "size needs to be a power of 2");
72Debug.Assert((int)PosIntFloat == (int)PosFloatInt + 1, "FloatInt and IntFloat need to be adjacent");
73Debug.Assert((int)PosSizeShift2nd == (int)PosSizeShift1st + 2, "SizeShift1st and 2nd need to be adjacent");
87Debug.Assert(nElements == 1, "HasImpliedRepeatedFields must have returned a false, it can't be an array");
91Debug.Assert(nFlattenedFieldsPerElement == 1 || nFlattenedFieldsPerElement == 2);
101Debug.Assert(elementTypeIndex == 0);
102Debug.Assert(typeIndex == 1);
105Debug.Assert((int)FpStruct.IntFloat == ((int)FpStruct.FloatInt << 1),
107Debug.Assert((int)FpStruct.SizeShift2ndMask == ((int)FpStruct.SizeShift1stMask << 2),
115Debug.Assert(info.Size1st() == info.Size2nd());
176Debug.Assert(nFields == 1);
182Debug.Assert(nElements > 0, "InlineArray length must be > 0");
196Debug.Assert(arch is TargetArchitecture.RiscV64 or TargetArchitecture.LoongArch64);
209Debug.Assert(nFields == 1 || nFields == 2);
221Debug.Assert((info.flags & (OnlyOne | BothFloat)) == 0);
222Debug.Assert((info.flags & FloatInt) == 0 || info.Size1st() == sizeof(float) || info.Size1st() == sizeof(double));
223Debug.Assert((info.flags & IntFloat) == 0 || info.Size2nd() == sizeof(float) || info.Size2nd() == sizeof(double));
227Debug.Assert(nFields == 2);
232Debug.Assert((info.flags & FloatInt) != 0);
233Debug.Assert((info.flags & (IntFloat | SizeShift2ndMask)) == 0);
234Debug.Assert(info.offset2nd == 0);
237Debug.Assert(nFields == ((info.flags & OnlyOne) != 0 ? 1 : 2));
239Debug.Assert(floatFlags != 0);
240Debug.Assert(((uint)floatFlags & ((uint)floatFlags - 1)) == 0,
246Debug.Assert(end1st <= info.offset2nd || end2nd <= info.offset1st, "fields must not overlap");
248Debug.Assert(info.offset1st + info.Size1st() <= td.GetElementSize().AsInt);
249Debug.Assert(info.offset2nd + info.Size2nd() <= td.GetElementSize().AsInt);
ILCompiler.RyuJit (253)
src\runtime\src\coreclr\tools\Common\Internal\Runtime\RiscVLoongArch64FpStruct.cs (30)
61Debug.Assert(index < 2);
63Debug.Assert(size == sizeof(float) || size == sizeof(double));
65Debug.Assert(size >= 1 && size <= 8);
66Debug.Assert((size & (size - 1)) == 0, "size needs to be a power of 2");
72Debug.Assert((int)PosIntFloat == (int)PosFloatInt + 1, "FloatInt and IntFloat need to be adjacent");
73Debug.Assert((int)PosSizeShift2nd == (int)PosSizeShift1st + 2, "SizeShift1st and 2nd need to be adjacent");
87Debug.Assert(nElements == 1, "HasImpliedRepeatedFields must have returned a false, it can't be an array");
91Debug.Assert(nFlattenedFieldsPerElement == 1 || nFlattenedFieldsPerElement == 2);
101Debug.Assert(elementTypeIndex == 0);
102Debug.Assert(typeIndex == 1);
105Debug.Assert((int)FpStruct.IntFloat == ((int)FpStruct.FloatInt << 1),
107Debug.Assert((int)FpStruct.SizeShift2ndMask == ((int)FpStruct.SizeShift1stMask << 2),
115Debug.Assert(info.Size1st() == info.Size2nd());
176Debug.Assert(nFields == 1);
182Debug.Assert(nElements > 0, "InlineArray length must be > 0");
196Debug.Assert(arch is TargetArchitecture.RiscV64 or TargetArchitecture.LoongArch64);
209Debug.Assert(nFields == 1 || nFields == 2);
221Debug.Assert((info.flags & (OnlyOne | BothFloat)) == 0);
222Debug.Assert((info.flags & FloatInt) == 0 || info.Size1st() == sizeof(float) || info.Size1st() == sizeof(double));
223Debug.Assert((info.flags & IntFloat) == 0 || info.Size2nd() == sizeof(float) || info.Size2nd() == sizeof(double));
227Debug.Assert(nFields == 2);
232Debug.Assert((info.flags & FloatInt) != 0);
233Debug.Assert((info.flags & (IntFloat | SizeShift2ndMask)) == 0);
234Debug.Assert(info.offset2nd == 0);
237Debug.Assert(nFields == ((info.flags & OnlyOne) != 0 ? 1 : 2));
239Debug.Assert(floatFlags != 0);
240Debug.Assert(((uint)floatFlags & ((uint)floatFlags - 1)) == 0,
246Debug.Assert(end1st <= info.offset2nd || end2nd <= info.offset1st, "fields must not overlap");
248Debug.Assert(info.offset1st + info.Size1st() <= td.GetElementSize().AsInt);
249Debug.Assert(info.offset2nd + info.Size2nd() <= td.GetElementSize().AsInt);
ILCompiler.TypeSystem (310)
illink (215)
ILLink.RoslynAnalyzer (127)
Microsoft.Analyzers.Local.Tests (1)
Microsoft.AspNetCore (6)
Microsoft.AspNetCore.Analyzers (3)
Microsoft.AspNetCore.Antiforgery (25)
Microsoft.AspNetCore.App.Analyzers (84)
Microsoft.AspNetCore.App.CodeFixes (2)
Microsoft.AspNetCore.Authentication (1)
Microsoft.AspNetCore.Authentication.Cookies (2)
Microsoft.AspNetCore.Authentication.Negotiate (5)
Microsoft.AspNetCore.Components (59)
Microsoft.AspNetCore.Components.Endpoints (40)
Microsoft.AspNetCore.Components.Media (1)
Microsoft.AspNetCore.Components.QuickGrid (2)
Microsoft.AspNetCore.Components.Server (30)
Microsoft.AspNetCore.Components.Web (9)
Microsoft.AspNetCore.Components.WebAssembly (2)
Microsoft.AspNetCore.Components.WebView (1)
Microsoft.AspNetCore.CookiePolicy (1)
Microsoft.AspNetCore.Cryptography.Internal (6)
Microsoft.AspNetCore.Cryptography.KeyDerivation (17)
Microsoft.AspNetCore.DataProtection (70)
Microsoft.AspNetCore.DataProtection.Abstractions (3)
Microsoft.AspNetCore.DataProtection.MicroBenchmarks (15)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (3)
Microsoft.AspNetCore.Diagnostics (12)
Microsoft.AspNetCore.Diagnostics.EntityFrameworkCore (10)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (3)
Microsoft.AspNetCore.Grpc.JsonTranscoding (5)
Microsoft.AspNetCore.Hosting (18)
Microsoft.AspNetCore.Html.Abstractions (2)
Microsoft.AspNetCore.Http (12)
Microsoft.AspNetCore.Http.Abstractions (26)
Microsoft.AspNetCore.Http.Connections (7)
Microsoft.AspNetCore.Http.Connections.Client (10)
Microsoft.AspNetCore.Http.Connections.Common (3)
Microsoft.AspNetCore.Http.Extensions (34)
Microsoft.AspNetCore.Http.RequestDelegateGenerator (5)
Microsoft.AspNetCore.Http.Results (7)
Microsoft.AspNetCore.HttpLogging (21)
Microsoft.AspNetCore.Identity (66)
_generated\0\GeneratedRouteBuilderExtensions.g.cs (60)
70Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
71Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
83Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
84Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
85Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
86Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
189Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
190Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
203Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
204Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
205Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
206Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
375Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
376Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
387Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
388Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
389Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
390Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
491Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
492Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
504Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
505Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
506Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
507Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
637Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
638Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
650Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
651Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
652Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
653Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
756Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
757Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
768Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
769Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
770Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
771Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
872Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
873Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
884Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
885Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
886Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
887Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
988Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
989Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1001Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
1002Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1003Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
1004Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
1107Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
1108Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1118Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
1119Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1120Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
1121Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
1209Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
1210Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1223Debug.Assert(options != null, "RequestDelegateFactoryOptions not found.");
1224Debug.Assert(options.EndpointBuilder != null, "EndpointBuilder not found.");
1225Debug.Assert(options.EndpointBuilder.ApplicationServices != null, "ApplicationServices not found.");
1226Debug.Assert(options.EndpointBuilder.FilterFactories != null, "FilterFactories not found.");
Microsoft.AspNetCore.Mvc.Abstractions (11)
Microsoft.AspNetCore.Mvc.Analyzers (3)
Microsoft.AspNetCore.Mvc.ApiExplorer (2)
Microsoft.AspNetCore.Mvc.Core (245)
Microsoft.AspNetCore.Mvc.Formatters.Xml (3)
Microsoft.AspNetCore.Mvc.Localization (2)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (2)
Microsoft.AspNetCore.Mvc.Razor (7)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (17)
Microsoft.AspNetCore.Mvc.RazorPages (80)
Microsoft.AspNetCore.Mvc.TagHelpers (9)
Microsoft.AspNetCore.Mvc.Testing (2)
Microsoft.AspNetCore.Mvc.ViewFeatures (47)
Microsoft.AspNetCore.OpenApi (23)
Microsoft.AspNetCore.OpenApi.SourceGenerators (4)
Microsoft.AspNetCore.OutputCaching (20)
Microsoft.AspNetCore.OutputCaching.StackExchangeRedis (7)
Microsoft.AspNetCore.Razor (1)
Microsoft.AspNetCore.Razor.Runtime (1)
Microsoft.AspNetCore.Razor.Utilities.Shared (117)
Microsoft.AspNetCore.ResponseCompression (2)
Microsoft.AspNetCore.Rewrite (9)
Microsoft.AspNetCore.Routing (91)
Microsoft.AspNetCore.Routing.Abstractions (19)
Microsoft.AspNetCore.Server.HttpSys (53)
Microsoft.AspNetCore.Server.IIS (46)
Microsoft.AspNetCore.Server.IISIntegration (3)
Microsoft.AspNetCore.Server.IntegrationTesting (1)
Microsoft.AspNetCore.Server.Kestrel.Core (375)
Microsoft.AspNetCore.Server.Kestrel.Transport.NamedPipes (10)
Microsoft.AspNetCore.Server.Kestrel.Transport.Quic (22)
Microsoft.AspNetCore.Server.Kestrel.Transport.Sockets (8)
Microsoft.AspNetCore.SignalR.Client.Core (7)
Microsoft.AspNetCore.SignalR.Common (5)
Microsoft.AspNetCore.SignalR.Core (25)
Microsoft.AspNetCore.SignalR.Protocols.Json (4)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (3)
Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson (5)
Microsoft.AspNetCore.SignalR.Specification.Tests (2)
Microsoft.AspNetCore.SignalR.StackExchangeRedis (16)
Microsoft.AspNetCore.SpaServices.Extensions (1)
Microsoft.AspNetCore.StaticAssets (10)
Microsoft.AspNetCore.StaticFiles (2)
Microsoft.AspNetCore.TestHost (3)
Microsoft.AspNetCore.Watch.BrowserRefresh (3)
Microsoft.AspNetCore.WebSockets (11)
Microsoft.AspNetCore.WebUtilities (22)
Microsoft.Build (221)
Collections\RetrievableEntryHashSet\RetrievableEntryHashSet.cs (10)
235Debug.Assert(String.Equals(name, value.Key, StringComparison.Ordinal));
263Debug.Assert(_buckets != null, "m_buckets was null but m_lastIndex > 0");
284Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
398Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
604Debug.Assert(String.Equals(entry.Key, entry.Value.Key, StringComparison.Ordinal));
703Debug.Assert(_count >= 0, "m_count is negative");
714Debug.Assert(_buckets != null, "m_buckets was null but m_count > 0");
740Debug.Assert(newSlots.Length <= _slots.Length, "capacity increased after TrimExcess");
760Debug.Assert(_buckets == null, "Initialize was called but m_buckets was non-null");
776Debug.Assert(_buckets != null, "IncreaseCapacity called on a set with no elements");
src\5057ed6cf5d6323b\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.collections\5.0.0-1.25277.114\contentFiles\cs\net9.0\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
Microsoft.Build.Framework (41)
Collections\RefArrayBuilder.cs (13)
77Debug.Assert(value >= 0, "Count must be non-negative.");
78Debug.Assert(value <= _scope.Length, "Count must not exceed the span length.");
93Debug.Assert(index < _count, "Index must be less than Count.");
138Debug.Assert(_count == _scope.Length, "AddWithResize should only be called when the span is full.");
195Debug.Assert(index >= 0, "Insert index must be non-negative.");
196Debug.Assert(index <= _count, "Insert index must not exceed Count.");
220Debug.Assert(_count == _scope.Length, "InsertWithResize should only be called when the span is full.");
237Debug.Assert(index >= 0, "Insert index must be non-negative.");
238Debug.Assert(index <= _count, "Insert index must not exceed Count.");
279Debug.Assert(startIndex >= -1, "Start index must be -1 or non-negative.");
280Debug.Assert(startIndex <= _count, "Start index must not exceed Count.");
336Debug.Assert(index >= 0, "Remove index must be non-negative.");
337Debug.Assert(index < _count, "Remove index must be less than Count.");
src\msbuild\artifacts\.packages\microsoft.codeanalysis.contracts\5.0.0-1.25277.114\contentFiles\cs\net9.0\ExceptionUtilities.cs (1)
24Debug.Assert(false, output);
Microsoft.Build.Tasks.CodeAnalysis (32)
Microsoft.Build.Tasks.Core (82)
BootstrapperUtil\BootstrapperBuilder.cs (21)
554Debug.Fail(ex.Message);
579Debug.Fail("Already found resources for culture " + stringNode.InnerText);
803Debug.Assert(filePath != null, "null filePath?");
804Debug.Assert(schemaPath != null, "null schemaPath?");
805Debug.Assert(schemaNamespace != null, "null schemaNamespace?");
819Debug.Fail("Could not locate schema '" + schemaPath + "', so no validation of '" + filePath + "' is possible.");
828Debug.Fail("Could not locate data file '" + filePath + "'.");
850Debug.Assert(_document != null, "our document should have been created by now!");
856Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message);
861Debug.Fail("Failed to load document '" + filePath + "' due to the following exception:\r\n" + ex.Message);
869Debug.Assert(xmlDocument.DocumentElement != null &&
946Debug.Assert(langDoc != null, "we couldn't load package.xml in '" + strLangManifestFilename + "'...?");
953Debug.Assert(langNode != null, $"Unable to find a package node in {strLangManifestFilename}");
1045Debug.WriteLine($"Validation results already added for Product Code '{productCodeAttribute}'");
1054Debug.Fail(ex.Message);
1058Debug.Fail(ex.Message);
1062Debug.Fail(ex.Message);
1260Debug.Assert(false, "Specified key does not exist for node " + nextNode.InnerXml);
1566Debug.Assert(sourceAttribute != null, "we should not be here if there is no ProductCode attribute");
1901Debug.Fail(ex.Message);
1995Debug.Assert(s != null, $"EmbeddedResource '{name}' not found");
Microsoft.Build.Tasks.Git (22)
Microsoft.Build.Utilities.Core (7)
Microsoft.CodeAnalysis (2379)
DiagnosticAnalyzer\AnalyzerDriver.cs (60)
78Debug.Assert(_lazyAnalyzerExecutor != null);
88Debug.Assert(_lazyCurrentCompilationData != null);
106Debug.Assert(_lazyUnsuppressedAnalyzers != null);
123Debug.Assert(_lazyPerSymbolAnalyzerActionsCache != null);
142Debug.Assert(_lazyCompilationEndAnalyzers != null);
164Debug.Assert(_lazyAnalyzerGateMap != null);
178Debug.Assert(!_lazyGeneratedCodeAnalysisFlagsMap.IsDefault);
198Debug.Assert(_lazyNonConfigurableAndCustomConfigurableAnalyzers != null);
212Debug.Assert(_lazySymbolStartAnalyzers != null);
226Debug.Assert(_lazyTreatAllCodeAsNonGeneratedCode.HasValue);
245Debug.Assert(_lazyGeneratedCodeFilesMap != null);
259Debug.Assert(_lazyGeneratedCodeSymbolsForTreeMap != null);
273Debug.Assert(_lazySuppressedAnalyzersForTreeMap != null);
289Debug.Assert(_lazySuppressedDiagnosticIdsForUnsuppressedAnalyzers != null);
303Debug.Assert(_lazyIsGeneratedCodeSymbolMap != null);
348Debug.Assert(_lazyCompilationEventQueue != null);
362Debug.Assert(_lazyDiagnosticQueue != null);
376Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Suppress));
377Debug.Assert(!severityFilter.Contains(ReportDiagnostic.Default));
404Debug.Assert(_lazyInitializeTask == null);
473Debug.Assert(_lazyInitializeTask == null);
474Debug.Assert(compilation.SemanticModelProvider != null);
706Debug.Assert(analysisScope != null);
728Debug.Assert(faultedTask.IsFaulted);
993Debug.Assert(severity != ReportDiagnostic.Default);
1017Debug.Assert(compilation.ContainsSyntaxTree(tree));
1024Debug.Assert(!reportedDiagnostics.IsEmptyWithoutResolution);
1048Debug.Assert(HasDiagnosticSuppressors);
1049Debug.Assert(!reportedDiagnostics.IsEmpty);
1050Debug.Assert(_programmaticSuppressions != null);
1051Debug.Assert(_diagnosticsProcessedForProgrammaticSuppressions != null);
1081Debug.Assert(suppressableDiagnostics.Contains(diagnostic));
1082Debug.Assert(!diagnostic.IsSuppressed);
1084Debug.Assert(suppressedDiagnostic.IsSuppressed);
1262Debug.Assert(location.SourceTree != null);
1282Debug.Assert(declaredSymbols != null);
1299Debug.Assert(GeneratedCodeSymbolsForTreeMap != null);
1300Debug.Assert(_lazyGeneratedCodeAttribute != null);
1322Debug.Assert(existingGeneratedCodeSymbols.SetEquals(generatedCodeSymbols));
1443Debug.Assert(_lazyInitializeTask != null);
1455Debug.Assert(_lazyPrimaryTask != null);
1618Debug.Assert(CompilationEventQueue.IsCompleted, "TryDequeueAsync should provide a value unless the AsyncQueue<T> is completed.");
1794Debug.Assert(!subsetProcessedAnalyzers.IsDefault);
1832Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0);
1883Debug.Assert(completedAnalyzers.Count < analysisScope.Analyzers.Length);
1964Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent);
2171Debug.Assert(AnalyzerActions.SymbolStartActionsCount > 0);
2172Debug.Assert(SymbolStartAnalyzers.Contains(analyzer));
2262Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken));
2287Debug.Assert(!IsDiagnosticAnalyzerSuppressed(analyzer, analyzerExecutor.Compilation.Options, analyzerManager, analyzerExecutor, analysisScope, severityFilter, cancellationToken));
2352Debug.Assert(_lazyDoNotAnalyzeGeneratedCode.HasValue);
2621Debug.Assert(shouldExecuteSyntaxNodeActions || shouldExecuteOperationActions || shouldExecuteCodeBlockActions || shouldExecuteOperationBlockActions);
2622Debug.Assert(!isInGeneratedCode || !DoNotAnalyzeGeneratedCode);
3032Debug.Assert(!operationBlock.Parent.IsImplicit);
3039Debug.Assert(operationBlock.Kind is OperationKind.Invocation or OperationKind.Invalid);
3040Debug.Assert(operationBlock.Parent.IsImplicit);
3041Debug.Assert(operationBlock.Parent.Parent is IConstructorBodyOperation ctorBody &&
3043Debug.Assert(!operationBlock.Parent.Parent.IsImplicit);
3050Debug.Fail($"Expected operation with kind '{operationBlock.Kind}' to be the root operation with null 'Parent', but instead it has a non-null Parent with kind '{operationBlock.Parent.Kind}'");
3061Debug.Assert(operationsToAnalyze.ToImmutableHashSet().Count == operationsToAnalyze.Count);
DiagnosticAnalyzer\AnalyzerExecutor.cs (40)
136Debug.Assert((addNonCategorizedDiagnostic != null) ^ (addCategorizedLocalDiagnostic != null));
137Debug.Assert((addCategorizedLocalDiagnostic != null) == (addCategorizedNonLocalDiagnostic != null));
233Debug.Assert(_analyzerExecutionTimeMap != null);
339Debug.Assert(startAction.Analyzer == symbolScope.Analyzer);
362Debug.Assert(_addSuppression != null);
403Debug.Assert(compilationEvent is CompilationStartedEvent || compilationEvent is CompilationCompletedEvent);
450Debug.Assert(getTopMostNodeForAnalysis != null);
451Debug.Assert(!filterSpan.HasValue || filterTree != null);
573Debug.Assert(getTopMostNodeForAnalysis != null);
574Debug.Assert(!isGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(analyzer));
575Debug.Assert(!IsAnalyzerSuppressedForSymbol(analyzer, symbolDeclaredEvent.Symbol, cancellationToken));
576Debug.Assert(!filterSpan.HasValue || filterTree != null);
687Debug.Assert(file.SourceTree != null);
743Debug.Assert(file.AdditionalFile != null);
787Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(syntaxNodeAction.Analyzer));
788Debug.Assert(!IsAnalyzerSuppressedForTree(syntaxNodeAction.Analyzer, node.SyntaxTree, cancellationToken));
811Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(operationAction.Analyzer));
812Debug.Assert(!IsAnalyzerSuppressedForTree(operationAction.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken));
861Debug.Assert(!executableCodeBlocks.IsEmpty);
975Debug.Assert(!operationBlocks.IsEmpty);
1056Debug.Assert(declaredNode != null);
1057Debug.Assert(executionData.DeclaredSymbol != null);
1058Debug.Assert(CanHaveExecutableCodeBlock(executionData.DeclaredSymbol));
1059Debug.Assert(startActions.Any() || endActions.Any() || actions.Any());
1181Debug.Assert(nodeActionsByKind.Any());
1182Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(executionData.Analyzer));
1183Debug.Assert(!IsAnalyzerSuppressedForTree(executionData.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken));
1284Debug.Assert(operationActionsByKind != null);
1285Debug.Assert(operationActionsByKind.Any());
1286Debug.Assert(!executionData.IsGeneratedCode || !_shouldSkipAnalysisOnGeneratedCode(executionData.Analyzer));
1287Debug.Assert(!IsAnalyzerSuppressedForTree(executionData.Analyzer, executionData.SemanticModel.SyntaxTree, cancellationToken));
1327Debug.Assert(((IFieldSymbol)symbol).AssociatedSymbol == null);
1386Debug.Assert(false);
1538Debug.Assert(IsAnalyzerExceptionDiagnostic(exceptionDiagnostic));
1576Debug.Assert(_addNonCategorizedDiagnostic != null);
1581Debug.Assert(_addNonCategorizedDiagnostic == null);
1582Debug.Assert(_addCategorizedNonLocalDiagnostic != null);
1618Debug.Assert(_addNonCategorizedDiagnostic != null);
1690Debug.Assert(_analyzerExecutionTimeMap != null);
1701Debug.Assert(operation.Parent == null);
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
Microsoft.CodeAnalysis.Analyzers (584)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.AnalyzerUtilities (977)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Analysis\PropertySetAnalysis\PropertySetAbstractValue.cs (1)
154Debug.Assert(index >= 0);
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\AnalysisEntityMapAbstractDomain.cs (16)
99Debug.Assert(!map2.ContainsKey(key1));
100Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
164Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
165Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
185Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
186Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
194Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
206Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
213Debug.Assert(!map1.ContainsKey(newKey));
214Debug.Assert(!map2.ContainsKey(newKey));
226Debug.Assert(Compare(map1, resultMap) <= 0);
227Debug.Assert(Compare(map2, resultMap) <= 0);
247Debug.Assert(values.Count > 0);
259Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
260Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
267Debug.Assert(isNewKey == (!map1.ContainsKey(key) && !map2.ContainsKey(key)));
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (103)
177Debug.Assert(!_currentAnalysisData.IsDisposed);
182Debug.Assert(!value.IsDisposed);
191Debug.Assert(_currentBasicBlock != null);
234Debug.Assert(ExceptionNamedType != null);
430Debug.Assert(_pendingArgumentsToReset.Count == 0);
431Debug.Assert(_pendingArgumentsToPostProcess.Count == 0);
551Debug.Assert(entryBlock.Kind == BasicBlockKind.Entry);
564Debug.Assert(result);
584Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit);
634Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
635Debug.Assert(DataFlowAnalysisContext.ControlFlowGraph.LocalFunctions.Contains(localFunction));
643Debug.Assert(_visitedLambdas.Contains(lambda));
651Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit);
745Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None);
788Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None);
823Debug.Assert(implicitTaskPointsToValueOpt.Kind == PointsToAbstractValueKind.KnownLocations);
852Debug.Assert(ExecutingExceptionPathsAnalysisPostPass);
853Debug.Assert(!SkipExceptionPathsAnalysisPostPass);
932Debug.Assert(ExecutingExceptionPathsAnalysisPostPass);
933Debug.Assert(!SkipExceptionPathsAnalysisPostPass);
962Debug.Assert(locals.Any() || flowCaptures.Any());
1004/// Checks if the method is an overload of the <see cref="Debug.Assert(bool)"/> method.
1007/// <returns>True if the method is an overlaod of the <see cref="Debug.Assert(bool)"/> method.</returns>
1141Debug.Assert(parameterEntity.Symbol?.Kind == SymbolKind.Parameter);
1154Debug.Assert(CurrentBasicBlock.Kind == BasicBlockKind.Entry);
1302Debug.Fail($"Unexpected 'null' target type for '{operation.Syntax}'");
1358Debug.Assert(PredicateAnalysis);
1364Debug.Assert(PredicateAnalysis);
1388Debug.Assert(PredicateAnalysis);
1389Debug.Assert(operation.Kind is OperationKind.BinaryOperator or
1424Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData");
1436Debug.Assert(result);
1439Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity));
1453Debug.Assert(!ReferenceEquals(truePredicatedData, CurrentAnalysisData));
1458Debug.Assert(!ReferenceEquals(falsePredicatedData, CurrentAnalysisData));
1462Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData");
1491Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation));
1529Debug.Assert(targetEntity.CaptureId != null);
1546Debug.Assert(PredicateAnalysis);
1547Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None);
1641Debug.Fail($"Unknown pattern kind '{isPatternOperation.Pattern.Kind}'");
1670Debug.Assert(IsContractCheckArgument(argument));
1684Debug.Assert(result);
1827Debug.Assert(PredicateAnalysis);
1852Debug.Assert(PredicateAnalysis);
1853Debug.Assert(operation.IsComparisonOperator());
1854Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None);
1896Debug.Assert(PredicateAnalysis);
1902Debug.Assert(PredicateAnalysis);
1908Debug.Assert(PredicateAnalysis);
1914Debug.Assert(PredicateAnalysis);
1923Debug.Assert(PredicateAnalysis);
1929Debug.Assert(PredicateAnalysis);
1935Debug.Assert(PredicateAnalysis);
1951Debug.Assert(IsLValueFlowCaptureReference(flowCaptureReference));
2026Debug.Assert(HasPointsToAnalysisResult);
2027Debug.Assert(operation.Type!.HasValueCopySemantics());
2045Debug.Assert(HasPointsToAnalysisResult);
2046Debug.Assert(!operation.Type!.HasValueCopySemantics());
2268Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2269Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2270Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
2333Debug.Assert(arguments.All(arg => !_pendingArgumentsToReset.Contains(arg)));
2348Debug.Assert(popped == originalOperation);
2395Debug.Assert(arguments.All(_pendingArgumentsToReset.Contains));
2485Debug.Assert(originalOperation.Kind == OperationKind.ObjectCreation);
2516Debug.Assert(arguments.Length == invokedMethod.Parameters.Length);
2558Debug.Assert(invokedMethod.Parameters.Length == method.GetParameters().Length ||
2624Debug.Assert(success);
2635Debug.Assert(IsStandaloneAnalysisRequiredForLocalFunction(localFunction));
2653Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2654Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2655Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
2685Debug.Assert(IsStandaloneAnalysisRequiredForLambda(lambda));
2703Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2704Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2705Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
3000Debug.Assert(result);
3009Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity));
3035Debug.Assert(flowCaptureEntity.CaptureId != null);
3079Debug.Assert(FlowBranchConditionKind == ControlFlowConditionKind.None);
3158Debug.Assert(operation.Initializer == null, "Object or collection initializer must have been lowered in the CFG");
3241Debug.Assert(!arguments.IsEmpty);
3260Debug.Assert(arguments.Length >= 2);
3284Debug.Assert(IsPointsToAnalysis);
3328Debug.Assert(operation != null ^ invocationTarget != null);
3339Debug.Assert(invocation.Instance == null);
3347Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or
3381Debug.Assert(knownTargetInvocations);
3388Debug.Assert(knownTargetInvocations);
3395Debug.Assert(knownTargetInvocations);
3417Debug.Assert(knownTargetInvocations);
3462Debug.Assert(methodTargetsOptBuilder.Count > 0 || lambdaTargets.Count > 0);
3480Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData));
3492Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData));
3496Debug.Assert(mergedCurrentAnalysisData == null || ReferenceEquals(mergedCurrentAnalysisData, CurrentAnalysisData));
3587Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation));
3605Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation));
3682Debug.Assert(elementEntities.Length == elementValueBuilder.Count);
3683Debug.Assert(elementEntities.Length == operation.Elements.Length);
3761Debug.Assert(caughtExceptionType != null || CurrentBasicBlock.IsFirstBlockOfFinally(out _));
3794Debug.Assert(CurrentBasicBlock.IsFirstBlockOfFinally(out _));
3828Debug.Assert(operation.Kind == OperationKind.YieldReturn, "IReturnOperation must have been lowered in the CFG");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.CodeStyle (560)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.CodeStyle.Fixes (37)
Microsoft.CodeAnalysis.CSharp (8577)
Binder\Binder_Conversions.cs (146)
69Debug.Assert(result is BoundConversion || (conversion.IsIdentity && ((object)result == source) || source.NeedsToBeConverted()) || hasErrors);
74Debug.Assert(filterConversion(conversion, result));
75Debug.Assert(BoundNode.GetConversion(result, placeholder1) == conversion);
81Debug.Assert(BoundNode.GetConversion(result2, placeholder2) == conversion);
234Debug.Assert(destination.SpecialType != SpecialType.System_String);
258Debug.Assert(!conversion.Exists);
277Debug.Assert(conversion.IsCollectionExpression
300Debug.Assert(source.Type is null);
301Debug.Assert(!conversion.Exists);
311Debug.Assert(inConversionGroupFlags == InConversionGroupFlags.Unspecified);
344Debug.Assert(source == (object)methodGroup || !conversion.IsValid);
363Debug.Assert(!conversion.IsMethodGroup);
379Debug.Assert(conversion.UnderlyingConversions.Length == 1);
442Debug.Assert(elementConversions.Length == sourceTypes.Length);
465Debug.Assert(conversion.UnderlyingConversions.IsDefault);
474Debug.Assert(syntax.SyntaxTree is object);
482Debug.Assert(conversion.ConstrainedToTypeOpt is TypeParameterSymbol);
523Debug.Assert(source.Type is { });
526Debug.Assert(elementField is { });
545Debug.Assert(destination.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions));
562Debug.Assert(source.Type is not null);
563Debug.Assert(destination.IsSpan() || destination.IsReadOnlySpan());
584Debug.Assert(destination.IsReadOnlySpan());
596Debug.Assert(destination.IsReadOnlySpan());
653Debug.Assert(type.IsSpan() || type.IsReadOnlySpan());
654Debug.Assert(type.IsDefinition);
663Debug.Assert(spanType.IsSpan() && readonlySpanType.IsReadOnlySpan());
664Debug.Assert(spanType.IsDefinition && readonlySpanType.IsDefinition);
686Debug.Assert(source.IsSpan() || source.IsReadOnlySpan());
687Debug.Assert(destination.IsReadOnlySpan());
688Debug.Assert(!source.IsDefinition && !destination.IsDefinition);
695Debug.Assert(!source.IsReadOnlySpan() || !sameElementTypes);
703Debug.Assert(source.IsReadOnlySpan() && destination.IsReadOnlySpan());
704Debug.Assert(source.IsDefinition && destination.IsDefinition);
731Debug.Assert(readOnlySpanType.IsReadOnlySpan());
732Debug.Assert(!readOnlySpanType.IsDefinition);
733Debug.Assert(((NamedTypeSymbol)readOnlySpanType).TypeArgumentsWithAnnotationsNoUseSiteDiagnostics[0].SpecialType is SpecialType.System_Char);
786Debug.Assert(destination.Equals(Compilation.GetWellKnownType(WellKnownType.System_IFormattable), TypeCompareKind.ConsiderEverything) ||
826Debug.Assert(expr is BoundObjectCreationExpressionBase { WasTargetTyped: true } or
831Debug.Assert(expr is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node.Syntax, node));
942Debug.Assert(_conversion.Kind is ConversionKind.NoConversion);
950Debug.Assert(elementType is { });
961Debug.Assert(result.WasCompilerGenerated == _node.IsParamsArrayOrCollection);
962Debug.Assert(result.IsParamsArrayOrCollection == _node.IsParamsArrayOrCollection);
972Debug.Assert(elementType is { });
1038Debug.Assert(_node.WithElement is null);
1039Debug.Assert(inProgressConstructor is not null);
1047Debug.Assert(collectionCreation is BoundObjectCreationExpressionBase or BoundBadExpression);
1159Debug.Assert(elements.Length == elementConversions.Length);
1160Debug.Assert(elementConversions.All(c => c.Exists));
1191Debug.Assert(enumeratorInfo is { });
1192Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable.
1268Debug.Assert(@this._targetType.IsArrayInterface(out _));
1280Debug.Assert(isMutableArray);
1370Debug.Assert(projection.Arity == 0);
1371Debug.Assert(projection.ParameterCount == 0 || !projection.Parameters.Last().IsParams);
1387Debug.Assert(collectionBuilderMethods.All(t => t.Name == methodName));
1420Debug.Assert(!projectionCall.Expanded);
1503Debug.Assert(result);
1507Debug.Assert(result);
1637Debug.Assert(parameterType.OriginalDefinition.Equals(Compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions));
1649Debug.Assert(!collectionBuilderMethod.IsExtensionBlockMember());
1664Debug.Assert(!isParamsModifierValidation || syntax is ParameterSyntax);
1666Debug.Assert(!isParamsModifierValidation);
1669Debug.Assert(!hasWithElement);
1690Debug.Assert(!hasWithElement);
1835Debug.Assert(!targetType.IsDynamic());
1914Debug.Assert(boundExpression.HasErrors);
1954Debug.Assert(methodGroup.ReceiverOpt is not null);
1955Debug.Assert(methodGroup.ReceiverOpt.Type is not null);
1971Debug.Assert(false); // Should not get here given the 'acceptOnlyMethods' argument value used in 'ResolveMethodGroup' call above
1995Debug.Assert(resolution.AnalyzedArguments.HasDynamicArgument);
2011Debug.Assert(finalApplicableCandidates.Length != 1 || finalApplicableCandidates[0].IsApplicable);
2032Debug.Assert(!IsDisallowedExtensionInOlderLangVer(addMethods[0]));
2038Debug.Assert(!resolution.OverloadResolutionResult.Succeeded);
2061Debug.Assert(methodGroup.ReceiverOpt is not null);
2091Debug.Assert(receiverType is not null);
2152Debug.Assert(constructed is not null);
2185Debug.Assert(node != null);
2186Debug.Assert(methodGroup != null);
2187Debug.Assert(methodGroup.Error == null);
2188Debug.Assert(methodGroup.Methods.Count > 0);
2249Debug.Assert(call.HasErrors);
2250Debug.Assert(call.Method.Name == "Add");
2253Debug.Assert(false); // Add test if we hit this assert.
2266Debug.Assert(!collectionInitializer.DefaultArguments[argIndex]);
2281Debug.Assert(false);
2364Debug.Assert(elementTypeWithAnnotations.Type is null); // GetCollectionExpressionTypeKind() does not set elementType for these cases.
2376Debug.Assert(elementTypeWithAnnotations.HasType);
2386Debug.Assert(elementType is { });
2434Debug.Assert(reportedErrors);
2456Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything));
2495Debug.Assert(targetTyped || destination.IsErrorType() || destination.Equals(source.Type, TypeCompareKind.ConsiderEverything));
2528Debug.Assert(conversionGroup != null);
2529Debug.Assert(conversionGroup.Conversion == conversion);
2530Debug.Assert(conversion.IsUserDefined);
2579Debug.Assert(conversion.BestUserDefinedConversionAnalysis is object); // All valid user-defined conversions have this populated
2601Debug.Assert(toParameterTypeConversion.IsNullable);
2602Debug.Assert(toParameterTypeConversion.IsExplicit);
2603Debug.Assert(toParameterTypeConversion.UnderlyingConversions[0].IsIdentity);
2647Debug.Assert(toConversion.Exists);
2653Debug.Assert(fromReturnTypeConversion.IsNullable);
2654Debug.Assert(fromReturnTypeConversion.IsImplicit);
2655Debug.Assert(!fromReturnTypeConversion.UnderlyingConversions[0].IsIdentity);
2717Debug.Assert(conversionGroup != null);
2718Debug.Assert(conversionGroup.Conversion == conversion);
2719Debug.Assert(conversion.IsUnion);
2742Debug.Assert(conversion.BestUnionConversionAnalysis is object); // All valid union conversions have this populated
2746Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm);
2747Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true }));
2748Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
2749Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
2750Debug.Assert(TypeSymbol.Equals(destination.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
2751Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true });
2752Debug.Assert(source.Type?.IsDynamic() != true);
2841Debug.Assert(conversion.Kind == ConversionKind.FunctionType);
2842Debug.Assert(source.Kind is BoundKind.MethodGroup or BoundKind.UnboundLambda);
2843Debug.Assert(syntax.IsFeatureEnabled(MessageID.IDS_FeatureInferredDelegateType));
2847Debug.Assert(delegateType is { });
2863Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.FunctionTypeDelegate) == 0);
2893Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.FunctionTypeDelegateToTarget) == 0);
2947Debug.Assert(conversion.UnderlyingConversions.IsDefault);
3004Debug.Assert(delegateType is not null);
3008Debug.Assert(lambdaSymbol.ParameterCount == delegateParameters.Length);
3094Debug.Assert(conversion.IsStackAlloc);
3127Debug.Assert(conversion.IsTupleLiteralConversion ||
3132Debug.Assert(conversion.IsNullable == destination.IsNullableType());
3144Debug.Assert(conversionWithoutNullable.IsTupleLiteralConversion);
3182Debug.Assert(targetElementTypes.Length == arguments.Length, "converting a tuple literal to incompatible type?");
3204Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.TupleLiteral) == 0);
3222Debug.Assert((inConversionGroupFlags & InConversionGroupFlags.TupleLiteralExplicitIdentity) == 0);
3364Debug.Assert(memberSymbol is not MethodSymbol { MethodKind: not MethodKind.Constructor } ||
3375Debug.Assert(!invokedAsExtensionMethod);
3379Debug.Assert(!invokedAsExtensionMethod || (receiverOpt != null));
3518Debug.Assert(delegateType is NamedTypeSymbol { TypeKind: TypeKind.Delegate, DelegateInvokeMethod: { HasUseSiteError: false } }
3529Debug.Assert(!isExtensionMethod || (receiverOpt != null));
3536Debug.Assert(methodParameters.Length == numParams + (isExtensionMethod ? 1 : 0));
3542Debug.Assert(!(isExtensionMethod || (method.IsExtensionBlockMember() && !method.IsStatic)) ||
3625Debug.Fail("This method should have been eliminated in overload resolution!");
3685Debug.Assert(method.IsExtensionBlockMember());
3709Debug.Assert(Conversions.IsAssignableFromMulticastDelegate(delegateOrFuncPtrType, ref discardedUseSiteInfo) || delegateOrFuncPtrType.TypeKind == TypeKind.Delegate || delegateOrFuncPtrType.TypeKind == TypeKind.FunctionPointer);
3710Debug.Assert(conversion.Method is object);
3755Debug.Assert(!selectedMethod.HasUseSiteError, "Shouldn't have reached this point if there were use site errors.");
3792Debug.Assert(conversion.IsValid); // i.e. if it exists, then it is valid.
3907Debug.Assert(!sourceValue.IsBad);
3914Debug.Assert(underlyingType.SpecialType != SpecialType.None);
Binder\Binder_Expressions.cs (303)
220Debug.Assert(expr != null);
221Debug.Assert(resultKind != LookupResultKind.Viable);
343Debug.Assert(op.NoCommonTypeError != 0);
448Debug.Assert(expr.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup);
478Debug.Assert((object)this.ContainingMemberOrLambda == field);
486Debug.Assert(initializerBinder != null);
536Debug.Assert(this.InParameterDefaultValue);
537Debug.Assert(this.ContainingMemberOrLambda.Kind == SymbolKind.Method
543Debug.Assert(defaultValueBinder != null);
561Debug.Assert(initializerBinder != null);
629Debug.Assert(node != null);
877Debug.Assert(false, "Unexpected SyntaxKind " + node.Kind());
1185Debug.Assert(elementNames.Count == inferredElementNames.Count);
1482Debug.Assert(ContainingType is { });
1506Debug.Assert((this.Flags & BinderFlags.InContextualAttributeBinder) != 0);
1533Debug.Assert(!result || lookupResult.Symbols.Count > 0);
1566Debug.Assert(symbol is null or LocalSymbol or LocalFunctionSymbol or RangeVariableSymbol or TypeParameterSymbol);
1649Debug.Assert(node != null);
1687Debug.Assert(node.Arity == typeArgumentList.Count);
1708Debug.Assert(members.Count > 0);
1711Debug.Assert(!IsTypeOrValueExpression(receiver));
1740Debug.Assert(isError); // Should have been reported by GetSymbolOrMethodOrPropertyGroup.
1820Debug.Assert(SyntaxFacts.IsInvoked(id) == invoked);
1885Debug.Assert(!primaryConstructor.GetCapturedParameters().ContainsKey(shadowedParameter)); // How could we capture a shadowed parameter?
1912Debug.Assert((options & LookupOptions.NamespacesOrTypesOnly) == 0);
1941Debug.Assert(node.Identifier.IsUnderscoreToken());
2006Debug.Assert(members.Count > 0);
2049Debug.Assert(!symbol.ContainingSymbol.Equals(containingMethod));
2116Debug.Assert(primaryCtor is null ||
2135Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
2158Debug.Assert(parameter.Type.IsRefLikeOrAllowsRefLikeType());
2518Debug.Assert(node.ContainsDiagnostics);
2535Debug.Assert(result.IsSingleViable, "If this happens, we need to deal with multiple label definitions.");
2579Debug.Assert(node != null);
2607Debug.Assert(location is not null);
2617Debug.Assert(this.ContainingMemberOrLambda is not null);
2681Debug.Assert(node.OperatorToken.IsKind(SyntaxKind.CaretToken));
2880Debug.Assert(conversion.IsUserDefined || conversion.IsUnion);
2889Debug.Assert(originalUserDefinedConversions.Length == 0,
2965Debug.Assert((object)operand.Type != null);
3006Debug.Assert(targetTypeWithAnnotations.HasType && targetTypeWithAnnotations.IsNullableType());
3007Debug.Assert((object)operand.Type != null && !operand.Type.IsNullableType());
3256Debug.Assert(isVar != declType.HasType);
3272Debug.Assert(declarationExpression.IsOutVarDeclaration());
3296Debug.Assert(localSymbol.DeclarationKind == LocalDeclarationKind.OutVariable);
3414Debug.Assert(argumentSyntax is ArgumentSyntax || argumentSyntax is AttributeArgumentSyntax);
3526Debug.Assert(result.ConversionForArg(arg).IsIdentity);
3527Debug.Assert(!argument.NeedsToBeConverted());
3528Debug.Assert(!expanded || result.ParameterFromArgument(arg) != parameters.Length - 1);
3537Debug.Assert(paramsArgsBuilder is null);
3554Debug.Assert(analyzedArguments.RefKinds.Count == 0 || analyzedArguments.RefKinds.Count == arguments.Count);
3555Debug.Assert(analyzedArguments.Names.Count == 0 || analyzedArguments.Names.Count == arguments.Count);
3556Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Count);
3577Debug.Assert(argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true });
3598Debug.Assert(parameterTypeWithAnnotations.HasType);
3603Debug.Assert(kind.IsIdentity);
3631Debug.Assert(arguments[arg].Kind is not
3660Debug.Assert(methodResult.Result.ParamsElementTypeOpt.HasType);
3661Debug.Assert(methodResult.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
3683Debug.Assert(collectionArgs.Length != 0);
3688Debug.Assert(firstParamsArgument != -1);
3689Debug.Assert(collectionArgs.Length == 1 || firstParamsArgument + collectionArgs.Length == arguments.Count);
3702Debug.Assert(argsToParamsBuilder is not null || argsToParamsOpt.IsDefault);
3753Debug.Assert(unconvertedString is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true });
3755Debug.Assert(interpolatedStringConversion.IsInterpolatedStringHandler);
3756Debug.Assert(handlerType is NamedTypeSymbol { IsInterpolatedStringHandlerType: true });
3763Debug.Assert(handlerParameterIndexes.IsEmpty);
3777Debug.Assert(arguments is not null);
3810Debug.Assert(handlerParameterIndexes.All((index, paramLength) => index >= BoundInterpolatedStringArgumentPlaceholder.ExtensionReceiver && index < paramLength,
3829Debug.Assert(handlerArgumentIndexesBuilder[handlerParameterIndex] is BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter);
3862Debug.Assert(argumentIndex != interpolatedStringArgNum);
3869Debug.Assert(receiver!.Type is not null);
3874Debug.Assert(methodResult.Member.IsExtensionBlockMember());
3876Debug.Assert(receiverParameter is not null);
3930Debug.Assert(receiver != null);
3995Debug.Assert(!available);
4008Debug.Assert(argNumber > 0);
4020Debug.Assert(argNumber >= 0); // can be 0 for receiver of extension method
4029Debug.Assert(argNumber > 0);
4289Debug.Assert(rank > 0);
4290Debug.Assert(dimension > 0 && dimension <= rank);
4291Debug.Assert(exprBuilder != null);
4362Debug.Assert(!boundInitExpr.IsDefault);
4372Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length);
4397Debug.Assert(boundInitExprIndex >= 0 && boundInitExprIndex < boundInitExpr.Length);
4400Debug.Assert(init.HasAnyErrors);
4401Debug.Assert(init.Type.IsErrorType());
4510Debug.Assert(creationSyntax == null ||
4513Debug.Assert(initSyntax != null);
4514Debug.Assert((object)type != null);
4515Debug.Assert(boundInitExprOpt.IsDefault || creationSyntax.Kind() == SyntaxKind.ImplicitArrayCreationExpression);
4667Debug.Assert(node is StackAllocArrayCreationExpressionSyntax || node is ImplicitStackAllocArrayCreationExpressionSyntax);
4692Debug.Assert(node is StackAllocArrayCreationExpressionSyntax or ImplicitStackAllocArrayCreationExpressionSyntax);
4730Debug.Assert(node != null);
4769Debug.Assert(node.IsKind(SyntaxKind.ImplicitStackAllocArrayCreationExpression) || node.IsKind(SyntaxKind.StackAllocArrayCreationExpression));
4815Debug.Assert(expression != null);
4833Debug.Assert(expression != null);
4859Debug.Assert(type == SpecialType.System_UInt32 || type == SpecialType.System_UInt64);
4894Debug.Assert(argumentListBinder.IsSemanticModelBinder);
4926Debug.Assert((object)constructor != null);
4927Debug.Assert(constructor.MethodKind == MethodKind.Constructor ||
4929Debug.Assert(diagnostics != null);
4943Debug.Assert(constructorReturnType.IsVoidType()); //true of all constructors
4962Debug.Assert((object)initializerType != null ||
4998Debug.Assert(initializerArgumentListOpt.Parent.Kind() == SyntaxKind.ThisConstructorInitializer);
5104Debug.Assert(initializerType.IsErrorType() ||
5165Debug.Assert(!resultMember.IsExtensionBlockMember());
5294Debug.Assert(result is not BoundBadExpression { ChildBoundNodes: var children } || !children.Any((child, node) => child.Syntax == node, node));
5422Debug.Assert(expression.Type is { });
5429Debug.Assert(conversion.IsValid);
5437Debug.Assert(length > 0);
5584Debug.Assert(!type.IsGenericOrNonGenericExpressionType(out _));
5671Debug.Assert(!conv.IsExtensionMethod);
5672Debug.Assert(conv.IsValid); // i.e. if it exists, then it is valid.
5739Debug.Assert(type.TypeKind is TypeKind.Class or TypeKind.Struct);
5783Debug.Assert(typeSyntax is not null);
5802Debug.Assert(syntax != null);
5803Debug.Assert((object)type != null);
5833Debug.Assert(syntax != null);
5834Debug.Assert((object)type != null);
5840Debug.Assert(syntax.Parent.Parent.Kind() != SyntaxKind.WithInitializerExpression);
5841Debug.Assert(rhsValueKind == BindValueKind.RValue);
5860Debug.Assert(initializerSyntax.Kind() == SyntaxKind.ObjectInitializerExpression ||
5862Debug.Assert((object)initializerType != null);
5906Debug.Assert((object)boundLeft.Type != null);
6235Debug.Assert(!boundMember.NeedsToBeConverted());
6257Debug.Assert(boundMember.HasAnyErrors);
6271Debug.Assert(memberNameMap != null);
6281Debug.Assert(memberInitializerSyntax.Kind() == SyntaxKind.SimpleAssignmentExpression);
6415Debug.Assert(initializerSyntax.Kind() == SyntaxKind.CollectionInitializerExpression);
6416Debug.Assert(initializerSyntax.Expressions.Any());
6417Debug.Assert((object)initializerType != null);
6569Debug.Assert(node.Kind() == SyntaxKind.ComplexElementInitializerExpression);
6600Debug.Assert(!boundElementInitializerExpressions.IsEmpty);
6619Debug.Assert(collectionInitializerAddMethodBinder.HasCollectionExpressionApplicableAddMethod(elementInitializer, implicitReceiver.Type, addMethods: out _, d));
6633Debug.Assert(collectionInitializerAddMethodBinder != null);
6634Debug.Assert(collectionInitializerAddMethodBinder.Flags.Includes(BinderFlags.CollectionInitializerAddMethod));
6635Debug.Assert(implicitReceiver != null);
6636Debug.Assert((object)implicitReceiver.Type != null);
6702Debug.Assert(addMethodInvocation.Kind == BoundKind.BadExpression);
6748Debug.Assert(enumeratorInfo.ElementType is { }); // ElementType is set always, even for IEnumerable.
6795Debug.Assert((object)constructor != null);
6796Debug.Assert(constructor.MethodKind == MethodKind.Constructor || constructor.MethodKind == MethodKind.StaticConstructor);
6823Debug.Assert((object)this.Compilation.Assembly != null);
6879Debug.Assert(finalApplicableCandidates[0].IsApplicable);
6967Debug.Assert(!method.IsExtensionBlockMember());
7102Debug.Assert((object)type != null);
7128Debug.Assert((object)interfaceType != null);
7129Debug.Assert(interfaceType.IsInterfaceType());
7130Debug.Assert((object)coClassType != null);
7131Debug.Assert(TypeSymbol.Equals(interfaceType.ComImportCoClass, coClassType, TypeCompareKind.ConsiderEverything2));
7132Debug.Assert(coClassType.TypeKind == TypeKind.Class || coClassType.TypeKind == TypeKind.Error);
7571Debug.Assert(!value.GetType().GetTypeInfo().IsEnum);
7576Debug.Assert(
7597Debug.Assert(node.Kind() == SyntaxKind.Utf8StringLiteralExpression);
7598Debug.Assert(node.Token.Kind() is SyntaxKind.Utf8StringLiteralToken or SyntaxKind.Utf8SingleLineRawStringLiteralToken or SyntaxKind.Utf8MultiLineRawStringLiteralToken);
7642Debug.Assert(node != null);
7643Debug.Assert(invoked == SyntaxFacts.IsInvoked(node));
7655Debug.Assert(node.Kind() == SyntaxKind.PointerMemberAccessExpression);
7709Debug.Assert((left.Parent is MemberAccessExpressionSyntax { RawKind: (int)SyntaxKind.SimpleMemberAccessExpression } memberAccess && memberAccess.Expression == left) ||
7721Debug.Assert(left.Arity == 0);
7780Debug.Assert(!leftType.IsDynamic());
7781Debug.Assert(IsPotentialColorColorReceiver(left, leftType));
7787Debug.Assert(!IsPotentialColorColorReceiver(left, leftType));
7790Debug.Assert(leftType.Equals(boundValue.Type, TypeCompareKind.ConsiderEverything));
7791Debug.Assert(leftSymbol == (boundValue.ExpressionSymbol ?? ((BoundConversion)boundValue).Operand.ExpressionSymbol));
7913Debug.Assert(node != null);
7914Debug.Assert(boundLeft != null);
7948Debug.Assert((object)leftType == null);
8090Debug.Assert(sym.Kind == SymbolKind.NamedType);
8106Debug.Assert(symbols.Count > 0);
8107Debug.Assert(symbols[0].Kind == SymbolKind.NamedType);
8116Debug.Assert(lookupResult.IsClear, "If there's a legitimate reason for having candidates without a reason, then we should produce something intelligent in such cases.");
8117Debug.Assert(lookupResult.Error == null);
8142Debug.Assert(boundLeft is BoundTypeExpression);
8143Debug.Assert((object)leftType != null);
8218Debug.Assert(!resolution.IsNonMethodExtensionMember(out _));
8226Debug.Assert(!resolution.IsEmpty);
8271Debug.Assert(typeArgumentsOpt.IsDefault);
8294Debug.Assert(propertySymbol.ContainingType.ExtensionParameter is not null);
8326Debug.Assert(rightArity == (typeArgumentsWithAnnotations.IsDefault ? 0 : typeArgumentsWithAnnotations.Length));
8606Debug.Assert(receiver != null);
8607Debug.Assert(extensionMethodArguments.Arguments.Count == 0);
8608Debug.Assert(extensionMethodArguments.Names.Count == 0);
8609Debug.Assert(extensionMethodArguments.RefKinds.Count == 0);
8651Debug.Assert(node != null);
8652Debug.Assert(left != null);
8653Debug.Assert(lookupResult.IsMultiViable);
8654Debug.Assert(lookupResult.Symbols.Any());
8664Debug.Assert(members.Count > 0);
8690Debug.Assert(symbol.Kind != SymbolKind.Method);
8773Debug.Assert(left.Type is not null);
8774Debug.Assert(!left.Type.IsDynamic());
8775Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion |
8868Debug.Assert(left.Type is not null);
8889Debug.Assert(arity == 0 || lookupResult.Symbols.All(s => s.Kind != SymbolKind.Property));
8902Debug.Assert(actualReceiverArguments is not null);
8937Debug.Assert(actualReceiverArguments is not null);
8946Debug.Assert(propertyResult?.HasAnyApplicableMember == true);
8957Debug.Assert(actualReceiverArguments is not null);
9004Debug.Assert(propertyResult is not null);
9029Debug.Assert(lookupResult.Kind == LookupResultKind.Viable);
9060Debug.Assert(receiverType is not null);
9185Debug.Assert(left is not null);
9193Debug.Assert(left.Type is not null);
9194Debug.Assert(!left.Type.IsDynamic());
9195Debug.Assert(!left.Type.IsArray());
9196Debug.Assert(left.Type.SpecialType != SpecialType.System_String);
9246Debug.Assert(receiver.Type is not null);
9247Debug.Assert(lookupResult.IsClear);
9282Debug.Assert(left is not null);
9290Debug.Assert(left.Type is not null);
9291Debug.Assert(!left.Type.IsDynamic());
9292Debug.Assert(!left.Type.IsArray());
9293Debug.Assert(left.Type.SpecialType != SpecialType.System_String);
9330Debug.Assert(receiver.Type is not null);
9350Debug.Assert(actualExtensionIntIndexerOrSliceArguments is null);
9368Debug.Assert(!argumentPlaceholders.IsDefault);
9406Debug.Assert(lengthOrCountProperty.ContainingType.ExtensionParameter is not null);
9426Debug.Assert(receiver.Type is not null);
9547Debug.Assert(receiver.Type is not null);
9556Debug.Assert(argKind is IndexOrRangeArgKind.Range);
9575Debug.Assert(receiver.Type is not null);
9669Debug.Assert(receiver.Type is not null);
9730Debug.Assert(!candidate.IsStatic);
9783Debug.Assert(resolutionResult.Result.ConversionForArg(0).Exists);
9966Debug.Assert((object)underlyingType != null);
9991Debug.Assert(propertySymbol.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) == CallerUnsafeMode.None ||
10013Debug.Assert(symbol is not TypeSymbol);
10079Debug.Assert(eventSymbol.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) == CallerUnsafeMode.None ||
10175Debug.Assert(!methodOrPropertyGroup.Any());
10180Debug.Assert(result.Kind != LookupResultKind.Empty);
10181Debug.Assert(!result.Symbols.Any(s => s.IsIndexer()));
10227Debug.Assert(methodOrPropertyGroup.Any() || ((object)other != null));
10257Debug.Assert(members.Count > 0);
10262Debug.Assert(members.All(m => m.Kind == member.Kind));
10270Debug.Assert(members.All(m => !m.IsIndexer()));
10299Debug.Assert(receiver.Type?.IsFunctionPointer() != true, "There should have been an error reported for indexing into a function pointer.");
10316Debug.Assert(propertyGroup.ReceiverOpt is not null);
10366Debug.Assert(expr.Type.TryGetInlineArrayElementField() is not null);
10382Debug.Assert(tryInlineArrayAccess);
10383Debug.Assert(diagnosticsForBindElementAccessCore.DiagnosticBag is { });
10610Debug.Assert(node != null);
10611Debug.Assert(expr != null);
10612Debug.Assert((object)expr.Type != null);
10613Debug.Assert(arguments != null);
10641Debug.Assert(node != null);
10642Debug.Assert(expr != null);
10643Debug.Assert(arguments != null);
10702Debug.Assert(convertedArguments.Length == 1);
10724Debug.Assert(index != null);
10829Debug.Assert(expr != null);
10830Debug.Assert((object)targetType != null);
10846Debug.Assert(result != null); // If this ever fails (it shouldn't), then put a null-check around the diagnostics update.
10853Debug.Assert(node != null);
10854Debug.Assert(expr != null);
10855Debug.Assert(analyzedArguments != null);
10869Debug.Assert(expr.Type.IsPointerType());
10915Debug.Assert(node != null);
10916Debug.Assert(expr != null);
10917Debug.Assert((object?)expr.Type != null);
10918Debug.Assert(analyzedArguments != null);
10934Debug.Assert(symbol.IsIndexer());
11005Debug.Assert(property.ParameterCount > 0);
11023Debug.Assert(receiver is not null);
11051Debug.Assert(receiver is not null);
11117Debug.Assert(receiver is not null);
11134Debug.Assert(finalApplicableCandidates[0].IsApplicable);
11260Debug.Assert(receiver is not null);
11261Debug.Assert(receiver.Type is not null);
11299Debug.Assert(argKind != IndexOrRangeArgKind.None);
11300Debug.Assert(lengthOrCountAccess is BoundPropertyAccess);
11301Debug.Assert(indexerOrSliceAccess is BoundIndexerAccess or BoundCall);
11302Debug.Assert(indexerOrSliceAccess.Type is not null);
11365Debug.Assert(argKind != IndexOrRangeArgKind.None);
11376Debug.Assert(actualExtensionIntIndexerOrSliceArguments is null);
11496Debug.Assert(receiverPlaceholder.Type is not null);
11499Debug.Assert(receiverPlaceholder.Type is not null);
11524Debug.Assert(lookupResult.IsClear);
11604Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion |
11636Debug.Assert(node.LookupError == null);
11696Debug.Assert(!methodResolution.HasAnyApplicableMethod);
11697Debug.Assert(!extensionMethodResolution.HasAnyApplicableMethod);
11698Debug.Assert(!methodResolution.IsEmpty);
11699Debug.Assert(!extensionMethodResolution.IsEmpty);
11713Debug.Assert(!extensionMethodResolution.IsEmpty);
11731Debug.Assert((options & ~(OverloadResolution.Options.IsMethodGroupConversion |
11864Debug.Assert(node.ReceiverOpt!.Type is not null); // extensions are only considered on member access
11882Debug.Assert(extensionMember is not null);
11921Debug.Assert(methods.Count != 0);
12080Debug.Assert(node.ReceiverOpt!.Type is not null); // extensions are only considered on member access
12096Debug.Assert(extensionMember is not null);
12209Debug.Assert(ContainingMemberOrLambda is { });
12210Debug.Assert(parameterRefKinds.IsDefault || parameterRefKinds.Length == parameterTypes.Length);
12211Debug.Assert(parameterDefaultValues.IsDefault || parameterDefaultValues.Length == parameterTypes.Length);
12212Debug.Assert(returnType.Type is { }); // Expecting System.Void rather than null return type.
12213Debug.Assert(!hasParams || parameterTypes.Length != 0);
12302Debug.Assert((location == null) ^ (node == null));
12356Debug.Assert((object)receiverType != null);
12475Debug.Assert(node != null);
12476Debug.Assert(node.Expression != null);
12482Debug.Assert(receiver != null);
12491Debug.Assert(conditionalAccessNode != null);
Binder\Binder_Statements.cs (94)
59Debug.Assert(node != null);
151Debug.Assert(result.WasCompilerGenerated == false ||
156Debug.Assert(result.Syntax is StatementSyntax, "BoundStatement should be associated with a statement syntax.");
158Debug.Assert(System.Linq.Enumerable.Contains(result.Syntax.AncestorsAndSelf(), node), @"Bound statement (or one of its parents)
189Debug.Assert(fixedBinder != null);
203Debug.Assert(!declarations.IsEmpty);
298Debug.Assert(lockBinder != null);
310Debug.Assert(usingBinder != null);
339Debug.Assert(binder != null);
348Debug.Assert(binder != null);
354Debug.Assert(binder != null);
593Debug.Assert(blockBody != null || expressionBody != null || (localSymbol.IsExtern && localSymbol.IsStatic) || hasErrors);
703Debug.Assert(usingDeclaration is BoundUsingLocalDeclarations);
763Debug.Assert(expr is object);
764Debug.Assert(expr.Type is object);
765Debug.Assert(expr.Type.IsRefLikeType || hasAwait); // pattern dispose lookup is only valid on ref structs or asynchronous usings
793Debug.Assert(
803Debug.Assert(typeSyntax is not ScopedTypeSyntax);
805Debug.Assert(declType.HasType || isVar);
965Debug.Assert(declarator != null);
991Debug.Assert(declarator != null);
992Debug.Assert(declTypeOpt.HasType || isVar);
993Debug.Assert(typeSyntax != null);
1076Debug.Assert(declTypeOpt.HasType);
1229Debug.Assert(!ReferenceEquals(declType, null));
1230Debug.Assert(declType.IsPointerType());
1366Debug.Assert(initializer != null);
1410Debug.Assert(node != null);
1411Debug.Assert(node.Left != null);
1412Debug.Assert(node.Right != null);
1486Debug.Assert(op1 != null);
1487Debug.Assert(op2 != null);
1493Debug.Assert(!op1.NeedsToBeConverted()
1555Debug.Assert(op1 != null);
1556Debug.Assert(op2 != null);
1560Debug.Assert(op1.Type is { });
1593Debug.Assert(leftEscape.Equals(rightEscape) || op1.Type.IsRefLikeOrAllowsRefLikeType());
1601Debug.Assert(op1.Kind != BoundKind.Parameter); // If the assert fails, add a corresponding test.
1649Debug.Assert(false);
1657Debug.Assert(methodInvocationInfo.MethodInfo.Method is not null);
1861Debug.Assert((object)receiver.Type != null);
1872Debug.Assert(node != null);
1917Debug.Assert(binder != null);
1968Debug.Assert((object)targetType != null);
1969Debug.Assert(expression != null);
2048Debug.Assert((object)targetType != null);
2049Debug.Assert(anonymousFunction != null);
2105Debug.Assert(targetType.IsExpressionTree());
2112Debug.Assert(targetType.IsGenericOrNonGenericExpressionType(out _));
2150Debug.Assert(delegateType is not null);
2208Debug.Assert(diagnostics.DiagnosticBag?.Count is not 0);
2231Debug.Assert(anonymousFunction.HasExplicitlyTypedParameterList);
2235Debug.Assert(anonymousFunction.ParameterCount == delegateParameters.Length);
2241Debug.Assert(!lambdaParameterType.IsErrorType());
2263Debug.Assert(ErrorFacts.PreventsSuccessfulDelegateConversion(bindingResult.Diagnostics.Diagnostics));
2270Debug.Assert(false, "Missing case in lambda conversion error reporting");
2281Debug.Assert(!conversion.IsImplicit || !conversion.IsValid);
2315Debug.Assert(conversion.IsUserDefined || conversion.IsUnion);
2324Debug.Assert(originalUserDefinedConversions.Length == 0,
2353Debug.Assert(operand != null);
2354Debug.Assert((object)targetType != null);
2445Debug.Assert(reportedError);
2465Debug.Assert(reportedError);
2487Debug.Assert(operand.HasAnyErrors && operand.Kind != BoundKind.UnboundLambda, "Missing a case in implicit conversion error reporting");
2605Debug.Assert(b != null);
2790Debug.Assert(node != null);
2807Debug.Assert(node != null);
2810Debug.Assert(loopBinder != null);
2822Debug.Assert(loopBinder != null);
2835Debug.Assert(loopBinder != null);
2853Debug.Assert(typeSyntax is not ScopedTypeSyntax || localKind is LocalDeclarationKind.RegularVariable or LocalDeclarationKind.UsingVariable);
2873Debug.Assert(declType.HasType || isVar);
2877Debug.Assert(count > 0);
2965Debug.Assert(name != null);
3215Debug.Assert(returnRefKind == RefKind.None);
3292Debug.Assert(node != null);
3340Debug.Assert((object)type != null);
3376Debug.Assert(((object)type == null) || !type.IsErrorType());
3418Debug.Assert(binder != null);
3426Debug.Assert(local.Type.IsErrorType() || (TypeSymbol.Equals(local.Type, type, TypeCompareKind.ConsiderEverything2)));
3568Debug.Assert(expressionSyntax != null || !IsValidExpressionBody(expressionSyntax, expression));
3658Debug.Assert(bodyBinder != null);
3679Debug.Assert(bodyBinder != null);
3691Debug.Assert(bodyBinder != null);
3693Debug.Assert(body.Kind() != SyntaxKind.RefExpression);
3771Debug.Assert(typeDecl.ParameterList is object);
3772Debug.Assert(typeDecl.Kind() is SyntaxKind.RecordDeclaration or SyntaxKind.ClassDeclaration or SyntaxKind.RecordStructDeclaration or SyntaxKind.StructDeclaration);
3779Debug.Assert(initializerBinder != null);
3800Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
3813Debug.Assert(bodyBinder != null);
3878Debug.Assert(!this.ContainingMember().IsImplicitlyDeclared);
3880Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
3897Debug.Assert(initializerInvocation.HasAnyErrors || constructorInitializer.IsConstructorInitializer(), "Please keep this bound node in sync with BoundNodeExtensions.IsConstructorInitializer.");
3921Debug.Assert(sourceConstructor?.SyntaxNode is TypeDeclarationSyntax
Binder\Binder_Symbols.cs (44)
42Debug.Assert(isVar == symbol.IsDefault);
62Debug.Assert((keyword != ConstraintContextualKeyword.None) == symbol.IsDefault);
83Debug.Assert(isVar == symbol.IsDefault);
277Debug.Assert(UnwrapAliasNoDiagnostics(symbol) is NamespaceSymbol);
325Debug.Assert(diagnostics != null);
400Debug.Assert(!result.IsDefault);
1136Debug.Assert(syntax != null);
1137Debug.Assert(diagnostics != null);
1319Debug.Assert(lookupResult.Error != null);
1362Debug.Assert(typeArguments.Count > 0);
1458Debug.Assert(members.Count > 0);
1563Debug.Assert(lookupResult?.IsClear != false);
1602Debug.Assert(symbol.IsExtensionBlockMember());
1639Debug.Assert(!typeArguments.IsEmpty);
1721Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found");
1729Debug.Assert((object)typeSymbol != null, "Expect an error type if special type isn't found");
1794Debug.Assert(symbol.IsDefinition);
1859Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found");
1867Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found");
1889Debug.Assert((object)typeSymbol != null, "Expect an error type if well-known type isn't found");
1905Debug.Assert((syntax != null) ^ (location != null));
2027Debug.Assert(where != null);
2028Debug.Assert(diagnostics != null);
2050Debug.Assert(!best.IsNone);
2051Debug.Assert(!secondBest.IsNone);
2066Debug.Assert(best.IsFromAddedModule);
2109Debug.Assert(!(srcSymbol.Kind == SymbolKind.Namespace && mdSymbol.Kind == SymbolKind.Namespace));
2117Debug.Assert(!Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything) || options.IsAttributeTypeLookup(),
2120Debug.Assert(!Symbol.Equals(first, second, TypeCompareKind.ConsiderEverything) || !Symbol.Equals(originalSymbols[best.Index], originalSymbols[secondBest.Index], TypeCompareKind.ConsiderEverything),
2161Debug.Assert(!best.IsFromCorLibrary);
2173Debug.Assert(best.IsFromCompilation);
2209Debug.Assert(secondBest.IsFromAddedModule);
2220Debug.Assert(best.IsFromAddedModule);
2244Debug.Assert(arg2.ContainingAssembly == Compilation.Assembly);
2275Debug.Assert(originalSymbols[best.Index].Name != originalSymbols[secondBest.Index].Name ||
2404Debug.Assert(symbols.Count > 0);
2524Debug.Assert(location != BestSymbolLocation.None);
2551Debug.Assert(secondLocation != 0);
2598Debug.Assert(!first.IsNone);
2599Debug.Assert(!second.IsNone);
2661Debug.Assert(qualifierOpt.IsNamespace);
2667Debug.Assert(aliasOpt == null || aliasOpt == SyntaxFacts.GetText(SyntaxKind.GlobalKeyword));
2733Debug.Assert((object)forwardedType.ContainingAssembly != null, "How did we find a cycle if there was no forwarding?");
2764Debug.Assert(false);
Binder\Binder.ValueChecks.cs (104)
93Debug.Assert(method is ErrorMethodSymbol or { HasUnsupportedMetadata: true });
156Debug.Assert(indexerAccess.AccessorKind != AccessorKind.Set);
172Debug.Assert(objectCreation.Constructor is not null);
188Debug.Assert(unaryOperator.MethodOpt is not null);
205Debug.Assert(binaryOperatorMethod is not null);
260Debug.Assert(incrementOperator.MethodOpt is not null);
277Debug.Assert(method is not null);
306Debug.Assert(propertyAccess.AutoPropertyAccessorKind != AccessorKind.Set);
353Debug.Assert(parameter.RefKind.IsWritableReference() && parameter.Type.IsRefLikeOrAllowsRefLikeType());
354Debug.Assert(GetParameterValEscapeLevel(parameter).HasValue);
395Debug.Assert(!isArgList || parameter is null);
662Debug.Assert(parameters.Length == indexer.Parameters.Length);
743Debug.Assert(expr.Syntax.Kind() != SyntaxKind.Argument || valueKind == BindValueKind.RefOrOut);
748Debug.Assert(valueKind == BindValueKind.RefOrOut);
752Debug.Assert(valueKind is (BindValueKind.Assignable or BindValueKind.RefOrOut or BindValueKind.RefAssignable) || diagnostics.DiagnosticBag is null || diagnostics.HasAnyResolvedErrors());
854Debug.Assert(!resolution.IsNonMethodExtensionMember(out _));
873Debug.Assert(methodGroup.ResultKind != LookupResultKind.Viable);
880Debug.Assert(methodGroup.LookupError != null);
938Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter());
1109Debug.Assert(!RequiresRefAssignableVariable(valueKind));
1404Debug.Assert(!RequiresAssignableVariable(BindValueKind.AddressOf));
1423Debug.Assert(parameterSymbol.RefKind != RefKind.None || !RequiresRefAssignableVariable(valueKind));
1431Debug.Assert(backingField.RefKind == RefKind.None);
1432Debug.Assert(!RequiresRefAssignableVariable(valueKind));
1436Debug.Assert(backingField.RefKind == RefKind.None);
1469Debug.Assert(valueKind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp
1573Debug.Assert(parameterSymbol.RefKind == RefKind.None || isRefScoped || refSafeToEscape.IsReturnOnly);
1655Debug.Assert(valueKind == BindValueKind.RefAssignable);
1666Debug.Assert(fieldAccess.ReceiverOpt is null or BoundTypeExpression);
1671Debug.Assert(fieldAccess.ReceiverOpt is not null);
1805Debug.Assert(fieldAccess.ReceiverOpt is { });
1862Debug.Assert(!RequiresVariableReceiver(receiver, eventSymbol));
1912Debug.Assert(receiver != null);
1997Debug.Assert((object)propertySymbol != null);
1998Debug.Assert(propertySyntax != null);
2010Debug.Assert(propertySymbol.TypeWithAnnotations.HasType);
2214Debug.Assert(member.Kind != SymbolKind.Property);
2215Debug.Assert(member.Kind != SymbolKind.Event);
2267Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(in methodInvocationInfo));
2430Debug.Assert(extensionParameter is not null);
2440Debug.Assert(methodInvocationInfo.HasAnyErrors, "Got a null receiver for a non-static extension method without errors?");
2481Debug.Assert(AllParametersConsideredInEscapeAnalysisHaveArguments(in methodInvocationInfo));
2668Debug.Assert(receiver.Type is { });
2669Debug.Assert(methodInvocationInfo.ReceiverIsSubjectToCloning != ThreeState.Unknown);
2673Debug.Assert(receiver is not BoundValuePlaceholderBase && method is not null && receiver.Type?.IsReferenceType == false);
2701Debug.Assert(argIndex == argsOpt.Length - 1);
2884Debug.Assert(methodInfo.Method?.IsExtensionMethod != false);
2913Debug.Assert(parameter?.IsThis != true);
2918Debug.Assert(escapeLevel == EscapeLevel.ReturnOnly);
3144Debug.Assert(symbol is null or SourceLocalSymbol or GlobalExpressionVariable);
3359Debug.Assert(underlyingParameter.IsThis);
3360Debug.Assert(underlyingParameter.RefKind != RefKind.Out); // Shouldn't get here for a constructor
3361Debug.Assert(underlyingParameter.ContainingSymbol is MethodSymbol);
3436Debug.Assert((object)local != null);
3437Debug.Assert(kind != BindValueKind.RValue);
3598Debug.Assert((object)field != null);
3599Debug.Assert(field.RefKind == RefKind.None ? RequiresAssignableVariable(kind) : RequiresRefAssignableVariable(kind));
3600Debug.Assert(field.Type != (object)null);
3604Debug.Assert(kind != BindValueKind.AddressOf); // If this assert fails, we probably should report ErrorCode.ERR_InvalidAddrOp
3634Debug.Assert((object)symbol != null);
3635Debug.Assert(RequiresAssignableVariable(kind));
3671Debug.Assert(expr.Type is not null);
3752Debug.Assert(false);
3757Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything));
3885Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None);
3893Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None);
3921Debug.Assert(expr is BoundConversion conversion &&
3928Debug.Assert(expr is BoundUnaryOperator unaryOperator &&
3935Debug.Assert(expr is BoundBinaryOperator binaryOperator &&
3942Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator &&
3948Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator &&
3955Debug.Assert(expr is BoundIncrementOperator incrementOperator &&
3977Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter());
3981Debug.Assert(GetRefEscape(expr).IsConvertibleTo(escapeTo));
4051Debug.Assert(false);
4056Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything));
4186Debug.Assert(GetInlineArrayAccessEquivalentSignatureMethod(elementAccess, out _, out _).RefKind == RefKind.None);
4194Debug.Assert(equivalentSignatureMethod.RefKind != RefKind.None);
4264Debug.Assert((!conversion.Conversion.IsUserDefined && !conversion.Conversion.IsUnion) ||
4270Debug.Assert(expr is BoundUnaryOperator unaryOperator &&
4277Debug.Assert(expr is BoundBinaryOperator binaryOperator &&
4284Debug.Assert(expr is BoundUserDefinedConditionalLogicalOperator logicalOperator &&
4290Debug.Assert(expr is BoundCompoundAssignmentOperator compoundAssignmentOperator &&
4297Debug.Assert(expr is BoundIncrementOperator incrementOperator &&
4368Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything));
4416Debug.Assert(false);
4594Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
4620Debug.Assert(operatorMethod is not null);
4642Debug.Assert(increment.OperatorKind.IsUserDefined());
4645Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement);
4790Debug.Assert(elementType.Type is { });
4799Debug.Assert(elementType.Type is { });
4803Debug.Assert(expr.CollectionCreation is not null);
4848Debug.Assert(spreadElement.HasErrors
4863Debug.Assert(element.HasErrors);
5037Debug.Assert(!checkingReceiver || expr.Type.IsValueType || expr.Type.IsTypeParameter());
5041Debug.Assert(GetValEscape(expr).IsConvertibleTo(escapeTo));
5069Debug.Assert(thisParam.Type.Equals(((BoundThisReference)expr).Type, TypeCompareKind.ConsiderEverything));
5174Debug.Assert(false);
5373Debug.Assert(conversion.ConversionKind != ConversionKind.StackAllocToSpanType, "StackAllocToSpanType unexpected");
5409Debug.Assert(operatorMethod is not null);
5436Debug.Assert(increment.OperatorKind.IsUserDefined());
5439Debug.Assert(prefix || increment.OperatorKind.Operator() is UnaryOperatorKind.PostfixIncrement or UnaryOperatorKind.PostfixDecrement);
5765Debug.Assert(conversion.Conversion.IsInlineArray);
Binder\DecisionDagBuilder.cs (104)
372Debug.Assert(pattern.UnionMatchingMode == UnionMatchingMode.None);
373Debug.Assert(input.UnionValue is null ?
387Debug.Assert(input.UnionValue is null);
435Debug.Assert(unionValue.Symbol is PropertySymbol);
440Debug.Assert(IsUnionValue(result, out _));
569Debug.Assert(input.Index == 0);
602Debug.Assert(variableAccess.Type!.Equals(input.Type, TypeCompareKind.AllIgnoreOptions) || variableAccess.Type.IsErrorType());
758Debug.Assert(IsUnionHasValue(temp, out _));
761Debug.Assert(test is Tests.One { Test: BoundDagValueTest });
803Debug.Assert(IsUnionTryGetValueReturn(boolResult, out _, out _, out _));
806Debug.Assert(test is Tests.One { Test: var tryGetValueResultTest } && IsUnionTryGetValueTest(tryGetValueResultTest, out _, out _, out _));
844Debug.Assert(!conversion.IsUserDefined);
845Debug.Assert(!conversion.IsUnion);
904Debug.Assert(constant.Value.Type is not null || constant.HasErrors);
923Debug.Assert(input.Source is BoundDagPropertyEvaluation { IsLengthOrCount: true });
1009Debug.Assert(subpattern is { IsLengthOrCount: false });
1067Debug.Assert(subpattern.HasAnyErrors);
1095Debug.Assert(subpattern.HasAnyErrors);
1170Debug.Assert(bin.HasErrors ||
1185Debug.Assert(type is { });
1233Debug.Assert(_suitableForLowering || !_forLowering);
1239Debug.Assert(kvp.Key == kvp.Value);
1385Debug.Assert(!first.IsImpossible);
1460Debug.Assert(state.SelectedTest is null);
1488Debug.Assert(state.FalseBranch is null);
1489Debug.Assert(trueBranch is not null);
1490Debug.Assert(state.TrueBranch is not null);
1500Debug.Assert(stateForCases.Index == state.TrueBranch.Cases[case2].Index);
1505Debug.Assert(case2 >= state.TrueBranch.Cases.Count || stateForCases.Index != state.TrueBranch.Cases[case2].Index);
1544Debug.Assert(trueBranch is not null);
1545Debug.Assert(falseBranch is not null);
1610Debug.Assert(_defaultLabel != null);
1611Debug.Assert(defaultDecision != null);
1621Debug.Assert(wasAcyclic, "wasAcyclic"); // force failure in debug builds
1893Debug.Assert(e.IsLengthOrCount);
1899Debug.Assert(input.Index == 0);
1914Debug.Assert(input.Index == 0);
2210Debug.Assert(testUnionInstance != null);
2211Debug.Assert(testKind != UnionTestKind.TypeTest || testTargetType is not null);
2222Debug.Assert(otherUnionInstance != null);
2223Debug.Assert(otherKind != UnionTestKind.TypeTest || otherTargetType is not null);
2265Debug.Assert(testTargetType is not null);
2266Debug.Assert(otherTargetType is not null);
2377Debug.Assert((hasValueTest.Value == ConstantValue.True || hasValueTest.Value == ConstantValue.False));
2396Debug.Assert(isTrue); // The only form of the test that we construct
2522Debug.Assert(s1LengthTemp.IsEquivalentTo(s2LengthTemp));
2589Debug.Assert(s1.Input.Source is BoundDagTypeEvaluation);
2590Debug.Assert(s2.Input.Source is BoundDagTypeEvaluation);
2676Debug.Assert(input.Index == 0);
2961Debug.Assert(arrayBuilder != null);
3067Debug.Assert(dagState.Cases.IsDefault);
3068Debug.Assert(dagState.RemainingValues is null);
3069Debug.Assert(dagState.SelectedTest is null);
3070Debug.Assert(dagState.TrueBranch is null);
3071Debug.Assert(dagState.FalseBranch is null);
3072Debug.Assert(dagState.Dag is null);
3278Debug.Assert((conditionToUseFinalResult is null) == (tempsUpdatedResult is null));
3279Debug.Assert((conditionToUseFinalResult is null) || (tempsUpdatedResult is One(BoundDagIndexerEvaluation)));
3316Debug.Assert(rewriteResult.TempsUpdatedResult is not null);
3354Debug.Assert(!b.TempContainingValue.Equals(useValueFrom));
3523Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32);
3524Debug.Assert(t.Relation == BinaryOperatorKind.GreaterThanOrEqual);
3525Debug.Assert(t.Value.Int32Value >= 0);
3538Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32);
3542Debug.Assert(t.Value.Discriminator == ConstantValueTypeDiscriminator.Int32);
3566Debug.Assert(value >= 0); // Tests with negative values should never be created.
3567Debug.Assert(offset >= 0); // The number of elements in a list is always non-negative.
3581Debug.Assert(tempMap.IsEmpty);
3607Debug.Assert(savedTempMap == tempsUpdatedResultTempMap);
3618Debug.Assert(removeEvaluationLeavesInputUnchanged(tempsUpdatedResult, builder, state, tempMap, e));
3623Debug.Assert(!finalResult.Equals(tempsUpdatedResult) || tempsUpdatedResultTempMap == tempMap);
3624Debug.Assert(condition is null ||
3628Debug.Assert(Test is not BoundDagIndexerEvaluation ||
3646Debug.Fail("Unexpected change in temp map during conditional removal of indexer evaluation.");
3713Debug.Assert(!eval.Input.Equals(e1.Input));
3762Debug.Assert(oldTemp.Type.Equals(newTemp.Type, TypeCompareKind.AllIgnoreOptions));
3794Debug.Assert(!typeEval.Equals(e1));
3860Debug.Fail("Do not expect to get in a situation when a type evaluation removal initiates a temp rewrite.");
3882Debug.Assert(s1LengthTemp.IsEquivalentTo(s2LengthTemp));
3892Debug.Assert(state.RemainingValues.ContainsKey(s1LengthTemp));
3896Debug.Assert(!lengthValues.IsEmpty);
3935Debug.Assert(passThrough.Input.Source is BoundDagTypeEvaluation);
4018Debug.Assert(test is not BoundDagEvaluation);
4046Debug.Assert(!values.IsEmpty);
4105Debug.Assert(test is BoundDagTypeTest, "New type of non-evaluation test added, please update filter for this");
4151Debug.Assert(sample is not null);
4174Debug.Assert(Input.Source is not BoundDagPropertyEvaluation { IsLengthOrCount: true } e ||
4244Debug.Assert(remainingTests.Length > 1);
4376Debug.Assert(tempMapToRestore == tempMap);
4386Debug.Assert(testsToAssemble.Count != 0); // If we have a child to rewrite, we must have a parent to reassemble.
4432Debug.Assert(testsToAssemble.Peek().Kind == ReassembleKind.And);
4442Debug.Assert(rewriteResult.TempsUpdatedResult is not null);
4448Debug.Assert(leftToRewriteBuilder.Count < childCount);
4475Debug.Assert(rewriteResult.ConditionToUseFinalResult is not null);
4476Debug.Assert(rewriteResult.TempsUpdatedResult is not null);
4547Debug.Assert(!skip);
4548Debug.Assert(!skip);
4616Debug.Assert(obj is SequenceTests);
4644Debug.Assert(t2 is SequenceTests seq && seq.RemainingTests.Length == sequence.RemainingTests.Length);
4778Debug.Assert(!remainingTests.Any(t => t is AndSequence));
4785Debug.Assert(t2 is not (True or False));
4884Debug.Assert(!remainingTests.Any(t => t is OrSequence));
4891Debug.Assert(t2 is not (True or False));
4943Debug.Assert(builder.Count == count);
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (143)
65Debug.Assert(instance.Count == 0);
285Debug.Assert(!methodTypeParameters.IsDefault);
286Debug.Assert(methodTypeParameters.Length > 0);
287Debug.Assert(!formalParameterTypes.IsDefault);
288Debug.Assert(formalParameterRefKinds.IsDefault || formalParameterRefKinds.Length == formalParameterTypes.Length);
289Debug.Assert(!arguments.IsDefault);
345Debug.Assert(ordinals is null || ordinals.Values.Count() == ordinals.Values.Distinct().Count());
346Debug.Assert(ordinals is null || methodTypeParameters.All(tp => ordinals.ContainsKey(tp)));
354Debug.Assert(_nullableAnnotationLowerBounds.All(annotation => annotation.IsNotAnnotated()));
443Debug.Assert(0 <= index && index < _formalParameterTypes.Length);
498Debug.Assert(ValidIndex(methodTypeParameterIndex));
504Debug.Assert(type.HasType);
539Debug.Assert(IsUnfixedTypeParameter(methodTypeParameterWithAnnotations));
554Debug.Assert(ValidIndex(methodTypeParameterIndex));
562Debug.Assert((object)delegateOrFunctionPointerType != null);
563Debug.Assert(delegateOrFunctionPointerType.IsDelegateType() || delegateOrFunctionPointerType is FunctionPointerTypeSymbol);
603Debug.Assert(!_formalParameterTypes.IsDefault);
604Debug.Assert(!_arguments.IsDefault);
671Debug.Assert(targetType is { });
705Debug.Assert(target.Type is { });
744Debug.Assert(sourceArguments.Length == destTypes.Length);
802Debug.Assert(res != InferenceResult.NoProgress);
931Debug.Assert((object)argument.Type == null, "should not need to dig into elements if tuple has natural type");
941Debug.Assert(sourceArguments.Length == destTypes.Length);
1128Debug.Assert(ValidIndex(iParam));
1129Debug.Assert(ValidIndex(jParam));
1141Debug.Assert(IsUnfixed(iParam));
1142Debug.Assert(IsUnfixed(jParam));
1194Debug.Assert(_dependencies == null);
1198Debug.Assert(0 == (int)Dependency.Unknown);
1215Debug.Assert(_dependencies != null);
1221Debug.Assert(0 <= iParam && iParam < _methodTypeParameters.Length);
1222Debug.Assert(0 <= jParam && jParam < _methodTypeParameters.Length);
1234Debug.Assert(_dependencies != null);
1235Debug.Assert(ValidIndex(iParam));
1236Debug.Assert(ValidIndex(jParam));
1270Debug.Assert(_dependencies != null);
1291Debug.Assert(_dependencies != null);
1306Debug.Assert(_dependencies != null);
1324Debug.Assert(ValidIndex(iParam));
1339Debug.Assert(ValidIndex(iParam));
1352Debug.Assert(ValidIndex(iParam));
1371Debug.Assert(expression != null);
1372Debug.Assert(target.HasType);
1404Debug.Assert(source != null);
1405Debug.Assert(target.HasType);
1418Debug.Assert((object)delegateType.DelegateInvokeMethod != null && !delegateType.DelegateInvokeMethod.HasUseSiteError,
1432Debug.Assert(inferredReturnType.Type is not FunctionTypeSymbol);
1440Debug.Assert(source != null);
1441Debug.Assert((object)target != null);
1472Debug.Assert(method is { HasUseSiteError: false },
1523Debug.Assert(!resolution.IsNonMethodExtensionMember(out _));
1549Debug.Assert(source != null);
1550Debug.Assert(target.HasType);
1604Debug.Assert(source != null);
1605Debug.Assert(target.HasType);
1640Debug.Assert(source.HasType);
1641Debug.Assert(target.HasType);
1694Debug.Assert(source.HasType);
1695Debug.Assert(target.HasType);
1709Debug.Assert(source.HasType);
1710Debug.Assert(target.HasType);
1741Debug.Assert(source is not null);
1742Debug.Assert(target is not null);
1768Debug.Assert(type.IsSpan() || type.IsReadOnlySpan());
1804Debug.Assert(source.HasType);
1805Debug.Assert(target.HasType);
1833Debug.Assert(source.HasType);
1834Debug.Assert(target.HasType);
1860Debug.Assert(source.HasType);
1861Debug.Assert(target.HasType);
1944Debug.Assert((object)source != null);
1945Debug.Assert((object)target != null);
1946Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
1954Debug.Assert(sourceTypeArguments.Count == targetTypeArguments.Count);
1971Debug.Assert(source.HasType);
1972Debug.Assert(target.HasType);
2065Debug.Assert(source.HasType);
2066Debug.Assert(target.HasType);
2080Debug.Assert((object)source != null);
2081Debug.Assert((object)target != null);
2115Debug.Assert((object)source != null);
2116Debug.Assert((object)target != null);
2153Debug.Assert(source is not null);
2154Debug.Assert(target is not null);
2196Debug.Assert((object)source != null);
2197Debug.Assert((object)target != null);
2260Debug.Assert((object)source != null);
2261Debug.Assert((object)target != null);
2305Debug.Assert((object)source != null);
2306Debug.Assert((object)target != null);
2386Debug.Assert((object)source != null);
2387Debug.Assert((object)target != null);
2388Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
2398Debug.Assert(typeParameters.Count == sourceTypeArguments.Count);
2399Debug.Assert(typeParameters.Count == targetTypeArguments.Count);
2480Debug.Assert(source.HasType);
2481Debug.Assert(target.HasType);
2514Debug.Assert(source.Type.IsReferenceType || source.Type.IsFunctionPointer());
2541Debug.Assert(source.HasType);
2542Debug.Assert(target.HasType);
2555Debug.Assert(source.HasType);
2556Debug.Assert(target.HasType);
2597Debug.Assert(sourceWithAnnotations.HasType);
2598Debug.Assert(targetWithAnnotations.HasType);
2657Debug.Assert((object)source != null);
2658Debug.Assert((object)target != null);
2686Debug.Assert((object)source != null);
2687Debug.Assert((object)target != null);
2736Debug.Assert((object)source != null);
2737Debug.Assert((object)target != null);
2738Debug.Assert(TypeSymbol.Equals(source.OriginalDefinition, target.OriginalDefinition, TypeCompareKind.ConsiderEverything2));
2748Debug.Assert(typeParameters.Count == sourceTypeArguments.Count);
2749Debug.Assert(typeParameters.Count == targetTypeArguments.Count);
2829Debug.Assert(IsUnfixed(iParam));
2851Debug.Assert(best.Type.Type.Equals(withoutNullability.Type, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
2883Debug.Assert(!containsFunctionTypes(exact));
2884Debug.Assert(!containsFunctionTypes(upper));
2974Debug.Assert(!best.Equals(candidate, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
2994Debug.Assert(compilation is not null); // Tracked by https://github.com/dotnet/roslyn/issues/80658
3062Debug.Assert((object)target != null);
3063Debug.Assert(target.IsDelegateType());
3064Debug.Assert((object)target.DelegateInvokeMethod != null && !target.DelegateInvokeMethod.HasUseSiteError,
3066Debug.Assert(!target.DelegateInvokeMethod.ReturnsVoid);
3070Debug.Assert(!HasUnfixedParamInInputType(source, target));
3156Debug.Assert(target.IsInterface);
3194Debug.Assert(extension is not null);
3195Debug.Assert(extension.Arity > 0);
3196Debug.Assert(extension.ExtensionParameter is not null);
3197Debug.Assert(!extension.ExtensionParameter.Type.IsDynamic());
3198Debug.Assert(extension.IsDefinition);
3199Debug.Assert(receiver is not null);
3263Debug.Assert((object)method != null);
3264Debug.Assert(method.Arity > 0);
3265Debug.Assert(!arguments.IsDefault);
3274Debug.Assert(!method.GetParameterType(0).IsDynamic());
3301Debug.Assert(!_formalParameterTypes.IsDefault);
3302Debug.Assert(_formalParameterTypes.Length >= 1);
3303Debug.Assert(!_arguments.IsDefault);
3304Debug.Assert(_arguments.Length >= 1);
3323Debug.Assert(IsUnfixed(iParam));
3393Debug.Assert(conversions.IncludeNullability ||
3424Debug.Assert(variance == VarianceKind.In || variance == VarianceKind.Out);
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (41)
68Debug.Assert(_bestResultState == ThreeState.True && _bestResult.Result.IsValid);
93Debug.Assert(_bestResultState == ThreeState.True);
133Debug.Assert(HasAnyApplicableMember);
176Debug.Assert(false, "How did we manage to get two methods in the overload resolution results that were both better than every other method?");
224Debug.Assert(!this.Succeeded, "Don't ask for diagnostic info on a successful overload resolution result.");
227Debug.Assert(arguments.Arguments.All(a => a.Display != null));
432Debug.Assert(!supportedRequiredParameterMissingConflicts);
495Debug.Assert(arguments.Names[badArg].HasValue);
535Debug.Assert(firstSupported.Member is MethodSymbol { MethodKind: MethodKind.Constructor });
544Debug.Assert(firstSupported.Member is MethodSymbol { Name: "Add" });
606Debug.Assert(diagInfo != null);
607Debug.Assert(diagInfo.Severity == DiagnosticSeverity.Error);
620Debug.Assert(firstSupported.Result.Kind == MemberResolutionKind.WrongCallingConvention);
635Debug.Assert(bad.Member.GetUseSiteInfo().DiagnosticInfo.Severity == DiagnosticSeverity.Error,
792Debug.Assert(arguments.Arguments.Count > 0);
832Debug.Assert(arguments.Names.Count > badArg);
833Debug.Assert(arguments.Names[badArg].HasValue);
835Debug.Assert(badName != null);
852Debug.Assert(arguments.Names.Count > badArg);
853Debug.Assert(arguments.Names[badArg].HasValue);
855Debug.Assert(badName != null);
866Debug.Assert(result.Result.BadArgumentsOpt.TrueBits().Count() == 1);
867Debug.Assert(arguments.Names[result.Result.FirstBadArgument].HasValue);
869Debug.Assert(name != null);
892Debug.Assert(arguments.Names.Count > badArg);
893Debug.Assert(arguments.Names[badArg].HasValue);
895Debug.Assert(badName != null);
938Debug.Assert(badMember.Kind == SymbolKind.Method);
939Debug.Assert(((MethodSymbol)(object)badMember).IsVararg);
1235Debug.Assert(refArg == RefKind.None);
1340Debug.Assert(argument.Kind != BoundKind.OutDeconstructVarPendingInference);
1341Debug.Assert(argument.Kind != BoundKind.OutVariablePendingInference);
1342Debug.Assert(argument.Kind != BoundKind.DiscardExpression || argument.HasExpressionType());
1343Debug.Assert(argument.Display != null);
1347Debug.Assert((arg == 0) && (parm == arg));
1348Debug.Assert(!badArg.Result.ConversionForArg(parm).IsImplicit);
1359Debug.Assert((object)parameter == unwrapIfParamsCollection(badArg, parameter, isLastParameter), "If they ever differ, just call the method when constructing the diagnostic.");
1423Debug.Assert(badArg.Result.ParamsElementTypeOpt.Type != (object)ErrorTypeSymbol.EmptyParamsCollectionElementTypeSentinel);
1442Debug.Assert(nWorse == 0, "How is it that there is exactly one applicable but worse method, and exactly zero applicable best methods? What was better than this thing?");
1503Debug.Assert(nValid == 0, "Why are we doing error reporting on an overload resolution problem that had one valid result?");
1507Debug.Assert(false, "Add tests if this is triggered. https://github.com/dotnet/roslyn/issues/80507");
BoundTree\BoundNode.cs (21)
75Debug.Assert(
139Debug.Assert((_attributes & BoundNodeAttributes.HasErrors) == 0,
157Debug.Assert(original is BoundExpression || !original.IsSuppressed);
185Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0,
195Debug.Assert((_attributes & BoundNodeAttributes.CompilerGenerated) == 0,
207Debug.Assert((_attributes & BoundNodeAttributes.WasCompilerGeneratedIsChecked) == 0,
240Debug.Assert((_attributes & BoundNodeAttributes.WasTopLevelNullabilityChecked) == 0,
304Debug.Assert((_attributes & BoundNodeAttributes.IsSuppressed) == 0, "flag should not be set twice or reset");
326Debug.Assert((_attributes & BoundNodeAttributes.WasConverted) == 0, "WasConverted flag should not be set twice or reset");
342Debug.Assert((_attributes & BoundNodeAttributes.WasPropertyBackingFieldAccessChecked) == 0, "should not be set twice or reset");
360Debug.Assert(value || !IsParamsArrayOrCollection);
361Debug.Assert(!value ||
366Debug.Assert(!value ||
468Debug.Assert(possiblyUserDefined.Conversion.IsUserDefined);
495Debug.Assert(possiblyUnion.Conversion.IsUnion);
519Debug.Assert((boundConversion.InConversionGroupFlags & InConversionGroupFlags.LoweredFormOfUserDefinedConversionForExpressionTree) != 0);
562Debug.Assert(false, "duplicate local " + local.GetDebuggerDisplay());
573Debug.Assert(false, "missing local " + local.GetDebuggerDisplay());
582Debug.Assert(false, "undeclared local " + local.GetDebuggerDisplay());
618Debug.Assert(added);
635Debug.Assert(removed);
CodeGen\EmitExpression.cs (120)
79Debug.Assert(_recursionDepth == 1);
84Debug.Assert(_recursionDepth == 1);
233Debug.Assert(used);
238Debug.Assert(used);
243Debug.Assert(!used);
248Debug.Assert(used);
253Debug.Assert(used);
258Debug.Assert(used);
263Debug.Assert(used);
268Debug.Assert(used);
273Debug.Assert(used);
278Debug.Assert(used);
313Debug.Assert(used);
359Debug.Assert(expression.Kind != BoundKind.BadExpression);
376Debug.Assert(!expression.Type.IsReferenceType);
377Debug.Assert(!expression.Type.IsValueType);
408Debug.Assert(!receiverType.IsValueType ||
415Debug.Assert(receiverType.IsVerifierReference());
519Debug.Assert(receiver.Type.IsNullableType());
572Debug.Assert(receiverTemp == null);
575Debug.Assert(receiverTemp == null || receiver.IsDefaultValue());
613Debug.Assert(walker._result.HasValue);
631Debug.Assert(!_result.HasValue);
640Debug.Assert(!_result.HasValue);
651Debug.Assert(!expression.Type.IsValueType);
674Debug.Assert(temp == null, "makeref should not create temps");
691Debug.Assert((object)getTypeMethod != null);
721Debug.Assert(refKind is RefKind.In or RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn);
727Debug.Assert(refKind is RefKind.In || argument.Type.IsDynamic() || argument is BoundFieldAccess { FieldSymbol.RefKind: not RefKind.None }, "passing args byref should not clone them into temps");
746Debug.Assert(refKind is RefKind.Ref or RefKind.Out or RefKindExtensions.StrictIn);
758Debug.Assert(temp == null, "If the operand is addressable, then a temp shouldn't be required.");
810Debug.Assert((object)meth != null);
817Debug.Assert(thisType.TypeKind != TypeKind.TypeParameter);
867Debug.Assert(sequence.Value.Kind != BoundKind.TypeExpression || !used);
957Debug.Assert(arguments.Length == parameters.Length ||
959Debug.Assert(parameters.All(p => p.RefKind == RefKind.None) || !argRefKindsOpt.IsDefault, "there are nontrivial parameters, so we must have argRefKinds");
961Debug.Assert(argRefKindsOpt.IsDefault || argRefKindsOpt.Length == arguments.Length ||
985Debug.Assert(argRefKind == parameters[i].RefKind ||
996Debug.Assert(parameters[i].RefKind != RefKind.RefReadOnlyParameter,
1010Debug.Assert(arguments[i].Kind == BoundKind.ArgListOperator);
1150Debug.Assert(!field.IsConst || field.ContainingType.SpecialType == SpecialType.System_Decimal,
1193Debug.Assert(FieldLoadMustUseRef(receiver), "only clr-ambiguous structs use temps here");
1260Debug.Assert(!field.IsVolatile, "volatile valuetype fields are unexpected");
1432Debug.Assert(parameter.Type.Equals(parameter.ParameterSymbol.Type, TypeCompareKind.AllIgnoreOptions) ||
1540Debug.Assert(receiver.Type.IsVerifierReference(), "this is not a reference");
1541Debug.Assert(receiver.Kind != BoundKind.BaseReference, "base should always use call");
1669Debug.Assert(method.IsImplicitlyDeclared);
1670Debug.Assert(TypeSymbol.Equals(method.ContainingType, receiver.Type, TypeCompareKind.ConsiderEverything2));
1671Debug.Assert(receiver.Kind == BoundKind.ThisReference);
1686Debug.Assert(method.IsStatic);
1755Debug.Assert(!box);
1763Debug.Assert(addressKind.GetValueOrDefault() != AddressKind.Constrained);
1764Debug.Assert(!parentCallReceiverType.IsVerifierValue());
1765Debug.Assert(parentCallKind != CallKind.ConstrainedCallVirt);
1769Debug.Assert(!box);
1770Debug.Assert(!parentCallReceiverType.IsVerifierReference());
1805Debug.Assert(receiverUseKind == UseKind.UsedAsValue);
1815Debug.Assert(receiverUseKind == UseKind.UsedAsValue);
1820Debug.Assert(!parentCallReceiverType.IsVerifierReference());
1824Debug.Assert(receiverUseKind == UseKind.UsedAsValue);
1825Debug.Assert(!HasHome(nested, addressKind.GetValueOrDefault()));
1868Debug.Assert(!method.IsStatic && !method.IsDefaultValueTypeConstructor() && method.RequiresInstanceReceiver);
1908Debug.Assert(TypeSymbol.Equals(receiverType, methodContainingType, TypeCompareKind.ObliviousNullableModifierMatchesAny));
1953Debug.Assert((callKind != CallKind.ConstrainedCallVirt) || (addressKind.GetValueOrDefault() == AddressKind.Constrained) || receiverType.IsVerifierValue());
1976Debug.Assert(!box);
1977Debug.Assert(!receiverType.IsVerifierReference());
2022Debug.Assert(receiver.Type.IsVerifierReference());
2033Debug.Assert(receiver.Type.IsVerifierReference());
2046Debug.Assert(false, "Taking this code path is likely unexpected.");
2205Debug.Assert(!b.OperatorKind.IsUserDefined());
2218Debug.Assert(!conv.ConversionKind.IsUserDefinedConversion());
2219Debug.Assert(!conv.ConversionKind.IsUnionConversion());
2236Debug.Assert(methodContainingType.IsVerifierValue(), "only struct calls can be readonly");
2351Debug.Assert(method.ContainingType.IsVerifierValue(), "this is not a value type");
2399Debug.Assert(expression.Type.SpecialType == SpecialType.System_Int32 ||
2732Debug.Assert(temp == null, "in-place init target should not create temps");
2739Debug.Assert(TargetIsNotOnHeap(target), "cannot read-back the target since it could have been modified");
2746Debug.Assert(TargetIsNotOnHeap(target), "in-place construction target should not be on heap");
2761Debug.Assert(temp == null, "in-place ctor target should not create temps");
2855Debug.Assert(temp == null, "temp is unexpected when assigning to a field");
2939Debug.Assert(temp == null, "taking ref of this should not create a temp");
2950Debug.Assert(temp == null, "taking ref of Dup should not create a temp");
2959Debug.Assert(left.IsRef);
2962Debug.Assert(temp == null, "taking ref of this should not create a temp");
2995Debug.Assert(left.Method.RefKind != RefKind.None);
3006Debug.Assert(left.FunctionPointer.Signature.RefKind != RefKind.None);
3061Debug.Assert(lhs.Kind != BoundKind.Parameter || exprTempsAfter <= exprTempsBefore);
3179Debug.Assert(((BoundDup)expression).RefKind != RefKind.None);
3184Debug.Assert(((BoundConditionalOperator)expression).IsRef);
3202Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None);
3207Debug.Assert(((BoundFunctionPointerInvocation)expression).FunctionPointer.Signature.RefKind != RefKind.None);
3258Debug.Assert(thisRef.Type.IsValueType);
3454Debug.Assert((object)operand.Type != null);
3473Debug.Assert(asOp.OperandPlaceholder is null);
3474Debug.Assert(asOp.OperandConversion is null);
3483Debug.Assert((object)targetType != null);
3535Debug.Assert(expression.Type.SpecialType == SpecialType.System_Decimal ||
3580Debug.Assert((object)getTypeMethod != null); // Should have been checked during binding
3601Debug.Assert(node.Method.IsDefinition);
3602Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32);
3619Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32);
3633Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32);
3647Debug.Assert(field.IsDefinition);
3656Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32);
3692Debug.Assert(throwMethod != null);
3735Debug.Assert(node.Type.SpecialType == SpecialType.System_Int32);
3746Debug.Assert((object)getMethod != null);
3754Debug.Assert(getMethod.ParameterCount == 2);
3773Debug.Assert((object)getField != null);
3781Debug.Assert(getField.ParameterCount == 2);
3810Debug.Assert(expr.ConstantValueOpt == null, "Constant value should have been emitted directly");
3908Debug.Assert(expr.LeftConversion is null, "coalesce with nontrivial left conversions are lowered into conditional.");
3909Debug.Assert(expr.Type.IsReferenceType);
3989Debug.Assert(conversionKind != ConversionKind.NullLiteral && conversionKind != ConversionKind.DefaultLiteral);
4056Debug.Assert(to.IsVerifierReference());
4076Debug.Assert(!type.IsRefLikeType);
4129Debug.Assert(useKind == UseKind.Unused, "Using the return value of a void method.");
4130Debug.Assert(_method.GenerateDebugInfo, "Implied by this.emitSequencePoints");
4169Debug.Assert(method.RefKind != RefKind.None);
4175Debug.Assert(load.Type is { TypeKind: TypeKind.FunctionPointer });
CodeGen\Optimizer.cs (44)
298Debug.Assert(instance._localDefs == null);
450Debug.Assert(expr.Kind != BoundKind.Label);
520Debug.Assert(_recursionDepth == 1);
525Debug.Assert(_recursionDepth == 1);
541Debug.Assert(result != null || context == ExprContext.None);
567Debug.Assert(node == null || EvalStackIsEmpty());
614Debug.Assert(EvalStackIsEmpty(), "entering blocks when evaluation stack is not empty?");
793Debug.Assert(localUsedWalker.IsLocalUsedIn(assignment.Right), "who assigns the temp?");
868Debug.Assert(_assignmentLocal == null);
928Debug.Assert(_context != ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment");
938Debug.Assert(_context == ExprContext.Value ||
972Debug.Assert(
978Debug.Assert(!isIndirectAssignment, "indirect assignment is a read, not a write");
1039Debug.Assert(!node.IsRef ||
1046Debug.Assert(lhs.Type.IsValueType, "'this' is assignable only in structs");
1066Debug.Assert(((BoundCall)lhs).Method.RefKind == RefKind.Ref, "only ref returning methods are assignable");
1070Debug.Assert(((BoundFunctionPointerInvocation)lhs).FunctionPointer.Signature.RefKind == RefKind.Ref, "only ref returning function pointers are assignable");
1074Debug.Assert(((BoundConditionalOperator)lhs).IsRef, "only ref ternaries are assignable");
1078Debug.Assert(((BoundAssignmentOperator)lhs).IsRef, "only ref assignments are assignable");
1084Debug.Assert(!IsIndirectAssignment(node.Update(((BoundSequence)node.Left).Value, node.Right, node.IsRef, node.Type)),
1179Debug.Assert(method.IsStatic);
1268Debug.Assert(!arguments.IsDefault);
1269Debug.Assert(!parameters.IsDefault);
1271Debug.Assert(arguments.Length == parameters.Length || arguments.Length == parameters.Length + 1);
1331Debug.Assert(node.InitializerExpressionOpt == null);
1400Debug.Assert(false, "we should not have label expressions at this stage");
1406Debug.Assert(false, "we should not have is-pattern expressions at this stage");
1412Debug.Assert(node.CaseExpressionOpt == null, "we should not have label expressions at this stage");
1431Debug.Assert(EvalStackIsEmpty());
1538Debug.Assert(!binary.OperatorKind.IsDynamic());
1552Debug.Assert((object)binary == node);
1573Debug.Assert(!node.OperatorKind.IsDynamic());
1582Debug.Assert(node.LeftPlaceholder is null);
1583Debug.Assert(node.LeftConversion is null);
1887Debug.Assert(local.RefKind == RefKind.None, "cannot take a ref of a ref");
1934Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth());
1955Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.OptimizerTemp);
1960Debug.Assert(local == empty || locInfo.StackAtDeclaration == StackDepth());
1968Debug.Assert(local.SynthesizedKind != SynthesizedLocalKind.OptimizerTemp);
2023Debug.Assert(local.SynthesizedKind == SynthesizedLocalKind.LoweringTemp, "only lowering temps may be sometimes reused");
2162Debug.Assert(!binary.OperatorKind.IsDynamic());
2173Debug.Assert((object)binary == node);
2205Debug.Assert(node.InitializerExpressionOpt == null);
2245Debug.Assert(locInfo.LocalDefs.Any((d) => _nodeCounter == d.Start && _nodeCounter <= d.End));
Compilation\CSharpSemanticModel.cs (73)
62Debug.Assert(node != null);
206Debug.Assert(expression != null);
255Debug.Assert(binder != null);
256Debug.Assert(binder.IsSemanticModelBinder);
257Debug.Assert(expression != null);
258Debug.Assert(bindingOption != SpeculativeBindingOption.BindAsTypeOrNamespace || expression is TypeSyntax);
267Debug.Assert(bindingOption == SpeculativeBindingOption.BindAsExpression);
739Debug.Assert(boundNode == null || crefSymbols.IsDefault);
765Debug.Assert(CanGetSemanticInfo(attribute, isSpeculative: true));
793Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true));
865Debug.Assert(CanGetSemanticInfo(constructorInitializer, isSpeculative: true));
926Debug.Assert(CanGetSemanticInfo(cref, isSpeculative: true));
1069Debug.Assert(boundNode == null || crefSymbols.IsDefault);
1216Debug.Assert(boundNode == null || crefSymbols.IsDefault);
1236Debug.Assert(result == null || result.IsSemanticModelBinder);
1328Debug.Assert(IsInTree(node));
1346Debug.Assert(position == fullSpan.Start);
1354Debug.Assert(node.Width == 0);
1373Debug.Assert(position == CheckAndAdjustPosition(position), "Expected adjusted position");
1581Debug.Assert((options & LookupOptions.UseBaseReferenceAccessibility) == 0, "Use the useBaseReferenceAccessibility parameter.");
1586Debug.Assert(!options.IsAttributeTypeLookup()); // Not exposed publicly.
1606Debug.Assert((object)container == null);
1677Debug.Assert((options & LookupOptions.NamespacesOrTypesOnly) == 0);
1678Debug.Assert((options & LookupOptions.NamespaceAliasesOnly) == 0);
1679Debug.Assert((options & LookupOptions.LabelsOnly) == 0);
1696Debug.Assert(symbol.IsExtensionBlockMember());
1755Debug.Assert(results != null);
1758Debug.Assert((options & LookupOptions.AllMethodsOnArityZero) == 0);
2323Debug.Assert((object)symbol != null);
2361Debug.Assert((object)symbol != null);
3314Debug.Assert(catchClause.Kind() == SyntaxKind.CatchClause);
3438Debug.Assert(boundNode is not BoundTypeOrValueExpression, "The Binder is expected to resolve the member access in the most appropriate way, even in an error scenario.");
3495Debug.Assert((object)indexerAccess.Indexer != null);
3544Debug.Assert((object)symbol != null);
3595Debug.Assert(conditional.ExpressionSymbol is null);
3601Debug.Assert(boundNodeForSyntacticParent == null);
3613Debug.Assert(resultKind != LookupResultKind.Viable);
3647Debug.Assert(dynamicInvocation.ExpressionSymbol is null);
3655Debug.Assert(collectionInit.ExpressionSymbol is null);
3663Debug.Assert(dynamicIndexer.ExpressionSymbol is null);
3670Debug.Assert((object)boundNode.ExpressionSymbol == null);
3686Debug.Assert(boundObjectCreation.ConstructorsGroup.Contains(boundObjectCreation.Constructor));
3832Debug.Assert((object)unaryOperator.MethodOpt == null && unaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
3855Debug.Assert((object)increment.MethodOpt == null && increment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
3880Debug.Assert((object)binaryOperator.BinaryOperatorMethod == null && binaryOperator.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
3919Debug.Assert(returnType.IsDynamic());
3923Debug.Assert(rightType.IsDynamic());
3928Debug.Assert(leftType.IsDynamic());
3953Debug.Assert((object)compoundAssignment.Operator.Method == null && compoundAssignment.OriginalUserDefinedOperatorsOpt.IsDefaultOrEmpty);
4012Debug.Assert(resultKind != LookupResultKind.Viable ||
4047Debug.Assert(lowestBoundNode != null);
4048Debug.Assert(binderOpt != null || IsInTree(lowestBoundNode.Syntax));
4052Debug.Assert(lowestBoundNode.Syntax != null);
4073Debug.Assert(resultKind != LookupResultKind.Viable);
4084Debug.Assert(candidateConstructors.Contains(constructorOpt));
4090Debug.Assert(resultKind != LookupResultKind.Viable);
4108Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax));
4139Debug.Assert(symbol.IsIndexer(), "Only indexers can have name " + WellKnownMemberNames.Indexer);
4265Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax));
4417Debug.Assert(binderOpt != null || IsInTree(boundNode.Syntax));
4500Debug.Assert(SyntaxFacts.IsNamedArgumentName(identifierNameSyntax));
4600Debug.Assert(nonHiddenMethods.Any()); // Something must be hiding, so can't all be hidden.
4636Debug.Assert(receiver != null);
4750Debug.Assert(members.Count > 0);
4757Debug.Assert((members.Count == 0) == (resultKind == LookupResultKind.Empty));
4758Debug.Assert(members.Count == filteredMembers.Count);
4769Debug.Assert(!methods.IsDefault);
4783Debug.Assert((object)receiverType != null);
4804Debug.Assert((object)method != null);
4808Debug.Assert(call.Arguments.Length > 0);
4821Debug.Assert((object)method != null);
4956Debug.Assert(((options & SymbolInfoOptions.PreferConstructorsToType) != 0) !=
4958Debug.Assert(((options & SymbolInfoOptions.ResolveAliases) != 0) !=
Compilation\MemberSemanticModel.cs (58)
53Debug.Assert(root != null);
54Debug.Assert((object)memberSymbol != null);
55Debug.Assert(containingPublicSemanticModel.IsSpeculativeSemanticModel == (containingPublicSemanticModel is SpeculativeSemanticModelWithMemberModel));
149Debug.Assert(false);
159Debug.Assert(_lazySnapshotManager is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled());
166Debug.Assert(_lazyRemappedSymbols is object || this is AttributeSemanticModel || !IsNullableAnalysisEnabled());
228Debug.Assert(root.Contains(node));
237Debug.Assert(current != null); // Why were we asked for an enclosing binder for a node outside our root?
254Debug.Assert(ownerOfTypeParametersInScope == null);
282Debug.Assert(binder != null);
364Debug.Assert(!current.CanHaveAssociatedLocalBinder());
374Debug.Assert(binder != null);
402Debug.Assert(binder != null);
412Debug.Assert(binder != null);
418Debug.Assert(binder != null);
429Debug.Assert(binder != null);
537Debug.Assert(node == GetBindableSyntaxNode(node));
559Debug.Assert(node == GetBindableSyntaxNode(node));
840Debug.Assert(parameter != null);
875Debug.Assert(parameter != null);
876Debug.Assert(lambda != null && lambda.IsAnonymousFunction());
893Debug.Assert(this.GetMemberModel(lambda) == null, "Did not find a unique LambdaSymbol for lambda in member.");
992Debug.Assert(enumeratorInfoOpt != null || boundForEach.HasAnyErrors);
1052Debug.Assert(boundConversion != null);
1070Debug.Assert(boundDeconstruction != null || boundForEach.HasAnyErrors);
1140Debug.Assert(index >= 0);
1141Debug.Assert(index < anonymousObjectCreation.Initializers.Count);
1234Debug.Assert(highestBoundNode != null);
1246Debug.Assert(highestBoundNode.Kind != BoundKind.UnboundLambda);
1263Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later");
1286Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later");
1298Debug.Assert(IsInTree(node), "Since the node is in the tree, we can always recompute the binder later");
1416Debug.Assert(node != null);
1424Debug.Assert(current != null, "Why are we being asked to find an enclosing lambda outside of our root?");
1480Debug.Assert(_nodeMapLock.IsWriteLockHeld || _nodeMapLock.IsReadLockHeld);
1498Debug.Assert(_nodeMapLock.IsWriteLockHeld);
1512Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax));
1529Debug.Assert(_nodeMapLock.IsWriteLockHeld);
1548Debug.Assert(syntax != _root || _guardedBoundNodeMap.ContainsKey(bound.Syntax));
1556Debug.Assert((manager is null && (!IsNullableAnalysisEnabled() || syntax != Root || syntax is TypeSyntax ||
1574Debug.Assert(node != null);
1580Debug.Assert(current != null, "How did we get outside the root?");
1709Debug.Assert(bindingRoot.Contains(enclosingLambdaOrQuery));
1751Debug.Assert(lambdaOrQuery != nodeToBind);
1786Debug.Assert(boundInnerLambdaOrQuery != null);
1804Debug.Assert(result != null);
1945Debug.Assert(containingLambda.IsAnonymousFunction());
1946Debug.Assert(LookupPosition.IsInAnonymousFunctionOrQuery(position, containingLambda));
1997Debug.Assert(!isNullableAnalysisEnabled ||
2043Debug.Assert(Compilation.IsNullableAnalysisEnabledAlways);
2071Debug.Assert(binder is SimpleProgramBinder);
2121Debug.Assert(node == GetBindableSyntaxNode(node));
2286Debug.Assert(parent.Kind() == SyntaxKind.VariableDeclaration);
2365Debug.Assert(bindableParent != null);
2393Debug.Assert(symbol is LocalSymbol or ParameterSymbol or MethodSymbol { MethodKind: MethodKind.LambdaMethod });
2462Debug.Assert(!(binder is IncrementalBinder));
2519Debug.Assert(!block.WasCompilerGenerated);
2583Debug.Assert(alternative is BoundIfStatement);
Compiler\ClsComplianceChecker.cs (40)
44Debug.Assert(diagnostics.DependenciesBag is null || diagnostics.DependenciesBag is ConcurrentSet<AssemblySymbol>);
93System.Diagnostics.Debug.Assert(symbol is SourceAssemblySymbol);
122System.Diagnostics.Debug.Assert(warningLocation != null || !moduleDeclaredCompliance.HasValue || (i == 0 && _filterTree != null),
243Debug.Assert(!symbol.IsImplicitClass);
279System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(constructor), "Should be implied by IsAccessibleIfContainerIsAccessible");
424System.Diagnostics.Debug.Assert(
430System.Diagnostics.Debug.Assert(!symbol.IsAccessor());
499System.Diagnostics.Debug.Assert(!IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on non-compliant symbols");
514System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols");
532System.Diagnostics.Debug.Assert((object)baseType != null || symbol.SpecialType == SpecialType.System_Object || symbol.IsExtension, "Only object or extension has no base.");
543System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols");
546System.Diagnostics.Debug.Assert((object)containingType == null || !containingType.IsImplicitClass);
555System.Diagnostics.Debug.Assert(typeParameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols");
574System.Diagnostics.Debug.Assert(parameters.IsEmpty || IsTrue(GetDeclaredOrInheritedCompliance(context)), "Only call on compliant symbols");
587System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols");
665System.Diagnostics.Debug.Assert(syntaxRef.SyntaxTree.HasCompilationUnitRoot);
713System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)), "Only call on compliant symbols");
738System.Diagnostics.Debug.Assert(method.ContainingType.TypeKind == TypeKind.Delegate);
743System.Diagnostics.Debug.Assert(!method.IsAccessor());
804System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(symbol));
805System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)));
886Debug.Assert(sameNameSymbols.Count > 0);
887Debug.Assert(symbol.Name == symbolName);
929System.Diagnostics.Debug.Assert(IsTrue(GetDeclaredOrInheritedCompliance(symbol)));
930System.Diagnostics.Debug.Assert(IsAccessibleOutsideAssembly(symbol));
952System.Diagnostics.Debug.Assert(name.Length == 0 || name[0] != '\uFF3F');
1116System.Diagnostics.Debug.Assert(symbol.Kind == SymbolKind.NamedType || !((symbol is TypeSymbol)),
1136Debug.Assert(symbol.Kind != SymbolKind.Alias);
1137Debug.Assert(symbol.Kind != SymbolKind.Label);
1138Debug.Assert(symbol.Kind != SymbolKind.Namespace);
1139Debug.Assert(symbol.Kind != SymbolKind.Parameter);
1140Debug.Assert(symbol.Kind != SymbolKind.RangeVariable);
1172System.Diagnostics.Debug.Assert(symbol.Kind != SymbolKind.Assembly);
1175System.Diagnostics.Debug.Assert((object)containing != null);
1209System.Diagnostics.Debug.Assert(args.Length == 1, "We already checked the signature and HasErrors.");
1246System.Diagnostics.Debug.Assert(symbol.Kind == SymbolKind.ErrorType);
1318System.Diagnostics.Debug.Assert((object)x != null);
1319System.Diagnostics.Debug.Assert((object)y != null);
1320System.Diagnostics.Debug.Assert((object)x != (object)y);
1321System.Diagnostics.Debug.Assert(x.Kind == y.Kind);
FlowAnalysis\NullableWalker.cs (372)
82Debug.Assert(variables.Id == variableNullableStates.Id);
149Debug.Assert(TypeSymbol.Equals(RValueType.Type, LValueType.Type, TypeCompareKind.ConsiderEverything));
166Debug.Assert(!StateForLambda.HasValue);
369Debug.Assert(TypeAllowsConditionalState(visitResult.RValueType.Type)
490Debug.Assert(_targetTypedAnalysisCompletionOpt is null or { Count: 0 });
514Debug.Assert(!TrackingRegions);
515Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethodOpt is object);
516Debug.Assert(baseOrThisInitializer is null or { MethodKind: MethodKind.Constructor });
584Debug.Assert(_resultForPlaceholdersOpt.Count == 0);
591Debug.Assert(AreCloseEnough(placeholder.Type, result.RValueType.Type));
592Debug.Assert(expression != null || placeholder.Kind == BoundKind.InterpolatedStringArgumentPlaceholder);
601Debug.Assert(_resultForPlaceholdersOpt is { });
603Debug.Assert(removed);
609Debug.Assert(placeholder is { });
691Debug.Assert(_useConstructorExitWarnings);
1035Debug.Assert(requiredMember.IsRequired());
1507Debug.Assert(node.SyntaxTree is object);
1553Debug.Assert(method.IsConstructor());
1874Debug.Assert(diagnostics != null);
1875Debug.Assert(getterNullResilienceData is null || symbol is SourcePropertyAccessorSymbol { MethodKind: MethodKind.PropertyGet });
1876Debug.Assert(getterNullResilienceData is null || !useConstructorExitWarnings);
1900Debug.Assert(!walker.IsConditionalState);
1918Debug.Assert(snapshotBuilderOpt is null || symbol is object);
1925Debug.Assert(walker._variables.Id == initialState.Value.Id);
1931Debug.Assert(!badRegion);
1952Debug.Assert(result.RequiredAnalysis == requiredAnalysis);
1968Debug.Assert(!IsConditionalState);
1991Debug.Assert(node is object);
2041Debug.Assert(slot > 0);
2136Debug.Assert(member?.RequiresInstanceReceiver() ?? true);
2155Debug.Assert(node.HasErrors ||
2275Debug.Assert(containingSlot == 0);
2672Debug.Assert(!IsConditionalState);
2726Debug.Assert(ErrorFacts.NullableWarnings.Contains(MessageProvider.Instance.GetIdForErrorCode((int)errorCode)));
2735Debug.Assert(targetSlot > 0);
2736Debug.Assert(EmptyStructTypeCache.IsTrackableStructType(targetType));
2762Debug.Assert(false, "If this assert fires, please add a unit test for the scenario.");
2778Debug.Assert(targetContainerSlot > 0);
2779Debug.Assert(skipSlot > 0);
2863Debug.Assert(slot > 0);
2884Debug.Assert(targetSlot > 0);
2888Debug.Assert(actualType is { });
2896Debug.Assert(conversion.Kind is ConversionKind.Identity or ConversionKind.ImplicitReference);
2929Debug.Assert(false);
2957Debug.Assert(targetSlot > 0);
2958Debug.Assert(valueSlot > 0);
2966Debug.Assert(member.Kind == SymbolKind.Field || member.Kind == SymbolKind.Property || member.Kind == SymbolKind.Event);
3040Debug.Assert(!IsConditionalState);
3094Debug.Assert(!IsConditionalState);
3200Debug.Assert((object)returnType != LambdaSymbol.ReturnTypeIsBeingInferred);
3249Debug.Assert(node.Type.IsErrorType() || type.Type.IsErrorType());
3281Debug.Assert(!TrackingRegions);
3348Debug.Assert(newBodiesVisited);
3438Debug.Assert((object?)variables.Container == container);
3450Debug.Assert(!useDelegateInvokeParameterTypes || delegateInvokeMethod is object);
3451Debug.Assert(!useDelegateInvokeReturnType || delegateInvokeMethod is object);
3573Debug.Assert(!IsConditionalState);
3599Debug.Assert(!IsConditionalState);
3713Debug.Assert(!IsConditionalState);
3748Debug.Assert(type.Type.IsErrorType());
3767Debug.Assert(node is BoundExpression or BoundPattern);
3768Debug.Assert(!IsConditionalState);
3785Debug.Assert((object?)resultType.Type != _invalidType.Type);
3786Debug.Assert(AreCloseEnough(resultType.Type, node.Type));
3884Debug.Assert(!_completingTargetTypedExpression);
3993Debug.Assert(reinferenceResult.Completion != null);
4009Debug.Assert(collectionBuilderElementsPlaceholder != null);
4031Debug.Assert(reinferenceResult.Completion != null);
4052Debug.Assert(allTypeArguments.Length == call.Method.Arity, "Guaranteed by GetCollectionBuilderMethods");
4091Debug.Assert(node.Placeholder is { });
4095Debug.Assert(initializer.ArgsToParamsOpt.IsDefault);
4166Debug.Assert(completion is not null);
4180Debug.Assert(TypeSymbol.Equals(strippedTargetCollectionType, node.Type, TypeCompareKind.AllIgnoreOptions));
4239Debug.Assert(foundIterationType);
4244Debug.Assert(!targetElementType.HasType);
4258Debug.Assert(node.ExpressionPlaceholder is { });
4259Debug.Assert(node.EnumeratorInfoOpt is { });
4271Debug.Assert(node.HasErrors);
4272Debug.Assert(node.Conversion is null);
4273Debug.Assert(node.EnumeratorInfoOpt is null);
4281Debug.Assert(!IsConditionalState);
4293Debug.Assert(isTargetTyped == argumentsCompletion is not null);
4324Debug.Assert(argumentsCompletion is not null);
4325Debug.Assert(initialStateInferenceCompletion is not null);
4330Debug.Assert(argumentsCompletion is null);
4331Debug.Assert(initialStateInferenceCompletion is null);
4332Debug.Assert(initializerCompletion is null);
4348Debug.Assert(resultState == NullableFlowState.NotNull);
4353Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4391Debug.Assert(node.Kind is BoundKind.ObjectCreationExpression or BoundKind.DynamicObjectCreationExpression or BoundKind.NewT or BoundKind.NoPiaObjectCreationExpression);
4482Debug.Assert(completion is null);
4483Debug.Assert(resultState == NullableFlowState.NotNull);
4491Debug.Assert(containingSlot > 0);
4505Debug.Assert(iUnionValuePropertySlot > 0);
4518Debug.Assert(!delayCompletionForType || containingSlot == -1);
4568Debug.Assert(!delayCompletionForType || containingSlot == -1);
4608Debug.Assert(symbol is not null);
4631Debug.Assert(argumentsCompletion is null);
4632Debug.Assert(initializationCompletion is null);
4642Debug.Assert(objectInitializer.MemberSymbol is not null);
4660Debug.Assert(argumentResults[0].LValueType.Type.Equals(containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4669Debug.Assert(initializationCompletion is null || symbol is not null);
4673Debug.Assert(result is null);
4685Debug.Assert(!delayCompletionForType || slot == -1);
4701Debug.Assert(nestedCompletion is null);
4726Debug.Assert(!delayCompletionForType || conversionCompletion is null);
4733Debug.Assert(GetTypeOrReturnTypeWithAnnotations(symbol).HasType);
4745Debug.Assert(conversionCompletion is not null);
4749Debug.Assert(conversionCompletion is null);
4762Debug.Assert(result is null);
4779Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4807Debug.Assert(TypeSymbol.Equals(objectInitializer.Type, GetTypeOrReturnType(symbol), TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4854Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4855Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4871Debug.Assert(visitArgumentsCompletion is not null);
4875Debug.Assert(visitArgumentsCompletion is null);
4876Debug.Assert(reinferredMethod is object);
4912Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.RValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4913Debug.Assert(TypeSymbol.Equals(containingType, receiverResult.LValueType.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
4990Debug.Assert(node.Type is object);
5008Debug.Assert((object)placeholder != null);
5014Debug.Assert(!IsConditionalState);
5015Debug.Assert(node.Type.IsAnonymousType);
5192Debug.Assert(namedType.Name == "Span");
5193Debug.Assert(namedType.OriginalDefinition.Arity == 1);
5199Debug.Assert(namedType.Name == "Span");
5200Debug.Assert(namedType.OriginalDefinition.Arity == 1);
5309Debug.Assert(!IsConditionalState);
5313Debug.Assert(!IsConditionalState);
5314Debug.Assert(!node.Expression.Type!.IsValueType);
5343Debug.Assert(!IsConditionalState);
5347Debug.Assert(!IsConditionalState);
5348Debug.Assert(expressionType is not null);
5349Debug.Assert(expressionType.IsValueType);
5423Debug.Assert(!IsConditionalState);
5581Debug.Assert(binary.Type.SpecialType == SpecialType.System_Boolean);
5614Debug.Assert(!IsConditionalState);
5649Debug.Assert(operand == expr);
5667Debug.Assert(!IsConditionalState);
5671Debug.Assert(binary.Type!.SpecialType == SpecialType.System_Boolean);
5797Debug.Assert(!IsConditionalState);
5898Debug.Assert(operand != null);
6146Debug.Assert(targetType.Type.ContainsErrorType() ||
6158Debug.Assert(TypeSymbol.Equals(targetType.Type, rightResult.Type, TypeCompareKind.AllIgnoreOptions));
6169Debug.Assert(!IsConditionalState);
6220Debug.Assert(rightType is object);
6227Debug.Assert(!conversion.IsUserDefined);
6228Debug.Assert(!conversion.IsUnion);
6233Debug.Assert(!conversion.IsUserDefined);
6234Debug.Assert(!conversion.IsUnion);
6257Debug.Assert(conversionResult.Type is not null);
6286Debug.Assert(targetType.HasType);
6298Debug.Assert(!IsConditionalState);
6336Debug.Assert(!IsConditionalState);
6382Debug.Assert(innerCondAccess.Receiver is not (BoundConditionalAccess or BoundConversion));
6394Debug.Assert(expr is BoundExpression);
6404Debug.Assert(expr is BoundExpression);
6475Debug.Assert(node is not BoundConditionalOperator { WasTargetTyped: true }, """
6565Debug.Assert(!wasTargetTyped);
6572Debug.Assert(node is BoundUnconvertedConditionalOperator);
6573Debug.Assert(node.HasErrors || _returnTypesOpt is not null || _disableDiagnostics);
6665Debug.Assert(!isRef);
6677Debug.Assert(isRef);
6809Debug.Assert(node.InvokedAsExtensionMethod);
6829Debug.Assert(node.InvokedAsExtensionMethod || isExtensionBlockMethod);
6836Debug.Assert(node.Method.ContainingType.ExtensionParameter is not null);
6876Debug.Assert(node.ReceiverOpt is null);
6929Debug.Assert(reinferenceResult.Member is not null);
6993Debug.Assert(reinferenceResult.Completion is null);
6995Debug.Assert(newMethod is not null);
7020Debug.Assert(extensionParameter is not null);
7033Debug.Assert(member.IsExtensionBlockMember());
7054Debug.Assert(extensionParameter is not null);
7125Debug.Assert(arguments.Length == 2);
7136Debug.Assert(arguments.Length == 1);
7225Debug.Assert(baseType is object);
7297Debug.Assert(!compareExchangeInfo.IsDefault);
7319Debug.Assert(argsToParamsOpt is { IsDefault: true } or { Length: 3 });
7537Debug.Assert(reinferenceResult.Completion is null);
7551Debug.Assert(reinferenceResult.Completion is null);
7584Debug.Assert(!arguments.IsDefault);
7585Debug.Assert(!expanded || !parametersOpt.IsDefault);
7586Debug.Assert(refKindsOpt.IsDefaultOrEmpty || refKindsOpt.Length == arguments.Length);
7587Debug.Assert(argsToParamsOpt.IsDefault || argsToParamsOpt.Length == arguments.Length);
7595Debug.Assert(!arguments.Any(a => a.IsParamsArrayOrCollection));
7695Debug.Assert(method is ErrorMethodSymbol);
7821Debug.Assert(result.Completion is null);
7833Debug.Assert(arguments.Count(a => a.IsParamsArrayOrCollection) <= 1);
7840Debug.Assert(parametersOpt.IsDefault || arguments.Length == parametersOpt.Length);
7868Debug.Assert(defaultArguments.IsNull || elements.Length == 1);
7869Debug.Assert(elements.Length == 1 || a == arguments.Length - 1);
7874Debug.Assert(argumentsBuilder.Count == arguments.Length + elements.Length - 1);
7978Debug.Assert(receiverSlot >= 0);
8085Debug.Assert(!IsConditionalState);
8149Debug.Assert(!IsConditionalState);
8197Debug.Assert(!IsConditionalState);
8216Debug.Assert(!this.IsConditionalState);
8233Debug.Assert(argumentResultType is not null);
8289Debug.Assert(!this.IsConditionalState);
8475Debug.Assert(!IsConditionalState);
8480Debug.Assert(!IsConditionalState);
8659Debug.Assert(variables.Id == localState.Id);
8678Debug.Assert(!expanded);
8688Debug.Assert(paramsIterationType.HasType);
8705Debug.Assert(member.GetMemberArityIncludingExtension() != 0);
8841Debug.Assert(false); // unexpected value
8880Debug.Assert(lambdaState.HasValue);
8893Debug.Assert(collectionExpressionVisitResults is not null);
8894Debug.Assert(collectionExpressionVisitResults.Length == collection.Elements.Length);
9034Debug.Assert(group != null || !conversion.ExplicitCastInCode); // Explicit conversions should include a group.
9147Debug.Assert((object)symbol != null);
9148Debug.Assert(!symbol.IsExtensionBlockMember(), symbol.ToDisplayString());
9182Debug.Assert(symbol.ContainingType.IsDefinition);
9219Debug.Assert(false);
9249Debug.Assert(targetType.HasType);
9294Debug.Assert(completion is null);
9325Debug.Assert(targetTypeOpt.HasType);
9354Debug.Assert(result.completion is null);
9384Debug.Assert(!IsConditionalState);
9420Debug.Assert(diagnostics.DiagnosticBag is { });
9446Debug.Assert(tupleType.IsTupleType);
9447Debug.Assert(values.Length == types.Length);
9448Debug.Assert(values.Length == (useRestField ? Math.Min(tupleType.TupleElements.Length, NamedTypeSymbol.ValueTupleRestPosition) : tupleType.TupleElements.Length));
9481Debug.Assert(index != -1);
9488Debug.Assert(containingType.OriginalDefinition.SpecialType == SpecialType.System_Nullable_T);
9489Debug.Assert(containingSlot > 0);
9490Debug.Assert(valueSlot > 0);
9512Debug.Assert(conversion.Kind == ConversionKind.ImplicitTuple || conversion.Kind == ConversionKind.ExplicitTuple);
9513Debug.Assert(slot > 0);
9514Debug.Assert(valueSlot > 0);
9603Debug.Assert(targetField.TypeWithAnnotations.Type.StrippedType() is NamedTypeSymbol { IsUnionType: true });
9623Debug.Assert(conversionOperandSlot > 0);
9673Debug.Assert(diagnostics.DiagnosticBag is { });
9729Debug.Assert(diagnostics.DiagnosticBag is { });
9784Debug.Assert(conversionOpt is null
9832Debug.Assert(!trackMembers || !IsConditionalState);
9833Debug.Assert(conversionOperand != null);
9834Debug.Assert(conversionOpt is null || targetInstanceSlotOpt < 0);
9860Debug.Assert(conversionOpt is null);
9909Debug.Assert(targetInstanceSlotOpt < 0);
9948Debug.Assert(targetInstanceSlotOpt < 0);
9953Debug.Assert(targetInstanceSlotOpt < 0);
10015Debug.Assert(containingSlot > 0);
10050Debug.Assert(targetInstanceSlotOpt < 0);
10064Debug.Assert(conversionOperand != null);
10072Debug.Assert(containingSlot > 0);
10109Debug.Assert(targetInstanceSlotOpt < 0);
10112Debug.Assert(conversionOperand != null);
10139Debug.Assert(conversionOperand != null);
10189Debug.Assert(targetType.IsValueType || targetType.IsErrorType());
10292Debug.Assert(dependsOn); // If this case fails, add a corresponding test.
10365Debug.Assert(handlerData.ArgumentPlaceholders.IsEmpty
10387Debug.Assert(extensionBlockFormOffset == 1);
10444Debug.Assert(!IsConditionalState);
10445Debug.Assert(conversionOperand != null);
10446Debug.Assert(targetTypeWithNullability.HasType);
10447Debug.Assert(diagnosticLocation != null);
10448Debug.Assert(conversion.Kind == ConversionKind.ExplicitUserDefined || conversion.Kind == ConversionKind.ImplicitUserDefined);
10480Debug.Assert(method is object);
10481Debug.Assert(method.ParameterCount == 1);
10482Debug.Assert(operandType.Type is object);
10598Debug.Assert(!IsConditionalState);
10599Debug.Assert(conversionOperand != null);
10600Debug.Assert(targetTypeWithNullability.HasType);
10601Debug.Assert(diagnosticLocation != null);
10602Debug.Assert(conversion.IsUnion);
10603Debug.Assert(conversionOpt is null || targetInstanceSlotOpt < 0);
10612Debug.Assert(conversion.BestUnionConversionAnalysis is { });
10615Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm);
10616Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true }));
10617Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
10618Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
10619Debug.Assert(TypeSymbol.Equals(targetTypeWithNullability.Type.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
10620Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true });
10628Debug.Assert(unionConstructionConversion is not null, "Unexpected conversion group structure for union conversion.");
10629Debug.Assert(sourceToParameterConversion is not null || analysis.SourceConversion.IsIdentity);
10633Debug.Assert(conversionOpt is null);
10653Debug.Assert(i < candidates.Length);
10660Debug.Assert(TypeSymbol.Equals(analysis.FromType, parameterType.Type, TypeCompareKind.AllIgnoreOptions));
10661Debug.Assert(TypeSymbol.Equals(toType, analysis.ToType, TypeCompareKind.AllIgnoreOptions));
10679Debug.Assert(operandType.Type is object);
10699Debug.Assert(factory.MethodKind == MethodKind.Constructor);
10704Debug.Assert(factory is { IsStatic: true, ContainingType.IsInterface: true });
10718Debug.Assert(conversionOperand != null);
10720Debug.Assert(containingSlot > 0);
10760Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup);
10773Debug.Assert(conversionOpt.ConversionGroupOpt == conversionGroup);
10838Debug.Assert(operandType.Type is object);
10839Debug.Assert(diagnosticLocation != null);
10872Debug.Assert(node.Type.IsDelegateType());
10919Debug.Assert(analysisCompletion is null);
10931Debug.Assert(TypeSymbol.Equals(resultTypeWithAnnotations.Type, node.Type, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
11008Debug.Assert(arg.Type is not null);
11027Debug.Assert(arg.Type is not null);
11048Debug.Assert(!IsConditionalState);
11114Debug.Assert(_binder is object);
11123Debug.Assert(receiverParameter is not null);
11157Debug.Assert(delegateTypeOpt?.IsDelegateType() != false);
11225Debug.Assert(!IsConditionalState);
11437Debug.Assert(conversion.Kind == ConversionKind.Deconstruction);
11463Debug.Assert(invocation is object);
11464Debug.Assert(rightResult.Type is object);
11490Debug.Assert(invocation.DefaultArguments.IsNull);
11502Debug.Assert(parameters.Length - offset == n);
11509Debug.Assert(receiverParameter is not null);
11554Debug.Assert(rightParts.Length == n);
11721Debug.Assert(!IsConditionalState);
11749Debug.Assert(reinferenceResult.Member is not null);
11817Debug.Assert(!operandConversion.IsUnion);
11914Debug.Assert(!IsConditionalState);
11942Debug.Assert(reinferenceResult.Member is not null);
12041Debug.Assert(MakeSlot(node) == -1);
12129Debug.Assert(property.Parameters.IsEmpty);
12143Debug.Assert(reinferenceResult.Completion is null);
12160Debug.Assert(property.IsExtensionBlockMember());
12182Debug.Assert(node.ReceiverOpt is not null);
12184Debug.Assert(reinferenceResult.Member is not null);
12223Debug.Assert(node.ReceiverOpt is not null);
12229Debug.Assert(reinferrenceResult.Member is not null);
12303Debug.Assert(!IsConditionalState);
12304Debug.Assert(!member.IsExtensionBlockMember());
12344Debug.Assert(!IsConditionalState);
12391Debug.Assert(containingType.IsNullableType());
12392Debug.Assert(TypeSymbol.Equals(NominalSlotType(containingSlot), containingType, TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
12404Debug.Assert(node.HasErrors);
12454Debug.Assert(resultType is object);
12504Debug.Assert(!foundMultiple);
12505Debug.Assert(targetTypeWithAnnotations.HasType);
12511Debug.Assert(node.HasErrors);
12518Debug.Assert(node.HasErrors);
12569Debug.Assert(wellKnownSpan is WellKnownType.System_Span_T or WellKnownType.System_ReadOnlySpan_T);
12790Debug.Assert(!IsConditionalState);
12940Debug.Assert(stack.Count > 0);
12968Debug.Assert(leftOperand is not null);
12993Debug.Assert(isAnd || op == BinaryOperatorKind.Or);
12998Debug.Assert(IsConditionalState);
13024Debug.Assert(!isBool);
13097Debug.Assert(placeholder is object);
13152Debug.Assert(!this.IsConditionalState);
13172Debug.Assert(!this.IsConditionalState);
13191Debug.Assert(node.Type.SpecialType == SpecialType.System_Boolean);
13243Debug.Assert(node.Type.SpecialType == SpecialType.System_RuntimeArgumentHandle);
13251Debug.Assert(node.Type is null);
13258Debug.Assert(!IsConditionalState);
13266Debug.Assert(!IsConditionalState);
13275Debug.Assert(node.WasCompilerGenerated);
13283Debug.Assert(node.WasCompilerGenerated);
13322Debug.Assert(node.Type.IsDynamic());
13341Debug.Assert(node.Type.IsDynamic());
13342Debug.Assert(node.Type.IsReferenceType);
13352Debug.Assert(!IsConditionalState);
13448Debug.Assert(node.Type.IsDynamic());
13461Debug.Assert(!this.IsConditionalState);
13471Debug.Assert(receiverOpt.Type is null || AreCloseEnough(receiverOpt.Type, resultTypeSymbol));
13592Debug.Assert(node.Type is null || node.Type.IsErrorType() || node.Type.IsRefLikeType);
13612Debug.Assert(node.Type is not null);
13783Debug.Assert(node.AwaitableInstancePlaceholder is not null);
13787Debug.Assert(node.RuntimeAsyncAwaitCallPlaceholder is not null);
13793Debug.Assert(node.GetResult is null);
13824Debug.Assert(ResultType is TypeWithState { Type: FunctionPointerTypeSymbol { }, State: NullableFlowState.NotNull });
13896Debug.Assert(!otherIsConditional);
14033Debug.Assert(Id == variables.Container!.Id);
14092Debug.Assert(state.Id > id);
14106Debug.Assert(Id < variables.Id);
14152Debug.Assert(Id > id);
14165Debug.Assert(index < Capacity);
14167Debug.Assert((_state[index], _state[index + 1]) != (false, false));
14184Debug.Assert(Id > id);
14239Debug.Assert(Id == other.Id);
14246Debug.Assert(_state.Capacity == other._state.Capacity);
14268Debug.Assert(Id == other.Id);
14275Debug.Assert(_state.Capacity == other._state.Capacity);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (74)
118Debug.Assert(node.Type.SpecialType == SpecialType.System_String, "Non-string binary addition should have been handled by VisitConversion or VisitArguments");
125Debug.Assert(applyParentUnaryOperator is null);
131Debug.Assert(applyParentUnaryOperator is null);
147Debug.Assert(stack.Count >= 1);
169Debug.Assert(node.OperatorKind == BinaryOperatorKind.StringConcatenation);
170Debug.Assert(node.InterpolatedStringHandlerData is not null);
209Debug.Assert(oldNode == null || (oldNode.Syntax == syntax));
234Debug.Assert(!isPointerElementAccess);
242Debug.Assert(method is null);
340Debug.Assert(loweredLeft.Type is { });
341Debug.Assert(loweredRight.Type is { });
354Debug.Assert(loweredLeft.Type is { });
355Debug.Assert(loweredRight.Type is { });
368Debug.Assert(loweredLeft.Type is { });
369Debug.Assert(loweredRight.Type is { });
539Debug.Assert(!operatorKind.IsDynamic());
577Debug.Assert(loweredLeft.Type is { });
614Debug.Assert(operatorKind.Operator() == BinaryOperatorKind.And || operatorKind.Operator() == BinaryOperatorKind.Or);
631Debug.Assert(applyParentUnaryOperator == null || applyParentUnaryOperator.OperatorKind == testOperator);
637Debug.Assert(leftTruthOperator == null);
712Debug.Assert(temp is { });
737Debug.Assert(leftTruthOperator == null);
750Debug.Assert(leftTruthOperator == null);
768Debug.Assert(leftTruthOperator != null);
772Debug.Assert(conversion.IsImplicit);
795Debug.Assert(!operatorKind.IsLogical());
803Debug.Assert(method is { });
804Debug.Assert(TypeSymbol.Equals(method.ReturnType, type, TypeCompareKind.ConsiderEverything2));
822Debug.Assert(left != null);
823Debug.Assert(right != null);
865Debug.Assert(nonNull is { });
909Debug.Assert(expression.Type is { });
932Debug.Assert(expression.Type is { });
946Debug.Assert(expression.Type is { });
1023Debug.Assert(yNonNull is null, "Handled by trivial optimization above; otherwise we should use yNonNull here.");
1036Debug.Assert(xNonNull is null, "Handled by trivial optimization above; otherwise we should use xNonNull here.");
1324Debug.Assert(left != null);
1325Debug.Assert(right != null);
1392Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case.
1633Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
1634Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
1635Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
1685Debug.Assert(!(leftAlwaysNull && rightAlwaysNull)); // We've already optimized this case.
1708Debug.Assert(alwaysNull.Type is { });
1750Debug.Assert(conditionalExpression.Type is { });
1784Debug.Assert(leftNonNull == null || rightNonNull == null); // We've already optimized the case where they are both non-null.
1785Debug.Assert(!NullableNeverHasValue(left) && !NullableNeverHasValue(right)); // We've already optimized the case where one is null.
1926Debug.Assert(nullableType2 is { });
1958Debug.Assert(loweredLeft != null);
1959Debug.Assert(loweredRight != null);
1960Debug.Assert((object)returnType != null);
1961Debug.Assert(returnType.SpecialType == SpecialType.System_Boolean);
1962Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull());
2022Debug.Assert((object)method != null);
2047Debug.Assert((object)method != null);
2059Debug.Assert(loweredLeft.Type is { SpecialType: SpecialType.System_Decimal });
2060Debug.Assert(loweredRight.Type is { SpecialType: SpecialType.System_Decimal });
2083Debug.Assert((object)method != null);
2090Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) ||
2096Debug.Assert(
2156Debug.Assert(loweredRight.Type is { });
2158Debug.Assert(rightType.SpecialType == SpecialType.System_Int32);
2223Debug.Assert(loweredLeft.Type is { });
2225Debug.Assert(leftType.SpecialType is SpecialType.System_IntPtr or SpecialType.System_UIntPtr);
2228Debug.Assert(loweredRight.Type is { });
2230Debug.Assert(rightType.SpecialType == SpecialType.System_Int32);
2279Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer });
2284Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer });
2290Debug.Assert(kind.Operator() == BinaryOperatorKind.Addition);
2324Debug.Assert(sizeOfExpression.Type is { SpecialType: SpecialType.System_Int32 });
2334Debug.Assert(numericOperand.Type is { });
2471Debug.Assert(loweredLeft.Type is { TypeKind: TypeKind.Pointer });
2472Debug.Assert(loweredRight.Type is { TypeKind: TypeKind.Pointer });
2473Debug.Assert(returnType.SpecialType == SpecialType.System_Int64);
Lowering\LocalRewriter\LocalRewriter_Call.cs (80)
43Debug.Assert(methodGroup.ReceiverOpt == null || methodGroup.ReceiverOpt.Kind != BoundKind.TypeOrValueExpression);
49Debug.Assert(node.ApplicableMethods.All(m => !m.RequiresInstanceReceiver && TypeSymbol.Equals(m.ContainingType, firstContainer, TypeCompareKind.ConsiderEverything2)));
56Debug.Assert(_factory.CurrentType is { });
57Debug.Assert(!_factory.CurrentType.IsExtension); // When binding a simple name for a call, you cannot get a member inside an extension type
86Debug.Assert(loweredReceiver != null);
163Debug.Assert(nameSyntax != null);
164Debug.Assert(interceptor.IsDefinition);
165Debug.Assert(!interceptor.ContainingType.IsGenericType);
201Debug.Assert(containingMethod is not null);
214Debug.Assert(receiverOpt is not BoundTypeExpression || method.IsStatic);
289Debug.Assert(methodThisParameter is not null);
290Debug.Assert(receiverOpt?.Type is not null);
296Debug.Assert(receiverOpt.Type.Equals(interceptor.Parameters[0].Type, TypeCompareKind.AllIgnoreOptions)
338Debug.Assert(node != null);
389Debug.Assert(invokedAsExtensionMethod && !arguments.IsEmpty);
446Debug.Assert(node.ReceiverOpt is null);
472Debug.Assert(rewrittenArguments.Length == 2);
525Debug.Assert(rewrittenBoundCall.Type is not null);
573Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression));
624Debug.Assert(false, "Not expected to survive lowering.");
632Debug.Assert(false, "Unexpected conversion kind" + conv.ConversionKind);
676Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length == arguments.Length);
678Debug.Assert(!requiresInstanceReceiver || rewrittenReceiver != null || _inExpressionLambda);
679Debug.Assert(!forceReceiverCapturing || (requiresInstanceReceiver && rewrittenReceiver != null && storesOpt is object));
680Debug.Assert(!forceReceiverCapturing || methodOrIndexer is PropertySymbol);
688Debug.Assert(!_inExpressionLambda);
689Debug.Assert(rewrittenReceiver is object);
690Debug.Assert(rewrittenReceiver.Type is { });
793Debug.Assert(saveTempsOpt is object || tempsOpt?.Count is null or > 0);
800Debug.Assert(assignmentToTemp is object);
801Debug.Assert(tempsOpt is object);
858Debug.Assert(!_inExpressionLambda);
863Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode);
869Debug.Assert(!argumentsAssignedToTemp.IsNull);
875Debug.Assert(argIndex < argumentIndex);
882Debug.Assert(usesReceiver(argument));
883Debug.Assert(requiresInstanceReceiver);
884Debug.Assert(receiverTemp is object);
898Debug.Assert(visitedArgumentsBuilder[argIndex] != null);
935Debug.Assert(!((BoundConversion)argument).ExplicitCastInCode);
953Debug.Assert(rewrittenReceiver.Type is { });
954Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is { });
995Debug.Assert(assignmentToTemp.IsRef);
998Debug.Assert(receiverType is object);
1034Debug.Assert(SpillSequenceSpiller.IsComplexConditionalInitializationOfReceiverRef(assignmentToTemp, out _, out _, out _, out _));
1051Debug.Assert(CodeGenerator.ReceiverIsKnownToReferToTempIfReferenceType(receiverTemp));
1077Debug.Assert(rewrittenArguments.All(arg => arg is not BoundDiscardExpression), "Discards should have been substituted by VisitArguments");
1082Debug.Assert(expanded ? rewrittenArguments.Length == parameters.Length : rewrittenArguments.Length >= parameters.Length);
1083Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0));
1189Debug.Assert(actualArguments.All(static arg => arg is not null));
1240Debug.Assert(argumentRefKindsOpt.IsDefault || argumentRefKindsOpt.Length >= parameters.Length);
1249Debug.Assert(!argumentRefKindsOpt.IsEmpty);
1271Debug.Assert(initialArgRefKind is RefKind.None or RefKind.In or RefKind.Ref);
1286Debug.Assert(comRefKindMismatchPossible);
1310Debug.Assert(rewrittenArguments.Length == methodOrIndexer.GetParameterCount() + 1);
1311Debug.Assert(argsToParamsOpt.IsDefault);
1334Debug.Assert(methodOrIndexer.ContainingType.ExtensionParameter is not null);
1357Debug.Assert(paramsArray.IsParamsArrayOrCollection);
1411Debug.Assert(refKinds.Count == arguments.Length);
1412Debug.Assert(storesToTemps.Count == 0);
1413Debug.Assert(rewrittenArguments.Length == parameters.Length);
1414Debug.Assert(rewrittenArguments.Count(a => a.IsParamsArrayOrCollection) <= (expanded ? 1 : 0));
1423Debug.Assert(arguments[p] == null);
1427Debug.Assert(expanded);
1428Debug.Assert(p == parameters.Length - 1);
1429Debug.Assert(argRefKind == RefKind.None);
1448Debug.Assert(arguments[p].IsParamsArrayOrCollection);
1543Debug.Assert(arguments != null);
1544Debug.Assert(storesToTemps != null);
1545Debug.Assert(temporariesBuilder != null);
1572Debug.Assert(arguments != null);
1573Debug.Assert(tempStores != null);
1613Debug.Assert(firstUnclaimedStore == tempStores.Count, "not all side-effects were claimed");
1639Debug.Assert(value.Type is { });
1691Debug.Assert(actualArguments != null);
1692Debug.Assert(actualArguments.Length == parameters.Length);
1694Debug.Assert(argsRefKindsBuilder != null);
1695Debug.Assert(argsRefKindsBuilder.Count == parameters.Length);
1721Debug.Assert(localRefKind == RefKind.None);
1748Debug.Assert(node.TypeArgumentsOpt.IsDefault);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (78)
31Debug.Assert(conversion.Kind == ConversionKind.CollectionExpression);
32Debug.Assert(!_inExpressionLambda);
33Debug.Assert(_additionalLocals is { });
34Debug.Assert(node.Type is { });
82Debug.Assert(elementType is { });
128Debug.Assert(spreadElement.IteratorBody is { });
146Debug.Assert(spreadElement.IteratorBody is { });
148Debug.Assert(iteratorBody is { });
161Debug.Assert(result is { });
185Debug.Assert(singleSpread.Expression.Type is not null);
202Debug.Assert(targetEnumerableType.OriginalDefinition == (object)_compilation.GetSpecialType(SpecialType.System_Collections_Generic_IEnumerable_T));
256Debug.Assert(!_inExpressionLambda);
257Debug.Assert(_additionalLocals is { });
258Debug.Assert(node.Placeholder is null);
259Debug.Assert(collectionType is ArrayTypeSymbol or NamedTypeSymbol);
273Debug.Assert(namedType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Span_T)) ||
280Debug.Assert(collectionType.OriginalDefinition == (object)_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T) ||
320Debug.Assert(isReadOnlySpan
337Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, CollectionExpressionTypeKind.ReadOnlySpan, elementType.Type, _compilation));
347Debug.Assert(!IsAllocatingRefStructCollectionExpression(node, isReadOnlySpan ? CollectionExpressionTypeKind.ReadOnlySpan : CollectionExpressionTypeKind.Span, elementType.Type, _compilation));
360Debug.Assert(isReadOnlySpan
384Debug.Assert(conversionKind == ConversionKind.Identity || (isReadOnlySpan && conversionKind == ConversionKind.ImplicitReference));
408Debug.Assert(list.Type is { });
409Debug.Assert(list.Type.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Collections_Generic_List_T), TypeCompareKind.AllIgnoreOptions));
421Debug.Assert(!_inExpressionLambda);
426Debug.Assert(rewrittenReceiver is { });
435Debug.Assert(placeholder is { });
483Debug.Assert(!_inExpressionLambda);
484Debug.Assert(_factory.ModuleBuilderOpt is { });
485Debug.Assert(_diagnostics.DiagnosticBag is { });
486Debug.Assert(node.Type is NamedTypeSymbol);
487Debug.Assert(node.Placeholder is null);
488Debug.Assert(node.Type.IsArrayInterface(out _));
498Debug.Assert(node.CollectionCreation is null);
505Debug.Assert(numberIncludingLastSpread == 0);
545Debug.Assert(collectionType.IsMutableArrayInterface(out _));
551Debug.Assert(node.CollectionCreation is null or BoundObjectCreationExpression);
561Debug.Assert(c.IsImplicit);
562Debug.Assert(c.IsReference || c.IsIdentity);
567Debug.Assert(node.Type.OriginalDefinition.SpecialType is
581Debug.Assert(!_inExpressionLambda);
582Debug.Assert(node.Type is { });
583Debug.Assert(node.CollectionCreation is { });
584Debug.Assert(node.Placeholder is null);
585Debug.Assert(node.CollectionBuilderMethod is { });
586Debug.Assert(node.CollectionBuilderElementsPlaceholder is { });
593Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_ReadOnlySpan_T), TypeCompareKind.AllIgnoreOptions));
642Debug.Assert(elements.Length > 0);
643Debug.Assert(elements.All(e => e is BoundExpression));
644Debug.Assert(_factory.ModuleBuilderOpt is { });
645Debug.Assert(_diagnostics.DiagnosticBag is { });
646Debug.Assert(_compilation.Assembly.RuntimeSupportsInlineArrayTypes);
647Debug.Assert(_additionalLocals is { });
668Debug.Assert(inlineArrayType.HasInlineArrayAttribute(out int inlineArrayLength) && inlineArrayLength == arrayLength);
709Debug.Assert(span.Type is { });
839Debug.Assert(TryOptimizeSingleSpreadToArray_NoConversionApplied(node, targetsReadOnlyCollection: false, arrayType) is null);
904Debug.Assert(arrayTemp.Type is ArrayTypeSymbol);
947Debug.Assert(indexTemp is not null);
1036Debug.Assert(type is not null);
1132Debug.Assert((object)spreadOperandAsSpan != rewrittenSpreadOperand || spreadOperandAsSpan is BoundLocal { LocalSymbol.SynthesizedKind: SynthesizedLocalKind.LoweringTemp });
1161Debug.Assert(!_inExpressionLambda);
1236Debug.Assert(useKnownLength);
1237Debug.Assert(setCount is { });
1238Debug.Assert(asSpan is { });
1239Debug.Assert(knownLengthTemp is { });
1275Debug.Assert(spanTemp.Type is NamedTypeSymbol);
1318Debug.Assert(indexTemp is not null);
1345Debug.Assert(rewrittenSpreadOperand.Type is not null);
1426Debug.Assert(statements.Length > 0);
1443Debug.Assert(rewrittenExpressions.Count >= numberIncludingLastSpread);
1454Debug.Assert(collectionPlaceholder is { });
1459Debug.Assert(lengthAccess is { });
1478Debug.Assert(sum is { });
1500Debug.Assert(enumeratorInfo is { });
1501Debug.Assert(convertedExpression is { });
1502Debug.Assert(expressionPlaceholder is { });
1503Debug.Assert(elementPlaceholder is { });
1504Debug.Assert(iteratorBody is { });
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (117)
25Debug.Assert(node.Type is NamedTypeSymbol { IsInterpolatedStringHandlerType: true });
39Debug.Assert(node.Operand is BoundConvertedSwitchExpression { WasTargetTyped: true });
43Debug.Assert(node.Operand is BoundConditionalOperator { WasTargetTyped: true });
47Debug.Assert(node.Operand is not null);
52Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true });
56Debug.Assert(node.Operand is BoundObjectCreationExpressionBase { WasTargetTyped: true } or
82Debug.Assert(result.Type!.Equals(toType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
94Debug.Assert(node.Type is not null);
95Debug.Assert(_compilation.IsReadOnlySpanType(node.Type));
97Debug.Assert(byteType.SpecialType == SpecialType.System_Byte);
142Debug.Assert(byteArray.IsSZArray);
143Debug.Assert(byteArray.ElementType.SpecialType == SpecialType.System_Byte);
166Debug.Assert(node.OperatorKind is BinaryOperatorKind.Utf8Addition);
194Debug.Assert(utf8Addition.OperatorKind is BinaryOperatorKind.Utf8Addition);
224Debug.Assert(rewrittenNode.Type is { });
271Debug.Assert(result.Type is { } rt && rt.Equals(rewrittenType, TypeCompareKind.AllIgnoreOptions));
306Debug.Assert(oldNodeOpt == null || oldNodeOpt.Syntax == syntax);
307Debug.Assert(rewrittenType is { });
308Debug.Assert(_factory.ModuleBuilderOpt is { });
309Debug.Assert(_diagnostics.DiagnosticBag is { });
319Debug.Assert(rewrittenOperand.Type is { });
433Debug.Assert(rewrittenOperand.Type is { });
448Debug.Assert(rewrittenOperand.Type is { });
451Debug.Assert(rewrittenOperand.Type.Equals(rewrittenType, TypeCompareKind.IgnoreDynamicAndTupleNames | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes));
494Debug.Assert(rewrittenOperand.Type is { });
504Debug.Assert(rewrittenOperand.Type.IsEnumType());
515Debug.Assert(rewrittenType.IsEnumType());
541Debug.Assert(conversion.Method is null);
542Debug.Assert(!conversion.IsExtensionMethod);
543Debug.Assert(constantValueOpt == null);
560Debug.Assert(symbolOpt is { });
570Debug.Assert(oldNodeOpt is { });
573Debug.Assert(method is { });
577Debug.Assert(receiver is { });
584Debug.Assert(_factory.TopLevelMethod is { });
602Debug.Assert(rewrittenOperand.Type is not null);
613Debug.Assert(spanType.OriginalDefinition.Equals(_compilation.GetWellKnownType(WellKnownType.System_Span_T), TypeCompareKind.AllIgnoreOptions));
629Debug.Assert(sourceType is not null);
642Debug.Assert(parameterType.IsSZArray());
643Debug.Assert(rewrittenOperand.Type?.IsSZArray() == true);
645Debug.Assert(c.IsImplicit || conversion.IsExplicit);
646Debug.Assert(c.IsReference || c.IsIdentity);
660Debug.Assert(destinationType.IsReadOnlySpan());
661Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan);
670Debug.Assert(implicitOperator.ParameterTypesWithAnnotations[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions));
692Debug.Assert(destinationType.IsReadOnlySpan());
693Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan);
694Debug.Assert(Binder.NeedsSpanCastUp(sourceType, destinationType));
704Debug.Assert(method.ParameterTypesWithAnnotations[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions));
711Debug.Assert(destinationType.IsReadOnlySpan());
712Debug.Assert(conversion.Kind is ConversionKind.ImplicitSpan);
719Debug.Assert(method.Parameters[0].Type.IsStringType());
720Debug.Assert(rewrittenOperand.Type?.IsStringType() == true);
757Debug.Assert(_factory.ModuleBuilderOpt is { });
770Debug.Assert((object)target != null);
832Debug.Assert(rewrittenOperand.Type is { });
864Debug.Assert(conversion.IsValid);
889Debug.Assert(conversion.Method is { });
890Debug.Assert(conversion.BestUserDefinedConversionAnalysis is { });
916Debug.Assert(rewrittenOperand.Type is { });
956Debug.Assert(conversion.IsValid);
957Debug.Assert(conversion.BestUnionConversionAnalysis is { });
961Debug.Assert(analysis.Kind == UserDefinedConversionAnalysisKind.ApplicableInNormalForm);
962Debug.Assert(analysis.Operator is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true }));
963Debug.Assert(TypeSymbol.Equals(analysis.FromType, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
964Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.Operator.MethodKind == MethodKind.Constructor ? analysis.Operator.ContainingType : analysis.Operator.ReturnType, TypeCompareKind.AllIgnoreOptions));
965Debug.Assert(TypeSymbol.Equals(rewrittenType.StrippedType(), analysis.ToType, TypeCompareKind.AllIgnoreOptions));
966Debug.Assert(analysis.TargetConversion is { IsIdentity: true } or { IsNullable: true, IsImplicit: true });
970Debug.Assert(!analysis.SourceConversion.IsIdentity);
979Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.Operator.GetParameterType(0), TypeCompareKind.AllIgnoreOptions));
986Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, analysis.ToType, TypeCompareKind.AllIgnoreOptions));
990Debug.Assert(!analysis.TargetConversion.IsIdentity);
999Debug.Assert(TypeSymbol.Equals(rewrittenOperand.Type, rewrittenType, TypeCompareKind.AllIgnoreOptions));
1023Debug.Assert(rewrittenOperand.Type is { });
1064Debug.Assert(expression.Type is { });
1111Debug.Assert((object)rewrittenType != null);
1119Debug.Assert(rewrittenOperandType is { });
1120Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType());
1167Debug.Assert((object)rewrittenType != null);
1168Debug.Assert(rewrittenOperand.Type is { });
1170Debug.Assert(rewrittenType.IsNullableType() || rewrittenOperandType.IsNullableType());
1293Debug.Assert(conversion.Method is { });
1313Debug.Assert(operand != null);
1314Debug.Assert((object)type != null);
1382Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
1383Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
1384Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
1415Debug.Assert(conversion.Method is { } && !conversion.Method.ReturnsVoid && conversion.Method.ParameterCount == 1);
1416Debug.Assert(rewrittenOperand.Type is { });
1448Debug.Assert(TypeSymbol.Equals(result.Type, rewrittenType, TypeCompareKind.ConsiderEverything2));
1456Debug.Assert(resultType.IsNullableType() && TypeSymbol.Equals(resultType.GetNullableUnderlyingType(), call.Method.ReturnType, TypeCompareKind.ConsiderEverything2));
1471Debug.Assert(rewrittenOperand.Type is { });
1487Debug.Assert((object)rewrittenType != null);
1488Debug.Assert(rewrittenOperand.Type.IsNullableType());
1519Debug.Assert(conversion.Method is { });
1559Debug.Assert(conversion.IsUnion);
1560Debug.Assert(conversion.Method is { ParameterCount: 1 } and ({ MethodKind: MethodKind.Constructor } or { MethodKind: MethodKind.Ordinary, IsStatic: true, ContainingType.IsInterface: true }));
1561Debug.Assert(rewrittenOperand.Type is { });
1562Debug.Assert(!_inExpressionLambda);
1563Debug.Assert(conversion.Method.Parameters[0].Type.Equals(rewrittenOperand.Type, TypeCompareKind.AllIgnoreOptions));
1602Debug.Assert(rewrittenOperand != null);
1603Debug.Assert((object)rewrittenType != null);
1604Debug.Assert(rewrittenOperand.Type is { });
1605Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr);
1618Debug.Assert(!method.ReturnsVoid);
1619Debug.Assert(method.ParameterCount == 1);
1625Debug.Assert(target.IsNullableType());
1651Debug.Assert((object)source != null);
1652Debug.Assert((object)target != null);
1811Debug.Assert(fromType.SpecialType == SpecialType.System_Decimal || toType.SpecialType == SpecialType.System_Decimal);
1830Debug.Assert(operand.Type is { });
1861Debug.Assert(TypeSymbol.Equals(method.ReturnType, toType, TypeCompareKind.ConsiderEverything2));
1878Debug.Assert(meth is { });
1914Debug.Assert(!_compilation.Assembly.RuntimeSupportsNumericIntPtr);
1945Debug.Assert(underlying is { });
1958Debug.Assert(underlying is { });
1990Debug.Assert(!meth.ContainingType.IsInterface);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (42)
38Debug.Assert(!_inExpressionLambda);
39Debug.Assert(rewrittenReceiver != null);
68Debug.Assert(_inExpressionLambda);
100Debug.Assert(!elementInitializer.AddMethod.CallsAreOmitted(initializer.SyntaxTree));
102Debug.Assert(!elementInitializer.InvokedAsExtensionMethod);
103Debug.Assert(!elementInitializer.AddMethod.IsExtensionMethod);
104Debug.Assert(!elementInitializer.AddMethod.IsExtensionBlockMember());
105Debug.Assert(elementInitializer.Arguments.Length == elementInitializer.AddMethod.ParameterCount);
106Debug.Assert(elementInitializer.ImplicitReceiverOpt is BoundObjectOrCollectionValuePlaceholder);
129Debug.Assert(rewrittenReceiver is { } || _inExpressionLambda);
143Debug.Assert(!_inExpressionLambda);
144Debug.Assert(initializer.Kind == BoundKind.DynamicCollectionElementInitializer);
183Debug.Assert(addMethod.Name == "Add");
184Debug.Assert(addMethod.Parameters
187Debug.Assert(initializer.Arguments.Any());
188Debug.Assert(!_inExpressionLambda);
231Debug.Assert(addMethod.IsStatic);
232Debug.Assert(addMethod.IsExtensionMethod);
233Debug.Assert(rewrittenReceiver is null);
272Debug.Assert(temps != null);
289Debug.Assert(!_inExpressionLambda);
309Debug.Assert(rewrittenReceiver != null);
310Debug.Assert(!_inExpressionLambda);
332Debug.Assert(memberInit is { });
336Debug.Assert(memberInit.Arguments.Count(a => a.IsParamsArrayOrCollection) <= (memberInit.Expanded ? 1 : 0));
360Debug.Assert(!memberInit.Expanded);
377Debug.Assert(setMember.SiteInitialization is { });
389Debug.Assert(getMember.SiteInitialization is { });
400Debug.Assert(assignment.Type.IsDynamic() || TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
411Debug.Assert(initializerMember is { });
421Debug.Assert(setMember.SiteInitialization is { });
428Debug.Assert(getMember.SiteInitialization is { });
437Debug.Assert(rewrittenArrayAccess is { });
441Debug.Assert(!arrayAccess.Indices.Any(a => a.IsParamsArrayOrCollection));
452Debug.Assert(getSubArrayCall.Arguments.Length == 2);
454Debug.Assert(Binder.IsWellKnownSystemRange(rangeArgument.Type, _compilation));
472Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
505Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
540Debug.Assert(TypeSymbol.Equals(rewrittenAccess.Type, assignment.Type, TypeCompareKind.AllIgnoreOptions));
579Debug.Assert(initializers is not null);
697Debug.Assert(memberSymbol is object);
701Debug.Assert(_compilation.Conversions.ClassifyConversionFromType(rewrittenReceiver.Type, memberSymbol.ContainingType, isChecked: false, ref discardedUseSiteInfo).IsImplicit ||
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (42)
38Debug.Assert(false); // these should have been represented as a BoundIncrementOperator
85Debug.Assert((kind == UnaryOperatorKind.DynamicTrue || kind == UnaryOperatorKind.DynamicFalse) && type.SpecialType == SpecialType.System_Boolean
87Debug.Assert(method is null);
113Debug.Assert(method is { });
114Debug.Assert(TypeSymbol.Equals(type, method.ReturnType, TypeCompareKind.ConsiderEverything2));
134Debug.Assert(underlyingType is { });
277Debug.Assert(result.Type is { });
328Debug.Assert(TypeSymbol.Equals(seq.Type, conditional.Type, TypeCompareKind.ConsiderEverything2));
329Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Consequence.Type, TypeCompareKind.ConsiderEverything2));
330Debug.Assert(TypeSymbol.Equals(conditional.Type, conditional.Alternative.Type, TypeCompareKind.ConsiderEverything2));
407Debug.Assert(node.MethodOpt is { });
408Debug.Assert(node.OperandConversion is null || (node.Operand.Type!.IsReferenceType && node.MethodOpt.IsExtensionBlockMember()));
414Debug.Assert(node.Type.IsVoidType());
422Debug.Assert(operandType is { });
423Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.AllIgnoreOptions));
451Debug.Assert(node.OperandConversion is null);
459Debug.Assert(operandType is { });
467Debug.Assert(TypeSymbol.Equals(operandType, transformedLHS.Type, TypeCompareKind.AllIgnoreOptions));
588Debug.Assert(operandType is { });
589Debug.Assert(TypeSymbol.Equals(operandType, node.Type, TypeCompareKind.ConsiderEverything2));
625Debug.Assert(transformedLHS is not BoundPropertyAccess);
641Debug.Assert(!IsCapturedPrimaryConstructorParameter(expression));
661Debug.Assert(boundTemp.Type is not null);
701Debug.Assert(boundTemp.Type is not null);
704Debug.Assert(tempValue.Type is { });
760Debug.Assert(placeholder is not null);
793Debug.Assert(node.MethodOpt is { });
794Debug.Assert(node.MethodOpt.ParameterCount == 1);
805Debug.Assert(TypeSymbol.Equals(node.MethodOpt.GetParameterType(0), node.MethodOpt.ReturnType, TypeCompareKind.ConsiderEverything2));
902Debug.Assert(constantOne != null);
903Debug.Assert(constantOne.SpecialType != SpecialType.None);
904Debug.Assert(binaryOperandType.SpecialType != SpecialType.None);
905Debug.Assert(binaryOperatorKind.OperandTypes() != 0);
932Debug.Assert(binaryOperatorKind.OperandTypes() == BinaryOperatorKind.PointerAndInt);
933Debug.Assert(binaryOperand.Type is { TypeKind: TypeKind.Pointer });
934Debug.Assert(boundOne.Type is { SpecialType: SpecialType.System_Int32 });
980Debug.Assert((object)method != null); // Should have been checked during Warnings pass
987Debug.Assert(operand.Type is { SpecialType: SpecialType.System_Decimal });
994Debug.Assert(operand.Type is { } && operand.Type.IsNullableType() && operand.Type.GetNullableUnderlyingType().SpecialType == SpecialType.System_Decimal);
1180Debug.Assert(underlyingType is { });
1185Debug.Assert(underlyingType.IsEnumType());
1187Debug.Assert(underlyingType is { });
Lowering\LocalRewriter\LocalRewriter.cs (38)
67Debug.Assert(factory.InstrumentationState != null);
73Debug.Assert(TypeSymbol.Equals(factory.CurrentType, (containingType ?? containingMethod.ContainingType), TypeCompareKind.ConsiderEverything2));
102Debug.Assert(statement != null);
103Debug.Assert(compilationState != null);
148Debug.Assert(loweredStatement is { });
214Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered");
232Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered");
244Debug.Assert(!node.HasErrors, "nodes with errors should not be lowered");
253Debug.Assert(!nameofOperator.WasCompilerGenerated);
285Debug.Assert(visited == null || visited.HasErrors || ReferenceEquals(visited.Type, node.Type) ||
322Debug.Assert(CanBePassedByReference(node));
324Debug.Assert(CanBePassedByReference(result));
333Debug.Assert(_factory.ModuleBuilderOpt is { });
513Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { });
522Debug.Assert(value.Type is { } && (value.Type.Equals(placeholder.Type, TypeCompareKind.AllIgnoreOptions) || value.HasErrors));
531Debug.Assert(_placeholderReplacementMapDoNotUseDirectly.Count == 0);
559Debug.Assert(placeholder is { });
560Debug.Assert(_placeholderReplacementMapDoNotUseDirectly is { });
563Debug.Assert(removed);
587Debug.Assert(node.Type is { });
608Debug.Assert((syntax != null) ^ (location != null));
658Debug.Assert(node.Type.ExtendedSpecialType == InternalSpecialType.System_Type ||
660Debug.Assert(node.GetTypeFromHandle is null);
663Debug.Assert(sourceType is { });
684Debug.Assert(getTypeFromHandle is not null);
685Debug.Assert(TypeSymbol.Equals(type, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions));
691Debug.Assert(node.GetTypeFromHandle is null);
724Debug.Assert(statement is { });
850Debug.Assert(node.Expression.Type is { TypeKind: TypeKind.Array });
880Debug.Assert(parent.Parent is { });
929Debug.Assert(assignment.Left.Kind == BoundKind.FieldAccess);
1071Debug.Assert(eventAccess.ReceiverOpt is { });
1072Debug.Assert(eventAccess.ReceiverOpt.Type is { });
1082Debug.Assert(fieldAccess.ReceiverOpt is { });
1083Debug.Assert(fieldAccess.ReceiverOpt.Type is { });
1155Debug.Assert(!member.IsStatic);
1157Debug.Assert(extensionParameter is not null);
1168Debug.Assert(Conversions.IsValidExtensionMethodThisArgConversion(this._compilation.Conversions.ClassifyConversionFromType(receiver.Type, extensionParameter.Type, isChecked: false, ref discardedUseSiteInfo)));
Lowering\SyntheticBoundNodeFactory.cs (79)
121Debug.Assert(node != null);
122Debug.Assert(compilationState != null);
123Debug.Assert(diagnostics != null);
139Debug.Assert(TopLevelMethod is null || TypeSymbol.Equals(TopLevelMethod.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
145Debug.Assert(CurrentFunction is null ||
155Debug.Assert(ModuleBuilderOpt is { });
177Debug.Assert(CurrentType is { });
185Debug.Assert(CurrentType is { });
193Debug.Assert(CurrentType is { });
201Debug.Assert(CurrentType is { });
209Debug.Assert(CurrentType is { });
218Debug.Assert(ModuleBuilderOpt is { });
229Debug.Assert(CurrentFunction is { IsStatic: false, ThisParameter: { } });
240Debug.Assert(CurrentFunction is { IsStatic: false });
272Debug.Assert(receiverOpt is null || receiverOpt.Type is { } &&
280Debug.Assert((receiverOpt is null) == property.IsStatic);
284Debug.Assert(!(receiverOpt is { Type: ArrayTypeSymbol { IsSZArray: true } } &&
289Debug.Assert(accessor is not null);
295Debug.Assert((receiverOpt is null) == property.IsStatic);
297Debug.Assert(accessor is not null);
366Debug.Assert(result is not null);
407Debug.Assert(result is not null);
444Debug.Assert(left.Type is { } && right.Type is { } &&
563Debug.Assert(CurrentFunction is { });
575Debug.Assert(useSiteInfo.Diagnostics.IsNullOrEmpty());
576Debug.Assert(conversion.Kind != ConversionKind.NoConversion);
580Debug.Assert(CurrentFunction.RefKind == RefKind.None);
590Debug.Assert(CurrentFunction is { });
669Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
670Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
676Debug.Assert(left.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
677Debug.Assert(right.Type?.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
706Debug.Assert(c.IsImplicit);
707Debug.Assert(c.IsBoxing || c.IsReference || c.IsIdentity);
836Debug.Assert(methodSymbol.IsStatic);
844Debug.Assert(methodSymbol.IsStatic);
845Debug.Assert(methodSymbol.IsGenericMethod);
846Debug.Assert(methodSymbol.Arity == typeArgs.Length);
854Debug.Assert(methodSymbol.IsStatic);
883Debug.Assert(method.ParameterCount == args.Length);
925Debug.Assert(method.ParameterCount == args.Length);
940Debug.Assert(valueTypeReceiver.Type is { });
941Debug.Assert(TypeSymbol.Equals(valueTypeReceiver.Type, referenceTypeReceiver.Type, TypeCompareKind.ConsiderEverything2));
947Debug.Assert(left.Type!.Equals(right.Type, TypeCompareKind.IgnoreCustomModifiersAndArraySizesAndLowerBounds | TypeCompareKind.IgnoreNullableModifiersForReferenceTypes) || left.Type.IsErrorType());
948Debug.Assert(left.Type.IsReferenceType);
976Debug.Assert(thenClause != null);
1058Debug.Assert(result.Type is { });
1065Debug.Assert(result.Type is { });
1074Debug.Assert(result.Type is { });
1104Debug.Assert(ex.Type is { SpecialType: CodeAnalysis.SpecialType.System_Int32 });
1131Debug.Assert(statements[0] is null);
1148Debug.Assert(!labels.Contains(v2));
1177Debug.Assert(stringConst.IsString || stringConst.IsNull);
1188Debug.Assert(charConst.IsChar || charConst.IsDefaultValue);
1199Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
1205Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
1218Debug.Assert(array.Type is { TypeKind: TypeKind.Array });
1225Debug.Assert(CurrentFunction is { ThisParameter: { } });
1270Debug.Assert(type.CanBeAssignedNull());
1289Debug.Assert(systemType.ExtendedSpecialType == InternalSpecialType.System_Type ||
1303Debug.Assert(TypeSymbol.Equals(systemType, getTypeFromHandle.ReturnType, TypeCompareKind.AllIgnoreOptions));
1325Debug.Assert(this.CompilationState is { DynamicOperationContextType: { } });
1347Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo));
1454Debug.Assert(result.Type.IsErrorType() || result.Type!.IsDerivedFrom(result.GetMethodFromHandle!.ReturnType, TypeCompareKind.AllIgnoreOptions, ref discardedUseSiteInfo));
1471Debug.Assert(systemReflectionMethodOrConstructorInfo.ExtendedSpecialType == InternalSpecialType.System_Reflection_MethodInfo ||
1534Debug.Assert(arg.Type is { });
1641Debug.Assert(expression is { Type: { SpecialType: CodeAnalysis.SpecialType.System_Boolean } });
1662Debug.Assert(argument.Type is { });
1664Debug.Assert(containingMethod is { });
1665Debug.Assert(kind != SynthesizedLocalKind.UserDefined);
1682Debug.Assert(argument.GetRefKind() != RefKind.In);
1739Debug.Assert(node.Type is { });
1762Debug.Assert((operatorKind == BinaryOperatorKind.Equal) || (operatorKind == BinaryOperatorKind.NotEqual) ||
1768Debug.Assert(
1838Debug.Assert(loweredLeft != null);
1839Debug.Assert(loweredRight != null);
1840Debug.Assert((object)returnType != null);
1841Debug.Assert(returnType.SpecialType == CodeAnalysis.SpecialType.System_Boolean);
1842Debug.Assert(loweredLeft.IsLiteralNull() != loweredRight.IsLiteralNull());
Parser\Lexer.cs (52)
120Debug.Assert(options != null);
329Debug.Assert(info.Kind != SyntaxKind.IdentifierToken || info.StringValue != null);
411Debug.Assert(SyntaxFacts.IsPunctuationOrKeyword(info.Kind));
614Debug.Assert(TextWindow.PeekChar() == '@');
738Debug.Assert(TextWindow.PeekChar() == '@');
764Debug.Assert(TextWindow.PeekChar() == '$');
1037Debug.Assert(info.Text != null);
1135Debug.Assert(hasUSuffix && hasLSuffix);
1600Debug.Assert(string.Equals(info.Text.Substring(0, objectAddressOffset + 1), "@0x", StringComparison.OrdinalIgnoreCase));
1636Debug.Assert(InXmlCrefOrNameAttributeValue);
1695Debug.Assert(consumedSurrogate == SlidingTextWindow.InvalidCharacter, "Since consumedChar == '\\'");
2070Debug.Assert(firstCh is '<' or '|' or '=' or '>');
2210Debug.Assert(delimiter is '/' or '@');
2211Debug.Assert(TextWindow.PeekChar() == delimiter && TextWindow.PeekChar(1) == '*');
2277Debug.Assert(SyntaxFacts.IsWhitespace(TextWindow.PeekChar()));
2312Debug.Assert(this.CurrentLexemeWidth > 0);
2712Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null);
2807Debug.Assert(this.LocationIs(XmlDocCommentLocation.End) || TextWindow.PeekChar() == SlidingTextWindow.InvalidCharacter);
2843Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
2844Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
2888Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null);
2902Debug.Assert(TextWindow.PeekChar() == '<');
2951Debug.Assert(TextWindow.PeekChar() == '&');
3210Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
3211Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
3278Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't.");
3294Debug.Assert(false, "Should have picked up leading indentationTrivia, but didn't.");
3306Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null);
3383Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
3384Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
3450Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null);
3541Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
3542Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
3601Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
3602Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
3686Debug.Assert(TextWindow.Position > beforeConsumed, "First character or entity has been consumed.");
3797Debug.Assert(info.Text == null, "Haven't tried to set it yet.");
3798Debug.Assert(info.StringValue == null, "Haven't tried to set it yet.");
3886Debug.Assert(info.Kind != SyntaxKind.None || info.Text != null);
4007Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
4008Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
4129Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
4130Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
4260Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Start));
4261Debug.Assert(!this.LocationIs(XmlDocCommentLocation.Exterior));
4472Debug.Assert(this.StyleIs(XmlDocCommentStyle.Delimited));
4601Debug.Assert(info == null, "Never produce a diagnostic while peeking.");
4609Debug.Assert(ch != SlidingTextWindow.InvalidCharacter, "Precondition established by all callers; required for correctness of AdvanceChar() call.");
4637Debug.Assert(character == '\\');
4687Debug.Assert(character == 'u' || character == 'x');
4741Debug.Assert(TextWindow.PeekChar() == '&');
4855Debug.Assert(codepoint > 0x0000FFFF && codepoint <= 0x0010FFFF);
Symbols\Metadata\PE\PEMethodSymbol.cs (34)
129Debug.Assert((long)value == ((long)value & MethodKindMask));
165Debug.Assert(EnumUtilities.ContainsAllValues<MethodKind>((int)MethodKindMask));
166Debug.Assert(EnumUtilities.ContainsAllValues<NullableContextKind>((int)NullableContextMask));
178Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet));
185Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet));
191Debug.Assert((long)methodKind == ((long)methodKind & MethodKindMask));
193Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet));
203Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet));
258Debug.Assert(BitsAreUnsetOrSame(_bits, bitsToSet));
422Debug.Assert((object)moduleSymbol != null);
423Debug.Assert((object)containingType != null);
424Debug.Assert(!methodDef.IsNil);
436Debug.Assert((uint)implFlags <= ushort.MaxValue);
449Debug.Assert((uint)localflags <= ushort.MaxValue);
475Debug.Assert(flag != 0 && ((ushort)flag & ((ushort)flag - 1)) == 0);
633Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated);
646Debug.Assert(_packedFlags.IsExplicitOverrideIsPopulated);
711Debug.Fail("Not expecting to get here; if we end up here through ENC, add tests to verify");
742Debug.Assert(!memberNotNull.IsDefault);
750Debug.Assert(!memberNotNullWhenTrue.IsDefault);
756Debug.Assert(!memberNotNullWhenFalse.IsDefault);
817Debug.Assert((methodKind == MethodKind.PropertyGet) || (methodKind == MethodKind.PropertySet));
827Debug.Assert((methodKind == MethodKind.EventAdd) || (methodKind == MethodKind.EventRemove));
835Debug.Assert(TypeSymbol.Equals(propertyOrEventSymbol.ContainingType, _containingType, TypeCompareKind.ConsiderEverything2));
843Debug.Assert(
1032Debug.Assert(!attributeData.IsDefault);
1558Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.Uninitialized));
1559Debug.Assert(!ReferenceEquals(data, UnmanagedCallersOnlyAttributeData.AttributePresentDataNotBound));
1653Debug.Assert(!result.IsDefault);
1681Debug.Assert(MethodKind == MethodKind.Constructor);
1737Debug.Assert(!ReferenceEquals(unmanagedCallersOnlyData, UnmanagedCallersOnlyAttributeData.Uninitialized)
1763Debug.Assert(result != null);
1830Debug.Assert(AssociatedSymbol?.GetCallerUnsafeMode(ConsList<FieldSymbol>.Empty) != CallerUnsafeMode.Implicit);
1870Debug.Assert(_uncommonFields is null or { _lazyOverloadResolutionPriority: 0 });
Symbols\Retargeting\RetargetingSymbolTranslator.cs (39)
44Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
50Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
56Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
62Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
66Debug.Assert(correspondingTupleField is TupleErrorFieldSymbol);
88Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
94Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
100Debug.Assert(ReferenceEquals(symbol.ContainingModule, _underlyingModule));
111Debug.Assert((object)retargetingModule != null);
164Debug.Assert(symbol.Kind != SymbolKind.NamedType || ((NamedTypeSymbol)symbol).PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
207Debug.Assert(type.IsDefinition);
241Debug.Assert(!retargetFrom.IsLinked);
283Debug.Assert(module.Ordinal == 0);
284Debug.Assert(!type.IsExplicitDefinitionOfNoPiaLocalType);
303Debug.Assert(module.Ordinal > 0);
305Debug.Assert(ReferenceEquals(((PEModuleSymbol)module).Module, addedModule.Module));
350Debug.Assert(signatureIndex == 0 || signatureIndex == 1);
364Debug.Assert((object)type.ContainingAssembly != (object)RetargetingAssembly.UnderlyingAssembly);
386Debug.Assert((object)result != null);
403Debug.Assert(!type.ContainingModule.Equals(addedModule) &&
435Debug.Assert(result is PENamedTypeSymbol peResult && peResult.Handle == type.Handle);
461Debug.Assert(result1?.IsErrorType() != true);
472Debug.Assert(result1.Arity == type.Arity);
475Debug.Assert(TypeSymbol.Equals(result1, result, TypeCompareKind.ConsiderEverything2));
499Debug.Assert(originalDefinition.Arity == 0 || !ReferenceEquals(type.ConstructedFrom, type));
510Debug.Assert((object)type.ContainingType == null || !type.ContainingType.IsUnboundGenericType());
578Debug.Assert(newParameters.Count == newArguments.Count);
741Debug.Assert(newModifiers == null || newModifiers.Count == oldModifiers.Length);
842Debug.Assert(nts.TypeKind == TypeKind.Error || nts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
854Debug.Assert(ts.TypeKind == TypeKind.Error || ts.PrimitiveTypeCode == Cci.PrimitiveTypeCode.NotPrimitive);
876Debug.Assert(ReferenceEquals(method.ContainingModule, this.UnderlyingModule));
877Debug.Assert(ReferenceEquals(method, method.OriginalDefinition));
884Debug.Assert((object)method == method.ConstructedFrom);
901Debug.Assert(!retargetedType.IsDefinition);
913Debug.Assert(retargetedType.IsDefinition);
926Debug.Assert(ReferenceEquals(property.ContainingModule, this.UnderlyingModule));
927Debug.Assert(ReferenceEquals(property, property.OriginalDefinition));
1048Debug.Assert((object)typeParameter.ContainingSymbol == _toFind);
1320Debug.Assert(ReferenceEquals(symbol, _retargetingModule.UnderlyingModule));
Symbols\Source\SourceAssemblySymbol.cs (57)
122Debug.Assert(compilation != null);
123Debug.Assert(assemblySimpleName != null);
124Debug.Assert(!String.IsNullOrWhiteSpace(moduleName));
125Debug.Assert(!netModules.IsDefault);
497Debug.Assert(!DeclaringCompilation.Options.Errors.IsEmpty);
652Debug.Assert((object)compilationRelaxationsAttribute != null, "GetWellKnownType unexpectedly returned null");
661Debug.Assert((object)runtimeCompatibilityAttribute != null, "GetWellKnownType unexpectedly returned null");
694Debug.Assert((object)unverifiableCodeAttribute != null, "GetWellKnownType unexpectedly returned null");
706Debug.Assert((object)securityPermissionAttribute != null, "GetWellKnownType unexpectedly returned null");
713Debug.Assert((object)securityAction != null, "GetWellKnownType unexpectedly returned null");
925Debug.Assert(thisThreadCompleted);
938Debug.Assert(locationOpt != null || filter != null, "If no location or filter was specified, then the module members should be completed");
949Debug.Assert(thisThreadCompleted);
1071Debug.Assert(moduleNs.Extent.Kind == NamespaceKind.Module);
1212Debug.Assert(!attribute.HasErrors);
1224Debug.Assert(!attribute.HasErrors);
1241Debug.Assert(success);
1318Debug.Assert(attributesFromNetModules.Any());
1319Debug.Assert(netModuleNames.Any());
1320Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length);
1455Debug.Assert(lazyNetModuleAttributesBag.IsSealed);
1461Debug.Assert(attributeMatches is QuickAttributes.AssemblyKeyFile
1487Debug.Assert(attributesFromNetModules.Any());
1488Debug.Assert(netModuleNames.Any());
1489Debug.Assert(attributesFromNetModules.Length == netModuleNames.Length);
1547Debug.Assert(attributesBag.IsSealed);
1600Debug.Assert(!attributes.IsDefault);
1601Debug.Assert(!netmoduleAttributes.IsDefault);
1615Debug.Assert(!attributes.IsDefault);
1628Debug.Assert(_lazyOmittedAttributeIndices == null || !_lazyOmittedAttributeIndices.Any(i => i < 0 || i >= this.GetAttributes().Length));
1629Debug.Assert(_lazySourceAttributesBag.IsSealed);
1630Debug.Assert(_lazyNetModuleAttributesBag.IsSealed);
1631Debug.Assert(index >= 0);
1632Debug.Assert(index < this.GetAttributes().Length);
1751Debug.Assert(added);
1757Debug.Assert(removed);
1782Debug.Assert(attributesBag.IsSealed);
1832Debug.Assert(!boolType.HasUseSiteError,
1972Debug.Assert(!int32Type.HasUseSiteError,
1992Debug.Assert(!boolType.HasUseSiteError, "Use site errors should have been checked ahead of time (type bool).");
2026Debug.Assert(!stringType.HasUseSiteError, "Use site errors should have been checked ahead of time (type string).");
2036Debug.Assert(!stringType.HasUseSiteError, "Use site errors should have been checked ahead of time (type string).");
2110Debug.Assert(conclusion != IVTConclusion.NoRelationshipClaimed);
2207Debug.Assert(!arguments.Attribute.HasErrors);
2226Debug.Assert(forwardedType.TypeKind != TypeKind.Error);
2278Debug.Assert(!attrData.HasErrors);
2368Debug.Assert(!attribute.HasErrors);
2369Debug.Assert(arguments.SymbolPart == AttributeLocation.None);
2617Debug.Assert(!attribute.HasErrors);
2660Debug.Assert(
2664Debug.Assert(
2672Debug.Assert(_unusedFieldWarnings.IsDefault, "We shouldn't have computed the diagnostics if we're still noting definitions.");
2693Debug.Assert(this.HasComplete(CompletionPart.Module),
2715Debug.Assert(success, "Once CompletionPart.Module is set, no-one should be modifying the map.");
2798Debug.Assert(!_unusedFieldWarnings.IsDefault);
2844Debug.Assert(forcedArity == emittedName.InferredArity);
2860Debug.Assert((object)originalDefinition.ContainingType == null, "How did a nested type get forwarded?");
Symbols\Source\SourceMemberContainerSymbol.cs (105)
113Debug.Assert(EnumUtilities.ContainsAllValues<SpecialType>(SpecialTypeMask));
114Debug.Assert(EnumUtilities.ContainsAllValues<InternalSpecialType>(SpecialTypeMask)); //This assert might false fail in the future, we don't really need to be able to represent NextAvailable
115Debug.Assert(EnumUtilities.ContainsAllValues<NullableContextKind>(NullableContextMask));
146Debug.Assert(BitsAreUnsetOrSame(_flags, bitsToSet));
235Debug.Assert(containingSymbol is NamespaceSymbol { IsGlobalNamespace: true } || !declaration.Declarations.Any(static d => d.IsSimpleProgram));
264Debug.Assert(typeKind is TypeKind.Struct or TypeKind.Class || !HasPrimaryConstructor);
664Debug.Assert(thisThreadCompleted);
719Debug.Assert(thisThreadCompleted);
730Debug.Assert((incompletePart & CompletionPart.NamedTypeSymbolAll) == 0);
870Debug.Assert(!useSiteDiagnostics.IsDefault);
879Debug.Assert(!useSiteDependencies.IsDefault);
1179Debug.Assert(!nonTypeMembers.IsDefault);
1180Debug.Assert(!staticInitializers.IsDefault);
1181Debug.Assert(staticInitializers.All(g => !g.IsDefault));
1182Debug.Assert(!instanceInitializers.IsDefault);
1183Debug.Assert(instanceInitializers.All(g => !g.IsDefault));
1185Debug.Assert(!nonTypeMembers.Any(static s => s is TypeSymbol));
1186Debug.Assert(haveIndexers == nonTypeMembers.Any(static s => s.IsIndexer()));
1253Debug.Assert(ctorInitializerLength >= 0);
1276Debug.Assert(distanceFromCtorBody > 0);
1484Debug.Assert(s_emptyTypeMembers.Count == 0);
1568Debug.Assert(symbol is not null);
1573Debug.Assert(attr is SourceAttributeData);
2060Debug.Assert(IsFileLocal);
2068Debug.Assert(fileIdentifier.FilePathChecksumOpt.IsDefault);
2397Debug.Assert(method1.ParameterCount == method2.ParameterCount);
2477Debug.Assert(checkCollisionWithTypeParameters || typeParameterNames == null);
2529Debug.Assert(!membersByName[indexerName.AsMemory()].Any(SymbolExtensions.IsIndexer));
2621Debug.Assert(cloneMembersByName);
2625Debug.Assert(masterExtension is not null);
2661Debug.Assert(!newMembers.IsEmpty);
2665Debug.Assert(newMembers.All(static (m, membersUnordered) => membersUnordered.Contains(m), membersUnordered));
2782Debug.Assert(value == _lazyKnownCircularStruct);
2793Debug.Assert(TypeKind == TypeKind.Struct);
2812Debug.Assert(field.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list.");
3027Debug.Assert(!this.IsExtension);
3110Debug.Assert(IsSubmissionClass || IsScriptClass);
3136Debug.Assert(ReferenceEquals(this, this.OriginalDefinition));
3149Debug.Assert(f.AssociatedSymbol is not EventSymbol, "Didn't expect to find a field-like event backing field in the member list.");
3422Debug.Assert(!nonTypeMembersWithPartialImplementations.IsDefault);
3426Debug.Assert(!nonTypeMembersWithPartialImplementations.Any(static s => s is TypeSymbol));
3427Debug.Assert(declarationWithParameters is object || primaryConstructor is null);
3442Debug.Assert(!initializers.IsDefault);
3450Debug.Assert(!group.IsDefaultOrEmpty);
3457Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i - 1].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3462Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i + 1].Last().Syntax, compilation)) < 0);
3467Debug.Assert(LexicalSortKey.Compare(new LexicalSortKey(initializers[i].First().Syntax, compilation), new LexicalSortKey(initializers[i].Last().Syntax, compilation)) < 0);
3492Debug.Assert(declaredMembersAndInitializers != DeclaredMembersAndInitializers.UninitializedSentinel);
3517Debug.Assert(InstanceInitializersForPositionalMembers.Count != 0);
3518Debug.Assert(declaredMembers.PrimaryConstructor is object);
3519Debug.Assert(declaredMembers.DeclarationWithParameters is object);
3520Debug.Assert(declaredMembers.DeclarationWithParameters.SyntaxTree == InstanceInitializersForPositionalMembers[0].Syntax.SyntaxTree);
3521Debug.Assert(declaredMembers.DeclarationWithParameters.Span.Contains(InstanceInitializersForPositionalMembers[0].Syntax.Span.Start));
3554Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.SyntaxTree == declaredInitializers[0].Syntax.SyntaxTree);
3555Debug.Assert(insertedInitializers[insertedInitializers.Count - 1].Syntax.Span.Start < declaredInitializers[0].Syntax.Span.Start);
3564Debug.Assert(groupsBuilder.Count == groupCount);
3568Debug.Assert(!declaredMembers.InstanceInitializers.Any(g => declaredMembers.DeclarationWithParameters.SyntaxTree == g[0].Syntax.SyntaxTree &&
3574Debug.Assert(groupsBuilder.Count == groupCount + 1);
3773Debug.Assert(partialMembersToMerge.Count != 0);
3814Debug.Assert(!_lazySimpleProgramEntryPoints.IsDefault);
3873Debug.Assert(result is object);
3896Debug.Assert(primaryConstructor is not null);
3897Debug.Assert(!this.IsDelegateType());
3928Debug.Assert(HasPrimaryConstructor);
3933Debug.Assert(declared.PrimaryConstructor is not null);
3939Debug.Assert(membersAndInitializers.PrimaryConstructor is not null);
3946Debug.Assert(HasPrimaryConstructor);
3970Debug.Assert(primaryConstructor is not null);
4175Debug.Assert(symbol.IsPartialMember());
4201Debug.Assert(pair.Key.Equals(WellKnownMemberNames.InstanceConstructorName.AsMemory()));
4212Debug.Assert(symbol.Kind != prev.Kind);
4213Debug.Assert(symbol is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol or SourceEventAccessorSymbol);
4214Debug.Assert(prev is SourceOrdinaryMethodSymbol or SourcePropertySymbol or SourcePropertyAccessorSymbol or SourceEventAccessorSymbol);
4222Debug.Assert(symbol.IsPartialMember());
4301Debug.Assert(symbol.IsPartialMember());
4553Debug.Assert(!propertySymbol.IsExplicitInterfaceImplementation); // checked by caller
4604Debug.Assert(!eventSymbol.IsExplicitInterfaceImplementation); // checked by caller
4739Debug.Assert(node.SyntaxTree == initializers.Last().Syntax.SyntaxTree);
4740Debug.Assert(node.SpanStart > initializers.Last().Syntax.Span.Start);
4826Debug.Assert(property.IsIndexer);
4915Debug.Assert(TypeKind == TypeKind.Struct);
4919Debug.Assert(builder.DeclarationWithParameters is TypeDeclarationSyntax { ParameterList: not null } type
4964Debug.Assert(ctor is object);
4974Debug.Assert(declaredMembersAndInitializers.PrimaryConstructor?.GetBackingFields().Any() != true);
4983Debug.Assert(valueProperty.GetMethod is object);
4984Debug.Assert(valueProperty.SetMethod is null);
4987Debug.Assert(backingField is object);
5016Debug.Assert(typeSyntax != null);
5053Debug.Assert(memberOffset == members.Count - typesBuilder.Count);
5102Debug.Assert(declaredMembersAndInitializers.DeclarationWithParameters is object);
5106Debug.Assert(ctor is object);
5159Debug.Assert(isRecordClass || !members.Any(m => m is PropertySymbol { GetMethod.IsEffectivelyReadOnly: false }));
5170Debug.Assert(positionalMembers.All(p => p is PropertySymbol or FieldSymbol));
5218Debug.Assert(isRecordClass);
5266Debug.Assert(isRecordClass);
5473Debug.Assert(property.GetMethod is object);
5474Debug.Assert(property.SetMethod is object);
5478Debug.Assert(backingField is object);
5540Debug.Assert(isRecordClass);
5662Debug.Assert(isRecordClass);
5995Debug.Assert(@event.IsPartial || @event.AddMethod is not null);
5996Debug.Assert(@event.IsPartial || @event.RemoveMethod is not null);
6019Debug.Assert(@event.AssociatedField is null);
6124Debug.Assert(
6329Debug.Assert(this.declaration.ContainsExtensionDeclarations);
Symbols\Source\SourceNamespaceSymbol.AliasesAndUsings.cs (35)
33Debug.Assert((object)result == calculated);
37Debug.Assert(result.ExternAliases.SequenceEqual(calculated.ExternAliases));
38Debug.Assert(result.UsingAliases.SetEquals(calculated.UsingAliases));
39Debug.Assert(result.Usings.SequenceEqual(calculated.Usings));
51Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetImports(this, declarationSyntax, basesBeingResolved) == Imports.Empty);
120Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetExternAliases(this, declarationSyntax).IsEmpty);
130Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetExternAliases(this, declarationSyntax).IsEmpty);
151Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliases(this, declarationSyntax, basesBeingResolved).IsEmpty);
161Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliases(this, declarationSyntax, basesBeingResolved).IsEmpty);
183Debug.Assert(result.SetEquals(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliasesMap(this, declarationSyntax, basesBeingResolved)));
193Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingAliasesMap(this, declarationSyntax, basesBeingResolved).IsEmpty);
215Debug.Assert(result.SequenceEqual(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingNamespacesOrTypes(this, declarationSyntax, basesBeingResolved)));
225Debug.Assert(GetAliasesAndUsingsForAsserts(declarationSyntax).GetUsingNamespacesOrTypes(this, declarationSyntax, basesBeingResolved).IsEmpty);
447Debug.Assert(result.IsEmpty);
448Debug.Assert(diagnostics.IsEmptyWithoutResolution);
564Debug.Assert(!onlyGlobal);
580Debug.Assert(calculated.UsingAliases.IsEmpty);
581Debug.Assert(calculated.UsingAliasesMap?.IsEmpty ?? true);
582Debug.Assert(calculated.UsingNamespacesOrTypes.IsEmpty);
583Debug.Assert(calculated.Diagnostics?.IsEmptyWithoutResolution ?? true);
598Debug.Assert(calculated.UsingAliases.SequenceEqual(result.UsingAliases));
599Debug.Assert((calculated.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty).SetEquals(result.UsingAliasesMap ?? ImmutableDictionary<string, AliasAndUsingDirective>.Empty));
600Debug.Assert(calculated.UsingNamespacesOrTypes.SequenceEqual(result.UsingNamespacesOrTypes));
601Debug.Assert(calculated.Diagnostics?.IsEmptyWithoutResolution ?? true);
763Debug.Assert(directiveDiagnostics.DiagnosticBag is object);
764Debug.Assert(directiveDiagnostics.DependenciesBag is object);
784Debug.Assert(directiveDiagnostics.DependenciesBag.IsEmpty());
959Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports));
983Debug.Assert(diagnostics.DiagnosticBag is object);
984Debug.Assert(diagnostics.DependenciesBag is object);
994Debug.Assert(declaringSymbol.IsGlobalNamespace);
1008Debug.Assert(alias.UsingDirective != null);
1027Debug.Assert(declaringSymbol.IsGlobalNamespace);
1063Debug.Assert(target.IsGlobalNamespace);
1202Debug.Assert(_state.HasComplete(CompletionPart.StartValidatingImports));
Utilities\ValueSetFactory.NumericValueSet.cs (10)
33Debug.Assert(tc.Related(LessThanOrEqual, first, last));
39Debug.Assert(intervals.Length == 0 || tc.Related(GreaterThanOrEqual, intervals[0].first, tc.MinValue));
42Debug.Assert(tc.Related(LessThanOrEqual, intervals[i].first, intervals[i].last));
46Debug.Assert(tc.Related(LessThan, tc.Next(intervals[i - 1].last), intervals[i].first));
165Debug.Assert(this._tc.GetType() == other._tc.GetType());
211Debug.Assert(tc.Related(LessThanOrEqual, first, last));
212Debug.Assert(tc.Related(GreaterThanOrEqual, first, tc.MinValue));
213Debug.Assert(tc.Related(LessThanOrEqual, last, tc.MaxValue));
214Debug.Assert(builder.Count == 0 || tc.Related(LessThanOrEqual, builder.Last().first, first));
242Debug.Assert(this._tc.GetType() == other._tc.GetType());
Microsoft.CodeAnalysis.CSharp.Analyzers (1)
Microsoft.CodeAnalysis.CSharp.CodeStyle (80)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (31)
Microsoft.CodeAnalysis.CSharp.Features (144)
Microsoft.CodeAnalysis.CSharp.NetAnalyzers (10)
Microsoft.CodeAnalysis.CSharp.Workspaces (101)
Microsoft.CodeAnalysis.Extensions.Package (163)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
Microsoft.CodeAnalysis.ExternalAccess.HotReload (2)
Microsoft.CodeAnalysis.Features (558)
EditAndContinue\AbstractEditAndContinueAnalyzer.cs (77)
670Debug.Assert(newActiveStatements.All(a => a != null));
960Debug.Assert(!newActiveStatementSpans.IsDefault);
961Debug.Assert(oldActiveStatements.Length == newActiveStatements.Count);
962Debug.Assert(oldActiveStatements.Length == newExceptionRegions.Count);
1126Debug.Assert(!newActiveStatementSpans.IsDefault);
1127Debug.Assert(newActiveStatementSpans.IsEmpty || oldActiveStatements.Length == newActiveStatementSpans.Length);
1128Debug.Assert(oldActiveStatements.IsEmpty || oldActiveStatements.Length == newActiveStatements.Count);
1129Debug.Assert(newActiveStatements.Count == newExceptionRegions.Count);
1130Debug.Assert(oldMemberBody != null || newMemberBody != null);
1172Debug.Assert(oldDeclaration != null);
1178Debug.Assert(IsDeclarationWithSharedBody(oldDeclaration, oldMember));
1192Debug.Assert(oldMemberBody != null);
1319Debug.Assert(oldMemberBody != null);
1320Debug.Assert(oldDeclaration != null);
1342Debug.Assert(lazyActiveOrMatchedLambdas != null);
1358Debug.Assert(!enclosingBodyMap.Forward.IsEmpty());
1402Debug.Assert(oldEnclosingLambdaBody != null);
1403Debug.Assert(lazyActiveOrMatchedLambdas != null);
1448Debug.Assert(newSpan != default);
1458Debug.Assert(IsDeclarationWithSharedBody(oldDeclaration, oldMember));
1569Debug.Assert(oldAncestors.Count == newAncestors.Count);
1760Debug.Assert(node != null);
1878Debug.Assert(hasAncestor && newAncestor != null);
1892Debug.Assert(hasAncestor && newAncestor != null);
2247Debug.Assert(editMap[newNode] is EditKind.Update or EditKind.Insert);
2309Debug.Assert(currentSegment.path != null);
2310Debug.Assert(lastOldStartLine >= 0);
2487Debug.Assert(previousOldEndLine >= 0);
2716Debug.Assert(inBreakState || newActiveStatementSpans.IsEmpty);
2742Debug.Assert(edit.OldNode is null || edit.NewNode is null || IsNamespaceDeclaration(edit.OldNode) == IsNamespaceDeclaration(edit.NewNode));
2754Debug.Assert(oldSymbol is INamedTypeSymbol);
2755Debug.Assert(newSymbol is INamedTypeSymbol);
2772Debug.Assert(newTypeDeclaration != null);
2971Debug.Assert(oldSymbol is INamedTypeSymbol);
3261Debug.Assert(newDeclaration != null);
3262Debug.Assert(oldProperty.ContainingType.IsRecord);
3263Debug.Assert(newProperty.ContainingType.IsRecord);
3267Debug.Assert(synthesizedProperty.IsSynthesizedAutoProperty());
3268Debug.Assert(synthesizedProperty.SetMethod != null);
3340Debug.Assert(newSymbol != null);
3564Debug.Assert(IsConstructorWithMemberInitializers(oldSymbol, cancellationToken) == IsConstructorWithMemberInitializers(newSymbol, cancellationToken));
3565Debug.Assert(IsDeclarationWithInitializer(oldDeclaration) == IsDeclarationWithInitializer(newDeclaration));
3735Debug.Assert(oldSymbol != null);
3736Debug.Assert(newSymbol != null);
3759Debug.Assert(member is IPropertySymbol or IMethodSymbol);
4272Debug.Assert(oldBody == null || oldDeclaration != null && oldMemberBody != null);
4273Debug.Assert(newBody == null || newDeclaration != null && newMemberBody != null);
4458Debug.Assert(ReturnTypesEquivalent(oldField, newField, exact: false));
4480Debug.Assert(oldImportData.BestFitMapping == newImportData.BestFitMapping ||
4535Debug.Assert(ReturnTypesEquivalent(oldMethod, newMethod, exact: false));
4559Debug.Assert(ReturnTypesEquivalent(oldType.DelegateInvokeMethod, newType.DelegateInvokeMethod, exact: false));
4569Debug.Assert(ReturnTypesEquivalent(oldProperty, newProperty, exact: false));
4583Debug.Assert(ReturnTypesEquivalent(oldEvent, newEvent, exact: false));
4700Debug.Assert(ParameterTypesEquivalent(oldMember.GetParameters(), newMember.GetParameters(), exact: true));
5099Debug.Assert(recordType.IsRecord);
5113Debug.Assert(record.IsRecord);
5200Debug.Assert(oldSymbol != null);
5347Debug.Assert(newSymbol != null);
5532Debug.Assert(oldBody != null);
5533Debug.Assert(newBody != null);
5667Debug.Assert(oldCtor == null || MemberOrDelegateSignaturesEquivalent(oldCtor, newCtor, exact: false));
5674Debug.Assert(newCtor.Parameters.IsEmpty);
5872Debug.Assert(IsNestedFunction(newLambda) == IsNestedFunction(oldLambda));
6446Debug.Assert(!parameter.IsThis);
6490Debug.Assert(parameterKey.Syntax != null);
6611Debug.Assert(oldCapture.Kind == newCapture.Kind);
6685Debug.Assert(IsNestedFunction(newLambda));
6686Debug.Assert(IsNestedFunction(oldLambda));
6746Debug.Assert(local.Kind is not SymbolKind.RangeVariable);
6758Debug.Assert(node != null);
6830Debug.Assert(rootNodes.Count == otherRootNodes.Count);
6846Debug.Assert(otherNode.SyntaxTree == otherRoot.SyntaxTree);
6847Debug.Assert(otherRoot.FullSpan.Contains(otherNode.SpanStart));
6850Debug.Assert(otherNode.FullSpan.Length > 0);
6859Debug.Assert(otherNode.RawKind == rightNode.RawKind);
6863Debug.Assert(!leftChild.IsToken);
6908Debug.Assert(!self.FullSpan.Contains(position), "Position is valid. How could we not find a child?");
Microsoft.CodeAnalysis.NetAnalyzers (561)
Microsoft.CodeQuality.Analyzers\ApiDesignGuidelines\EnumShouldNotHaveDuplicatedValues.cs (1)
83Debug.Assert(added);
src\9382845807600969\AnalysisEntityMapAbstractDomain.cs (16)
98Debug.Assert(!map2.ContainsKey(key1));
99Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
163Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
164Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
184Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
185Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
193Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
205Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
212Debug.Assert(!map1.ContainsKey(newKey));
213Debug.Assert(!map2.ContainsKey(newKey));
225Debug.Assert(Compare(map1, resultMap) <= 0);
226Debug.Assert(Compare(map2, resultMap) <= 0);
246Debug.Assert(values.Count > 0);
258Debug.Assert(ValueDomain.Compare(value1, mergedValue) <= 0);
259Debug.Assert(ValueDomain.Compare(value2, mergedValue) <= 0);
266Debug.Assert(isNewKey == (!map1.ContainsKey(key) && !map2.ContainsKey(key)));
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\Compiler\WellKnownTypeProvider.cs (1)
94Debug.Assert(result
src\sdk\src\Microsoft.CodeAnalysis.NetAnalyzers\src\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (103)
174Debug.Assert(!_currentAnalysisData.IsDisposed);
179Debug.Assert(!value.IsDisposed);
188Debug.Assert(_currentBasicBlock != null);
231Debug.Assert(ExceptionNamedType != null);
427Debug.Assert(_pendingArgumentsToReset.Count == 0);
428Debug.Assert(_pendingArgumentsToPostProcess.Count == 0);
548Debug.Assert(entryBlock.Kind == BasicBlockKind.Entry);
561Debug.Assert(result);
581Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit);
631Debug.Assert(localFunction.MethodKind == MethodKind.LocalFunction);
632Debug.Assert(DataFlowAnalysisContext.ControlFlowGraph.LocalFunctions.Contains(localFunction));
640Debug.Assert(_visitedLambdas.Contains(lambda));
648Debug.Assert(exitBlock.Kind == BasicBlockKind.Exit);
742Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None);
785Debug.Assert(branch.ControlFlowConditionKind != ControlFlowConditionKind.None);
820Debug.Assert(implicitTaskPointsToValueOpt.Kind == PointsToAbstractValueKind.KnownLocations);
849Debug.Assert(ExecutingExceptionPathsAnalysisPostPass);
850Debug.Assert(!SkipExceptionPathsAnalysisPostPass);
929Debug.Assert(ExecutingExceptionPathsAnalysisPostPass);
930Debug.Assert(!SkipExceptionPathsAnalysisPostPass);
959Debug.Assert(locals.Any() || flowCaptures.Any());
1001/// Checks if the method is an overload of the <see cref="Debug.Assert(bool)"/> method.
1004/// <returns>True if the method is an overlaod of the <see cref="Debug.Assert(bool)"/> method.</returns>
1138Debug.Assert(parameterEntity.Symbol?.Kind == SymbolKind.Parameter);
1151Debug.Assert(CurrentBasicBlock.Kind == BasicBlockKind.Entry);
1299Debug.Fail($"Unexpected 'null' target type for '{operation.Syntax}'");
1355Debug.Assert(PredicateAnalysis);
1361Debug.Assert(PredicateAnalysis);
1385Debug.Assert(PredicateAnalysis);
1386Debug.Assert(operation.Kind is OperationKind.BinaryOperator or
1421Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData");
1433Debug.Assert(result);
1436Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity));
1450Debug.Assert(!ReferenceEquals(truePredicatedData, CurrentAnalysisData));
1455Debug.Assert(!ReferenceEquals(falsePredicatedData, CurrentAnalysisData));
1459Debug.Assert(Equals(savedCurrentAnalysisData, CurrentAnalysisData), "Expected no updates to CurrentAnalysisData");
1488Debug.Assert(IsContractCheckArgument((IArgumentOperation)operation));
1526Debug.Assert(targetEntity.CaptureId != null);
1543Debug.Assert(PredicateAnalysis);
1544Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None);
1638Debug.Fail($"Unknown pattern kind '{isPatternOperation.Pattern.Kind}'");
1667Debug.Assert(IsContractCheckArgument(argument));
1681Debug.Assert(result);
1824Debug.Assert(PredicateAnalysis);
1849Debug.Assert(PredicateAnalysis);
1850Debug.Assert(operation.IsComparisonOperator());
1851Debug.Assert(FlowBranchConditionKind != ControlFlowConditionKind.None);
1893Debug.Assert(PredicateAnalysis);
1899Debug.Assert(PredicateAnalysis);
1905Debug.Assert(PredicateAnalysis);
1911Debug.Assert(PredicateAnalysis);
1920Debug.Assert(PredicateAnalysis);
1926Debug.Assert(PredicateAnalysis);
1932Debug.Assert(PredicateAnalysis);
1948Debug.Assert(IsLValueFlowCaptureReference(flowCaptureReference));
2023Debug.Assert(HasPointsToAnalysisResult);
2024Debug.Assert(operation.Type!.HasValueCopySemantics());
2042Debug.Assert(HasPointsToAnalysisResult);
2043Debug.Assert(!operation.Type!.HasValueCopySemantics());
2265Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2266Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2267Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
2330Debug.Assert(arguments.All(arg => !_pendingArgumentsToReset.Contains(arg)));
2345Debug.Assert(popped == originalOperation);
2392Debug.Assert(arguments.All(_pendingArgumentsToReset.Contains));
2482Debug.Assert(originalOperation.Kind == OperationKind.ObjectCreation);
2513Debug.Assert(arguments.Length == invokedMethod.Parameters.Length);
2555Debug.Assert(invokedMethod.Parameters.Length == method.GetParameters().Length ||
2621Debug.Assert(success);
2632Debug.Assert(IsStandaloneAnalysisRequiredForLocalFunction(localFunction));
2650Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2651Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2652Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
2682Debug.Assert(IsStandaloneAnalysisRequiredForLambda(lambda));
2700Debug.Assert(pointsToAnalysisResult?.ControlFlowGraph == null || cfg == pointsToAnalysisResult?.ControlFlowGraph);
2701Debug.Assert(copyAnalysisResult?.ControlFlowGraph == null || cfg == copyAnalysisResult?.ControlFlowGraph);
2702Debug.Assert(valueContentAnalysisResult?.ControlFlowGraph == null || cfg == valueContentAnalysisResult?.ControlFlowGraph);
2997Debug.Assert(result);
3006Debug.Assert(HasPredicatedDataForEntity(flowCaptureReferenceEntity));
3032Debug.Assert(flowCaptureEntity.CaptureId != null);
3076Debug.Assert(FlowBranchConditionKind == ControlFlowConditionKind.None);
3155Debug.Assert(operation.Initializer == null, "Object or collection initializer must have been lowered in the CFG");
3238Debug.Assert(!arguments.IsEmpty);
3257Debug.Assert(arguments.Length >= 2);
3281Debug.Assert(IsPointsToAnalysis);
3325Debug.Assert(operation != null ^ invocationTarget != null);
3336Debug.Assert(invocation.Instance == null);
3344Debug.Assert(targetMethod.MethodKind is MethodKind.LambdaMethod or
3378Debug.Assert(knownTargetInvocations);
3385Debug.Assert(knownTargetInvocations);
3392Debug.Assert(knownTargetInvocations);
3414Debug.Assert(knownTargetInvocations);
3459Debug.Assert(methodTargetsOptBuilder.Count > 0 || lambdaTargets.Count > 0);
3477Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData));
3489Debug.Assert(!ReferenceEquals(oldMergedAnalysisData, CurrentAnalysisData));
3493Debug.Assert(mergedCurrentAnalysisData == null || ReferenceEquals(mergedCurrentAnalysisData, CurrentAnalysisData));
3584Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation));
3602Debug.Assert(_interproceduralResultsBuilder.ContainsKey(originalOperation));
3679Debug.Assert(elementEntities.Length == elementValueBuilder.Count);
3680Debug.Assert(elementEntities.Length == operation.Elements.Length);
3758Debug.Assert(caughtExceptionType != null || CurrentBasicBlock.IsFirstBlockOfFinally(out _));
3791Debug.Assert(CurrentBasicBlock.IsFirstBlockOfFinally(out _));
3825Debug.Assert(operation.Kind == OperationKind.YieldReturn, "IReturnOperation must have been lowered in the CFG");
Microsoft.CodeAnalysis.Razor.Compiler (306)
Language\DocumentationDescriptor.FormattedDescriptor.cs (1)
24Debug.Assert(
Microsoft.CodeAnalysis.Rebuild (3)
Microsoft.CodeAnalysis.ResxSourceGenerator (547)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.Scripting (64)
Microsoft.CodeAnalysis.VisualBasic (1124)
Generated\BoundNodes.xml.Generated.vb (427)
225Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
233Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
301Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
313Debug.Assert(underlyingLValue IsNot Nothing, "Field 'underlyingLValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
314Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
353Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
360Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
372Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
379Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
391Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
398Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
424Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
431Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
457Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
469Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
497Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
509Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
573Debug.Assert(Not (symbols.IsDefault), "Field 'symbols' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
574Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
629Debug.Assert(Not (childBoundNodes.IsDefault), "Field 'childBoundNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
663Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
702Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
744Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
745Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
746Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
801Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
802Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
836Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
837Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
879Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
880Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
888Debug.Assert(field IsNot Nothing, "Field 'field' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
889Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
923Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
924Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
925Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
934Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
935Debug.Assert(getMethodFromHandle IsNot Nothing, "Field 'getMethodFromHandle' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
936Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
978Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1020Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1028Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1062Debug.Assert(namespaceSymbol IsNot Nothing, "Field 'namespaceSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1117Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1118Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1131Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1132Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1168Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1175Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1201Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1210Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1252Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1260Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1294Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1301Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1327Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1328Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1336Debug.Assert(document IsNot Nothing, "Field 'document' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1337Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1371Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1372Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1435Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1436Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1483Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1484Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1523Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1524Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1525Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1596Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1597Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1652Debug.Assert(bitwiseOperator IsNot Nothing, "Field 'bitwiseOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1653Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1716Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1723Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1749Debug.Assert(left IsNot Nothing, "Field 'left' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1750Debug.Assert(right IsNot Nothing, "Field 'right' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1751Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1814Debug.Assert(byRefLocal IsNot Nothing, "Field 'byRefLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1815Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1870Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1871Debug.Assert(methodGroup IsNot Nothing, "Field 'methodGroup' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1921Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1922Debug.Assert(whenTrue IsNot Nothing, "Field 'whenTrue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1923Debug.Assert(whenFalse IsNot Nothing, "Field 'whenFalse' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1924Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1987Debug.Assert(testExpression IsNot Nothing, "Field 'testExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1988Debug.Assert(elseExpression IsNot Nothing, "Field 'elseExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
1989Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2060Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2067Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2079Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2080Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2172Debug.Assert(lambda IsNot Nothing, "Field 'lambda' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2214Debug.Assert(Not (elementPlaceholders.IsDefault), "Field 'elementPlaceholders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2215Debug.Assert(Not (convertedElements.IsDefault), "Field 'convertedElements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2262Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2263Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2310Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2311Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2382Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2383Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2446Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2447Debug.Assert(targetType IsNot Nothing, "Field 'targetType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2448Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2542Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2676Debug.Assert(Not (methods.IsDefault), "Field 'methods' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2734Debug.Assert(Not (properties.IsDefault), "Field 'properties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2828Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2898Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2932Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2933Debug.Assert(Not (indices.IsDefault), "Field 'indices' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
2996Debug.Assert(Not (clauses.IsDefault), "Field 'clauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3030Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3031Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3032Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3127Debug.Assert(Not (constructorArguments.IsDefault), "Field 'constructorArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3128Debug.Assert(Not (namedArguments.IsDefault), "Field 'namedArguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3129Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3195Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3266Debug.Assert(member IsNot Nothing, "Field 'member' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3267Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3338Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3339Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3381Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3401Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3451Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3452Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3486Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3511Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3512Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3575Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3609Debug.Assert(Not (declarations.IsDefault), "Field 'declarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3610Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3660Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3669Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3711Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3712Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3754Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3782Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3821Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3852Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3883Debug.Assert(method IsNot Nothing, "Field 'method' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3884Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3950Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
3951Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4022Debug.Assert(inferredType IsNot Nothing, "Field 'inferredType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4023Debug.Assert(Not (bounds.IsDefault), "Field 'bounds' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4024Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4025Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4099Debug.Assert(Not (initializers.IsDefault), "Field 'initializers' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4133Debug.Assert(fieldSymbol IsNot Nothing, "Field 'fieldSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4134Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4205Debug.Assert(propertySymbol IsNot Nothing, "Field 'propertySymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4206Debug.Assert(Not (arguments.IsDefault), "Field 'arguments' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4207Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4302Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4303Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4345Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4346Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4396Debug.Assert(Not (fields.IsDefault), "Field 'fields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4397Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4452Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4515Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4516Debug.Assert(initializer IsNot Nothing, "Field 'initializer' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4517Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4567Debug.Assert(Not (localDeclarations.IsDefault), "Field 'localDeclarations' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4635Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4671Debug.Assert(Not (initializedFields.IsDefault), "Field 'initializedFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4672Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4706Debug.Assert(Not (initializedProperties.IsDefault), "Field 'initializedProperties' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4707Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4741Debug.Assert(parameter IsNot Nothing, "Field 'parameter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4742Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4784Debug.Assert(statement IsNot Nothing, "Field 'statement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4818Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4819Debug.Assert(Not (sideEffects.IsDefault), "Field 'sideEffects' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4820Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4875Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4909Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4910Debug.Assert(consequence IsNot Nothing, "Field 'consequence' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4960Debug.Assert(expressionStatement IsNot Nothing, "Field 'expressionStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4961Debug.Assert(Not (caseBlocks.IsDefault), "Field 'caseBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
4962Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5028Debug.Assert(caseStatement IsNot Nothing, "Field 'caseStatement' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5029Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5071Debug.Assert(Not (caseClauses.IsDefault), "Field 'caseClauses' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5275Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5276Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5285Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5286Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5314Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5315Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5316Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5382Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5383Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5384Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5385Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5427Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5428Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5429Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5430Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5474Debug.Assert(leftOperandPlaceholder IsNot Nothing, "Field 'leftOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5475Debug.Assert(rightOperandPlaceholder IsNot Nothing, "Field 'rightOperandPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5476Debug.Assert(addition IsNot Nothing, "Field 'addition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5477Debug.Assert(subtraction IsNot Nothing, "Field 'subtraction' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5478Debug.Assert(lessThanOrEqual IsNot Nothing, "Field 'lessThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5479Debug.Assert(greaterThanOrEqual IsNot Nothing, "Field 'greaterThanOrEqual' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5558Debug.Assert(initialValue IsNot Nothing, "Field 'initialValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5559Debug.Assert(limitValue IsNot Nothing, "Field 'limitValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5560Debug.Assert(stepValue IsNot Nothing, "Field 'stepValue' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5561Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5562Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5563Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5564Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5630Debug.Assert(collection IsNot Nothing, "Field 'collection' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5631Debug.Assert(enumeratorInfo IsNot Nothing, "Field 'enumeratorInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5632Debug.Assert(controlVariable IsNot Nothing, "Field 'controlVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5633Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5634Debug.Assert(continueLabel IsNot Nothing, "Field 'continueLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5635Debug.Assert(exitLabel IsNot Nothing, "Field 'exitLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5677Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5685Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5719Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5727Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5761Debug.Assert(tryBlock IsNot Nothing, "Field 'tryBlock' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5762Debug.Assert(Not (catchBlocks.IsDefault), "Field 'catchBlocks' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5820Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5894Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5907Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5943Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5950Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5976Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
5988Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6016Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6023Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6049Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6056Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6082Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6083Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6091Debug.Assert(sourceType IsNot Nothing, "Field 'sourceType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6092Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6126Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6133Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6159Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6160Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6174Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6175Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6219Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6220Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6221Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6236Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6237Debug.Assert(emitExpressions IsNot Nothing, "Field 'emitExpressions' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6238Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6290Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6291Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6301Debug.Assert(parameterSymbol IsNot Nothing, "Field 'parameterSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6302Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6352Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6360Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6394Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6395Debug.Assert(inConversion IsNot Nothing, "Field 'inConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6396Debug.Assert(inPlaceholder IsNot Nothing, "Field 'inPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6397Debug.Assert(outConversion IsNot Nothing, "Field 'outConversion' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6398Debug.Assert(outPlaceholder IsNot Nothing, "Field 'outPlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6469Debug.Assert(originalArgument IsNot Nothing, "Field 'originalArgument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6470Debug.Assert(localSymbol IsNot Nothing, "Field 'localSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6517Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6525Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6559Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6567Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6601Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6643Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6677Debug.Assert(condition IsNot Nothing, "Field 'condition' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6678Debug.Assert(label IsNot Nothing, "Field 'label' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6728Debug.Assert(originalExpression IsNot Nothing, "Field 'originalExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6729Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6730Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6780Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6781Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6782Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6799Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6800Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6801Debug.Assert(bindingCache IsNot Nothing, "Field 'bindingCache' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6869Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6870Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6949Debug.Assert(lastOperator IsNot Nothing, "Field 'lastOperator' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6950Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6984Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
6991Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7003Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7004Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7038Debug.Assert(conversionCall IsNot Nothing, "Field 'conversionCall' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7039Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7073Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7074Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7075Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7076Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7086Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7087Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7088Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7089Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7125Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7126Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7127Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7128Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7129Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7176Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7177Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7178Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7179Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7180Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7214Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7215Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7249Debug.Assert(lambdaSymbol IsNot Nothing, "Field 'lambdaSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7250Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7251Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7309Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7310Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7311Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7353Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7354Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7355Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7365Debug.Assert(binder IsNot Nothing, "Field 'binder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7366Debug.Assert(Not (parameters.IsDefault), "Field 'parameters' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7367Debug.Assert(compilation IsNot Nothing, "Field 'compilation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7417Debug.Assert(underlyingExpression IsNot Nothing, "Field 'underlyingExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7418Debug.Assert(Not (rangeVariables.IsDefault), "Field 'rangeVariables' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7419Debug.Assert(compoundVariableType IsNot Nothing, "Field 'compoundVariableType' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7420Debug.Assert(Not (binders.IsDefault), "Field 'binders' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7421Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7471Debug.Assert(group IsNot Nothing, "Field 'group' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7472Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7506Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7507Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7515Debug.Assert(rangeVariable IsNot Nothing, "Field 'rangeVariable' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7516Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7550Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7551Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7579Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7580Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7606Debug.Assert(eventAccess IsNot Nothing, "Field 'eventAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7607Debug.Assert(handler IsNot Nothing, "Field 'handler' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7633Debug.Assert(eventSymbol IsNot Nothing, "Field 'eventSymbol' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7634Debug.Assert(eventInvocation IsNot Nothing, "Field 'eventInvocation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7676Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7677Debug.Assert(usingInfo IsNot Nothing, "Field 'usingInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7678Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7744Debug.Assert(lockExpression IsNot Nothing, "Field 'lockExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7745Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7787Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7788Debug.Assert(localName IsNot Nothing, "Field 'localName' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7789Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7790Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7840Debug.Assert(xmlNamespace IsNot Nothing, "Field 'xmlNamespace' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7841Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7842Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7884Debug.Assert(declaration IsNot Nothing, "Field 'declaration' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7885Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7886Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7887Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7937Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7938Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7996Debug.Assert(target IsNot Nothing, "Field 'target' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7997Debug.Assert(data IsNot Nothing, "Field 'data' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7998Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
7999Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8049Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8050Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8051Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8093Debug.Assert(name IsNot Nothing, "Field 'name' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8094Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8095Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8096Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8159Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8160Debug.Assert(Not (childNodes.IsDefault), "Field 'childNodes' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8161Debug.Assert(rewriterInfo IsNot Nothing, "Field 'rewriterInfo' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8162Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8212Debug.Assert(memberAccess IsNot Nothing, "Field 'memberAccess' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8213Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8247Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8248Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8282Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8283Debug.Assert(objectCreation IsNot Nothing, "Field 'objectCreation' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8284Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8430Debug.Assert(body IsNot Nothing, "Field 'body' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8501Debug.Assert(activeHandlerLocal IsNot Nothing, "Field 'activeHandlerLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8502Debug.Assert(resumeTargetLocal IsNot Nothing, "Field 'resumeTargetLocal' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8503Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8550Debug.Assert(value IsNot Nothing, "Field 'value' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8551Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8598Debug.Assert(resumeTargetTemporary IsNot Nothing, "Field 'resumeTargetTemporary' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8599Debug.Assert(resumeLabel IsNot Nothing, "Field 'resumeLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8600Debug.Assert(resumeNextLabel IsNot Nothing, "Field 'resumeNextLabel' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8601Debug.Assert(Not (jumps.IsDefault), "Field 'jumps' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8664Debug.Assert(operand IsNot Nothing, "Field 'operand' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8665Debug.Assert(awaitableInstancePlaceholder IsNot Nothing, "Field 'awaitableInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8666Debug.Assert(getAwaiter IsNot Nothing, "Field 'getAwaiter' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8667Debug.Assert(awaiterInstancePlaceholder IsNot Nothing, "Field 'awaiterInstancePlaceholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8668Debug.Assert(isCompleted IsNot Nothing, "Field 'isCompleted' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8669Debug.Assert(getResult IsNot Nothing, "Field 'getResult' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8670Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8749Debug.Assert(Not (locals.IsDefault), "Field 'locals' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8750Debug.Assert(Not (spillFields.IsDefault), "Field 'spillFields' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8751Debug.Assert(Not (statements.IsDefault), "Field 'statements' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8850Debug.Assert(original IsNot Nothing, "Field 'original' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8851Debug.Assert(start IsNot Nothing, "Field 'start' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8852Debug.Assert(source IsNot Nothing, "Field 'source' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8853Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8916Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8917Debug.Assert(placeholder IsNot Nothing, "Field 'placeholder' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8918Debug.Assert(accessExpression IsNot Nothing, "Field 'accessExpression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8968Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
8982Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9026Debug.Assert(receiver IsNot Nothing, "Field 'receiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9027Debug.Assert(whenNotNull IsNot Nothing, "Field 'whenNotNull' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9028Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9099Debug.Assert(valueTypeReceiver IsNot Nothing, "Field 'valueTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9100Debug.Assert(referenceTypeReceiver IsNot Nothing, "Field 'referenceTypeReceiver' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9101Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9148Debug.Assert(argument IsNot Nothing, "Field 'argument' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9149Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9196Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9197Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9236Debug.Assert(Not (contents.IsDefault), "Field 'contents' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9237Debug.Assert(type IsNot Nothing, "Field 'type' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
9284Debug.Assert(expression IsNot Nothing, "Field 'expression' cannot be null (use Null=""allow"" in BoundNodes.xml to remove this check)")
Lowering\ExpressionLambdaRewriter\ExpressionLambdaRewriter.vb (31)
137Debug.Assert(block.Statements(0).Kind <> BoundKind.SequencePoint)
138Debug.Assert(block.Statements.Length = 1 OrElse
147Debug.Assert(block.Locals.IsEmpty OrElse
176Debug.Assert(False)
308Debug.Assert(saveRecursionDepth = _recursionDepth)
331Debug.Assert(Not p.IsByRef, "DiagnosticsPass should have reported an error")
351Debug.Assert(Not node.LambdaSymbol.IsAsync AndAlso Not node.LambdaSymbol.IsIterator,
353Debug.Assert(node.WasCompilerGenerated OrElse node.IsSingleLine,
406Debug.Assert(origReceiverOpt IsNot Nothing OrElse fieldIsShared)
412Debug.Assert(origReceiverOpt IsNot Nothing)
433Debug.Assert(origReceiverOpt IsNot Nothing OrElse propertyIsShared)
439Debug.Assert(origReceiverOpt IsNot Nothing)
440Debug.Assert(origReceiverOpt.Kind <> BoundKind.MyBaseReference AndAlso origReceiverOpt.Kind <> BoundKind.MyClassReference)
456Debug.Assert(node.RelaxationLambdaOpt Is Nothing)
457Debug.Assert(node.RelaxationReceiverPlaceholderOpt Is Nothing)
458Debug.Assert(node.MethodGroupOpt Is Nothing)
461Debug.Assert(delegateType.TypeKind = TYPEKIND.Delegate)
532Debug.Assert(arg.Type Is Me.Int32Type)
543Debug.Assert(expressions(i).Type Is Me.Int32Type)
585Debug.Assert(initializer.CreateTemporaryLocalForInitialization,
593Debug.Assert(initializers(i).Kind = BoundKind.AssignmentOperator)
596Debug.Assert(assignment.LeftOnTheRightOpt Is Nothing)
605Debug.Assert(DirectCast(assignment.Left, BoundPropertyAccess).AccessKind = PropertyAccessKind.Set)
611Debug.Assert(leftSymbol IsNot Nothing)
615Debug.Assert(initializer.PlaceholderOpt IsNot Nothing)
616Debug.Assert(Not BoundNodeFinder.ContainsNode(right, initializer.PlaceholderOpt, _recursionDepth, convertInsufficientExecutionStackExceptionToCancelledByStackGuardException:=True), "Should be addressed in DiagnosticsPass")
617Debug.Assert(leftSymbol.Kind = SymbolKind.Field OrElse leftSymbol.Kind = SymbolKind.Property)
642Debug.Assert(initializers(i).Kind = BoundKind.Call)
683Debug.Assert(properties.Length = node.Arguments.Length)
739Debug.Assert(arrayType.IsSZArray, "Not SZArray should be addressed in DiagnosticsPass")
790Debug.Assert(type.IsValueType)
Semantics\TypeInference\TypeInferenceCollection.vb (16)
190Debug.Assert(numberOfStrictCandidates = 0, "code logic error: since every strict candidate is also an unstrict candidate.")
197Debug.Assert(numberOfUnstrictCandidates > 1, "code logic error: we should already have covered this case")
205Debug.Assert(resultList.Count() = numberOfUnstrictCandidates, "code logic error: we should have >1 unstrict candidates, like we calculated earlier")
211Debug.Assert(numberOfStrictCandidates > 1, "code logic error: we should have >1 widening candidates; all other possibilities have already been covered")
251Debug.Assert(False, "How can a typeless hint be a candidate?")
326Debug.Assert(rank <> -1) ' Can we get different ranks at all? If we can, we should investigate if we can do something better than just give up.
393Debug.Assert(False, "unexpected: how can there be multiple strict candidates and no widest ones??? please tell lwischik if you find such a case.")
401Debug.Assert(resultList.Count > 0, "code logic error: we already said there were multiple strict candidates")
425Debug.Assert(RequiredConversion.Count = 8, "If you've updated the type argument inference restrictions, then please also update CheckHintSatisfaction()")
493Debug.Assert(Conversions.IsWideningConversion(inConversion) AndAlso Conversions.IsWideningConversion(outConversion) AndAlso
536Debug.Assert(False, "code logic error: inferenceRestrictions; we should have dealt with all of them already")
549Debug.Assert(False, "code logic error: ConversionClass; we should have dealt with them already")
564Debug.Assert(type IsNot Nothing)
567Debug.Assert(Not type.IsVoidType(), "Please do not put Void types into the dominant type algorithm. That doesn't make sense.")
594Debug.Assert(Not foundInList, "List is supposed to be unique: how can we already find two of the same type in this list.")
630Debug.Assert(names1.Length = names2.Length)
Microsoft.CodeAnalysis.Workspaces (753)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Microsoft.CodeAnalysis.Workspaces.MSBuild (13)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (30)
Microsoft.CodeAnalysis.Workspaces.MSBuild.Contracts (3)
Microsoft.CSharp (912)
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\Constant.cs (1)
40Debug.Assert(
Microsoft\CSharp\RuntimeBinder\Semantics\Tree\MemberGroup.cs (1)
14Debug.Assert(
Microsoft.Data.Analysis (59)
TextFieldParser.cs (25)
439Debug.Fail("The TextFieldType is not supported");
627Debug.Assert(_buffer != null, "There's no buffer");
628Debug.Assert(_reader != null, "There's no StreamReader");
631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default");
643Debug.Assert(_buffer != null, "There's no buffer");
644Debug.Assert(_reader != null, "There's no StreamReader");
645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range");
662Debug.Assert(_buffer != null, "There's no buffer");
663Debug.Assert(_reader != null, "There's no StreamReader");
675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for");
712Debug.Assert(_buffer != null, "There's no buffer");
713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range");
878Debug.Assert(_fieldWidths != null, "No field widths");
910Debug.Assert(line != null, "We are parsing null");
912Debug.Assert(length > 0, "A blank line shouldn't be parsed");
915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed");
934Debug.Assert(line != null, "No Line sent");
960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input");
972Debug.Assert(widths != null, "There are no field widths");
1011Debug.Fail("Delimiter element is empty. This should have been caught on input");
1036Debug.Fail("Unknown TextFieldType");
1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing");
1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing");
1119Debug.Fail("Unknown TextFieldType");
1142Debug.Assert(_delimiters != null, "No delimiters set!");
Microsoft.Data.Analysis.Tests (27)
src\Microsoft.Data.Analysis\TextFieldParser.cs (25)
439Debug.Fail("The TextFieldType is not supported");
627Debug.Assert(_buffer != null, "There's no buffer");
628Debug.Assert(_reader != null, "There's no StreamReader");
631Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default");
643Debug.Assert(_buffer != null, "There's no buffer");
644Debug.Assert(_reader != null, "There's no StreamReader");
645Debug.Assert((_position >= 0) && (_position <= _buffer.Length), "The cursor is out of range");
662Debug.Assert(_buffer != null, "There's no buffer");
663Debug.Assert(_reader != null, "There's no StreamReader");
675Debug.Assert(_charsRead <= bufferSize, "We've read more chars than we have space for");
712Debug.Assert(_buffer != null, "There's no buffer");
713Debug.Assert((cursor >= 0) && (cursor <= _charsRead), "The cursor is out of range");
878Debug.Assert(_fieldWidths != null, "No field widths");
910Debug.Assert(line != null, "We are parsing null");
912Debug.Assert(length > 0, "A blank line shouldn't be parsed");
915Debug.Assert(!line[0].Equals('\r') && !line[0].Equals('\n'), "A blank line shouldn't be parsed");
934Debug.Assert(line != null, "No Line sent");
960Debug.Assert(_fieldWidths[i] > 0, "Bad field width, this should have been caught on input");
972Debug.Assert(widths != null, "There are no field widths");
1011Debug.Fail("Delimiter element is empty. This should have been caught on input");
1036Debug.Fail("Unknown TextFieldType");
1080Debug.Assert(((_delimitersCopy == null) && (_delimiters == null)) || ((_delimitersCopy != null) && (_delimiters != null)), "Delimiters and copy are not both Nothing or both not Nothing");
1100Debug.Assert(((_fieldWidthsCopy == null) && (_fieldWidths == null)) || ((_fieldWidthsCopy != null) && (_fieldWidths != null)), "FieldWidths and copy are not both Nothing or both not Nothing");
1119Debug.Fail("Unknown TextFieldType");
1142Debug.Assert(_delimiters != null, "No delimiters set!");
Microsoft.Diagnostics.DataContractReader (3)
Microsoft.Diagnostics.DataContractReader.Abstractions (7)
Microsoft.Diagnostics.DataContractReader.Contracts (196)
Contracts\StackWalk\Context\X86\X86Unwinder.cs (35)
102Debug.Assert(gcInfo.IsInEpilog);
103Debug.Assert(gcInfo.EpilogOffset > 0);
137Debug.Assert(gcInfo.RawStackSize != 0);
247Debug.Assert(gcInfo.IsInEpilog);
248Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign);
249Debug.Assert(gcInfo.EpilogOffset > 0);
268Debug.Assert(gcInfo.RawStackSize == _target.PointerSize);
301Debug.Assert(
313Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign);
314Debug.Assert(!gcInfo.IsInEpilog);
353Debug.Assert(gcInfo.IsInProlog);
354Debug.Assert(!gcInfo.Header.EbpFrame && !gcInfo.Header.DoubleAlign);
435Debug.Assert(gcInfo.Header.EbpFrame || gcInfo.Header.DoubleAlign);
516Debug.Assert(gcInfo.IsInProlog);
517Debug.Assert(gcInfo.Header.EbpFrame || gcInfo.Header.DoubleAlign);
536Debug.Assert(CheckInstrByte(ReadByteAt(methodStart + offset), X86_INSTR_PUSH_EBP) ||
629Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xFD), 0x81, ReadByteAt(baseAddress + offset)));
630Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset + 1) & 0xC0), 0xC0, ReadByteAt(baseAddress + offset + 1)));
633Debug.Assert(((ReadByteAt(baseAddress + offset) & 2) != 0 == CAN_COMPRESS(val)) || IsMarkerInstr(ReadByteAt(baseAddress + offset)));
643Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xF8), 0x58, ReadByteAt(baseAddress + offset)));
651Debug.Assert(CheckInstrBytePattern((byte)(ReadByteAt(baseAddress + offset) & 0xF8), 0x50, ReadByteAt(baseAddress + offset)));
660Debug.Assert(
679Debug.Assert(
689Debug.Assert(size != 0);
715Debug.Assert(size < 0x3000);
723Debug.Assert(CheckInstrWord(ReadShortAt(baseAddress + offset), X86_INSTR_w_TEST_ESP_DWORD_OFFSET_EAX));
748Debug.Assert(size >= 0x3000);
813Debug.Assert(CheckInstrWord(_target.Read<ushort>(baseAddress + offset), X86_INSTR_w_TEST_ESP_EAX));
827Debug.Assert(val == _target.Read<sbyte>(baseAddress + offset + 3));
828Debug.Assert(CAN_COMPRESS(val));
832Debug.Assert(CheckInstrWord(wOpcode, X86_INSTR_w_LEA_EAX_ESP_DWORD_OFFSET));
833Debug.Assert(val == _target.Read<int>(baseAddress + offset + 3));
834Debug.Assert(!CAN_COMPRESS(val));
851Debug.Assert(CheckInstrWord(_target.Read<ushort>(baseAddress + offset), X86_INSTR_W_CALL_IND_IMM));
913Debug.Assert((valPattern & val) == valPattern);
Microsoft.Diagnostics.DataContractReader.DataGenerator (2)
Microsoft.Diagnostics.DataContractReader.Legacy (1279)
ClrDataAppDomain.cs (8)
76Debug.ValidateHResult(hr, hrLocal);
80Debug.Assert(*nameLen == nameLenLocal, $"cDAC: {*nameLen}, DAC: {nameLenLocal}");
91Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
121Debug.ValidateHResult(hr, hrLocal);
122Debug.Assert(*id == idLocal, $"cDAC: {*id}, DAC: {idLocal}");
150Debug.ValidateHResult(hr, hrLocal);
151Debug.Assert(*flags == flagsLocal, $"cDAC: {*flags}, DAC: {flagsLocal}");
178Debug.Assert(hrLocal == hr, $"cDAC: {hr}, DAC: {hrLocal}");
ClrDataExceptionState.cs (13)
61Debug.ValidateHResult(hr, hrLocal);
63Debug.Assert(*flags == legacyFlags, $"cDAC flags: {*flags:x}, DAC flags: {legacyFlags:x}");
111Debug.ValidateHResult(hr, hrLocal);
172Debug.ValidateHResult(hr, hrLocal);
231Debug.ValidateHResult(hr, hrLocal);
234Debug.Assert(strLen == null || *strLen == legacyStrLen);
236Debug.Assert(str == null || cmpLen <= 0 || new ReadOnlySpan<char>(strLocal, 0, cmpLen).SequenceEqual(new ReadOnlySpan<char>(str, cmpLen)));
263Debug.ValidateHResult(hr, hrLocal);
266Debug.Assert(outBufferSize == sizeof(uint) && outBuffer is not null);
269Debug.Assert(revision == legacyRevision);
284Debug.ValidateHResult(hr, hrLocal);
297Debug.ValidateHResult(hr, hrLocal);
375Debug.ValidateHResult(hr, hrLocal);
ClrDataFrame.cs (10)
77Debug.ValidateHResult(hr, hrLocal);
86Debug.Assert(contextStruct.Equals(localContextStruct));
131Debug.ValidateHResult(hr, hrLegacy);
163Debug.ValidateHResult(hr, hrLocal);
165Debug.Assert(*numArgs == numArgsLocal, $"cDAC: {*numArgs}, DAC: {numArgsLocal}");
261Debug.ValidateHResult(hr, hrLegacy, HResultValidationMode.AllowCdacSuccess);
285Debug.ValidateHResult(hr, hrLocal);
287Debug.Assert(*numLocals == numLocalsLocal, $"cDAC: {*numLocals}, DAC: {numLocalsLocal}");
352Debug.ValidateHResult(hr, hrLegacy, HResultValidationMode.AllowCdacSuccess);
394Debug.ValidateHResult(hr, hrLocal);
ClrDataMethodDefinition.cs (20)
201Debug.ValidateHResult(hr, hrLocal);
261Debug.ValidateHResult(hr, hrLocal);
352Debug.ValidateHResult(hr, hrLocal);
356Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}");
362Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
410Debug.ValidateHResult(hr, hrLocal);
414Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}");
466Debug.ValidateHResult(hr, hrLocal);
522Debug.ValidateHResult(hr, hrLocal);
525Debug.Assert(extent->startAddress == extentLocal.startAddress, $"StartAddress - cDAC: {extent->startAddress:x}, DAC: {extentLocal.startAddress:x}");
526Debug.Assert(extent->endAddress == extentLocal.endAddress, $"EndAddress - cDAC: {extent->endAddress:x}, DAC: {extentLocal.endAddress:x}");
527Debug.Assert(extent->enCVersion == extentLocal.enCVersion, $"EnCVersion - cDAC: {extent->enCVersion:x}, DAC: {extentLocal.enCVersion:x}");
528Debug.Assert(extent->type == extentLocal.type, $"Type - cDAC: {extent->type:x}, DAC: {extentLocal.type:x}");
562Debug.ValidateHResult(hr, hrLocal);
651Debug.ValidateHResult(hr, hrLocal);
653Debug.Assert(*(uint*)outBuffer == revisionLocal);
684Debug.ValidateHResult(hr, hrLocal);
687Debug.Assert(*addr == addrLocal, $"cDAC: {*addr:x}, DAC: {addrLocal:x}");
723Debug.ValidateHResult(hr, hrLocal);
726Debug.Assert(bGenericLocal == *bGeneric, $"cDAC: {*bGeneric}, DAC: {bGenericLocal}");
ClrDataMethodInstance.cs (28)
78Debug.ValidateHResult(hr, hrLocal);
129Debug.ValidateHResult(hr, hrLocal);
133Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}");
203Debug.ValidateHResult(hr, hrLocal);
205Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}");
211Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
302Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess);
308Debug.Assert(localOffsetsNeeded == *offsetsNeeded, $"cDAC: {*offsetsNeeded:x}, DAC: {localOffsetsNeeded:x}");
315Debug.Assert(localIlOffsets[i] == ilOffsets[i], $"cDAC: {localIlOffsets[i]:x}, DAC: {ilOffsets[i]:x}");
398Debug.ValidateHResult(hr, hrLocal);
404Debug.Assert(rangesNeededLocal == *rangesNeeded, $"cDAC: {*rangesNeeded:x}, DAC: {rangesNeededLocal:x}");
412Debug.Assert(addressRangesLocal[i].startAddress == addressRanges[i].startAddress, $"StartAddress - cDAC: {addressRanges[i].startAddress:x}, DAC: {addressRangesLocal[i].startAddress:x}");
413Debug.Assert(addressRangesLocal[i].endAddress == addressRanges[i].endAddress, $"EndAddress - cDAC: {addressRanges[i].endAddress:x}, DAC: {addressRangesLocal[i].endAddress:x}");
490Debug.ValidateHResult(hr, hrLocal);
494Debug.Assert(mapNeeded == null || *mapNeeded == mapNeededLocal);
500Debug.Assert(mapsLocal[i].ilOffset == maps![i].ilOffset, $"ILOffset - cDAC: {maps[i].ilOffset:x}, DAC: {mapsLocal[i].ilOffset:x}");
501Debug.Assert(mapsLocal[i].startAddress == maps[i].startAddress, $"StartAddress - cDAC: {maps[i].startAddress:x}, DAC: {mapsLocal[i].startAddress:x}");
502Debug.Assert(mapsLocal[i].endAddress == maps[i].endAddress, $"EndAddress - cDAC: {maps[i].endAddress:x}, DAC: {mapsLocal[i].endAddress:x}");
503Debug.Assert(mapsLocal[i].type == maps[i].type, $"Type - cDAC: {maps[i].type:x}, DAC: {mapsLocal[i].type:x}");
573Debug.ValidateHResult(hr, hrLocal);
629Debug.ValidateHResult(hr, hrLocal);
632Debug.Assert(extent->startAddress == extentLocal.startAddress, $"StartAddress - cDAC: {extent->startAddress:x}, DAC: {extentLocal.startAddress:x}");
633Debug.Assert(extent->endAddress == extentLocal.endAddress, $"EndAddress - cDAC: {extent->endAddress:x}, DAC: {extentLocal.endAddress:x}");
667Debug.ValidateHResult(hr, hrLocal);
708Debug.ValidateHResult(hr, hrLocal);
710Debug.Assert(*(uint*)outBuffer == revisionLocal);
747Debug.ValidateHResult(hr, hrLocal);
748Debug.Assert(addrLocal == *addr, $"cDAC: {*addr:x}, DAC: {addrLocal:x}");
ClrDataModule.cs (20)
315Debug.ValidateHResult(hr, hrLocal);
372Debug.ValidateHResult(hr, hrLocal);
439Debug.ValidateHResult(hr, hrLocal);
487Debug.ValidateHResult(hr, hrLocal);
490Debug.Assert(nameLen == null || *nameLen == nameLenLocal);
491Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)nameLenLocal - 1).SequenceEqual(new string(name)));
538Debug.Assert(hrLocal == HResults.S_OK);
539Debug.Assert(nameLen == null || *nameLen == nameLenLocal);
540Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)nameLenLocal - 1).SequenceEqual(new string(name)));
575Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}");
576Debug.Assert(flagsLocal == *flags, $"cDAC: {*flags}, DAC: {flagsLocal}");
628Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}");
671Debug.Assert(hr == hrLocal, $"cDAC: {hr}, DAC: {hrLocal}");
675Debug.Assert(dataModuleExtent->baseAddress == dataModuleExtentLocal.baseAddress, $"cDAC: {dataModuleExtent->baseAddress}, DAC: {dataModuleExtentLocal.baseAddress}");
676Debug.Assert(dataModuleExtent->length == dataModuleExtentLocal.length, $"cDAC: {dataModuleExtent->length}, DAC: {dataModuleExtentLocal.length}");
677Debug.Assert(dataModuleExtent->type == dataModuleExtentLocal.type, $"cDAC: {dataModuleExtent->type}, DAC: {dataModuleExtentLocal.type}");
690Debug.Assert(hrLocal == HResults.S_OK, $"cDAC: {HResults.S_OK}, DAC: {hrLocal}");
741Debug.ValidateHResult(hr, hrLocal);
743Debug.Assert(new ReadOnlySpan<byte>(outBuffer, (int)outBufferSize).SequenceEqual(localBuffer));
836Debug.ValidateHResult(hr, hrLocal);
ClrDataStackWalk.cs (11)
112Debug.ValidateHResult(hr, hrLocal);
121Debug.Assert(contextStruct.Equals(localContextStruct));
198Debug.ValidateHResult(hr, hrLocal);
202Debug.Assert(*simpleType == simpleTypeLocal, $"cDAC: {*simpleType:x}, DAC: {simpleTypeLocal:x}");
204Debug.Assert(*detailedType == detailedTypeLocal, $"cDAC: {*detailedType:x}, DAC: {detailedTypeLocal:x}");
228Debug.ValidateHResult(hr, hrLocal);
231Debug.Assert(*stackSizeSkipped == stackSizeSkippedLocal, $"cDAC: {*stackSizeSkipped:x}, DAC: {stackSizeSkippedLocal:x}");
259Debug.ValidateHResult(hr, hrLocal);
313Debug.ValidateHResult(hr, hrLocal);
315Debug.Assert(new ReadOnlySpan<byte>(outBuffer, (int)outBufferSize).SequenceEqual(localOutBuffer));
342Debug.ValidateHResult(hr, hrLocal);
ClrDataTypeDefinition.cs (7)
113Debug.ValidateHResult(hr, hrLocal);
117Debug.Assert(nameLenLocal == *nameLen, $"cDAC: {*nameLen:x}, DAC: {nameLenLocal:x}");
123Debug.Assert(dacName == cdacName, $"cDAC: {cdacName}, DAC: {dacName}");
168Debug.ValidateHResult(hr, hrLocal);
170Debug.Assert(tokenLocal == *token, $"cDAC: {*token:x}, DAC: {tokenLocal:x}");
201Debug.ValidateHResult(hr, hrLocal);
203Debug.Assert(typeLocal == *type, $"cDAC: {*type:x}, DAC: {typeLocal:x}");
ClrDataValue.cs (36)
89Debug.ValidateHResult(hr, hrLocal);
91Debug.Assert(*flags == flagsLocal, $"GetFlags cDAC: 0x{*flags:X}, DAC: 0x{flagsLocal:X}");
121Debug.ValidateHResult(hr, hrLocal);
123Debug.Assert((ulong)*address == (ulong)addressLocal, $"GetAddress cDAC: 0x{(ulong)*address:X}, DAC: 0x{(ulong)addressLocal:X}");
153Debug.ValidateHResult(hr, hrLocal);
155Debug.Assert(*size == sizeLocal, $"GetSize cDAC: {*size}, DAC: {sizeLocal}");
213Debug.ValidateHResult(hr, hrLocal);
217Debug.Assert(*dataSize == legacyDataSize, $"GetBytes dataSize cDAC: {*dataSize}, DAC: {legacyDataSize}");
221Debug.Assert(buffer[i] == legacyBuf[i], $"GetBytes mismatch at byte {i}: cDAC: 0x{buffer[i]:X2}, DAC: 0x{legacyBuf[i]:X2}");
267Debug.ValidateHResult(hr, hrLocal);
318Debug.ValidateHResult(hr, hrLocal);
320Debug.Assert(*(uint*)outBuffer == revisionLocal);
348Debug.ValidateHResult(hr, hrLocal);
350Debug.Assert(*numFields == numFieldsLocal, $"GetNumFields2 cDAC: {*numFields}, DAC: {numFieldsLocal}");
430Debug.ValidateHResult(hr, hrLocal);
475Debug.ValidateHResult(hr, hrLocal);
507Debug.ValidateHResult(hr, hrLocal);
509Debug.Assert(*strLen == strLenLocal, $"GetString length cDAC: {*strLen}, DAC: {strLenLocal}");
513Debug.Assert(new string(str) == new string(strLocalPtr));
556Debug.ValidateHResult(hr, hrLocal);
559Debug.Assert(rank is null || *rank == rankLocal);
560Debug.Assert(totalElements is null || *totalElements == totalElementsLocal);
561Debug.Assert(dims.AsSpan().SequenceEqual(dimsLocal));
562Debug.Assert(bases.AsSpan().SequenceEqual(basesLocal));
629Debug.ValidateHResult(hr, hrLocal);
705Debug.ValidateHResult(hr, hrLocal);
776Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess);
779Debug.Assert(token is null || *token == tokenLocal);
780Debug.Assert(nameLen is null || *nameLen == nameLenLocal);
781Debug.Assert(nameBuf is null || new ReadOnlySpan<char>(nameBuf, checked((int)nameLenLocal)).SequenceEqual(nameBufLocal.AsSpan(0, checked((int)nameLenLocal))));
821Debug.ValidateHResult(hr, hrLocal);
1074Debug.ValidateHResult(hr, hrLocal);
1076Debug.Assert(*numLocs == numLocsLocal, $"GetNumLocations cDAC: {*numLocs}, DAC: {numLocsLocal}");
1109Debug.ValidateHResult(hr, hrLocal);
1112Debug.Assert(*flags == flagsLocal, $"GetLocationByIndex[{loc}] flags cDAC: {*flags}, DAC: {flagsLocal}");
1118Debug.WriteLine($"GetLocationByIndex[{loc}] addr divergence - cDAC: 0x{(ulong)*arg:X}, DAC: 0x{(ulong)argLocal:X}");
Dbi\DacDbiImpl.cs (382)
121Debug.ValidateHResult(hr, hrLocal);
123Debug.Assert(*pResult == resultLocal);
147Debug.ValidateHResult(hr, hrLocal);
149Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
171Debug.ValidateHResult(hr, hrLocal);
197Debug.ValidateHResult(hr, hrLocal);
200Debug.Assert(
237Debug.ValidateHResult(hr, hrLocal);
239Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
317Debug.ValidateHResult(hr, hrLocal);
320Debug.Assert(pTargetRefInfo->vmAssembly == targetLocal.vmAssembly, $"cDAC: {pTargetRefInfo->vmAssembly:x}, DAC: {targetLocal.vmAssembly:x}");
321Debug.Assert(pTargetRefInfo->typeToken == targetLocal.typeToken, $"cDAC: {pTargetRefInfo->typeToken:x}, DAC: {targetLocal.typeToken:x}");
367Debug.ValidateHResult(hr, hrLocal);
369Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
408Debug.ValidateHResult(hr, hrLocal);
411Debug.Assert(pTargetBuffer->pAddress == pTargetBufferLocal.pAddress, $"pAddress: cDAC: {pTargetBuffer->pAddress:x}, DAC: {pTargetBufferLocal.pAddress:x}");
412Debug.Assert(pTargetBuffer->cbSize == pTargetBufferLocal.cbSize, $"cbSize: cDAC: {pTargetBuffer->cbSize}, DAC: {pTargetBufferLocal.cbSize}");
445Debug.ValidateHResult(hr, hrLocal);
448Debug.Assert(*pSize == sizeLocal, $"cDAC size: {*pSize}, DAC size: {sizeLocal}");
489Debug.ValidateHResult(hr, hrLocal);
492Debug.Assert(new Span<byte>(pBuffer, blobLength).SequenceEqual(bufferLocal.AsSpan(0, blobLength)), "cDAC and DAC read-write metadata buffers differ.");
536Debug.ValidateHResult(hr, hrLocal);
539Debug.Assert(pTargetBuffer->pAddress == bufferLocal.pAddress, $"pAddress: cDAC: {pTargetBuffer->pAddress:x}, DAC: {bufferLocal.pAddress:x}");
540Debug.Assert(pTargetBuffer->cbSize == bufferLocal.cbSize, $"cbSize: cDAC: {pTargetBuffer->cbSize}, DAC: {bufferLocal.cbSize}");
541Debug.Assert(*pSymbolFormat == formatLocal, $"pSymbolFormat: cDAC: {*pSymbolFormat}, DAC: {formatLocal}");
584Debug.ValidateHResult(hr, hrLocal);
587Debug.Assert(pData->vmAssembly == dataLocal.vmAssembly, $"vmAssembly: cDAC: {pData->vmAssembly:x}, DAC: {dataLocal.vmAssembly:x}");
588Debug.Assert(pData->vmPEAssembly == dataLocal.vmPEAssembly, $"vmPEAssembly: cDAC: {pData->vmPEAssembly:x}, DAC: {dataLocal.vmPEAssembly:x}");
589Debug.Assert(pData->fIsDynamic == dataLocal.fIsDynamic, $"fIsDynamic: cDAC: {pData->fIsDynamic}, DAC: {dataLocal.fIsDynamic}");
590Debug.Assert(pData->fInMemory == dataLocal.fInMemory, $"fInMemory: cDAC: {pData->fInMemory}, DAC: {dataLocal.fInMemory}");
591Debug.Assert(pData->pPEBaseAddress == dataLocal.pPEBaseAddress, $"pPEBaseAddress: cDAC: {pData->pPEBaseAddress:x}, DAC: {dataLocal.pPEBaseAddress:x}");
592Debug.Assert(pData->nPESize == dataLocal.nPESize, $"nPESize: cDAC: {pData->nPESize}, DAC: {dataLocal.nPESize}");
628Debug.ValidateHResult(hr, hrLocal);
631Debug.Assert(*pModule == moduleLocal, $"cDAC: {*pModule:x}, DAC: {moduleLocal:x}");
633Debug.Assert(*pIsModuleLoaded == isModuleLoadedLocal, $"cDAC: {*pIsModuleLoaded}, DAC: {isModuleLoadedLocal}");
663Debug.ValidateHResult(hr, hrLocal);
666Debug.Assert(*pIsManaged == isManagedLocal, $"cDAC: {*pIsManaged}, DAC: {isManagedLocal}");
700Debug.ValidateHResult(hr, hrLocal);
703Debug.Assert(*pfAllowJITOpts == allowJITOptsLocal, $"cDAC: {*pfAllowJITOpts}, DAC: {allowJITOptsLocal}");
704Debug.Assert(*pfEnableEnC == enableEnCLocal, $"cDAC: {*pfEnableEnC}, DAC: {enableEnCLocal}");
752Debug.ValidateHResult(hr, hrLocal);
800Debug.ValidateHResult(hr, hrLocal);
803Debug.Assert(
834Debug.ValidateHResult(hr, hrLocal);
855Debug.ValidateHResult(hr, hrLocal);
885Debug.ValidateHResult(hr, hrLocal);
916Debug.ValidateHResult(hr, hrLocal);
1025Debug.ValidateHResult(hr, hrLocal);
1028Debug.Assert(
1064Debug.ValidateHResult(hr, hrLocal);
1066Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
1089Debug.ValidateHResult(hr, hrLocal);
1091Debug.Assert(*pRetVal == retValLocal, $"cDAC: {(nuint)(*pRetVal):x}, DAC: {(nuint)retValLocal:x}");
1118Debug.ValidateHResult(hr, hrLocal);
1120Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
1149Debug.ValidateHResult(hr, hrLocal);
1152Debug.Assert(pThreadAllocInfo->allocBytesSOH == allocInfoLocal.allocBytesSOH, $"cDAC: {pThreadAllocInfo->allocBytesSOH}, DAC: {allocInfoLocal.allocBytesSOH}");
1153Debug.Assert(pThreadAllocInfo->allocBytesUOH == allocInfoLocal.allocBytesUOH, $"cDAC: {pThreadAllocInfo->allocBytesUOH}, DAC: {allocInfoLocal.allocBytesUOH}");
1188Debug.ValidateHResult(hr, hrLocal);
1212Debug.ValidateHResult(hr, hrLocal);
1214Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
1253Debug.ValidateHResult(hr, hrLocal);
1255Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1298Debug.ValidateHResult(hr, hrLocal);
1300Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1315Debug.ValidateHResult(hr, hrLocal);
1317Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1332Debug.ValidateHResult(hr, hrLocal);
1334Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1361Debug.ValidateHResult(hr, hrLocal);
1363Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1387Debug.ValidateHResult(hr, hrLocal);
1389Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1420Debug.ValidateHResult(hr, hrLocal);
1422Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
1469Debug.ValidateHResult(hr, hrLocal);
1471Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
1495Debug.ValidateHResult(hr, hrLocal);
1497Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
1521Debug.ValidateHResult(hr, hrLocal);
1523Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
1557Debug.ValidateHResult(hr, hrLocal);
1559Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
1582Debug.Assert(vmMethodDesc != 0, $"vmMethodDesc is null");
1583Debug.Assert(fCodeAvailable != 0, $"fCodeAvailable is false");
1680Debug.ValidateHResult(hr, hrLocal);
1682Debug.Assert(*pRetVal == pRetValLocal, $"cDAC: {*pRetVal:x}, DAC: {pRetValLocal:x}");
1766Debug.ValidateHResult(hr, hrLocal);
1774Debug.Fail(DescribeContextDiff(cdacBytes, legacyBytes));
1815Debug.ValidateHResult(hr, hrLocal);
1859Debug.ValidateHResult(hr, hrLocal);
1865Debug.Fail(DescribeContextDiff(cdacBytes, legacyBytes));
1903Debug.ValidateHResult(hr, hrLocal);
1949Debug.ValidateHResult(hr, hrLocal);
1953Debug.Assert(*pResult == localResult, $"cDAC: {*pResult}, DAC: {localResult}");
1986Debug.ValidateHResult(hr, hrLocal);
2072Debug.ValidateHResult(hr, hrLocal);
2075Debug.Assert(ftResult == legacyRetVal, $"FrameType mismatch - cDAC: {ftResult}, DAC: {legacyRetVal}");
2079Debug.Assert(pcdac->fp == legacyData.fp, $"fp mismatch - cDAC: 0x{pcdac->fp:x}, DAC: 0x{legacyData.fp:x}");
2080Debug.Assert(pcdac->vmCurrentAppDomainToken == legacyData.vmCurrentAppDomainToken, $"appDomain mismatch - cDAC: 0x{pcdac->vmCurrentAppDomainToken:x}, DAC: 0x{legacyData.vmCurrentAppDomainToken:x}");
2081Debug.Assert(pcdac->eType == legacyData.eType, $"eType mismatch - cDAC: {pcdac->eType}, DAC: {legacyData.eType}");
2088Debug.Fail(DescribeContextDiff(cctx, lctx));
2095Debug.Assert(cv.mapping == lv.mapping, $"mapping mismatch - cDAC: {cv.mapping}, DAC: {lv.mapping}");
2096Debug.Assert(cv.fVarArgs == lv.fVarArgs, $"fVarArgs mismatch - cDAC: {cv.fVarArgs}, DAC: {lv.fVarArgs}");
2097Debug.Assert(cv.fNoMetadata == lv.fNoMetadata, $"fNoMetadata mismatch - cDAC: {cv.fNoMetadata}, DAC: {lv.fNoMetadata}");
2098Debug.Assert(cv.taAmbientESP == lv.taAmbientESP, $"taAmbientESP mismatch - cDAC: 0x{cv.taAmbientESP:x}, DAC: 0x{lv.taAmbientESP:x}");
2099Debug.Assert(cv.exactGenericArgsToken == lv.exactGenericArgsToken, $"exactGenericArgsToken mismatch - cDAC: 0x{cv.exactGenericArgsToken:x}, DAC: 0x{lv.exactGenericArgsToken:x}");
2100Debug.Assert(cv.dwExactGenericArgsTokenIndex == lv.dwExactGenericArgsTokenIndex, $"dwExactGenericArgsTokenIndex mismatch - cDAC: 0x{cv.dwExactGenericArgsTokenIndex:x}, DAC: 0x{lv.dwExactGenericArgsTokenIndex:x}");
2101Debug.Assert(cv.funcData.funcMetadataToken == lv.funcData.funcMetadataToken, $"funcMetadataToken mismatch - cDAC: 0x{cv.funcData.funcMetadataToken:x}, DAC: 0x{lv.funcData.funcMetadataToken:x}");
2102Debug.Assert(cv.funcData.vmAssembly == lv.funcData.vmAssembly, $"vmAssembly mismatch - cDAC: 0x{cv.funcData.vmAssembly:x}, DAC: 0x{lv.funcData.vmAssembly:x}");
2103Debug.Assert(cv.jitFuncData.nativeStartAddressPtr == lv.jitFuncData.nativeStartAddressPtr, $"nativeStartAddressPtr mismatch - cDAC: 0x{cv.jitFuncData.nativeStartAddressPtr:x}, DAC: 0x{lv.jitFuncData.nativeStartAddressPtr:x}");
2104Debug.Assert(cv.jitFuncData.nativeOffset == lv.jitFuncData.nativeOffset, $"nativeOffset mismatch - cDAC: 0x{cv.jitFuncData.nativeOffset:x}, DAC: 0x{lv.jitFuncData.nativeOffset:x}");
2105Debug.Assert(cv.jitFuncData.vmNativeCodeMethodDescToken == lv.jitFuncData.vmNativeCodeMethodDescToken, $"vmNativeCodeMethodDescToken mismatch - cDAC: 0x{cv.jitFuncData.vmNativeCodeMethodDescToken:x}, DAC: 0x{lv.jitFuncData.vmNativeCodeMethodDescToken:x}");
2106Debug.Assert(cv.jitFuncData.fIsFilterFrame == lv.jitFuncData.fIsFilterFrame, $"fIsFilterFrame mismatch - cDAC: {cv.jitFuncData.fIsFilterFrame}, DAC: {lv.jitFuncData.fIsFilterFrame}");
2107Debug.Assert(cv.jitFuncData.isInstantiatedGeneric == lv.jitFuncData.isInstantiatedGeneric, $"isInstantiatedGeneric mismatch - cDAC: {cv.jitFuncData.isInstantiatedGeneric}, DAC: {lv.jitFuncData.isInstantiatedGeneric}");
2108Debug.Assert(cv.jitFuncData.fpParentOrSelf == lv.jitFuncData.fpParentOrSelf, $"fpParentOrSelf mismatch - cDAC: 0x{cv.jitFuncData.fpParentOrSelf:x}, DAC: 0x{lv.jitFuncData.fpParentOrSelf:x}");
2109Debug.Assert(cv.jitFuncData.parentNativeOffset == lv.jitFuncData.parentNativeOffset, $"parentNativeOffset mismatch - cDAC: 0x{cv.jitFuncData.parentNativeOffset:x}, DAC: 0x{lv.jitFuncData.parentNativeOffset:x}");
2111Debug.Assert(cv.jitFuncData.justAfterILThrow == lv.jitFuncData.justAfterILThrow, $"justAfterILThrow mismatch - cDAC: {cv.jitFuncData.justAfterILThrow}, DAC: {lv.jitFuncData.justAfterILThrow}");
2306Debug.ValidateHResult(hr, hrLocal);
2308Debug.Assert(*pRetVal == dacCount, $"Internal frame count mismatch - cDAC: {*pRetVal}, DAC: {dacCount}");
2374Debug.ValidateHResult(hr, hrLocal);
2377Debug.Assert(cdacFrames!.Count == dacFrames.Count, $"Internal frame count mismatch - cDAC: {cdacFrames!.Count}, DAC: {dacFrames.Count}");
2383Debug.Assert(c.fp == d.fp, $"Frame[{i}] fp mismatch - cDAC: 0x{c.fp:x}, DAC: 0x{d.fp:x}");
2384Debug.Assert(c.vmCurrentAppDomainToken == d.vmCurrentAppDomainToken, $"Frame[{i}] vmCurrentAppDomainToken mismatch - cDAC: 0x{c.vmCurrentAppDomainToken:x}, DAC: 0x{d.vmCurrentAppDomainToken:x}");
2385Debug.Assert(c.eType == d.eType, $"Frame[{i}] eType mismatch - cDAC: {c.eType}, DAC: {d.eType}");
2386Debug.Assert(c.stubFrame.funcMetadataToken == d.stubFrame.funcMetadataToken, $"Frame[{i}] funcMetadataToken mismatch - cDAC: 0x{c.stubFrame.funcMetadataToken:x}, DAC: 0x{d.stubFrame.funcMetadataToken:x}");
2387Debug.Assert(c.stubFrame.vmAssembly == d.stubFrame.vmAssembly, $"Frame[{i}] vmAssembly mismatch - cDAC: 0x{c.stubFrame.vmAssembly:x}, DAC: 0x{d.stubFrame.vmAssembly:x}");
2388Debug.Assert(c.stubFrame.vmMethodDesc == d.stubFrame.vmMethodDesc, $"Frame[{i}] vmMethodDesc mismatch - cDAC: 0x{c.stubFrame.vmMethodDesc:x}, DAC: 0x{d.stubFrame.vmMethodDesc:x}");
2389Debug.Assert(c.stubFrame.frameType == d.stubFrame.frameType, $"Frame[{i}] frameType mismatch - cDAC: {c.stubFrame.frameType}, DAC: {d.stubFrame.frameType}");
2479Debug.ValidateHResult(hr, hrLocal);
2481Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
2529Debug.ValidateHResult(hr, hrLocal);
2531Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
2560Debug.ValidateHResult(hr, hrLocal);
2569Debug.Assert(contextStruct.Equals(localContextStruct));
2603Debug.ValidateHResult(hr, hrLocal);
2605Debug.Assert(*pRetVal == resultLocal, $"cDAC: {*pRetVal}, DAC: {resultLocal}");
2635Debug.ValidateHResult(hr, hrLocal);
2638Debug.Assert(*pArgBase == argBaseLocal, $"cDAC argBase: 0x{*pArgBase:X}, DAC argBase: 0x{argBaseLocal:X}");
2639Debug.Assert(pRetVal->pAddress == retValLocal.pAddress, $"cDAC sigAddr: 0x{pRetVal->pAddress:X}, DAC sigAddr: 0x{retValLocal.pAddress:X}");
2640Debug.Assert(pRetVal->cbSize == retValLocal.cbSize, $"cDAC sigLen: {pRetVal->cbSize}, DAC sigLen: {retValLocal.cbSize}");
2675Debug.ValidateHResult(hr, hrLocal);
2677Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
2714Debug.Fail($"Unexpected generics type token index: {dwExactGenericArgsTokenIndex}");
2727Debug.ValidateHResult(hr, hrLocal);
2729Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
2795Debug.ValidateHResult(hr, hrLocal);
2798Debug.Assert(pTargetBuffer->pAddress == bufferLocal.pAddress, $"cDAC ILAddr: 0x{pTargetBuffer->pAddress:X}, DAC ILAddr: 0x{bufferLocal.pAddress:X}");
2799Debug.Assert(pTargetBuffer->cbSize == bufferLocal.cbSize, $"cDAC ILSize: {pTargetBuffer->cbSize}, DAC ILSize: {bufferLocal.cbSize}");
2800Debug.Assert(*pLocalSigToken == sigLocal, $"cDAC LocalSig: 0x{*pLocalSigToken:X}, DAC LocalSig: 0x{sigLocal:X}");
2864Debug.ValidateHResult(hr, hrLocal);
2950Debug.ValidateHResult(hr, hrLocal);
2955Debug.Assert(*pVmModule == vmModuleLocal, $"cDAC: 0x{*pVmModule:X}, DAC: 0x{vmModuleLocal:X}");
2957Debug.Assert(*pFunctionToken == functionTokenLocal, $"cDAC: 0x{*pFunctionToken:X}, DAC: 0x{functionTokenLocal:X}");
2982Debug.Assert(codeInfo.hotRegion.pAddress == codeInfoLocal.hotRegion.pAddress, $"cDAC: 0x{codeInfo.hotRegion.pAddress:X}, DAC: 0x{codeInfoLocal.hotRegion.pAddress:X}");
2983Debug.Assert(codeInfo.hotRegion.cbSize == codeInfoLocal.hotRegion.cbSize, $"cDAC: {codeInfo.hotRegion.cbSize}, DAC: {codeInfoLocal.hotRegion.cbSize}");
2984Debug.Assert(codeInfo.coldRegion.pAddress == codeInfoLocal.coldRegion.pAddress, $"cDAC: 0x{codeInfo.coldRegion.pAddress:X}, DAC: 0x{codeInfoLocal.coldRegion.pAddress:X}");
2985Debug.Assert(codeInfo.coldRegion.cbSize == codeInfoLocal.coldRegion.cbSize, $"cDAC: {codeInfo.coldRegion.cbSize}, DAC: {codeInfoLocal.coldRegion.cbSize}");
2986Debug.Assert(codeInfo.isInstantiatedGeneric == codeInfoLocal.isInstantiatedGeneric, $"cDAC: {codeInfo.isInstantiatedGeneric}, DAC: {codeInfoLocal.isInstantiatedGeneric}");
2987Debug.Assert(codeInfo.vmNativeCodeMethodDescToken == codeInfoLocal.vmNativeCodeMethodDescToken, $"cDAC: 0x{codeInfo.vmNativeCodeMethodDescToken:X}, DAC: 0x{codeInfoLocal.vmNativeCodeMethodDescToken:X}");
2988Debug.Assert(codeInfo.encVersion == codeInfoLocal.encVersion, $"cDAC: {codeInfo.encVersion}, DAC: {codeInfoLocal.encVersion}");
3011Debug.ValidateHResult(hr, hrLocal);
3013Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
3038Debug.ValidateHResult(hr, hrLocal);
3040Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
3289Debug.ValidateHResult(hr, hrLocal);
3292Debug.Assert(cdacObjectSize == dacObjectSize, $"{label} object size mismatch - cDAC: {cdacObjectSize}, DAC: {dacObjectSize}");
3299Debug.Assert(cdacFields!.Count == dacFields.Count, $"{label} field count mismatch - cDAC: {cdacFields!.Count}, DAC: {dacFields.Count}");
3305Debug.Assert(c.m_fldMetadataToken == d.m_fldMetadataToken, $"{label} field[{i}] m_fldMetadataToken mismatch - cDAC: 0x{c.m_fldMetadataToken:x}, DAC: 0x{d.m_fldMetadataToken:x}");
3306Debug.Assert(c.m_fFldStorageAvailable == d.m_fFldStorageAvailable, $"{label} field[{i}] m_fFldStorageAvailable mismatch - cDAC: {c.m_fFldStorageAvailable}, DAC: {d.m_fFldStorageAvailable}");
3307Debug.Assert(c.m_fFldIsStatic == d.m_fFldIsStatic, $"{label} field[{i}] m_fFldIsStatic mismatch - cDAC: {c.m_fFldIsStatic}, DAC: {d.m_fFldIsStatic}");
3308Debug.Assert(c.m_fFldIsRVA == d.m_fFldIsRVA, $"{label} field[{i}] m_fFldIsRVA mismatch - cDAC: {c.m_fFldIsRVA}, DAC: {d.m_fFldIsRVA}");
3309Debug.Assert(c.m_fFldIsTLS == d.m_fFldIsTLS, $"{label} field[{i}] m_fFldIsTLS mismatch - cDAC: {c.m_fFldIsTLS}, DAC: {d.m_fFldIsTLS}");
3310Debug.Assert(c.m_fFldIsPrimitive == d.m_fFldIsPrimitive, $"{label} field[{i}] m_fFldIsPrimitive mismatch - cDAC: {c.m_fFldIsPrimitive}, DAC: {d.m_fFldIsPrimitive}");
3311Debug.Assert(c.m_fFldIsCollectibleStatic == d.m_fFldIsCollectibleStatic, $"{label} field[{i}] m_fFldIsCollectibleStatic mismatch - cDAC: {c.m_fFldIsCollectibleStatic}, DAC: {d.m_fFldIsCollectibleStatic}");
3312Debug.Assert(c.m_fldInstanceOffset == d.m_fldInstanceOffset, $"{label} field[{i}] m_fldInstanceOffset mismatch - cDAC: 0x{c.m_fldInstanceOffset:x}, DAC: 0x{d.m_fldInstanceOffset:x}");
3313Debug.Assert(c.m_pFldStaticAddress == d.m_pFldStaticAddress, $"{label} field[{i}] m_pFldStaticAddress mismatch - cDAC: 0x{c.m_pFldStaticAddress:x}, DAC: 0x{d.m_pFldStaticAddress:x}");
3314Debug.Assert(c.m_vmFieldDesc == d.m_vmFieldDesc, $"{label} field[{i}] m_vmFieldDesc mismatch - cDAC: 0x{c.m_vmFieldDesc:x}, DAC: 0x{d.m_vmFieldDesc:x}");
3337Debug.ValidateHResult(hr, hrLocal);
3366Debug.ValidateHResult(hr, hrLocal);
3379Debug.Assert(cdac->elementType == dac->elementType,
3385Debug.Assert(cdac->ClassTypeData_metadataToken == dac->ClassTypeData_metadataToken,
3387Debug.Assert(cdac->ClassTypeData_vmAssembly == dac->ClassTypeData_vmAssembly,
3389Debug.Assert(cdac->ClassTypeData_typeHandle == dac->ClassTypeData_typeHandle,
3394Debug.Assert(cdac->ArrayTypeData_arrayRank == dac->ArrayTypeData_arrayRank,
3396Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.elementType == dac->ArrayTypeData_arrayTypeArg.elementType,
3398Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.metadataToken == dac->ArrayTypeData_arrayTypeArg.metadataToken,
3400Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.vmAssembly == dac->ArrayTypeData_arrayTypeArg.vmAssembly,
3402Debug.Assert(cdac->ArrayTypeData_arrayTypeArg.vmTypeHandle == dac->ArrayTypeData_arrayTypeArg.vmTypeHandle,
3407Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.elementType == dac->UnaryTypeData_unaryTypeArg.elementType,
3409Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.metadataToken == dac->UnaryTypeData_unaryTypeArg.metadataToken,
3411Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.vmAssembly == dac->UnaryTypeData_unaryTypeArg.vmAssembly,
3413Debug.Assert(cdac->UnaryTypeData_unaryTypeArg.vmTypeHandle == dac->UnaryTypeData_unaryTypeArg.vmTypeHandle,
3417Debug.Assert(cdac->NaryTypeData_typeHandle == dac->NaryTypeData_typeHandle,
3456Debug.ValidateHResult(hr, hrLocal);
3458Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
3494Debug.ValidateHResult(hr, hrLocal);
3496Debug.Assert(*pRetVal == vmLocal, $"cDAC: {*pRetVal:x}, DAC: {vmLocal:x}");
3548Debug.ValidateHResult(hr, hrLocal);
3550Debug.Assert(*pVmTypeHandle == vmLocal, $"cDAC: {*pVmTypeHandle:x}, DAC: {vmLocal:x}");
3771Debug.ValidateHResult(hr, hrLocal);
3774Debug.Assert(cClassParams == cClassParamsLocal,
3780Debug.Assert(entries.Count == legacyEntries.Count,
3786Debug.Assert(entries[i].Equals(legacyEntries[i]),
3824Debug.ValidateHResult(hr, hrLocal);
3826Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
3851Debug.ValidateHResult(hr, hrLocal);
3853Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal}, DAC: {retValLocal}");
3927Debug.ValidateHResult(hr, hrLocal);
3930Debug.Assert(pFieldData->m_fldMetadataToken == fieldDataLocal.m_fldMetadataToken,
3932Debug.Assert(pFieldData->m_fFldStorageAvailable == fieldDataLocal.m_fFldStorageAvailable,
3934Debug.Assert(pFieldData->m_fFldIsStatic == fieldDataLocal.m_fFldIsStatic,
3936Debug.Assert(pFieldData->m_fFldIsRVA == fieldDataLocal.m_fFldIsRVA,
3938Debug.Assert(pFieldData->m_fFldIsTLS == fieldDataLocal.m_fFldIsTLS,
3940Debug.Assert(pFieldData->m_fFldIsPrimitive == fieldDataLocal.m_fFldIsPrimitive,
3942Debug.Assert(pFieldData->m_fFldIsCollectibleStatic == fieldDataLocal.m_fFldIsCollectibleStatic,
3944Debug.Assert(pFieldData->m_vmFieldDesc == fieldDataLocal.m_vmFieldDesc,
3947Debug.Assert(pFieldData->m_pFldStaticAddress == fieldDataLocal.m_pFldStaticAddress,
3950Debug.Assert(pFieldData->m_fldInstanceOffset == fieldDataLocal.m_fldInstanceOffset,
4025Debug.ValidateHResult(hr, hrLocal);
4031Debug.Assert(entries.Count == legacyEntries.Count,
4037Debug.Assert(entries[i].Equals(legacyEntries[i]),
4072Debug.Assert(pVmModule != null);
4080Debug.Assert(pMetadataToken != null);
4099Debug.ValidateHResult(hr, hrLocal);
4102Debug.Assert(*pMetadataToken == metadataTokenLocal, $"cDAC: {*pMetadataToken}, DAC: {metadataTokenLocal}");
4103Debug.Assert(*pVmModule == vmModuleLocal, $"cDAC: {*pVmModule}, DAC: {vmModuleLocal}");
4142Debug.ValidateHResult(hr, hrLocal);
4144Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
4199Debug.ValidateHResult(hr, hrLocal);
4205Debug.Assert(frames.SequenceEqual(legacyFrames),
4235Debug.ValidateHResult(hr, hrLocal);
4237Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
4292Debug.ValidateHResult(hr, hrLocal);
4297Debug.Assert(itfPtrs.SequenceEqual(legacyItfPtrs),
4330Debug.ValidateHResult(hr, hrLocal);
4331Debug.Assert(*pObjRef == objRefLocal, $"cDAC objRef: 0x{*pObjRef:x}, DAC: 0x{objRefLocal:x}");
4334Debug.Assert(pTypedByRefType->elementType == typeLocal.elementType,
4336Debug.Assert(pTypedByRefType->metadataToken == typeLocal.metadataToken,
4338Debug.Assert(pTypedByRefType->vmAssembly == typeLocal.vmAssembly,
4371Debug.ValidateHResult(hr, hrLocal);
4374Debug.Assert(*pLength == lengthLocal, $"cDAC length: {*pLength}, DAC: {lengthLocal}");
4375Debug.Assert(*pOffsetToStringBase == offsetLocal, $"cDAC offsetToStringBase: {*pOffsetToStringBase}, DAC: {offsetLocal}");
4425Debug.ValidateHResult(hr, hrLocal);
4428Debug.Assert(*pIsValidArray == isValidLocal, $"cDAC isValidArray: {*pIsValidArray}, DAC: {isValidLocal}");
4431Debug.Assert(pArrayInfo->rank == arrayInfoLocal.rank, $"cDAC rank: {pArrayInfo->rank}, DAC: {arrayInfoLocal.rank}");
4432Debug.Assert(pArrayInfo->componentCount == arrayInfoLocal.componentCount, $"cDAC componentCount: {pArrayInfo->componentCount}, DAC: {arrayInfoLocal.componentCount}");
4433Debug.Assert(pArrayInfo->offsetToArrayBase == arrayInfoLocal.offsetToArrayBase, $"cDAC offsetToArrayBase: {pArrayInfo->offsetToArrayBase}, DAC: {arrayInfoLocal.offsetToArrayBase}");
4434Debug.Assert(pArrayInfo->offsetToUpperBounds == arrayInfoLocal.offsetToUpperBounds, $"cDAC offsetToUpperBounds: {pArrayInfo->offsetToUpperBounds}, DAC: {arrayInfoLocal.offsetToUpperBounds}");
4435Debug.Assert(pArrayInfo->offsetToLowerBounds == arrayInfoLocal.offsetToLowerBounds, $"cDAC offsetToLowerBounds: {pArrayInfo->offsetToLowerBounds}, DAC: {arrayInfoLocal.offsetToLowerBounds}");
4436Debug.Assert(pArrayInfo->elementSize == arrayInfoLocal.elementSize, $"cDAC elementSize: {pArrayInfo->elementSize}, DAC: {arrayInfoLocal.elementSize}");
4490Debug.ValidateHResult(hr, hrLocal);
4493Debug.Assert(*pIsValidRef == isValidLocal, $"cDAC isValidRef: {*pIsValidRef}, DAC: {isValidLocal}");
4496Debug.Assert(*pObjSize == objSizeLocal, $"cDAC objSize: {*pObjSize}, DAC: {objSizeLocal}");
4497Debug.Assert(*pObjOffsetToVars == objOffsetLocal, $"cDAC objOffsetToVars: {*pObjOffsetToVars}, DAC: {objOffsetLocal}");
4498Debug.Assert(pObjTypeData->elementType == typeDataLocal.elementType,
4524Debug.ValidateHResult(hr, hrLocal);
4526Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
4549Debug.ValidateHResult(hr, hrLocal);
4551Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
4567Debug.ValidateHResult(hr, hrLocal);
4569Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
4584Debug.ValidateHResult(hr, hrLocal);
4586Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
4610Debug.ValidateHResult(hr, hrLocal);
4612Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
4627Debug.ValidateHResult(hr, hrLocal);
4629Debug.Assert(*pRetVal == retValLocal, $"cDAC: {*pRetVal:x}, DAC: {retValLocal:x}");
4653Debug.Assert(threadPtr != TargetPointer.Null, "A thread should have been found");
4671Debug.ValidateHResult(hr, hrLocal);
4674Debug.Assert(pRetVal->lockOwner == pRetValLocal.lockOwner,
4676Debug.Assert(pRetVal->acquisitionCount == pRetValLocal.acquisitionCount,
4704Debug.ValidateHResult(hr, hrLocal);
4706Debug.Assert(*pRetVal == resultLocal);
4761Debug.ValidateHResult(hr, hrLocal);
4764Debug.Assert(*pResult == resultLocal, $"GetModuleMetaDataFileInfo result mismatch - cDAC: {*pResult}, DAC: {resultLocal}");
4767Debug.Assert(*dwTimeStamp == timeStampLocal, $"GetModuleMetaDataFileInfo timestamp mismatch - cDAC: {*dwTimeStamp}, DAC: {timeStampLocal}");
4768Debug.Assert(*dwImageSize == imageSizeLocal, $"GetModuleMetaDataFileInfo image size mismatch - cDAC: {*dwImageSize}, DAC: {imageSizeLocal}");
4769Debug.Assert(
4802Debug.ValidateHResult(hr, hrLocal);
4804Debug.Assert(*pResult == resultLocal);
4833Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowCdacSuccess);
4867Debug.ValidateHResult(hr, hrLocal);
4933Debug.ValidateHResult(hr, hrLocal);
4936Debug.Assert(*fetched == fetchedLocal,
4940Debug.Assert(objects[k].address == objectsLocal[k].address,
4942Debug.Assert(objects[k].size == objectsLocal[k].size,
4944Debug.Assert(objects[k].type.token1 == objectsLocal[k].type.token1,
5026Debug.ValidateHResult(hr, hrLocal);
5033Debug.Assert(segments.Count == legacySegments.Count,
5039Debug.Assert(segments[i] == legacySegments[i],
5106Debug.ValidateHResult(hr, hrLocal);
5109Debug.Assert(*pResult == resultLocal, $"cDAC: {*pResult}, DAC: {resultLocal}");
5139Debug.ValidateHResult(hr, hrLocal);
5173Debug.ValidateHResult(hr, hrLocal);
5228Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.AllowDivergentSuccess);
5231Debug.Assert(
5238Debug.Assert(refs[j].dwType == legacyRefs[j].dwType,
5240Debug.Assert(refs[j].vmDomain == legacyRefs[j].vmDomain,
5242Debug.Assert(refs[j].objHnd == legacyRefs[j].objHnd,
5244Debug.Assert(refs[j].i64ExtraData == legacyRefs[j].i64ExtraData,
5286Debug.ValidateHResult(hr, hrLocal);
5289Debug.Assert(pType->token1 == resultLocal.token1);
5290Debug.Assert(pType->token2 == resultLocal.token2);
5317Debug.ValidateHResult(hr, hrLocal);
5320Debug.Assert(pId->token1 == resultLocal.token1);
5321Debug.Assert(pId->token2 == resultLocal.token2);
5460Debug.ValidateHResult(hr, hrLocal);
5463Debug.Assert(*pceltFetched == fetchedLocal, $"cDAC: {*pceltFetched}, DAC: {fetchedLocal}");
5467Debug.Assert(layout[i].token == localFieldsPtr[i].token, $"field[{i}].token cDAC: {layout[i].token:x}, DAC: {localFieldsPtr[i].token:x}");
5468Debug.Assert(layout[i].offset == localFieldsPtr[i].offset, $"field[{i}].offset cDAC: {layout[i].offset}, DAC: {localFieldsPtr[i].offset}");
5469Debug.Assert(layout[i].fieldType == localFieldsPtr[i].fieldType, $"field[{i}].fieldType cDAC: {layout[i].fieldType}, DAC: {localFieldsPtr[i].fieldType}");
5470Debug.Assert(layout[i].id.token1 == localFieldsPtr[i].id.token1, $"field[{i}].id.token1 cDAC: {layout[i].id.token1:x}, DAC: {localFieldsPtr[i].id.token1:x}");
5471Debug.Assert(layout[i].id.token2 == localFieldsPtr[i].id.token2, $"field[{i}].id.token2 cDAC: {layout[i].id.token2:x}, DAC: {localFieldsPtr[i].id.token2:x}");
5522Debug.ValidateHResult(hr, hrLocal);
5525Debug.Assert(pLayout->parentID.token1 == resultLocal.parentID.token1, $"cDAC: {pLayout->parentID.token1:x}, DAC: {resultLocal.parentID.token1:x}");
5526Debug.Assert(pLayout->parentID.token2 == resultLocal.parentID.token2, $"cDAC: {pLayout->parentID.token2:x}, DAC: {resultLocal.parentID.token2:x}");
5527Debug.Assert(pLayout->objectSize == resultLocal.objectSize, $"cDAC: {pLayout->objectSize}, DAC: {resultLocal.objectSize}");
5528Debug.Assert(pLayout->numFields == resultLocal.numFields, $"cDAC: {pLayout->numFields}, DAC: {resultLocal.numFields}");
5529Debug.Assert(pLayout->boxOffset == resultLocal.boxOffset, $"cDAC: {pLayout->boxOffset}, DAC: {resultLocal.boxOffset}");
5530Debug.Assert(pLayout->type == resultLocal.type, $"cDAC: {pLayout->type}, DAC: {resultLocal.type}");
5595Debug.ValidateHResult(hr, hrLocal);
5598Debug.Assert(pLayout->componentID.token1 == resultLocal.componentID.token1, $"cDAC: {pLayout->componentID.token1:x}, DAC: {resultLocal.componentID.token1:x}");
5599Debug.Assert(pLayout->componentID.token2 == resultLocal.componentID.token2, $"cDAC: {pLayout->componentID.token2:x}, DAC: {resultLocal.componentID.token2:x}");
5600Debug.Assert(pLayout->componentType == resultLocal.componentType, $"cDAC: {pLayout->componentType}, DAC: {resultLocal.componentType}");
5601Debug.Assert(pLayout->firstElementOffset == resultLocal.firstElementOffset, $"cDAC: {pLayout->firstElementOffset}, DAC: {resultLocal.firstElementOffset}");
5602Debug.Assert(pLayout->elementSize == resultLocal.elementSize, $"cDAC: {pLayout->elementSize}, DAC: {resultLocal.elementSize}");
5603Debug.Assert(pLayout->countOffset == resultLocal.countOffset, $"cDAC: {pLayout->countOffset}, DAC: {resultLocal.countOffset}");
5604Debug.Assert(pLayout->rankSize == resultLocal.rankSize, $"cDAC: {pLayout->rankSize}, DAC: {resultLocal.rankSize}");
5605Debug.Assert(pLayout->numRanks == resultLocal.numRanks, $"cDAC: {pLayout->numRanks}, DAC: {resultLocal.numRanks}");
5606Debug.Assert(pLayout->rankOffset == resultLocal.rankOffset, $"cDAC: {pLayout->rankOffset}, DAC: {resultLocal.rankOffset}");
5640Debug.ValidateHResult(hr, hrLocal);
5643Debug.Assert(pHeapInfo->areGCStructuresValid == resultLocal.areGCStructuresValid);
5644Debug.Assert(pHeapInfo->numHeaps == resultLocal.numHeaps);
5645Debug.Assert(pHeapInfo->pointerSize == resultLocal.pointerSize);
5646Debug.Assert(pHeapInfo->gcType == resultLocal.gcType);
5647Debug.Assert(pHeapInfo->concurrent == resultLocal.concurrent);
5676Debug.ValidateHResult(hr, hrLocal);
5678Debug.Assert(*pHasReadWriteMetadata == resultLocal, $"cDAC: {*pHasReadWriteMetadata}, DAC: {resultLocal}");
5730Debug.ValidateHResult(hr, hrLocal);
5732Debug.Assert(*pOptimizationsDisabled == localPOptimizationsDisabled);
5787Debug.ValidateHResult(hr, hrLocal);
5789Debug.Assert(*pVmILCodeVersionNode == resultLocal, $"cDAC: {*pVmILCodeVersionNode:x}, DAC: {resultLocal:x}");
5854Debug.ValidateHResult(hr, hrLocal);
5857Debug.Assert(pCodeInfo->pAddress == bufferLocal.pAddress, $"cDAC ILAddr: 0x{pCodeInfo->pAddress:X}, DAC ILAddr: 0x{bufferLocal.pAddress:X}");
5858Debug.Assert(pCodeInfo->cbSize == bufferLocal.cbSize, $"cDAC ILSize: {pCodeInfo->cbSize}, DAC ILSize: {bufferLocal.cbSize}");
5859Debug.Assert(*pLocalSigToken == sigLocal, $"cDAC LocalSig: 0x{*pLocalSigToken:X}, DAC LocalSig: 0x{sigLocal:X}");
5896Debug.ValidateHResult(hr, hrLocal);
5898Debug.Assert(*pVmNativeCodeVersionNode == resultLocal, $"cDAC: {*pVmNativeCodeVersionNode:x}, DAC: {resultLocal:x}");
5933Debug.ValidateHResult(hr, hrLocal);
5935Debug.Assert(*pVmILCodeVersionNode == resultLocal, $"cDAC: {*pVmILCodeVersionNode:x}, DAC: {resultLocal:x}");
5978Debug.ValidateHResult(hr, hrLocal);
5981Debug.Assert(pData->pbIL == dataLocal.pbIL, $"cDAC: {pData->pbIL:x}, DAC: {dataLocal.pbIL:x}");
5982Debug.Assert(pData->cInstrumentedMapEntries == dataLocal.cInstrumentedMapEntries, $"cDAC: {pData->cInstrumentedMapEntries:x}, DAC: {dataLocal.cInstrumentedMapEntries:x}");
5983Debug.Assert(pData->rgInstrumentedMapEntries == dataLocal.rgInstrumentedMapEntries, $"cDAC: {pData->rgInstrumentedMapEntries:x}, DAC: {dataLocal.rgInstrumentedMapEntries:x}");
6006Debug.ValidateHResult(hr, hrLocal);
6035Debug.ValidateHResult(hr, hrLocal);
6037Debug.Assert(*pResult == pResultLocal, $"cDAC: {*pResult}, DAC: {pResultLocal}");
6092Debug.ValidateHResult(hr, hrLocal);
6095Debug.Assert(*ppFunctionAssembly == asmLocal, $"cDAC: {*ppFunctionAssembly:x}, DAC: {asmLocal:x}");
6096Debug.Assert(*pMethodDef == methodDefLocal, $"cDAC: {*pMethodDef:x}, DAC: {methodDefLocal:x}");
6130Debug.ValidateHResult(hr, hrLocal);
6132Debug.Assert(*ppTargetObj == targetObjLocal, $"cDAC: {*ppTargetObj:x}, DAC: {targetObjLocal:x}");
6175Debug.ValidateHResult(hr, hrLocal);
6177Debug.Assert(*isModuleMapped == isModuleMappedLocal, $"cDAC: {*isModuleMapped}, DAC: {isModuleMappedLocal}");
6201Debug.ValidateHResult(hr, hrLocal);
6203Debug.Assert(*pResult == resultLocal);
6237Debug.ValidateHResult(hr, hrLocal);
6239Debug.Assert(*pVmAssembly == assemblyLocal, $"cDAC: {*pVmAssembly:x}, DAC: {assemblyLocal:x}");
6269Debug.ValidateHResult(hr, hrLocal);
6272Debug.Assert(*pDiagnosticIP == diagnosticIPLocal, $"cDAC: {*pDiagnosticIP:x}, DAC: {diagnosticIPLocal:x}");
6273Debug.Assert(*pNextContinuation == nextLocal, $"cDAC: {*pNextContinuation:x}, DAC: {nextLocal:x}");
6274Debug.Assert(*pState == stateLocal, $"cDAC: {*pState}, DAC: {stateLocal}");
6360Debug.ValidateHResult(hr, hrLocal);
6365Debug.Assert(locals.Count == legacyLocals.Count,
6369Debug.Assert(locals[i].Offset == legacyLocals[i].Offset,
6371Debug.Assert(locals[i].IlVarNum == legacyLocals[i].IlVarNum,
6418Debug.ValidateHResult(hr, hrLocal);
6420Debug.Assert(*pIndex == indexLocal, $"cDAC: {*pIndex}, DAC: {indexLocal}");
6551Debug.Assert(rts.IsArray(typeHandle, out _));
6591Debug.Assert(modulePtr != TargetPointer.Null);
6645Debug.Assert(modulePtr != TargetPointer.Null);
Dbi\DacDbiImpl.NativeCodeInfo.cs (25)
150Debug.ValidateHResult(hr, hrLocal);
155Debug.Assert(*pFixedArgCount == dacFixedArgCount,
169Debug.Assert(cdac.Count == dac.Count,
176Debug.Assert(c.nativeOffset == d.nativeOffset,
178Debug.Assert(c.ilOffset == d.ilOffset,
180Debug.Assert(c.source == d.source,
187Debug.Assert(cdac.Count == dac.Count,
194Debug.Assert(c.startOffset == d.startOffset,
196Debug.Assert(c.endOffset == d.endOffset,
198Debug.Assert(c.callReturnValueILOffset == d.callReturnValueILOffset,
200Debug.Assert(c.varNumber == d.varNumber,
202Debug.Assert(c.loc.vlType == d.loc.vlType,
210Debug.Assert(c.loc.vlrReg == d.loc.vlrReg,
216Debug.Assert(c.loc.vlsBaseReg == d.loc.vlsBaseReg,
218Debug.Assert(c.loc.vlsOffset == d.loc.vlsOffset,
222Debug.Assert(c.loc.vlrrReg1 == d.loc.vlrrReg1,
224Debug.Assert(c.loc.vlrrReg2 == d.loc.vlrrReg2,
228Debug.Assert(c.loc.vlrsReg == d.loc.vlrsReg,
230Debug.Assert(c.loc.vlrssBaseReg == d.loc.vlrssBaseReg,
232Debug.Assert(c.loc.vlrssOffset == d.loc.vlrssOffset,
236Debug.Assert(c.loc.vlsrsBaseReg == d.loc.vlsrsBaseReg,
238Debug.Assert(c.loc.vlsrsOffset == d.loc.vlsrsOffset,
240Debug.Assert(c.loc.vlsrReg == d.loc.vlsrReg,
244Debug.Assert(c.loc.vlfReg == d.loc.vlfReg,
248Debug.Assert(c.loc.vlfvOffset == d.loc.vlfvOffset,
MetaDataImportImpl.cs (112)
198Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumTypeDefs count mismatch: cDAC={tokens.Count}, DAC={legacyTokens.Count}");
200Debug.Assert(tokens[i] == legacyTokens[i], $"EnumTypeDefs token mismatch at [{i}]: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}");
246Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumInterfaceImpls count mismatch for 0x{td:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}");
248Debug.Assert(tokens[i] == legacyTokens[i], $"EnumInterfaceImpls token mismatch at [{i}] for 0x{td:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}");
300Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumMethods count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}");
302Debug.Assert(tokens[i] == legacyTokens[i], $"EnumMethods token mismatch at [{i}] for 0x{cl:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}");
348Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumFields count mismatch for 0x{cl:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}");
350Debug.Assert(tokens[i] == legacyTokens[i], $"EnumFields token mismatch at [{i}] for 0x{cl:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}");
409Debug.Assert(tokens.Count == legacyTokens.Count, $"EnumGenericParams count mismatch for 0x{tk:X}: cDAC={tokens.Count}, DAC={legacyTokens.Count}");
411Debug.Assert(tokens[i] == legacyTokens[i], $"EnumGenericParams token mismatch at [{i}] for 0x{tk:X}: cDAC=0x{tokens[i]:X}, DAC=0x{legacyTokens[i]:X}");
450Debug.ValidateHResult(hr, hrLegacy);
454Debug.Assert(*pdwTypeDefFlags == flagsLocal, $"TypeDefFlags mismatch: cDAC=0x{*pdwTypeDefFlags:X}, DAC=0x{flagsLocal:X}");
456Debug.Assert(*ptkExtends == extendsLocal, $"Extends mismatch: cDAC=0x{*ptkExtends:X}, DAC=0x{extendsLocal:X}");
458Debug.Assert(*pchTypeDef == pchLocal, $"Name length mismatch: cDAC={*pchTypeDef}, DAC={pchLocal}");
463Debug.Assert(cdacName == dacName, $"TypeDef name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
501Debug.ValidateHResult(hr, hrLegacy);
505Debug.Assert(*ptkResolutionScope == scopeLocal, $"ResolutionScope mismatch: cDAC=0x{*ptkResolutionScope:X}, DAC=0x{scopeLocal:X}");
507Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
512Debug.Assert(cdacName == dacName, $"TypeRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
568Debug.ValidateHResult(hr, hrLegacy);
572Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}");
574Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}");
576Debug.Assert(*pchMethod == pchLocal, $"Name length mismatch: cDAC={*pchMethod}, DAC={pchLocal}");
581Debug.Assert(cdacName == dacName, $"Method name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
584Debug.Assert(*pulCodeRVA == rvaLocal, $"RVA mismatch: cDAC=0x{*pulCodeRVA:X}, DAC=0x{rvaLocal:X}");
586Debug.Assert(*pdwImplFlags == implLocal, $"ImplFlags mismatch: cDAC=0x{*pdwImplFlags:X}, DAC=0x{implLocal:X}");
590Debug.Assert(*pcbSigBlob == cbSigLocal, $"SigBlob length mismatch: cDAC={*pcbSigBlob}, DAC={cbSigLocal}");
664Debug.ValidateHResult(hr, hrLegacy);
668Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}");
670Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}");
672Debug.Assert(*pchField == pchLocal, $"Name length mismatch: cDAC={*pchField}, DAC={pchLocal}");
677Debug.Assert(cdacName == dacName, $"Field name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
680Debug.Assert(*pdwCPlusTypeFlag == cpTypeLocal, $"CPlusTypeFlag mismatch: cDAC=0x{*pdwCPlusTypeFlag:X}, DAC=0x{cpTypeLocal:X}");
684Debug.Assert(*pcbSigBlob == cbSigLocal, $"SigBlob length mismatch: cDAC={*pcbSigBlob}, DAC={cbSigLocal}");
688Debug.Assert(*pcchValue == cchValueLocal, $"Constant length mismatch: cDAC={*pcchValue}, DAC={cchValueLocal}");
755Debug.ValidateHResult(hr, hrLegacy);
759Debug.Assert(*pClass == classLocal, $"Class mismatch: cDAC=0x{*pClass:X}, DAC=0x{classLocal:X}");
761Debug.Assert(*ptkIface == ifaceLocal, $"Interface mismatch: cDAC=0x{*ptkIface:X}, DAC=0x{ifaceLocal:X}");
792Debug.ValidateHResult(hr, hrLegacy);
794Debug.Assert(*ptdEnclosingClass == enclosingLocal, $"Enclosing class mismatch: cDAC=0x{*ptdEnclosingClass:X}, DAC=0x{enclosingLocal:X}");
837Debug.ValidateHResult(hr, hrLegacy);
841Debug.Assert(*pulParamSeq == seqLocal, $"ParamSeq mismatch: cDAC={*pulParamSeq}, DAC={seqLocal}");
843Debug.Assert(*pdwParamFlags == flagsLocal, $"ParamFlags mismatch: cDAC=0x{*pdwParamFlags:X}, DAC=0x{flagsLocal:X}");
845Debug.Assert(*ptOwner == ownerLocal, $"Owner mismatch: cDAC=0x{*ptOwner:X}, DAC=0x{ownerLocal:X}");
847Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
852Debug.Assert(cdacName == dacName, $"GenericParam name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
899Debug.ValidateHResult(hr, hrLegacy);
903Debug.Assert(*pulCodeRVA == rvaLocal, $"RVA mismatch: cDAC=0x{*pulCodeRVA:X}, DAC=0x{rvaLocal:X}");
905Debug.Assert(*pdwImplFlags == implLocal, $"ImplFlags mismatch: cDAC=0x{*pdwImplFlags:X}, DAC=0x{implLocal:X}");
939Debug.ValidateHResult(hr, hrLegacy);
945Debug.Assert(*pcbSig == cbLocal, $"Sig length mismatch: cDAC={*pcbSig}, DAC={cbLocal}");
996Debug.ValidateHResult(hr, hrLegacy);
1002Debug.Assert(*pcbData == cbLocal, $"CustomAttribute length mismatch: cDAC={*pcbData}, DAC={cbLocal}");
1103Debug.ValidateHResult(hr, hrLegacy);
1105Debug.Assert(*ptd == tdLocal, $"TypeDef mismatch: cDAC=0x{*ptd:X}, DAC=0x{tdLocal:X}");
1191Debug.ValidateHResult(hr, hrLegacy);
1195Debug.Assert(*ptk == tkLocal, $"Parent mismatch: cDAC=0x{*ptk:X}, DAC=0x{tkLocal:X}");
1197Debug.Assert(*pchMember == pchLocal, $"Name length mismatch: cDAC={*pchMember}, DAC={pchLocal}");
1202Debug.Assert(cdacName == dacName, $"MemberRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1207Debug.Assert(*pbSig == cbSigLocal, $"SigBlob length mismatch: cDAC={*pbSig}, DAC={cbSigLocal}");
1284Debug.ValidateHResult(hr, hrLegacy);
1288Debug.Assert(*pdwPackSize == packLocal, $"PackSize mismatch: cDAC={*pdwPackSize}, DAC={packLocal}");
1290Debug.Assert(*pulClassSize == sizeLocal, $"ClassSize mismatch: cDAC={*pulClassSize}, DAC={sizeLocal}");
1292Debug.Assert(*pcFieldOffset == fieldCountLocal, $"FieldOffset count mismatch: cDAC={*pcFieldOffset}, DAC={fieldCountLocal}");
1329Debug.ValidateHResult(hr, hrLegacy);
1333Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
1338Debug.Assert(cdacName == dacName, $"ModuleRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1376Debug.ValidateHResult(hr, hrLegacy);
1382Debug.Assert(*pcbSig == cbLocal, $"Sig length mismatch: cDAC={*pcbSig}, DAC={cbLocal}");
1452Debug.ValidateHResult(hr, hrLegacy);
1456Debug.Assert(*pchString == pchLocal, $"String length mismatch: cDAC={*pchString}, DAC={pchLocal}");
1464Debug.Assert(cdacStr == dacStr, $"UserString content mismatch: cDAC='{cdacStr}', DAC='{dacStr}'");
1522Debug.ValidateHResult(hr, hrLegacy);
1524Debug.Assert(*ppd == pdLocal, $"Param token mismatch: cDAC=0x{*ppd:X}, DAC=0x{pdLocal:X}");
1602Debug.ValidateHResult(hr, hrLegacy);
1606Debug.Assert(*pmd == mdLocal, $"Method mismatch: cDAC=0x{*pmd:X}, DAC=0x{mdLocal:X}");
1608Debug.Assert(*pulSequence == seqLocal, $"Sequence mismatch: cDAC={*pulSequence}, DAC={seqLocal}");
1610Debug.Assert(*pdwAttr == attrLocal, $"Attr mismatch: cDAC=0x{*pdwAttr:X}, DAC=0x{attrLocal:X}");
1612Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
1617Debug.Assert(cdacName == dacName, $"Param name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1728Debug.ValidateHResult(hr, hrLegacy);
1732Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
1737Debug.Assert(cdacName == dacName, $"Assembly name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1740Debug.Assert(*pulHashAlgId == hashAlgLocal, $"HashAlgId mismatch: cDAC=0x{*pulHashAlgId:X}, DAC=0x{hashAlgLocal:X}");
1742Debug.Assert(*pdwAssemblyFlags == flagsLocal, $"Flags mismatch: cDAC=0x{*pdwAssemblyFlags:X}, DAC=0x{flagsLocal:X}");
1746Debug.Assert(*pcbPublicKey == cbPublicKeyLocal, $"PublicKey length mismatch: cDAC={*pcbPublicKey}, DAC={cbPublicKeyLocal}");
1749Debug.Assert(pMetaData->usMajorVersion == metaLocal.usMajorVersion, $"MajorVersion mismatch: cDAC={pMetaData->usMajorVersion}, DAC={metaLocal.usMajorVersion}");
1750Debug.Assert(pMetaData->usMinorVersion == metaLocal.usMinorVersion, $"MinorVersion mismatch: cDAC={pMetaData->usMinorVersion}, DAC={metaLocal.usMinorVersion}");
1751Debug.Assert(pMetaData->usBuildNumber == metaLocal.usBuildNumber, $"BuildNumber mismatch: cDAC={pMetaData->usBuildNumber}, DAC={metaLocal.usBuildNumber}");
1752Debug.Assert(pMetaData->usRevisionNumber == metaLocal.usRevisionNumber, $"RevisionNumber mismatch: cDAC={pMetaData->usRevisionNumber}, DAC={metaLocal.usRevisionNumber}");
1839Debug.ValidateHResult(hr, hrLegacy);
1843Debug.Assert(*pchName == pchLocal, $"Name length mismatch: cDAC={*pchName}, DAC={pchLocal}");
1848Debug.Assert(cdacName == dacName, $"AssemblyRef name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1851Debug.Assert(*pdwAssemblyRefFlags == flagsLocal, $"Flags mismatch: cDAC=0x{*pdwAssemblyRefFlags:X}, DAC=0x{flagsLocal:X}");
1855Debug.Assert(*pcbPublicKeyOrToken == cbPublicKeyLocal, $"PublicKey length mismatch: cDAC={*pcbPublicKeyOrToken}, DAC={cbPublicKeyLocal}");
1859Debug.Assert(*pcbHashValue == cbHashLocal, $"Hash length mismatch: cDAC={*pcbHashValue}, DAC={cbHashLocal}");
1862Debug.Assert(pMetaData->usMajorVersion == metaLocal.usMajorVersion, $"MajorVersion mismatch: cDAC={pMetaData->usMajorVersion}, DAC={metaLocal.usMajorVersion}");
1863Debug.Assert(pMetaData->usMinorVersion == metaLocal.usMinorVersion, $"MinorVersion mismatch: cDAC={pMetaData->usMinorVersion}, DAC={metaLocal.usMinorVersion}");
1864Debug.Assert(pMetaData->usBuildNumber == metaLocal.usBuildNumber, $"BuildNumber mismatch: cDAC={pMetaData->usBuildNumber}, DAC={metaLocal.usBuildNumber}");
1865Debug.Assert(pMetaData->usRevisionNumber == metaLocal.usRevisionNumber, $"RevisionNumber mismatch: cDAC={pMetaData->usRevisionNumber}, DAC={metaLocal.usRevisionNumber}");
1920Debug.ValidateHResult(hr, hrLegacy);
1927Debug.Assert(cdacName == dacName, $"ExportedType name mismatch: cDAC='{cdacName}', DAC='{dacName}'");
1930Debug.Assert(*pchName == pchNameLocal, $"ExportedType name length mismatch: cDAC={*pchName}, DAC={pchNameLocal}");
1932Debug.Assert(*ptkImplementation == tkImplementationLocal, $"ExportedType implementation mismatch: cDAC=0x{*ptkImplementation:X}, DAC=0x{tkImplementationLocal:X}");
1934Debug.Assert(*ptkTypeDef == tkTypeDefLocal, $"ExportedType typeDef mismatch: cDAC=0x{*ptkTypeDef:X}, DAC=0x{tkTypeDefLocal:X}");
1936Debug.Assert(*pdwExportedTypeFlags == dwExportedTypeFlagsLocal, $"ExportedType flags mismatch: cDAC=0x{*pdwExportedTypeFlags:X}, DAC=0x{dwExportedTypeFlagsLocal:X}");
1970Debug.ValidateHResult(hr, hrLegacy);
1972Debug.Assert(*ptkAssembly == tkLocal, $"Assembly token mismatch: cDAC=0x{*ptkAssembly:X}, DAC=0x{tkLocal:X}");
2026Debug.ValidateHResult(hr, hrLegacy);
2028Debug.Assert(*ptkExportedType == tkExportedTypeLocal, $"ExportedType mismatch: cDAC=0x{*ptkExportedType:X}, DAC=0x{tkExportedTypeLocal:X}");
2071Debug.Assert(cdacLen == dacLen, $"{name} length mismatch: cDAC={cdacLen}, DAC={dacLen}");
2076Debug.Assert(cdacSpan.SequenceEqual(dacSpan), $"{name} content mismatch (length={cdacLen})");
SOSDacImpl.cs (565)
105Debug.ValidateHResult(hr, hrLocal);
160Debug.ValidateHResult(hr, hrLocal);
163Debug.Assert(data->AppDomainPtr == dataLocal.AppDomainPtr);
164Debug.Assert(data->pHighFrequencyHeap == dataLocal.pHighFrequencyHeap);
165Debug.Assert(data->pLowFrequencyHeap == dataLocal.pLowFrequencyHeap);
166Debug.Assert(data->pStubHeap == dataLocal.pStubHeap);
167Debug.Assert(data->DomainLocalBlock == dataLocal.DomainLocalBlock);
168Debug.Assert(data->pDomainLocalModules == dataLocal.pDomainLocalModules);
169Debug.Assert(data->dwId == dataLocal.dwId);
170Debug.Assert(data->appDomainStage == dataLocal.appDomainStage);
171Debug.Assert(data->AssemblyCount == dataLocal.AssemblyCount);
172Debug.Assert(data->FailedAssemblyCount == dataLocal.FailedAssemblyCount);
208Debug.ValidateHResult(hr, hrLocal);
209Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
212Debug.Assert(values[0] == valuesLocal[0], $"cDAC: {values[0]:x}, DAC: {valuesLocal[0]:x}");
278Debug.ValidateHResult(hr, hrLocal);
281Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
282Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name)));
309Debug.ValidateHResult(hr, hrLocal);
310Debug.Assert(appDomainStoreData->sharedDomain == dataLocal.sharedDomain, $"cDAC: {appDomainStoreData->sharedDomain:x}, DAC: {dataLocal.sharedDomain:x}");
311Debug.Assert(appDomainStoreData->systemDomain == dataLocal.systemDomain, $"cDAC: {appDomainStoreData->systemDomain:x}, DAC: {dataLocal.systemDomain:x}");
312Debug.Assert(appDomainStoreData->DomainCount == dataLocal.DomainCount, $"cDAC: {appDomainStoreData->DomainCount}, DAC: {dataLocal.DomainCount}");
327Debug.ValidateHResult(hr, hrLocal);
371Debug.ValidateHResult(hr, hrLocal);
374Debug.Assert(data->AssemblyPtr == dataLocal.AssemblyPtr, $"cDAC: {data->AssemblyPtr:x}, DAC: {dataLocal.AssemblyPtr:x}");
375Debug.Assert(data->ClassLoader == dataLocal.ClassLoader, $"cDAC: {data->ClassLoader:x}, DAC: {dataLocal.ClassLoader:x}");
376Debug.Assert(data->ParentDomain == dataLocal.ParentDomain, $"cDAC: {data->ParentDomain:x}, DAC: {dataLocal.ParentDomain:x}");
377Debug.Assert(data->DomainPtr == dataLocal.DomainPtr, $"cDAC: {data->DomainPtr:x}, DAC: {dataLocal.DomainPtr:x}");
378Debug.Assert(data->AssemblySecDesc == dataLocal.AssemblySecDesc, $"cDAC: {data->AssemblySecDesc:x}, DAC: {dataLocal.AssemblySecDesc:x}");
379Debug.Assert(data->isDynamic == dataLocal.isDynamic, $"cDAC: {data->isDynamic}, DAC: {dataLocal.isDynamic}");
380Debug.Assert(data->ModuleCount == dataLocal.ModuleCount, $"cDAC: {data->ModuleCount}, DAC: {dataLocal.ModuleCount}");
381Debug.Assert(data->LoadContext == dataLocal.LoadContext, $"cDAC: {data->LoadContext:x}, DAC: {dataLocal.LoadContext:x}");
382Debug.Assert(data->isDomainNeutral == dataLocal.isDomainNeutral, $"cDAC: {data->isDomainNeutral}, DAC: {dataLocal.isDomainNeutral}");
383Debug.Assert(data->dwLocationFlags == dataLocal.dwLocationFlags, $"cDAC: {data->dwLocationFlags:x}, DAC: {dataLocal.dwLocationFlags:x}");
449Debug.ValidateHResult(hr, hrLocal);
452Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
459Debug.Assert(values[i] == valuesLocal![i], $"cDAC: {values[i]:x}, DAC: {valuesLocal[i]:x}");
502Debug.ValidateHResult(hr, hrLocal);
505Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
508Debug.Assert(modules[0] == modulesLocal[0], $"cDAC: {modules[0]:x}, DAC: {modulesLocal[0]:x}");
554Debug.ValidateHResult(hr, hrLocal);
557Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
558Debug.Assert(name == null || new ReadOnlySpan<char>(fileNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name)));
612Debug.ValidateHResult(hr, hrLocal);
615Debug.Assert(data->outerIUnknown == dataLocal.outerIUnknown, $"cDAC outerIUnknown: {data->outerIUnknown:x}, DAC: {dataLocal.outerIUnknown:x}");
616Debug.Assert(data->managedObject == dataLocal.managedObject, $"cDAC managedObject: {data->managedObject:x}, DAC: {dataLocal.managedObject:x}");
617Debug.Assert(data->handle == dataLocal.handle, $"cDAC handle: {data->handle:x}, DAC: {dataLocal.handle:x}");
618Debug.Assert(data->ccwAddress == dataLocal.ccwAddress, $"cDAC ccwAddress: {data->ccwAddress:x}, DAC: {dataLocal.ccwAddress:x}");
619Debug.Assert(data->refCount == dataLocal.refCount, $"cDAC refCount: {data->refCount}, DAC: {dataLocal.refCount}");
620Debug.Assert(data->interfaceCount == dataLocal.interfaceCount, $"cDAC interfaceCount: {data->interfaceCount}, DAC: {dataLocal.interfaceCount}");
621Debug.Assert(data->isNeutered == dataLocal.isNeutered, $"cDAC isNeutered: {data->isNeutered}, DAC: {dataLocal.isNeutered}");
622Debug.Assert(data->jupiterRefCount == dataLocal.jupiterRefCount, $"cDAC jupiterRefCount: {data->jupiterRefCount}, DAC: {dataLocal.jupiterRefCount}");
623Debug.Assert(data->isPegged == dataLocal.isPegged, $"cDAC isPegged: {data->isPegged}, DAC: {dataLocal.isPegged}");
624Debug.Assert(data->isGlobalPegged == dataLocal.isGlobalPegged, $"cDAC isGlobalPegged: {data->isGlobalPegged}, DAC: {dataLocal.isGlobalPegged}");
625Debug.Assert(data->hasStrongRef == dataLocal.hasStrongRef, $"cDAC hasStrongRef: {data->hasStrongRef}, DAC: {dataLocal.hasStrongRef}");
626Debug.Assert(data->isExtendsCOMObject == dataLocal.isExtendsCOMObject, $"cDAC isExtendsCOMObject: {data->isExtendsCOMObject}, DAC: {dataLocal.isExtendsCOMObject}");
627Debug.Assert(data->isAggregated == dataLocal.isAggregated, $"cDAC isAggregated: {data->isAggregated}, DAC: {dataLocal.isAggregated}");
698Debug.ValidateHResult(hr, hrLocal);
701Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC count: {(pNeeded is null ? "null" : (*pNeeded).ToString())}, DAC count: {pNeededLocal}");
706Debug.Assert(interfaces[i].methodTable == interfacesLocal![i].methodTable, $"cDAC methodTable[{i}]: {interfaces[i].methodTable:x}, DAC: {interfacesLocal[i].methodTable:x}");
707Debug.Assert(interfaces[i].interfacePtr == interfacesLocal![i].interfacePtr, $"cDAC interfacePtr[{i}]: {interfaces[i].interfacePtr:x}, DAC: {interfacesLocal[i].interfacePtr:x}");
708Debug.Assert(interfaces[i].comContext == interfacesLocal![i].comContext, $"cDAC comContext[{i}]: {interfaces[i].comContext:x}, DAC: {interfacesLocal[i].comContext:x}");
754Debug.ValidateHResult(hr, hrLocal);
757Debug.Assert(new ReadOnlySpan<byte>(genericModeBlockLocal, 0, sizeOfGenericModeBlock).SequenceEqual(new Span<byte>(pGenericModeBlock, sizeOfGenericModeBlock)));
831Debug.ValidateHResult(hr, hrLocal);
834Debug.Assert(data->MethodDescPtr == dataLocal.MethodDescPtr, $"cDAC: {data->MethodDescPtr:x}, DAC: {dataLocal.MethodDescPtr:x}");
835Debug.Assert(data->JITType == dataLocal.JITType, $"cDAC: {data->JITType}, DAC: {dataLocal.JITType}");
836Debug.Assert(data->GCInfo == dataLocal.GCInfo, $"cDAC: {data->GCInfo:x}, DAC: {dataLocal.GCInfo:x}");
837Debug.Assert(data->MethodStart == dataLocal.MethodStart, $"cDAC: {data->MethodStart:x}, DAC: {dataLocal.MethodStart:x}");
838Debug.Assert(data->MethodSize == dataLocal.MethodSize, $"cDAC: {data->MethodSize}, DAC: {dataLocal.MethodSize}");
839Debug.Assert(data->HotRegionSize == dataLocal.HotRegionSize, $"cDAC: {data->HotRegionSize}, DAC: {dataLocal.HotRegionSize}");
840Debug.Assert(data->ColdRegionStart == dataLocal.ColdRegionStart, $"cDAC: {data->ColdRegionStart:x}, DAC: {dataLocal.ColdRegionStart:x}");
841Debug.Assert(data->ColdRegionSize == dataLocal.ColdRegionSize, $"cDAC: {data->ColdRegionSize}, DAC: {dataLocal.ColdRegionSize}");
859Debug.Assert(jitManager.ToTargetPointer(_target) == jitManagerInfo.ManagerAddress);
900Debug.ValidateHResult(hr, hrLocal);
905Debug.Assert(*pNeeded == neededLocal, $"cDAC count: {(*pNeeded):x}, DAC count: {neededLocal:x}");
911Debug.Assert(codeHeaps[i].codeHeapType == legacyHeaps![i].codeHeapType,
914Debug.Assert(codeHeaps[i].LoaderHeap == legacyHeaps[i].LoaderHeap,
918Debug.Assert(codeHeaps[i].baseAddr == legacyHeaps[i].baseAddr,
920Debug.Assert(codeHeaps[i].currentAddr == legacyHeaps[i].currentAddr,
950Debug.ValidateHResult(hr, hrLocal);
953Debug.Assert(domainLocal == context, $"cDAC: {context:x}, DAC: {domainLocal:x}");
968Debug.ValidateHResult(hr, hrLocal);
984Debug.ValidateHResult(hr, hrLocal);
999Debug.ValidateHResult(hr, hrLocal);
1039Debug.ValidateHResult(hr, hrLocal);
1042Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
1043Debug.Assert(location == null || new ReadOnlySpan<char>(locationLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(location)));
1155Debug.ValidateHResult(hr, hrLocal);
1158Debug.Assert(data->Type == dataLocal.Type, $"cDAC: {data->Type}, DAC: {dataLocal.Type}");
1159Debug.Assert(data->sigType == dataLocal.sigType, $"cDAC: {data->sigType}, DAC: {dataLocal.sigType}");
1160Debug.Assert(data->TokenOfType == dataLocal.TokenOfType, $"cDAC: {data->TokenOfType:x}, DAC: {dataLocal.TokenOfType:x}");
1161Debug.Assert(data->MTOfType == dataLocal.MTOfType, $"cDAC: {data->MTOfType:x}, DAC: {dataLocal.MTOfType:x}");
1162Debug.Assert(data->ModuleOfType == dataLocal.ModuleOfType, $"cDAC: {data->ModuleOfType:x}, DAC: {dataLocal.ModuleOfType:x}");
1163Debug.Assert(data->mb == dataLocal.mb, $"cDAC: {data->mb:x}, DAC: {dataLocal.mb:x}");
1164Debug.Assert(data->MTOfEnclosingClass == dataLocal.MTOfEnclosingClass, $"cDAC: {data->MTOfEnclosingClass:x}, DAC: {dataLocal.MTOfEnclosingClass:x}");
1165Debug.Assert(data->dwOffset == dataLocal.dwOffset, $"cDAC: {data->dwOffset:x}, DAC: {dataLocal.dwOffset:x}");
1166Debug.Assert(data->bIsThreadLocal == dataLocal.bIsThreadLocal, $"cDAC: {data->bIsThreadLocal}, DAC: {dataLocal.bIsThreadLocal}");
1167Debug.Assert(data->bIsContextLocal == dataLocal.bIsContextLocal, $"cDAC: {data->bIsContextLocal}, DAC: {dataLocal.bIsContextLocal}");
1168Debug.Assert(data->bIsStatic == dataLocal.bIsStatic, $"cDAC: {data->bIsStatic}, DAC: {dataLocal.bIsStatic}");
1172Debug.Assert(data->NextField == dataLocal.NextField || data->NextField == 0, $"cDAC: {data->NextField:x}, DAC: {dataLocal.NextField:x}");
1216Debug.ValidateHResult(hr, hrLocal);
1219Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
1220Debug.Assert(frameName == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal).SequenceEqual(new string(frameName)),
1261Debug.ValidateHResult(hr, hrLocal);
1264Debug.Assert(data->bServerMode == dataLocal.bServerMode, $"cDAC: {data->bServerMode}, DAC: {dataLocal.bServerMode}");
1265Debug.Assert(data->bGcStructuresValid == dataLocal.bGcStructuresValid, $"cDAC: {data->bGcStructuresValid}, DAC: {dataLocal.bGcStructuresValid}");
1266Debug.Assert(data->HeapCount == dataLocal.HeapCount, $"cDAC: {data->HeapCount}, DAC: {dataLocal.HeapCount}");
1267Debug.Assert(data->g_max_generation == dataLocal.g_max_generation, $"cDAC: {data->g_max_generation}, DAC: {dataLocal.g_max_generation}");
1298Debug.Assert(gcHeaps.Count == heapCount, "Expected the number of GC heaps to match the count returned by GetGCHeapCount");
1321Debug.ValidateHResult(hr, hrLocal);
1324Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
1329Debug.Assert(heaps[i] == heapsLocal[i], $"cDAC: {heaps[i]:x}, DAC: {heapsLocal[i]:x}");
1429Debug.ValidateHResult(hr, hrLocal);
1432Debug.Assert(details->heapAddr == detailsLocal.heapAddr, $"cDAC: {details->heapAddr:x}, DAC: {detailsLocal.heapAddr:x}");
1433Debug.Assert(details->alloc_allocated == detailsLocal.alloc_allocated, $"cDAC: {details->alloc_allocated:x}, DAC: {detailsLocal.alloc_allocated:x}");
1434Debug.Assert(details->mark_array == detailsLocal.mark_array, $"cDAC: {details->mark_array:x}, DAC: {detailsLocal.mark_array:x}");
1435Debug.Assert(details->current_c_gc_state == detailsLocal.current_c_gc_state, $"cDAC: {details->current_c_gc_state:x}, DAC: {detailsLocal.current_c_gc_state:x}");
1436Debug.Assert(details->next_sweep_obj == detailsLocal.next_sweep_obj, $"cDAC: {details->next_sweep_obj:x}, DAC: {detailsLocal.next_sweep_obj:x}");
1437Debug.Assert(details->saved_sweep_ephemeral_seg == detailsLocal.saved_sweep_ephemeral_seg, $"cDAC: {details->saved_sweep_ephemeral_seg:x}, DAC: {detailsLocal.saved_sweep_ephemeral_seg:x}");
1438Debug.Assert(details->saved_sweep_ephemeral_start == detailsLocal.saved_sweep_ephemeral_start, $"cDAC: {details->saved_sweep_ephemeral_start:x}, DAC: {detailsLocal.saved_sweep_ephemeral_start:x}");
1439Debug.Assert(details->background_saved_lowest_address == detailsLocal.background_saved_lowest_address, $"cDAC: {details->background_saved_lowest_address:x}, DAC: {detailsLocal.background_saved_lowest_address:x}");
1440Debug.Assert(details->background_saved_highest_address == detailsLocal.background_saved_highest_address, $"cDAC: {details->background_saved_highest_address:x}, DAC: {detailsLocal.background_saved_highest_address:x}");
1445Debug.Assert(details->generation_table[i].start_segment == detailsLocal.generation_table[i].start_segment, $"cDAC gen[{i}].start_segment: {details->generation_table[i].start_segment:x}, DAC: {detailsLocal.generation_table[i].start_segment:x}");
1446Debug.Assert(details->generation_table[i].allocation_start == detailsLocal.generation_table[i].allocation_start, $"cDAC gen[{i}].allocation_start: {details->generation_table[i].allocation_start:x}, DAC: {detailsLocal.generation_table[i].allocation_start:x}");
1447Debug.Assert(details->generation_table[i].allocContextPtr == detailsLocal.generation_table[i].allocContextPtr, $"cDAC gen[{i}].allocContextPtr: {details->generation_table[i].allocContextPtr:x}, DAC: {detailsLocal.generation_table[i].allocContextPtr:x}");
1448Debug.Assert(details->generation_table[i].allocContextLimit == detailsLocal.generation_table[i].allocContextLimit, $"cDAC gen[{i}].allocContextLimit: {details->generation_table[i].allocContextLimit:x}, DAC: {detailsLocal.generation_table[i].allocContextLimit:x}");
1451Debug.Assert(details->ephemeral_heap_segment == detailsLocal.ephemeral_heap_segment, $"cDAC: {details->ephemeral_heap_segment:x}, DAC: {detailsLocal.ephemeral_heap_segment:x}");
1456Debug.Assert(details->finalization_fill_pointers[i] == detailsLocal.finalization_fill_pointers[i], $"cDAC finalization_fill_pointers[{i}]: {details->finalization_fill_pointers[i]:x}, DAC: {detailsLocal.finalization_fill_pointers[i]:x}");
1459Debug.Assert(details->lowest_address == detailsLocal.lowest_address, $"cDAC: {details->lowest_address:x}, DAC: {detailsLocal.lowest_address:x}");
1460Debug.Assert(details->highest_address == detailsLocal.highest_address, $"cDAC: {details->highest_address:x}, DAC: {detailsLocal.highest_address:x}");
1461Debug.Assert(details->card_table == detailsLocal.card_table, $"cDAC: {details->card_table:x}, DAC: {detailsLocal.card_table:x}");
1562Debug.ValidateHResult(hr, hrLocal);
1565Debug.Assert(details->heapAddr == detailsLocal.heapAddr, $"cDAC: {details->heapAddr:x}, DAC: {detailsLocal.heapAddr:x}");
1566Debug.Assert(details->alloc_allocated == detailsLocal.alloc_allocated, $"cDAC: {details->alloc_allocated:x}, DAC: {detailsLocal.alloc_allocated:x}");
1567Debug.Assert(details->mark_array == detailsLocal.mark_array, $"cDAC: {details->mark_array:x}, DAC: {detailsLocal.mark_array:x}");
1568Debug.Assert(details->current_c_gc_state == detailsLocal.current_c_gc_state, $"cDAC: {details->current_c_gc_state:x}, DAC: {detailsLocal.current_c_gc_state:x}");
1569Debug.Assert(details->next_sweep_obj == detailsLocal.next_sweep_obj, $"cDAC: {details->next_sweep_obj:x}, DAC: {detailsLocal.next_sweep_obj:x}");
1570Debug.Assert(details->saved_sweep_ephemeral_seg == detailsLocal.saved_sweep_ephemeral_seg, $"cDAC: {details->saved_sweep_ephemeral_seg:x}, DAC: {detailsLocal.saved_sweep_ephemeral_seg:x}");
1571Debug.Assert(details->saved_sweep_ephemeral_start == detailsLocal.saved_sweep_ephemeral_start, $"cDAC: {details->saved_sweep_ephemeral_start:x}, DAC: {detailsLocal.saved_sweep_ephemeral_start:x}");
1572Debug.Assert(details->background_saved_lowest_address == detailsLocal.background_saved_lowest_address, $"cDAC: {details->background_saved_lowest_address:x}, DAC: {detailsLocal.background_saved_lowest_address:x}");
1573Debug.Assert(details->background_saved_highest_address == detailsLocal.background_saved_highest_address, $"cDAC: {details->background_saved_highest_address:x}, DAC: {detailsLocal.background_saved_highest_address:x}");
1578Debug.Assert(details->generation_table[i].start_segment == detailsLocal.generation_table[i].start_segment, $"cDAC gen[{i}].start_segment: {details->generation_table[i].start_segment:x}, DAC: {detailsLocal.generation_table[i].start_segment:x}");
1579Debug.Assert(details->generation_table[i].allocation_start == detailsLocal.generation_table[i].allocation_start, $"cDAC gen[{i}].allocation_start: {details->generation_table[i].allocation_start:x}, DAC: {detailsLocal.generation_table[i].allocation_start:x}");
1580Debug.Assert(details->generation_table[i].allocContextPtr == detailsLocal.generation_table[i].allocContextPtr, $"cDAC gen[{i}].allocContextPtr: {details->generation_table[i].allocContextPtr:x}, DAC: {detailsLocal.generation_table[i].allocContextPtr:x}");
1581Debug.Assert(details->generation_table[i].allocContextLimit == detailsLocal.generation_table[i].allocContextLimit, $"cDAC gen[{i}].allocContextLimit: {details->generation_table[i].allocContextLimit:x}, DAC: {detailsLocal.generation_table[i].allocContextLimit:x}");
1584Debug.Assert(details->ephemeral_heap_segment == detailsLocal.ephemeral_heap_segment, $"cDAC: {details->ephemeral_heap_segment:x}, DAC: {detailsLocal.ephemeral_heap_segment:x}");
1589Debug.Assert(details->finalization_fill_pointers[i] == detailsLocal.finalization_fill_pointers[i], $"cDAC finalization_fill_pointers[{i}]: {details->finalization_fill_pointers[i]:x}, DAC: {detailsLocal.finalization_fill_pointers[i]:x}");
1592Debug.Assert(details->lowest_address == detailsLocal.lowest_address, $"cDAC: {details->lowest_address:x}, DAC: {detailsLocal.lowest_address:x}");
1593Debug.Assert(details->highest_address == detailsLocal.highest_address, $"cDAC: {details->highest_address:x}, DAC: {detailsLocal.highest_address:x}");
1594Debug.Assert(details->card_table == detailsLocal.card_table, $"cDAC: {details->card_table:x}, DAC: {detailsLocal.card_table:x}");
1670Debug.ValidateHResult(hr, hrLocal);
1673Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}");
1676Debug.Assert(handles[i].AppDomain == handlesLocal[i].AppDomain, $"cDAC: {handles[i].AppDomain:x}, DAC: {handlesLocal[i].AppDomain:x}");
1677Debug.Assert(handles[i].Handle == handlesLocal[i].Handle, $"cDAC: {handles[i].Handle:x}, DAC: {handlesLocal[i].Handle:x}");
1678Debug.Assert(handles[i].Secondary == handlesLocal[i].Secondary, $"cDAC: {handles[i].Secondary:x}, DAC: {handlesLocal[i].Secondary:x}");
1679Debug.Assert(handles[i].Type == handlesLocal[i].Type, $"cDAC: {handles[i].Type}, DAC: {handlesLocal[i].Type}");
1680Debug.Assert(handles[i].StrongReference == handlesLocal[i].StrongReference, $"cDAC: {handles[i].StrongReference}, DAC: {handlesLocal[i].StrongReference}");
1681Debug.Assert(handles[i].RefCount == handlesLocal[i].RefCount, $"cDAC: {handles[i].RefCount}, DAC: {handlesLocal[i].RefCount}");
1682Debug.Assert(handles[i].JupiterRefCount == handlesLocal[i].JupiterRefCount, $"cDAC: {handles[i].JupiterRefCount}, DAC: {handlesLocal[i].JupiterRefCount}");
1683Debug.Assert(handles[i].IsPegged == handlesLocal[i].IsPegged, $"cDAC: {handles[i].IsPegged}, DAC: {handlesLocal[i].IsPegged}");
1716Debug.Assert(countLocal == (uint)_handles.Length);
1777Debug.ValidateHResult(hr, hrLocal);
1780Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}");
1783Debug.Assert(memRegions[i].Start == regionsLocal[i].Start, $"cDAC: {memRegions[i].Start:x}, DAC: {regionsLocal[i].Start:x}");
1784Debug.Assert(memRegions[i].Size == regionsLocal[i].Size, $"cDAC: {memRegions[i].Size:x}, DAC: {regionsLocal[i].Size:x}");
1785Debug.Assert(memRegions[i].ExtraData == regionsLocal[i].ExtraData, $"cDAC: {memRegions[i].ExtraData:x}, DAC: {regionsLocal[i].ExtraData:x}");
1786Debug.Assert(memRegions[i].Heap == regionsLocal[i].Heap, $"cDAC: {memRegions[i].Heap}, DAC: {regionsLocal[i].Heap}");
1822Debug.Assert(countLocal == (uint)_regions.Length);
1842Debug.ValidateHResult(hr, hrLocal);
1867Debug.ValidateHResult(hr, hrLocal);
1915Debug.ValidateHResult(hr, hrLocal);
1918Debug.Assert(data->heapAddr == dataLocal.heapAddr, $"cDAC: {data->heapAddr:x}, DAC: {dataLocal.heapAddr:x}");
1919Debug.Assert(data->internal_root_array == dataLocal.internal_root_array, $"cDAC: {data->internal_root_array:x}, DAC: {dataLocal.internal_root_array:x}");
1920Debug.Assert(data->internal_root_array_index == dataLocal.internal_root_array_index, $"cDAC: {data->internal_root_array_index}, DAC: {dataLocal.internal_root_array_index}");
1921Debug.Assert(data->heap_analyze_success == dataLocal.heap_analyze_success, $"cDAC: {data->heap_analyze_success}, DAC: {dataLocal.heap_analyze_success}");
1961Debug.ValidateHResult(hr, hrLocal);
1964Debug.Assert(data->heapAddr == dataLocal.heapAddr, $"cDAC: {data->heapAddr:x}, DAC: {dataLocal.heapAddr:x}");
1965Debug.Assert(data->internal_root_array == dataLocal.internal_root_array, $"cDAC: {data->internal_root_array:x}, DAC: {dataLocal.internal_root_array:x}");
1966Debug.Assert(data->internal_root_array_index == dataLocal.internal_root_array_index, $"cDAC: {data->internal_root_array_index}, DAC: {dataLocal.internal_root_array_index}");
1967Debug.Assert(data->heap_analyze_success == dataLocal.heap_analyze_success, $"cDAC: {data->heap_analyze_success}, DAC: {dataLocal.heap_analyze_success}");
2022Debug.ValidateHResult(hr, hrLocal);
2025Debug.Assert(data->segmentAddr == dataLocal.segmentAddr, $"segmentAddr - cDAC: {data->segmentAddr:x}, DAC: {dataLocal.segmentAddr:x}");
2026Debug.Assert(data->allocated == dataLocal.allocated, $"allocated - cDAC: {data->allocated:x}, DAC: {dataLocal.allocated:x}");
2027Debug.Assert(data->committed == dataLocal.committed, $"committed - cDAC: {data->committed:x}, DAC: {dataLocal.committed:x}");
2028Debug.Assert(data->reserved == dataLocal.reserved, $"reserved - cDAC: {data->reserved:x}, DAC: {dataLocal.reserved:x}");
2029Debug.Assert(data->used == dataLocal.used, $"used - cDAC: {data->used:x}, DAC: {dataLocal.used:x}");
2030Debug.Assert(data->mem == dataLocal.mem, $"mem - cDAC: {data->mem:x}, DAC: {dataLocal.mem:x}");
2031Debug.Assert(data->next == dataLocal.next, $"next - cDAC: {data->next:x}, DAC: {dataLocal.next:x}");
2032Debug.Assert(data->gc_heap == dataLocal.gc_heap, $"gc_heap - cDAC: {data->gc_heap:x}, DAC: {dataLocal.gc_heap:x}");
2033Debug.Assert(data->highAllocMark == dataLocal.highAllocMark, $"highAllocMark - cDAC: {data->highAllocMark:x}, DAC: {dataLocal.highAllocMark:x}");
2034Debug.Assert(data->flags == dataLocal.flags, $"flags - cDAC: {data->flags:x}, DAC: {dataLocal.flags:x}");
2035Debug.Assert(data->background_allocated == dataLocal.background_allocated, $"background_allocated - cDAC: {data->background_allocated:x}, DAC: {dataLocal.background_allocated:x}");
2052Debug.ValidateHResult(hr, hrLocal);
2081Debug.ValidateHResult(hr, hrLocal);
2084Debug.Assert(*il == ilLocal, $"cDAC: {*il:x}, DAC: {ilLocal:x}");
2119Debug.ValidateHResult(hr, hrLocal);
2122Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
2123Debug.Assert(name == null || new ReadOnlySpan<byte>(name, (int)neededLocal).SequenceEqual(nameLocal!.AsSpan(0, (int)neededLocal)));
2162Debug.ValidateHResult(hr, hrLocal);
2165Debug.Assert(managers->managerAddr == managerLocal.managerAddr);
2166Debug.Assert(managers->codeType == managerLocal.codeType);
2167Debug.Assert(managers->ptrHeapList == managerLocal.ptrHeapList);
2174Debug.ValidateHResult(hr, hrLocal);
2177Debug.Assert(*pNeeded == neededLocal);
2193Debug.Assert(IsJumpRel64(pThunk), "Expected a jump thunk");
2237Debug.ValidateHResult(hr, hrLocal);
2240Debug.Assert(*targetIP == targetIPLocal, $"cDAC: {*targetIP:x}, DAC: {targetIPLocal:x}");
2241Debug.Assert(*targetMD == targetMDLocal, $"cDAC: {*targetMD:x}, DAC: {targetMDLocal:x}");
2349Debug.Assert(data->rejitDataRequested.rejitID == 0);
2455Debug.ValidateHResult(hr, hrLocal);
2458Debug.Assert(data->bHasNativeCode == dataLocal.bHasNativeCode, $"cDAC: {data->bHasNativeCode}, DAC: {dataLocal.bHasNativeCode}");
2459Debug.Assert(data->bIsDynamic == dataLocal.bIsDynamic, $"cDAC: {data->bIsDynamic}, DAC: {dataLocal.bIsDynamic}");
2460Debug.Assert(data->wSlotNumber == dataLocal.wSlotNumber, $"cDAC: {data->wSlotNumber}, DAC: {dataLocal.wSlotNumber}");
2461Debug.Assert(data->NativeCodeAddr == dataLocal.NativeCodeAddr, $"cDAC: {data->NativeCodeAddr:x}, DAC: {dataLocal.NativeCodeAddr:x}");
2462Debug.Assert(data->AddressOfNativeCodeSlot == dataLocal.AddressOfNativeCodeSlot, $"cDAC: {data->AddressOfNativeCodeSlot:x}, DAC: {dataLocal.AddressOfNativeCodeSlot:x}");
2463Debug.Assert(data->MethodDescPtr == dataLocal.MethodDescPtr, $"cDAC: {data->MethodDescPtr:x}, DAC: {dataLocal.MethodDescPtr:x}");
2464Debug.Assert(data->MethodTablePtr == dataLocal.MethodTablePtr, $"cDAC: {data->MethodTablePtr:x}, DAC: {dataLocal.MethodTablePtr:x}");
2465Debug.Assert(data->ModulePtr == dataLocal.ModulePtr, $"cDAC: {data->ModulePtr:x}, DAC: {dataLocal.ModulePtr:x}");
2466Debug.Assert(data->MDToken == dataLocal.MDToken, $"cDAC: {data->MDToken:x}, DAC: {dataLocal.MDToken:x}");
2467Debug.Assert(data->GCInfo == dataLocal.GCInfo, $"cDAC: {data->GCInfo:x}, DAC: {dataLocal.GCInfo:x}");
2468Debug.Assert(data->GCStressCodeCopy == dataLocal.GCStressCodeCopy, $"cDAC: {data->GCStressCodeCopy:x}, DAC: {dataLocal.GCStressCodeCopy:x}");
2470Debug.Assert(data->managedDynamicMethodObject == 0);
2471Debug.Assert(data->requestedIP == dataLocal.requestedIP, $"cDAC: {data->requestedIP:x}, DAC: {dataLocal.requestedIP:x}");
2472Debug.Assert(data->cJittedRejitVersions == dataLocal.cJittedRejitVersions, $"cDAC: {data->cJittedRejitVersions}, DAC: {dataLocal.cJittedRejitVersions}");
2475Debug.Assert(data->rejitDataCurrent.rejitID == dataLocal.rejitDataCurrent.rejitID, $"cDAC: {data->rejitDataCurrent.rejitID}, DAC: {dataLocal.rejitDataCurrent.rejitID}");
2476Debug.Assert(data->rejitDataCurrent.NativeCodeAddr == dataLocal.rejitDataCurrent.NativeCodeAddr, $"cDAC: {data->rejitDataCurrent.NativeCodeAddr:x}, DAC: {dataLocal.rejitDataCurrent.NativeCodeAddr:x}");
2477Debug.Assert(data->rejitDataCurrent.flags == dataLocal.rejitDataCurrent.flags, $"cDAC: {data->rejitDataCurrent.flags}, DAC: {dataLocal.rejitDataCurrent.flags}");
2480Debug.Assert(data->rejitDataRequested.rejitID == dataLocal.rejitDataRequested.rejitID, $"cDAC: {data->rejitDataRequested.rejitID}, DAC: {dataLocal.rejitDataRequested.rejitID}");
2481Debug.Assert(data->rejitDataRequested.NativeCodeAddr == dataLocal.rejitDataRequested.NativeCodeAddr, $"cDAC: {data->rejitDataRequested.NativeCodeAddr:x}, DAC: {dataLocal.rejitDataRequested.NativeCodeAddr:x}");
2482Debug.Assert(data->rejitDataRequested.flags == dataLocal.rejitDataRequested.flags, $"cDAC: {data->rejitDataRequested.flags}, DAC: {dataLocal.rejitDataRequested.flags}");
2487Debug.Assert(cNeededRevertedRejitDataLocal == *pcNeededRevertedRejitData, $"cDAC: {*pcNeededRevertedRejitData}, DAC: {cNeededRevertedRejitDataLocal}");
2490Debug.Assert(rgRevertedRejitData[i].rejitID == rgRevertedRejitDataLocal[i].rejitID, $"cDAC: {rgRevertedRejitData[i].rejitID}, DAC: {rgRevertedRejitDataLocal[i].rejitID}");
2491Debug.Assert(rgRevertedRejitData[i].NativeCodeAddr == rgRevertedRejitDataLocal[i].NativeCodeAddr, $"cDAC: {rgRevertedRejitData[i].NativeCodeAddr:x}, DAC: {rgRevertedRejitDataLocal[i].NativeCodeAddr:x}");
2492Debug.Assert(rgRevertedRejitData[i].flags == rgRevertedRejitDataLocal[i].flags, $"cDAC: {rgRevertedRejitData[i].flags}, DAC: {rgRevertedRejitDataLocal[i].flags}");
2541Debug.Fail("Unknown RejitState. cDAC should be updated to understand this new state.");
2586Debug.ValidateHResult(hr, hrLocal);
2589Debug.Assert(*methodDesc == methodDescLocal, $"cDAC: {*methodDesc:x}, DAC: {methodDescLocal:x}");
2673Debug.ValidateHResult(hr, hrLocal);
2676Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
2677Debug.Assert(name == null || new ReadOnlySpan<char>(nameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(name)), $"cDAC: {new string(name)}, DAC: {new string(nameLocal, 0, (int)neededLocal - 1)}");
2710Debug.ValidateHResult(hr, hrLocal);
2713Debug.Assert(*ppMD == ppMDLocal);
2761Debug.ValidateHResult(hr, hrLocal);
2764Debug.Assert(*ppMD == ppMDLocal);
2844Debug.ValidateHResult(hr, hrLocal);
2847Debug.Assert(data->module == dataLocal.module);
2848Debug.Assert(data->klass == dataLocal.klass);
2849Debug.Assert(data->parentMethodTable == dataLocal.parentMethodTable);
2850Debug.Assert(data->wNumInterfaces == dataLocal.wNumInterfaces);
2851Debug.Assert(data->wNumMethods == dataLocal.wNumMethods);
2852Debug.Assert(data->wNumVtableSlots == dataLocal.wNumVtableSlots);
2853Debug.Assert(data->wNumVirtuals == dataLocal.wNumVirtuals);
2854Debug.Assert(data->cl == dataLocal.cl);
2855Debug.Assert(data->dwAttrClass == dataLocal.dwAttrClass);
2856Debug.Assert(data->bContainsGCPointers == dataLocal.bContainsGCPointers);
2857Debug.Assert(data->bIsShared == dataLocal.bIsShared);
2858Debug.Assert(data->bIsDynamic == dataLocal.bIsDynamic);
2892Debug.ValidateHResult(hr, hrLocal);
2895Debug.Assert(data->wNumInstanceFields == mtFieldDataLocal.wNumInstanceFields);
2896Debug.Assert(data->wNumStaticFields == mtFieldDataLocal.wNumStaticFields);
2897Debug.Assert(data->wNumThreadStaticFields == mtFieldDataLocal.wNumThreadStaticFields);
2898Debug.Assert(data->wContextStaticOffset == mtFieldDataLocal.wContextStaticOffset);
2899Debug.Assert(data->wContextStaticsSize == mtFieldDataLocal.wContextStaticsSize);
2927Debug.ValidateHResult(hr, hrLocal);
2929Debug.Assert(*value == valueLocal);
2993Debug.ValidateHResult(hr, hrLocal);
2996Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
2997Debug.Assert(mtName == null || new ReadOnlySpan<char>(mtNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(mtName)));
3063Debug.ValidateHResult(hr, hrLocal);
3066Debug.Assert(*value == valueLocal, $"cDAC: {*value:x}, DAC: {valueLocal:x}");
3174Debug.ValidateHResult(hr, hrLocal);
3177Debug.Assert(data->Address == dataLocal.Address);
3178Debug.Assert(data->PEAssembly == dataLocal.PEAssembly);
3179Debug.Assert(data->Assembly == dataLocal.Assembly);
3180Debug.Assert(data->isReflection == dataLocal.isReflection);
3181Debug.Assert(data->isPEFile == dataLocal.isPEFile);
3182Debug.Assert(data->dwTransientFlags == dataLocal.dwTransientFlags);
3183Debug.Assert(data->ilBase == dataLocal.ilBase);
3184Debug.Assert(data->metadataStart == dataLocal.metadataStart);
3185Debug.Assert(data->metadataSize == dataLocal.metadataSize);
3186Debug.Assert(data->LoaderAllocator == dataLocal.LoaderAllocator);
3187Debug.Assert(data->ThunkHeap == dataLocal.ThunkHeap);
3188Debug.Assert(data->FieldDefToDescMap == dataLocal.FieldDefToDescMap);
3189Debug.Assert(data->ManifestModuleReferencesMap == dataLocal.ManifestModuleReferencesMap);
3190Debug.Assert(data->MemberRefToDescMap == dataLocal.MemberRefToDescMap);
3191Debug.Assert(data->MethodDefToDescMap == dataLocal.MethodDefToDescMap);
3192Debug.Assert(data->TypeDefToMethodTableMap == dataLocal.TypeDefToMethodTableMap);
3193Debug.Assert(data->TypeRefToMethodTableMap == dataLocal.TypeRefToMethodTableMap);
3194Debug.Assert(data->dwModuleID == dataLocal.dwModuleID);
3195Debug.Assert(data->dwBaseClassIndex == dataLocal.dwBaseClassIndex);
3196Debug.Assert(data->dwModuleIndex == dataLocal.dwModuleIndex);
3229Debug.ValidateHResult(hr, hrLocal);
3232Debug.Assert(*exceptionObject == exceptionObjectLocal);
3233Debug.Assert(*nextNestedException == nextNestedExceptionLocal);
3302Debug.ValidateHResult(hr, hrLocal);
3305Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
3306Debug.Assert(className == null || new ReadOnlySpan<char>(classNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(className)));
3401Debug.ValidateHResult(hr, hrLocal);
3404Debug.Assert(data->MethodTable == dataLocal.MethodTable);
3405Debug.Assert(data->ObjectType == dataLocal.ObjectType);
3406Debug.Assert(data->Size == dataLocal.Size);
3407Debug.Assert(data->ElementTypeHandle == dataLocal.ElementTypeHandle);
3408Debug.Assert(data->ElementType == dataLocal.ElementType);
3409Debug.Assert(data->dwRank == dataLocal.dwRank);
3410Debug.Assert(data->dwNumComponents == dataLocal.dwNumComponents);
3411Debug.Assert(data->dwComponentSize == dataLocal.dwComponentSize);
3412Debug.Assert(data->ArrayDataPtr == dataLocal.ArrayDataPtr);
3413Debug.Assert(data->ArrayBoundsPtr == dataLocal.ArrayBoundsPtr);
3414Debug.Assert(data->ArrayLowerBoundsPtr == dataLocal.ArrayLowerBoundsPtr);
3415Debug.Assert(data->RCW == dataLocal.RCW);
3416Debug.Assert(data->CCW == dataLocal.CCW);
3455Debug.ValidateHResult(hr, hrLocal);
3458Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
3461Debug.Assert(stringData == null || new ReadOnlySpan<char>(stringDataLocal, 0, new string(stringData).Length).SequenceEqual(new string(stringData)));
3504Debug.ValidateHResult(hr, hrLocal);
3507Debug.Assert(data->reason == dataLocal.reason, $"cDAC: {data->reason}, DAC: {dataLocal.reason}");
3508Debug.Assert(data->alloc_size == dataLocal.alloc_size, $"cDAC: {data->alloc_size}, DAC: {dataLocal.alloc_size}");
3509Debug.Assert(data->available_pagefile_mb == dataLocal.available_pagefile_mb, $"cDAC: {data->available_pagefile_mb}, DAC: {dataLocal.available_pagefile_mb}");
3510Debug.Assert(data->gc_index == dataLocal.gc_index, $"cDAC: {data->gc_index}, DAC: {dataLocal.gc_index}");
3511Debug.Assert(data->fgm == dataLocal.fgm, $"cDAC: {data->fgm}, DAC: {dataLocal.fgm}");
3512Debug.Assert(data->size == dataLocal.size, $"cDAC: {data->size}, DAC: {dataLocal.size}");
3513Debug.Assert(data->loh_p == dataLocal.loh_p, $"cDAC: {data->loh_p}, DAC: {dataLocal.loh_p}");
3554Debug.ValidateHResult(hr, hrLocal);
3557Debug.Assert(data->reason == dataLocal.reason, $"cDAC: {data->reason}, DAC: {dataLocal.reason}");
3558Debug.Assert(data->alloc_size == dataLocal.alloc_size, $"cDAC: {data->alloc_size}, DAC: {dataLocal.alloc_size}");
3559Debug.Assert(data->available_pagefile_mb == dataLocal.available_pagefile_mb, $"cDAC: {data->available_pagefile_mb}, DAC: {dataLocal.available_pagefile_mb}");
3560Debug.Assert(data->gc_index == dataLocal.gc_index, $"cDAC: {data->gc_index}, DAC: {dataLocal.gc_index}");
3561Debug.Assert(data->fgm == dataLocal.fgm, $"cDAC: {data->fgm}, DAC: {dataLocal.fgm}");
3562Debug.Assert(data->size == dataLocal.size, $"cDAC: {data->size}, DAC: {dataLocal.size}");
3563Debug.Assert(data->loh_p == dataLocal.loh_p, $"cDAC: {data->loh_p}, DAC: {dataLocal.loh_p}");
3600Debug.ValidateHResult(hr, hrLocal);
3602Debug.Assert(*peBase == peBaseLocal);
3645Debug.ValidateHResult(hr, hrLocal);
3648Debug.Assert(pNeeded == null || *pNeeded == neededLocal);
3649Debug.Assert(fileName == null || new ReadOnlySpan<char>(fileNameLocal, 0, (int)neededLocal - 1).SequenceEqual(new string(fileName)));
3665Debug.ValidateHResult(hr, hrLocal);
3707Debug.ValidateHResult(hr, hrLocal);
3710Debug.Assert(data->identityPointer == dataLocal.identityPointer, $"cDAC: {data->identityPointer:x}, DAC: {dataLocal.identityPointer:x}");
3711Debug.Assert(data->unknownPointer == dataLocal.unknownPointer, $"cDAC: {data->unknownPointer:x}, DAC: {dataLocal.unknownPointer:x}");
3712Debug.Assert(data->managedObject == dataLocal.managedObject, $"cDAC: {data->managedObject:x}, DAC: {dataLocal.managedObject:x}");
3713Debug.Assert(data->vtablePtr == dataLocal.vtablePtr, $"cDAC: {data->vtablePtr:x}, DAC: {dataLocal.vtablePtr:x}");
3714Debug.Assert(data->creatorThread == dataLocal.creatorThread, $"cDAC: {data->creatorThread:x}, DAC: {dataLocal.creatorThread:x}");
3715Debug.Assert(data->ctxCookie == dataLocal.ctxCookie, $"cDAC: {data->ctxCookie:x}, DAC: {dataLocal.ctxCookie:x}");
3716Debug.Assert(data->refCount == dataLocal.refCount, $"cDAC: {data->refCount}, DAC: {dataLocal.refCount}");
3717Debug.Assert(data->interfaceCount == dataLocal.interfaceCount, $"cDAC: {data->interfaceCount}, DAC: {dataLocal.interfaceCount}");
3718Debug.Assert(data->isAggregated == dataLocal.isAggregated, $"cDAC: {data->isAggregated}, DAC: {dataLocal.isAggregated}");
3719Debug.Assert(data->isContained == dataLocal.isContained, $"cDAC: {data->isContained}, DAC: {dataLocal.isContained}");
3720Debug.Assert(data->isFreeThreaded == dataLocal.isFreeThreaded, $"cDAC: {data->isFreeThreaded}, DAC: {dataLocal.isFreeThreaded}");
3721Debug.Assert(data->isDisconnected == dataLocal.isDisconnected, $"cDAC: {data->isDisconnected}, DAC: {dataLocal.isDisconnected}");
3796Debug.ValidateHResult(hr, hrLocal);
3799Debug.Assert(numWritten == pNeededLocal, $"cDAC: {numWritten}, DAC: {pNeededLocal}");
3804Debug.Assert(interfaces[i].methodTable == interfacesLocal![i].methodTable, $"cDAC: {interfaces[i].methodTable:x}, DAC: {interfacesLocal[i].methodTable:x}");
3805Debug.Assert(interfaces[i].interfacePtr == interfacesLocal![i].interfacePtr, $"cDAC: {interfaces[i].interfacePtr:x}, DAC: {interfacesLocal[i].interfacePtr:x}");
3806Debug.Assert(interfaces[i].comContext == interfacesLocal![i].comContext, $"cDAC: {interfaces[i].comContext:x}, DAC: {interfacesLocal[i].comContext:x}");
3870Debug.ValidateHResult(hr, hrLocal);
3873Debug.Assert(pNeeded is null || *pNeeded == neededLocal);
3874Debug.Assert(buffer is null || new ReadOnlySpan<char>(bufferLocal, 0, (int)Math.Min(count, neededLocal)).SequenceEqual(new ReadOnlySpan<char>(buffer, (int)Math.Min(count, neededLocal))));
3962Debug.ValidateHResult(hr, hrLocal);
3965Debug.Assert(lower == null || *lower == lowerLocal, $"cDAC: {*lower:x}, DAC: {lowerLocal:x}");
3966Debug.Assert(upper == null || *upper == upperLocal, $"cDAC: {*upper:x}, DAC: {upperLocal:x}");
3967Debug.Assert(fp == null || *fp == fpLocal, $"cDAC: {*fp:x}, DAC: {fpLocal:x}");
4102Debug.ValidateHResult(hr, hrLocal);
4116Debug.Assert(HResults.S_OK == _legacyImpl.GetStressLogAddress(&legacyStressLog));
4117Debug.Assert(legacyStressLog == stressLogAddress);
4170Debug.ValidateHResult(hr, hrLocal);
4173Debug.Assert(data->SyncBlockPointer == dataLocal.SyncBlockPointer, $"cDAC: {data->SyncBlockPointer:x}, DAC: {dataLocal.SyncBlockPointer:x}");
4174Debug.Assert(data->nextSyncBlock == dataLocal.nextSyncBlock, $"cDAC: {data->nextSyncBlock:x}, DAC: {dataLocal.nextSyncBlock:x}");
4175Debug.Assert(data->blockRCW == dataLocal.blockRCW, $"cDAC: {data->blockRCW:x}, DAC: {dataLocal.blockRCW:x}");
4176Debug.Assert(data->blockClassFactory == dataLocal.blockClassFactory, $"cDAC: {data->blockClassFactory:x}, DAC: {dataLocal.blockClassFactory:x}");
4177Debug.Assert(data->blockCCW == dataLocal.blockCCW, $"cDAC: {data->blockCCW:x}, DAC: {dataLocal.blockCCW:x}");
4241Debug.ValidateHResult(hr, hrLocal);
4244Debug.Assert(data->Object == dataLocal.Object, $"cDAC: {data->Object:x}, DAC: {dataLocal.Object:x}");
4245Debug.Assert(data->bFree == dataLocal.bFree, $"cDAC: {data->bFree}, DAC: {dataLocal.bFree}");
4246Debug.Assert(data->SyncBlockPointer == dataLocal.SyncBlockPointer, $"cDAC: {data->SyncBlockPointer:x}, DAC: {dataLocal.SyncBlockPointer:x}");
4247Debug.Assert(data->COMFlags == dataLocal.COMFlags, $"cDAC: {data->COMFlags}, DAC: {dataLocal.COMFlags}");
4248Debug.Assert(data->MonitorHeld == dataLocal.MonitorHeld, $"cDAC: {data->MonitorHeld}, DAC: {dataLocal.MonitorHeld}");
4251Debug.Assert(data->Recursion == dataLocal.Recursion, $"cDAC: {data->Recursion}, DAC: {dataLocal.Recursion}");
4252Debug.Assert(data->HoldingThread == dataLocal.HoldingThread, $"cDAC: {data->HoldingThread:x}, DAC: {dataLocal.HoldingThread:x}");
4254Debug.Assert(data->AdditionalThreadCount == dataLocal.AdditionalThreadCount, $"cDAC: {data->AdditionalThreadCount}, DAC: {dataLocal.AdditionalThreadCount}");
4255Debug.Assert(data->appDomainPtr == dataLocal.appDomainPtr, $"cDAC: {data->appDomainPtr:x}, DAC: {dataLocal.appDomainPtr:x}");
4256Debug.Assert(data->SyncBlockCount == dataLocal.SyncBlockCount, $"cDAC: {data->SyncBlockCount}, DAC: {dataLocal.SyncBlockCount}");
4288Debug.ValidateHResult(hr, hrLocal);
4291Debug.Assert(data->allocBytes == dataLocal.allocBytes, $"cDAC: {data->allocBytes:x}, DAC: {dataLocal.allocBytes:x}");
4292Debug.Assert(data->allocBytesLoh == dataLocal.allocBytesLoh, $"cDAC: {data->allocBytesLoh:x}, DAC: {dataLocal.allocBytesLoh:x}");
4337Debug.ValidateHResult(hr, hrLocal);
4340Debug.Assert(data->corThreadId == dataLocal.corThreadId, $"cDAC: {data->corThreadId}, DAC: {dataLocal.corThreadId}");
4341Debug.Assert(data->osThreadId == dataLocal.osThreadId, $"cDAC: {data->osThreadId}, DAC: {dataLocal.osThreadId}");
4347Debug.Assert(data->state == (dataLocal.state & wrappedStateMask), $"cDAC: {data->state}, DAC: {dataLocal.state & wrappedStateMask}");
4348Debug.Assert(data->preemptiveGCDisabled == dataLocal.preemptiveGCDisabled, $"cDAC: {data->preemptiveGCDisabled}, DAC: {dataLocal.preemptiveGCDisabled}");
4349Debug.Assert(data->allocContextPtr == dataLocal.allocContextPtr, $"cDAC: {data->allocContextPtr:x}, DAC: {dataLocal.allocContextPtr:x}");
4350Debug.Assert(data->allocContextLimit == dataLocal.allocContextLimit, $"cDAC: {data->allocContextLimit:x}, DAC: {dataLocal.allocContextLimit:x}");
4351Debug.Assert(data->fiberData == dataLocal.fiberData, $"cDAC: {data->fiberData:x}, DAC: {dataLocal.fiberData:x}");
4352Debug.Assert(data->context == dataLocal.context, $"cDAC: {data->context:x}, DAC: {dataLocal.context:x}");
4353Debug.Assert(data->domain == dataLocal.domain, $"cDAC: {data->domain:x}, DAC: {dataLocal.domain:x}");
4354Debug.Assert(data->lockCount == dataLocal.lockCount, $"cDAC: {data->lockCount}, DAC: {dataLocal.lockCount}");
4355Debug.Assert(data->pFrame == dataLocal.pFrame, $"cDAC: {data->pFrame:x}, DAC: {dataLocal.pFrame:x}");
4356Debug.Assert(data->firstNestedException == dataLocal.firstNestedException, $"cDAC: {data->firstNestedException:x}, DAC: {dataLocal.firstNestedException:x}");
4357Debug.Assert(data->lastThrownObjectHandle == dataLocal.lastThrownObjectHandle, $"cDAC: {data->lastThrownObjectHandle:x}, DAC: {dataLocal.lastThrownObjectHandle:x}");
4358Debug.Assert(data->nextThread == dataLocal.nextThread, $"cDAC: {data->nextThread:x}, DAC: {dataLocal.nextThread:x}");
4383Debug.ValidateHResult(hr, hrLocal);
4386Debug.Assert(*pThread == pThreadLocal);
4401Debug.ValidateHResult(hr, hrLocal);
4417Debug.ValidateHResult(hr, hrLocal);
4456Debug.ValidateHResult(hr, hrLocal);
4459Debug.Assert(data->threadCount == dataLocal.threadCount);
4460Debug.Assert(data->firstThread == dataLocal.firstThread);
4461Debug.Assert(data->finalizerThread == dataLocal.finalizerThread);
4462Debug.Assert(data->gcThread == dataLocal.gcThread);
4463Debug.Assert(data->unstartedThreadCount == dataLocal.unstartedThreadCount);
4464Debug.Assert(data->backgroundThreadCount == dataLocal.backgroundThreadCount);
4465Debug.Assert(data->pendingThreadCount == dataLocal.pendingThreadCount);
4466Debug.Assert(data->deadThreadCount == dataLocal.deadThreadCount);
4467Debug.Assert(data->fHostConfig == dataLocal.fHostConfig);
4495Debug.ValidateHResult(hr, hrLocal);
4498Debug.Assert(*pIndex == indexLocal);
4545Debug.Assert(data->ArrayMethodTable == dataLocal.ArrayMethodTable);
4546Debug.Assert(data->StringMethodTable == dataLocal.StringMethodTable);
4547Debug.Assert(data->ObjectMethodTable == dataLocal.ObjectMethodTable);
4548Debug.Assert(data->ExceptionMethodTable == dataLocal.ExceptionMethodTable);
4549Debug.Assert(data->FreeMethodTable == dataLocal.FreeMethodTable);
4565Debug.ValidateHResult(hr, hrLocal);
4592Debug.Assert(clauseIndex < totalClauses, $"Invalid clause index {clauseIndex} of {totalClauses}");
4596Debug.Assert(pEHInfo->clauseType == expectedEhClause.clauseType, $"cDAC: {expectedEhClause.clauseType}, DAC: {pEHInfo->clauseType}");
4597Debug.Assert(pEHInfo->tryStartOffset == expectedEhClause.tryStartOffset, $"cDAC: {expectedEhClause.tryStartOffset:x}, DAC: {pEHInfo->tryStartOffset:x}");
4598Debug.Assert(pEHInfo->tryEndOffset == expectedEhClause.tryEndOffset, $"cDAC: {expectedEhClause.tryEndOffset:x}, DAC: {pEHInfo->tryEndOffset:x}");
4599Debug.Assert(pEHInfo->handlerStartOffset == expectedEhClause.handlerStartOffset, $"cDAC: {expectedEhClause.handlerStartOffset:x}, DAC: {pEHInfo->handlerStartOffset:x}");
4600Debug.Assert(pEHInfo->handlerEndOffset == expectedEhClause.handlerEndOffset, $"cDAC: {expectedEhClause.handlerEndOffset:x}, DAC: {pEHInfo->handlerEndOffset:x}");
4601Debug.Assert(pEHInfo->isDuplicateClause == expectedEhClause.isDuplicateClause, $"cDAC: {expectedEhClause.isDuplicateClause}, DAC: {pEHInfo->isDuplicateClause}");
4602Debug.Assert(pEHInfo->filterOffset == expectedEhClause.filterOffset, $"cDAC: {expectedEhClause.filterOffset:x}, DAC: {pEHInfo->filterOffset:x}");
4603Debug.Assert(pEHInfo->isCatchAllHandler == expectedEhClause.isCatchAllHandler, $"cDAC: {expectedEhClause.isCatchAllHandler}, DAC: {pEHInfo->isCatchAllHandler}");
4604Debug.Assert(pEHInfo->moduleAddr == expectedEhClause.moduleAddr, $"cDAC: {expectedEhClause.moduleAddr:x}, DAC: {pEHInfo->moduleAddr:x}");
4605Debug.Assert(pEHInfo->mtCatch == expectedEhClause.mtCatch, $"cDAC: {expectedEhClause.mtCatch:x}, DAC: {pEHInfo->mtCatch:x}");
4606Debug.Assert(pEHInfo->tokCatch == expectedEhClause.tokCatch, $"cDAC: {expectedEhClause.tokCatch:x}, DAC: {pEHInfo->tokCatch:x}");
4610Debug.Fail($"Received unexpected clause index {clauseIndex} of {totalClauses}");
4697Debug.ValidateHResult(hr, hrLocal, HResultValidationMode.Exact);
4723Debug.Assert(found, $"Unexpected loader heap block: address={virtualAddress:x}, size={virtualSize:x}");
4782Debug.ValidateHResult(hr, hrLocal);
4785Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0,
4787Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount,
4806Debug.Assert(false, $"Unexpected module address {moduleAddr:x} at index {index}");
4852Debug.ValidateHResult(hr, hrLocal);
4853Debug.Assert(expectedElements[default] == elements.Count(), $"cDAC: {elements.Count()} elements, DAC: {expectedElements[default]} elements");
4870Debug.Fail($"Unexpected RCW address {rcwAddr:x} or context {ctx:x}");
4912Debug.ValidateHResult(hr, hrLocal);
4913Debug.Assert(expectedElements[default] == (ulong)cleanupInfos.Count(), $"cDAC: {cleanupInfos.Count()} elements, DAC: {expectedElements[default]} elements");
4958Debug.ValidateHResult(hr, hrLocal);
4961Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0,
4963Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount,
5021Debug.ValidateHResult(hr, hrLocal);
5024Debug.Assert(*inDCOMProxy == inDCOMProxyLocal);
5064Debug.ValidateHResult(hr, hrLocal);
5106Debug.ValidateHResult(hr, hrLocal);
5148Debug.Assert(cdacData->interestingDataPoints[i] == legacyData->interestingDataPoints[i],
5155Debug.Assert(cdacData->compactReasons[i] == legacyData->compactReasons[i],
5162Debug.Assert(cdacData->expandMechanisms[i] == legacyData->expandMechanisms[i],
5169Debug.Assert(cdacData->bitMechanisms[i] == legacyData->bitMechanisms[i],
5176Debug.Assert(cdacData->globalMechanisms[i] == legacyData->globalMechanisms[i],
5218Debug.ValidateHResult(hr, hrLocal);
5223Debug.Assert(globalMechanisms[i] == globalMechanismsLocal[i],
5263Debug.ValidateHResult(hr, hrLocal);
5266Debug.Assert(*pNeeded == neededLocal);
5269Debug.Assert(arguments[i] == argumentsLocal[i]);
5391Debug.ValidateHResult(hr, hrLocal);
5394Debug.Assert(*pcNativeCodeAddrs == legacyCount, $"cDAC count: {*pcNativeCodeAddrs}, DAC count: {legacyCount}");
5399Debug.Assert(nativeCodeAddrs[i].nativeCodeAddr == legacyBuffer[i].nativeCodeAddr,
5401Debug.Assert(nativeCodeAddrs[i].nativeCodeVersionNodePtr == legacyBuffer[i].nativeCodeVersionNodePtr,
5403Debug.Assert(nativeCodeAddrs[i].optimizationTier == legacyBuffer[i].optimizationTier,
5447Debug.ValidateHResult(hr, hrLocal);
5450Debug.Assert((data->bCollectible == 0) == (dataLocal.bCollectible == 0), $"cDAC: {data->bCollectible}, DAC: {dataLocal.bCollectible}");
5451Debug.Assert(data->LoaderAllocatorObjectHandle == dataLocal.LoaderAllocatorObjectHandle, $"cDAC: {data->LoaderAllocatorObjectHandle:x}, DAC: {dataLocal.LoaderAllocatorObjectHandle:x}");
5494Debug.ValidateHResult(hr, hrLocal);
5497Debug.Assert(*pRejitId == rejitIdLocal);
5532Debug.Assert(true, "Unknown SharedRejitInfo state. cDAC should be updated to understand this new state.");
5552Debug.ValidateHResult(hr, hrLocal);
5555Debug.Assert(pRejitData->rejitID == rejitDataLocal.rejitID);
5556Debug.Assert(pRejitData->il == rejitDataLocal.il);
5557Debug.Assert(pRejitData->flags == rejitDataLocal.flags);
5558Debug.Assert(pRejitData->ilCodeVersionNodePtr == rejitDataLocal.ilCodeVersionNodePtr);
5613Debug.ValidateHResult(hr, hrLocal);
5616Debug.Assert(pILData->type == ilDataLocal.type, $"cDAC: {pILData->type}, DAC: {ilDataLocal.type}");
5617Debug.Assert(pILData->rejitID == ilDataLocal.rejitID, $"cDAC: {pILData->rejitID}, DAC: {ilDataLocal.rejitID}");
5618Debug.Assert(pILData->il == ilDataLocal.il, $"cDAC: {pILData->il:x}, DAC: {ilDataLocal.il:x}");
5681Debug.ValidateHResult(hr, hrLocal);
5684Debug.Assert(*pcMethodDescs == pcMethodDescsLocal, $"cDAC: {*pcMethodDescs}, DAC: {pcMethodDescsLocal}");
5687Debug.Assert(methodDescs[i] == methodDescsLocal[i], $"cDAC: {methodDescs[i]:x}, DAC: {methodDescsLocal[i]:x}");
5722Debug.ValidateHResult(hr, hrLocal);
5725Debug.Assert(*pGenerations == pGenerationsLocal);
5780Debug.ValidateHResult(hr, hrLocal);
5783Debug.Assert(*pNeeded == pNeededLocal);
5789Debug.Assert(pGenDataLocal[i].start_segment == pGenerationData[i].start_segment);
5790Debug.Assert(pGenDataLocal[i].allocation_start == pGenerationData[i].allocation_start);
5791Debug.Assert(pGenDataLocal[i].allocContextPtr == pGenerationData[i].allocContextPtr);
5792Debug.Assert(pGenDataLocal[i].allocContextLimit == pGenerationData[i].allocContextLimit);
5845Debug.ValidateHResult(hr, hrLocal);
5848Debug.Assert(*pNeeded == pNeededLocal);
5854Debug.Assert(pFillPointersLocal[i] == pFinalizationFillPointers[i]);
5911Debug.ValidateHResult(hr, hrLocal);
5914Debug.Assert(*pNeeded == pNeededLocal);
5920Debug.Assert(pGenDataLocal[i].start_segment == pGenerationData[i].start_segment);
5921Debug.Assert(pGenDataLocal[i].allocation_start == pGenerationData[i].allocation_start);
5922Debug.Assert(pGenDataLocal[i].allocContextPtr == pGenerationData[i].allocContextPtr);
5923Debug.Assert(pGenDataLocal[i].allocContextLimit == pGenerationData[i].allocContextLimit);
5976Debug.ValidateHResult(hr, hrLocal);
5979Debug.Assert(*pNeeded == pNeededLocal);
5986Debug.Assert(pFillPointersLocal[i] == pFinalizationFillPointers[i]);
6019Debug.ValidateHResult(hr, hrLocal);
6022Debug.Assert(*assemblyLoadContext == assemblyLoadContextLocal);
6038Debug.Assert(version == _legacyImpl9.GetBreakingChangeVersion());
6100Debug.ValidateHResult(hr, hrLocal);
6104Debug.Assert(*rcw == rcwLocal);
6106Debug.Assert(*pNeeded == neededLocal);
6111Debug.Assert(mowList[i] == mowListLocal![i]);
6144Debug.ValidateHResult(hr, hrLocal);
6147Debug.Assert(*isComWrappersCCW == isComWrappersCCWLocal);
6185Debug.ValidateHResult(hr, hrLocal);
6189Debug.Assert(*managedObject == managedObjectLocal);
6191Debug.Assert(*refCount == refCountLocal);
6226Debug.ValidateHResult(hr, hrLocal);
6229Debug.Assert(*isComWrappersRCW == isComWrappersRCWLocal);
6260Debug.ValidateHResult(hr, hrLocal);
6263Debug.Assert(*identity == identityLocal);
6314Debug.ValidateHResult(hr, hrLocal);
6317Debug.Assert(*isTrackedType == isTrackedTypeLocal);
6318Debug.Assert(*hasTaggedMemory == hasTaggedMemoryLocal);
6358Debug.ValidateHResult(hr, hrLocal);
6361Debug.Assert(*taggedMemory == taggedMemoryLocal);
6362Debug.Assert(*taggedMemorySizeInBytes == taggedMemorySizeInBytesLocal);
6395Debug.ValidateHResult(hr, hrLocal);
6398Debug.Assert(*allocPtr == allocPtrLocal);
6399Debug.Assert(*allocLimit == allocLimitLocal);
6418Debug.ValidateHResult(hr, hrLocal);
6421Debug.Assert(DebugTraverseLoaderHeapBlocks.Count == 0,
6423Debug.Assert(_debugTraverseLoaderDebugCount == (uint)cdacCount,
6461Debug.ValidateHResult(hr, hrLocal);
6464Debug.Assert(*pLoaderAllocator == pLoaderAllocatorLocal);
6555Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC needed: {(pNeeded != null ? *pNeeded : -1)}, DAC needed: {pNeededLocal}");
6565Debug.Assert(cdacName == dacName, $"HeapName[{i}] - cDAC: {cdacName}, DAC: {dacName}");
6612Debug.Assert(pNeeded is null || *pNeeded == pNeededLocal, $"cDAC needed: {(pNeeded != null ? *pNeeded : -1)}, DAC needed: {pNeededLocal}");
6618Debug.Assert(hrLocal == hr, $"cDAC: {hr:x}, DAC: {hrLocal:x}");
6623Debug.Assert(pLoaderHeaps[i] == pLoaderHeapsLocal[i], $"Heap[{i}] - cDAC: {pLoaderHeaps[i]:x}, DAC: {pLoaderHeapsLocal[i]:x}");
6624Debug.Assert(pKinds[i] == pKindsLocal[i], $"Kind[{i}] - cDAC: {pKinds[i]}, DAC: {pKindsLocal[i]}");
6645Debug.ValidateHResult(hr, hrLocal);
6670Debug.ValidateHResult(hr, hrLocal);
6695Debug.ValidateHResult(hr, hrLocal);
6748Debug.ValidateHResult(hr, hrLocal);
6752Debug.Assert(*GCStaticsAddress == GCStaticsAddressLocal);
6754Debug.Assert(*nonGCStaticsAddress == nonGCStaticsAddressLocal);
6802Debug.ValidateHResult(hr, hrLocal);
6806Debug.Assert(*nonGCStaticsAddress == nonGCStaticsAddressLocal);
6808Debug.Assert(*GCStaticsAddress == GCStaticsAddressLocal);
6842Debug.ValidateHResult(hr, hrLocal);
6845Debug.Assert(*initializationStatus == initializationStatusLocal);
6973Debug.ValidateHResult(hr, hrLocal);
6976Debug.Assert(*pNeeded == neededLocal, $"cDAC: {*pNeeded}, DAC: {neededLocal}");
6979Debug.Assert(values[i].MethodDesc == valuesLocal[i].MethodDesc, $"cDAC: {values[i].MethodDesc:x}, DAC: {valuesLocal[i].MethodDesc:x}");
6980Debug.Assert(values[i].DefiningMethodTable == valuesLocal[i].DefiningMethodTable, $"cDAC: {values[i].DefiningMethodTable:x}, DAC: {valuesLocal[i].DefiningMethodTable:x}");
6981Debug.Assert(values[i].DefiningModule == valuesLocal[i].DefiningModule, $"cDAC: {values[i].DefiningModule:x}, DAC: {valuesLocal[i].DefiningModule:x}");
6982Debug.Assert(values[i].Token == valuesLocal[i].Token, $"cDAC: {values[i].Token}, DAC: {valuesLocal[i].Token}");
6983Debug.Assert(values[i].Entrypoint == valuesLocal[i].Entrypoint, $"cDAC: {values[i].Entrypoint:x}, DAC: {valuesLocal[i].Entrypoint:x}");
6984Debug.Assert(values[i].Slot == valuesLocal[i].Slot, $"cDAC: {values[i].Slot}, DAC: {valuesLocal[i].Slot}");
7023Debug.Assert(countLocal == (uint)_methods.Count);
7054Debug.ValidateHResult(hr, hrLocal);
7101Debug.ValidateHResult(hr, hrLocal);
7104Debug.Assert(pDynamicAdaptationMode == null || *pDynamicAdaptationMode == dynamicAdaptationModeLocal);
SOSDacImpl.IXCLRDataProcess.cs (28)
167Debug.ValidateHResult(hr, hrLocal);
219Debug.ValidateHResult(hr, hrLocal);
222Debug.Assert(*type == typeLocal, $"cDAC: {*type}, DAC: {typeLocal}");
326Debug.ValidateHResult(hr, hrLocal);
329Debug.Assert(nameLen is null || *nameLen == nameLenLocal);
332Debug.Assert(new ReadOnlySpan<char>(nameBuf, (int)nameLenLocal)
337Debug.Assert(*displacement == displacementLocal);
422Debug.ValidateHResult(hr, hrLocal);
473Debug.ValidateHResult(hr, hrLocal);
539Debug.ValidateHResult(hr, hrLocal);
595Debug.ValidateHResult(hr, hrLocal);
645Debug.ValidateHResult(hr, hrLocal);
726Debug.ValidateHResult(hr, hrLocal);
992Debug.ValidateHResult(hr, hrLocal);
1038Debug.ValidateHResult(hr, hrLocal);
1080Debug.ValidateHResult(hr, hrLocal);
1254Debug.ValidateHResult(hr, hrLocal);
1257Debug.Assert(outBufferSize == sizeof(uint) && outBuffer is not null);
1260Debug.Assert(revision == legacyRevision);
1455Debug.ValidateHResult(hr, hrLocal);
1456Debug.Assert(*flags == flagsLocal);
1500Debug.ValidateHResult(hr, hrLocal);
1503Debug.Assert(flags == flagsLocal);
1567Debug.ValidateHResult(hr, hrLocal);
1633Debug.ValidateHResult(hr, hrLocal);
1666Debug.ValidateHResult(hr, hrLocal);
1735Debug.ValidateHResult(hr, hrLocal);
1759Debug.ValidateHResult(hr, hrLocal);
Microsoft.Diagnostics.NETCore.Client (10)
Microsoft.DiaSymReader (20)
Microsoft.DotNet.ApiCompatibility (6)
Microsoft.DotNet.Build.Tasks.VisualStudio (1)
Microsoft.DotNet.Cli.Telemetry (5)
Microsoft.DotNet.Cli.Utils (5)
Microsoft.DotNet.HotReload.Watch (38)
Microsoft.DotNet.HotReload.WebAssembly.Browser (5)
Microsoft.DotNet.NativeWrapper (1)
Microsoft.DotNet.PackageValidation (2)
Microsoft.DotNet.ProjectTools (17)
Microsoft.DotNet.SdkResolver (1)
Microsoft.DotNet.StrongName (1)
Microsoft.DotNet.XliffTasks (1)
Microsoft.Extensions.AI (24)
Microsoft.Extensions.AI.Abstractions (16)
Microsoft.Extensions.AI.Evaluation.Safety (2)
Microsoft.Extensions.AI.OpenAI (2)
Microsoft.Extensions.Caching.Hybrid (32)
..\..\..\..\src\Libraries\Microsoft.Extensions.Caching.Hybrid\Internal\BufferChunk.cs (10)
31Debug.Assert(array is not null, "expected valid array input");
41Debug.Assert(!ReturnToPool, "do not return right-sized arrays");
42Debug.Assert(Length == array.Length, "array length not respected");
47Debug.Assert(array is not null, "expected valid array input");
48Debug.Assert(length >= 0, "expected valid length");
52Debug.Assert(ReturnToPool == returnToPool, "return-to-pool not respected");
53Debug.Assert(Length == length, "length not respected");
84Debug.Assert(OversizedArray is null && !ReturnToPool, "expected clean slate after recycle");
98Debug.Assert(copy.Length == Length, "same length expected");
99Debug.Assert(!copy.ReturnToPool, "do not return to pool");
Microsoft.Extensions.Caching.Hybrid.Tests (1)
Microsoft.Extensions.Caching.Memory (2)
Microsoft.Extensions.Caching.StackExchangeRedis (9)
Microsoft.Extensions.Configuration (5)
Microsoft.Extensions.Configuration.Binder (9)
Microsoft.Extensions.Configuration.Binder.SourceGeneration (72)
Microsoft.Extensions.Configuration.EnvironmentVariables (6)
Microsoft.Extensions.Configuration.Json (1)
Microsoft.Extensions.DataIngestion (6)
Microsoft.Extensions.DataIngestion.Markdig (2)
Microsoft.Extensions.DependencyInjection (20)
Microsoft.Extensions.DependencyInjection.Abstractions (11)
Microsoft.Extensions.DependencyModel (14)
Microsoft.Extensions.Diagnostics (17)
Microsoft.Extensions.Diagnostics.Abstractions (1)
Microsoft.Extensions.DotNetDeltaApplier (6)
Microsoft.Extensions.FileProviders.Embedded (1)
Microsoft.Extensions.FileProviders.Physical (6)
Microsoft.Extensions.Hosting (4)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.Hosting.WindowsServices (3)
Microsoft.Extensions.Http (9)
Microsoft.Extensions.Identity.Core (5)
Microsoft.Extensions.Logging (5)
Microsoft.Extensions.Logging.Abstractions (6)
Microsoft.Extensions.Logging.AzureAppServices (1)
Microsoft.Extensions.Logging.Configuration (1)
Microsoft.Extensions.Logging.Console (23)
Microsoft.Extensions.Logging.Debug (2)
Microsoft.Extensions.Logging.EventSource (17)
Microsoft.Extensions.Logging.Generators (11)
Microsoft.Extensions.Logging.MSBuild (1)
Microsoft.Extensions.ObjectPool (1)
Microsoft.Extensions.Options.DataAnnotations (4)
Microsoft.Extensions.Primitives (4)
Microsoft.Extensions.ServiceDiscovery (4)
Microsoft.Extensions.ServiceDiscovery.Dns (10)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests.Fuzzing (1)
Microsoft.Extensions.TimeProvider.Testing (1)
Microsoft.Extensions.Validation.ValidationsGenerator (5)
Microsoft.Extensions.VectorData.Abstractions (5)
Microsoft.Gen.Logging (1)
Microsoft.Interop.ComInterfaceGenerator (15)
Microsoft.Interop.JavaScript.JSImportGenerator (3)
Microsoft.Interop.LibraryImportGenerator (3)
Microsoft.Interop.LibraryImportGenerator.Downlevel (2)
Microsoft.Interop.SourceGeneration (16)
Microsoft.JSInterop (4)
Microsoft.Maui (11)
Microsoft.Maui.Controls (5)
Microsoft.Maui.Controls.Build.Tasks (1)
Microsoft.Maui.Controls.Foldable (4)
Microsoft.Maui.Controls.Xaml (14)
Microsoft.Maui.Essentials (10)
Microsoft.Maui.Graphics (8)
Microsoft.Maui.Graphics.Skia (5)
Microsoft.Maui.Graphics.Text.Markdig (1)
Microsoft.Maui.Graphics.Win2D.WinUI.Desktop (2)
Microsoft.Maui.Maps (3)
Microsoft.ML.AutoML.Samples (1)
Microsoft.ML.Core (11)
Microsoft.ML.CpuMath (3)
Microsoft.ML.Data (1)
Microsoft.ML.DataView (48)
Microsoft.ML.ImageAnalytics (6)
Microsoft.ML.InternalCodeAnalyzer (5)
Microsoft.ML.TestFramework (2)
Microsoft.ML.TestFrameworkCommon (1)
Microsoft.ML.Tokenizers (115)
Microsoft.ML.Tokenizers.Data.Tests (1)
Microsoft.ML.Tokenizers.Tests (15)
Microsoft.ML.TorchSharp (7)
Microsoft.ML.Transforms (1)
Microsoft.NET.Build.Containers (13)
Microsoft.NET.Build.Tasks (6)
Microsoft.NET.HostModel (46)
Microsoft.Net.Http.Headers (3)
Microsoft.NET.Sdk.BlazorWebAssembly.Tasks (1)
Microsoft.NET.Sdk.Publish.Tasks (21)
Microsoft.NET.Sdk.Razor.Tasks (2)
Microsoft.NET.Sdk.StaticWebAssets.Tasks (1)
Microsoft.Private.Windows.Core (71)
Microsoft.SourceLink.AzureDevOpsServer.Git (5)
Microsoft.SourceLink.AzureRepos.Git (5)
Microsoft.SourceLink.Bitbucket.Git (5)
Microsoft.SourceLink.Common (4)
Microsoft.SourceLink.Gitea (4)
Microsoft.SourceLink.Gitee (4)
Microsoft.SourceLink.GitHub (4)
Microsoft.SourceLink.GitLab (4)
Microsoft.SourceLink.GitWeb (4)
Microsoft.SourceLink.Tools.Package (1)
Microsoft.TemplateEngine.Cli (2)
Microsoft.TemplateEngine.Core (3)
Microsoft.TestPlatform.AdapterUtilities (4)
Microsoft.TestPlatform.Build (5)
Microsoft.TestPlatform.CommunicationUtilities (5)
Microsoft.TestPlatform.CoreUtilities (5)
Microsoft.TestPlatform.CrossPlatEngine (5)
Microsoft.TestPlatform.Extensions.BlameDataCollector (4)
Microsoft.TestPlatform.Filter.Source (2)
Microsoft.TestPlatform.PlatformAbstractions (10)
Microsoft.TestPlatform.TestHostRuntimeProvider (4)
Microsoft.TestPlatform.Utilities (4)
Microsoft.VisualBasic.Core (344)
Microsoft\VisualBasic\Collection.vb (17)
58Debug.Assert(m_KeyedNodesHash.ContainsKey(Key), "We got an argumentexception from a hashtable add, but it wasn't a duplicate key.")
78Debug.Assert(BeforeNode IsNot Nothing)
93Debug.Assert(AfterNode IsNot Nothing)
156Debug.Assert(node IsNot Nothing)
162Debug.Assert(node.m_Key IsNot Nothing, "How can that be? We just found it by its key.")
170Debug.Assert(node Is Nothing)
178Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
197Debug.Assert(node IsNot Nothing, "Should have thrown rather than returning Nothing")
213Debug.Assert(node IsNot Nothing)
337Debug.Assert(CultureInfo IsNot Nothing)
385Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we remove a non-existent node ?")
448Debug.Assert(NodeToInsertBefore IsNot Nothing, "FastList.InsertBefore: NodeToInsertBefore may not be nothing")
456Debug.Assert(NodeToInsertAfter IsNot Nothing, "FastList.InsertAfter: NodeToInsertAfter may not be nothing")
514Debug.Assert(NodeToBeDeleted IsNot Nothing, "How can we delete a non-existent node ?")
518Debug.Assert(NodeToBeDeleted Is m_StartOfList, "How can any node besides the first node not have a previous node ?")
571Debug.Assert(NewOrRemovedNode IsNot Nothing, "AdjustIndexes: Node shouldn't be Nothing")
681Debug.Assert(node IsNot Nothing, "Should have thrown exception rather than return Nothing")
Microsoft\VisualBasic\CompilerServices\ConversionResolution.vb (34)
150Debug.Assert(GetTypeCode(Result.GetType()) = tc, "Widest type is invalid")
160Debug.Assert(TypeCode.Empty = 0, "wrong value!")
161Debug.Assert(TypeCode.Object = 1, "wrong value!")
162Debug.Assert(TypeCode.Boolean = 3, "yte is wrong value!")
163Debug.Assert(TypeCode.Char = 4, "wrong value!")
164Debug.Assert(TypeCode.SByte = 5, "wrong value!")
165Debug.Assert(TypeCode.Byte = 6, "wrong value!")
166Debug.Assert(TypeCode.Int16 = 7, "wrong value!")
167Debug.Assert(TypeCode.UInt16 = 8, "wrong value!")
168Debug.Assert(TypeCode.Int32 = 9, "wrong value!")
169Debug.Assert(TypeCode.UInt32 = 10, "wrong value!")
170Debug.Assert(TypeCode.Int64 = 11, "wrong value!")
171Debug.Assert(TypeCode.UInt64 = 12, "wrong value!")
172Debug.Assert(TypeCode.Single = 13, "wrong value!")
173Debug.Assert(TypeCode.Double = 14, "wrong value!")
174Debug.Assert(TypeCode.Decimal = 15, "wrong value!")
175Debug.Assert(TypeCode.DateTime = 16, "wrong value!")
176Debug.Assert(TypeCode.String = 18, "wrong value!")
185Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.")
204Debug.Assert(IsIntrinsicType(targetTypeCode) AndAlso IsIntrinsicType(sourceTypeCode), "expected intrinsics here")
213Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.")
250Debug.Assert(False, "all conversions from interface should have been handled by now")
331Debug.Assert(Not IsInterface(sourceType),
362Debug.Assert(IsInterface(targetInterface), "Non-Interface type unexpected!!!")
363Debug.Assert(IsArrayType(sourceArrayType), "Non-Array type unexpected!!!")
478Debug.Assert(Not targetType.IsByRef AndAlso Not sourceType.IsByRef, "ByRef types unexpected.")
590Debug.Assert(types.Count > 0, "unexpected empty set")
597Debug.Assert(candidate Is maxEncompassing OrElse Not Encompasses(maxEncompassing, candidate),
616Debug.Assert(types.Count > 0, "unexpected empty set")
624Debug.Assert(candidate Is maxEncompassed OrElse Not Encompasses(candidate, maxEncompassed),
839Debug.Assert(Not wideningOnly AndAlso sourceDeriveds.Count > 0, "unexpected state")
848Debug.Assert(Not wideningOnly AndAlso targetBases.Count > 0, "unexpected state")
944Debug.Assert(ClassifyPredefinedConversion(targetType, sourceType) = ConversionClass.None,
979Debug.Assert(operatorSet.Count > 0, "expected operators")
Microsoft\VisualBasic\CompilerServices\LikeOperator.vb (31)
78Debug.Assert(Options <> CompareOptions.Ordinal, "Char expansion check unexpected during binary compare")
455Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text")
456Debug.Assert(Not MatchBothCharsOfExpandedCharInRight OrElse Not UseUnexpandedCharForRight, "Conflicting compare options")
493Debug.Assert(LeftEnd < LeftLength AndAlso RightEnd < RightLength, "Comparing chars beyond end of string")
517Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text")
537Debug.Assert(Comparer IsNot Nothing, "Like Operator - Comparer expected for option compare text")
563Debug.Assert(PatternIndex <= PatternLength AndAlso
567Debug.Assert(RangeList Is Nothing OrElse ValidatePatternWithoutMatching, "Unexpected options to MatchRange")
784Debug.Assert(Not ValidatePatternWithoutMatching, "Unexpected string matching when validating pattern string")
912Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type")
916Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type")
924Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type")
928Debug.Assert(PatType = PatternType.STRING, "Unexpected pattern group type")
942Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type")
946Debug.Assert(PatType = PatternType.STAR OrElse PatType = PatternType.NONE, "Unexpected pattern group type")
958Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type")
962Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type")
971Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type")
975Debug.Assert(PatType = PatternType.EXCLIST OrElse PatType = PatternType.INCLIST, "Unexpected pattern group type")
1165Debug.Assert(False, "Unexpected pattern kind")
1190Debug.Assert(PatternIndex <= PatternLength AndAlso
1229Debug.Assert(PatternGroups IsNot Nothing AndAlso
1281Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.NONE, "Unexpected pattern end")
1310Debug.Assert(False, "Unexpected pattern kind")
1356Debug.Assert(PatternGroups(PGIndex).PatType = PatternType.STAR, "Unexpected start of pattern groups list")
1498Debug.Assert(SourceIndex <= PGCurrent.MaxSourceIndex, "Pattern matching lost")
1524Debug.Assert(PatternGroups(PGPrevMismatchIndex).PatType <> PatternType.NONE, "Bad previous mismatch index")
1605Debug.Assert(PG.PatType = PatternType.EXCLIST OrElse PG.PatType = PatternType.INCLIST, "Unexpected pattern group")
1611Debug.Assert(RangeList IsNot Nothing AndAlso RangeList.Count > 0, "Empty RangeList unexpected")
1617Debug.Assert(Range.Start >= 0, "NULL Range start unexpected")
1729Debug.Assert(Options <> CompareOptions.Ordinal, "This method should not be invoked in Option compare binary mode")
Microsoft\VisualBasic\CompilerServices\NewLateBinding.vb (27)
522Debug.Assert(False, "the resolution should have thrown an exception")
720Debug.Assert(False, "the resolution should have thrown an exception - should never reach here")
1096Debug.Assert(False, "the resolution should have thrown an exception")
1182Debug.Assert(baseReference IsNot Nothing, "Nothing unexpected")
1183Debug.Assert(arguments IsNot Nothing, "Nothing unexpected")
1184Debug.Assert(argumentNames IsNot Nothing, "Nothing unexpected")
1185Debug.Assert(typeArguments IsNot Nothing, "Nothing unexpected")
1217Debug.Assert(False, "If ReportErrors is True, GetMembers should have thrown above")
1244Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.")
1255Debug.Assert(targetProcedure.IsProperty, "advertised property method isn't.")
1259Debug.Assert(propInfo.GetSetMethod Is Nothing OrElse HasIsExternalInitModifier(propInfo.GetSetMethod), "expected error condition")
1263Debug.Assert(propInfo.GetGetMethod Is Nothing, "expected error condition")
1293Debug.Assert(baseReference IsNot Nothing, "expected a base reference")
1294Debug.Assert(methodName IsNot Nothing, "expected method name")
1295Debug.Assert(members IsNot Nothing AndAlso members.Length > 0, "expected members")
1296Debug.Assert(arguments IsNot Nothing AndAlso
1353Debug.Assert(failure = OverloadResolution.ResolutionFailure.None OrElse Not reportErrors,
1357Debug.Assert(resolutionResult Is Nothing, "resolution failed so should have no result")
1361Debug.Assert(resolutionResult IsNot Nothing, "resolution didn't fail, so should have result")
1384Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
1415Debug.Assert(resolutionResult.IsMethod, "must be a method")
1429Debug.Assert(GetCallTarget(resolutionResult, lookupFlags).Name.StartsWith("set_"), "expected set accessor")
1460Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
1483Debug.Assert(False, "not a method or property??")
1493Debug.Assert(targetProcedure IsNot Nothing AndAlso arguments IsNot Nothing, "expected arguments")
1504Debug.Assert(arguments.Length > 0, "must have an argument for property set Value")
1515Debug.Assert(GetCallTarget(targetProcedure, lookupFlags).Name.StartsWith("set_"), "expected set accessor")
Microsoft\VisualBasic\CompilerServices\OverloadResolution.vb (50)
98Debug.Assert(IsNumericType(leftType) AndAlso Not IsEnum(leftType) AndAlso
105Debug.Assert(GetTypeCode(leftType) <> GetTypeCode(rightType),
414Debug.Assert(False, "Unexpected comparison type!!!")
424Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce),
493Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!")
654Debug.Assert((baseReference IsNot Nothing AndAlso baseReference.IsWindowsRuntimeObject) OrElse
686Debug.Assert(False, "unexpected code path")
728Debug.Assert(arguments Is Nothing OrElse arguments.Length = argumentCount, "Inconsistency in arguments!!!")
783Debug.Assert(propertyBlock.GetSetMethod Is Nothing OrElse
790Debug.Assert(setMethod IsNot Nothing, "must have set here")
813Debug.Assert(False, "what is this? just ignore it.")
822Debug.Assert(candidateSignature IsNot Nothing, "must have signature if we have a method")
876Debug.Assert(Not collectOnlyOperators, "didn't expect operator with paramarray")
1040Debug.Assert(Not IsGenericParameter(argumentType), "Generic parameter unexpected!!!")
1116Debug.Assert(Not parameterType.IsByRef, "didn't expect byref parameter type here")
1117Debug.Assert(IsRawGeneric(targetProcedure), "Type inference for instantiated generic unexpected!!!")
1171Debug.Assert(parameterTypeParameters.Length = argumentTypeArguments.Length,
1219Debug.Assert(IsParamArray(parameter), "expected ParamArray parameter")
1319Debug.Assert(targetProcedure.IsMethod, "we shouldn't be inferring type arguments for non-methods")
1348Debug.Assert(parameter IsNot Nothing AndAlso parameterType IsNot Nothing)
1426Debug.Assert(Not (errors Is Nothing AndAlso
1449Debug.Assert(arguments.Length <= parameters.Length OrElse
1486Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex,
1527Debug.Assert(arguments.Length - argIndex <= 1,
1578Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
1672Debug.Assert(typeArguments.Length = targetProcedure.TypeParameters.Length, "expected length match")
1715Debug.Assert(targetProcedure.ArgumentsValidated,
1717Debug.Assert(matchedArguments.Length = parameters.Length OrElse
1720Debug.Assert(arguments.Length <= parameters.Length OrElse
1747Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex,
1775Debug.Assert(arguments.Length - argIndex = 1,
1803Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
1822Debug.Assert(Not matchedParameters(paramIndex), "named argument match collision")
1834Debug.Assert(parameters(index).IsOptional,
1857Debug.Assert(arguments.Length <= parameters.Length OrElse
1890Debug.Assert(paramIndex = targetProcedure.ParamArrayIndex,
1915Debug.Assert(arguments.Length - argIndex <= 1,
1942Debug.Assert(parameters.Length > 0, "expected some parameters here") 'Candidate collection guarantees this.
2006Debug.Assert(copyBack.Length = arguments.Length, "array sizes must match")
2007Debug.Assert(parameterResults.Length = targetProcedure.Parameters.Length, "parameter arrays must match")
2113Debug.Assert(candidate.ArgumentMatchingDone = False, "Argument matching being done multiple times!!!")
2217Debug.Assert(False, "Unexpected comparison type!!!")
2296Debug.Assert(Not (leftWinsAtLeastOnce AndAlso rightWinsAtLeastOnce),
2357Debug.Assert(candidateCount = 1, "Surprising overload candidate remains.")
2462Debug.Assert(errors IsNot Nothing, "expected error table")
2477Debug.Assert(errors IsNot Nothing, "expected error table")
2490Debug.Assert(errors IsNot Nothing, "expected error table")
2499Debug.Assert(errors IsNot Nothing, "expected error table")
2552Debug.Assert(result = False AndAlso errors.Count > 0, "expected this candidate to fail")
2565Debug.Assert(candidateReportCount > 0, "expected at least one candidate")
Microsoft\VisualBasic\CompilerServices\Symbols.vb (28)
181Debug.Assert(IsUserDefinedOperator(method), "expected operator here")
431Debug.Assert(Not IsInterface(implementor), "interfaces can't implement, so why call this?")
432Debug.Assert(IsInterface([interface]), "expected interface, not " & [interface].FullName)
447Debug.Assert((Not derived.IsByRef) AndAlso (Not derived.IsPointer))
448Debug.Assert((Not base.IsByRef) AndAlso (Not base.IsPointer))
517Debug.Assert(type.GetGenericTypeDefinition IsNot Nothing, "expected bound generic type")
523Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter")
530Debug.Assert(IsGenericParameter(genericParameter), "expected type parameter")
542Debug.Assert(genericMethodDef IsNot Nothing AndAlso IsRawGeneric(genericMethodDef), "Uninstantiated generic expected!!!")
563Debug.Assert(referringType.DeclaringMethod.IsGenericMethodDefinition, "Unexpected generic method instantiation!!!")
626Debug.Assert(method1 IsNot Nothing AndAlso IsRawGeneric(method1), "Generic method def expected!!!")
627Debug.Assert(method2 IsNot Nothing AndAlso IsRawGeneric(method2), "Generic method def expected!!!")
666Debug.Assert(False, "unexpected membertype")
678Debug.Assert(type.HasElementType, "expected type with element type")
708Debug.Assert(parameters IsNot Nothing, "expected parameter array")
938Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object")
999Debug.Assert(Me.IsWindowsRuntimeObject(), "Expected a Windows Runtime Object")
1146Debug.Assert(Me.IsArray, "expected array when getting array value")
1147Debug.Assert(indices IsNot Nothing, "expected valid indices")
1195Debug.Assert(Me.IsArray, "expected array when setting array value")
1196Debug.Assert(arguments IsNot Nothing, "expected valid indices")
1258Debug.Assert(callTarget IsNot Nothing, "must have valid MethodBase")
1260Debug.Assert(Not targetProcedure.IsGeneric OrElse
1390Debug.Assert(rawMethod IsNot Nothing)
1478Debug.Assert(Me.ArgumentsValidated, "can't bind without validating arguments")
1479Debug.Assert(Me.IsMethod, "binding to a non-method")
1491Debug.Assert(Me.IsMethod, "casting a non-method to a method")
1496Debug.Assert(Me.IsProperty, "casting a non-property to a property")
Microsoft\VisualBasic\FileIO\FileSystem.vb (44)
685Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(directory),
722Debug.Assert(GetParentPath(FullNewPath).Equals(GetParentPath(file),
863Debug.Assert(StrCollection IsNot Nothing, "StrCollection is NULL")
895Debug.Assert([Enum].IsDefined(operation), "Invalid Operation")
936Debug.Assert(TargetDirectoryFullPath.Length > SourceDirectoryFullPath.Length, "Target path should be longer")
964Debug.Assert([Enum].IsDefined(operation), "Invalid Operation")
965Debug.Assert(sourceDirectoryPath <> "" And IO.Path.IsPathRooted(sourceDirectoryPath), "Invalid Source")
966Debug.Assert(targetDirectoryPath <> "" And IO.Path.IsPathRooted(targetDirectoryPath), "Invalid Target")
987Debug.Assert(IO.Directory.Exists(targetDirectoryPath), "Should be able to create Target Directory")
1013Debug.Assert([Enum].IsDefined(Operation), "Invalid Operation")
1014Debug.Assert(Exceptions IsNot Nothing, "Null exception list")
1015Debug.Assert(SourceDirectoryNode IsNot Nothing, "Null source node")
1032Debug.Assert(IO.Directory.Exists(SourceDirectoryNode.TargetPath), "TargetPath should have existed or exception should be thrown")
1095Debug.Assert([Enum].IsDefined(operation), "Invalid Operation")
1267Debug.Assert(FilePath <> "" AndAlso IO.Path.IsPathRooted(FilePath), FilePath)
1268Debug.Assert(Text <> "", "Empty text")
1313Debug.Assert(ByteCount <= ByteBuffer.Length)
1330Debug.Assert(Not (TypeOf ex Is ArgumentException Or TypeOf ex Is ArgumentOutOfRangeException Or
1382Debug.Assert(Results IsNot Nothing, "Results is NULL")
1449Debug.Assert(Path <> "" AndAlso IO.Path.IsPathRooted(Path), Path)
1450Debug.Assert(Path.Equals(IO.Path.GetFullPath(Path)), Path)
1451Debug.Assert(NewName <> "", "Null NewName")
1452Debug.Assert(ArgumentName <> "", "Null argument name")
1485Debug.Assert(Not FullPath = "" AndAlso IO.Path.IsPathRooted(FullPath), "Must be full path")
1497Debug.Assert(DInfo.GetFiles(IO.Path.GetFileName(FullPath)).Length = 1, "Must found exactly 1")
1500Debug.Assert(DInfo.GetDirectories(IO.Path.GetFileName(FullPath)).Length = 1,
1517Debug.Assert(Not (TypeOf ex Is ArgumentException OrElse
1600Debug.Assert([Enum].IsDefined(Operation))
1601Debug.Assert([Enum].IsDefined(TargetType))
1602Debug.Assert(FullSourcePath <> "" And IO.Path.IsPathRooted(FullSourcePath), "Invalid FullSourcePath")
1603Debug.Assert(FullTargetPath <> "" And IO.Path.IsPathRooted(FullTargetPath), "Invalid FullTargetPath")
1604Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???")
1667Debug.Assert(FullPath <> "" And IO.Path.IsPathRooted(FullPath), "FullPath must be a full path")
1668Debug.Assert(ShowUI <> UIOptionInternal.NoUI, "Why call ShellDelete if ShowUI is NoUI???")
2096Debug.Assert(IO.Directory.Exists(DirectoryPath), "Directory does not exist")
2097Debug.Assert(TargetDirectoryPath <> "" And IO.Path.IsPathRooted(TargetDirectoryPath), "Invalid TargetPath")
2157Debug.Assert(Encoding IsNot Nothing, "Null Decoder")
2158Debug.Assert(Text <> "", "Empty Text")
2179Debug.Assert(ByteBuffer IsNot Nothing, "Null ByteBuffer")
2180Debug.Assert(Count > 0, Count.ToString(CultureInfo.InvariantCulture))
2181Debug.Assert(m_Decoder IsNot Nothing, "Null Decoder")
2182Debug.Assert(m_Preamble IsNot Nothing, "Null Preamble")
2211Debug.Assert(CharCount = ExpectedCharCount, "Should read all characters")
2245Debug.Assert(BigBuffer.Length > SmallBuffer.Length, "BigBuffer should be longer")
Microsoft\VisualBasic\FileIO\TextFieldParser.vb (26)
364Debug.Fail("The TextFieldType is not supported")
656Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer")
657Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader")
662Debug.Assert(BufferLength >= DEFAULT_BUFFER_LENGTH, "Buffer shrunk to below default")
688Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer")
689Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader")
690Debug.Assert(m_Position >= 0 And m_Position <= m_Buffer.Length, "The cursor is out of range")
717Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer")
718Debug.Assert(m_Reader IsNot Nothing, "There's no StreamReader")
719Debug.Assert(m_Position = 0, "Non-zero position")
739Debug.Assert(CharsRead <= m_Buffer.Length - m_CharsRead, "We've read more chars than we have space for")
811Debug.Assert(m_Buffer IsNot Nothing, "There's no buffer")
812Debug.Assert(Cursor >= 0 And Cursor <= m_CharsRead, "The cursor is out of range")
1007Debug.Assert(m_FieldWidths IsNot Nothing, "No field widths")
1070Debug.Assert(Line IsNot Nothing, "We are parsing a Nothing")
1073Debug.Assert(Length > 0, "A blank line shouldn't be parsed")
1076Debug.Assert(Line(0) <> vbCr And Line(0) <> vbLf, "A blank line shouldn't be parsed")
1098Debug.Assert(Line IsNot Nothing, "No Line sent")
1128Debug.Assert(m_FieldWidths(i) > 0, "Bad field width, this should have been caught on input")
1150Debug.Assert(Widths IsNot Nothing, "There are no field widths")
1197Debug.Fail("Delimiter element is empty. This should have been caught on input")
1229Debug.Fail("Unknown TextFieldType")
1281Debug.Assert((m_DelimitersCopy Is Nothing And m_Delimiters Is Nothing) Or (m_DelimitersCopy IsNot Nothing And m_Delimiters IsNot Nothing), "Delimiters and copy are not both Nothing or both not Nothing")
1299Debug.Assert((m_FieldWidthsCopy Is Nothing And m_FieldWidths Is Nothing) Or (m_FieldWidthsCopy IsNot Nothing And m_FieldWidths IsNot Nothing), "FieldWidths and copy are not both Nothing or both not Nothing")
1316Debug.Fail("Unknown TextFieldType")
1414Debug.Assert(m_Delimiters IsNot Nothing, "No delimiters set!")
Microsoft\VisualBasic\FileSystem.vb (12)
56Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
95Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
106Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
114Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
132Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
162Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
199Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
214Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
300Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
315Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
344Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
375Debug.Assert(Not System.Reflection.Assembly.GetCallingAssembly() Is Utils.VBRuntimeAssembly,
Microsoft.VisualStudio.TestPlatform.Common (7)
Microsoft.VisualStudio.TestPlatform.Extensions.Html.TestLogger (4)
Microsoft.VisualStudio.TestPlatform.Extensions.Trx.TestLogger (8)
Microsoft.VisualStudio.TestPlatform.ObjectModel (6)
Microsoft.Web.XmlTransform (34)
Microsoft.Win32.Registry (10)
Microsoft.Win32.SystemEvents (10)
Mono.Cecil (2)
MSBuild (12)
netstandard (1)
NuGet.Build.Tasks (4)
NuGet.CommandLine.XPlat (3)
NuGet.Commands (14)
NuGet.Common (1)
NuGet.Configuration (7)
NuGet.DependencyResolver.Core (2)
NuGet.Frameworks (4)
NuGet.LibraryModel (6)
NuGet.PackageManagement (15)
NuGet.Packaging (78)
NuGet.ProjectModel (9)
NuGet.Protocol (15)
NuGet.Resolver (6)
NuGet.Versioning (6)
PresentationBuildTasks (214)
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecords.cs (27)
687Debug.Fail("Assembly, Type and Attribute records are not cached, so don't ask for one.");
712Debug.Fail("Unknown RecordType");
765Debug.Assert(null == _writeCache[(int)record.RecordType]);
855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); }
864Debug.Fail("Must override RecordType");
902Debug.Assert( value <= 3 && value >= 0 );
1090Debug.Assert(RecordSize < 0);
1500Debug.Assert(_valuePositionPosition != -1,
1683Debug.Assert(_valuePositionPosition != -1,
2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2386Debug.Assert(value <= ExtensionIdMask);
2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
3197set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3284set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3433Debug.Assert(_contentSizePosition != -1,
3478set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was");
4542Debug.Assert( SerializerTypeId != 0 );
4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\BamlRecordWriter.cs (21)
133Debug.Assert(null != DocumentStartRecord);
404Debug.Assert(_deferElementDepth == 0);
405Debug.Assert(_deferComplexPropertyDepth == 0);
406Debug.Assert(_staticResourceElementDepth == 0);
407Debug.Assert(_dynamicResourceElementDepth == 0);
408Debug.Assert(_staticResourceRecordList == null);
426Debug.Assert(_staticResourceElementDepth == 0);
463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section");
782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list");
864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
875Debug.Assert(_deferElementDepth == 2);
1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension);
1081Debug.Assert(typeValue != null);
1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary");
1634Debug.Assert(keyIndex == _deferKeys.Count,
1657Debug.Assert(_deferElementDepth > 0 && CollectingValues,
1665Debug.Assert(valueDeferRecord.Record != null &&
1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlReaderHelper.cs (53)
115Debug.Assert(xamlParser != null, "Cannot have null xaml parser");
116Debug.Assert(parserContext != null, "Cannot have null parser context");
117Debug.Assert(xmlReader != null, "Cannot have null xmlReader");
327Debug.Assert(null != xamlNode, "null returned from the collection");
356Debug.Assert(null != XmlReader);
395Debug.Assert(!IsMoreData(), "Setting state to done but not done parsing.");
428Debug.Assert(null != xamlNode, "null returned from the collection");
1174Debug.Assert(null != typeFullName, "type name not set");
1175Debug.Assert(null != dynamicObjectName, "dynamicObject name not set");
1176Debug.Assert(null != assemblyName, "assembly name not set");
1503Debug.Assert( (null==ContentPropertyInfo && null==ContentPropertyName)
1827Debug.Assert(null == dynamicObject,"DynamicObject should be null for code");
1995Debug.Assert(!endTagHasBeenRead, "Read past end tag on end tag");
2066Debug.Assert(!endTagHasBeenRead);
2216Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2225Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2234Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2243Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2252Debug.Assert(IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2261Debug.Assert (attributeFound || !IsElementScopedAttribute(attribName, attribLocalName, attributeNamespaceUri));
2754Debug.Assert(unknownTagName != null || null != parentType);
3177Debug.Assert(null != assemblyName, "property without an AssemblyName");
3178Debug.Assert(null != declaringTypeFullName, "property without a type name");
3179Debug.Assert(null != dynamicObjectName, "property without a field Name");
3699Debug.Assert(typeAndSerializer == null ||
3753Debug.Assert(CurrentContext.ContextType == ElementContextType.PropertyComplex ||
4132Debug.Assert(null != assemblyName, "property without an AssemblyName");
4133Debug.Assert(null != typeFullName, "property without a type name");
4134Debug.Assert(null != dynamicObjectName, "property without a field Name");
4813Debug.Assert( collectionTypeID >= 0
5051Debug.Assert( xmlNodeType == XmlNodeType.Text ||
5084Debug.Assert( isWhitespace,
5132Debug.Assert (parentNodeType == ElementContextType.Unknown,
5262Debug.Assert(null != XmlReader, "XmlReader is not yet set");
5308Debug.Fail("XmlReader doesn't support LineNumber");
5339Debug.Fail("XmlReader doesn't support LinePosition");
5491Debug.Assert(currentPos > 0 && currentPos < s.Length - 1);
5566Debug.Assert(null != text, "String passed to CollapseText cannot be null");
5567Debug.Assert(textLength > 0, "String passed to Collapsed Text cannot be empty");
5827Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count),
5847Debug.Assert((_nodeIndex == 0 && _xamlNodes.Count == 0 ) || (_nodeIndex < _xamlNodes.Count),
5874Debug.Assert(!value || _insertionIndex == -1, "Attribute node collection is already marked for insertion.");
5933Debug.Assert(_nodeIndex == _xamlNodes.Count, "NodeIndex is larger than node count.");
6001Debug.Assert( _typeConverterDecisionState == TypeConverterDecisionState.ElementEnd,
6064Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart,
6083Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode,
6107Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex])==xamlNode,
6123Debug.Assert( _typeConverterTextWrittenAndNotProcessed != null,
6152Debug.Assert(((XamlNode)_xamlNodes[_typeConverterCandidateIndex]).TokenType==XamlNodeType.ElementStart,
6344Debug.Fail($"State machine checking for TypeConverter syntax has encountered an unexpected XamlNode type {tokenType}");
6428Debug.Assert(null != textFlowData, "No data for TextFlow");
6450Debug.Assert(null != typeRightTag, "ElementType not yet assigned to Node");
6571Debug.Assert(0 == textFlowData.InlineCount, "Text stack still has an inline count");
src\wpf\src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (18)
935Debug.Assert(null != localName, "null localName");
936Debug.Assert(null != xmlNamespace, "null xmlNamespace");
1906Debug.Assert(typeInfo != null, "Must have cached type info at this point");
2304Debug.Assert(memberName != null);
2307Debug.Assert(memberInfo != null);
2322Debug.Assert(targetType != null);
2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace");
2399Debug.Assert(null != localName,"null value passed for localName");
2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace");
2438Debug.Assert(null != localName,"null value passed for localName");
2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace");
2591Debug.Assert(localName != null,"Null localName");
3150Debug.Fail("Should initialize cache prior to compiling");
3421Debug.Fail("Should initialize cache prior to compiling");
3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType");
3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType");
3744Debug.Assert(null != type, "null value for type passed to GetWhitespace");
4006Debug.Assert(_dpLookupHashtable != null,
PresentationCore (2224)
MS\Internal\TextFormatting\Bidi.cs (30)
684Debug.Assert(CharProperty[1, (int) startClass]==1 || (startClass == DirectionClass.ArabicLetter),
687Debug.Assert(CharProperty[1, (int) endClass]==1, ("Cannot use non strong type to resolve neutrals"));
710Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0,
735Debug.Assert(CharProperty[2, (int) characterClass[counter + classIndex]]==0, "Changing class of a fixed class");
846Debug.Assert(startOfNeutrals == PositionInvalid,
891Debug.Assert(startOfDelayed != PositionInvalid,
936Debug.Assert(startOfNeutrals == PositionInvalid,
941Debug.Assert(startOfDelayed != PositionInvalid,
1041Debug.Assert(startOfNeutrals != PositionInvalid,
1080Debug.Assert(startOfNeutrals != PositionInvalid,
1113Debug.Assert(startOfNeutrals == PositionInvalid,
1131Debug.Assert(startOfNeutrals == PositionInvalid,
1144Debug.Assert(startOfDelayed != PositionInvalid,
1158Debug.Assert(startOfNeutrals == PositionInvalid,
1163Debug.Assert(startOfDelayed != PositionInvalid,
1174Debug.Assert(startOfNeutrals != PositionInvalid,
1183Debug.Assert(startOfNeutrals == PositionInvalid,
1201Debug.Assert(startOfDelayed != PositionInvalid,
1205Debug.Assert(lastClass == DirectionClass.EuropeanTerminator,
1212Debug.Assert(startOfNeutrals == PositionInvalid,
1217Debug.Assert(startOfDelayed != PositionInvalid,
1266Debug.Assert(startOfNeutrals != PositionInvalid,
1280Debug.Assert(startOfNeutrals == PositionInvalid,
1285Debug.Assert(startOfDelayed != PositionInvalid,
1317Debug.Assert(startOfNeutrals == PositionInvalid,
1344Debug.Assert(startOfNeutrals == PositionInvalid,
1389Debug.Assert(startOfNeutrals == PositionInvalid,
1425Debug.Assert(startOfDelayed != PositionInvalid,
1567Debug.Assert(startOfNeutrals == PositionInvalid,
2454Debug.Assert(runLengthResolved == runLength,
System\Windows\Input\Stylus\Wisp\PenThreadWorker.cs (11)
151Debug.WriteLine("WorkerOperationGetTabletsInfo.OnDoWork failed due to: {0}{1}", Environment.NewLine, e.ToString());
207Debug.WriteLine("WorkerOperationCreateContext.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString());
314Debug.WriteLine("WorkerOperationRefreshCursorInfo.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString());
356Debug.WriteLine("WorkerOperationGetTabletInfo.OnDoWork failed due to {0}{1}", Environment.NewLine, e.ToString());
396Debug.WriteLine("WorkerOperationWorkerGetUpdatedSizes.OnDoWork failed due to a {0}{1}", Environment.NewLine, e.ToString());
514Debug.Assert(penContext != null);
541Debug.Assert(penContext != null);
932Debug.Assert(properties[StylusPointDescription.RequiredXIndex /*0*/].Id == StylusPointPropertyIds.X, "X isn't where we expect it! Fix PenImc to ask for X at index 0");
933Debug.Assert(properties[StylusPointDescription.RequiredYIndex /*1*/].Id == StylusPointPropertyIds.Y, "Y isn't where we expect it! Fix PenImc to ask for Y at index 1");
1035Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
1089Debug.Assert(pc != null && pc.CommHandle != IntPtr.Zero);
System\Windows\Media\Animation\AnimationStorage.cs (41)
46Debug.Assert( _animationClocks == null
49Debug.Assert( _propertyTriggerLayers == null
78Debug.Assert(animationClock != null);
79Debug.Assert(_dependencyObject.Target != null);
80Debug.Assert(_currentTimeInvalidatedHandler != null);
106Debug.Assert(animationClock != null);
107Debug.Assert(_currentTimeInvalidatedHandler != null);
119Debug.Assert(_dependencyObject == null);
120Debug.Assert(_dependencyProperty == null);
144Debug.Assert(_propertyTriggerLayers != null);
145Debug.Assert(_propertyTriggerLayers.ContainsValue(layer));
149Debug.Assert(index >= 0);
244Debug.Assert(animatedPropertyMap.Count > 0);
245Debug.Assert(animatedPropertyMap[_dependencyProperty.GlobalIndex] != DependencyProperty.UnsetValue);
501Debug.Assert( _animationClocks != null
509Debug.Assert(index > -1,
538Debug.Assert(_hasStickySnapshotValue,
550Debug.Assert(_animationClocks.Count > 0);
588Debug.Assert(animationClocks != null,
590Debug.Assert(animationClocks.Count > 0,
592Debug.Assert(!animationClocks.Contains(null),
594Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior),
649Debug.Assert(animationClocks[i] != null);
657Debug.Assert(handoffBehavior == HandoffBehavior.Compose);
658Debug.Assert(storage != null);
659Debug.Assert(storage._animationClocks != null);
703Debug.Assert(animationClocks != null);
704Debug.Assert(!animationClocks.Contains(null));
706Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior),
776Debug.Assert(animation == null || IsAnimationValid(dp, animation));
777Debug.Assert(IsPropertyAnimatable(d, dp));
779Debug.Assert(HandoffBehaviorEnum.IsDefined(handoffBehavior),
848Debug.Assert(storage._animationClocks != null && storage._animationClocks.Count > 0,
895Debug.Assert(storage != null,
916Debug.Assert(storage._snapshotValue != DependencyProperty.UnsetValue);
928Debug.Assert(currentPropertyValue != DependencyProperty.UnsetValue);
938Debug.Assert(count > 0);
970Debug.Assert(clocksCount > 0);
971Debug.Assert(defaultDestinationValue != DependencyProperty.UnsetValue);
1082Debug.Assert( AnimatedPropertyMapField.GetValue(d)[dp.GlobalIndex] == DependencyProperty.UnsetValue
1144Debug.Assert(type == typeof(Vector3D), "Application is trying to create independent animation storage for an unsupported type.");
System\Windows\Media\Animation\Clock.cs (145)
51Debug.Assert(timeline != null);
161Debug.Assert(!IsTimeManager);
190Debug.Assert(!IsTimeManager);
208Debug.Assert(!IsTimeManager);
230Debug.Assert(!IsTimeManager);
268Debug.Assert(!IsTimeManager);
281Debug.Assert(!IsTimeManager);
299Debug.Assert(!IsTimeManager);
326Debug.Assert(!IsTimeManager);
354Debug.Assert(!IsTimeManager);
486Debug.Assert(!IsTimeManager);
572Debug.Assert(!clock.IsTimeManager);
622Debug.Assert(!current.IsTimeManager); // We should not yet be connected to the TimeManager
700Debug.Assert(!IsTimeManager);
775Debug.Assert(!IsTimeManager);
782Debug.Assert(!(IsInteractivelyPaused && PendingInteractivePause));
783Debug.Assert(!(!IsInteractivelyPaused && PendingInteractiveResume));
820Debug.Assert(!IsTimeManager);
827Debug.Assert( !(IsInteractivelyPaused && PendingInteractivePause));
828Debug.Assert( !(!IsInteractivelyPaused && PendingInteractiveResume));
855Debug.Assert(IsRoot);
877Debug.Assert(IsRoot);
948Debug.Assert(IsRoot);
959Debug.Assert(IsRoot);
990Debug.Assert(IsRoot);
1071Debug.Assert(!IsTimeManager);
1107Debug.Assert(!IsTimeManager);
1129Debug.Assert(!IsTimeManager);
1148Debug.Assert(!IsTimeManager);
1224Debug.Assert(!IsTimeManager);
1372Debug.Assert(!IsTimeManager);
1392Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be set to Automatic.");
1409Debug.Assert(!IsTimeManager);
1410Debug.Assert(_parent != null && !_parent.IsTimeManager);
1782Debug.Assert(IsRoot); // root clocks only; non-roots have constant begin time
1783Debug.Assert(_rootData != null);
1788Debug.Assert(!RootBeginPending); // we can have either a begin or a seek, not both
1859Debug.Assert(_beginTime.HasValue);
1910Debug.Assert(IsRoot);
1916Debug.Assert(_rootData.DesiredFrameRate > 0);
1936Debug.Assert(!IsTimeManager);
1937Debug.Assert(!IsInteractivelyStopped);
1938Debug.Assert(_parent._currentClockState != ClockState.Stopped);
1939Debug.Assert(_currentClockState != ClockState.Stopped);
1940Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic.");
1941Debug.Assert(_beginTime.HasValue);
1943Debug.Assert(parentTime >= _beginTime.Value); // We are active or in postfill
1958Debug.Assert(_currentClockState != ClockState.Active);
2166Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value.");
2167Debug.Assert(_currentClockState == ClockState.Active
2185Debug.Assert(this is ClockGroup, "ComputeCurrentIterationWithGrow should only run on ClockGroups.");
2186Debug.Assert(CanGrow, "ComputeCurrentIterationWithGrow should only run on clocks with CanGrow.");
2187Debug.Assert(_currentIterationBeginTime.HasValue, "ComputeCurrentIterationWithGrow should only be called when _currentIterationBeginTime has a value.");
2188Debug.Assert(_resolvedDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _resolvedDuration has a value."); // We must have a computed duration
2189Debug.Assert(_currentDuration.HasTimeSpan, "ComputeCurrentIterationWithGrow should only be called when _currentDuration has a value.");
2250Debug.Assert(!IsTimeManager);
2251Debug.Assert(!IsInteractivelyStopped);
2252Debug.Assert(_parent._currentClockState != ClockState.Stopped);
2253Debug.Assert(_beginTime.HasValue);
2302Debug.Assert(!IsTimeManager);
2303Debug.Assert(!IsInteractivelyStopped);
2304Debug.Assert(_parent._currentClockState != ClockState.Stopped);
2305Debug.Assert(_currentClockState == ClockState.Active); // Must be active at this point
2332Debug.Assert(!IsTimeManager);
2333Debug.Assert(!IsInteractivelyStopped);
2334Debug.Assert(_parent._currentClockState != ClockState.Stopped);
2335Debug.Assert(_currentClockState != ClockState.Stopped);
2336Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic.");
2340Debug.Assert(_currentDuration.TimeSpan > TimeSpan.Zero, "ComputeCurrentTime was entered with _currentDuration <= 0");
2347Debug.Assert(transitionTime <= 1, "The values of the accel and decel attributes incorrectly add to more than 1.0");
2348Debug.Assert(transitionTime >= 0, "The values of the accel and decel attributes incorrectly add to less than 0.0");
2411Debug.Assert(_currentDuration == Duration.Forever, "_currentDuration has an invalid enum value.");
2425Debug.Assert(!IsTimeManager);
2439Debug.Assert(_resolvedDuration == Duration.Forever, "_resolvedDuration should be Forever when NaturalDuration is Automatic.");
2467Debug.Assert(!IsTimeManager);
2468Debug.Assert(!IsInteractivelyStopped || IsRoot);
2472Debug.Assert(_resolvedDuration != Duration.Automatic, "_resolvedDuration should never be Automatic.");
2473Debug.Assert(_currentDuration != Duration.Automatic, "_currentDuration should never be Automatic.");
2495Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan.");
2496Debug.Assert(_currentDuration == _resolvedDuration, "For clocks which cannot grow, _currentDuration must equal _resolvedDuration.");
2508Debug.Assert(_resolvedDuration.HasTimeSpan, "_resolvedDuration is invalid, neither Forever nor a TimeSpan.");
2509Debug.Assert(_currentDuration.HasTimeSpan, "_currentDuration is invalid, neither Forever nor a TimeSpan.");
2518Debug.Assert(_beginTime.HasValue); // _currentIterationBeginTime.HasValue implies _beginTime.HasValue
2547Debug.Assert(repeatBehavior == RepeatBehavior.Forever); // Only other valid enum value
2641Debug.Assert(!IsTimeManager);
2642Debug.Assert(!IsInteractivelyStopped || IsRoot);
2649Debug.Assert(!_currentIterationBeginTime.HasValue, "_currentIterationBeginTime should not have a value when _beginTime has no value.");
2654Debug.Assert(_beginTime.HasValue);
2683Debug.Assert(IsRoot);
2726Debug.Assert(_beginTime == null);
2727Debug.Assert(_currentClockState == ClockState.Stopped);
2751Debug.Assert(!IsInteractivelyPaused); // Enforce invariant: cannot be pausePending when already paused
2752Debug.Assert(!PendingInteractiveResume); // Enforce invariant: cannot be both pause and resumePending
2769Debug.Assert(IsInteractivelyPaused);
2770Debug.Assert(!PendingInteractivePause);
2798Debug.Assert(endOfActivePeriod.HasValue);
2873Debug.Assert(!IsTimeManager);
2898Debug.Assert(parentTime.HasValue); // If parent isn't stopped, it must have valid time and speed
2899Debug.Assert(parentSpeed.HasValue);
2925Debug.Assert(parentTime.HasValue); // Cannot be true unless parent is stopped
2946Debug.Assert(_beginTime.HasValue);
2947Debug.Assert(parentTime.HasValue);
2992Debug.Assert(!IsTimeManager);
2993Debug.Assert(!IsInteractivelyStopped);
2994Debug.Assert(_parent._currentClockState != ClockState.Stopped);
2995Debug.Assert(_beginTime.HasValue);
3067Debug.Assert(!IsTimeManager);
3068Debug.Assert(!IsInteractivelyStopped || IsRoot);
3072Debug.Assert(_rootData != null, "A root Clock must have the _rootData structure initialized.");
3150Debug.Assert(!IsTimeManager);
3151Debug.Assert(_parent != null);
3152Debug.Assert(_parent.CurrentState != ClockState.Stopped);
3155Debug.Assert(HasSeekOccuredAfterLastTick ||
3159Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this);
3160Debug.Assert(CanSlip || _timeline is ParallelTimeline && ((ParallelTimeline)_timeline).SlipBehavior == SlipBehavior.Slip);
3162Debug.Assert(_syncData != null);
3163Debug.Assert(!_syncData.IsInSyncPeriod);
3166Debug.Assert(!_timeline.AutoReverse);
3167Debug.Assert(_timeline.AccelerationRatio == 0);
3168Debug.Assert(_timeline.DecelerationRatio == 0);
3215Debug.Assert(syncClockDuration == Duration.Automatic);
3283Debug.Assert(!IsTimeManager);
3284Debug.Assert(_parent != null);
3285Debug.Assert(_syncData != null);
3286Debug.Assert(_syncData.IsInSyncPeriod);
3289Debug.Assert(_syncData.SyncClock == this || _syncData.SyncClock._parent == this);
3293Debug.Assert(!parentIntervalCollection.IsEmpty); // The parent isn't Stopped, so it must have a TIC
3297Debug.Assert(parentIntervalCollection.IsEmptyOfRealPoints || parentIntervalCollection.FirstNodeTime <= currentParentTimePT);
3298Debug.Assert(currentParentSpeed >= 0);
3386Debug.Assert(!current.IsRoot, "Root nodes never should reset their Slip amounts with ResetSlipOnSubtree(), even when seeking.");
3428Debug.Assert(!IsTimeManager);
3509Debug.Assert(_rootData.DesiredFrameRate > 0);
3537Debug.Assert(!IsTimeManager);
3560Debug.Assert(!IsTimeManager);
3561Debug.Assert(_parent == null);
3562Debug.Assert(_timeManager == null);
3653Debug.Assert(factor != 0); // Divide by zero
3737Debug.Assert(IsRoot); // This should only be called on root-child clocks
3773Debug.Assert(!IsTimeManager);
3852Debug.Assert(!IsTimeManager);
3970Debug.Assert(syncClock != null);
3971Debug.Assert(syncClock.GetCanSlip());
3972Debug.Assert(syncClock.IsRoot || syncClock._timeline.BeginTime.HasValue); // Only roots may later validate their _beginTime
4061Debug.Assert(_syncClockBeginTime.HasValue); // This should never be queried on a root without beginTime
4163Debug.Assert(Math.Abs(optimizedInputTime - inputTime) <= error,
System\Windows\Media\MediaContext.cs (34)
188Debug.Assert(dispatcher.Reserved0 == null);
344Debug.Assert(CheckAccess());
603Debug.Assert(InterlockIsEnabled,
700Debug.Assert(_interlockState == InterlockState.WaitingForResponse,
777Debug.Assert(!InterlockIsWaiting,
842Debug.Assert(InterlockIsWaiting,
1077Debug.Assert(IsClockSupported, "MediaContext.CurrentTime called when QueryPerformaceCounter is not supported");
1336Debug.Assert(_interlockState == InterlockState.Disabled,
1345Debug.Assert(Channel != null);
1366Debug.Assert(dispatcher != null, "Dispatcher required");
1371Debug.Assert(dispatcher.Reserved0 == cm);
1394Debug.Assert(CheckAccess());
1403Debug.Assert(CheckAccess());
1434Debug.Assert(_timeManager != null);
1463Debug.Assert(dispatcher != null);
1464Debug.Assert(iv != null);
1476Debug.Assert(!_isDisposed);
1477Debug.Assert(iv != null);
1504Debug.Assert(dispatcher != null);
1505Debug.Assert(iv != null);
1516Debug.Assert(iv != null);
1566Debug.Assert(callback != null);
1571Debug.Assert(arg != null);
1610Debug.Assert(op != null);
1648Debug.Assert(CheckAccess());
1769Debug.Assert(CheckAccess());
1770Debug.Assert(
2008Debug.Assert(CheckAccess());
2010Debug.Assert(!_isDisposed);
2011Debug.Assert(_registeredICompositionTargets != null);
2114Debug.Assert(_needToCommitChannel, "CommitChannel called with nothing on the channel");
2118Debug.Assert(!InterlockIsWaiting,
2184Debug.Assert(InterlockIsEnabled,
2508Debug.Assert(_interlockState == InterlockState.WaitingForNextFrame
System\Windows\Media\Visual.cs (30)
156Debug.Fail("TYPE_VISUAL or TYPE_VIEWPORT3DVISUAL expected.");
560Debug.Assert(BitmapEffectStateField.GetValue(this) != null);
638Debug.Assert(IsOnChannel(channel));
639Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected));
840Debug.Assert(channelsToCyclicBrushMap[channel] > 0);
866Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0);
891Debug.Assert(cyclicBrushToChannelsMap != null);
892Debug.Assert(cyclicBrushToChannelsMap.ContainsKey(cyclicBrush));
893Debug.Assert(cyclicBrushToChannelsMap[cyclicBrush] > 0);
913Debug.Assert(channelsToCyclicBrushMap != null);
914Debug.Assert(channelsToCyclicBrushMap.ContainsKey(channel));
915Debug.Assert(channelsToCyclicBrushMap[channel] > 0);
1290Debug.Assert(CheckFlagsAnd(VisualFlags.ReentrancyFlag)); // Exit must be matched with Enter. See Enter comments.
1943Debug.Assert(Point.Equals(pointParams.HitPoint, backupHitPoint),
1974Debug.Assert(Matrix.Equals(geometryParams.InternalHitGeometry.Transform.Value, originalMatrix),
2069Debug.Assert(BitmapEffectStateField.GetValue(this) != null);
2200Debug.Assert(bitmapEffectState != null);
2239Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
2297Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
2361Debug.Assert(resultCallback != null);
2422Debug.Assert(intersectionDetail != IntersectionDetail.NotCalculated);
3033Debug.Assert(bed != null, "Must be non-null because otherwise the code would have earlied out where new value is compared against old value.");
3195Debug.Assert(currentBitmapEffect.IsFrozen == emulatingEffect.IsFrozen);
3264Debug.Assert(bitmapEffectState != null);
3278Debug.Assert(EffectField.GetValue(this) == null, "Not expecting both BitmapEffect and Effect to be set on the same node");
3953Debug.Assert(_parent != null, "If oldParent is null, current parent should != null.");
4465Debug.Assert(ancestor != null);
4582Debug.Assert((group == null) || (group.Children.Count > 0));
4657Debug.Assert(ancestor != null);
5216Debug.Assert(cyclicBrushToChannelsMap != null, "Visual brush roots need to have the visual brush to channels map!");
System\Windows\Media3D\Visual3D.cs (23)
236Debug.Assert(child != null);
237Debug.Assert(child.InternalVisualParent == null);
284Debug.Assert(child != null);
285Debug.Assert(child.InternalVisualParent == this);
457Debug.Assert(VisualTreeHelper.GetParent(this) != null, "If oldParent is null, current parent should != null.");
949Debug.Assert(InternalVisualParent == newParent);
957Debug.Assert(InternalVisualParent == newParent);
1057Debug.Assert(boundsAreEqual, errorString);
1079Debug.Assert(model != null);
1211Debug.Assert((flags & VisualProxyFlags.IsContentNodeConnected) == 0,
1259Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentConnected));
1260Debug.Assert(IsOnChannel(channel));
1451Debug.Assert(IsOnChannel(channel));
1452Debug.Assert(!CheckFlagsAnd(channel, VisualProxyFlags.IsContentNodeConnected));
1582Debug.Assert(child.InheritanceContext == this,
1649Debug.Assert(ancestor != null);
1791Debug.Assert(ancestor != null);
1828Debug.Assert(_2DParent.GetValue(this) == null,
1836Debug.Assert(parent2D == null || parent2D is Viewport3DVisual,
2040Debug.Assert(!e.CheckFlagsOr(VisualFlags.ShouldPostRender),
2042Debug.Assert(!e.CheckFlagsOr(VisualFlags.NodeIsCyclicBrushRoot),
2054Debug.Assert((viewport == null) == (e.InternalVisualParent == null),
2092Debug.Assert(_inheritanceContext.GetValue(this) == UseParentAsContext,
PresentationFramework (2272)
MS\Internal\Annotations\Anchoring\LocatorManager.cs (13)
307Debug.Assert(attachedAnchor != null, "AttachedAnchor cannot be null if attachmentLevel is not Unresolved.");
357Debug.Assert(processor != null, "SubtreeProcessor can not be null");
634Debug.Assert(startNode != null, "startNode can not be null");
746Debug.Assert(node != null, "node can not be null");
813Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type");
818Debug.Assert(processor != null, "SubtreeProcessor can not be null"); // There is always a default processor
840Debug.Assert(data != null, "dataBlob is either null or not of ProcessingTreeState type");
844Debug.Assert(processor != null, "SubtreeProcessor can not be null");
879Debug.Assert(locator != null, "locator can not be null");
880Debug.Assert(startNode != null, "startNode can not be null");
916Debug.Assert(offset >= 0 && offset < realLocator.Parts.Count, "offset out of range");
1089Debug.Assert(locator != null, "locator can not be null");
1090Debug.Assert(data.LocatorPartIndex >= 0 && data.LocatorPartIndex < locator.Parts.Count,
MS\Internal\Annotations\Component\AnnotationHighlightLayer.cs (21)
72Debug.Assert(start != null, "start pointer is null");
73Debug.Assert(end != null, "end pointer is null");
74Debug.Assert(start.CompareTo(end) <= 0, "end pointer before start");
110Debug.Assert(highlightRange != null, "null range data");
340Debug.Assert(highlightRange != null, " null highlight range");
342Debug.Assert((rangeSegments != null) && (rangeSegments.Count > 0), "invalid rangeSegments");
353Debug.Assert(highlightSegment != null, "null highlight segment");
377Debug.Assert(rangeEnumerator.Current.IsNull || !next ||
512Debug.Fail("Mismatched segment data");
635Debug.Assert(start != null, "start pointer is null");
636Debug.Assert(end != null, "end pointer is null");
637Debug.Assert(owners != null, "null owners list");
638Debug.Assert(owners.Count > 0, "empty owners list");
640Debug.Assert(owners[i] != null, "null owner");
791Debug.Assert((ps1 != null) && (ps2 != null) && (ps1.CompareTo(ps2) <= 0), "invalid splitting points");
865Debug.Assert(res.Count == 2, "unexpected resulting segment count after split");
918Debug.Assert(textViews != null, "geometry text view not found");
937Debug.Assert((view != null) && (parentView != null), "null text view");
979Debug.Assert(!_segment.IsNull, "null TextSegment");
1098Debug.Assert(TopOwner != null, "invalid TopOwner");
1100Debug.Assert(parentView != null, "geometry parent text view not found");
MS\Internal\Annotations\Component\MarkedHighlightComponent.cs (26)
363Debug.Assert(anchor != null, "undefined anchor");
364Debug.Assert(marker.Data != null || marker.Data == Geometry.Empty, "undefined geometry");
368Debug.Assert(geometry != null, "unexpected geometry type");
369Debug.Assert(geometry.Children.Count == 3, "unexpected geometry children count");
433Debug.Assert(_uiParent != null, "No selection container");
475Debug.Assert(textContainer != null, "TextAnchor does not belong to a TextContainer");
624Debug.Assert(componentsRegister != null, "The selection is not registered");
647Debug.Assert(anchor != null, "wrong attachedAnchor");
880Debug.Assert(selection != null, "Unexpected sender of Changed event");
890Debug.Assert(components != null, "No SN registered for this selection");
898Debug.Assert(components[i].HighlightAnchor != null, "Missing highlight anchor component");
919Debug.Assert(sender != null, "undefined sender");
946Debug.Assert(pos != null, "null text pointer");
960Debug.Assert((components != null) && (components.Count > 0), "invalid component registry");
987Debug.Assert(selectionHandler != null, "SelectionHandler handler can not be null");
988Debug.Assert(mouseMoveHandler != null, "MouseMoveHandler handler can not be null");
1001Debug.Assert(component != null, "component is null");
1002Debug.Assert(_components != null, "_components are null");
1036Debug.Assert(component != null, "component is null");
1037Debug.Assert(_components != null, "_components are null");
1092Debug.Assert(first != null, "first component is null");
1093Debug.Assert((first.AttachedAnnotations != null) && (first.AttachedAnnotations.Count > 0), "first AttachedAnchor is null");
1094Debug.Assert(second != null, "second component is null");
1095Debug.Assert((second.AttachedAnnotations != null) && (second.AttachedAnnotations.Count > 0), "second AttachedAnchor is null");
1100Debug.Assert(firstAnchor != null, " first TextAnchor is null");
1101Debug.Assert(secondAnchor != null, " second TextAnchor is null");
MS\Internal\Ink\EditingCoordinator.cs (22)
72Debug.Assert(ActiveEditingBehavior == SelectionEditor,
165Debug.Assert(currentBehavior is StylusEditingBehavior,
187Debug.Assert(currentBehavior is StylusEditingBehavior,
243Debug.Assert(behavior != null);
301Debug.Assert(_activationStack.Count == 1, "The behavior stack has to contain one behavior.");
347Debug.Assert(behavior == ActiveEditingBehavior);
357Debug.Assert(behavior == LassoSelectionBehavior || behavior == SelectionEditingBehavior,
368Debug.Assert(behavior != LassoSelectionBehavior && behavior != SelectionEditingBehavior,
437Debug.Assert((_capturedStylus != null && _capturedMouse == null)
595Debug.Assert(newEditingBehavior != null);
768Debug.Assert(stylusEditingBehavior != null || ActiveEditingBehavior == null,
851Debug.Assert(ActiveEditingBehavior == null || ActiveEditingBehavior is IStylusEditing,
920Debug.Assert(inputDevice != null, "A null device is passed in.");
921Debug.Assert(stylusEditingBehavior != null, "stylusEditingBehavior cannot be null.");
922Debug.Assert(!IsInMidStroke, "The previous device hasn't been released yet.");
967Debug.Assert(!resetDynamicRenderer, "The dynamic renderer shouldn't be reset for Mouse");
1003Debug.Assert(IsInMidStroke || !releaseDevice, "The captured device has been release unexpectly.");
1045Debug.Assert(_capturedStylus == null || _capturedMouse == null, "InkCanvas cannot capture both stylus and mouse at the same time.");
1178Debug.Fail("Unknown behavior");
1215Debug.Fail("Unknown behavior");
1223Debug.Assert(!IsInMidStroke, "ChangeEditingBehavior cannot be called in a mid-stroke");
1224Debug.Assert(_activationStack.Count <= 1, "The behavior stack has to contain at most one behavior when user is not editing.");
MS\Internal\Text\ComplexLine.cs (12)
63Debug.Assert(run != null, "TextRun has not been created.");
64Debug.Assert(run.Length > 0, "TextRun has to have positive length.");
76Debug.Assert(dcp >= 0);
151Debug.Assert(runs != null, "Cannot retrieve runs collection.");
174Debug.Assert(DoubleUtil.GreaterThanOrClose(rect.Width, 0), "Negative inline object's width.");
226Debug.Assert(runs != null, "Cannot retrieve runs collection.");
330Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.Text, "TextPointer does not point to characters.");
377Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementStart, "TextPointer does not point to element start edge.");
382Debug.Assert(element != null, "Cannot use ITextContainer that does not provide TextElement instances.");
468Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.ElementEnd, "TextPointer does not point to element end edge.");
473Debug.Assert(element != null, "Element should be here.");
518Debug.Assert(position.GetPointerContext(LogicalDirection.Forward) == TextPointerContext.EmbeddedElement, "TextPointer does not point to embedded object.");
System\Windows\Controls\DataGrid.cs (17)
1633Debug.Assert(info != null, "info is null.");
1634Debug.Assert(column != null, "column is null.");
1745Debug.Assert(_isDraggingSelection, "DoAutoScroll should only be called when dragging selection.");
3530Debug.Assert(CanUserAddRows, "AddNewItem called when the end-user cannot add new rows.");
3531Debug.Assert(!IsAddingNewItem, "AddNewItem called when a pending add is taking place.");
5229Debug.Assert(!IsUpdatingSelectedCells);
5235Debug.Assert(IsUpdatingSelectedCells);
5316Debug.Fail("Unknown SelectionUnit encountered.");
6360Debug.Assert(RelativeMousePosition != RelativeMousePositions.Over, "The mouse is not supposed to be over the DataGrid.");
7080Debug.Assert(sortColumn != null, "column should not be null");
7238Debug.Assert(e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time");
7249Debug.Assert(e.OldItems.Count == 1, "SortDescriptionCollection should handle one element at a time");
7269Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "SortDescriptionCollection should handle one element at a time");
7383Debug.Assert(e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time");
7391Debug.Assert(e.OldItems.Count == 1, "GroupDescriptionCollection should handle one element at a time");
7402Debug.Assert(e.OldItems.Count == 1 && e.NewItems.Count == 1, "GroupDescriptionCollection should handle one element at a time");
7822Debug.Assert(dataGrid != null || columnCollection != null, "Both dataGrid and columnCollection cannot not be null at the same time");
System\Windows\Controls\DataGridAutoGeneratingColumnEventArgs.cs (1)
105Debug.Assert(
System\Windows\Controls\DataGridCellsPanel.cs (18)
166Debug.Assert(blockList != null, "RealizedColumnsBlockList shouldn't be null at this point.");
627Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container");
642Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated");
672Debug.Assert(container != null, "Null container was generated");
708Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'");
769Debug.Fail("We should have found a child");
1064Debug.Assert(columnIndex < columnCount, "columnIndex should be less than column count");
1139Debug.Assert(startIndex >= 0);
1140Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling");
1322Debug.Assert(
1328Debug.Assert(
1407Debug.Assert(i >= arrangeState.FrozenColumnCount, "Frozen cells should have been realized or not visible");
1441Debug.Assert(child != null, "child cannot be null.");
1456Debug.Assert(cell.Column != null, "column cannot be null.");
1561Debug.Assert(children.Count > blockElementCount, "Element count from blocks can't be less than total children count");
1602Debug.Assert(columnIndex <= block.EndIndex, "Missing children for index in block list");
1961Debug.Assert(ParentDataGrid != null, "ParentDataGrid should not be null");
2079Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
System\Windows\Controls\DataGridColumnCollection.cs (18)
20Debug.Assert(dataGridOwner != null, "We should have a valid DataGrid");
226Debug.Assert(displayIndex >= 0 && displayIndex < DisplayIndexMap.Count, "displayIndex should have already been validated");
324Debug.Assert(newDisplayIndex >= 0 && newDisplayIndex < Count, "The new DisplayIndex should have already been validated");
357Debug.Assert(oldDisplayIndex != newDisplayIndex, "A column's display index must have changed for us to call OnColumnDisplayIndexChanged");
358Debug.Assert(oldDisplayIndex >= 0 && oldDisplayIndex < Count, "The old DisplayIndex should be valid");
409Debug.Assert(
412Debug.Assert(!IsUpdatingDisplayIndex, "We don't add new columns as part of a display index update operation");
469Debug.Assert(DisplayIndexMap.Count == 0, "DisplayIndexMap should be empty until first measure call.");
542Debug.Assert(assignedDisplayIndexMap.ContainsKey(displayIndex));
553Debug.Assert(
556Debug.Assert(!IsUpdatingDisplayIndex, "We don't remove columns as part of a display index update operation");
561Debug.Assert(DisplayIndexMap.Count > Count, "Columns were just removed: the display index map shouldn't have yet been updated");
597Debug.Assert(oldColumns.Count == 1 && newColumns.Count == 1, "Multi replace isn't possible with ObservableCollection");
686Debug.Assert(removedDisplayIndex >= 0);
725Debug.Assert(Count == DisplayIndexMap.Count, "Display Index map is of the wrong size");
728Debug.Assert(DisplayIndexMap[i] >= 0 && DisplayIndexMap[i] < Count, "DisplayIndex map entry doesn't point to a valid column");
729Debug.Assert(ColumnFromDisplayIndex(i).DisplayIndex == i, "DisplayIndex map doesn't match column indices");
896Debug.Assert(
System\Windows\Controls\GridViewColumnCollectionChangedEventArgs.cs (12)
44Debug.Assert(action == NotifyCollectionChangedAction.Add || action == NotifyCollectionChangedAction.Remove,
46Debug.Assert(changedItem != null, "changedItem can't be null");
47Debug.Assert(index >= 0, "index must >= 0");
48Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
59Debug.Assert(newItem != null, "newItem can't be null");
60Debug.Assert(oldItem != null, "oldItem can't be null");
61Debug.Assert(index >= 0, "index must >= 0");
62Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
73Debug.Assert(changedItem != null, "changedItem can't be null");
74Debug.Assert(index >= 0, "index must >= 0");
75Debug.Assert(oldIndex >= 0, "oldIndex must >= 0");
76Debug.Assert(actualIndex >= 0, "actualIndex must >= 0");
System\Windows\Controls\GridViewHeaderRowPresenter.cs (16)
300Debug.Assert(_paddingHeader != null, "padding header is null");
310Debug.Assert(_indicator != null, "_indicator is null");
311Debug.Assert(_floatingHeader != null, "_floatingHeader is null");
384Debug.Assert(_paddingHeader != null, "padding header is null");
453Debug.Assert(_draggingSrcHeader != null, "_draggingSrcHeader is null");
636Debug.Assert(column != null);
854Debug.Assert(index >= 0 && index < InternalChildren.Count, "Error index when GetVisualIndex");
934Debug.Fail("Head is container for itself, but parent is neither GridViewHeaderRowPresenter nor null.");
983Debug.Assert(header != null || index != -1);
1044Debug.Assert(header != null);
1050Debug.Assert(header != null);
1162Debug.Assert(header != null, "Cannot instantiate GridViewColumnHeader in AddFloatingHeader");
1175Debug.Assert(srcHeader != null, "srcHeader is null");
1176Debug.Assert(_floatingHeader != null, "floating header is null");
1342Debug.Assert(index >= 0 && index < HeadersPositionList.Count, "wrong index");
1529Debug.Assert(Columns != null, "Columns is null in OnHeaderDragCompleted");
System\Windows\Controls\InkCanvas.cs (18)
575Debug.Assert(e.Property == InkCanvas.RightProperty || e.Property == InkCanvas.BottomProperty,
1041Debug.Assert(e != null, "EventArg can not be null");
1260Debug.Assert(e != null, "EventArg can not be null");
1317Debug.Assert(e != null, "EventArg can not be null");
1371Debug.Assert(e != null, "EventArg can not be null");
1405Debug.Assert(e != null, "EventArg can not be null");
1436Debug.Assert(e != null, "EventArg can not be null");
1472Debug.Assert(e != null, "EventArg can not be null");
1548Debug.Assert(e != null, "EventArg can not be null");
1578Debug.Assert(e != null, "EventArg can not be null");
1612Debug.Assert(e != null, "EventArg can not be null");
1642Debug.Assert(e != null, "EventArg can not be null");
2268System.Diagnostics.Debug.Assert(_dynamicallySelectedStrokes.Contains(s));
2339Debug.Assert(strokes != null
2566System.Diagnostics.Debug.Assert(object.ReferenceEquals(sender, DefaultDrawingAttributes));
2666Debug.Assert(removeSelectedStrokes || removeSelectedElements, "At least either Strokes or Elements should be removed!");
2705Debug.Assert(inkCanvas != null);
2778Debug.Assert(inkCanvas != null);
System\Windows\Controls\ItemContainerGenerator.cs (9)
279Debug.Fail("Unexpected reentrant call to ICG.Remove");
325Debug.Assert(!_recyclableContainers.Contains(container), "trying to add a container to the collection twice");
930Debug.Assert(item == null || ItemsControl.EqualsEx(item, target),
2205Debug.Assert(ItemsControl.EqualsEx(rib.ItemAt(rib.ContainerCount - 1),
2271Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)");
2336Debug.Assert(!container.HasExpression(entryIndex, dp), "DataContext set by expression (unexpectedly)");
2369Debug.Assert(ItemsControl.EqualsEx(item, ItemsInternal[index]), "Event contains the wrong index");
2444Debug.Fail("unexpected reentrant call to OnItemAdded");
2634Debug.Fail("unexpected reentrant call to OnItemMoved");
System\Windows\Controls\Primitives\DataGridCellsPresenter.cs (1)
345Debug.Assert(
System\Windows\Controls\Primitives\DataGridColumnHeadersPresenter.cs (11)
226Debug.Assert(column != null, "We shouldn't have generated this column header if we don't have a column.");
262Debug.Assert(HeaderCollection != null, "This is a helper method for preparing and clearing a container; if it's called we must have a valid ItemSource");
692Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
739Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null");
753Debug.Assert(_columnHeaderDragIndicator != null, "Drag indicator is null");
754Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null");
772Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null");
786Debug.Assert(_columnHeaderDropLocationIndicator != null, "Drag indicator is null");
787Debug.Assert(_draggingSrcColumnHeader != null, "Dragging header is null");
804Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
914Debug.Assert(ParentDataGrid != null, "ParentDataGrid is null");
System\Windows\Controls\Primitives\Popup.cs (12)
176Debug.Assert(popup != null, "Popup must be non-null");
177Debug.Assert(placementTarget != null, "Placement target must be non-null.");
207Debug.Assert(popup != null, "Popup must be non-null");
208Debug.Assert(placementTarget != null, "Placement target must be non-null.");
884Debug.Assert(!bindTreatMousePlacementAsBottomProperty || child is ToolTip, "child must be a Tooltip to bind TreatMousePlacementAsBottomProperty");
1108Debug.Assert( Mouse.Captured == _popupRoot, "_cacheValid[(int)CacheBits.CaptureEngaged] == true but Mouse.Captured != _popupRoot");
1400Debug.Assert(popup != null, "popup should be non-null.");
1401Debug.Assert(child != null, "child should be non-null.");
1424Debug.Assert(child != null, "child should be non-null");
1932Debug.Assert(CheckAccess(), "AsyncReposition not called on the dispatcher thread.");
2497Debug.Assert(i >= 0 && i < GetNumberOfCombinations(placement));
3290Debug.Assert(!IsChildPopup || (IsChildPopup && !transparent), "Child popups cannot be transparent");
System\Windows\Controls\Primitives\Selector.cs (22)
580Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText");
1034Debug.Assert(CanSelectMultiple, "CanSelectMultiple should be true when calling SelectAllImpl");
1422Debug.Assert(!SelectionChange.IsActive, "SelectionChange is already active -- use SelectionChange.Select or Unselect");
1496Debug.Assert(!((SelectedIndex >= 0) && (_selectedItems.Count == 0)), "SelectedIndex >= 0 implies _selectedItems nonempty");
1523Debug.Assert(IsSynchronizedWithCurrentItemPrivate);
1551Debug.Assert(IsSynchronizedWithCurrentItemPrivate);
1594Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true");
1676Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true");
2039Debug.Assert(SelectionChange.IsActive, "SelectionChange.IsActive should be true");
2171Debug.Assert(String.IsNullOrEmpty(path) || path == "/InnerText");
2270Debug.Assert(_owner.CheckAccess());
2271Debug.Assert(!_active, SR.SelectionChangeActive);
2283Debug.Assert(_owner.CheckAccess());
2284Debug.Assert(_active, "There must be a selection change active when you call SelectionChange.End()");
2318Debug.Assert(_toSelect.Count <= 1, "_toSelect.Count was > 1");
2492Debug.Assert(_owner.CheckAccess());
2493Debug.Assert(_active, SR.SelectionChangeNotActive);
2494Debug.Assert(info != null, "parameter info should not be null");
2549Debug.Assert(_owner.CheckAccess());
2550Debug.Assert(_active, SR.SelectionChangeNotActive);
2551Debug.Assert(info != null, "info should not be null");
2587Debug.Assert(_owner.CheckAccess());
System\Windows\Controls\VirtualizedCellInfoCollection.cs (30)
23Debug.Assert(owner != null, "owner must not be null.");
36Debug.Assert(owner != null, "owner must not be null.");
86Debug.Assert(IsValidCell(cell), "The cell should be valid.");
87Debug.Assert(!Contains(cell), "VirtualizedCellInfoCollection does not support duplicate items.");
470Debug.Assert(left >= 0, "left must be positive.");
471Debug.Assert(top >= 0, "top must be positive.");
472Debug.Assert(width >= 0, "width must be positive.");
473Debug.Assert(height >= 0, "height must be positive.");
490Debug.Assert(value >= 0, "Value must be positive.");
504Debug.Assert(value >= 0, "Value must be positive.");
518Debug.Assert(value >= _left, "Right must be greater than or equal to Left.");
532Debug.Assert(value >= _top, "Bottom must be greater than or equal to Top.");
546Debug.Assert(value >= 0, "Value must be positive.");
560Debug.Assert(value >= 0, "Value must be positive.");
786Debug.Assert(!IsEmpty, "Don't call GetBoundingRegion when IsEmpty is true.");
818Debug.Assert(left <= right, "left should be less than or equal to right.");
819Debug.Assert(top <= bottom, "top should be less than or equal to bottom.");
829Debug.Assert(rowCount > 0, "rowCount should be greater than 0.");
830Debug.Assert(columnCount > 0, "columnCount should be greater than 0.");
974Debug.Assert(rowIndex >= 0);
1002Debug.Assert(rowIndex >= 0);
1041Debug.Assert(rowIndex >= 0);
1057Debug.Assert(oldIndex >= 0);
1058Debug.Assert(newIndex >= 0);
1147Debug.Assert(columnIndex >= 0);
1190Debug.Assert(columnIndex >= 0);
1229Debug.Assert(columnIndex >= 0);
1248Debug.Assert(oldIndex >= 0);
1249Debug.Assert(newIndex >= 0);
1633Debug.Assert(list != null, "list should not be null.");
System\Windows\Controls\VirtualizingStackPanel.cs (78)
401Debug.Assert(!IsPixelBased && IsScrolling &&
478Debug.Assert(IsScrolling, "setting offset on non-scrolling panel");
606Debug.Assert(IsScrolling, "setting offset on non-scrolling panel");
797Debug.Assert(AnchorOperationField.GetValue(this) == null, "There is already a pending AnchorOperation.");
829Debug.Assert(_scrollData._firstContainerInViewport != null, "Must have an anchor element");
855Debug.Assert(AnchorOperationField.GetValue(this) != null, "anchor state is inconsistent");
886Debug.Assert(currFirstContainerInViewport != null, "Cannot find container in viewport");
1141Debug.Assert(!IsPixelBased || !findTopContainer, "find 'top' container only makes sense when item-scrolling");
1698Debug.Assert(IsVirtualizing && InRecyclingMode, "We should only modify the visual order when in recycling mode");
2388Debug.Assert(!adjustToChangeInFirstItem || foundFirstItemInViewport, "This loop should only happen twice at most");
3695Debug.Assert(args.Action == NotifyCollectionChangedAction.Reset && args.ItemCount == 1);
3849Debug.Assert(info != null, "Expected state from previous measure not found");
3957Debug.Assert(IsScrolling && IsVirtualizing, "Only check viewport on scrolling panel when virtualizing");
4352Debug.Assert(retryCount >=0, "retry MeasureCaches too often");
4509Debug.Assert(effectiveOffsetInfo.ScrollGeneration <= scrollGeneration,
4705Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here.");
4961Debug.Assert(IsScrolling, "The scrolling panel is the only one that should extend the viewport");
5019Debug.Assert(virtualizationInfoProvider != null, "This method should only be invoked for a virtualizing owner");
5020Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page after cache size is not expected here.");
5648Debug.Assert(itemIndex < items.Count, "index out of range");
5748Debug.Assert(IsVirtualizing, "We should only need to extend the viewport beyond the generated items when virtualizing");
6082Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size");
6098Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode");
6166Debug.Assert(!containerSize.IsEmpty, "We can't estimate an empty size");
6378Debug.Assert(parentItemStorageProvider != null || container != null,
6421Debug.Assert(!IsVSP45Compat, "SetItemsHostInset should not be called in VSP45-compat mode");
6457Debug.Fail("SetInset should only be called for a container");
6561Debug.Fail($"Unexpected container type: {((container == null) ? "null" : container.GetType().Name)}");
6602Debug.Assert(cacheUnit != VirtualizationCacheLengthUnit.Page, "Page cacheUnit is not expected here.");
6812Debug.Assert(virtualizingChild != null, "This method should only be invoked for a virtualizing child");
7250Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Width), "The computed sizes within and outside the viewport should add up to the childPixelSize.");
7342Debug.Assert(DoubleUtil.AreClose(pixelSizeInViewport + pixelSizeBeforeViewport + pixelSizeAfterViewport, childPixelSize.Height), "The computed sizes within and outside the viewport should add up to the childPixelSize.");
7437Debug.Assert(IsVSP45Compat, "this method should only be called in VSP45Compat mode");
7443Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false.");
7589Debug.Assert(!IsVSP45Compat, "this method should not be called in VSP45Compat mode");
7595Debug.Assert(evaluateAreContainersUniformlySized || !computedAreContainersUniformlySized, "AreContainersUniformlySized starts off true and can only be flipped to false.");
7878Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available.");
7879Debug.Assert(item != null, "An item must be available.");
7903Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available.");
7904Debug.Assert(item != null, "An item must be available.");
7947Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available.");
7948Debug.Assert(item != null, "An item must be available.");
8005Debug.Assert(itemStorageProvider != null || item == this, "An item storage provider must be available.");
8006Debug.Assert(item != null, "An item must be available.");
8728Debug.Assert(container != null, "Null container was generated");
8773Debug.Assert(children[visualTreeIndex] != null, "MoveVisualChild interprets a null destination as 'move to end'");
8898Debug.Assert(!children.Contains(child), "we incorrectly identified a recycled container");
8919Debug.Assert(child == InternalChildren[childIndex], "Wrong child was generated");
8941Debug.Assert(args.ItemUICount == args.ItemCount, "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
8951Debug.Assert(child != null, "Null child was generated");
8952Debug.Assert(!newlyRealized, "newlyRealized should be false after Replace");
8981Debug.Assert((itemCount == itemUICount) || (itemUICount == 0), "Both ItemUICount and ItemCount should be equal or ItemUICount should be 0.");
9022Debug.Assert(IsVirtualizing, "Can't clean up containers if not virtualizing");
9023Debug.Assert(itemsControl != null, "We can't cleanup if we aren't the itemshost");
9168Debug.Assert(InRecyclingMode, "This method only applies to recycling mode");
9187Debug.Assert(IsVirtualizing && InRecyclingMode, "Realized children only exist when recycling");
9188Debug.Assert(_realizedChildren != null, "Realized children must exist to verify it");
9201Debug.Assert(!_realizedChildren.Contains(child), "_realizedChildren should not contain recycled containers");
9207Debug.Assert(_realizedChildren[position.Index] == child, "_realizedChildren is corrupt!");
9219Debug.Assert(_realizedChildren.Count == children.Count, "Realized and visual children must match");
9223Debug.Assert(_realizedChildren[i] == children[i], "Realized and visual children must match");
9253Debug.Fail("We should have found a child");
9324Debug.Assert(_cleanupDelay != null);
9345Debug.Assert(_cleanupOperation != null);
9369Debug.Assert(!InRecyclingMode, "This method only applies to standard virtualization");
9436Debug.Assert(startIndex >= 0 && count > 0);
9437Debug.Assert(children == _realizedChildren, "the given child list must be the _realizedChildren list when recycling");
9583Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel.");
9710Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode.");
9711Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode.");
9715Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode.");
9716Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode.");
10434Debug.Assert(IsScrolling, "ScrollData must only be set on a scrolling panel.");
10559Debug.Assert(DoubleUtil.AreClose(viewportSize.Width - Math.Floor(viewportSize.Width), 0.0), "The viewport size must not contain fractional values when in item scrolling mode.");
10560Debug.Assert(DoubleUtil.AreClose(extentSize.Width - Math.Floor(extentSize.Width), 0.0), "The extent size must not contain fractional values when in item scrolling mode.");
10564Debug.Assert(DoubleUtil.AreClose(viewportSize.Height - Math.Floor(viewportSize.Height), 0.0), "The viewport size must not contain fractional values when in item scrolling mode.");
10565Debug.Assert(DoubleUtil.AreClose(extentSize.Height - Math.Floor(extentSize.Height), 0.0), "The extent size must not contain fractional values when in item scrolling mode.");
12209Debug.Assert(tracer != null, "Trace called when not tracing");
System\Windows\Input\KeyboardNavigation.cs (20)
494Debug.Assert(adornedElement != null, "adornedElement should not be null");
495Debug.Assert(focusVisualStyle != null, "focusVisual should not be null");
511Debug.Assert(adornedElement != null, "adornedElement should not be null");
512Debug.Assert(adornedElementParent != null, "adornedElementParent should not be null");
513Debug.Assert(contentHostParent != null, "contentHostParent should not be null");
514Debug.Assert(contentHostParent is Visual, "contentHostParent should be Visual");
515Debug.Assert(focusVisualStyle != null, "focusVisual should not be null");
977Debug.Assert(currentElement != null, "currentElement should not be null");
1337Debug.Assert(container != null, "container cannot be null");
1788Debug.Assert(e != null, "e should not be null");
1789Debug.Assert(container != null, "container should not be null");
1867Debug.Assert(e != null, "e cannot be null");
2081Debug.Assert(container != null, "container should not be null");
2117Debug.Assert(IsTabStopOrGroup(nextTabElement), "nextTabElement should be IsTabStop or group");
2256Debug.Assert(e != null || container != null, "e or container should not be null");
2635Debug.Assert(sourceElement != null, "sourceElement must not be null");
2882Debug.Assert(!(sourceElement == null && container == null), "Both sourceElement and container cannot be null");
2887Debug.Assert(container != null, "container cannot be null");
3099Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd1, rangeStart1));
3100Debug.Assert(DoubleUtil.GreaterThanOrClose(rangeEnd2, rangeStart2));
System\Windows\Interop\ActiveXHost.cs (26)
214Debug.Assert(args.Key.Length > 0, "got an empty access key");
406Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition");
411Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition");
416Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition");
421Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Failed transition");
425Debug.Fail("bad state");
457Debug.Fail("how did we ever get into the open state?");
462Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Failed transition");
467Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Failed transition");
472Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Failed transition");
477Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Failed transition");
481Debug.Fail("bad state");
505Debug.Assert(hr == NativeMethods.S_OK, $"DoVerb call failed for verb 0x{verb:X}");
548Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Passive, "Wrong start state to transition from");
553Debug.Assert(_axInstance == null, "_axInstance must be null");
556Debug.Assert(_axInstance != null, "w/o an exception being thrown we must have an object...");
571Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from");
605Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Loaded, "Wrong start state to transition from");
630Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from");
647Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.Running, "Wrong start state to transition from");
674Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from");
689Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.InPlaceActive, "Wrong start state to transition from");
702Debug.Assert(this.ActiveXState == ActiveXHelper.ActiveXState.UIActive, "Wrong start state to transition from");
706Debug.Assert(NativeMethods.Succeeded(hr), "Failed in IOleInPlaceObject.UiDeactivate");
938Debug.Assert(_axInstance != null, "The native control is null");
985Debug.Fail(e.ToString());
System\Windows\Markup\BamlRecordReader.cs (46)
91Debug.Assert(null != bamlStream);
92Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper);
117Debug.Assert(null != parserContext && null != parserContext.XamlTypeMapper);
226Debug.Assert(!XamlReaderStream.IsWriteComplete,
326Debug.Assert(bamlRecord.RecordType == BamlRecordType.LinePosition);
509Debug.Assert( stackDepth == ReaderContextStack.Count );
525Debug.Assert(bamlConnectionIdRecord.ConnectionId > 0);
537Debug.Assert(0 == ReaderContextStack.Count); // if not zero we missed an EndElement
621Debug.Assert(false);
710Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType);
792Debug.Assert(ReaderFlags.DependencyObject == CurrentContext.ContextType ||
997Debug.Assert(_rootElement != null);
1047Debug.Assert(null == ParentContext);
1200Debug.Assert(!CurrentContext.CheckFlag(ReaderFlags.NeedToAddToTree), "Failed to add Element to tree before popping stack");
1214Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexClr );
1215Debug.Assert( CurrentContext.ContextType != ReaderFlags.PropertyComplexDP );
1267Debug.Assert(CurrentContext.ContextType == ReaderFlags.ConstructorParams);
1297Debug.Assert(parent is DependencyObject);
1416Debug.Assert(param is String);
1459Debug.Assert(paramString != null);
1497Debug.Assert(param != null && paramList == null, "Must have a single param");
1511Debug.Assert(param == null && paramList != null, "Must have a paramList");
1885Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup");
1958Debug.Assert(staticResourceValues != null, "Must have a list of StaticResourceValues for lookup");
2095Debug.Assert(serializerTypeId == (short)KnownElements.DependencyPropertyConverter);
2226Debug.Assert(element is DependencyObject, "Guaranteed by PropertyDefinition constructor");
2522Debug.Assert(o is DependencyObject);
2696Debug.Assert( attributeUsage == BamlAttributeUsage.XmlSpace,
2738Debug.Assert(element is DependencyObject);
2971Debug.Assert(!holder.ReadOnly); // this is being checked in XamlReaderHelper, just assert
2996Debug.Assert(arrayExt != null);
3115Debug.Assert (holder.Collection == null);
3434Debug.Assert( CurrentContext.ObjectData == null && CurrentContext.ExpectedType != null,
3619Debug.Assert(null != CurrentContext &&
3679Debug.Assert(false);
3688Debug.Assert(currentTarget is DependencyObject);
3702Debug.Assert(false); // We do not expect to be here after all checks done in propertyType identification above
3764Debug.Assert(genericType != null);
3807Debug.Assert(memberInfo is MethodInfo);
3823Debug.Assert(null != CurrentContext &&
3872Debug.Assert(null != CurrentContext &&
4225Debug.Assert(!context.CreateUsingTypeConverter,
4875Debug.Assert(contentProperty != null);
4980Debug.Fail("The only remaining option is attached property, which is not allowed in xaml for content properties");
5723Debug.Assert(_attributeInfo != null);
5818Debug.Assert(this.AttachedPropertyGetter != null);
System\Windows\Markup\BamlRecords.cs (29)
687Debug.Fail("Assembly, Type and Attribute records are not cached, so don't ask for one.");
712Debug.Fail("Unknown RecordType");
765Debug.Assert(null == _writeCache[(int)record.RecordType]);
855set { Debug.Assert (value == -1, "Setting fixed record to an invalid size"); }
864Debug.Fail("Must override RecordType");
902Debug.Assert( value <= 3 && value >= 0 );
1090Debug.Assert(RecordSize < 0);
1500Debug.Assert(_valuePositionPosition != -1,
1683Debug.Assert(_valuePositionPosition != -1,
2048set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2118set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2179set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
2386Debug.Assert(value <= ExtensionIdMask);
2406set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
2716Debug.Assert(!ValueObjectSet);
2795Debug.Assert (false, "Unknown custom serializer");
2983set { Debug.Assert (value == -1, "Wrong size set for complex prop record"); }
3197set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3284set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3433Debug.Assert(_contentSizePosition != -1,
3478set { Debug.Assert(value == -1, "Wrong size set for element record"); }
3638set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3736set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3814set { Debug.Assert(value == -1, "Wrong size set for complex prop record"); }
3999Debug.Assert(FilePos != -1,"UpdateWrite called but Write Never was");
4542Debug.Assert( SerializerTypeId != 0 );
4695Debug.Assert((propertyMember is MethodInfo) || (propertyMember is PropertyInfo)
4714Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
4757Debug.Assert(arr.Length == 3 && arr[0] != null && arr[1] != null);
System\Windows\Markup\BamlRecordWriter.cs (22)
115Debug.Assert(null != DocumentStartRecord);
133Debug.Assert(null != DocumentStartRecord);
404Debug.Assert(_deferElementDepth == 0);
405Debug.Assert(_deferComplexPropertyDepth == 0);
406Debug.Assert(_staticResourceElementDepth == 0);
407Debug.Assert(_dynamicResourceElementDepth == 0);
408Debug.Assert(_staticResourceRecordList == null);
426Debug.Assert(_staticResourceElementDepth == 0);
463Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
562Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
598Debug.Assert(!InStaticResourceSection, "We do not support x:Shared within a StaticResource Section");
782Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
838Debug.Assert(keyRecord.RecordList.Count == 0, "Should have empty record list");
864Debug.Assert(!InStaticResourceSection, "We do not support x:Key within a StaticResource Section");
875Debug.Assert(_deferElementDepth == 2);
1064Debug.Assert(extensionTypeId != (short)KnownElements.TypeExtension);
1081Debug.Assert(typeValue != null);
1626Debug.Assert(keyRecord != null, "Unknown key record type in defer load dictionary");
1634Debug.Assert(keyIndex == _deferKeys.Count,
1657Debug.Assert(_deferElementDepth > 0 && CollectingValues,
1665Debug.Assert(valueDeferRecord.Record != null &&
1677Debug.Assert(valueDeferRecord.Record != null && valueDeferRecord.Record.RecordType == BamlRecordType.ElementEnd,
System\Windows\Markup\XamlStream.cs (14)
74Debug.Assert(!WriteComplete,"Write called after close");
76Debug.Assert(null != buffer,"Null buffer past to the Writer");
88Debug.Assert(null != writeBuffer,"Null writeBuffer returned");
108Debug.Assert(0 < bufferWriteCount,"Not writing any bytes to the buffer");
113Debug.Assert(bufferOffset < BufferSize,"Trying to Read past bufer");
179Debug.Assert(!WriteComplete,"UpdateReaderLength called after close");
224Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer");
244Debug.Assert(0 < bufferReadCount,"Not reading any bytes to the buffer");
249Debug.Assert(bufferOffset < BufferSize,"Trying ot read past buffer");
372Debug.Assert(bufferOffset < BufferSize,"Calculated bufferOffset is greater than buffer");
377Debug.Assert(bufferArray.Count == bufferIndex,"Need to allocate more than one buffer");
378Debug.Assert(!reader, "Allocating a buffer on Read");
783Debug.Fail("Close called on ReaderStream");
791Debug.Fail("Flush called on ReaderStream");
System\Windows\Markup\XamlTypeMapper.cs (33)
543Debug.WriteLine($"Reflected for type converter on {propType.Name}.{propName}");
816Debug.Assert(null != attribInfo, "null attribInfo");
817Debug.Assert(null != currentParentType, "null currentParentType");
856Debug.Assert(propertyOwnerType != null);
885Debug.Assert(attachedPropertyInfo.IsPublic ||
935Debug.Assert(null != localName, "null localName");
936Debug.Assert(null != xmlNamespace, "null xmlNamespace");
1587Debug.Assert(null != eventName, "null eventName");
1588Debug.Assert(null != owner, "null owner");
1632Debug.Assert(null != localName, "null localName");
1633Debug.Assert(null != xmlNamespace, "null xmlNamespace");
1670Debug.Assert(null != baseType, "baseType not set");
1763Debug.Assert(null != localName, "null localName");
1764Debug.Assert(null != xmlNamespace, "null xmlNamespace");
1906Debug.Assert(typeInfo != null, "Must have cached type info at this point");
2123Debug.Assert( propertyMember is DependencyProperty);
2304Debug.Assert(memberName != null);
2307Debug.Assert(memberInfo != null);
2322Debug.Assert(targetType != null);
2398Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace");
2399Debug.Assert(null != localName,"null value passed for localName");
2437Debug.Assert(null != xmlNamespace,"null value passed for xmlNamespace");
2438Debug.Assert(null != localName,"null value passed for localName");
2590Debug.Assert(namespaceMap.ClrNamespace != null,"Null CLR Namespace");
2591Debug.Assert(localName != null,"Null localName");
3440Debug.Assert(null != type, "Null passed for type to GetTypeConverterType");
3471Debug.Assert(null != type, "Null passed for type to GetTypeConverter");
3515Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverterType");
3559Debug.Assert(null != propType, "Null passed for propType to GetPropertyConverter");
3678Debug.Assert(_constructors != null, "This operation is legal only after the constructors have been fetched");
3744Debug.Assert(null != type, "null value for type passed to GetWhitespace");
3756Debug.Assert(1 == trimAttribute.Length,"More than one TrimWhitespace Attribute");
4006Debug.Assert(_dpLookupHashtable != null,
System\Windows\Navigation\NavigationService.cs (46)
80Debug.Assert(_navigateQueueItem == null || !_navigateQueueItem.IsPosted);
89Debug.Assert(e != null, "Hyperlink fired Navigate event with null NavigateEventArgs");
102Debug.Assert(dobj != null, "RequestNavigateEventArgs.OriginalSource should be DependencyObject");
250Debug.Assert(_bp != null, "NavigationService should not handle a nav from a hyperlink thats not in its hosted tree");
256Debug.Assert(IsConsistent(navInfo));
288Debug.Assert(navMode != NavigationMode.Refresh); // because of !IsSameUri() above
309Debug.Assert(_navStatus == NavigationStatus.Navigating);
454Debug.Assert(!(_bp is Visual));
587Debug.Assert(_parentNavigationService == newParent);
624Debug.Assert(ChildNavigationServices.Contains(ncChild), "Child NavigationService must already exist");
684Debug.Assert(fe != null, "INavigatorHost needs to be FrameworkElement");
857Debug.Assert(_navigateQueueItem == null && _navStatus == NavigationStatus.Navigated);
881Debug.Assert(finishingChildPageFunction == null ||
900Debug.Assert(finishingChildPageFunction._Return == null);
931Debug.Assert(pfReturnInfo == null);
937Debug.Assert(pf.ParentPageFunctionId != Guid.Empty);
976Debug.Assert(IsConsistent(navInfo));
1001Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation);
1005Debug.Assert(_navigateQueueItem == null);
1114Debug.Assert(bpu == null ||
1144Debug.Assert(navMode == NavigationMode.Refresh,
1162Debug.Assert(!JournalScope.Journal.HasUncommittedNavigation);
1179Debug.Assert(navMode == NavigationMode.Back || navMode == NavigationMode.Forward);
1182Debug.Assert(_contentId != 0);
1186Debug.Assert(_journalEntryGroupState == null ||
1906Debug.Assert(PendingNavigationList.Count == 0,
2016Debug.Assert(this.Application != null &&
2067Debug.Assert(navigateInfo.IsConsistent);
2068Debug.Assert(source == null ||
2118Debug.Assert(PendingNavigationList.Count == 0,
2128Debug.Assert(_navigateQueueItem == null, "Previous nav queue item should be cleared by now.");
2208Debug.Assert(_navStatus == NavigationStatus.Navigated);
2542Debug.Assert(sender == _bp);
3022Debug.Assert(IsConsistent(navigateInfo));
3049Debug.Assert(navigationMode == NavigationMode.New ||
3054Debug.Assert(destinationJournalEntry == null
3133Debug.Assert(_contentId != 0 &&
3627Debug.Assert(ps._Resume); // should've been set by JournalEntryPFxx.ResumePageFunction()
3656Debug.Assert(_navigateQueueItem == null,
3731Debug.Assert(parentPF._Return == null);
3833Debug.Assert(parentEntryIndex < journal.CurrentIndex);
3838Debug.Fail("Could not find the finishing PageFunction in the journal.");
3895Debug.Fail($"Unhandled scenario: PageFunction returning to {parentEntry.GetType().Name}");
4338Debug.Assert(_postedOp == null);
4426Debug.Assert(child != null);
4449Debug.Assert(node != null, "Trying to dispose a null Logical Tree Node");
System\Windows\StyleHelper.cs (99)
54Debug.Assert(fe != null || fce != null);
93Debug.Assert(fe != null || fce != null);
157Debug.Assert((fe != null && fce == null)|| (fe == null && fce != null));
347Debug.Assert(frameworkTemplate != null );
364Debug.Assert( !frameworkTemplate.HasXamlNodeContent );
368Debug.Assert(frameworkTemplate != null);
403Debug.Assert( frameworkTemplate != null );
704Debug.Assert(freezable.IsFrozen, "Freezable within a Style or Template should have been frozen by now");
762Debug.Assert(childIndex >= 0);
1122Debug.Assert(action.IsSealed, "TriggerAction should have already been sealed by this point.");
1276Debug.Assert( childIndex != 0 ); // This should go to the other AddDelegateToFireTrigger overload
1334Debug.Assert((fe != null && fce == null) || (fe == null && fce != null));
1366Debug.Assert((fe != null && fce == null) || (fe == null && fce != null));
1367Debug.Assert((fe != null && fe == container) || (fce != null && fce == container));
1368Debug.Assert(newStyle != null || newFrameworkTemplate != null );
1430Debug.Assert((fe != null && fce == null) || (fe == null && fce != null));
1431Debug.Assert((fe != null && fe == container) || (fce != null && fce == container));
1432Debug.Assert(oldStyle != null || oldFrameworkTemplate != null );
1491Debug.Assert((container is FrameworkElement) || (container is FrameworkContentElement), "Caller has queried with non-framework element. Bad caller, bad!");
1492Debug.Assert(dataType < InstanceStyleData.ArraySize, "Caller has queried using a value outside the range of the Enum. Bad caller, bad!");
1595Debug.Assert(!freezable.CanFreeze, "If a freezable could have been frozen it would have been done by now.");
1622Debug.Assert(instanceValues != null, "InstanceValues hashtable should have been created at initialization time.");
1666Debug.Assert(oldStyle != null || oldFrameworkTemplate != null );
1684Debug.Assert(dataField == ThemeStyleDataField);
1766Debug.Assert(frameworkTemplate != null );
1807Debug.Assert(treeRoot is FrameworkElement || treeRoot is FrameworkContentElement,
1855Debug.Assert(treeRoot == null || treeRoot is FrameworkElement || treeRoot is FrameworkContentElement,
1883Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTree,
1891Debug.Assert(frameworkTemplate != null, "Only FrameworkTemplate has the ability to build a VisualTree by this means");
1903Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForBuildVisualTreeCompletion,
1908Debug.Assert( feContainer._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot,
1943Debug.Assert( container._buildVisualTreeVerification != VerificationState.WaitingForBuildVisualTreeCompletion,
1945Debug.Assert( container._buildVisualTreeVerification == VerificationState.WaitingForAddCustomTemplateRoot,
1966Debug.Assert( null == VisualTreeHelper.GetParent(child),
2040Debug.Assert(frameworkTemplate != null );
2054Debug.Assert( feWalkNode != null || fceWalkNode != null,
2127Debug.Assert(feContainer != null || fceContainer != null,
2146Debug.Assert(templatedChildren.Count > 0,
2175Debug.Assert(feContainer != null || fceContainer != null);
2210Debug.Assert(oldFrameworkTemplate != null );
2259Debug.Assert( oldFrameworkTemplate != null );
2387Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement,
2442Debug.Assert(sender is FrameworkElement || sender is FrameworkContentElement,
2473Debug.Assert( feTemplatedParent != null );
2476Debug.Assert(templatedParentTemplate != null, "Must have a VisualTree owner");
2497Debug.Assert(ownerStyle != null || frameworkTemplate != null );
2509Debug.Assert( frameworkTemplate != null );
2521Debug.Assert(action.ContainingTrigger is EventTrigger,
2612Debug.Assert(child.IsValid, "child should either be an FE or an FCE");
2878Debug.Assert(dataField == ThemeStyleDataField);
2964Debug.Assert(value != NotYetApplied, "attempt to retrieve instance value that was never set");
3017Debug.Assert(frameworkTemplate != null );
3031Debug.Assert(frameworkTemplate != null );
3066Debug.Assert(!StyleHelper.IsSetOnContainer(conditions[j].Property, ref containerDependents, true),
3142Debug.Assert(fe != null || fce != null);
3224Debug.Assert(fe != null || fce != null);
3296Debug.Assert(feContainer != null);
3305Debug.Assert(feContainer != null);
3345Debug.Assert(feContainer != null);
3368Debug.Assert(feContainer != null);
3396Debug.Assert(feContainer != null);
3440Debug.Assert(fe != null || fce != null);
3441Debug.Assert(container == fe || container == fce);
3481Debug.Assert(fe != null || fce != null);
3482Debug.Assert(container == fe || container == fce);
3483Debug.Assert( oldTemplate == null || oldTemplate is FrameworkTemplate,
3485Debug.Assert( newTemplate == null || newTemplate is FrameworkTemplate,
3487Debug.Assert( (oldTemplate == null || newTemplate == null ) ||
3895Debug.Assert(sourceType == ValueLookupType.Simple ||
3925Debug.Assert(sourceType == ValueLookupType.Trigger ||
3979Debug.Assert(sourceType == ValueLookupType.Simple ||
4079Debug.Assert(styledChildren != null, "Should reach here only if the template tree has already been created");
4189Debug.Assert(child.FE != null || child.FCE != null);
4208Debug.Assert(dp != null, "dp must not be null");
4298Debug.Assert(ownerStyle != null || frameworkTemplate != null );
4340Debug.Assert(candidateTrigger is List<TriggerBase>,
4369Debug.Assert(ownerStyle != null || frameworkTemplate != null );
4440Debug.Assert( triggerBase is MultiDataTrigger,
4476Debug.Assert( triggerBase is MultiTrigger,
4540Debug.Assert( ft != null );
4819Debug.Assert(!(action.ContainingTrigger is EventTrigger),
4835Debug.Assert( trigger.Property == changedProperty,
4842Debug.Assert( frameworkTemplate != null,
4850Debug.Assert( conditions != null && conditions.Length == 1,
4880Debug.Assert( conditions != null && conditions.Length == 1,
4913Debug.Assert( frameworkTemplate != null,
4924Debug.Assert(evaluationNode != null,
4986Debug.Assert( evaluationBinding != null,
5051Debug.Assert( existing is List<TriggerBase>,
5097Debug.Assert( existing is List<TriggerBase>,
5270Debug.Assert(candidateTrigger is List<TriggerBase>,
5302Debug.Assert(frameworkTemplate != null );
5309Debug.Assert(frameworkTemplate != null);
5333Debug.Assert(frameworkTemplate != null);
5378Debug.Assert(frameworkTemplate != null );
5383Debug.Assert(frameworkTemplate != null);
5436Debug.Assert(
5546Debug.Assert(routedEvent != null);
5800Debug.Fail("GetHashCode for value types will use reflection to generate the hashcode. Write a better hash code generation algorithm if this struct is to be used in a hashtable, or remove this assert if it's decided that reflection is OK.");
System\Windows\TreeWalkHelper.cs (14)
39Debug.Assert(fe != null || fce != null, "Node with the tree change notification must be an FE or an FCE.");
40Debug.Assert(parent != null, "Must have a parent that the current node is connected to or disconnected from.");
241Debug.Assert(fe != null || fce != null, "Must have non-null current node");
264Debug.Assert(inheritableProperty.IsPotentiallyInherited, "if we got here, it means that this property is inheritable by someone");
281Debug.Assert(!currentInheritableProperties.Contains(inheritableProperty), "InheritableProperties list should not have duplicates");
316Debug.Assert(d != null, "Must have non-null current node");
319Debug.Assert(fMetadata.IsInherited, "This must be an inherited dependency property");
322Debug.Assert(!wasSelfInheritanceParent || isSelfInheritanceParent, "IsSelfInheritanceParent changed from true to false");
453Debug.Assert(fe != null || fce != null, "Node with the resources change notification must be an FE or an FCE.");
522Debug.Assert(d != null, "Must have non-null current node");
684Debug.Assert(d != null, "Must have non-null current node");
747Debug.Assert(d != null, "Must have non-null current node");
909Debug.Assert(fo.IsValid, "Node with the resources change notification must be an FE or an FCE.");
941Debug.Assert(d != null, "Must have non-null current node");
System\Windows\Window.cs (57)
336Debug.Assert(_threadWindowHandles == null, "_threadWindowHandles must be null before enumerating the thread windows");
714Debug.Assert(false);
1359Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when _showingAsDialog is true");
2288Debug.Assert( _swh != null );
2297Debug.Assert( _swh != null );
3010Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function");
3237Debug.Assert(Manager != null, "HwndStyleManager must have a valid value here");
3570Debug.Assert(w != null, "Target must be of type Window.");
3593Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point");
3616Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point");
3753Debug.Assert(!IsSourceWindowNull, "_swh should not be null here");
3870Debug.Assert(hMonitor != IntPtr.Zero);
3903Debug.Assert(workAreaWidthDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaWidth ({hMonitor})for monitor ({workAreaWidthDeviceUnits}) is negative"));
3904Debug.Assert(workAreaHeightDeviceUnits >= 0, string.Create(CultureInfo.InvariantCulture, $"workAreaHeight ({hMonitor}) for monitor ({workAreaHeightDeviceUnits}) is negative"));
3914Debug.Assert(!IsSourceWindowNull, "_swh should not be null here");
4043Debug.Fail("Invalid value for ResizeMode");
4418Debug.Assert(_showingAsDialog, "_showingAsDialog must be true when DoDialogHide is called");
4456Debug.Assert(_threadWindowHandles != null, "_threadWindowHandles must not be null at this point");
4497Debug.Assert(ownedWindows.Count == 0, "All owned windows should now be gone");
5055Debug.Assert(w != null, "DependencyObject must be of type Window.");
5081Debug.Assert(w != null, "DependencyObject must be of type Window.");
5100Debug.Assert(w != null, "DependencyObject must be of type Window.");
5160Debug.Assert(w != null, "DependencyObject must be of type Window.");
5287Debug.Assert(w != null, "DependencyObject must be of type Window.");
5307Debug.Assert(w != null, "DependencyObject must be of type Window.");
5568Debug.Assert(_dispatcherFrame == null, "_dispatcherFrame must be null here");
5627Debug.Assert(w != null, "DependencyObject must be of type Window.");
5638Debug.Assert(w != null, "DependencyObject must be of type Window.");
5698Debug.Assert(w != null, "d must be typeof Window");
5721Debug.Assert(w != null, "d must be typeof Window");
5760Debug.Assert(w != null, "d must be typeof Window");
5798Debug.Assert(w != null, "d must be typeof Window");
5819Debug.Assert(w != null, "d must be typeof Window");
5860Debug.Assert(w != null, "d must be typeof Window");
5954Debug.Fail($"specifiedRestoreBounds can't be {specifiedRestoreBounds}");
6090Debug.Assert( w != null, "DependencyObject must be of type Window." );
6165Debug.Assert( w != null, "DependencyObject must be of type Window." );
6222Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true when calling this function");
6244Debug.Assert( w != null, "DependencyObject must be of type Window." );
6276Debug.Assert(w != null, "DependencyObject must be of type Window.");
6463Debug.Assert(0 != (int)_overlaySize.Width);
6464Debug.Assert(0 != (int)_overlaySize.Height);
6507Debug.Assert(null != _taskbarList);
6533Debug.Assert(false);
6552Debug.Assert(null != _taskbarList);
6566Debug.Assert(0 <= taskbarInfo.ProgressValue && taskbarInfo.ProgressValue <= 1);
6574Debug.Assert(null != _taskbarList);
6599Debug.Assert(null != _taskbarList);
6670Debug.Assert(null != _taskbarList);
6698Debug.Assert(null != _taskbarList);
7129Debug.Assert( _swh != null );
7347Debug.Assert( sourceWindow != null );
7430Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull cannot be true here");
7521Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" );
7531Debug.Assert(!IsSourceWindowNull, "Should only be invoked when we know Handle is non-null" );
7556Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here");
7575Debug.Assert(!IsSourceWindowNull, "IsSourceWindowNull can't be true here");
PresentationFramework.Aero (4)
PresentationFramework.Aero2 (4)
PresentationFramework.AeroLite (4)
PresentationFramework.Classic (22)
Microsoft\Windows\Themes\ClassicBorderDecorator.cs (18)
231Debug.Assert(rgbColor.Red >= 0 && rgbColor.Red <= 1, "Red must be between 0 and 1.");
232Debug.Assert(rgbColor.Green >= 0 && rgbColor.Green <= 1, "Green must be between 0 and 1.");
233Debug.Assert(rgbColor.Blue >= 0 && rgbColor.Blue <= 1, "Blue must be between 0 and 1.");
295Debug.Assert(hue >= 0 && hue <= 1, "Output hue should be between 0 and 1.");
296Debug.Assert(lightness >= 0 && lightness <= 1, "Output lightness should be between 0 and 1.");
297Debug.Assert(saturation >= 0 && saturation <= 1, "Output saturation should be between 0 and 1.");
299Debug.Assert(!isHueDefined || isSaturationDefined, "If hue is defined, saturation must also be defined.");
311Debug.Assert(hlsColor.Lightness >= 0 && hlsColor.Lightness <= 1, "Lightness must be between 0 and 1.");
312Debug.Assert(hlsColor.Saturation >= 0 && hlsColor.Saturation <= 1, "Saturation must be between 0 and 1.");
337Debug.Assert(red >= 0 && red <= 1, "Output red should be between 0 and 1.");
338Debug.Assert(green >= 0 && green <= 1, "Output green should be between 0 and 1.");
339Debug.Assert(blue >= 0 && blue <= 1, "Output blue should be between 0 and 1.");
346Debug.Assert(n1 >= 0 && n1 <= 1, "n1 must be between 0 and 1.");
347Debug.Assert(n2 >= 0 && n2 <= 1, "n2 must be between 0 and 1.");
348Debug.Assert(hue >= -6 && hue < 12, "Hue must be between -6 (inclusive) and 12 (exclusive).");
1154Debug.Assert(_tabCache != null, "_tabCache is null. GetShadow1 should only be called after GetHighlight1");
1167Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
1180Debug.Assert(_tabCache != null, "_tabCache is null. GetHighlight2 should only be called after GetHighlight1");
PresentationFramework.Luna (4)
PresentationFramework.Royale (4)
PresentationUI (5)
ReachFramework (123)
AlphaFlattener\BrushProxy.cs (55)
163Debug.Assert(pen != null, "pen expected");
164Debug.Assert(brush != null, "brush expected");
187Debug.Assert(_brush.BrushList == null, "Simple brush expected");
269Debug.Assert(pen != null, "pen expected");
270Debug.Assert(pen.Brush != null, "pen expected to have a brush");
302Debug.Assert(pen != null, "pen expected");
303Debug.Assert(pen.Brush != null, "pen expected to have a brush");
540Debug.Assert(bp._opacityOnly == _opacityOnly, "Brush and OpacityMask can't mix in a single list");
668Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox area must be positive");
675Debug.Fail("IsOpaque(" + _brush.GetType() + ") not handled");
735Debug.Assert(Utility.IsRenderVisible(vb), "TileBrush.Viewbox must be visible");
771Debug.Fail("IsTransparent not handled " + _brush.GetType());
1075Debug.Fail("Unexpected brush type");
1191Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute);
1223Debug.Assert(tileBrush.ViewportUnits == BrushMappingMode.Absolute);
1248Debug.Assert(drawingBrush.Drawing != null, "DrawingBrush where Drawing == null should've been culled");
1314Debug.Assert(_drawing != null, "_drawing primitive changed, but it's null");
1383Debug.Assert(!_bounds.IsEmpty);
1391Debug.Assert(_brushList != null && _bounds.IsEmpty);
1730Debug.Assert(brush.ViewboxUnits == BrushMappingMode.Absolute);
1731Debug.Assert(brush.ViewportUnits == BrushMappingMode.Absolute);
1933Debug.Fail("Unhandled GradientBrush type");
1986Debug.Assert(g.GradientStops != null);
2041Debug.Assert(g.GradientStops.Count > 0);
2130Debug.Assert(b._brush is SolidColorBrush, "SolidColorBrush expected");
2131Debug.Assert(!b._opacityOnly, "OpacityMask not expected");
2143Debug.Assert(first, "prefix only");
2371Debug.Assert(bp != null, "Blending visible ImageBrush with another brush should yield non-empty brush");
2648Debug.Assert(brush != null, "null brush");
2691Debug.Assert(gb.MappingMode == BrushMappingMode.Absolute, "absolute brush");
2699Debug.Assert(tb.ViewportUnits == BrushMappingMode.Absolute, "absolute brush required for BrushProxy");
2885Debug.Fail("Unhandled GradientBrush type");
2910Debug.Fail("Unandled Brush type");
2940Debug.Assert(gsc != null && gsc.Count > 0, "BrushProxy.IsEmpty should return true upon GradientBrush with zero stops");
2981Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for BitmapCacheBrush");
3059Debug.Assert(!bounds.IsEmpty, "Bounds must not be empty for VisualBrush");
3199Debug.Fail("Unhandled ImageBrush.ImageSource type");
3254Debug.Assert(brushB.Brush != null, "null brush not expected");
3341Debug.Fail("Brush type not expected");
3366Debug.Assert(Utility.NormalizeOpacity(value) == value, "BrushProxy.Opacity must always be normalized");
3494Debug.Fail("Unexpected brush type");
3614Debug.Fail("Single brush expected");
3639Debug.Assert(
3706Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid");
3780Debug.Assert(false); // Optimization is needed before reaching here
3786Debug.Assert(false); // Optimization is needed before reaching here
3791Debug.Assert(steps > 0);
3831Debug.Assert((i >= 0) && (i < steps));
3845Debug.Assert(false);
3942Debug.Assert(di >= 0);
4044Debug.Assert(_left <= left);
4045Debug.Assert(_right >= right);
4175Debug.Assert(Utility.IsValid(opacity), "Opacity comes from BrushProxy, should be valid");
4271Debug.Assert(_left <= left);
4272Debug.Assert(_right >= right);
RepoTasks (3)
Roslyn.Diagnostics.Analyzers (563)
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedDictionary`2.cs (21)
168Debug.Assert(_entries.Length >= source.Count);
169Debug.Assert(_count == 0);
260Debug.Assert(modified);
267Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
301Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
302Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
408Debug.Assert(_entries.Length > 0, "expected entries to be non-empty");
447Debug.Assert(comparer is not null);
518Debug.Assert(_buckets.Length > 0);
521Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
524Debug.Assert(comparer is not null || (SupportsComparerDevirtualization && typeof(TKey).IsValueType));
574Debug.Assert(comparer is not null);
616Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
648Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
649Debug.Assert(newSize >= _entries.Length);
707Debug.Assert(_entries.Length > 0, "entries should be non-empty");
711Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
734Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
784Debug.Assert(_entries.Length > 0, "entries should be non-empty");
788Debug.Assert((SupportsComparerDevirtualization && typeof(TKey).IsValueType) || comparer is not null);
813Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
src\roslyn\src\Dependencies\Collections\Segmented\SegmentedHashSet`1.cs (16)
189Debug.Assert(Count == source.Count);
204Debug.Assert(_buckets.Length > 0, "_buckets should be non-empty");
205Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
227Debug.Assert(entries.Length > 0, "Expected _entries to be initialized");
258Debug.Assert(comparer is not null);
296Debug.Assert(entries.Length > 0, "entries should be non-empty");
302Debug.Assert((SupportsComparerDevirtualization && typeof(T).IsValueType) || comparer is not null);
326Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
901Debug.Assert(_entries.Length > 0, "_entries should be non-empty");
902Debug.Assert(newSize >= _entries.Length);
1023Debug.Assert(_buckets.Length > 0);
1026Debug.Assert(entries.Length > 0, "expected entries to be non-empty");
1063Debug.Assert(comparer is not null);
1091Debug.Assert((StartOfFreeList - entries[_freeList]._next) >= -1, "shouldn't overflow because `next` cannot underflow");
1172Debug.Assert(_buckets.Length > 0, "_buckets shouldn't be empty; callers should check first");
1329Debug.Assert((_buckets.Length > 0) && (_count > 0), "_buckets was empty but count greater than 0");
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Formatting\Context\FormattingContext.InitialContextFinder.cs (1)
56Debug.Assert(
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Extensions\Symbols\SymbolEquivalenceComparer.GetHashCodeVisitor.cs (1)
266Debug.Assert(
Roslyn.Diagnostics.CSharp.Analyzers (76)
rzc (15)
Shared (25)
..\..\..\..\src\Shared\ServerSentEvents\SseParser_1.cs (7)
282Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}");
283Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}");
284Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}");
286Debug.Assert(searchLength >= 0, $"{searchLength}");
287Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}");
292Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
548Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
Stress.ApiService (3)
System (1)
System.CodeDom (6)
System.Collections (103)
System.Collections.Concurrent (67)
System.Collections.Immutable (185)
System.Collections.NonGeneric (1)
System.Collections.Specialized (14)
System.CommandLine.StaticCompletions (1)
System.ComponentModel.Annotations (14)
System.ComponentModel.Composition (53)
System.ComponentModel.EventBasedAsync (1)
System.ComponentModel.TypeConverter (137)
System\ComponentModel\MaskedTextProvider.cs (15)
635Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars.");
647Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars.");
1266Debug.Assert(input != null && position >= 0 && position < _testString.Length, "input param out of range.");
1554Debug.Assert(startPosition >= 0 && startPosition <= endPosition && endPosition < _testString.Length, "Out of range input value.");
1946Debug.Assert(AssignedEditPositionCount >= 0, "Invalid count of assigned chars.");
1956Debug.Assert(startPosition >= 0 && endPosition >= 0 && endPosition >= startPosition && endPosition < _testString.Length, "position out of range.");
2025Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range.");
2037Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range.");
2038Debug.Assert(charDescriptor != null, "Null character descriptor.");
2051Debug.Assert(!IsLiteralPosition(charDex), "Setting char in literal position.");
2084Debug.Assert(AssignedEditPositionCount <= EditPositionCount, "Invalid count of assigned chars.");
2162Debug.Assert(position >= 0 && position < _testString.Length, "Position out of range.");
2324Debug.Fail("Invalid mask language character.");
2420Debug.Assert(input != null, "null input.");
2421Debug.Assert(position >= 0, "Position out of range.");
System\ComponentModel\ReflectEventDescriptor.cs (10)
89Debug.Assert(type.IsSubclassOf(typeof(Delegate)), $"Not a valid ReflectEvent: {componentClass.FullName}. {name} {type.FullName}");
99Debug.Assert(eventInfo.ReflectedType!.IsAssignableFrom(componentClass), "eventInfo.ReflectedType is used below, but only componentClass is annotated with DynamicallyAccessedMembers. Ensure ReflectedType is in componentClass's hierarchy.");
236Debug.Assert(_componentClass != null, "Must have a component class for FilterAttributes");
243Debug.Assert(_removeMethod != null, $"Null remove method for {Name}");
246Debug.Assert(_addMethod != null, $"Null remove method for {Name}");
262Debug.Assert(currentReflectType != null, "currentReflectType cannot be null");
263Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
368Debug.Fail($"Missing event accessors for {_componentClass.FullName}. {Name}");
383Debug.Assert(currentReflectType != null, "currentReflectType cannot be null");
384Debug.Assert(currentReflectType.IsAssignableFrom(_componentClass), "currentReflectType must be in _componentClass's hierarchy");
System\ComponentModel\ReflectTypeDescriptionProvider.cs (17)
224Debug.Assert(table != null, "COMPAT: Editor table should not be null"); // don't throw; RTM didn't so we can't do it either.
245Debug.Assert(objectType != null, "Should have arg-checked before coming in here");
611Debug.Assert(eppa != null, $"Extender property {prop.Name} has no provider attribute. We will skip it.");
766Debug.Assert(idx < extenderCount, "There are more extenders than we expect");
771Debug.Assert(idx == extenderCount, "Wrong number of extenders");
782Debug.Assert(idx < extenderCount, "There are more extenders than we expect");
787Debug.Assert(idx == extenderCount, "Wrong number of extenders");
821Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us.");
827Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us.");
908Debug.Assert(objectType != null, "Should have arg-checked before coming in here");
921Debug.Assert(td != null);
929Debug.Assert(td != null);
1032Debug.Fail("This should never be invoked. TypeDescriptionNode should wrap for us.");
1185Debug.Fail("Hey, assumption holds true. Rip this assert.");
1205Debug.Assert(dbgEvent != null, $"Holes in event array for type {type}");
1399Debug.Assert(Array.TrueForAll(properties, dbgProp => dbgProp is not null), $"Holes in property array for type {type}");
1585Debug.Assert(callingType != typeof(Uri) && callingType != typeof(CultureInfo));
System\ComponentModel\TypeDescriptor.cs (36)
690Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
716Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
855Debug.Assert(converter != null, "Unexpected null TypeConverter.");
865Debug.Assert(converter != null, "Unexpected null TypeConverter.");
907Debug.Fail("COMPAT: Returning null, but you should not pass null here");
929Debug.Fail("COMPAT: Returning null, but you should not pass null here");
945Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
967Debug.Fail("COMPAT: Returning null, but you should not pass null here");
1105Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1132Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1191Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1342Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1369Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1448Debug.Fail("COMPAT: Returning an empty collection, but you should not pass null here");
1658Debug.Assert(type != null, "Caller should validate");
1746Debug.Assert(instance != null, "Caller should validate");
1845Debug.Assert(target.Next == null, "Delegating provider should always be the last provider in the chain.");
1885Debug.Assert(pipelineType != PIPELINE_ATTRIBUTES, "PipelineAttributeFilter is not supported for attributes");
1938Debug.Fail("unknown pipeline type");
1975Debug.Assert(cache == null || list == null || !cache.Contains(s_pipelineFilterKeys[pipelineType]), "Earlier pipeline stage should have removed our cache");
2033Debug.Assert(suffix != null, "Name collision with non-extender property.");
2065Debug.Fail("unknown pipeline type");
2136Debug.Fail("unknown pipeline type");
2277Debug.Fail("unknown pipeline type");
2317Debug.Fail("COMPAT: Returning, but you should not pass null here");
2400Debug.Fail("COMPAT: Returning, but you should not pass null here");
2462Debug.Fail("COMPAT: Returning, but you should not pass null here");
2521Debug.Fail("COMPAT: Returning, but you should not pass null here");
2925Debug.Assert(newAttrs[idx] != null, "_attributes contains a null member");
3096Debug.Assert(attrs != null, "Someone should have handled this");
3107Debug.Assert(className != null, "Someone should have handled this");
3127Debug.Assert(converter != null, "Someone should have handled this");
3169Debug.Assert(events != null, "Someone should have handled this");
3181Debug.Assert(events != null, "Someone should have handled this");
3193Debug.Assert(properties != null, "Someone should have handled this");
3207Debug.Assert(properties != null, "Someone should have handled this");
System.Composition.Hosting (11)
System.Composition.Runtime (2)
System.Configuration.ConfigurationManager (122)
System\Configuration\BaseConfigurationRecord.cs (33)
450Debug.Assert(inputsPerConfigKey.Count > 0, "We won't get here unless we have inputs.");
542Debug.Assert(!_parent.IsInitDelayed, "!_parent.IsInitDelayed");
648Debug.Assert(!sectionRecord.HasIndirectLocationInputs,
773Debug.Assert(requestIsHere || !checkPermission, "requestIsHere || !checkPermission");
776Debug.Assert(getRuntimeObject, "getRuntimeObject == true");
777Debug.Assert(requestIsHere, "requestIsHere == true");
793Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors");
940Debug.Assert(factoryRecord != null, "factoryRecord != null");
953Debug.Assert(factoryRecord != null, "factoryRecord != null");
959Debug.Assert(!checkPermission || (factoryRecord != null),
1012Debug.Assert(success || getLkg, "success || getLkg");
1016Debug.Assert(getLkg, "getLkg == true");
1045Debug.Assert(!requestIsHere, "!requestIsHere");
1085Debug.Assert(getLkg, "getLkg == true");
1158Debug.Assert(!factoryRecord.HasErrors, "!factoryRecord.HasErrors");
1161Debug.Assert(sectionRecord.HasInput, "sectionRecord.HasInput");
1169Debug.Assert(!(IsLocationConfig && getLkg),
1179Debug.Assert(!sectionRecord.HasErrors, "!sectionRecord.HasErrors");
1219Debug.Assert(IsLocationConfig,
1272Debug.Assert((locationInputs != null) || (indirectLocationInputs != null),
1293Debug.Assert(getLkg, "getLkg == true");
1608Debug.Assert(_protectedConfig != null,
1670Debug.Assert(tConfigRecord._parent.IsRootConfig,
1724Debug.Assert(!rootFactoryRecord.HasErrors, "!rootFactoryRecord.HasErrors");
2167Debug.Assert(UrlPath.IsSubpath(_parent.ConfigPath, input.SectionXmlInfo.TargetConfigPath));
2245Debug.Assert(FindFactoryRecord(configKey, true) != null);
2261Debug.Assert(mode != OverrideMode.Inherit); // Remember that the default is never Inherit
2276Debug.Assert(mode != OverrideMode.Inherit);
2618Debug.Assert(!positionedAtNextElement, "!positionedAtNextElement");
3664Debug.Assert(factoryRecord.HasErrors,
3746Debug.Assert(x.SectionXmlInfo.ConfigKey == y.SectionXmlInfo.ConfigKey);
3774Debug.Assert(StringUtil.EqualsIgnoreCase(yTargetConfigPath, xTargetConfigPath));
3792Debug.Fail("It's not possible for two location input to come from the same config file and point to the same target");
System\Configuration\MgmtConfigurationRecord.cs (28)
338Debug.Assert(sectionRecord != null);
342Debug.Assert(input.HasResult, "input.HasResult");
349Debug.Assert(IsLocationConfig, "Indirect location inputs exist only in location config record");
351Debug.Assert(input != null);
352Debug.Assert(input.HasResult, "input.HasResult");
381Debug.Assert(!current.IsRootConfig, "An immediate parent result should have been found");
965Debug.Assert(filename.Length > 0, "The caller should make sure that filename is not empty");
1397Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared");
1398Debug.Assert(!IsImplicitSection(factoryRecord.ConfigKey),
1427Debug.Assert(!IsImplicitSection(sectionRecord.ConfigKey),
1429Debug.Assert(!factoryRecord.IsUndeclared, "!factoryRecord.IsUndeclared");
1799Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs,
1821Debug.Assert(sectionRecord.HasFileInput || sectionRecord.HasLocationInputs,
1984Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section");
2080Debug.Assert(IsLocationConfig, "IsLocationConfig");
2209Debug.Assert((reader.NodeType == XmlNodeType.Element) && (reader.Name == ConfigurationTag),
2270Debug.Assert(
2345Debug.Assert(
2350Debug.Assert(!l.SectionUpdates.HasUnretrievedSections(),
2410Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section");
2469Debug.Assert(!IsImplicitSection(configKey), "We should never write out an implicit section");
2551Debug.Assert(groupUpdate.UpdatedXml == null, "groupUpdate.UpdatedXml == null");
2552Debug.Assert(!declarationUpdatesChild.HasUnretrievedSections(),
2638Debug.Assert(locationPathApplies, nameof(locationPathApplies));
2707Debug.Assert(LocationSubPath == null);
2731Debug.Assert(allowOverrideAttribute == null,
2983Debug.Assert(update.SectionRecord.HasFileInput, "update.SectionRecord.HasFileInput");
3024Debug.Assert(hasFile, "hasFile");
System.Console (49)
System.Data.Common (1046)
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (12)
414Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex");
428Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index");
429Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index");
494Debug.Assert(parsetableContainsKey, $"{nameof(ParseInternal)} code vs. regex mismatch keyname <{keyname}>");
495Debug.Assert(value1 == value2, $"{nameof(ParseInternal)} code vs. regex mismatch keyvalue <{value1}> <{value2}>");
520Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>");
524Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}");
530Debug.Fail("ParseInternal code threw exception vs regex mismatch");
537Debug.Assert(null != connectionString, "null connectionstring");
559Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname");
560Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue");
641Debug.Assert(expanded, "password/pwd was not removed");
System\Data\Common\DataStorage.cs (14)
142Debug.Assert(storageType == GetStorageType(type), "Incorrect storage type specified");
239Debug.Fail("not a String or SqlString column");
297Debug.Assert(typeCode == GetStorageType(dataType), "Incorrect storage type specified");
357Debug.Fail("shouldn't be here");
381Debug.Assert(storageType != StorageType.Empty);
465Debug.Assert(result == dataType.IsValueType, "typeCode mismatches dataType");
478Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType");
505Debug.Assert(nullable == typeof(INullable).IsAssignableFrom(dataType), "INullable");
506Debug.Assert(changeTracking == typeof(System.ComponentModel.IChangeTracking).IsAssignableFrom(dataType), "IChangeTracking");
507Debug.Assert(revertibleChangeTracking == typeof(System.ComponentModel.IRevertibleChangeTracking).IsAssignableFrom(dataType), "IRevertibleChangeTracking");
508Debug.Assert(xmlSerializable == typeof(IXmlSerializable).IsAssignableFrom(dataType), "IXmlSerializable");
513Debug.Assert(dataType != null, "Type should not be null");
524Debug.Assert(typeCode == GetStorageType(dataType), "typeCode mismatches dataType");
595Debug.Assert(null != type, "null type");
System\Data\Common\DBCommandBuilder.cs (13)
201Debug.Assert(_isMutatedName[iMutatedName], $"{_baseParameterNames[iMutatedName]} expected to be a mutated name");
608Debug.Fail("Rowcount expected to be 1");
799Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name");
820Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name");
911Debug.Assert(!string.IsNullOrEmpty(_quotedBaseTableName), "no table name");
1135Debug.Assert(!string.IsNullOrEmpty(sourceColumn), "empty source column");
1167Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?");
1168Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?");
1216Debug.Assert(null != _parameterNames, "How can we have a parameterName without a _parameterNames collection?");
1217Debug.Assert(null != _parameterMarkerFormat, "How can we have a _parameterNames collection but no _parameterMarkerFormat?");
1402Debug.Assert(null != p, "null CreateParameter");
1552Debug.Fail("how did we get here?");
1617Debug.Fail("how did we get here?");
System\Data\Common\DbDataAdapter.cs (25)
775Debug.Assert(DbType.Int32 == parameter.DbType, "unexpected DbType");
937Debug.Assert(null != tableMapping, "null TableMapping when MissingMappingAction.Error");
966Debug.Assert((null != dataRows) && (0 < dataRows.Length), "Update: bad dataRows");
967Debug.Assert(null != tableMapping, "Update: bad DataTableMapping");
1038Debug.Fail("InvalidDataRowState");
1366Debug.Assert(rowUpdatedEvent.Rows != null);
1451Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception");
1462Debug.Assert(null != connection, "unexpected null connection");
1497Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent");
1498Debug.Assert(null != dataCommand, "null dataCommand");
1499Debug.Assert(rowUpdatedEvent.Command == dataCommand, "dataCommand differs from rowUpdatedEvent");
1560Debug.Fail("unexpected StatementType");
1585Debug.Assert(null == rowUpdatedEvent.Errors, "Continue - but contains an exception");
1597Debug.Assert(null != rowUpdatedEvent, "null rowUpdatedEvent");
1619Debug.Assert(null != batchCommands, "null batchCommands?");
1638Debug.Assert(null != row, "null dataRow?");
1654Debug.Assert(null != batchCommands, "null batchCommands?");
1670Debug.Assert(null != row, "null dataRow?");
1706Debug.Assert(null != batchCommands, "null batchCommands?");
1713Debug.Assert(null != row, "null dataRow?");
1724Debug.Assert(null != dataRow, "null dataRow");
1771Debug.Assert(null != command, "GetConnection3: null command");
1772Debug.Assert(!string.IsNullOrEmpty(method), "missing method name");
1783Debug.Assert(null != command, "GetConnection4: null command");
1824Debug.Assert(null != connection, "QuietOpen: null connection");
System\Data\Common\SQLConvert.cs (16)
14Debug.Assert(value != null, "null argument in ConvertToSqlByte");
32Debug.Assert(value != null, "null argument in ConvertToSqlInt16");
51Debug.Assert(value != null, "null argument in ConvertToSqlInt32");
74Debug.Assert(value != null, "null argument in ConvertToSqlInt64");
99Debug.Assert(value != null, "null argument in ConvertToSqlDouble");
132Debug.Assert(value != null, "null argument in ConvertToSqlDecimal");
162Debug.Assert(value != null, "null argument in ConvertToSqlSingle");
193Debug.Assert(value != null, "null argument in ConvertToSqlMoney");
223Debug.Assert(value != null, "null argument in ConvertToSqlDateTime");
241Debug.Assert(value != null, "null argument in ConvertToSqlBoolean");
259Debug.Assert(value != null, "null argument in ConvertToSqlGuid");
277Debug.Assert(value != null, "null argument in ConvertToSqlBinary");
295Debug.Assert(value != null, "null argument in ConvertToSqlString");
313Debug.Assert(value != null, "null argument in ConvertToSqlChars");
329Debug.Assert(value != null, "null argument in ConvertToSqlBytes");
561Debug.Assert(value is string || type == typeof(string), "invalid call to ChangeTypeForXML");
System\Data\DataColumn.cs (42)
405Debug.Assert(!string.IsNullOrEmpty(_encodedColumnName));
456Debug.Assert(value != null);
647Debug.Assert(_defaultValue != null, "It should not have been set to null.");
859Debug.Assert(null != _storage, "no storage");
868Debug.Assert(null != _storage, "no storage");
877Debug.Assert(null != _storage, "no storage");
888Debug.Assert(_simpleType.CanHaveMaxLength(), "expected simpleType to be string");
1028Debug.Assert(2 <= _sortIndex.RefCount, "bad sortIndex refcount");
1096Debug.Assert(table != null || !Unique);
1131Debug.Assert(null != _storage, "null storage");
1139Debug.Assert(null != _storage, "no storage");
1140Debug.Assert(null != value, "setting null, expecting dbnull");
1142Debug.Assert(null != _table, "storage with no DataTable on column");
1169Debug.Assert(null != _storage, "no storage");
1178Debug.Assert(null != value, "setting null, expecting dbnull");
1179Debug.Assert(null != _table, "storage with no DataTable on column");
1180Debug.Assert(null != _storage, "no storage");
1196Debug.Assert(null != _storage, "no storage");
1235Debug.Assert(oldConstraint != null, "Should have found a column to remove from the collection.");
1250Debug.Assert(_table.Constraints.FindKeyConstraint(this) == null, "Should not be a duplication constraint in collection");
1369Debug.Assert(IsStringType, "not a String or SqlString column");
1389Debug.Assert(IsStringType, "not a String or SqlString column");
1444Debug.Assert(null != _storage, "no storage");
1464Debug.Assert(null != _storage, "null storage");
1495Debug.Assert(null != _storage, "null storage");
1501Debug.Assert(null != _storage, "null storage");
1507Debug.Assert(null != _storage, "null storage");
1584Debug.Assert(null != _storage, "no storage");
1594Debug.Assert(null != _storage, "no storage");
1629Debug.Assert(null != _storage, "no storage");
1641Debug.Assert(rels != null, "Invalid ParentRelations");
1645Debug.Assert(key.HasValue, "Invalid child key (null)");
1653Debug.Assert(rels != null, "Invalid ChildRelations");
1657Debug.Assert(key.HasValue, "Invalid parent key (null)");
1754Debug.Assert(s != null, "Caller is responsible for missing element/attribute case");
1769Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull");
1777Debug.Assert(value != null && (value != DBNull.Value), "Caller is responsible for checking on DBNull");
1788Debug.Assert(null != _storage, "no storage");
1802Debug.Assert(!_dependentColumns.Contains(expressionColumn), "duplicate column - expected to be unique");
1818Debug.Assert(_table != null);
1827Debug.Assert(null != col, "null datacolumn in expression dependencies");
1956Debug.Assert(null != value && DataColumn.IsAutoIncrementType(value.GetType()) && !(value is BigInteger), "unexpected value for autoincrement");
System\Data\DataRow.cs (15)
340Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?");
341Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?");
357Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?");
512Debug.Assert(!_inChangingEvent, "how are we in a changing event to cancel?");
513Debug.Assert(-1 != _tempRecord, "how no propsed record to cancel?");
530Debug.Assert(!_inChangingEvent, "how are we in a changing event to end?");
608Debug.Assert(-1 != _tempRecord, "missing temp record");
609Debug.Assert(0 == _countColumnChange, "unexpected column change count");
610Debug.Assert(null == _lastChangedColumn, "unexpected last column change");
626Debug.Assert(-1 == _tempRecord, "unexpected temp record");
1033Debug.Assert(0 != (DataViewRowState.Added & viewState), "not DataViewRowState.Added");
1038Debug.Assert(_action == DataRowAction.Rollback || 0 != (DataViewRowState.Deleted & viewState), "not DataViewRowState.Deleted");
1047Debug.Assert(0 != (DataViewRowState.ModifiedOriginal & viewState), "not DataViewRowState.ModifiedOriginal");
1352Debug.Assert(relation != null, "The relation should not be null here.");
1447Debug.Assert(valueFromStorage.Equals(column.DataExpression.Evaluate(this, version)),
System\Data\DataTable.cs (75)
279Debug.Assert(ds.RemotingFormat == SerializationFormat.Xml, "RemotingFormat must be SerializationFormat.Xml");
329Debug.Assert(ds.Tables.Count == 1, "There should be exactly 1 table here");
455Debug.Assert(Columns.Count == 0, "There is column in Table");
524Debug.Assert(DataSet != null);
554Debug.Assert(fk != null);
625Debug.Assert(con.Equals("F"));
868Debug.Assert(bitStates != null);
869Debug.Assert(bitStates.Length > bitIndex);
899Debug.Assert(Rows.Count > rowIndex);
900Debug.Assert(rowErrors != null);
901Debug.Assert(colErrors != null);
930Debug.Assert(Rows.Count > rowIndex);
931Debug.Assert(rowErrors != null);
932Debug.Assert(colErrors != null);
945Debug.Assert(columnsInError.Length == columnErrors.Length);
1409Debug.Assert(null != _culture, "null culture");
1480Debug.Assert(null != culture, "SetLocaleValue: no locale");
1569Debug.Assert(nRel.Length == _nestedParentRelations.Length, "nestedParent cache is broken");
1572Debug.Assert(null != nRel[i], "null relation");
1573Debug.Assert(null != _nestedParentRelations[i], "null relation");
1574Debug.Assert(nRel[i] == _nestedParentRelations[i], "unequal relations");
1636Debug.Assert(2 <= primayKeyConstraint.ConstraintIndex.RefCount, "bad primaryKey index RefCount");
1730Debug.Assert(_primaryKey == null || Constraints.FindConstraint(_primaryKey) == _primaryKey, "PrimaryKey is not in ConstraintCollection");
2098Debug.Assert(value != null, "Value should not be null ??");
2099Debug.Assert(value.ColumnMapping == MappingType.SimpleContent, "should be text node here");
2143Debug.Assert(ndx != null);
2163Debug.Assert(action == DataRowAction.Delete, "Unexpected SetNewRecord action in merge function.");
2250Debug.Assert(saveIdxRecord == ((saveRowState == DataRowState.Added) ? targetRow._newRecord : targetRow._oldRecord), "oops, you change index record without noticing it");
2400Debug.Assert(clone != null, "The table passed in has to be newly created empty DataTable.");
2842Debug.Assert(null == _rowDiffId, "wasn't previously cleared");
3131Debug.Assert(Enum.GetUnderlyingType(typeof(DataRowState)) == typeof(int), "Invalid DataRowState type");
3373Debug.Assert(key.HasValue);
3556Debug.Assert(e != null, "e should not be null");
3566Debug.Assert(e != null, "e should not be null");
3622Debug.Assert((null != e) && ((null != _onRowChangedDelegate) || IsTypedDataTable), "OnRowChanged arguments");
3635Debug.Assert((null != e) && ((null != _onRowChangingDelegate) || IsTypedDataTable), "OnRowChanging arguments");
3648Debug.Assert((null != e) && ((null != _onRowDeletingDelegate) || IsTypedDataTable), "OnRowDeleting arguments");
3661Debug.Assert((null != e) && ((null != _onRowDeletedDelegate) || IsTypedDataTable), "OnRowDeleted arguments");
3764Debug.Assert(record != -1, "Record number must be given");
3790Debug.Assert(oldIndex.Length == newIndex.Length, "Size oldIndexes and newIndexes should be the same");
3791Debug.Assert(oldIndex.Length == _shadowIndexes!.Count, "Size of OldIndexes should be the same as size of Live indexes");
4065Debug.Assert(null != _indexes, "unexpected null indexes");
4284Debug.Assert(row != null, "Row can't be null.");
4299Debug.Assert(fireEvent, "SetNewRecord is called with wrong parameter");
4305Debug.Assert(!row._inChangingEvent, "How can this row be in an infinite loop?");
4556Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count");
4568Debug.Assert(0 == _shadowCount, "unexpected count");
4574Debug.Assert(1 <= _shadowCount, "unexpected negative shadow count");
4583Debug.Assert(0 < _indexes.Count, "unexpected");
4606Debug.Assert(null == _loadIndex, "loadIndex should already be null");
4695Debug.Assert(2 <= _loadIndex.RefCount, "bad loadIndex.RefCount");
4702Debug.Assert(row != null, "Row can't be null for index record");
4758Debug.Assert(_loadIndexwithCurrentDeleted != null, "loadIndexwithCurrentDeleted should not be null");
4769Debug.Assert(_loadIndexwithOriginalAdded != null, "loadIndexwithOriginalAdded should not be null");
4775Debug.Assert(2 <= indextoUse!.RefCount, "bad indextoUse.RefCount");
4810Debug.Assert(row != null, "Row can't be null for index record");
4883Debug.Assert(parentKey != null, "AddForeignKey: Invalid parameter.. related primary key is null");
5036Debug.Assert(result.Max >= result.Min);
5165Debug.Fail("LoadOption.Upsert with deleted row, should not be here");
5201Debug.Assert(dataRow._tempRecord == recordNo, "tempRecord has been changed in event handler");
5537Debug.Assert(tableList != null, "tableList shouldnot be null");
6592Debug.Assert(DataSet != null);
6827Debug.Assert(_targetTable == null, "do not reuse this section");
6828Debug.Assert(table != null);
6829Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared");
6831Debug.Assert(t_usedTables == null || !t_usedTables.Contains(table),
6850Debug.Assert(t_usedTables != null && t_usedTables.Contains(_targetTable), "missing Prepare before Cleanup");
6869Debug.Assert(t_usedTables != null, message);
6880Debug.Assert(_targetDS == null, "do not reuse this section");
6881Debug.Assert(ds != null);
6893Debug.Assert(!RowDiffIdUsageSection.t_usedTables.Contains(table), "Nested call with same table can cause data corruption!");
6896Debug.Assert(table._rowDiffId == null, "rowDiffId wasn't previously cleared");
6908Debug.Assert(RowDiffIdUsageSection.t_usedTables != null, "missing Prepare before Cleanup");
7073Debug.Assert(column._table != null);
7074Debug.Assert(column.Computed, "Only computed columns should be re-evaluated.");
System\Data\DataView.cs (24)
275Debug.Assert(_rowViewCache.Count == CountFromIndex, "DataView.Count mismatch");
360Debug.Assert(null != predicate, "null predicate");
367Debug.Assert(DataRowVersion.Default != version, "not expecting Default");
368Debug.Assert(DataRowVersion.Proposed != version, "not expecting Proposed");
549Debug.Assert(null == _addNewRow, "AddNew addNewRow is not null");
784Debug.Assert(null != _addNewRow, "null addNewRow");
808Debug.Assert(flag, "didn't remove addNewRow");
1099Debug.Assert(property != null, "property is null");
1291Debug.Assert(null != row, "MaintainDataView.ItemAdded with null DataRow");
1298Debug.Assert(flag, "row actually removed");
1305Debug.Assert(0 <= index, "ItemAdded was actually deleted");
1316Debug.Fail("ItemAdded DataRow already in view");
1320Debug.Assert(null != row, "MaintainDataView.ItemDeleted with null DataRow");
1321Debug.Assert(row != _addNewRow, "addNewRow being deleted");
1333Debug.Fail("ItemDeleted DataRow not in view tracking");
1338Debug.Fail("ItemDeleted DataRow not in view");
1342Debug.Assert(null == row, "MaintainDataView.Reset with non-null DataRow");
1351Debug.Fail("unexpected");
1376Debug.Assert(((ListChangedType.ItemChanged == e.ListChangedType) && ((e.NewIndex == e.OldIndex) || (-1 == e.OldIndex))) ||
1380Debug.Assert(0 <= e.NewIndex, "negative NewIndex");
1471Debug.Assert(null != drv, "didn't contain addNewRow");
1474Debug.Assert(rvc.Count == CountFromIndex, "didn't add expected count");
1535Debug.Assert((0 == (DataViewRowState.ModifiedCurrent & newRowStates)) ||
1552Debug.Assert(null == _comparison, "RelatedView should not have a comparison function");
System\Data\Filter\ExpressionParser.cs (34)
294Debug.Assert(_text[_start] == '\'' && _text[_pos - 1] == '\'', "The expression contains an invalid string constant");
295Debug.Assert(_pos - _start > 1, "The expression contains an invalid string constant");
301Debug.Assert(_text[_start] == '#' && _text[_pos - 1] == '#', "The expression contains invalid date constant.");
302Debug.Assert(_pos - _start > 2, "The expression contains invalid date constant '{0}'.");
308Debug.Fail("unhandled token");
322Debug.Assert(_topOperator > 0, "Empty operator stack!!");
393Debug.Assert(_topOperator > 1, "melformed operator stack.");
403Debug.Assert(opInfo._priority == Operators.PriParen, "melformed operator stack.");
415Debug.Assert(_topNode > 0 && NodePeek()!.GetType() == typeof(FunctionNode), "The function node should be created on '('");
549Debug.Assert(_topNode == 1 || _topNode == 0, "Invalid Node Stack");
562Debug.Assert(_token == Tokens.LeftParen, "ParseAggregateArgument(): Invalid argument, token <> '('");
618Debug.Assert(_topNode > 0, "NodePop(): Corrupted node stack");
620Debug.Assert(null != node, "null NodePop");
640Debug.Assert(null != node, "null NodePush");
658Debug.Assert(pri > Operators.PriStart && pri <= Operators.PriMax, "Invalid priority value");
664Debug.Assert(_topOperator > 0, "Empty operator stack!!");
670Debug.Assert(opInfo._priority >= pri, "Invalid prioriry value");
710Debug.Assert(opInfo._op == Operators.Plus ||
719Debug.Assert(nodeLeft != null, "Invalid left operand");
720Debug.Assert(nodeRight != null, "Invalid right operand");
751Debug.Assert(nodeLeft == null, "Invalid left operand");
752Debug.Assert(nodeRight != null, "Invalid right operand");
763Debug.Fail("Unhandled operator type");
766Debug.Assert(expr != null, "Failed to create expression");
992Debug.Assert(_pos != 0, "We have at least one digit in the buffer, ScanNumeric()");
993Debug.Assert(IsDigit(text[_pos - 1]), "We have at least one digit in the buffer, ScanNumeric(), not a digit");
1053Debug.Assert(chEnd != '\0', "Invalid bracket value");
1054Debug.Assert(esc != '\0', "Invalid escape value");
1072Debug.Assert(text[_pos] == chEnd, "Invalid bracket value");
1111Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
1112Debug.Assert(_pos > _start, "Exprecing an identifier.");
1115Debug.Assert(name != null, "Make sure the arguments for Compare method are OK");
1125Debug.Assert(s_reservedwords[i]._word != null, "Make sure the arguments for Compare method are OK");
1145Debug.Assert(_token == Tokens.Name, "Exprecing an identifier.");
System\Data\Filter\FunctionNode.cs (23)
123Debug.Assert(_info < s_funcs.Length && _info >= 0, "Invalid function info.");
127Debug.Assert(_argumentCount == s_funcs[_info]._argumentCount || s_funcs[_info]._isVariantArgumentList, "Invalid argument argumentCount.");
198Debug.Assert(_info > -1, "All function nodes should be bound at this point."); // default info is -1, it means if not bounded, it should be -1, not 0!!
258Debug.Assert(_info > -1, "Optimizing unbound function "); // default info is -1, it means if not bounded, it should be -1, not 0!!
321Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
332Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
344Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
348Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
352Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
356Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
360Debug.Assert(_argumentCount == 2, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
362Debug.Assert(argumentValues[0] is string, $"Invalid argument type for {s_funcs[_info]._name}");
363Debug.Assert(argumentValues[1] is string, $"Invalid argument type for {s_funcs[_info]._name}");
377Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}");
396Debug.Assert(_argumentCount == 2, "Invalid argument argumentCount: ");
404Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
405Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
423Debug.Assert(_argumentCount == 3, $"Invalid argument argumentCount: {_argumentCount.ToString(FormatProvider)}");
424Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid first argument {argumentValues[0].GetType().FullName} in {s_funcs[_info]._name}");
425Debug.Assert(argumentValues[1] is int, $"Invalid second argument {argumentValues[1].GetType().FullName} in {s_funcs[_info]._name}");
426Debug.Assert(argumentValues[2] is int, $"Invalid third argument {argumentValues[2].GetType().FullName} in {s_funcs[_info]._name}");
465Debug.Assert(_argumentCount == 1, $"Invalid argument argumentCount for {s_funcs[_info]._name} : {_argumentCount.ToString(FormatProvider)}");
466Debug.Assert((argumentValues[0] is string) || (argumentValues[0] is SqlString), $"Invalid argument type for {s_funcs[_info]._name}");
System\Data\ProviderBase\SchemaMapping.cs (27)
64Debug.Assert(null != adapter, nameof(adapter));
65Debug.Assert(null != dataReader, nameof(dataReader));
66Debug.Assert(0 < dataReader.FieldCount, "FieldCount");
67Debug.Assert(null != dataset || null != datatable, "SchemaMapping - null dataSet");
68Debug.Assert(SchemaType.Mapped == schemaType || SchemaType.Source == schemaType, "SetupSchema - invalid schemaType");
284Debug.Assert(_mappedLength == _indexMap!.Length, "incorrect precomputed length");
299Debug.Assert(_mappedLength == Math.Min(_readerDataValues!.Length, _mappedDataValues!.Length), "incorrect precomputed length");
310Debug.Assert(_readerDataValues != null);
363Debug.Assert(0 == _mappedMode, "incorrect mappedMode");
364Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null == _mappedDataValues), "incorrect MappedValues");
367Debug.Assert((null == _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues");
371Debug.Assert((null == _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues");
375Debug.Assert((null != _chapterMap) && (null == _indexMap) && (null != _mappedDataValues), "incorrect MappedValues");
379Debug.Assert((null != _chapterMap) && (null != _indexMap) && (null != _mappedDataValues), "incorrect MappedValues");
420Debug.Fail("unexpected LoadOption");
472Debug.Assert(null != _dataSet, "if chapters, then Fill(DataSet,...) not Fill(DataTable,...)");
523Debug.Assert(rgcol != null, "invalid call to ResizeArray");
524Debug.Assert(len <= rgcol.Length, "invalid len passed to ResizeArray");
566Debug.Assert(_dataTable != null);
567Debug.Assert(_fieldNames != null);
568Debug.Assert(_tableMapping != null);
762Debug.Assert(_dataTable != null);
763Debug.Assert(_schemaTable != null);
764Debug.Assert(_fieldNames != null);
765Debug.Assert(_tableMapping != null);
769Debug.Assert(null != schemaRows, "SchemaSetup - null DbSchemaRow[]");
770Debug.Assert(_dataReader.FieldCount <= schemaRows.Length, "unexpected fewer rows in Schema than FieldCount");
System\Data\RbTree.cs (30)
321Debug.Assert(_inUseNodeCount - 1 == SubTreeSize(root), "count mismatch");
371Debug.Assert(page._slots[slotId]._leftId == NIL, "node not cleared");
372Debug.Assert(page._slots[slotId]._rightId == NIL, "node not cleared");
373Debug.Assert(page._slots[slotId]._parentId == NIL, "node not cleared");
374Debug.Assert(page._slots[slotId]._nextId == NIL, "node not cleared");
377Debug.Assert(page._slots[slotId]._nodeColor == NodeColor.red, "node not cleared");
550Debug.Assert(NIL != x_id, "nil left");
551Debug.Assert(NIL != z_id, "nil right");
580Debug.Assert(-1 == position, "KEY_SEARCH_AND_INDEX with bad position");
591Debug.Assert((NIL == Left(z_id)) || (0 > Compare(root_id, Left(z_id), z_id)), "Left is not left");
598Debug.Assert((NIL == Right(z_id)) || (0 < Compare(root_id, Right(z_id), z_id)), "Right is not right");
841Debug.Assert(_accessMethod == TreeAccessMethod.INDEX_ONLY, "not expecting anything else");
1229Debug.Assert((NIL == Left(x_id)) || (0 > Compare(root_id, Left(x_id), x_id)), "Search duplicate Left is not left");
1236Debug.Assert((NIL == Right(x_id)) || (0 < Compare(root_id, Right(x_id), x_id)), "Search duplicate Right is not right");
1259Debug.Assert((NIL == Left(x_id)) || (0 > Compare(NIL, Left(x_id), x_id)), "Search Left is not left");
1266Debug.Assert((NIL == Right(x_id)) || (0 < Compare(NIL, Right(x_id), x_id)), "Search Right is not right");
1347Debug.Assert(NIL != node, "GetIndexByNode(NIL)");
1513Debug.Assert(NIL == Next(x_id), "has unexpected satellite tree");
1698Debug.Assert(nodeId != NIL, " in SetParent nodeId == NIL");
1709Debug.Assert(nodeId != NIL, " in SetColor nodeId == NIL");
1740Debug.Assert(nodeId != NIL &&
1786Debug.Assert(myCorrectSize == size, "VerifySize");
1907Debug.Assert(null != tree, "null tree");
1908Debug.Assert((NIL == _nodeID && NIL == _mainTreeNodeID) || (NIL != _nodeID), "MainTreeNodeID is not NIL");
1912Debug.Assert(NIL != tree.Next(_mainTreeNodeID), "MainTreeNodeID should have a Next");
1918Debug.Assert(tree.root == node, "MainTreeNodeID parent change doesn't align");
1922Debug.Assert(NIL == tree.Next(_nodeID), "NodeID should not have a Next");
1935Debug.Assert(NIL == tree.Next(node), "duplicate node should not have a next");
1939Debug.Assert((NIL == _mainTreeNodeID && tree.root == node) ||
1989Debug.Assert((_slotMap[segmentPos] & freeSlot) == 0, "Slot position segment[segmentPos ]: [freeSlot] is in use. Expected to be empty");
System\Data\Selection.cs (27)
19Debug.Assert(column != null, "null column");
113Debug.Assert(indexFields != null);
114Debug.Assert(null != table, "null table");
175Debug.Assert(recordIndex >= 0 && recordIndex < _recordCount, "recordIndex out of range");
233Debug.Assert(0 <= _refCount, "AddRef on disposed index");
234Debug.Assert(null != _records, "null records");
298Debug.Assert(_records.CheckUnique(_records.root) != HasDuplicates, "CheckUnique difference");
326Debug.Assert(null != row1, "record1 no datarow");
327Debug.Assert(null != row2, "record2 no datarow");
350Debug.Assert(0 == CompareDataRows(record1, record2), "duplicate record not a duplicate by user function");
357Debug.Assert(0 == c, "duplicate record not a duplicate");
362Debug.Assert(null != row1, "record1 no datarow");
363Debug.Assert(null != row2, "record2 no datarow");
448Debug.Assert(null != _comparison, "missing comparison");
475Debug.Assert(record == row._newRecord, "newRecord has change during GetIndex");
479Debug.Assert(record == row._oldRecord, "oldRecord has change during GetIndex");
859Debug.Assert(DoListChanged, "supposed to check DoListChanged before calling to delay create ListChangedEventArgs");
870Debug.Assert(-1 <= record, "bad record#");
942Debug.Assert((-1 == oldRecord) || (-1 == newRecord) ||
1073Debug.Assert(null != listener, "null listener");
1074Debug.Assert(!Index.ContainsReference(_listeners, listener), "already contains reference");
1086Debug.Assert(null != listener, "null listener");
1089Debug.Assert(0 <= index, "listeners don't contain listener");
1104Debug.Assert(null != action, "no action");
1105Debug.Assert(0 <= _listenerReaderCount, "negative _listEventCount");
1147Debug.Assert((-1 == nullIndex) || (null == _listeners[nullIndex]), "non-null listener");
1148Debug.Assert(0 == _listenerReaderCount, "0 < _listenerReaderCount");
System\Data\SQLTypes\SQLDecimal.cs (49)
409Debug.Assert((precision == MaxPrecision + 1) || VerifyPrecision(precision), "Calcualted precision too low?");
410Debug.Assert((precision == 1) || !VerifyPrecision((byte)(precision - 1)), "Calculated precision too high?");
421Debug.Assert(precision == bActualPrecision, $"CalculatePrecision={precision}, BActualPrec={bActualPrecision}. Results must be equal!");
433Debug.Assert(precision > 0, "Precision cannot be less than 1");
434Debug.Assert(precision <= MaxPrecision, "Precision > MaxPrecision");
720Debug.Assert(ulLen <= s_NUMERIC_MAX_PRECISION, "ulLen <= NUMERIC_MAX_PRECISION", "");
786Debug.Assert(rglData.Length >= 4);
834Debug.Assert(!IsNull);
840Debug.Assert(!IsNull);
1259Debug.Assert(ResInteger <= MaxPrecision);
1263Debug.Assert(ResScale <= MaxScale);
1272Debug.Assert(ResPrec - ResInteger >= 0);
1322Debug.Assert(dwlAccum < s_ulInt32Base);
1522Debug.Assert(dwlAccum < s_ulInt32Base * 2);
1525Debug.Assert(dwlAccum < s_ulInt32Base); // can never final accum > 1 more UI4
1541Debug.Assert(s_NUMERIC_MAX_PRECISION == ResPrec);
1816Debug.Assert(_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid");
1817Debug.Assert(_bScale <= _bPrec, "m_bScale <= m_bPrec", "In AssertValid");
1818Debug.Assert(_bScale >= 0, "m_bScale >= 0", "In AssertValid");
1819Debug.Assert(_bPrec > 0, "m_bPrec > 0", "In AssertValid");
1821Debug.Assert(CLenFromPrec(_bPrec) >= _bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid");
1822Debug.Assert(_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid");
1829Debug.Assert(_bLen == 1, "m_bLen == 1", "In AssertValid");
1834Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid");
1866Debug.Assert(rgulData.Length == s_cNumeMax, "rgulData.Length == x_cNumeMax", "Invalid array length");
1919Debug.Assert(bPrec <= MaxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0",
1940Debug.Assert(rglData.Length == 4, "rglData.Length == 4", $"Wrong array length: {rglData.Length}");
2103Debug.Assert(Prec == 9 || Prec == 18 || Prec == 27);
2146Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_lInt32Base", "");
2175Debug.Assert(dwlAccum < s_ulInt32Base);
2192Debug.Assert(dwlAccum < s_ulInt32Base, "dwlAccum < x_dwlBaseUI4", "Integer overflow");
2244Debug.Assert(dwlAccum < dwlDivisor);
2246Debug.Assert((dwlAccum / dwlDivisor) < s_ulInt32Base);
2273Debug.Assert(dwlAccum < s_ulInt32Base);
2287Debug.Assert(!IsNull, "!IsNull", "In AdjustScale");
2471Debug.Assert(rgulS.Length >= ciulS, "rgulS.Length >= ciulS", "Invalid array length");
2472Debug.Assert(rgulD.Length >= ciulS, "rgulD.Length >= ciulS", "Invalid array length");
2511Debug.Assert(iulX > s_uiZero);
2544Debug.Assert(rgulU.Length == s_cNumeMax);
2551Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!");
2552Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero");
2553Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array");
2610Debug.Assert(ciulU > 0, "ciulU > 0", "In method MpDiv");
2611Debug.Assert(ciulD > 0, "ciulD > 0", "In method MpDiv");
2612Debug.Assert(rgulU.Length == s_cNumeMax);
2613Debug.Assert(rgulD.Length == s_cNumeMax);
3025Debug.Assert(uiDigit < 10);
3032Debug.Assert(rguiData.Length == 4);
3041Debug.Assert(_bPrec >= 1);
System\Data\XDRSchema.cs (8)
40Debug.Assert(FEqualIdentity(schemaRoot, Keywords.XDR_SCHEMA, Keywords.XDRNS), "Illegal node");
74Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
133Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS), $"Invalid node type {node.LocalName}");
184Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENTTYPE, Keywords.XDRNS) ||
275Debug.Assert((s_mapNameTypeXdr[i - 1].CompareTo(s_mapNameTypeXdr[i].name)) < 0, "incorrect sorting");
285Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found");
290Debug.Assert(s_mapNameTypeXdr[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found");
345Debug.Assert(FEqualIdentity(node, Keywords.XDR_ELEMENT, Keywords.XDRNS) ||
System\Data\XMLSchema.cs (20)
329Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties");
360Debug.Assert(dc != null, "HandleColumnExpression is supposed to be called for DataColumn");
400Debug.Assert(val is PropertyCollection, "We can set values only for classes that have ExtendedProperties");
414Debug.Assert(table != null, "ref table should have been already created");
847Debug.Assert(schemaSet.Count == 1, "there should be one schema");
919Debug.Assert(child == table, "table not the same");
1068Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType");
1086Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction");
1098Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent");
1109Debug.Assert(ct.BaseXmlSchemaType is XmlSchemaSimpleType, "Expected SimpleType or ComplexType");
1115Debug.Assert(cContent is XmlSchemaSimpleContentRestriction, "Expected SimpleContent extension or restriction");
1152Debug.Assert(cContent is XmlSchemaComplexContentRestriction, "Expected complexContent extension or restriction");
1158Debug.Assert(ct.ContentModel is XmlSchemaSimpleContent, "expected simpleContent or complexContent");
1533Debug.Assert((node is XmlSchemaElement) || (node is XmlSchemaAttribute), "GetInstanceName should only be called on attribute or elements");
1544Debug.Assert((instanceName != null) && (instanceName.Length != 0), "instanceName cannot be null or empty. There's an error in the XSD compiler");
1785Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}");
1851Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}");
1899Debug.Assert((s_mapNameTypeXsd[i - 1].CompareTo(s_mapNameTypeXsd[i].name)) < 0, $"incorrect sorting {s_mapNameTypeXsd[i].name}");
1909Debug.Assert(nt.name != name, $"FindNameType('{name}') -- failed. Existed name not found");
1914Debug.Assert(s_mapNameTypeXsd[index].name == name, $"FindNameType('{name}') -- failed. Wrong name found");
System\Data\XmlToDatasetMap.cs (10)
107Debug.Assert(dataSet != null, "DataSet can't be null");
108Debug.Assert(nameTable != null, "NameTable can't be null");
116Debug.Assert(dataSet != null, "DataSet can't be null");
117Debug.Assert(nameTable != null, "NameTable can't be null");
125Debug.Assert(dataTable != null, "DataTable can't be null");
126Debug.Assert(nameTable != null, "NameTable can't be null");
134Debug.Assert(dataTable != null, "DataTable can't be null");
135Debug.Assert(nameTable != null, "NameTable can't be null");
438Debug.Assert(node != null, "Argument validation");
506Debug.Assert(col.ColumnName.StartsWith("xml", StringComparison.OrdinalIgnoreCase), "column name should start with xml");
System.Data.Odbc (263)
Common\System\Data\Common\DBConnectionString.cs (19)
67Debug.Assert(null != connectionOptions, "null connectionOptions");
176Debug.Fail("empty restriction");
286Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this");
287Debug.Assert(null == entry || !entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry");
299Debug.Assert(combinedSet != null, "The combined connection string should not be null");
309Debug.Assert(!combinedSet._restrictionValues.Except(componentSet._restrictionValues).Any(), "Combined set allows values not allowed by component set");
318Debug.Fail($"Unknown behavior for combined set: {combinedSet._behavior}");
328Debug.Assert(!combinedSet._restrictionValues.Intersect(componentSet._restrictionValues).Any(), "Combined values allows values prevented by component set");
335Debug.Assert(!componentSet._restrictionValues.Except(combinedSet._restrictionValues).Any(), "Combined values does not prevent all of the values prevented by the component set");
339Debug.Fail($"Unknown behavior for combined set: {combinedSet._behavior}");
344Debug.Fail($"Unknown behavior for component set: {componentSet._behavior}");
357Debug.Assert(!_hasPassword || ContainsKey(KEY.Password) || ContainsKey(KEY.Pwd), "OnDeserialized password mismatch this");
358Debug.Assert(!entry._hasPassword || entry.ContainsKey(KEY.Password) || entry.ContainsKey(KEY.Pwd), "OnDeserialized password mismatch entry");
387Debug.Fail("invalid KeyRestrictionBehavior");
442Debug.Assert(null != a && 0 < a.Length, "empty a");
443Debug.Assert(null != b && 0 < b.Length, "empty b");
537Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i - 1]), "empty restriction");
538Debug.Assert(!string.IsNullOrEmpty(restrictionValues[i]), "empty restriction");
539Debug.Assert(0 >= StringComparer.Ordinal.Compare(restrictionValues[i - 1], restrictionValues[i]));
Common\System\Data\ProviderBase\DbBuffer.cs (38)
61Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
89Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
115Debug.Assert(0 == offset % 4, "invalid alignment");
147Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
148Debug.Assert(null != destination, "null destination");
149Debug.Assert(startIndex + length <= destination.Length, "destination too small");
180Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
181Debug.Assert(null != destination, "null destination");
182Debug.Assert(startIndex + length <= destination.Length, "destination too small");
213Debug.Assert(0 == offset % 2, "invalid alignment");
239Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
240Debug.Assert(null != destination, "null destination");
241Debug.Assert(startIndex + length <= destination.Length, "destination too small");
265Debug.Assert(0 == offset % 4, "invalid alignment");
291Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
292Debug.Assert(null != destination, "null destination");
293Debug.Assert(startIndex + length <= destination.Length, "destination too small");
317Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
343Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
385Debug.Assert(null != structure, "null structure");
388Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
412Debug.Assert(0 == offset % 4, "invalid alignment");
436Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
437Debug.Assert(null != source, "null source");
438Debug.Assert(startIndex + length <= source.Length, "source too small");
462Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
463Debug.Assert(null != source, "null source");
464Debug.Assert(startIndex + length <= source.Length, "source too small");
493Debug.Assert(0 == offset % 2, "invalid alignment");
517Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
518Debug.Assert(null != source, "null source");
519Debug.Assert(startIndex + length <= source.Length, "source too small");
543Debug.Assert(0 == offset % 4, "invalid alignment");
567Debug.Assert(0 == offset % ADP.PtrSize, "invalid alignment");
568Debug.Assert(null != source, "null source");
569Debug.Assert(startIndex + length <= source.Length, "source too small");
593Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
617Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
Common\System\Data\ProviderBase\DbConnectionPool.cs (19)
139Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup");
300Debug.Assert(obj != null, "null connection is not expected");
330Debug.Assert(obj != null, "null connection is not expected");
333Debug.Assert(!obj.IsEmancipated, "pooled object not in pool");
334Debug.Assert(obj.CanBePooled, "pooled object is not poolable");
363Debug.Assert(obj != null, "null connection is not expected");
368Debug.Assert(obj != null, "null connection is not expected");
417Debug.Assert(oldConnectionPool._state == State.ShuttingDown, "Old connections pool should be shutting down");
457Debug.Assert(timerIsNotDisposed, "ErrorCallback timer has been disposed");
488Debug.Assert(_state == State.Running || _state == State.ShuttingDown);
530Debug.Assert(!destroyObject);
543Debug.Assert(returnToGeneralPool || destroyObject);
556Debug.Assert(removed, "attempt to DestroyObject not in list");
645Debug.Assert(connection != null, "connection should never be null in success case");
789Debug.Assert(2 == CREATION_HANDLE, "creation handle changed value");
907Debug.Assert(obj != null, "null connection is not expected");
912Debug.Assert(obj != null, "null connection is not expected");
1012Debug.Assert(null != obj, "why are we adding a null object to the pool?");
1022Debug.Assert(null != obj, "null obj?");
src\runtime\src\libraries\Common\src\System\Data\Common\DbConnectionOptions.Common.cs (12)
414Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex");
428Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index");
429Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index");
494Debug.Assert(parsetableContainsKey, $"{nameof(ParseInternal)} code vs. regex mismatch keyname <{keyname}>");
495Debug.Assert(value1 == value2, $"{nameof(ParseInternal)} code vs. regex mismatch keyvalue <{value1}> <{value2}>");
520Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>");
524Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}");
530Debug.Fail("ParseInternal code threw exception vs regex mismatch");
537Debug.Assert(null != connectionString, "null connectionstring");
559Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname");
560Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue");
641Debug.Assert(expanded, "password/pwd was not removed");
src\runtime\src\libraries\Common\src\System\Data\ProviderBase\DbConnectionFactory.cs (17)
64Debug.Assert(key != null, "key cannot be null");
83Debug.Assert(null != owningConnection, "null owningConnection?");
84Debug.Assert(null != poolGroup, "null poolGroup?");
97Debug.Assert(null != pool, "null pool?");
119Debug.Assert(key != null, "key cannot be null");
134Debug.Assert(Monitor.IsEntered(s_pendingOpenNonPooled), $"Expected {nameof(s_pendingOpenNonPooled)} lock to be held.");
142Debug.Assert(null != owningObject, "null owningObject?");
143Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
161Debug.Assert(null != connectionOptions, "prevent expansion of connectionString");
164Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
234Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered");
237Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?");
238Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?");
309Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered");
333Debug.Assert(null != pool, "null pool?");
352Debug.Assert(null != poolGroup, "null poolGroup?");
367Debug.Assert(connectionPoolGroup != null, "connectionPoolGroup may not be null.");
System\Data\Odbc\OdbcConnectionHelper.cs (11)
124Debug.Assert(null != value, "null poolGroup");
199Debug.Assert(DbConnectionClosedConnecting.SingletonInstance == _innerConnection, "not connecting");
207Debug.Assert(null != userConnectionOptions, "null UserConnectionOptions");
217Debug.Assert(null != _innerConnection, "null InnerConnection");
218Debug.Assert(null != to, "to null InnerConnection");
238Debug.Fail("unexpected state switch");
248Debug.Assert(null != _innerConnection, "null InnerConnection");
249Debug.Assert(null != from, "from null InnerConnection");
250Debug.Assert(null != to, "to null InnerConnection");
257Debug.Assert(null != _innerConnection, "null InnerConnection");
258Debug.Assert(null != to, "to null InnerConnection");
System\Data\Odbc\OdbcDataReader.cs (26)
61Debug.Assert(command != null, "Command null on OdbcDataReader ctor");
75Debug.Fail("object is disposed");
359Debug.Assert(null != Connection, "null cmd connection");
966Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value");
1009Debug.Assert(lengthOrIndicator >= 0 || lengthOrIndicator == ODBC32.SQL_NO_TOTAL, "unexpected lengthOrIndicator value");
1023Debug.Assert(cbMissing == -1 && lengthOrIndicator <= cbMaxData);
1148Debug.Assert((cachedObj != null), "internalGetString should always return non-null or raise exception");
1153Debug.Assert((cachedObj != null), "internalGetBytes should always return non-null or raise exception");
1339Debug.Assert(bufferIndex >= 0, "Negative buffer index");
1340Debug.Assert(bytesOrCharsLength >= 0, "Negative number of bytes or chars to read");
1343Debug.Assert(buffer == null || bytesOrCharsLength <= (buffer.Length - bufferIndex), "Not enough space in user's buffer");
1409Debug.Assert((cbTotal > 0), "GetData returned negative value, which is not SQL_NO_TOTAL");
1486Debug.Assert(flag, "internalGetBytes - unexpected invalid result inside if-block");
1645Debug.Fail("Non-V3 driver. Must not call GetDescFieldStr");
1725Debug.Assert(null != StatementHandle, "Statement handle is null in DateReader");
1728Debug.Assert(_dataCache == null || !Convert.IsDBNull(_dataCache[i]), "Cannot call GetData without checking for cache first!");
1733Debug.Assert(cb <= Buffer.Length - 2, "GetData needs to Reallocate. Perf bug");
1911Debug.Assert(!disposing || !allresults, "both disposing & allresults are true");
1989Debug.Assert(!disposing, "errors while disposing");
2308Debug.Assert(_metadata != null);
2324Debug.Assert(buffer.Length >= 264, "Native buffer to small (_buffer.Length < 264)");
2472Debug.Assert(_metadata != null);
2505Debug.Assert(buffer.Length >= 544, "Native buffer to small (_buffer.Length < 544)");
2851Debug.Assert(str.Length > 1, "Illegal string, only one char that is a quote");
2852Debug.Assert(str[str.Length - 1] == quoteChar, "Missing quote at end of string that begins with quote");
2891Debug.Assert(quotePrefix != null && quoteSuffix != null);
System\Data\Odbc\OdbcParameter.cs (12)
336Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary");
399else { Debug.Fail("not expecting this"); }
410Debug.Assert((0 <= cch) && (cch < 0x3fffffff), $"GetColumnSize: cch = {cch} out of range, _internalShouldSerializeSize = {_internalShouldSerializeSize}, _internalSize = {_internalSize}");
455Debug.Assert((0 <= cch) && (cch < 0x3fffffff), $"GetValueSize: cch = {cch} out of range, _internalShouldSerializeSize = {_internalShouldSerializeSize}, _internalSize = {_internalSize}");
475Debug.Assert((ODBC32.SQL_C.WCHAR == _bindtype._sql_c) || (ODBC32.SQL_C.BINARY == _bindtype._sql_c), "not wchar or binary");
504else { Debug.Fail("not expecting this"); }
529Debug.Assert((0 <= ccb) && (ccb < 0x3fffffff), $"GetParameterSize: out of range {ccb}");
622Debug.Assert(command.Connection != null);
792Debug.Assert(command.Connection != null);
978Debug.Assert(ODBC32.SQL_C.NUMERIC == _typemap._sql_c, "unexpected");
1032Debug.Assert(null != _typemap, "GetParameterValue: null _typemap");
1108Debug.Fail("Unexpected Direction Property on Parameter");
System\Data\Odbc\OdbcUtils.cs (14)
37Debug.Assert((cb > 0), "Character count negative ");
38Debug.Assert((Length >= cb), "Native buffer too small ");
45Debug.Assert((cb > 0), "Character count negative ");
46Debug.Assert((Length >= cb), "Native buffer too small ");
143Debug.Fail("UnknownSQLCType");
168Debug.Assert(value is string || value is char[], "Only string or char[] can be marshaled to WCHAR");
180Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!");
193Debug.Assert(rgChars.Length < (base.Length - valueOffset), "attempting to extend parameter buffer!");
207Debug.Assert((valueOffset <= length), "Offset out of Range");
222Debug.Assert(length < (base.Length - valueOffset), "attempting to extend parameter buffer!");
315Debug.Fail("UnknownSQLCType");
456Debug.Assert((_sqlstatement[curidx] == '['), "GetTokenFromQuote: character at starting position must be same as quotechar");
472Debug.Assert(_quote != ' ', "ODBC driver doesn't support quoted identifiers -- GetTokenFromQuote should not be used in this case");
473Debug.Assert((_sqlstatement[curidx] == _quote), "GetTokenFromQuote: character at starting position must be same as quotechar");
System.Data.OleDb (502)
ColumnBinding.cs (123)
56Debug.Assert(null != rowbinding, "null rowbinding");
57Debug.Assert(null != bindings, "null bindings");
58Debug.Assert(ODB.SizeOf_tagDBBINDING <= offset, $"invalid offset {offset}");
76Debug.Assert(0 <= _offsetStatus, "negative _offsetStatus");
77Debug.Assert(0 <= _offsetLength, "negative _offsetLength");
78Debug.Assert(0 <= _offsetValue, "negative _offsetValue");
160Debug.Assert(null != _dataReader, "null DataReader");
166Debug.Assert((null != _parameter) && (null != parameter), "null parameter");
192Debug.Assert(0 <= value, "negative LengthValue");
198Debug.Assert(null != _parameter, "null parameter");
238Debug.Fail("unexpected StatusValue");
383Debug.Fail("should have bound as WSTR");
386Debug.Fail("should have bound as NUMERIC");
389Debug.Fail("UDT binding should not have been encountered");
392Debug.Fail("should have bound as BYREF|WSTR");
416Debug.Fail("should have bound as WSTR");
419Debug.Fail("should have bound as BYREF|WSTR");
587Debug.Fail("unknown DBTYPE");
591Debug.Fail("Should have bound as WSTR");
594Debug.Fail("UDT binding should not have been encountered");
597Debug.Fail("not allowed to set HCHAPTER");
600Debug.Fail("should have bound as NUMERIC");
603Debug.Fail("should have bound as BYREF|WSTR");
611Debug.Assert((NativeDBType.BOOL == DbType), "Value_BOOL");
612Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_BOOL");
618Debug.Assert((NativeDBType.BOOL == DbType), "Value_BOOL");
626Debug.Assert((NativeDBType.BSTR == DbType), "Value_BSTR");
627Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_BSTR");
652Debug.Assert((null != value), "Value_BSTR null");
653Debug.Assert((NativeDBType.BSTR == DbType), "Value_BSTR");
661Debug.Assert(((NativeDBType.BYREF | NativeDBType.BYTES) == DbType), "Value_ByRefBYTES");
662Debug.Assert((DBStatus.S_OK == StatusValue()), "Value_ByRefBYTES");
688Debug.Assert(null != value, "Value_ByRefBYTES null");
689Debug.Assert((NativeDBType.BYREF | NativeDBType.BYTES) == DbType, "Value_ByRefBYTES");
709Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR");
710Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_ByRefWSTR");
736Debug.Assert(null != value, "Value_ByRefWSTR null");
737Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR");
755Debug.Assert(null != value, "Value_ByRefWSTR null");
756Debug.Assert((NativeDBType.BYREF | NativeDBType.WSTR) == DbType, "Value_ByRefWSTR");
775Debug.Assert(NativeDBType.BYTES == DbType, "Value_BYTES");
776Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_BYTES");
784Debug.Assert(null != value, "Value_BYTES null");
797Debug.Assert(NativeDBType.CY == DbType, "Value_CY");
798Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_CY");
803Debug.Assert(NativeDBType.CY == DbType, "Value_CY");
811Debug.Assert(NativeDBType.DATE == DbType, "Value_DATE");
812Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DATE");
817Debug.Assert(NativeDBType.DATE == DbType, "Value_DATE");
825Debug.Assert(NativeDBType.DBDATE == DbType, "Value_DBDATE");
826Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBDATE");
831Debug.Assert(NativeDBType.DBDATE == DbType, "Value_DATE");
839Debug.Assert(NativeDBType.DBTIME == DbType, "Value_DBTIME");
840Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBTIME");
845Debug.Assert(NativeDBType.DBTIME == DbType, "Value_DBTIME");
853Debug.Assert(NativeDBType.DBTIMESTAMP == DbType, "Value_DBTIMESTAMP");
854Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DBTIMESTAMP");
859Debug.Assert(NativeDBType.DBTIMESTAMP == DbType, "Value_DBTIMESTAMP");
867Debug.Assert(NativeDBType.DECIMAL == DbType, "Value_DECIMAL");
868Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_DECIMAL");
880Debug.Assert(NativeDBType.DECIMAL == DbType, "Value_DECIMAL");
900Debug.Assert(NativeDBType.ERROR == DbType, "Value_ERROR");
901Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_ERROR");
906Debug.Assert(NativeDBType.ERROR == DbType, "Value_ERROR");
914Debug.Assert(NativeDBType.FILETIME == DbType, "Value_FILETIME");
915Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_FILETIME");
921Debug.Assert(NativeDBType.FILETIME == DbType, "Value_FILETIME");
930Debug.Assert(NativeDBType.GUID == DbType, "Value_GUID");
931Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_GUID");
936Debug.Assert(NativeDBType.GUID == DbType, "Value_GUID");
945Debug.Assert(NativeDBType.HCHAPTER == DbType, "Value_HCHAPTER");
946Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_HCHAPTER");
953Debug.Assert(NativeDBType.I1 == DbType, "Value_I1");
954Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I1");
960Debug.Assert(NativeDBType.I1 == DbType, "Value_I1");
968Debug.Assert(NativeDBType.I2 == DbType, "Value_I2");
969Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I2");
974Debug.Assert(NativeDBType.I2 == DbType, "Value_I2");
982Debug.Assert(NativeDBType.I4 == DbType, "Value_I4");
983Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I4");
988Debug.Assert(NativeDBType.I4 == DbType, "Value_I4");
996Debug.Assert(NativeDBType.I8 == DbType, "Value_I8");
997Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_I8");
1002Debug.Assert(NativeDBType.I8 == DbType, "Value_I8");
1010Debug.Assert(NativeDBType.IDISPATCH == DbType, "Value_IDISPATCH");
1011Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_IDISPATCH");
1034Debug.Assert(NativeDBType.IDISPATCH == DbType, "Value_IDISPATCH");
1057Debug.Assert(NativeDBType.IUNKNOWN == DbType, "Value_IUNKNOWN");
1058Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_IUNKNOWN");
1081Debug.Assert(NativeDBType.IUNKNOWN == DbType, "Value_IUNKNOWN");
1090Debug.Assert(NativeDBType.NUMERIC == DbType, "Value_NUMERIC");
1091Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_NUMERIC");
1096Debug.Assert(NativeDBType.NUMERIC == DbType, "Value_NUMERIC");
1111Debug.Assert(NativeDBType.R4 == DbType, "Value_R4");
1112Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_R4");
1118Debug.Assert(NativeDBType.R4 == DbType, "Value_R4");
1126Debug.Assert(NativeDBType.R8 == DbType, "Value_R8");
1127Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_R8");
1133Debug.Assert(NativeDBType.R8 == DbType, "Value_I4");
1141Debug.Assert(NativeDBType.UI1 == DbType, "Value_UI1");
1142Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI1");
1147Debug.Assert(NativeDBType.UI1 == DbType, "Value_UI1");
1155Debug.Assert(NativeDBType.UI2 == DbType, "Value_UI2");
1156Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI2");
1161Debug.Assert(NativeDBType.UI2 == DbType, "Value_UI2");
1169Debug.Assert(NativeDBType.UI4 == DbType, "Value_UI4");
1170Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI4");
1175Debug.Assert(NativeDBType.UI4 == DbType, "Value_UI4");
1183Debug.Assert(NativeDBType.UI8 == DbType, "Value_UI8");
1184Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_UI8");
1189Debug.Assert(NativeDBType.UI8 == DbType, "Value_UI8");
1197Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR");
1198Debug.Assert((DBStatus.S_OK == StatusValue()) || (DBStatus.S_TRUNCATED == StatusValue()), "Value_WSTR");
1199Debug.Assert(2 < ColumnBindingMaxLen, "Value_WSTR");
1205Debug.Assert(null != value, "Value_BYTES null");
1206Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR");
1220Debug.Assert(null != value, "Value_BYTES null");
1221Debug.Assert(NativeDBType.WSTR == DbType, "Value_WSTR");
1234Debug.Assert((NativeDBType.VARIANT == DbType) || (NativeDBType.PROPVARIANT == DbType), "Value_VARIANT");
1235Debug.Assert(DBStatus.S_OK == StatusValue(), "Value_VARIANT");
1240Debug.Assert((NativeDBType.VARIANT == DbType) || (NativeDBType.PROPVARIANT == DbType), "Value_VARIANT");
1671Debug.Fail("CheckStatusValue: unhandled data with ok status");
1674Debug.Fail("CheckStatusValue: unhandled data with truncated status");
DbBindings.cs (15)
70Debug.Assert((0 <= value) && (value < _count), "bad binding index");
77Debug.Assert(null != _columnBindings, "null ColumnBindings");
83Debug.Assert(null != _parameters, "null Parameters");
180Debug.Assert(0 <= value, "invalid MaxLen");
245Debug.Assert(null == _rowBinding, "row binding already allocated");
246Debug.Assert(null == _columnBindings, "column bindings already allocated");
252Debug.Assert(null != columnBindings, "null column bindings");
257Debug.Assert(columnBindings.Length == _dbcolumns.Length, "length mismatch");
268Debug.Assert(index < binding.Index, "invaild index");
315Debug.Assert(null != collection, "null parameter collection");
316Debug.Assert(null != _parameters, "null parameters");
325Debug.Assert(null != binding, "null column binding");
326Debug.Assert(binding.Parameter() == _parameters[i], "parameter mismatch");
363Debug.Assert(null != _rowBinding, "no row binding");
364Debug.Assert(null != _columnBindings, "no column bindings");
DbConnectionOptions.cs (13)
488Debug.Assert(keyname == keyname.ToLowerInvariant(), "missing ToLower");
767Debug.Assert(((0 < keyname.Length) && (';' != keyname[0]) && !char.IsWhiteSpace(keyname[0]) && !keyname.Contains('\u0000')) == compValue, "IsValueValid mismatch with regex");
781Debug.Assert(KeyIndex == parser.GroupNumberFromName("key"), "wrong key index");
782Debug.Assert(ValueIndex == parser.GroupNumberFromName("value"), "wrong value index");
844Debug.Assert(parsetable.Contains(keyname), $"ParseInternal code vs. regex mismatch keyname <{keyname}>");
845Debug.Assert(value1 == value2, $"ParseInternal code vs. regex mismatch keyvalue <{value1}> <{value2}>");
871Debug.Assert(isEquivalent, $"ParseInternal code vs regex message mismatch: <{msg1}> <{msg2}>");
875Debug.Fail($"ParseInternal code vs regex throw mismatch {f.Message}");
881Debug.Fail("ParseInternal code threw exception vs regex mismatch");
887Debug.Assert(null != connectionString, "null connectionstring");
910Debug.Assert(IsKeyNameValid(keyname), "ParseFailure, invalid keyname");
911Debug.Assert(IsValueValidInternal(keyvalue), "parse failure, invalid keyvalue");
985Debug.Assert(expanded, "password/pwd was not removed");
OleDbCommand.cs (19)
357Debug.Assert(null != _icommandText, "IAccessor: null ICommandText");
364Debug.Assert(null != _icommandText, "ICommandProperties: null ICommandText");
371Debug.Assert(null != _icommandText, "ICommandPrepare: null ICommandText");
378Debug.Assert(null != _icommandText, "ICommandWithParameters: null ICommandText");
389Debug.Assert(System.Data.CommandType.Text == CommandType || System.Data.CommandType.StoredProcedure == CommandType, "CreateAccessor: incorrect CommandType");
390Debug.Assert(null == _dbBindings, "CreateAccessor: already has dbBindings");
391Debug.Assert(HasParameters(), "CreateAccessor: unexpected, no parameter collection");
519Debug.Assert(null != _connection, "no connection, CloseInternal");
534Debug.Assert(_dbBindings == bindings, "bindings with two owners");
564Debug.Assert(null != _connection, "no connection, CloseInternalParameters");
690Debug.Fail("ExecuteReaderInternal: unknown result type");
713Debug.Assert(null != dataReader, "ExecuteReader should never return a null DataReader");
859Debug.Assert(0 == (CommandBehavior.SingleRow & this.commandBehavior), "SingleRow implies SingleResult");
891Debug.Assert(_executeQuery, "ExecuteNonQuery should always use ExecuteCommandTextForSingleResult");
932Debug.Assert(null != e, "missing inner exception");
1114Debug.Assert(null != _connection, "ExpandStoredProcedureToText: null Connection");
1131Debug.Assert(null != _connection, "InitializeCommand: null OleDbConnection");
1276Debug.Assert(_connection != null);
1282Debug.Assert(!_isPrepared, "null command isPrepared");
OleDbConnection.cs (12)
187Debug.Assert(null != this.PoolGroup, "PoolGroup must never be null when accessing ProviderInfo");
242Debug.Fail($"Unknown 'Connection Status' value {connectionStatus.ToString("G", CultureInfo.InvariantCulture)}");
263Debug.Assert(null != GetOpenConnection(), "ICommandText closed");
269Debug.Assert(null != GetOpenConnection(), "IDBProperties closed");
275Debug.Assert(null != GetOpenConnection(), "IOpenRowset closed");
281Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SqlSupport");
287Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SupportMultipleResults");
293Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString SupportIRow");
299Debug.Assert(null != this.OleDbConnectionStringValue, "no OleDbConnectionString QuotedIdentifierCase");
477Debug.Assert(null != GetOpenConnection(), "GetSchemaRowset closed");
546Debug.Assert(1 == propSet.PropertySetCount, "too many PropertySets");
549Debug.Assert(1 == dbprops.Length, "too many Properties");
OleDbConnectionInternal.cs (20)
69Debug.Assert((null != constr) && !constr.IsEmpty, "empty connectionstring");
86Debug.Assert(!_datasrcwrp.IsInvalid, "bad DataSource");
107Debug.Assert(null != e, "CreateSessionError");
110Debug.Assert(!_sessionwrp.IsInvalid, "bad Session");
190Debug.Assert(null != _datasrcwrp, "IDBProperties: null datasource");
197Debug.Assert(null != _datasrcwrp, "IOpenRowset: null datasource");
198Debug.Assert(null != _sessionwrp, "IOpenRowset: null session");
205Debug.Assert(null != _datasrcwrp, "IDBInfo: null datasource");
212Debug.Assert(null != _datasrcwrp, "IDBSchemaRowset: null datasource");
213Debug.Assert(null != _sessionwrp, "IDBSchemaRowset: null session");
220Debug.Assert(null != _datasrcwrp, "ITransactionJoin: null datasource");
221Debug.Assert(null != _sessionwrp, "ITransactionJoin: null session");
228Debug.Assert(null != _datasrcwrp, "IDBCreateCommand: null datasource");
229Debug.Assert(null != _sessionwrp, "IDBCreateCommand: null session");
234Debug.Assert((0 <= hr) || (null == icommandText), "CreateICommandText: error with ICommandText");
267Debug.Assert(null != _datasrcwrp, "ITransactionLocal: null datasource");
268Debug.Assert(null != _sessionwrp, "ITransactionLocal: null session");
314Debug.Assert(null == LocalTransaction, "why was Deactivate not called first");
742Debug.Assert(null != wrapper, "GetObjectPool: null dataInitialize");
781Debug.Assert(null != head, "unexcpted Transaction state");
OleDbDataReader.cs (66)
119Debug.Assert(_singleRow, "SingleRow not already set");
175Debug.Assert((_singleRow && !_isClosed && !_isRead && (null == _irow) && (null == _irowset)) ||
240Debug.Fail("object is disposed");
251Debug.Fail("object is disposed");
283Debug.Assert(null == _metadata, "BuildMetaInfo: already built, by _metadata");
300Debug.Assert(null != _bindings, "unexpected dbBindings");
321Debug.Assert(null == _dbSchemaTable, "BuildSchemaTable: schema table already exists");
322Debug.Assert(null != metadata, "BuildSchemaTable: no _metadata");
453Debug.Assert(null == _dbSchemaTable, "non-null SchemaTable");
454Debug.Assert(null == _metadata, "non-null metadata");
455Debug.Assert(null != handle, "unexpected null rowset");
463Debug.Fail("bad IRow - IColumnsInfo not available");
467Debug.Assert(handle is UnsafeNativeMethods.IRowset, "bad IRowset - IColumnsInfo not available");
496Debug.Assert(0 < columnCount, "BuildSchemaTableInfoTable - no column");
551Debug.Assert(ODB.DBKIND_PGUID_NAME != dbColumnInfo.columnid.eKind, "OLE DB providers never return pGuid-style bindings.");
552Debug.Assert(ODB.DBKIND_PGUID_PROPID != dbColumnInfo.columnid.eKind, "OLE DB providers never return pGuid-style bindings.");
582Debug.WriteLine($"OleDbDataReader[{info.ordinal}, {dbColumnInfo.pwszName}]={dbType.enumOleDbType},{dbType.dataSourceType}, {dbType.wType}");
602Debug.Assert(null == _dbSchemaTable, "BuildSchemaTableRowset - non-null SchemaTable");
603Debug.Assert(null != handle, "BuildSchemaTableRowset(object) - unexpected null handle");
614Debug.Assert((0 == hr) || prgOptColumns.IsInvalid, "GetAvailableCOlumns: unexpected return");
618Debug.Assert((0 <= hr) || (null == rowset), "if GetColumnsRowset failed, rowset should be null");
1015Debug.Assert(fieldType != null);
1055Debug.Assert(null != _metadata[index].columnName);
1110Debug.Assert(null != binding, "null binding");
1115Debug.Assert(_nextAccessorForRetrieval <= binding.IndexForAccessor, "backwards index for accessor");
1116Debug.Assert(_nextAccessorForRetrieval == i, "failed to increment");
1214Debug.Assert(!_hasRowsReadCheck, "_hasRowsReadCheck not reset");
1263Debug.Assert(OleDbHResult.DB_E_OBJECTOPEN == hr, "unexpected");
1296Debug.Fail("<oledb.OleDbDataReader.NextResultsInfinite|INFO> System.Data.OleDb.OleDbDataReader: 2000 IMultipleResult.GetResult(NULL, DBRESULTFLAG_DEFAULT, IID_NULL, NULL, NULL) iterations with 0 records affected. Stopping suspect infinite loop. To work-around try using ExecuteReader() and iterating through results with NextResult().\n");
1317Debug.Assert(null == _irow, "NextResult: row loop check");
1318Debug.Assert(null == _irowset, "NextResult: rowset loop check");
1417Debug.Assert(null != _irowset, "ReadRow: null IRowset");
1418Debug.Assert(0 <= _metadata!.Length, "incorrect state for fieldCount");
1430Debug.Assert(0 == _currentRow, "incorrect state for _currentRow");
1431Debug.Assert(0 <= _metadata.Length, "incorrect state for fieldCount");
1432Debug.Assert(0 == _nextAccessorForRetrieval, "incorrect state for nextAccessorForRetrieval");
1433Debug.Assert(0 == _nextValueForRetrieval, "incorrect state for nextValueForRetrieval");
1443Debug.Assert(null != _irowset, "ReleaseCurrentRow: no rowset");
1449Debug.Assert(null != bindings, "ReleaseCurrentRow: null dbBindings");
1467Debug.Assert(null == _bindings, "CreateAccessor: dbBindings already exists");
1468Debug.Assert(null != _irowset, "CreateAccessor: no IRowset available");
1469Debug.Assert(null != _metadata && 0 < _metadata.Length, "no columns");
1580Debug.Assert(indexToBinding[index] < dbbindings.Length, "bad indexToAccessor");
1600Debug.Assert(NativeDBType.STR != getType, "Should have bound as WSTR");
1676Debug.Assert(count == columnBindings[k].Index, "column binding mismatch");
1689Debug.Assert(0 < (int)_rowHandleFetchCount, "GetRowHandles: bad _rowHandleFetchCount");
1690Debug.Assert(!_isRead, "GetRowHandles: _isRead");
1706Debug.Assert(rowHandleBuffer.DangerousGetHandle() == rowHandlesPtr, "rowhandlebuffer changed");
1739Debug.Assert(null != _bindings, "GetRowDataFromHandle: null dbBindings");
1740Debug.Assert(null != _rowHandleNativeBuffer, "GetRowDataFromHandle: null dbBindings");
1777Debug.Assert(0 < (int)_rowFetchedCount, "invalid _rowFetchedCount");
1835Debug.Assert(null != _irow, "GetRowValue: null IRow");
1836Debug.Assert(null != _metadata, "GetRowValue: null MetaData");
1841Debug.Assert(_nextValueForRetrieval <= columnBindings[0].Index, "backwards retrieval");
1910Debug.Assert(null != _connection, "null connection");
1911Debug.Assert(null != _metadata, "no _metadata");
1953Debug.WriteLine("Multiple BaseTableName detected:"
2074Debug.WriteLine($"PartialKeyColumn detected: <{name}> metaindex={metaindex}");
2165Debug.WriteLine($"MultipleUniqueIndexes detected: <{uniqueIndexName}> <{indexname}>");
2177Debug.WriteLine($"PartialKeyColumn detected: {name}");
2192Debug.WriteLine($"PartialUniqueIndexes detected: <{uniqueIndexName}> <{indexname}>");
2213Debug.WriteLine($"upgrade single unique index to be a key: <{uniqueIndexName}>");
2248Debug.Assert(null == dataReader._fieldNameLookup, "lookup already exists");
2457Debug.WriteLine($"Filtered Column: DBCOLUMN_GUID=DBCOL_SPECIALCOL DBCOLUMN_NAME={info.columnName} DBCOLUMN_KEYCOLUMN={info.isKeyColumn}");
2468Debug.WriteLine($"Filtered Column: DBCOLUMN_NUMBER={info.ordinal} DBCOLUMN_NAME={info.columnName}");
2479Debug.WriteLine($"Filtered Column: DBCOLUMN_FLAGS={info.flags:X8} DBCOLUMN_NAME={info.columnName}");
OleDbParameter.cs (7)
31Debug.Assert(!(value is OleDbType), "use OleDbParameter(string, OleDbType)");
32Debug.Assert(!(value is SqlDbType), "use OleDbParameter(string, OleDbType)");
384Debug.Assert(NativeDBType.STR != dbtype.wType, "should have ANSI binding, describing is okay");
412Debug.Assert(NativeDBType.STR != dbtype.wType, "should have ANSI binding, describing is okay");
459Debug.Assert(_changeID == changeID, "parameter has unexpectedly changed");
466Debug.Assert(null != destinationType, "null destinationType");
545Debug.Assert(IsParameterComputed(), "Prepare computed parameter");
RowBinding.cs (30)
46Debug.Assert(0 < _bindingCount, "bad _bindingCount");
47Debug.Assert(0 < _headerLength, "bad _headerLength");
48Debug.Assert(0 < _dataLength, "bad _dataLength");
49Debug.Assert(_bindingCount * 3 * IntPtr.Size <= _dataLength, "_dataLength too small");
50Debug.Assert(_headerLength + _dataLength <= _emptyStringOffset, "bad string offset");
51Debug.Assert(_headerLength + _dataLength + 8 <= length, "bad length");
58Debug.Fail("previous row not yet cleared");
114Debug.Fail("unknown accessor buffer");
124Debug.Assert(null != bindings, "null bindings");
125Debug.Assert(dbbindings.Length == BindingCount(), "count mismatch");
170Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false");
171Debug.Assert(0 == (ODB.SizeOf_Variant % 8), "unexpected VARIANT size mutiplier");
172Debug.Assert(0 == offset % 8, "invalid alignment");
200Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false");
201Debug.Assert(0 == (ODB.SizeOf_Variant % 8), "unexpected VARIANT size mutiplier");
202Debug.Assert(0 == offset % 8, "invalid alignment");
241Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false");
242Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
280Debug.Assert(_needToReset, "data type requires resetting and _needToReset is false");
281Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
374Debug.Assert(0 <= _bindingCount && (_bindingCount * ODB.SizeOf_tagDBBINDING) < Length, "bad _bindingCount");
386Debug.Fail("expected _needToReset");
396Debug.Assert(IntPtr.Zero != buffer && _needToReset && _haveData, "shouldn't be calling ResetValues");
459Debug.Fail("investigate");
469Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset");
481Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset");
510Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset");
538Debug.Assert(0 == (sizeof(ComVariant) % 8), "unexpected PROPVARIANT size mutiplier");
539Debug.Assert(0 == valueOffset % 8, "unexpected unaligned ptr offset");
568Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
System\Data\ProviderBase\DbBuffer.cs (37)
62Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
88Debug.Assert(0 == offset % 4, "invalid alignment");
120Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
121Debug.Assert(null != destination, "null destination");
122Debug.Assert(startIndex + length <= destination.Length, "destination too small");
153Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
154Debug.Assert(null != destination, "null destination");
155Debug.Assert(startIndex + length <= destination.Length, "destination too small");
186Debug.Assert(0 == offset % 2, "invalid alignment");
212Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
213Debug.Assert(null != destination, "null destination");
214Debug.Assert(startIndex + length <= destination.Length, "destination too small");
238Debug.Assert(0 == offset % 4, "invalid alignment");
264Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
265Debug.Assert(null != destination, "null destination");
266Debug.Assert(startIndex + length <= destination.Length, "destination too small");
290Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
316Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
358Debug.Assert(null != structure, "null structure");
361Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
385Debug.Assert(0 == offset % 4, "invalid alignment");
409Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
410Debug.Assert(null != source, "null source");
411Debug.Assert(startIndex + length <= source.Length, "source too small");
435Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
436Debug.Assert(null != source, "null source");
437Debug.Assert(startIndex + length <= source.Length, "source too small");
466Debug.Assert(0 == offset % 2, "invalid alignment");
490Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
491Debug.Assert(null != source, "null source");
492Debug.Assert(startIndex + length <= source.Length, "source too small");
516Debug.Assert(0 == offset % 4, "invalid alignment");
540Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
541Debug.Assert(null != source, "null source");
542Debug.Assert(startIndex + length <= source.Length, "source too small");
566Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
590Debug.Assert(0 == offset % IntPtr.Size, "invalid alignment");
System\Data\ProviderBase\DbConnectionFactory.cs (15)
69Debug.Assert(null != owningConnection, "null owningConnection?");
70Debug.Assert(null != poolGroup, "null poolGroup?");
87Debug.Assert(null != pool, "null pool?");
124Debug.Assert(null != owningConnection, "null owningConnection?");
293Debug.Assert(null != owningObject, "null owningObject?");
294Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
312Debug.Assert(null != connectionOptions, "prevent expansion of connectionString");
315Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup?");
397Debug.Assert(!connectionPoolGroup.IsDisabled, "Disabled pool entry discovered");
400Debug.Assert(null != connectionPoolGroup, "how did we not create a pool entry?");
401Debug.Assert(null != userConnectionOptions, "how did we not have user connection options?");
412Debug.Assert(connectionPoolGroup != null, "connectionPoolGroup may not be null.");
495Debug.Assert(!entry.Value.IsDisabled, "Disabled pool entry discovered");
520Debug.Assert(null != pool, "null pool?");
540Debug.Assert(null != poolGroup, "null poolGroup?");
System\Data\ProviderBase\DbConnectionHelper.cs (11)
128Debug.Assert(null != value, "null poolGroup");
251Debug.Assert(DbConnectionClosedConnecting.SingletonInstance == _innerConnection, "not connecting");
261Debug.Assert(null != userConnectionOptions, "null UserConnectionOptions");
274Debug.Assert(null != _innerConnection, "null InnerConnection");
275Debug.Assert(null != to, "to null InnerConnection");
299Debug.Fail("unexpected state switch");
313Debug.Assert(null != _innerConnection, "null InnerConnection");
314Debug.Assert(null != from, "from null InnerConnection");
315Debug.Assert(null != to, "to null InnerConnection");
326Debug.Assert(null != _innerConnection, "null InnerConnection");
327Debug.Assert(null != to, "to null InnerConnection");
System\Data\ProviderBase\DbConnectionPool.cs (38)
67Debug.Assert(null != pool, "null pool?");
83Debug.Assert(null != transaction, "null transaction?");
104Debug.Assert(connections != null);
123Debug.Assert(null != transaction, "null transaction?");
124Debug.Assert(null != transactedObject, "null transactedObject?");
137Debug.Assert(connections != null);
142Debug.Assert(0 > connections.IndexOf(transactedObject), "adding to pool a second time?");
172Debug.Assert(connections != null);
177Debug.Assert(0 > connections.IndexOf(transactedObject), "adding to pool a second time?");
253Debug.Assert(0 == SEMAPHORE_HANDLE, "SEMAPHORE_HANDLE");
254Debug.Assert(1 == ERROR_HANDLE, "ERROR_HANDLE");
255Debug.Assert(2 == CREATION_HANDLE, "CREATION_HANDLE");
376Debug.Assert(ADP.IsWindowsNT, "Attempting to construct a connection pool on Win9x?");
377Debug.Assert(null != connectionPoolGroup, "null connectionPoolGroup");
540Debug.Assert(obj != null, "null connection is not expected");
600Debug.Assert(obj != null, "null connection is not expected");
602Debug.Assert(!obj.IsEmancipated, "pooled object not in pool");
603Debug.Assert(obj.CanBePooled, "pooled object is not poolable");
632Debug.Assert(obj != null, "null connection is not expected");
638Debug.Assert(obj != null, "null connection is not expected");
687Debug.Assert(oldConnectionPool._state == State.ShuttingDown, "Old connections pool should be shutting down");
733Debug.Assert(timerIsNotDisposed, "ErrorCallback timer has been disposed");
765Debug.Assert(_state == State.Running || _state == State.ShuttingDown);
817Debug.Assert(_transactedConnectionPool != null, "Transacted connection pool was not expected to be null.");
859Debug.Assert(!destroyObject);
875Debug.Assert(rootTxn || returnToGeneralPool || destroyObject);
896Debug.Assert(removed, "attempt to DestroyObject not in list");
929Debug.Assert(!Thread.CurrentThread.IsThreadPoolThread, "This thread may block for a long time. Threadpool threads should not be used.");
1012Debug.Assert(connection != null, "connection should never be null in success case");
1120Debug.Assert(2 == waitHandleCount || 3 == waitHandleCount, "unexpected waithandle count");
1193Debug.Assert(2 == CREATION_HANDLE, "creation handle changed value");
1237Debug.Assert(waitForMultipleObjectsExHR != 0, "WaitForMultipleObjectsEx failed but waitForMultipleObjectsExHR remained 0");
1341Debug.Assert(obj != null, "null connection is not expected");
1346Debug.Assert(obj != null, "null connection is not expected");
1516Debug.Assert(null != obj, "why are we adding a null object to the pool?");
1532Debug.Assert(null != obj, "null obj?");
1560Debug.Assert(null != obj, "null pooledObject?");
1561Debug.Assert(obj.EnlistedTransaction == null, "pooledObject is still enlisted?");
System.Diagnostics.Debug (1)
System.Diagnostics.DiagnosticSource (91)
System.Diagnostics.EventLog (17)
System.Diagnostics.PerformanceCounter (21)
System.Diagnostics.Process (70)
System.Diagnostics.StackTrace (1)
System.Diagnostics.TextWriterTraceListener (4)
System.Diagnostics.TraceSource (15)
System.DirectoryServices (113)
System\DirectoryServices\ActiveDirectory\ActiveDirectorySite.cs (7)
172Debug.Assert(existing);
211Debug.Assert(siteName != null);
600Debug.Assert(tmpSchedule != null && tmpSchedule.Length == 188);
944Debug.Assert(fromSite != null && Utils.Compare(fromSite, 0, 3, "CN=", 0, 3) == 0);
1023Debug.Assert(otherSite != null && Utils.Compare(otherSite, 0, 3, "CN=", 0, 3) == 0);
1305Debug.Assert(handle != 0);
1330Debug.Assert(val != 0);
System.DirectoryServices.AccountManagement (498)
System.DirectoryServices.Protocols (52)
System\DirectoryServices\Protocols\common\BerConverter.cs (29)
23Debug.WriteLine("Begin encoding\n");
58Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
65Debug.WriteLine("type should be int\n");
80Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
87Debug.WriteLine("type should be boolean\n");
102Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
109Debug.WriteLine("type should be string, but receiving value has type of ");
110Debug.WriteLine(value[valueCount].GetType());
131Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
138Debug.WriteLine("type should be byte[], but receiving value has type of ");
139Debug.WriteLine(value[valueCount].GetType());
154Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
161Debug.WriteLine("type should be string[], but receiving value has type of ");
162Debug.WriteLine(value[valueCount].GetType());
195Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
202Debug.WriteLine("type should be byte[][], but receiving value has type of ");
203Debug.WriteLine(value[valueCount].GetType());
218Debug.WriteLine("value argument is not valid, valueCount >= value.Length\n");
225Debug.WriteLine("type should be int\n");
238Debug.WriteLine("Format string contains undefined character: ");
239Debug.WriteLine(new string(fmt, 1));
246Debug.WriteLine("ber_printf failed\n");
263Debug.WriteLine("ber_flatten failed\n");
306Debug.WriteLine("Begin decoding");
340Debug.WriteLine("ber_scanf for {, }, [, ], n or x failed");
365Debug.WriteLine("ber_scanf for format character 'i', 'e' or 'b' failed");
434Debug.WriteLine("Format string contains undefined character\n");
506Debug.WriteLine("ber_scanf for format character 'O' failed");
626Debug.WriteLine("ber_scanf for format character 'V' failed");
System.Drawing.Common (81)
System.Drawing.Primitives (9)
System.Formats.Asn1 (121)
System.Formats.Cbor (47)
System.Formats.Nrbf (19)
System.Formats.Tar (127)
System.IO.Compression (208)
System.IO.Compression.Brotli (17)
System.IO.Compression.ZipFile (2)
System.IO.FileSystem.AccessControl (14)
System.IO.FileSystem.DriveInfo (3)
System.IO.FileSystem.Watcher (46)
System.IO.Hashing (74)
System.IO.IsolatedStorage (5)
System.IO.MemoryMappedFiles (24)
System.IO.Packaging (67)
System.IO.Pipelines (55)
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0.");
68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2");
69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum.");
70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur.");
102Debug.Assert(segment is not null, "Expected a non-null segment.");
112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow.");
179Debug.Assert(segment is not null, "Expected a non-null segment.");
180Debug.Assert(array is not null, "Expected a non-null item array.");
253Debug.Assert(segment is not null, "Expected a non-null segment.");
254Debug.Assert(array is not null, "Expected a non-null item array.");
368Debug.Assert(syncObj is not null, "The syncObj parameter is null.");
390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2");
429Debug.Assert(queue is not null, "Expected a non-null queue.");
System.IO.Pipes (28)
System.IO.Ports (25)
System\IO\Ports\SerialPort.cs (13)
689Debug.Assert(CachedBytesToRead == 0, "there should be nothing left in our internal buffer");
721Debug.Assert(IsOpen, "ReadOneChar - port not open");
817Debug.Assert(IsOpen, "port not open!");
818Debug.Assert(buffer != null, "invalid buffer!");
819Debug.Assert(offset >= 0, "invalid offset!");
820Debug.Assert(count >= 0, "invalid count!");
821Debug.Assert(buffer.Length - offset >= count, "invalid offset/count!");
889Debug.Assert(count != 0, "Count should never be zero. We will probably see bugs further down if count is 0.");
933Debug.Assert((lastFullCharPos + currentBytesToExamine) <= _readLen, "We should never be attempting to read more bytes than we have");
951Debug.Assert((buffer.Length - offset - totalCharsFound) >= currentCharsFound, "internal buffer to read one full unicode char sequence is not sufficient!");
1102Debug.Assert((char.IsSurrogate(_singleCharBuffer[i])), "number of chars read should be more than one only for surrogate characters!");
1105Debug.Assert((numCharsRead > 0), "possible bug in ReadBufferIntoChars, reading surrogate char?");
1332Debug.Assert(_inBuffer.Length >= _readLen, "ResizeBuffer - readLen > inBuffer.Length");
System.Linq (223)
System.Linq.AsyncEnumerable (59)
System.Linq.Expressions (489)
System.Linq.Parallel (687)
System\Linq\Parallel\Channels\AsynchronousChannel.cs (21)
118Debug.Assert(chunkSize > 0, "chunk size must be greater than 0");
119Debug.Assert(capacity > 1, "this impl doesn't support capacity of 1 or 0");
258Debug.Assert(_producerChunk != null);
289Debug.Assert(chunk != null);
290Debug.Assert(!_done, "can't continue producing after the production is over");
294Debug.Assert(!IsFull, "expected a non-full buffer");
315Debug.Assert(_consumerEvent != null);
327Debug.Assert(_producerEvent != null);
383Debug.Assert(1 <= _producerChunkIndex && _producerChunkIndex <= _chunkSize);
410Debug.Assert(_consumerChunk == null);
418Debug.Assert(_consumerChunk != null, "consumer chunk is null");
419Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds");
488Debug.Assert(_consumerChunk == null);
496Debug.Assert(_consumerChunk != null, "consumer chunk is null");
497Debug.Assert(0 <= _consumerChunkIndex && _consumerChunkIndex < _consumerChunk.Length, "chunk index out of bounds");
587Debug.Assert(!IsChunkBufferEmpty, "single-consumer should never witness an empty queue here");
606Debug.Assert(!IsChunkBufferEmpty);
630Debug.Assert(_producerEvent != null);
663Debug.Assert(_done, "Expected channel to be done before disposing");
664Debug.Assert(_producerEvent != null);
665Debug.Assert(_consumerEvent != null);
System\Linq\Parallel\Partitioning\PartitionedDataSource.cs (41)
74Debug.Assert(source != null);
75Debug.Assert(partitionCount > 0);
81Debug.Assert(source != null);
138Debug.Assert(partitions.Length == partitionCount);
161Debug.Assert(source != null);
162Debug.Assert(partitionCount > 0);
238Debug.Assert(data != null, "data mustn't be null");
239Debug.Assert(partitionCount > 0, "partitionCount must be positive");
240Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
241Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
242Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1");
251Debug.Assert(sectionSize > 0);
277Debug.Assert(mutables != null);
278Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize);
340Debug.Assert(data != null, "data must not be null");
341Debug.Assert(partitionCount > 0, "partitionCount must be positive");
342Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
343Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
360Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
409Debug.Assert(data != null, "data must not be null");
410Debug.Assert(partitionCount > 0, "partitionCount must be positive");
411Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
412Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
413Debug.Assert(maxChunkSize > 0, "maxChunkSize must be positive or -1");
422Debug.Assert(sectionSize > 0);
448Debug.Assert(mutables != null);
449Debug.Assert(mutables._currentPositionInChunk >= mutables._currentChunkSize);
511Debug.Assert(data != null, "data must not be null");
512Debug.Assert(partitionCount > 0, "partitionCount must be positive");
513Debug.Assert(partitionIndex >= 0, "partitionIndex can't be negative");
514Debug.Assert(partitionIndex < partitionCount, "partitionIndex must be less than partitionCount");
531Debug.Assert(_currentIndex == null, "Expected deferred allocation to ensure it happens on correct thread");
595Debug.Assert(source != null);
596Debug.Assert(sourceSyncLock != null);
597Debug.Assert(currentIndex != null);
614Debug.Assert(mutables._chunkBuffer != null);
624Debug.Assert(_source != null);
625Debug.Assert(chunkBuffer != null);
626Debug.Assert(mutables._currentChunkSize > 0);
627Debug.Assert(0 <= currentChunkIndex && currentChunkIndex < chunkBuffer.Length);
641Debug.Assert(0 <= mutables._nextChunkMaxSize && mutables._nextChunkMaxSize <= chunkBuffer.Length);
System.Linq.Queryable (4)
System.Management (1)
System.Memory (56)
System.Net.Http (918)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (40)
38Debug.Assert(initialBufferSize >= 0);
70Debug.Assert(byteCount >= 0);
71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}");
112Debug.Assert(toReturn is not null);
120Debug.Assert(byteCount >= 0);
121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}");
130Debug.Assert(byteCount >= 0);
131Debug.Assert(limit >= 0);
147Debug.Assert(byteCount >= 0);
157Debug.Assert(byteCount > AvailableMemory.Length);
169Debug.Assert(_allocatedEnd == 0);
170Debug.Assert(_activeStart == 0);
171Debug.Assert(_availableStart == 0);
183Debug.Assert(_allocatedEnd % BlockSize == 0);
184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}");
225Debug.Assert(_allocatedEnd % BlockSize == 0);
227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null);
230Debug.Assert(_blocks[allocatedBlockCount] is null);
237Debug.Assert(byteCount <= AvailableMemory.Length);
247Debug.Assert(_activeStart == 0);
248Debug.Assert(_availableStart == 0);
249Debug.Assert(_allocatedEnd == 0);
253Debug.Assert(_activeStart <= _availableStart);
254Debug.Assert(_availableStart <= _allocatedEnd);
255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?");
264Debug.Assert(_blocks[i] is null);
269Debug.Assert(_blocks[i] is not null);
274Debug.Assert(_blocks[i] is null);
279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}");
307Debug.Assert(blocks is not null);
308Debug.Assert(start <= int.MaxValue);
309Debug.Assert(length <= int.MaxValue);
310Debug.Assert(start + length <= blocks.Length * BlockSize);
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
350Debug.Assert(_blocks is not null);
355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
System\Net\Http\Headers\HttpHeaders.cs (65)
68Debug.Assert((allowedHeaderTypes & treatAsCustomHeaderTypes) == 0);
101Debug.Assert(!Contains(descriptor));
154Debug.Assert(!Contains(descriptor));
184Debug.Assert(currentValue is string);
341Debug.Assert(singleValue is not null ^ multiValue is not null);
353Debug.Assert(multiValue is not null && multiValue.Length > 0);
371Debug.Assert(singleValue is not null ^ multiValue is not null);
394Debug.Assert(_headerStore is not null);
397Debug.Assert(_count != 0 && entries is not null, "Caller should have validated the collection is not empty");
444Debug.Assert(value != null);
445Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available.");
451Debug.Assert(descriptor.Parser.SupportsMultipleValues, $"Header '{descriptor.Name}' doesn't support multiple values");
458Debug.Assert(value != null);
459Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available.");
489Debug.Assert(value != null);
495Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available.");
496Debug.Assert(descriptor.Parser.SupportsMultipleValues,
514Debug.Assert(parsedValue.GetType() == value.GetType(),
531Debug.Assert(item.GetType() == value.GetType(),
573Debug.Assert(headerRemoved, $"Existing header '{descriptor.Name}' couldn't be removed.");
584Debug.Assert(value != null);
590Debug.Assert(descriptor.Parser != null, "Can't add parsed value if there is no parser available.");
591Debug.Assert(descriptor.Parser.SupportsMultipleValues,
609Debug.Assert(parsedValue.GetType() == value.GetType(),
621Debug.Assert(item.GetType() == value.GetType(),
640Debug.Assert(sourceHeaders != null);
641Debug.Assert(GetType() == sourceHeaders.GetType(), "Can only copy headers from an instance of the same type.");
680Debug.Assert(sourceValue is string);
732Debug.Assert(source is not InvalidValue);
778Debug.Assert(!Contains(descriptor));
784Debug.Assert((descriptor.HeaderType & _treatAsCustomHeaderTypes) == 0);
836Debug.Assert(value is string);
856Debug.Assert(!info.IsEmpty);
869Debug.Assert(rawValue is not null);
874Debug.Assert(info.ParsedAndInvalidValues is not null);
882Debug.Assert(Monitor.IsEntered(info));
921Debug.Assert(!Contains(descriptor));
931Debug.Assert(info != null);
932Debug.Assert(descriptor.Parser != null);
964Debug.Assert(index < value.Length, "Parser must return an index value within the string length.");
1007Debug.Assert(value != null);
1017Debug.Assert(!(value is List<object>),
1050Debug.Assert(currentStoreValue is T);
1054Debug.Assert(value is T);
1103Debug.Assert(info != null);
1104Debug.Assert(descriptor.Parser != null);
1129Debug.Assert(index < value.Length, "Parser must return an index value within the string length.");
1219Debug.Assert(singleValue is not null ^ multiValue is not null);
1228Debug.Assert(sourceValues is string);
1247Debug.Assert(length > 1, "The header should have been removed when it became empty");
1255Debug.Assert(currentIndex == length);
1266Debug.Assert(sourceValues is string);
1280Debug.Assert(length > 0);
1290Debug.Assert(currentIndex == length);
1298Debug.Assert(info != null);
1299Debug.Assert(Monitor.IsEntered(info));
1324Debug.Assert(item != null);
1334Debug.Assert(value != null);
1351Debug.Assert(value is not null);
1367Debug.Assert(parser != null, "There should be no reason to call CanAddValue if there is no parser for the current header.");
1390Debug.Assert(item is not InvalidValue);
1395Debug.Assert(ParsedAndInvalidValues is not InvalidValue);
1439Debug.Assert(count == 1, "Only a single parsed value should be stored for this parser");
1579Debug.Assert(dictionary.Count == _count - 1);
1597Debug.Assert(!Contains(entry.Key));
System\Net\Http\SocketsHttpHandler\HttpConnection.cs (75)
81Debug.Assert(stream != null);
138Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_Completed);
162Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted);
196Debug.Assert(_readAheadTaskStatus != ReadAheadTask_CompletionReserved);
206Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started);
233Debug.Assert(_readAheadTask == default);
247Debug.Assert(_readAheadTask == default);
248Debug.Assert(_readBuffer.ActiveLength == 0);
280Debug.Assert(_readAheadTaskStatus is ReadAheadTask_Started or ReadAheadTask_CompletionReserved);
306Debug.Assert(bytesToConsume <= _readBuffer.ActiveLength);
312Debug.Assert(request.RequestUri is not null);
333Debug.Assert(request.RequestUri.Scheme == Uri.UriSchemeHttp);
342Debug.Assert(request.Version.Major >= 0 && request.Version.Minor >= 0); // guaranteed by Version class
352Debug.Assert(Kind != HttpConnectionKind.Proxy);
357Debug.Assert(Kind == HttpConnectionKind.Proxy);
412Debug.Assert(success);
420Debug.Assert(_currentRequest is not null);
438Debug.Assert(headerValuesCount > 0, "No values for header??");
492Debug.Assert(Ascii.IsValid(s));
497Debug.Assert(status == OperationStatus.Done);
498Debug.Assert(bytesWritten == s.Length);
517Debug.Assert(status == OperationStatus.Done);
518Debug.Assert(bytesWritten == s.Length);
537Debug.Assert(_currentRequest == null, $"Expected null {nameof(_currentRequest)}.");
538Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in read buffer");
539Debug.Assert(_readAheadTaskStatus != ReadAheadTask_Started,
606Debug.Assert(_readBuffer.ActiveLength == 0);
615Debug.Assert(_readAheadTask != default);
616Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);
861Debug.Assert(_readAheadTaskStatus is ReadAheadTask_CompletionReserved or ReadAheadTask_Completed);
949Debug.Assert(request.Content is not null);
975Debug.Assert(stream.BytesWritten == 0);
1148Debug.Assert(_allowedReadLineBytes >= 0);
1325Debug.Assert(added);
1379Debug.Assert(source.Length <= _writeBuffer.AvailableLength);
1537Debug.Assert(formatted);
1543Debug.Assert(_writeBuffer.Capacity >= 8);
1651Debug.Assert(!ReadAheadTaskHasStarted);
1652Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity);
1653Debug.Assert(_readBuffer.AvailableLength >= InitialReadBufferSize);
1667Debug.Assert(_readAheadTask == default);
1707Debug.Assert(_readBuffer.ActiveStartOffset == 0);
1708Debug.Assert(_readBuffer.ActiveLength > searchOffset);
1721Debug.Assert(searchOffset == readLength - 1 && _readBuffer.ActiveReadOnlySpan[searchOffset] == '\n');
1738Debug.Assert(buffer.Length > 0);
1794Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers.");
1812Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers.");
1833Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers.");
1840Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity);
1872Debug.Assert(_readAheadTask == default, "Read ahead task should have been consumed as part of the headers.");
1874Debug.Assert(_readBuffer.AvailableLength == _readBuffer.Capacity);
1887Debug.Assert(count <= _readBuffer.ActiveLength);
1907Debug.Assert(destination != null);
1926Debug.Assert(remaining > 0);
1943Debug.Assert(destination != null);
1944Debug.Assert(length > 0);
1962Debug.Assert(_readBuffer.ActiveLength == 0, "HttpConnection's buffer should have been empty.");
2012Debug.Assert(origReadBuffer.Length > 0);
2033Debug.Assert(_currentRequest == null);
2034Debug.Assert(!_inUse);
2041Debug.Assert(_inUse);
2059Debug.Assert(_inUse);
2066Debug.Assert(_currentRequest != null, "Expected the connection to be associated with a request.");
2067Debug.Assert(_writeBuffer.ActiveLength == 0, "Everything in write buffer should have been flushed.");
2102Debug.Assert(_inUse);
2109Debug.Assert(response.Content != null);
2113Debug.Assert(responseStream != null || stream is EmptyReadStream);
2117Debug.Assert(response.RequestMessage == _currentRequest);
2126Debug.Assert(_currentRequest == null);
2133Debug.Assert(!_disposed, "Connection should not be disposed.");
2134Debug.Assert(_currentRequest == null, "Connection should no longer be associated with a request.");
2135Debug.Assert(_readAheadTask == default, "Expected a previous initial read to already be consumed.");
2136Debug.Assert(_readAheadTaskStatus == ReadAheadTask_NotStarted, "Expected SendAsync to reset the read-ahead task status.");
2137Debug.Assert(_readBuffer.ActiveLength == 0, "Unexpected data in connection read buffer.");
2154Debug.Assert(!_detachedFromPool, "Should not be detached from pool unless _connectionClose is true");
System.Net.Http.Json (5)
System.Net.Http.WinHttpHandler (138)
System\Net\Http\WinHttpRequestCallback.cs (30)
51Debug.Assert(state != null, "WinHttpCallback must have a non-null state object");
83Debug.Assert(statusInformationLength == sizeof(int));
110Debug.Assert(
141Debug.Assert(state != null);
142Debug.Assert(state.Handler != null);
143Debug.Assert(state.RequestMessage != null);
157Debug.Assert(state != null, "OnRequestSendRequestComplete: state is null");
167Debug.Assert(state != null, "OnRequestSendRequestComplete: state is null");
168Debug.Assert(state.LifecycleAwaitable != null, "OnRequestSendRequestComplete: LifecycleAwaitable is null");
175Debug.Assert(state != null, "OnRequestDataAvailable: state is null");
182Debug.Assert(state != null, "OnRequestReadComplete: state is null");
204Debug.Assert(state != null, "OnRequestWriteComplete: state is null");
205Debug.Assert(state.TcsInternalWriteDataToRequestStream != null, "TcsInternalWriteDataToRequestStream is null");
206Debug.Assert(!state.TcsInternalWriteDataToRequestStream.Task.IsCompleted, "TcsInternalWriteDataToRequestStream.Task is completed");
213Debug.Assert(state != null, "OnRequestReceiveResponseHeadersComplete: state is null");
214Debug.Assert(state.LifecycleAwaitable != null, "LifecycleAwaitable is null");
221Debug.Assert(state != null, "OnRequestRedirect: state is null");
222Debug.Assert(state.Handler != null, "OnRequestRedirect: state.Handler is null");
223Debug.Assert(state.RequestMessage != null, "OnRequestRedirect: state.RequestMessage is null");
224Debug.Assert(redirectUri != null, "OnRequestRedirect: redirectUri is null");
264Debug.Assert(state != null, "OnRequestSendingRequest: state is null");
265Debug.Assert(state.Handler != null, "OnRequestSendingRequest: state.Handler is null");
266Debug.Assert(state.RequestMessage != null, "OnRequestSendingRequest: state.RequestMessage is null");
267Debug.Assert(state.RequestMessage.RequestUri != null, "OnRequestSendingRequest: state.RequestMessage.RequestUri is null");
345Debug.Assert(ipAddress != null, "AddressFamily is not supported");
440Debug.Assert(state != null, "OnRequestError: state is null");
465Debug.Assert(state.RequestHandle != null, "OnRequestError: state.RequestHandle is null");
506Debug.Assert(state.TcsInternalWriteDataToRequestStream != null);
520Debug.Fail(
531Debug.Assert(requestHandle != null);
System.Net.HttpListener (48)
System\Net\HttpListenerRequestUriBuilder.cs (16)
49Debug.Assert(!string.IsNullOrEmpty(rawUri), "Empty raw URL.");
50Debug.Assert(!string.IsNullOrEmpty(cookedUriScheme), "Empty cooked URL scheme.");
51Debug.Assert(!string.IsNullOrEmpty(cookedUriHost), "Empty cooked URL host.");
52Debug.Assert(!string.IsNullOrEmpty(cookedUriPath), "Empty cooked URL path.");
122Debug.Assert((type == EncodingType.Primary) || (type == EncodingType.Secondary), $"Unknown 'EncodingType' value: {type}");
136Debug.Assert(encoding != null, "'encoding' must be assigned.");
137Debug.Assert(!string.IsNullOrEmpty(_rawPath), "'rawPath' must have at least one character.");
150Debug.Assert(_rawOctets.Count == 0,
172Debug.Assert(encoding != null, "'encoding' must be assigned.");
176Debug.Assert(_rawPath != null);
229Debug.Assert(_requestUriString != null);
288Debug.Assert(_rawOctets != null);
365Debug.Assert(uriString != null, "uriString must not be null");
366Debug.Assert(uriString.Length > 0, "uriString must not be empty");
408Debug.Assert((uriString.Length == 1) && (uriString[0] == '*'), "Unknown request Uri string format",
434Debug.Assert(path != null, "'path' must not be null");
System.Net.Mail (68)
System.Net.NameResolution (47)
System.Net.NetworkInformation (24)
System.Net.Ping (10)
System.Net.Primitives (81)
System.Net.Quic (133)
src\runtime\src\libraries\Common\src\System\Net\MultiArrayBuffer.cs (40)
38Debug.Assert(initialBufferSize >= 0);
70Debug.Assert(byteCount >= 0);
71Debug.Assert(byteCount <= ActiveMemory.Length, $"MultiArrayBuffer.Discard: Expected byteCount={byteCount} <= {ActiveMemory.Length}");
112Debug.Assert(toReturn is not null);
120Debug.Assert(byteCount >= 0);
121Debug.Assert(byteCount <= AvailableMemory.Length, $"MultiArrayBuffer.Commit: Expected byteCount={byteCount} <= {AvailableMemory.Length}");
130Debug.Assert(byteCount >= 0);
131Debug.Assert(limit >= 0);
147Debug.Assert(byteCount >= 0);
157Debug.Assert(byteCount > AvailableMemory.Length);
169Debug.Assert(_allocatedEnd == 0);
170Debug.Assert(_activeStart == 0);
171Debug.Assert(_availableStart == 0);
183Debug.Assert(_allocatedEnd % BlockSize == 0);
184Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
220Debug.Assert(_activeStart / BlockSize == 0, $"Start is not in first block after move or resize?? _activeStart={_activeStart}");
225Debug.Assert(_allocatedEnd % BlockSize == 0);
227Debug.Assert(allocatedBlockCount == 0 || _blocks[allocatedBlockCount - 1] is not null);
230Debug.Assert(_blocks[allocatedBlockCount] is null);
237Debug.Assert(byteCount <= AvailableMemory.Length);
247Debug.Assert(_activeStart == 0);
248Debug.Assert(_availableStart == 0);
249Debug.Assert(_allocatedEnd == 0);
253Debug.Assert(_activeStart <= _availableStart);
254Debug.Assert(_availableStart <= _allocatedEnd);
255Debug.Assert(_allocatedEnd <= _blocks.Length * BlockSize);
257Debug.Assert(_allocatedEnd % BlockSize == 0, $"_allocatedEnd={_allocatedEnd} not at block boundary?");
264Debug.Assert(_blocks[i] is null);
269Debug.Assert(_blocks[i] is not null);
274Debug.Assert(_blocks[i] is null);
279Debug.Assert(_activeStart == 0, $"No active bytes but _activeStart={_activeStart}");
307Debug.Assert(blocks is not null);
308Debug.Assert(start <= int.MaxValue);
309Debug.Assert(length <= int.MaxValue);
310Debug.Assert(start + length <= blocks.Length * BlockSize);
349Debug.Assert(_length > 0, "Length should never be 0 here because BlockCount would be 0");
350Debug.Assert(_blocks is not null);
355Debug.Assert(0 <= startInBlock, $"Invalid startInBlock={startInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
356Debug.Assert(startInBlock < endInBlock, $"Invalid startInBlock={startInBlock}, endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
357Debug.Assert(endInBlock <= BlockSize, $"Invalid endInBlock={endInBlock}. blockIndex={blockIndex}, _blocks.Length={_blocks.Length}, _start={_start}, _length={_length}");
System.Net.Requests (29)
System.Net.Security (231)
System.Net.ServerSentEvents (25)
System\Net\ServerSentEvents\SseParser_1.cs (7)
269Debug.Assert(searchOffset >= _lineOffset, $"{searchOffset}, {_lineLength}");
270Debug.Assert(searchOffset <= _lineOffset + _lineLength, $"{searchOffset}, {_lineOffset}, {_lineLength}");
271Debug.Assert(searchOffset <= _lineBuffer.Length, $"{searchOffset}, {_lineBuffer.Length}");
273Debug.Assert(searchLength >= 0, $"{searchLength}");
274Debug.Assert(searchLength <= _lineLength, $"{searchLength}, {_lineLength}");
279Debug.Assert(_newlineIndex - _lineOffset < _lineLength, "Expected to be positioned at a non-empty newline");
547Debug.Assert(_lineOffset == 0, $"Expected _lineOffset == 0, got {_lineOffset}");
System.Net.Sockets (179)
System\Net\Sockets\SocketAsyncContext.Unix.cs (62)
164Debug.Assert(oldState == State.Waiting, $"Unexpected operation state: {(State)oldState}");
169Debug.Assert(_state is State.Running or State.RunningWithPendingCancellation, "Unexpected operation state");
182Debug.Assert(state is State.Running or State.RunningWithPendingCancellation, $"Unexpected operation state: {(State)state}");
246Debug.Assert(_state == State.Canceled);
258Debug.Assert(!Interlocked.Exchange(ref _callbackQueued, true), $"Unexpected _callbackQueued: {_callbackQueued}");
285Debug.Assert(Event == null);
307Debug.Fail("Expected derived type to implement IThreadPoolWorkItem");
471Debug.Assert(SocketAddress.Length == 0);
627Debug.Assert(ErrorCode == SocketError.Success || AcceptedFileDescriptor == (IntPtr)(-1), $"Unexpected values: ErrorCode={ErrorCode}, AcceptedFileDescriptor={AcceptedFileDescriptor}");
718Debug.Assert(lockObject != null);
722Debug.Assert(!Monitor.IsEntered(_lockObject));
726Debug.Assert(success, "Timed out waiting for queue lock");
734Debug.Assert(Monitor.IsEntered(_lockObject));
800Debug.Assert(_queueLock == null);
819Debug.Assert(sizeof(QueueState) == sizeof(int));
859Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???");
871Debug.Assert(operation.Next == operation, "Expected operation.Next == operation");
875Debug.Assert(!_isNextOperationSynchronous);
898Debug.Assert(_tail == null);
925Debug.Assert(error != Interop.Error.SUCCESS);
959Debug.Assert(_tail == null, "State == Ready but queue is not empty!");
965Debug.Assert(_tail != null, "State == Waiting but queue is empty!");
967Debug.Assert(_isNextOperationSynchronous == (op.Event != null));
980Debug.Assert(_tail != null, "State == Processing but queue is empty!");
986Debug.Assert(_tail == null);
1006Debug.Assert(!skipAsyncEvents);
1015Debug.Assert(op.Event == null, "Sync operation encountered in ProcessAsyncOperation");
1042Debug.Assert(_tail == null);
1048Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!");
1049Debug.Assert(_tail != null, "Unexpected empty queue while processing I/O");
1050Debug.Assert(op == _tail.Next, "Operation is not at head of queue???");
1070Debug.Assert(_tail == null);
1076Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!");
1082Debug.Assert(observedSequenceNumber - _sequenceNumber < 10000, "Very large sequence number increase???");
1102Debug.Assert(_tail == null);
1107Debug.Assert(_state == QueueState.Processing, $"_state={_state} while processing queue!");
1108Debug.Assert(_tail.Next == op, "Queue modified while processing queue");
1130Debug.Assert(result != OperationResult.Pending);
1137Debug.Assert(op.Event != null);
1146Debug.Assert(_tail == null);
1150Debug.Assert(_tail != null, "Unexpected empty queue in CancelAndContinueProcessing");
1220Debug.Assert(_state != QueueState.Stopped);
1226Debug.Assert(_state != QueueState.Stopped);
1290Debug.Assert(_isHandleNonBlocking);
1397Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
1472Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}");
1479Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}");
1497Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}");
1498Debug.Assert(callback != null, "Expected non-null callback");
1507Debug.Assert(errorCode == SocketError.Success || acceptedFd == (IntPtr)(-1), $"Unexpected values: errorCode={errorCode}, acceptedFd={acceptedFd}");
1535Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}");
1562Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}");
1563Debug.Assert(callback != null, "Expected non-null callback");
1640Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
1785Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
1854Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
1891Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
1983Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
2015Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
2094Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
2164Debug.Assert(timeout == -1 || timeout > 0, $"Unexpected timeout: {timeout}");
2284Debug.Assert((events & Interop.Sys.SocketEvents.Error) == 0);
System\Net\Sockets\SocketPal.Unix.cs (37)
68Debug.Assert(fd != (IntPtr)(-1), "fd should not be -1");
89Debug.Assert(fd == (IntPtr)(-1), $"Unexpected fd: {fd}");
107Debug.Assert(!handle.IsSocket);
122Debug.Assert(socket.IsSocket);
146Debug.Assert(socket.IsSocket);
158Debug.Assert(socketAddress.Length != 0 || sockAddr == null);
187Debug.Assert(!handle.IsSocket);
216Debug.Assert(socket.IsSocket);
243Debug.Assert(socket.IsSocket);
287Debug.Assert(socket.IsSocket);
382Debug.Assert(socket.IsSocket);
485Debug.Assert(socket.IsSocket);
501Debug.Assert(socketAddress.Length != 0 || rawSocketAddress == null);
543Debug.Assert(socket.IsSocket);
650Debug.Assert(fd != (IntPtr)(-1), "Expected fd != -1");
673Debug.Assert(socketAddress.Length > 0, $"Unexpected socketAddressLen: {socketAddress.Length}");
747Debug.Assert(err == Interop.Error.EBADF, $"Unexpected err: {err}");
782Debug.Assert(flags == SocketFlags.None);
841Debug.Assert(flags == SocketFlags.None);
842Debug.Assert(buffers == null);
980Debug.Assert(flags == SocketFlags.None);
981Debug.Assert(buffers == null);
1534Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName: {optionName}");
1557Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}");
1686Debug.Assert((uint)optionLength <= optionValue.Length);
1705Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}");
1730Debug.Assert(optionName == SocketOptionName.AddMembership || optionName == SocketOptionName.DropMembership, $"Unexpected optionName={optionName}");
1798Debug.Assert(count > 0, $"Expected at least one entry.");
1881Debug.Assert(refsAdded == 0);
1894Debug.Assert(buffer.Length == socketList.Count);
1940Debug.Assert(eventsLength == checkReadInitialCount + checkWriteInitialCount + checkErrorInitialCount, "Invalid eventsLength");
1950Debug.Assert(offset == eventsLength, $"Invalid adds. offset={offset}, eventsLength={eventsLength}.");
1951Debug.Assert(refsAdded == eventsLength, $"Invalid ref adds. refsAdded={refsAdded}, eventsLength={eventsLength}.");
1989Debug.Assert(refsAdded == 0);
2001Debug.Assert(arrOffset < arrLength, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls.");
2036Debug.Assert(arrEndOffset >= 0, "IList.Count must have been faulty, returning a negative value and/or returning a different value across calls.");
2088Debug.Assert(elements.Length == fileHandles.Length);
System.Net.WebClient (27)
System.Net.WebHeaderCollection (1)
System.Net.WebProxy (1)
System.Net.WebSockets (86)
System\Net\WebSockets\ManagedWebSocket.cs (32)
142Debug.Assert(StateUpdateLock != null, $"Expected {nameof(StateUpdateLock)} to be non-null");
143Debug.Assert(stream != null, $"Expected non-null {nameof(stream)}");
144Debug.Assert(stream.CanRead, $"Expected readable {nameof(stream)}");
145Debug.Assert(stream.CanWrite, $"Expected writeable {nameof(stream)}");
146Debug.Assert(keepAliveInterval == Timeout.InfiniteTimeSpan || keepAliveInterval >= TimeSpan.Zero, $"Invalid {nameof(keepAliveInterval)}: {keepAliveInterval}");
147Debug.Assert(keepAliveTimeout == Timeout.InfiniteTimeSpan || keepAliveTimeout >= TimeSpan.Zero, $"Invalid {nameof(keepAliveTimeout)}: {keepAliveTimeout}");
236Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held");
431Debug.Assert(_sentCloseFrame);
459Debug.Assert(Monitor.IsEntered(StateUpdateLock), $"Expected {nameof(StateUpdateLock)} to be held");
499Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}");
653Debug.Assert(_sendBuffer != null);
715Debug.Assert(sendBuffer.Length >= MaxMessageHeaderLength, $"Expected {nameof(sendBuffer)} to be at least {MaxMessageHeaderLength}, got {sendBuffer.Length}");
890Debug.Assert(header.Opcode == MessageOpcode.Binary || header.Opcode == MessageOpcode.Text, $"Unexpected opcode {header.Opcode}");
915Debug.Assert(_inflater is not null);
1146Debug.Assert(_receiveMutex.IsHeld, $"Expected {nameof(_receiveMutex)} to be held");
1186Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}");
1290Debug.Assert(_receiveMutex.IsHeld, $"Caller should hold the {nameof(_receiveMutex)}");
1314Debug.Assert(_receiveBufferCount >= 2, "Expected to at least have the first two bytes of the header.");
1332Debug.Assert(_receiveBufferCount >= 2, "Expected to have two bytes for the payload length.");
1338Debug.Assert(_receiveBufferCount >= 8, "Expected to have eight bytes for the payload length.");
1455Debug.Assert(
1561Debug.Assert(count - 2 == encodedLength, $"{nameof(s_textEncoding.GetByteCount)} and {nameof(s_textEncoding.GetBytes)} encoded count didn't match");
1595Debug.Assert(count >= 0, $"Expected non-negative {nameof(count)}, got {count}");
1596Debug.Assert(count <= _receiveBufferCount, $"Trying to consume {count}, which is more than exists {_receiveBufferCount}");
1605Debug.Assert(minimumRequiredBytes <= _receiveBuffer.Length, $"Requested number of bytes {minimumRequiredBytes} must not exceed {_receiveBuffer.Length}");
1644Debug.Assert(_sendBuffer == null); // would only fail if had some catastrophic error previously that prevented cleaning up
1651Debug.Assert(_sendMutex.IsHeld, $"Caller should hold the {nameof(_sendMutex)}");
1671Debug.Assert(maskOffsetIndex < MaskLength, $"Unexpected {nameof(maskOffsetIndex)}: {maskOffsetIndex}");
1672Debug.Assert(mask.Length >= MaskLength + maskOffset, $"Unexpected inputs: {mask.Length}, {maskOffset}");
1683Debug.Assert(maskIndex < sizeof(int));
1801Debug.Assert((b & 0x80) != 0, "Should have already skipped past ASCII");
1909Debug.Assert(task.IsFaulted);
System.Net.WebSockets.Client (6)
System.Numerics.Tensors (399)
System.ObjectModel (4)
System.Private.CoreLib (4897)
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\ExceptionHandling.cs (12)
759Debug.Assert(exInfo._passNumber == 1, "expected asm throw routine to set the pass");
783Debug.Assert(isValid, "RhThrowEx called with an unexpected context");
870Debug.Assert(pCatchHandler != null || pReversePInvokePropagationCallback != IntPtr.Zero || unwoundReversePInvoke || isExceptionIntercepted, "We should have a handler if we're starting the second pass");
871Debug.Assert(!isExceptionIntercepted || (pCatchHandler == null), "No catch handler should be returned for intercepted exceptions in the first pass");
911Debug.Assert(isValid, "second-pass EH unwind failed unexpectedly");
922Debug.Assert(pReversePInvokePropagationCallback != IntPtr.Zero, "Unwound to a reverse P/Invoke in the second pass. We should have a propagation handler.");
923Debug.Assert(frameIter.PreviousTransitionFrame != IntPtr.Zero, "Should have a transition frame for reverse P/Invoke.");
924Debug.Assert(frameIter.SP == handlingFrameSP, "Encountered a different reverse P/Invoke frame in the second pass.");
964Debug.Fail("unreachable");
972Debug.Assert(ip != null, "IP address must not be null");
978Debug.Assert(handlingFrameSP != MaxSP, "Handling frame must have an SP value");
980Debug.Assert(((UIntPtr*)handlingFrameSP) > &handlingFrameSP,
src\runtime\src\coreclr\nativeaot\Runtime.Base\src\System\Runtime\TypeCast.cs (46)
98Debug.Assert(pTargetType->IsInterface);
99Debug.Assert(!pTargetType->HasGenericVariance);
187Debug.Assert(!pTargetType->IsParameterizedType, "IsInstanceOfClass called with parameterized MethodTable");
188Debug.Assert(!pTargetType->IsFunctionPointer, "IsInstanceOfClass called with function pointer MethodTable");
189Debug.Assert(!pTargetType->IsInterface, "IsInstanceOfClass called with interface MethodTable");
190Debug.Assert(!pTargetType->HasGenericVariance, "IsInstanceOfClass with variant MethodTable");
198Debug.Assert(obj.GetMethodTable()->IsArray);
301Debug.Assert(result != CastResult.CannotCast);
307Debug.Assert(pTargetType->IsInterface);
308Debug.Assert(!pTargetType->HasGenericVariance);
392Debug.Assert(!pTargetType->IsParameterizedType, "CheckCastClass called with parameterized MethodTable");
393Debug.Assert(!pTargetType->IsFunctionPointer, "CheckCastClass called with function pointer MethodTable");
394Debug.Assert(!pTargetType->IsInterface, "CheckCastClass called with interface MethodTable");
395Debug.Assert(!pTargetType->HasGenericVariance, "CheckCastClass with variant MethodTable");
409Debug.Assert(!pTargetType->IsParameterizedType, "CheckCastClassSpecial called with parameterized MethodTable");
410Debug.Assert(!pTargetType->IsFunctionPointer, "CheckCastClassSpecial called with function pointer MethodTable");
411Debug.Assert(!pTargetType->IsInterface, "CheckCastClassSpecial called with interface MethodTable");
412Debug.Assert(!pTargetType->HasGenericVariance, "CheckCastClassSpecial with variant MethodTable");
415Debug.Assert(mt != pTargetType, "The check for the trivial cases should be inlined by the JIT");
420Debug.Assert(mt->IsArray);
477Debug.Assert(!pDerivedType->IsArray, "did not expect array type");
478Debug.Assert(!pDerivedType->IsParameterizedType, "did not expect parameterType");
479Debug.Assert(!pDerivedType->IsFunctionPointer, "did not expect function pointer");
480Debug.Assert(!pBaseType->IsArray, "did not expect array type");
481Debug.Assert(!pBaseType->IsInterface, "did not expect interface type");
482Debug.Assert(!pBaseType->IsParameterizedType, "did not expect parameterType");
483Debug.Assert(!pBaseType->IsFunctionPointer, "did not expect function pointer");
484Debug.Assert(pBaseType->IsCanonical || pBaseType->IsGenericTypeDefinition, "unexpected MethodTable");
485Debug.Assert(pDerivedType->IsCanonical || pDerivedType->IsGenericTypeDefinition, "unexpected MethodTable");
504Debug.Assert(!pTargetType->IsParameterizedType, "did not expect parameterized type");
505Debug.Assert(!pTargetType->IsFunctionPointer, "did not expect function pointer type");
506Debug.Assert(pTargetType->IsInterface, "IsInstanceOfInterface called with non-interface MethodTable");
535Debug.Assert(pTargetVarianceInfo != null, "did not expect empty variance info");
560Debug.Assert(pInterfaceVarianceInfo != null, "did not expect empty variance info");
564Debug.Assert(targetArity == interfaceArity, "arity mismatch between generic instantiations");
596Debug.Assert(pTargetVarianceInfo != null, "did not expect empty variance info");
602Debug.Assert(pSourceVarianceInfo != null, "did not expect empty variance info");
606Debug.Assert(targetArity == sourceArity, "arity mismatch between generic instantiations");
704Debug.Fail("unknown generic variance type");
720Debug.Assert(array.GetMethodTable()->IsArray, "first argument must be an array");
756Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array");
763Debug.Assert(index >= 0);
788Debug.Assert(array is null || array.GetMethodTable()->IsArray, "first argument must be an array");
794Debug.Assert(index >= 0);
853Debug.Assert(pTargetType->IsArray, "IsInstanceOfArray called with non-array MethodTable");
934Debug.Assert((int)elementType < 32);
src\runtime\src\coreclr\System.Private.CoreLib\src\System\Runtime\CompilerServices\AsyncHelpers.RuntimeAsyncYielder.cs (1)
27Debug.Assert(
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0.");
68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2");
69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum.");
70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur.");
102Debug.Assert(segment is not null, "Expected a non-null segment.");
112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow.");
179Debug.Assert(segment is not null, "Expected a non-null segment.");
180Debug.Assert(array is not null, "Expected a non-null item array.");
253Debug.Assert(segment is not null, "Expected a non-null segment.");
254Debug.Assert(array is not null, "Expected a non-null item array.");
368Debug.Assert(syncObj is not null, "The syncObj parameter is null.");
390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2");
429Debug.Assert(queue is not null, "Expected a non-null queue.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\Dictionary.cs (51)
129Debug.Assert(source._entries is not null);
130Debug.Assert(_entries is not null);
131Debug.Assert(_entries.Length >= source.Count);
132Debug.Assert(_count == 0);
199Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type.");
244Debug.Assert(modified);
251Debug.Assert(modified); // If there was an existing key and the Add failed, an exception will already have been thrown.
285Debug.Assert(_buckets != null, "_buckets should be non-null");
286Debug.Assert(_entries != null, "_entries should be non-null");
407Debug.Assert(_entries != null, "expected entries to be != null");
445Debug.Assert(comparer is not null);
520Debug.Assert(_buckets != null);
523Debug.Assert(entries != null, "expected entries to be non-null");
526Debug.Assert(comparer is not null || typeof(TKey).IsValueType);
568Debug.Assert(comparer is not null);
603Debug.Assert((StartOfFreeList - entries[_freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow");
696Debug.Assert(dictionary is not null);
697Debug.Assert(IsCompatibleKey(dictionary));
731Debug.Assert(dictionary is not null);
739Debug.Assert(IsCompatibleKey(dictionary));
782Debug.Assert(actualKey is not null);
809Debug.Assert(dictionary._entries != null, "expected entries to be != null");
879Debug.Assert(dictionary._entries != null, "entries should be non-null");
906Debug.Assert((StartOfFreeList - dictionary._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
971Debug.Assert(dictionary._buckets != null);
974Debug.Assert(entries != null, "expected entries to be non-null");
982Debug.Assert(comparer is not null);
1013Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow");
1052Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here");
1085Debug.Assert(dictionary._buckets != null);
1088Debug.Assert(entries != null, "expected entries to be non-null");
1091Debug.Assert(comparer is not null || typeof(TKey).IsValueType);
1124Debug.Assert(comparer is not null);
1150Debug.Assert((StartOfFreeList - entries[dictionary._freeList].next) >= -1, "shouldn't overflow because `next` cannot underflow");
1189Debug.Assert(!Unsafe.IsNullRef(ref value), "the lookup result cannot be a null ref here");
1251Debug.Assert(!forceNewHashCodes || !typeof(TKey).IsValueType);
1252Debug.Assert(_entries != null, "_entries should be non-null");
1253Debug.Assert(newSize >= _entries.Length);
1262Debug.Assert(_comparer is NonRandomizedStringEqualityComparer);
1306Debug.Assert(_entries != null, "entries should be non-null");
1310Debug.Assert(typeof(TKey).IsValueType || comparer is not null);
1336Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
1368Debug.Assert(comparer is not null);
1384Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
1432Debug.Assert(_entries != null, "entries should be non-null");
1436Debug.Assert(typeof(TKey).IsValueType || comparer is not null);
1464Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
1496Debug.Assert(comparer is not null);
1514Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
1711Debug.Assert(oldEntries is not null);
1718Debug.Assert(_entries is not null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Collections\Generic\HashSet.cs (32)
148Debug.Assert(EffectiveEqualityComparersAreEqual(this, source), "must use identical effective comparers.");
187Debug.Assert(Count == source.Count);
202Debug.Assert(_buckets != null, "_buckets should be non-null");
203Debug.Assert(_entries != null, "_entries should be non-null");
225Debug.Assert(entries != null, "Expected _entries to be initialized");
255Debug.Assert(comparer is not null);
297Debug.Assert(entries != null, "entries should be non-null");
303Debug.Assert(typeof(T).IsValueType || comparer is not null);
327Debug.Assert((StartOfFreeList - _freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
426Debug.Assert(set is not null);
427Debug.Assert(IsCompatibleItem(set));
438Debug.Assert(set is not null);
446Debug.Assert(IsCompatibleItem(set));
462Debug.Assert(set._buckets != null);
465Debug.Assert(entries != null, "expected entries to be non-null");
472Debug.Assert(comparer is not null);
502Debug.Assert((StartOfFreeList - entries[set._freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow");
549Debug.Assert(entries != null, "entries should be non-null");
574Debug.Assert((StartOfFreeList - set._freeList) < 0, "shouldn't underflow because max hashtable length is MaxPrimeArrayLength = 0x7FEFFFFD(2146435069) _freelist underflow threshold 2147483646");
634Debug.Assert(set._entries != null, "expected entries to be != null");
1253Debug.Assert(_comparer is not null, "The comparer should never be null for a reference type.");
1297Debug.Assert(!forceNewHashCodes || !typeof(T).IsValueType);
1298Debug.Assert(_entries != null, "_entries should be non-null");
1299Debug.Assert(newSize >= _entries.Length);
1308Debug.Assert(_comparer is NonRandomizedStringEqualityComparer);
1425Debug.Assert(_buckets != null);
1428Debug.Assert(entries != null, "expected entries to be non-null");
1464Debug.Assert(comparer is not null);
1492Debug.Assert((StartOfFreeList - entries[_freeList].Next) >= -1, "shouldn't overflow because `next` cannot underflow");
1525Debug.Assert(location >= 0);
1583Debug.Assert(_buckets != null, "_buckets shouldn't be null; callers should check first");
1741Debug.Assert((_buckets != null) && (_count > 0), "_buckets was null but count greater than 0");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\CultureData.cs (20)
903Debug.Assert(_sRealName != null, "[CultureData.CultureName] Expected _sRealName to be populated by already");
1083Debug.Assert(_sSpecificCulture != null, "[CultureData.SpecificCultureName] Expected this.sSpecificCulture to be populated by culture data initialization already");
1659Debug.Assert(_sWindowsName != null, "[CultureData.CalendarIds] Expected _sWindowsName to be populated by already");
1726Debug.Assert(calendarId > 0 && calendarId <= CalendarId.LAST_CALENDAR,
1750Debug.Assert(_sWindowsName != null, "[CultureData.GetCalendar] Expected _sWindowsName to be populated by already");
1780Debug.Assert(_sRealName != null, "[CultureData.IsRightToLeft] Expected _sRealName to be populated by already");
1804Debug.Assert(_sRealName != null, "[CultureData.TextInfoName] Expected _sRealName to be populated by already");
1816Debug.Assert(_sRealName != null, "[CultureData.SortName] Expected _sRealName to be populated by already");
1889Debug.Assert(_sRealName != null, "[CultureData.LCID] Expected this.sRealName to be populated already");
1932Debug.Assert(calendarId > 0, "[CultureData.saEraNames] Expected Calendar.ID > 0");
1938Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0");
1944Debug.Assert(calendarId > 0, "[CultureData.saAbbrevEraNames] Expected Calendar.ID > 0");
2022Debug.Assert(str != null);
2023Debug.Assert(start >= 0);
2024Debug.Assert(end >= 0);
2109Debug.Assert(startIndex >= 0, "startIndex cannot be negative");
2110Debug.Assert(!timeParts.AsSpan().ContainsAny('\'', '\\'), "timeParts cannot include quote characters");
2204Debug.Assert(index >= 10, $"Couldn't read native digits for '{_sWindowsName}' successfully.");
2230Debug.Assert(_sWindowsName != null, "[CultureData.GetNFIValues] Expected _sWindowsName to be populated by already");
2250Debug.Assert(_sRealName != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\DateTimeFormatInfo.cs (51)
166Debug.Assert(abbreviatedDayNames.Length == 7, "[DateTimeFormatInfo.GetAbbreviatedDayOfWeekNames] Expected 7 day names in a week");
180Debug.Assert(m_superShortDayNames.Length == 7, "[DateTimeFormatInfo.InternalGetSuperShortDayNames] Expected 7 day names in a week");
194Debug.Assert(dayNames.Length == 7, "[DateTimeFormatInfo.GetDayOfWeekNames] Expected 7 day names in a week");
208Debug.Assert(abbreviatedMonthNames.Length == 12 || abbreviatedMonthNames.Length == 13,
223Debug.Assert(monthNames.Length == 12 || monthNames.Length == 13,
237Debug.Assert(cultureData != null);
238Debug.Assert(cal != null);
248Debug.Assert(cultureData != null);
249Debug.Assert(calendarId != CalendarId.UNINITIALIZED_VALUE, "[DateTimeFormatInfo.Populate] Expected initialized calendarId");
266Debug.Assert(allLongTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long time patterns");
269Debug.Assert(allShortTimePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short time patterns");
272Debug.Assert(allLongDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some long date patterns");
275Debug.Assert(allShortDatePatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some short date patterns");
278Debug.Assert(allYearMonthPatterns.Length > 0, "[DateTimeFormatInfo.Populate] Expected some year month patterns");
345Debug.Assert(amDesignator != null, "DateTimeFormatInfo.AMDesignator, amDesignator != null");
364Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
374Debug.Assert(calendar != null, "DateTimeFormatInfo.Calendar: calendar != null");
578Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.AbbreviatedEnglishEraNames] Expected Calendar.ID > 0");
594Debug.Assert(dateSeparator != null, "DateTimeFormatInfo.DateSeparator, dateSeparator != null");
613Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
627Debug.Assert(firstDayOfWeek != -1, "DateTimeFormatInfo.FirstDayOfWeek, firstDayOfWeek != -1");
659Debug.Assert(calendarWeekRule != -1, "DateTimeFormatInfo.CalendarWeekRule, calendarWeekRule != -1");
773Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.MonthDayPattern] Expected calID > 0");
777Debug.Assert(monthDayPattern != null, "DateTimeFormatInfo.MonthDayPattern, monthDayPattern != null");
797Debug.Assert(pmDesignator != null, "DateTimeFormatInfo.PMDesignator, pmDesignator != null");
816Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
979Debug.Assert(timeSeparator != null, "DateTimeFormatInfo.TimeSeparator, timeSeparator != null");
998Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
1042Debug.Assert(values != null, "value != null");
1043Debug.Assert(values.Length >= length);
1201Debug.Assert(m_genitiveAbbreviatedMonthNames.Length == 13,
1211Debug.Assert(genitiveMonthNames.Length == 13,
1227Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.InternalGetLeapYearMonthNames] Expected Calendar.ID > 0");
1229Debug.Assert(leapYearMonthNames.Length == 13,
1268Debug.Assert(patterns1 != null);
1269Debug.Assert(patterns2 != null);
1371Debug.Assert(patterns != null && patterns.Length > 0,
1373Debug.Assert(defaultPattern != null,
1449Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedYearMonthPatterns] Expected Calendar.ID > 0");
1451Debug.Assert(allYearMonthPatterns.Length > 0,
1470Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedShortDatePatterns] Expected Calendar.ID > 0");
1472Debug.Assert(allShortDatePatterns.Length > 0,
1491Debug.Assert(Calendar.ID > 0, "[DateTimeFormatInfo.UnclonedLongDatePatterns] Expected Calendar.ID > 0");
1493Debug.Assert(allLongDatePatterns.Length > 0,
1513Debug.Assert(allShortTimePatterns.Length > 0,
1533Debug.Assert(allLongTimePatterns.Length > 0,
1698Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
2251Debug.Assert(state == HebrewNumberParsingState.ContinueParsing || state == HebrewNumberParsingState.FoundEndOfHebrewNumber,
2300Debug.Assert(str.Index < str.Value.Length, "DateTimeFormatInfo.Tokenize(): start < value.Length");
2418Debug.Fail("The hashtable is full. This should not happen.");
2502Debug.Fail("The hashtable is full. This should not happen.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\IdnMapping.cs (14)
214Debug.Assert(input.Length > 0);
262Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now.");
296Debug.Assert(unicode.Length >= 1, "[IdnMapping.GetAscii] Expected 0 length strings to fail before now.");
476Debug.Assert(!char.IsLowSurrogate(unicode[basicCount]), "[IdnMapping.punycode_encode]Unexpected low surrogate");
553Debug.Assert(delta > 0, "[IdnMapping.cs]1 punycode_encode - delta overflowed int");
567Debug.Assert(delta > 0, "[IdnMapping.cs]2 punycode_encode - delta overflowed int");
578Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_encode]Expected c_punycodeBase (36) to be != t");
597Debug.Assert(delta > 0, "[IdnMapping.cs]3 punycode_encode - delta overflowed int");
837Debug.Assert(w > 0, "[IdnMapping.punycode_decode]Expected w > 0");
845Debug.Assert(c_punycodeBase != t, "[IdnMapping.punycode_decode]Expected t != c_punycodeBase (36)");
855Debug.Assert((output.Length - iOutputAfterLastDot - numSurrogatePairs) + 1 > 0,
979Debug.Assert(numpoints != 0, "[IdnMapping.adapt]Expected non-zero numpoints.");
987Debug.Assert(delta + c_skew != 0, "[IdnMapping.adapt]Expected non-zero delta+skew.");
1012Debug.Assert(d >= 0 && d < c_punycodeBase, "[IdnMapping.encode_digit]Expected 0 <= d < punycodeBase");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Globalization\TimeSpanFormat.cs (27)
53Debug.Assert(typeof(TChar) == typeof(char) || typeof(TChar) == typeof(byte));
111Debug.Assert(format == StandardFormat.C || format == StandardFormat.G || format == StandardFormat.g);
127Debug.Assert(ticks == long.MinValue /* -9223372036854775808 */);
144Debug.Assert(fraction < 10_000_000);
152Debug.Assert(decimalSeparator.IsEmpty);
167Debug.Assert(format == StandardFormat.g);
182Debug.Assert(seconds < 60);
190Debug.Assert(minutes < 60);
194Debug.Assert(totalHoursRemaining <= uint.MaxValue);
201Debug.Assert(hours < 24);
216Debug.Assert(dayDigits <= 8);
251Debug.Assert(hourDigits == 1 || hourDigits == 2);
289Debug.Assert(p - dest == requiredOutputLength);
299Debug.Assert(dtfi != null);
522Debug.Assert(field >= 0 && field <= 5);
539Debug.Fail("Unexpected special token '%', Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
551Debug.Assert((field == 0 && sb.Length == 0) || field == 1, "field == 0 || field == 1, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
559Debug.Assert((field == 1 && sb.Length == 0) || field == 2, "field == 1 || field == 2, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
567Debug.Assert((field == 2 && sb.Length == 0) || field == 3, "field == 2 || field == 3, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
575Debug.Assert((field == 3 && sb.Length == 0) || field == 4, "field == 3 || field == 4, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
584Debug.Assert((field == 4 && sb.Length == 0) || field == 5, "field == 4 || field == 5, Bug in DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
597Debug.Assert(field == 5);
600Debug.Assert(0 < dd && dd < 3, "0 < dd && dd < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
601Debug.Assert(0 < hh && hh < 3, "0 < hh && hh < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
602Debug.Assert(0 < mm && mm < 3, "0 < mm && mm < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
603Debug.Assert(0 < ss && ss < 3, "0 < ss && ss < 3, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
604Debug.Assert(0 < ff && ff < 8, "0 < ff && ff < 8, Bug in System.Globalization.DateTimeFormatInfo.FullTimeSpan[Positive|Negative]Pattern");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\BufferedStream.cs (84)
92Debug.Assert(_stream != null);
100Debug.Assert(_stream != null);
108Debug.Assert(_stream != null);
116Debug.Assert(_buffer != null);
117Debug.Assert(_bufferSize > 0);
132Debug.Assert(_bufferSize > 0);
199Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time.");
270Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0);
292Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0)));
315Debug.Assert(_stream != null);
323Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0);
344Debug.Assert(_writePos == 0 && (!_stream.CanSeek || (_readPos == 0 && _readLen == 0)));
353Debug.Assert(_writePos == 0 && _readPos == _readLen);
367Debug.Assert(_stream != null);
368Debug.Assert(_writePos == 0, "BufferedStream: Write buffer must be empty in FlushRead!");
382Debug.Assert(_stream != null);
383Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]");
393Debug.Assert(_readPos < _readLen);
406Debug.Assert(_stream != null);
407Debug.Assert(_readPos == 0 && _readLen == 0,
409Debug.Assert(_buffer != null && _bufferSize >= _writePos,
419Debug.Assert(_stream != null);
420Debug.Assert(_readPos == 0 && _readLen == 0,
422Debug.Assert(_buffer != null && _bufferSize >= _writePos,
433Debug.Assert(readbytes >= 0);
449Debug.Assert(readbytes >= 0);
477Debug.Assert(_stream != null);
499Debug.Assert(_readLen == _readPos, "The read buffer must now be empty");
532Debug.Assert(_stream != null);
549Debug.Assert(_readLen == _readPos, "The read buffer must now be empty");
675Debug.Assert(_stream != null);
676Debug.Assert(_stream.CanRead);
677Debug.Assert(_bufferSize > 0);
678Debug.Assert(_asyncActiveSemaphore != null);
679Debug.Assert(semaphoreLockTask != null);
699Debug.Assert(_readLen == _readPos);
742Debug.Assert(_readPos == _readLen);
751Debug.Assert(_stream != null);
798Debug.Assert(_stream != null);
863Debug.Assert(_writePos < _bufferSize);
880Debug.Assert(count == 0);
884Debug.Assert(count >= 0);
885Debug.Assert(_writePos == _bufferSize);
886Debug.Assert(_buffer != null);
893Debug.Assert(count == 0);
894Debug.Assert(_writePos < _bufferSize);
901Debug.Assert(_buffer != null);
902Debug.Assert(totalUserbytes >= _bufferSize);
927Debug.Assert(_stream != null);
933Debug.Assert(_writePos < _bufferSize, $"Expected {_writePos} < {_bufferSize}");
952Debug.Assert(bytesWritten == buffer.Length);
957Debug.Assert(_writePos == _bufferSize);
958Debug.Assert(_buffer != null);
966Debug.Assert(bytesWritten == buffer.Length);
968Debug.Assert(_writePos < _bufferSize);
975Debug.Assert(_buffer != null);
976Debug.Assert(totalUserbytes >= _bufferSize);
1028Debug.Assert(_writePos < _bufferSize);
1035Debug.Assert(bytesWritten == buffer.Length);
1058Debug.Assert(_stream != null);
1059Debug.Assert(_stream.CanWrite);
1060Debug.Assert(_bufferSize > 0);
1061Debug.Assert(_asyncActiveSemaphore != null);
1062Debug.Assert(semaphoreLockTask != null);
1091Debug.Assert(buffer.Length == 0);
1095Debug.Assert(buffer.Length >= 0);
1096Debug.Assert(_writePos == _bufferSize);
1097Debug.Assert(_buffer != null);
1103Debug.Assert(bytesWritten == buffer.Length);
1105Debug.Assert(_writePos < _bufferSize);
1113Debug.Assert(_buffer != null);
1114Debug.Assert(totalUserBytes >= _bufferSize);
1172Debug.Assert(_stream != null);
1179Debug.Assert(_writePos < _bufferSize);
1186Debug.Assert(_stream != null);
1207Debug.Assert(oldPos == _stream.Position + (_readPos - _readLen));
1229Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})");
1241Debug.Assert(_stream != null);
1252Debug.Assert(_stream != null);
1255Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}");
1260Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
1287Debug.Assert(_stream != null);
1294Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}");
1299Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\Strategies\BufferedFileStreamStrategy.cs (40)
28Debug.Assert(bufferSize > 1, "Buffering must not be enabled for smaller buffer sizes");
62Debug.Assert(!(_writePos > 0 && _readPos != _readLen), "Read and Write buffers cannot both have data in them at the same time.");
162Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen),
233Debug.Assert(_readPos == _readLen, "Read buffer should be empty!");
254Debug.Assert(_readPos == _readLen);
301Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
302Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen),
352Debug.Assert(!_strategy.CanSeek);
380Debug.Assert(_writePos == 0, "Win32FileStream must not have buffered write data here! Pipes should be unidirectional.");
394Debug.Assert(_asyncActiveSemaphore != null);
395Debug.Assert(_strategy.CanSeek);
428Debug.Assert(_readLen == _readPos, "The read buffer must now be empty");
519Debug.Assert(_writePos == 0, "FlushWrite must set _writePos to 0");
525Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted.");
576Debug.Assert(_writePos <= _bufferSize);
599Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
600Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen),
602Debug.Assert(_strategy.CanSeek || (_readPos == 0 && _readLen == 0),
661Debug.Assert(!_strategy.CanSeek);
678Debug.Assert(_asyncActiveSemaphore != null);
679Debug.Assert(_strategy.CanSeek);
723Debug.Assert(_writePos == 0, "FileStream cannot have buffered data to write here! Your stream will be corrupted.");
760Debug.Assert(!_strategy.IsClosed, "FileStream responsibility");
761Debug.Assert((_readPos == 0 && _readLen == 0 && _writePos >= 0) || (_writePos == 0 && _readPos <= _readLen),
782Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0)));
806Debug.Assert(_writePos == 0 && _readPos == 0 && _readLen == 0);
821Debug.Assert(_writePos == 0 && (!_strategy.CanSeek || (_readPos == 0 && _readLen == 0)));
826Debug.Assert(_writePos == 0 && _readPos == _readLen);
851Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}");
856Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
882Debug.Assert(readBytes >= 0, $"Expected a non-negative number of bytes in buffer, got {readBytes}");
887Debug.Assert(_writePos == 0, "Write buffer must be empty if there's data in the read buffer");
919Debug.Assert(oldPos == _strategy.Position + (_readPos - _readLen));
941Debug.Assert(newPos == Position, $"newPos (={newPos}) == Position (={Position})");
954Debug.Assert(_writePos == 0, "Write buffer must be empty in FlushRead!");
967Debug.Assert(_readPos == 0 && _readLen == 0, "Read buffer must be empty in FlushWrite!");
968Debug.Assert(_buffer != null && _bufferSize >= _writePos, "Write buffer must be allocated and write position must be in the bounds of the buffer in FlushWrite!");
979Debug.Assert(_readPos <= _readLen, $"_readPos <= _readLen [{_readPos} <= {_readLen}]");
989Debug.Assert(_readPos < _readLen);
1043Debug.Assert(!_strategy.IsClosed, "FileStream ensures that strategy is not closed");
src\runtime\src\libraries\System.Private.CoreLib\src\System\IO\StreamReader.cs (34)
125Debug.Assert(this is NullStreamReader);
491Debug.Assert(_byteLen >= n, "CompressBuffer was called with a number of bytes greater than the current buffer length. Are two threads using this StreamReader at the same time?");
500Debug.Assert(_byteLen >= 2, "Caller should've validated that at least 2 bytes were available.");
578Debug.Assert(_checkPreamble);
581Debug.Assert(_bytePos < preamble.Length, "_compressPreamble was called with the current bytePos greater than the preamble buffer length. Are two threads using this StreamReader at the same time?");
595Debug.Assert(_bytePos <= preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
626Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
628Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
640Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
642Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
671Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration.");
681Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
726Debug.Assert(charsRead == 0);
730Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
732Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
744Debug.Assert(_bytePos == 0, "bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
746Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
778Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration.");
796Debug.Assert(charsRead == 0 && _charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
841Debug.Assert(!charBufferSpan.IsEmpty, "ReadBuffer returned > 0 but didn't bump _charLen?");
951Debug.Assert(charPos < charLen, "ReadBuffer returned > 0 but didn't bump _charLen?");
1172Debug.Assert(n == 0);
1176Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
1179Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
1200Debug.Assert(n == 0);
1212Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
1216Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
1248Debug.Assert(n == 0);
1392Debug.Assert(_bytePos <= _encoding.Preamble.Length, "possible bug in _compressPreamble. Are two threads using this StreamReader at the same time?");
1395Debug.Assert(len >= 0, "Stream.Read returned a negative number! This is a bug in your stream class.");
1407Debug.Assert(_bytePos == 0, "_bytePos can be non zero only when we are trying to _checkPreamble. Are two threads using this StreamReader at the same time?");
1409Debug.Assert(_byteLen >= 0, "Stream.Read returned a negative number! Bug in stream class.");
1438Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be trying to decode more data if we made progress in an earlier iteration.");
1448Debug.Assert(_charPos == 0 && _charLen == 0, "We shouldn't be looking for EOF unless we have an empty char buffer.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ManifestBasedResourceGroveler.cs (24)
31Debug.Assert(mediator != null, "mediator shouldn't be null; check caller");
37Debug.Assert(culture != null, "culture shouldn't be null; check caller");
38Debug.Assert(localResourceSets != null, "localResourceSets shouldn't be null; check caller");
90Debug.Assert(satellite != null, "satellite should not be null when stream is set");
112Debug.Assert(_mediator.NeutralResourcesCulture != null);
128Debug.Assert(a != null, "assembly != null");
154Debug.Fail(CoreLib.Name + "'s NeutralResourcesLanguageAttribute is a malformed culture name! name: \"" + attr.CultureName + "\" Exception: " + e);
168Debug.Assert(store != null, "I need a Stream!");
208Debug.Assert(_mediator.MainAssembly != null);
225Debug.Assert(readerTypeName != null, "Reader Type name should be set");
226Debug.Assert(resSetTypeName != null, "ResourceSet Type name should be set");
300Debug.Assert(resSetTypeName != null, "We should have a ResourceSet type name from the custom resource file here.");
315Debug.Assert(satellite != null, "satellite shouldn't be null; check caller");
316Debug.Assert(fileName != null, "fileName shouldn't be null; check caller");
328Debug.Assert(satellite != null, "satellite shouldn't be null; check caller");
329Debug.Assert(name != null, "name shouldn't be null; check caller");
357Debug.Assert(_mediator.MainAssembly != null);
392Debug.Assert(readerTypeName != null, "readerTypeName shouldn't be null; check caller");
393Debug.Assert(resSetTypeName != null, "resSetTypeName shouldn't be null; check caller");
419Debug.Assert(_mediator.MainAssembly != null);
427Debug.Assert(_mediator.NeutralResourcesCulture != null);
462Debug.Assert(_mediator.BaseName != null);
467Debug.Fail("Couldn't get " + CoreLib.Name + ResourceManager.ResFileExtension + " from " + CoreLib.Name + "'s assembly" + Environment.NewLineConst + Environment.NewLineConst + "Are you building the runtime on your machine? Chances are the BCL directory didn't build correctly. Type 'build -c' in the BCL directory. If you get build errors, look at buildd.log. If you then can't figure out what's wrong (and you aren't changing the assembly-related metadata code), ask a BCL dev.\n\nIf you did NOT build the runtime, you shouldn't be seeing this and you've found a bug.");
473Debug.Assert(_mediator.MainAssembly != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?");
191Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}");
195Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled.");
200Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled.");
207Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}");
211Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled.");
216Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled.");
252Debug.Assert(_store != null, "ResourceReader is closed!");
333Debug.Assert(_store != null, "ResourceReader is closed!");
334Debug.Assert(Monitor.IsEntered(this)); // uses _store
376Debug.Assert(_store != null, "ResourceReader is closed!");
447Debug.Assert(_store != null, "ResourceReader is closed!");
471Debug.Assert(_store != null, "ResourceReader is closed!");
533Debug.Assert(_store != null, "ResourceReader is closed!");
534Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!");
535Debug.Assert(Monitor.IsEntered(this)); // uses _store
555Debug.Assert(Monitor.IsEntered(this)); // uses _store
615Debug.Assert(_store != null, "ResourceReader is closed!");
616Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!");
617Debug.Assert(Monitor.IsEntered(this)); // uses _store
637Debug.Assert(Monitor.IsEntered(this)); // uses _store
723Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)");
775Debug.Assert(!Monitor.IsEntered(this)); // only called during init
776Debug.Assert(_store != null, "ResourceReader is closed!");
798Debug.Assert(!Monitor.IsEntered(this)); // only called during init
987Debug.Assert(Monitor.IsEntered(this)); // uses _store
995Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!");
1026Debug.Assert(typeCode >= 0, "can't be negative");
1027Debug.Assert(Monitor.IsEntered(this)); // uses _store
1031Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers.");
1037Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
1111Debug.Assert(!Monitor.IsEntered(_reader));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\CompilerServices\TaskAwaiter.cs (16)
32Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
107Debug.Assert(taskCompleted, "With an infinite timeout, the task should have always completed.");
129Debug.Assert(task.IsCompleted, "Task must have been completed by now.");
130Debug.Assert(task.Status != TaskStatus.RanToCompletion, "Task should not be completed successfully.");
144Debug.Fail("Throw() should have thrown");
155Debug.Fail("Throw() should have thrown");
160Debug.Fail("There should be exceptions if we're Faulted.");
198Debug.Assert(stateMachineBox != null);
245Debug.Assert(task != null, "Need a task to wait on");
246Debug.Assert(continuation != null, "Need a continuation to invoke when the wait completes");
326Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
394Debug.Assert(task != null, "Constructing an awaitable requires a task to await.");
422Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
423Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.SuppressThrowing | ConfigureAwaitOptions.ForceYielding)) == 0);
504Debug.Assert(task != null, "Constructing an awaiter requires a task to await.");
505Debug.Assert((options & ~(ConfigureAwaitOptions.ContinueOnCapturedContext | ConfigureAwaitOptions.ForceYielding)) == 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\InteropServices\RuntimeInformation.Unix.cs (1)
45Debug.Assert(osArch >= 0);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Runtime\Serialization\SerializationInfo.cs (14)
105Debug.Assert(_names.Length == _count, "[SerializationInfo.ExpandArrays]_names.Length == _count");
267Debug.Assert(null != name, "[SerializationInfo.UpdateValue]name!=null");
268Debug.Assert(null != value, "[SerializationInfo.UpdateValue]value!=null");
269Debug.Assert(type is not null, "[SerializationInfo.UpdateValue]type!=null");
310Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length");
311Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length");
314Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null");
327Debug.Assert(index < _values.Length, "[SerializationInfo.GetElement]index<_values.Length");
328Debug.Assert(index < _types.Length, "[SerializationInfo.GetElement]index<_types.Length");
331Debug.Assert(foundType is not null, "[SerializationInfo.GetElement]foundType!=null");
349Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
355Debug.Assert(type is not null, "[SerializationInfo.GetValue]type ==null");
356Debug.Assert(type is RuntimeType, "[SerializationInfo.GetValue]type is not a runtime type");
367Debug.Assert(_converter != null, "[SerializationInfo.GetValue]_converter!=null");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SearchValues\IndexOfAnyAsciiSearcher.cs (18)
39Debug.Assert((uint)value <= 127);
77Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char));
102Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char));
144Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(char));
212Debug.Assert(searchSpaceLength >= Vector128<short>.Count);
239Debug.Assert(searchSpaceLength >= Vector128<short>.Count);
346Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector.");
399Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector.");
478Debug.Assert(searchSpaceLength >= Vector256<short>.Count, "We expect that the input is long enough for us to load a whole vector.");
529Debug.Assert(searchSpaceLength >= Vector128<short>.Count, "We expect that the input is long enough for us to load a whole vector.");
628Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128.");
677Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
753Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128.");
802Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
900Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128.");
952Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
1028Debug.Assert(searchSpaceLength >= Vector128<byte>.Count, "We expect that the input is long enough for us to load a Vector128.");
1080Debug.Assert(searchSpaceLength >= sizeof(ulong), "We expect that the input is long enough for us to load a ulong.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\SpanHelpers.T.cs (63)
86Debug.Fail("Vector<T> is unexpected size.");
98Debug.Fail("Vector<T> is unexpected size.");
104Debug.Fail("Vector<T> is greater than 512 bits in size?");
207Debug.Assert(searchSpaceLength >= 0);
208Debug.Assert(valueLength >= 0);
220Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength".
249Debug.Assert(length >= 0);
255Debug.Assert(value is not null);
320Debug.Assert(length >= 0);
325Debug.Assert(value is not null);
419Debug.Assert(length >= 0);
425Debug.Assert(value0 is not null && value1 is not null);
544Debug.Assert(length >= 0);
550Debug.Assert(value0 is not null && value1 is not null && value2 is not null);
669Debug.Assert(searchSpaceLength >= 0);
670Debug.Assert(valueLength >= 0);
738Debug.Assert(searchSpaceLength >= 0);
739Debug.Assert(valueLength >= 0);
757Debug.Assert(0 <= index && index <= searchSpaceLength); // Ensures no deceptive underflows in the computation of "remainingSearchSpaceLength".
784Debug.Assert(length >= 0);
788Debug.Assert(value is not null);
876Debug.Assert(length >= 0);
881Debug.Assert(value0 is not null && value1 is not null);
1000Debug.Assert(length >= 0);
1005Debug.Assert(value0 is not null && value1 is not null && value2 is not null);
1124Debug.Assert(searchSpaceLength >= 0);
1125Debug.Assert(valueLength >= 0);
1179Debug.Assert(length >= 0, "Expected non-negative length");
1194Debug.Assert(length >= 0, "Expected non-negative length");
1209Debug.Assert(length >= 0, "Expected non-negative length");
1225Debug.Assert(length >= 0, "Expected non-negative length");
1241Debug.Assert(length >= 0, "Expected non-negative length");
1259Debug.Assert(length >= 0, "Expected non-negative length");
1277Debug.Assert(length >= 0, "Expected non-negative length");
1296Debug.Assert(length >= 0, "Expected non-negative length");
1315Debug.Assert(length >= 0);
1442Debug.Assert(firstLength >= 0);
1443Debug.Assert(secondLength >= 0);
1474Debug.Assert(length >= 0, "Expected non-negative length");
1475Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types");
1661Debug.Assert(length >= 0, "Expected non-negative length");
1662Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types");
1895Debug.Assert(length >= 0, "Expected non-negative length");
1896Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
2136Debug.Assert(length >= 0, "Expected non-negative length");
2137Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
2362Debug.Assert(length >= 0, "Expected non-negative length");
2363Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
2535Debug.Assert(length >= 0, "Expected non-negative length");
2536Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
2711Debug.Assert(length >= 0, "Expected non-negative length");
2712Debug.Assert(value is byte or short or int or long, "Expected caller to normalize to one of these types");
2855Debug.Assert(length >= 0, "Expected non-negative length");
2856Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
3072Debug.Assert(length >= 0, "Expected non-negative length");
3073Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
3289Debug.Assert(length >= 0, "Expected non-negative length");
3290Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
3436Debug.Assert(oldValue is not null);
3466Debug.Assert(Vector128.IsHardwareAccelerated && Vector128<T>.IsSupported, "Vector128 is not HW-accelerated or not supported");
3523Debug.Assert(Vector512.IsHardwareAccelerated && Vector512<T>.IsSupported, "Vector512 is not HW-accelerated or not supported");
3561Debug.Assert(length >= 0, "Expected non-negative length");
3562Debug.Assert(value0 is byte or short or int or long, "Expected caller to normalize to one of these types");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Ascii.Utility.cs (87)
57Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort));
84Debug.Assert((mask != 0) ? index < 16 : index >= 16);
157Debug.Assert(0 < numBytesRead && numBytesRead <= Vector512.Size, "We should've made forward progress of at least one byte.");
158Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
161Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
165Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned.");
193Debug.Assert(0 < numBytesRead && numBytesRead <= Vector256.Size, "We should've made forward progress of at least one byte.");
194Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
197Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
201Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned.");
229Debug.Assert(0 < numBytesRead && numBytesRead <= Vector128.Size, "We should've made forward progress of at least one byte.");
230Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
233Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
237Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned.");
338Debug.Assert(!AllBytesInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input.");
353Debug.Assert(sseMask != uint.MaxValue);
354Debug.Assert(Sse2.IsSupported);
361Debug.Assert(advSimdIndex != uint.MaxValue);
362Debug.Assert(AdvSimd.IsSupported);
373Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Sse2 or AdvSimd64 required.");
374Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 implementation assumes little-endian.");
432Debug.Assert(0 < numBytesRead && numBytesRead <= SizeOfVector128, "We should've made forward progress of at least one byte.");
433Debug.Assert((nuint)numBytesRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
601Debug.Assert(ContainsNonAsciiByte_Sse2(currentSseMask), "Shouldn't be here unless we see non-ASCII data.");
606Debug.Assert(ContainsNonAsciiByte_AdvSimd(currentAdvSimdIndex), "Shouldn't be here unless we see non-ASCII data.");
619Debug.Assert(!AllBytesInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data.");
630Debug.Assert(bufferLength < SizeOfVector128);
761Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char));
782Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector512InChars, "We should've made forward progress of at least one char.");
783Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
786Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
790Debug.Assert((nuint)pBuffer % Vector512.Size == 0, "Vector read should be aligned.");
818Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector256InChars, "We should've made forward progress of at least one char.");
819Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
822Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
826Debug.Assert((nuint)pBuffer % Vector256.Size == 0, "Vector read should be aligned.");
853Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char.");
854Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
857Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
861Debug.Assert((nuint)pBuffer % Vector128.Size == 0, "Vector read should be aligned.");
940Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars.");
945Debug.Assert(!AllCharsInUInt32AreAscii(currentUInt32), "Shouldn't have reached this point if we have an all-ASCII input.");
974Debug.Assert(Sse2.IsSupported || AdvSimd.Arm64.IsSupported, "Should've been checked by caller.");
975Debug.Assert(BitConverter.IsLittleEndian, "This SSE2/Arm64 assumes little-endian.");
991Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char));
1021Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char.");
1022Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
1100Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count.");
1143Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-ASCII data.");
1168Debug.Assert(!AllCharsInUInt32AreAscii(currentDWord), "Shouldn't be here unless we see non-ASCII data.");
1186Debug.Assert(bufferLength < SizeOfVector128InChars);
1271Debug.Assert(AllCharsInUInt64AreAscii(value));
1326Debug.Assert(AllCharsInUInt32AreAscii(value));
1392Debug.Assert(currentOffset <= elementCount);
1508Debug.Assert(!AllCharsInUInt32AreAscii(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-ASCII input.");
1605Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort));
1616Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort));
1640Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort));
1658Debug.Assert(typeof(T) == typeof(byte) || typeof(T) == typeof(ushort));
1726Debug.Assert(Vector128.IsHardwareAccelerated, "Vector128 is required.");
1727Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian.");
1728Debug.Assert(elementCount >= 2 * SizeOfVector128);
1779Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector.");
1780Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer.");
1781Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector.");
1799Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned.");
1822Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned.");
1844Debug.Assert(Vector256.IsHardwareAccelerated, "Vector256 is required.");
1845Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian.");
1846Debug.Assert(elementCount >= 2 * Vector256.Size);
1896Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector256.Size, "We wrote at least 1 byte but no more than a whole vector.");
1897Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer.");
1898Debug.Assert(elementCount - currentOffsetInElements >= Vector256.Size, "We should be able to run at least one whole vector.");
1916Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Write should be aligned.");
1939Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector128.Size == 0, "Destination should be 128-bit-aligned.");
1961Debug.Assert(Vector512.IsHardwareAccelerated, "Vector512 is required.");
1962Debug.Assert(BitConverter.IsLittleEndian, "This implementation assumes little-endian.");
1963Debug.Assert(elementCount >= 2 * Vector512.Size);
2014Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= Vector512.Size, "We wrote at least 1 byte but no more than a whole vector.");
2015Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer.");
2016Debug.Assert(elementCount - currentOffsetInElements >= Vector512.Size, "We should be able to run at least one whole vector.");
2034Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector512.Size == 0, "Write should be aligned.");
2057Debug.Assert(((nuint)pAsciiBuffer + currentOffsetInElements) % Vector256.Size == 0, "Destination should be 256-bit-aligned.");
2095Debug.Assert(currentOffset <= elementCount);
2167Debug.Assert(!AllBytesInUInt32AreAscii(asciiData), "Shouldn't have reached this point if we have an all-ASCII input.");
2266Debug.Assert(typeof(TVectorByte) == typeof(Vector128<byte>));
2280Debug.Assert(AllBytesInUInt32AreAscii(value));
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\ASCIIEncoding.cs (14)
157Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
158Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
350Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
351Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
352Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
353Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
409Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
499Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
500Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
641Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
642Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
643Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
644Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
697Debug.Assert(idx <= numElementsToConvert, "Somehow went beyond bounds of source or destination buffer?");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Encoding.Internal.cs (73)
76Debug.Fail("This should be overridden by a subclassed type.");
82Debug.Fail("This should be overridden by a subclassed type.");
114Debug.Fail("This should be overridden by a subclassed type.");
124Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS.");
125Debug.Assert(charCount >= 0, "Caller should've checked this condition.");
126Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count.");
207Debug.Fail("This should be overridden by a subclassed type.");
232Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method.");
258Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS.");
259Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition.");
313Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer.");
314Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter.");
348Debug.Assert(byteCountThisIteration >= 0, "Fallback shouldn't have returned a negative value.");
349Debug.Assert(charsConsumedThisIteration >= 0, "Fallback shouldn't have returned a negative value.");
371Debug.Assert(byteCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
372Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
386Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetByteCount.");
401Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS.");
402Debug.Assert(charCount >= 0, "Caller should've checked this condition.");
403Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count.");
404Debug.Assert(byteCount >= 0, "Caller should've checked this condition.");
405Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count.");
470Debug.Fail("This should be overridden by a subclassed type.");
495Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar < originalCharCount, "Invalid arguments provided to method.");
496Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Invalid arguments provided to method.");
525Debug.Assert(encoder != null, "This code path should only be called from EncoderNLS.");
526Debug.Assert(0 <= charsConsumedSoFar && charsConsumedSoFar <= originalCharCount, "Caller should've checked this condition.");
527Debug.Assert(0 <= bytesWrittenSoFar && bytesWrittenSoFar <= originalByteCount, "Caller should've checked this condition.");
589Debug.Assert(!chars.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer.");
590Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter.");
591Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter.");
609Debug.Assert(charsConsumedThisIteration == chars.Length, "If returning NeedMoreData, should out the entire buffer length as chars consumed.");
659Debug.Assert(bytesWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
660Debug.Assert(charsConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
689Debug.Assert(encoder is null);
698Debug.Assert(originalCharsLength >= chars.Length, "About to report a negative number of chars used?");
702Debug.Assert(fallbackBuffer.Remaining == 0 || encoder != null, "Shouldn't have any leftover data in fallback buffer unless an EncoderNLS is in use.");
717Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS.");
718Debug.Assert(byteCount >= 0, "Caller should've checked this condition.");
719Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count.");
726Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Fallback buffer can't hold data between GetChars invocations.");
801Debug.Fail("This should be overridden by a subclassed type.");
826Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method.");
852Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS.");
853Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition.");
913Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer.");
914Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter.");
945Debug.Assert(charCountThisIteration >= 0, "Fallback shouldn't have returned a negative value.");
967Debug.Assert(charCountThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
968Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
982Debug.Assert(fallbackBuffer.Remaining == 0, "There should be no data in the fallback buffer after GetCharCount.");
997Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS.");
998Debug.Assert(byteCount >= 0, "Caller should've checked this condition.");
999Debug.Assert(pBytes != null || byteCount == 0, "Cannot provide a null pointer and a non-zero count.");
1000Debug.Assert(charCount >= 0, "Caller should've checked this condition.");
1001Debug.Assert(pChars != null || charCount == 0, "Cannot provide a null pointer and a non-zero count.");
1066Debug.Fail("This should be overridden by a subclassed type.");
1091Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar < originalByteCount, "Invalid arguments provided to method.");
1092Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Invalid arguments provided to method.");
1121Debug.Assert(decoder != null, "This code path should only be called from DecoderNLS.");
1122Debug.Assert(0 <= bytesConsumedSoFar && bytesConsumedSoFar <= originalByteCount, "Caller should've checked this condition.");
1123Debug.Assert(0 <= charsWrittenSoFar && charsWrittenSoFar <= originalCharCount, "Caller should've checked this condition.");
1147Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0, "Should be no remaining fallback data at this point.");
1190Debug.Assert(!bytes.IsEmpty, "Caller shouldn't invoke this method with an empty input buffer.");
1191Debug.Assert(originalBytesLength >= 0, "Caller provided invalid parameter.");
1192Debug.Assert(originalCharsLength >= 0, "Caller provided invalid parameter.");
1211Debug.Assert(bytesConsumedThisIteration == bytes.Length, "If returning NeedMoreData, should out the entire buffer length as bytes consumed.");
1228Debug.Assert(charsWrittenThisIteration >= 0, "Fallback shouldn't have returned a negative value.");
1259Debug.Assert(charsWrittenThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
1260Debug.Assert(bytesConsumedThisIteration >= 0, "Workhorse shouldn't have returned a negative value.");
1273Debug.Assert(fallbackBuffer.Remaining == 0);
1286Debug.Assert(decoder is null);
1295Debug.Assert(originalBytesLength >= bytes.Length, "About to report a negative number of bytes used?");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Encoding.cs (10)
109Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
110Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
296Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
297Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
298Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
299Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
602Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
603Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
604Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
605Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Latin1Utility.cs (33)
41Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char));
64Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVectorInChars, "We should've made forward progress of at least one char.");
65Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
68Debug.Assert(pBuffer <= pFinalVectorReadPos, "Should be able to read at least one vector.");
72Debug.Assert((nuint)pBuffer % SizeOfVectorInChars == 0, "Vector read should be aligned.");
150Debug.Assert(totalNumBytesRead % sizeof(char) == 0, "Total number of bytes read should be even since we're working with chars.");
155Debug.Assert(!AllCharsInUInt32AreLatin1(currentUInt32), "Shouldn't have reached this point if we have an all-Latin-1 input.");
185Debug.Assert(Sse2.IsSupported, "Should've been checked by caller.");
186Debug.Assert(BitConverter.IsLittleEndian, "SSE2 assumes little-endian.");
205Debug.Assert(bufferLength <= nuint.MaxValue / sizeof(char));
241Debug.Assert(0 < numCharsRead && numCharsRead <= SizeOfVector128InChars, "We should've made forward progress of at least one char.");
242Debug.Assert((nuint)numCharsRead <= bufferLength, "We shouldn't have read past the end of the input buffer.");
371Debug.Assert(((nuint)pBuffer - (nuint)pOriginalBuffer) % 2 == 0, "Shouldn't have incremented any pointer by an odd byte count.");
426Debug.Assert(currentMask != 0, "Shouldn't be here unless we see non-Latin-1 data.");
434Debug.Assert(!AllCharsInUInt32AreLatin1(currentDWord), "Shouldn't be here unless we see non-Latin-1 data.");
452Debug.Assert(bufferLength < SizeOfVector128InChars);
551Debug.Assert(BitConverter.IsLittleEndian, "Assume little endian if SSE2 is supported.");
631Debug.Assert(currentOffset <= elementCount);
747Debug.Assert(!AllCharsInUInt32AreLatin1(utf16Data32BitsHigh), "Shouldn't have reached this point if we have an all-Latin-1 input.");
780Debug.Assert(Sse2.IsSupported);
781Debug.Assert(BitConverter.IsLittleEndian);
782Debug.Assert(elementCount >= 2 * SizeOfVector128);
863Debug.Assert(0 < currentOffsetInElements && currentOffsetInElements <= SizeOfVector128, "We wrote at least 1 byte but no more than a whole vector.");
865Debug.Assert(currentOffsetInElements <= elementCount, "Shouldn't have overrun the destination buffer.");
866Debug.Assert(elementCount - currentOffsetInElements >= SizeOfVector128, "We should be able to run at least one whole vector.");
899Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % SizeOfVector128 == 0, "Write should be aligned.");
934Debug.Assert(((nuint)pLatin1Buffer + currentOffsetInElements) % sizeof(ulong) == 0, "Destination should be ulong-aligned.");
972Debug.Assert(Sse2.IsSupported);
973Debug.Assert(BitConverter.IsLittleEndian);
998Debug.Assert(0 < currentOffset && currentOffset <= SizeOfVector128 / sizeof(char));
1028Debug.Assert(elementCount - currentOffset < SizeOfVector128, "Case where 2 vectors remained should've been in the hot loop.");
1072Debug.Assert(!Sse2.IsSupported);
1099Debug.Assert(elementCount - currentOffset < SizeOfVector, "Vectorized logic should result in less than a vector's length of data remaining.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\StringBuilder.cs (64)
240Debug.Assert(m_ChunkOffset + m_ChunkChars.Length >= m_ChunkOffset, "The length of the string is greater than int.MaxValue.");
247Debug.Assert(currentBlock.m_MaxCapacity == maxCapacity);
248Debug.Assert(currentBlock.m_ChunkChars != null);
250Debug.Assert(currentBlock.m_ChunkLength <= currentBlock.m_ChunkChars.Length);
251Debug.Assert(currentBlock.m_ChunkLength >= 0);
252Debug.Assert(currentBlock.m_ChunkOffset >= 0);
257Debug.Assert(currentBlock.m_ChunkOffset == 0);
261Debug.Assert(currentBlock.m_ChunkOffset == prevBlock.m_ChunkOffset + prevBlock.m_ChunkLength);
471Debug.Assert(newLen == chunk.m_ChunkChars.Length, "The new chunk should be larger or equal to the one it is replacing.");
481Debug.Assert(Length == value, "Something went wrong setting Length.");
576Debug.Assert(next.m_ChunkPrevious != null);
602Debug.Assert(stringBuilder != null);
655Debug.Assert(stringBuilder != null);
709Debug.Assert(repeatCount > 0, "Invalid length; should have been validated by caller.");
731Debug.Assert(m_ChunkLength == 0, "A new block was not created.");
874Debug.Assert(m_ChunkLength == 0 && m_ChunkChars.Length >= count);
930Debug.Assert(chunk != null);
982Debug.Assert(insertingChars + this.Length < int.MaxValue);
1050Debug.Assert(m_ChunkLength == 0, "A new block was not created.");
1097Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known");
1110Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known");
1276Debug.Assert(values != null);
1277Debug.Assert(!Unsafe.IsNullRef(ref separator));
1278Debug.Assert(separatorLength >= 0);
1468Debug.Assert(typeof(T).Assembly.Equals(typeof(object).Assembly), "Implementation trusts the results of TryFormat because T is expected to be something known");
1640Debug.Assert(format[pos - 1] == '{');
1641Debug.Assert(ch != '{');
1744Debug.Assert(format[pos] == '}');
1972Debug.Assert(index > 2);
2061Debug.Assert(thisChunk != null && sbChunk != null);
2098Debug.Assert(offset == Length);
2153Debug.Assert(chunk != null, "chunk was null in replace");
2177Debug.Assert(count >= 0, "count should never go negative");
2195Debug.Assert(oldValue.Length > Math.Min(count, chunk.m_ChunkLength - indexInChunk),
2215Debug.Assert(indexInChunk >= chunk.m_ChunkLength || count == 0,
2233Debug.Assert(chunk != null || count == 0, "Chunks ended prematurely!");
2293Debug.Assert(chunk.m_ChunkPrevious != null);
2353Debug.Assert(valueCount >= 0, "Invalid length; should have been validated by caller.");
2405Debug.Assert(m_ChunkLength == 0, "A new block was not created.");
2422Debug.Assert((uint)index <= (uint)Length, "Callers should check that index is a legal value.");
2443Debug.Assert(!replacements.IsEmpty);
2476Debug.Assert(gapStart < sourceChunk.m_ChunkChars.Length, "gap starts at end of buffer. Should not happen");
2477Debug.Assert(gapStart <= gapEnd, "negative gap size");
2478Debug.Assert(gapEnd <= sourceChunk.m_ChunkLength, "gap too big");
2487Debug.Assert(targetIndexInChunk <= targetChunk.m_ChunkLength, "gap not in chunk");
2556Debug.Assert(chunk != null, "chunk should not be null at this point");
2558Debug.Assert(lengthInChunk >= 0, "Index isn't in the chunk.");
2590Debug.Assert(0 <= index && index <= Length);
2595Debug.Assert(result.m_ChunkPrevious != null);
2599Debug.Assert(result != null);
2632Debug.Assert(Capacity == Length, nameof(ExpandByABlock) + " should only be called when there is no space left.");
2633Debug.Assert(minBlockCharCount > 0);
2723Debug.Assert(count > 0);
2724Debug.Assert(index >= 0);
2735Debug.Assert(chunk.m_ChunkPrevious != null);
2792Debug.Assert(size > 0);
2793Debug.Assert(maxCapacity > 0);
2818Debug.Assert(startIndex >= 0 && startIndex < Length);
2846Debug.Assert(chunk.m_ChunkPrevious != null);
2849Debug.Assert(chunk != null, "We fell off the beginning of the string!");
2881Debug.Assert(chunk != null, "We fell off the beginning of the string!");
3281Debug.Assert(_hasCustomFormatter);
3282Debug.Assert(_provider != null);
3285Debug.Assert(formatter != null, "An incorrectly written provider said it implemented ICustomFormatter, and then didn't");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\Unicode\Utf8Utility.Transcoding.cs (18)
26Debug.Assert(inputLength >= 0, "Input length must not be negative.");
27Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null.");
29Debug.Assert(outputCharsRemaining >= 0, "Destination length must not be negative.");
30Debug.Assert(pOutputBuffer != null || outputCharsRemaining == 0, "Destination length must be zero if destination buffer pointer is null.");
66Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer);
76Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read.");
136Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(secondDWord));
154Debug.Assert(!Ascii.AllBytesInUInt32AreAscii(thisDWord)); // this should have been handled earlier
226Debug.Assert(outputCharsRemaining == 1);
846Debug.Assert(inputLength >= 0, "Input length must not be negative.");
847Debug.Assert(pInputBuffer != null || inputLength == 0, "Input length must be zero if input buffer pointer is null.");
849Debug.Assert(outputBytesRemaining >= 0, "Destination length must not be negative.");
850Debug.Assert(pOutputBuffer != null || outputBytesRemaining == 0, "Destination length must be zero if destination buffer pointer is null.");
902Debug.Assert(pInputBuffer <= pFinalPosWhereCanReadDWordFromInputBuffer);
912Debug.Assert(pLastBufferPosProcessed < pInputBuffer, "Algorithm should've made forward progress since last read.");
1096Debug.Assert(!Utf16Utility.AllCharsInUInt64AreAscii(possibleNonAsciiQWord)); // this condition should've been checked earlier
1164Debug.Assert(!Utf16Utility.AllCharsInUInt32AreAscii(thisDWord)); // this should have been handled earlier
1441Debug.Assert(inputLength < CharsPerDWord);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UnicodeEncoding.cs (32)
347Debug.Assert(chars is not null, "[UnicodeEncoding.GetByteCount]chars!=null");
348Debug.Assert(count >= 0, "[UnicodeEncoding.GetByteCount]count >=0");
491Debug.Assert(chars > charStart,
559Debug.Assert(chars > charStart,
626Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
636Debug.Assert(chars is not null, "[UnicodeEncoding.GetBytes]chars!=null");
637Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetBytes]byteCount >=0");
638Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetBytes]charCount >=0");
639Debug.Assert(bytes is not null, "[UnicodeEncoding.GetBytes]bytes!=null");
776Debug.Assert(chars > charStart,
844Debug.Assert(chars > charStart + 1 || bytes == byteStart,
873Debug.Assert(chars > charStart,
908Debug.Assert(chars > charStart,
975Debug.Assert((encoder is not null && !encoder.MustFlush) || charLeftOver == (char)0,
978Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0 ||
987Debug.Assert(bytes is not null, "[UnicodeEncoding.GetCharCount]bytes!=null");
988Debug.Assert(count >= 0, "[UnicodeEncoding.GetCharCount]count >=0");
1022Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1293Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
1302Debug.Assert(chars is not null, "[UnicodeEncoding.GetChars]chars!=null");
1303Debug.Assert(byteCount >= 0, "[UnicodeEncoding.GetChars]byteCount >=0");
1304Debug.Assert(charCount >= 0, "[UnicodeEncoding.GetChars]charCount >=0");
1305Debug.Assert(bytes is not null, "[UnicodeEncoding.GetChars]bytes!=null");
1321Debug.Assert(!decoder.InternalHasFallbackBuffer || decoder.FallbackBuffer.Remaining == 0,
1473Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1522Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1539Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1581Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1598Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1643Debug.Assert(bytes >= byteStart + 2 || chars == charStart,
1699Debug.Assert(!decoder.MustFlush || ((lastChar == (char)0) && (lastByte == -1)),
1709Debug.Assert(fallbackBuffer is null || fallbackBuffer.Remaining == 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF32Encoding.cs (26)
355Debug.Assert(chars is not null, "[UTF32Encoding.GetByteCount]chars!=null");
356Debug.Assert(count >= 0, "[UTF32Encoding.GetByteCount]count >=0");
419Debug.Assert(chars > charStart,
477Debug.Assert(fallbackBuffer.Remaining == 0,
487Debug.Assert(chars is not null, "[UTF32Encoding.GetBytes]chars!=null");
488Debug.Assert(bytes is not null, "[UTF32Encoding.GetBytes]bytes!=null");
489Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetBytes]byteCount >=0");
490Debug.Assert(charCount >= 0, "[UTF32Encoding.GetBytes]charCount >=0");
560Debug.Assert(chars > charStart + 1 || bytes == byteStart,
588Debug.Assert(chars > charStart,
633Debug.Assert(chars > charStart,
670Debug.Assert(highSurrogate == 0 || (encoder is not null && !encoder.MustFlush),
688Debug.Assert(bytes is not null, "[UTF32Encoding.GetCharCount]bytes!=null");
689Debug.Assert(count >= 0, "[UTF32Encoding.GetCharCount]count >=0");
714Debug.Assert(fallbackBuffer.Remaining == 0,
821Debug.Assert(fallbackBuffer.Remaining == 0,
831Debug.Assert(chars is not null, "[UTF32Encoding.GetChars]chars!=null");
832Debug.Assert(bytes is not null, "[UTF32Encoding.GetChars]bytes!=null");
833Debug.Assert(byteCount >= 0, "[UTF32Encoding.GetChars]byteCount >=0");
834Debug.Assert(charCount >= 0, "[UTF32Encoding.GetChars]charCount >=0");
858Debug.Assert(baseDecoder is not null);
863Debug.Assert(fallbackBuffer.Remaining == 0,
928Debug.Assert(bytes >= byteStart + 4 || chars == charStart,
951Debug.Assert(bytes >= byteStart + 4 || chars == charStart,
968Debug.Assert(bytes >= byteStart + 4 || chars == charStart,
1036Debug.Assert(fallbackBuffer.Remaining == 0,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF7Encoding.cs (15)
62Debug.Assert(_base64Bytes.Length == 64);
391Debug.Assert(chars is not null, "[UTF7Encoding.GetByteCount]chars!=null");
392Debug.Assert(count >= 0, "[UTF7Encoding.GetByteCount]count >=0");
401Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetBytes]byteCount >=0");
402Debug.Assert(chars is not null, "[UTF7Encoding.GetBytes]chars!=null");
403Debug.Assert(charCount >= 0, "[UTF7Encoding.GetBytes]charCount >=0");
540Debug.Assert(count >= 0, "[UTF7Encoding.GetCharCount]count >=0");
541Debug.Assert(bytes is not null, "[UTF7Encoding.GetCharCount]bytes!=null");
550Debug.Assert(byteCount >= 0, "[UTF7Encoding.GetChars]byteCount >=0");
551Debug.Assert(bytes is not null, "[UTF7Encoding.GetChars]bytes!=null");
552Debug.Assert(charCount >= 0, "[UTF7Encoding.GetChars]charCount >=0");
571Debug.Assert(!firstByte || decoder.bitCount <= 0,
849Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.Fallback] Can't have recursive fallbacks");
850Debug.Assert(bytesUnknown.Length == 1, "[DecoderUTF7FallbackBuffer.Fallback] Only possible fallback case should be 1 unknown byte");
902Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Text\UTF8Encoding.cs (12)
206Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
207Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
396Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
397Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
398Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
399Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
598Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
599Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
600Debug.Assert(charCount >= 0, "Caller shouldn't specify negative length buffer.");
601Debug.Assert(pChars is not null || charCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
716Debug.Assert(byteCount >= 0, "Caller shouldn't specify negative length buffer.");
717Debug.Assert(pBytes is not null || byteCount == 0, "Input pointer shouldn't be null if non-zero length specified.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\CancellationTokenSource.cs (22)
327Debug.Assert(IsCancellationRequested);
346Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished");
589Debug.Assert(this != s_neverCanceledSource, "This source should never be exposed via a CancellationToken.");
590Debug.Assert(callback is Action<object?> || callback is Action<object?, CancellationToken>);
625Debug.Assert(node.Prev == null, "Nodes in the free list should all have a null Prev");
677Debug.Assert(id != 0, "IDs should never be the reserved value 0.");
695Debug.Assert(IsCancellationCompleted, "Expected cancellation to have finished");
731Debug.Assert(IsCancellationRequested, "ExecuteCallbackHandlers should only be called after setting IsCancellationRequested->true");
768Debug.Assert(node.Registrations.Source == this);
769Debug.Assert(node.Prev == null);
829Debug.Assert(exceptionList.Count > 0, $"Expected {exceptionList.Count} > 0");
938Debug.Assert(s is CancellationTokenSource, $"Expected {typeof(CancellationTokenSource)}, got {s}");
982Debug.Assert(d is Action<object?> || d is Action<object?, CancellationToken>);
1028Debug.Assert(_locked);
1050Debug.Assert(node != null, "Expected non-null node");
1051Debug.Assert(node.Registrations == this, "Expected node to come from this registrations instance");
1079Debug.Assert(node.Prev == null);
1084Debug.Assert(node.Prev != null);
1175Debug.Assert(_locked);
1195Debug.Assert(registrations != null, "Expected non-null parent registrations");
1204Debug.Assert(Callback != null);
1212Debug.Assert(node.Callback != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ExecutionContext.cs (24)
88Debug.Assert(Thread.CurrentThread == currentThread);
101Debug.Assert(isFlowSuppressed != m_isFlowSuppressed);
267Debug.Assert(threadPoolThread == Thread.CurrentThread);
315Debug.Assert(executionContext != null && !executionContext.m_isDefault, "ExecutionContext argument is Default.");
331Debug.Assert(currentThread == Thread.CurrentThread);
332Debug.Assert(contextToRestore != currentContext);
367Debug.Assert(!RuntimeFeature.IsMultithreadingSupported || Thread.CurrentThread.IsThreadPoolThread); // there are no dedicated threadpool threads on runtimes where we can't start threads
368Debug.Assert(Thread.CurrentThread._executionContext == null, "ThreadPool thread not on Default ExecutionContext.");
369Debug.Assert(Thread.CurrentThread._synchronizationContext == null, "ThreadPool thread not on Default SynchronizationContext.");
374Debug.Assert(previousExecutionCtx != nextExecutionCtx);
381Debug.Assert(previousChangeNotifications != null || nextChangeNotifications != null);
389Debug.Assert(previousExecutionCtx!.m_localValues != null);
390Debug.Assert(nextExecutionCtx!.m_localValues != null);
424Debug.Assert(previousExecutionCtx!.m_localValues != null);
438Debug.Assert(nextExecutionCtx!.m_localValues != null);
473Debug.Assert(!current.IsDefault);
474Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context");
487Debug.Assert(!current.IsDefault);
488Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context");
510Debug.Assert(!current.IsDefault);
511Debug.Assert(current.m_localValues != null, "Only the default context should have null, and we shouldn't be here on the default context");
530Debug.Assert(newChangeNotifications != null);
531Debug.Assert(Array.IndexOf(newChangeNotifications, local) >= 0);
573Debug.Assert(currentThread == Thread.CurrentThread);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\SemaphoreSlim.cs (14)
370Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't");
402Debug.Assert(!waitSuccessful || m_currentCount > 0,
700Debug.Assert(m_currentCount == 0, "m_currentCount should never be negative");
713Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held");
721Debug.Assert(m_asyncTail is null, "If head is null, so too should be tail");
727Debug.Assert(m_asyncTail is not null, "If head is not null, neither should be tail");
742Debug.Assert(task is not null, "Expected non-null task");
743Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held");
753Debug.Assert((m_asyncHead is null) == (m_asyncTail is null), "Head is null iff tail is null");
769Debug.Assert(asyncWaiter is not null, "Waiter should have been constructed");
770Debug.Assert(Monitor.IsEntered(m_lockObjAndDisposed), "Requires the lock be held");
861Debug.Assert(m_countOfWaitersPulsedToWake <= waitCount);
889Debug.Assert(m_asyncTail is not null, "tail should not be null if head isn't null");
963Debug.Assert(obj is SemaphoreSlim, "Expected a SemaphoreSlim");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ConcurrentExclusiveSchedulerPair.cs (26)
200Debug.Assert(ReadyToComplete, "The block must be ready to complete to be here.");
211Debug.Assert(state is ConcurrentExclusiveSchedulerPair);
213Debug.Assert(!localThis.m_completionState!.IsCompleted, "Completion should only happen once.");
219Debug.Assert(success, "Expected to complete completion task.");
230Debug.Assert(faultedTask != null && faultedTask.IsFaulted && faultedTask.Exception!.InnerExceptionCount > 0,
340else Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing count must be the sentinel if it's not >= 0.");
364Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "Processing exclusive tasks requires being in exclusive mode.");
365Debug.Assert(!m_exclusiveTaskScheduler.m_tasks.IsEmpty, "Processing exclusive tasks requires tasks to be processed.");
370Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing,
388Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingExclusiveTask,
399Debug.Assert(m_processingCount == EXCLUSIVE_PROCESSING_SENTINEL, "The processing mode should not have deviated from exclusive.");
412Debug.Assert(m_processingCount > 0, "Processing concurrent tasks requires us to be in concurrent mode.");
417Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.NotCurrentlyProcessing,
446Debug.Assert(m_threadProcessingMode.Value == ProcessingMode.ProcessingConcurrentTasks,
457Debug.Assert(m_processingCount > 0, "The procesing mode should not have deviated from concurrent.");
524Debug.Assert(pair != null, "Scheduler must be associated with a valid pair.");
525Debug.Assert(processingMode == ProcessingMode.ProcessingConcurrentTasks || processingMode == ProcessingMode.ProcessingExclusiveTask,
527Debug.Assert(
547Debug.Assert(task != null, "Infrastructure should have provided a non-null task.");
563Debug.Assert(task != null, "Infrastructure should have provided a non-null task.");
573Debug.Assert(task != null, "Infrastructure should have provided a non-null task.");
647Debug.Assert(t.IsFaulted, "Task should be faulted due to the scheduler faulting it and throwing the exception.");
671Debug.Assert(scheduler != null, "Need a scheduler with which to construct the debug view.");
694Debug.Assert(pair != null, "Need a pair with which to construct the debug view.");
734Debug.Assert(syncObj != null, "The monitor object to check must be provided.");
735Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\Task.cs (123)
195Debug.Assert(task != null, "Null Task objects can't be added to the ActiveTasks collection");
473Debug.Assert(promiseStyle, "Promise CTOR: promiseStyle was false");
667Debug.Assert(m_contingentProperties == null || m_contingentProperties.m_capturedContext == null,
711Debug.Assert(illegalInternalOptions == 0, "TaskConstructorCore: Illegal internal options");
715Debug.Assert(m_stateFlags == 0, "TaskConstructorCore: non-zero m_stateFlags");
716Debug.Assert((((int)creationOptions) | (int)TaskStateFlags.OptionsMask) == (int)TaskStateFlags.OptionsMask, "TaskConstructorCore: options take too many bits");
743Debug.Assert((internalOptions & InternalTaskOptions.ContinuationTask) == 0, "TaskConstructorCore: Did not expect to see cancelable token for continuation task.");
785Debug.Assert(continuation != null);
831Debug.Assert(((int)TaskStateFlags.OptionsMask & 1) == 1, "OptionsMask needs a shift in Options.get");
886Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0,
894Debug.Assert(success, "Tried to set enabled on completed Task");
924Debug.Assert(tasks != null, "Expected non-null array of tasks");
961Debug.Assert(isWaitNotificationEnabled, "Should only be called if the wait completion bit is set.");
980Debug.Assert(IsWaitNotificationEnabled, "Should only be called if the wait completion bit is set.");
1021Debug.Assert(InternalCurrent == this, "Task.AddNewChild(): Called from an external context");
1042Debug.Assert(InternalCurrent == this, "Task.DisregardChild(): Called from an external context");
1045Debug.Assert(props.m_completionCountdown >= 2, "Task.DisregardChild(): Expected parent count to be >= 2");
1190Debug.Assert(scheduler != null, "Task.InternalRunSynchronously(): null TaskScheduler");
1261Debug.Assert(
1278Debug.Assert((m_stateFlags & (int)TaskStateFlags.Canceled) != 0, "Task.RunSynchronously: expected TaskStateFlags.Canceled to be set");
1408Debug.Assert((e == null) || IsFaulted, "Task.Exception_get(): returning non-null value when not Faulted");
1812Debug.Assert(m_taskScheduler != null, "expected a task scheduler to have been selected");
1813Debug.Assert((m_stateFlags & (int)TaskStateFlags.Started) == 0, "task has already started");
1861Debug.Assert(
1881Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object");
1892Debug.Assert(exceptionObject != null, "Task.AddException: Expected a non-null exception object");
1900Debug.Assert(
1906Debug.Assert(
1998Debug.Assert(m_contingentProperties != null && m_contingentProperties.m_exceptionsHolder != null, "ExceptionRecorded should imply this");
2016Debug.Assert(IsFaulted && ExceptionRecorded, "Must only be used when the task has faulted with exceptions.");
2024Debug.Assert(IsCanceled, "Must only be used when the task has canceled.");
2039Debug.Assert(IsCompleted, "ThrowIfExceptional(): Expected IsCompleted == true");
2144Debug.Assert(userDelegateExecute || m_contingentProperties != null);
2306Debug.Assert(childTask != null);
2307Debug.Assert(childTask.IsCompleted, "ProcessChildCompletion was called for an uncompleted task");
2309Debug.Assert(childTask.m_contingentProperties?.m_parent == this, "ProcessChildCompletion should only be called for a child of this task");
2351Debug.Assert(props != null);
2369Debug.Assert(task.IsCompleted, "Expected all tasks in list to be completed");
2373Debug.Assert(exceptionHolder != null);
2536Debug.Assert(obj is Task);
2547Debug.Assert(m_action != null, "Null action in InnerInvoke()");
2559Debug.Fail("Invalid m_action in Task");
2569Debug.Assert(unhandledException != null);
2641Debug.Assert(continuationAction != null);
2686Debug.Assert(!flowExecutionContext, "We already determined we're not required to flow context.");
2712Debug.Assert(stateMachineBox != null);
2785Debug.Assert(waitResult, "expected wait to succeed");
2941Debug.Assert((m_stateFlags & (int)TaskStateFlags.Faulted) == 0, "Task.Wait() completing when in Faulted state.");
3018Debug.Assert(source != null);
3019Debug.Assert(millisecondsDelay != 0);
3073Debug.Assert(completingTask.IsCompleted);
3165Debug.Assert(IsCompleted || millisecondsTimeout != Timeout.Infinite);
3328Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) == 0, "Task.InternalCancel() did not expect promise-style task");
3400Debug.Assert((m_stateFlags & IllegalFlags) == 0, "The continuation was in an invalid state.");
3401Debug.Assert((m_stateFlags & (int)TaskStateFlags.WaitingForActivation) != 0, "Expected continuation to be waiting for activation");
3402Debug.Assert(m_contingentProperties is null || m_contingentProperties.m_cancellationToken == default);
3420Debug.Assert((Options & (TaskCreationOptions)InternalTaskOptions.PromiseTask) != 0, "Task.RecordInternalCancellationRequest(CancellationToken) only valid for promise-style task");
3423Debug.Assert(m_contingentProperties!.m_cancellationToken == default);
3440Debug.Assert(edi != null, "Expected either an OCE or an EDI");
3442Debug.Assert(oce != null, "Expected EDI to contain an OCE");
3444Debug.Assert(oce.CancellationToken == tokenToRecord,
3455Debug.Assert((m_stateFlags & ((int)TaskStateFlags.Canceled | (int)TaskStateFlags.CompletionReserved)) != 0, "Task.CancellationCleanupLogic(): Task not canceled or reserved.");
3487Debug.Assert(this == InternalCurrent, "SetCancellationAcknowledged() should only be called while this is still the current task");
3488Debug.Assert(IsCancellationRequested, "SetCancellationAcknowledged() should not be called if the task's CT wasn't signaled");
3525Debug.Assert(exceptionObject != null, "Expected non-null exceptionObject argument");
3528Debug.Assert(
3570Debug.Assert(
3616Debug.Assert(continuationObject != null);
3736Debug.Assert(currentContinuation is TaskContinuation);
3779Debug.Assert(currentContinuation is ITaskCompletionAction);
4638Debug.Assert(continuationTask != null, "Task.ContinueWithCore(): null continuationTask");
4639Debug.Assert(scheduler != null, "Task.ContinueWithCore(): null scheduler");
4640Debug.Assert(!continuationTask.IsCompleted, "Did not expect continuationTask to be completed");
4725Debug.Assert(tc != null, "Expected non-null tc object in AddTaskContinuationComplex");
4728Debug.Assert(oldValue is not null, "Expected non-null m_continuationObject object");
4764Debug.Assert(oldValue == s_taskCompletionSentinel, "Expected m_continuationObject to be list or sentinel");
4802Debug.Assert(tc != null);
4898Debug.Assert(waitResult, "expected wait to succeed");
4918Debug.Assert(waitResult, "expected wait to succeed");
5224Debug.Assert(exceptions != null, "Should have seen at least one exception");
5250Debug.Assert(tasks != null, "Expected a non-null list of tasks");
5251Debug.Assert(tasks.Count > 0, "Expected at least one task");
5299Debug.Assert(count > 0, "Expected count > 0");
5306Debug.Assert(_count >= 0, "Count should never go below 0");
5349Debug.Assert(tasks.Length == 0 || waitResult != -1, "expected wait to succeed");
5526Debug.Assert(firstCompleted.Status == TaskStatus.RanToCompletion);
5528Debug.Assert(signaledTaskIndex >= 0);
5614Debug.Assert(succeeded, "This should always succeed on a new task.");
5628Debug.Assert(succeeded, "This should always succeed on a new task.");
5658Debug.Assert(exception != null);
5662Debug.Assert(succeeded, "This should always succeed on a new task.");
5672Debug.Assert(exception != null);
5676Debug.Assert(succeeded, "This should always succeed on a new task.");
5965Debug.Assert(millisecondsDelay != 0);
6024Debug.Assert(token.CanBeCanceled);
6222Debug.Assert(tasks.Length != 0, "Expected a non-zero length task array");
6223Debug.Assert(m_stateObject is null, "Expected to be able to use the state object field for faulted/canceled tasks.");
6298Debug.Assert(failedOrCanceled is Task, $"Expected Task, got {failedOrCanceled}");
6307Debug.Assert(failedOrCanceled is List<Task>);
6330Debug.Assert(completed);
6362Debug.Assert(failedOrCanceled is Task);
6368Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception");
6380Debug.Assert(IsCompleted);
6383Debug.Assert(_remainingToComplete >= 0, "Count should never go below 0");
6576Debug.Assert(tasks != null, "Expected a non-null task array");
6577Debug.Assert(tasks.Length > 0, "Expected a non-zero length task array");
6615Debug.Assert(task != null, "Constituent task in WhenAll should never be null");
6628Debug.Assert(task.Status == TaskStatus.RanToCompletion);
6640Debug.Assert(observedExceptions.Count > 0, "Expected at least one exception");
6661Debug.Assert(m_count >= 0, "Count should never go below 0");
6802Debug.Assert(task1 != null && task2 != null);
6838Debug.Assert(task1 != null && task2 != null);
6839Debug.Assert(task1.IsCompleted || task2.IsCompleted);
6862Debug.Assert(success, "Only one task should have gotten to this point, and thus this must be successful.");
7110Debug.Assert(_waitForNextCompletedTask.GetStatus(_waitForNextCompletedTask.Version) == ValueTaskSourceStatus.Pending);
7231Debug.Assert(outerTask != null);
7576Debug.Assert(outerTask != null, "Expected non-null outerTask");
7630Debug.Assert(result, "Expected TrySetFromTask from inner task to succeed");
7633Debug.Fail("UnwrapPromise in illegal state");
7657Debug.Assert(task != null && task.IsCompleted, "Expected non-null, completed outer task");
7658Debug.Assert(_state == STATE_WAITING_ON_OUTER_TASK, "We're in the wrong state!");
7670Debug.Assert(result, "Expected TrySetFromTask from outer task to succeed");
7687Debug.Assert(task != null && task.IsCompleted, "TrySetFromTask: Expected task to have completed.");
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskContinuation.cs (36)
18Debug.Assert(action is Action<Task> || action is Action<Task, object?>,
31Debug.Assert(antecedent != null,
39Debug.Assert(m_action != null);
51Debug.Fail("Invalid m_action in ContinuationTaskFromTask");
64Debug.Assert(function is Func<Task, TResult> || function is Func<Task, object?, TResult>,
77Debug.Assert(antecedent != null,
85Debug.Assert(m_action != null);
97Debug.Fail("Invalid m_action in ContinuationResultTaskFromTask");
110Debug.Assert(action is Action<Task<TAntecedentResult>> || action is Action<Task<TAntecedentResult>, object?>,
123Debug.Assert(antecedent != null,
131Debug.Assert(m_action != null);
143Debug.Fail("Invalid m_action in ContinuationTaskFromResultTask");
156Debug.Assert(function is Func<Task<TAntecedentResult>, TResult> || function is Func<Task<TAntecedentResult>, object?, TResult>,
169Debug.Assert(antecedent != null,
177Debug.Assert(m_action != null);
189Debug.Fail("Invalid m_action in ContinuationResultTaskFromResultTask");
216Debug.Assert(task != null);
217Debug.Assert(task.m_taskScheduler != null);
274Debug.Assert(task != null, "TaskContinuation ctor: task is null");
275Debug.Assert(scheduler != null, "TaskContinuation ctor: scheduler is null");
291Debug.Assert(completedTask != null);
292Debug.Assert(completedTask.IsCompleted, "ContinuationTask.Run(): completedTask not completed");
295Debug.Assert(continuationTask != null);
369Debug.Assert(state is Action);
385Debug.Assert(context != null);
418Debug.Assert(state is SynchronizationContextAwaitTaskContinuation);
466Debug.Assert(scheduler != null);
493Debug.Assert(action != null);
494Debug.Assert(scheduler != null && scheduler != TaskScheduler.Default);
547Debug.Assert(action != null);
563Debug.Assert(action != null);
564Debug.Assert(scheduler != null);
683Debug.Assert(state is Action);
697Debug.Assert(callback != null);
698Debug.Assert(currentTask == Task.t_currentTask);
847Debug.Assert(m_action != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskExceptionHolder.cs (17)
47Debug.Assert(task != null, "Expected a non-null task.");
92Debug.Assert(exceptionObject != null, "TaskExceptionHolder.Add(): Expected a non-null exceptionObject");
93Debug.Assert(
109Debug.Assert(exceptionObject != null, "Expected exceptionObject to be non-null.");
111Debug.Assert(m_cancellationException == null,
116Debug.Assert(m_faultExceptions == null,
129Debug.Assert(edi != null && edi.SourceException is OperationCanceledException,
145Debug.Assert(exceptionObject != null, "AddFaultException(): Expected a non-null exceptionObject");
173Debug.Assert(exc != null, "No exceptions should be null");
179Debug.Assert(numExceptions > 0, "Collection should contain at least one exception.");
189Debug.Assert(exceptions.Count > 0, "There should be at least one dispatch info.");
192Debug.Assert(tmp != null, "No dispatch infos should be null");
255Debug.Assert(exceptions != null, "Expected an initialized list.");
256Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
284Debug.Assert(exceptions != null, "Expected an initialized list.");
285Debug.Assert(exceptions.Count > 0, "Expected at least one exception.");
300Debug.Assert(edi == null || edi.SourceException is OperationCanceledException,
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\TaskFactory_T.cs (31)
498Debug.Assert((endFunction != null) != (endAction != null), "Expected exactly one of endFunction/endAction to be non-null");
642Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
764Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
786Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
881Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
903Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1006Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
1028Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1139Debug.Assert((endFunction != null) != (endAction != null), "Both endFunction and endAction were non-null");
1161Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1200Debug.Assert(thisRef != null, "Expected a non-null thisRef");
1201Debug.Assert(beginMethod != null, "Expected a non-null beginMethod");
1202Debug.Assert(endMethod != null, "Expected a non-null endMethod");
1215Debug.Assert(asyncResult.IsCompleted, "If the operation completed synchronously, it must be completed.");
1243Debug.Assert(thisRef != null, "Expected a non-null thisRef");
1244Debug.Assert(endMethod != null, "Expected a non-null endMethod");
1273Debug.Assert(thisRef != null);
1290Debug.Assert(!IsCompleted, "The task should not have been completed yet.");
1319Debug.Assert(successfullySet, "Expected the task to not yet be completed");
1611Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
1637Debug.Assert(continuationAction != null);
1658Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
1682Debug.Assert(state is Func<Task[], TResult>);
1689Debug.Assert(continuationAction != null);
1694Debug.Assert(state is Action<Task[]>);
1982Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
2002Debug.Assert(state is Func<Task, TResult>);
2009Debug.Assert(continuationAction != null);
2013Debug.Assert(state is Action<Task>);
2032Debug.Assert((continuationFunction != null) != (continuationAction != null), "Expected exactly one of endFunction/endAction to be non-null");
2055Debug.Assert(continuationAction != null);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\Tasks\ThreadPoolTaskScheduler.cs (1)
35Debug.Assert(s is Task);
src\runtime\src\libraries\System.Private.CoreLib\src\System\Threading\ThreadPoolBoundHandle.PlatformNotSupported.cs (1)
15Debug.Fail("Unreachable");
System.Private.CoreLib.Generators (8)
System.Private.DataContractSerialization (377)
System.Private.Reflection.Execution (99)
Internal\Reflection\Execution\TypeLoader\ConstraintValidatorSupport.cs (33)
10using Debug = global::System.Diagnostics.Debug;
141public override Assembly Assembly { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
142public override string AssemblyQualifiedName { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
143public override string FullName { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
145public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
146public override object[] GetCustomAttributes(bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; }
147public override object[] GetCustomAttributes(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; }
149public override EventInfo GetEvent(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
151public override EventInfo[] GetEvents(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
153public override FieldInfo GetField(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
155public override FieldInfo[] GetFields(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
160public override Type GetInterface(string name, bool ignoreCase) { Debug.Assert(false); throw NotImplemented.ByDesign; }
162public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
164public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
166public override Type GetNestedType(string name, BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
168public override Type[] GetNestedTypes(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
170public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { Debug.Assert(false); throw NotImplemented.ByDesign; }
171public override bool IsDefined(Type attributeType, bool inherit) { Debug.Assert(false); throw NotImplemented.ByDesign; }
172public override Guid GUID { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
177public override object InvokeMember(string name, BindingFlags invokeAttr, Binder binder, object target, object[] args, ParameterModifier[] modifiers, CultureInfo culture, string[] namedParameters) { Debug.Assert(false); throw NotImplemented.ByDesign; }
178public override Module Module { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
179public override string Namespace { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
180public override string Name { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
181public override Type UnderlyingSystemType { get { Debug.Assert(false); throw NotImplemented.ByDesign; } }
184protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; }
186protected override MethodInfo GetMethodImpl(string name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; }
188protected override PropertyInfo GetPropertyImpl(string name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { Debug.Assert(false); throw NotImplemented.ByDesign; }
189protected override bool IsCOMObjectImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
190protected override bool IsPrimitiveImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
191protected override bool HasElementTypeImpl() { Debug.Assert(false); throw NotImplemented.ByDesign; }
212Debug.Assert(type.DeclaringType != null);
253Debug.Assert(type.IsNullable());
256Debug.Assert(arguments.Length == 1);
System.Private.StackTraceMetadata (25)
System.Private.TypeLoader (354)
System.Private.Uri (156)
System.Private.Windows.Core (77)
System.Private.Windows.GdiPlus (1)
System.Private.Xml (3189)
System\Xml\BinaryXml\SqlUtils.cs (17)
85Debug.Assert(rgulU.Length == s_cNumeMax);
92Debug.Assert(iulD != 0, "iulD != 0", "Divided by zero!");
93Debug.Assert(iulD > 0, "iulD > 0", "Invalid data: less than zero");
94Debug.Assert(ciulU > 0, "ciulU > 0", "No data in the array");
130Debug.Assert(bPrec <= s_maxPrecision && bPrec > 0, "bPrec <= MaxPrecision && bPrec > 0", "Invalid numeric precision");
136Debug.Assert(uiDigit < 10);
250Debug.Assert(m_bScale <= s_NUMERIC_MAX_PRECISION, "m_bScale <= NUMERIC_MAX_PRECISION", "In AssertValid");
251Debug.Assert(m_bScale <= m_bPrec, "m_bScale <= m_bPrec", "In AssertValid");
252Debug.Assert(m_bScale >= 0, "m_bScale >= 0", "In AssertValid");
253Debug.Assert(m_bPrec > 0, "m_bPrec > 0", "In AssertValid");
254Debug.Assert(CLenFromPrec(m_bPrec) >= m_bLen, "CLenFromPrec(m_bPrec) >= m_bLen", "In AssertValid");
255Debug.Assert(m_bLen <= s_cNumeMax, "m_bLen <= x_cNumeMax", "In AssertValid");
262Debug.Assert(m_bLen == 1, "m_bLen == 1", "In AssertValid");
267Debug.Assert(rglData[iulData] == 0, "rglData[iulData] == 0", "In AssertValid");
323Debug.Assert(val >= 0 && val < 100);
329Debug.Assert(val > -10000 && val < 10000);
341Debug.Assert(val >= 0 && val < 1000);
System\Xml\Cache\XPathNode.cs (14)
154Debug.Assert(HasCollapsedText, "Do not call CollapsedLinePosition unless HasCollapsedText is true.");
173Debug.Assert(pageNode != null);
211Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized.");
223Debug.Assert(localName == null || (object?)Document.NameTable.Get(localName) == (object)localName, "localName must be atomized.");
361Debug.Assert(info != null && idxParent <= ushort.MaxValue);
372Debug.Assert(lineNumOffset >= 0 && lineNumOffset <= MaxLineNumberOffset, $"Line number offset too large or small: {lineNumOffset}");
373Debug.Assert(linePosOffset >= 0 && linePosOffset <= MaxLinePositionOffset, $"Line position offset too large or small: {linePosOffset}");
383Debug.Assert(posOffset >= 0 && posOffset <= MaxCollapsedPositionOffset, $"Collapsed text line position offset too large or small: {posOffset}");
400Debug.Assert(NodeType == XPathNodeType.Element);
411Debug.Assert(NodeType == XPathNodeType.Element);
439Debug.Assert(pageSibling != null && idxSibling != 0 && idxSibling <= ushort.MaxValue, "Bad argument");
440Debug.Assert(_idxSibling == 0, "SetSibling should not be called more than once.");
458Debug.Assert(pageSimilar != null && idxSimilar != 0 && idxSimilar <= ushort.MaxValue, "Bad argument");
459Debug.Assert(_idxSimilar == 0, "SetSimilarElement should not be called more than once.");
System\Xml\Cache\XPathNodeHelper.cs (34)
26Debug.Assert(pageElem[idxElem].NodeType == XPathNodeType.Element);
70Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
75Debug.Assert(pageNode[idxNode].NodeType == XPathNodeType.Attribute);
89Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
109Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
119Debug.Assert(idx != 0);
120Debug.Assert(page != null);
138Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
161Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
179Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
180Debug.Assert(idxNode <= ushort.MaxValue);
181Debug.Assert(pageNode[0].PageInfo!.PageNumber <= short.MaxValue);
194Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
200Debug.Assert(idx != 0);
228Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
261Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
299Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
312Debug.Assert(typ != XPathNodeType.Attribute && typ != XPathNodeType.Namespace);
331Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
332Debug.Assert(pageNode[idxNode].NodeType != XPathNodeType.Attribute);
348Debug.Assert(pagePrec != null);
369Debug.Assert(idxAnc != 0 && pageAnc != null);
394Debug.Assert(pageNode != null && idxNode != 0, "Cannot pass null argument(s)");
428Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
454Debug.Assert(page != null);
527Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
528Debug.Assert(typ != XPathNodeType.Text, "Text should be handled by GetTextFollowing in order to take into account collapsed text.");
529Debug.Assert(page[idx].NodeType != XPathNodeType.Attribute, "Current node should never be an attribute or namespace--caller should handle this case.");
566Debug.Assert(!page[idx].IsAttrNmsp, "GetContentFollowing should never return attributes or namespaces.");
585Debug.Assert(pageCurrent != null && idxCurrent != 0, "Cannot pass null argument(s)");
586Debug.Assert(!page[idx].IsAttrNmsp, "Current node should never be an attribute or namespace--caller should handle this case.");
662Debug.Assert(pageNode[idxNode].HasAttribute || pageNode[idxNode].HasContentChild, "Caller must check HasAttribute/HasContentChild on parent before calling GetChild.");
663Debug.Assert(pageNode[idxNode].HasAttribute || !pageNode[idxNode].HasCollapsedText, "Text child is virtualized and therefore is not present in the physical node page.");
669Debug.Assert(pageNode != null);
System\Xml\Core\XmlTextReaderImpl.cs (294)
317Debug.Assert(nt != null);
330Debug.Assert(_index == 0);
371Debug.Assert(!_nameTableFromSettings);
393Debug.Assert(_index == 0);
442Debug.Fail($"Unexpected conformance level {settings.ConformanceLevel}");
601Debug.Assert(baseUri == null);
629Debug.Assert(_laterInitParam != null);
630Debug.Assert(_laterInitParam.inputUriResolver != null);
631Debug.Assert(_laterInitParam.inputbaseUri != null);
632Debug.Assert(_reportedBaseUri != null);
699Debug.Assert(baseUri == null);
730Debug.Assert(_laterInitParam != null);
731Debug.Assert(_laterInitParam.inputStream != null);
732Debug.Assert(_reportedBaseUri != null);
763Debug.Assert(baseUriStr == string.Empty, "BaseURI can come either from XmlParserContext or from the constructor argument, not from both");
789Debug.Assert(_laterInitParam != null);
790Debug.Assert(_laterInitParam.inputTextReader != null);
791Debug.Assert(_reportedBaseUri != null);
812Debug.Assert(xmlFragment != null);
838default: Debug.Fail($"Unexpected fragment type {_fragmentType}"); goto case XmlNodeType.None;
1195Debug.Assert(_laterInitParam != null);
1210Debug.Fail("Invalid InitInputType");
1234Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent);
1237Debug.Assert(!_ps.appendMode);
1265Debug.Assert(_parsingFunction == ParsingFunction.ElementContent ||
1270Debug.Assert(_curNode.type == XmlNodeType.Element);
1334Debug.Fail($"Unexpected parsing function {_parsingFunction}");
1362Debug.Fail($"Unexpected parsing function {_parsingFunction}");
1394Debug.Assert(_curNode.type == XmlNodeType.EndElement);
1395Debug.Assert(_parsingFunction != ParsingFunction.Eof);
1415Debug.Assert(_namespaceManager != null);
1498Debug.Assert(_parsingMode == ParsingMode.Full);
1517Debug.Fail("Unexpected entity type");
1543Debug.Fail("Unexpected entity type");
1559Debug.Assert(value is XmlTextReader);
1578Debug.Assert(_outerReader is XmlTextReaderImpl);
1867Debug.Assert(_ps.chars != null);
1891Debug.Assert(_ps.chars != null);
1944Debug.Assert(_namespaceManager != null);
1952Debug.Assert(_namespaceManager != null);
1988Debug.Assert(_namespaceManager != null);
2008Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be accessed on reader created via XmlReader.Create.");
2013Debug.Assert(_v1Compat, "XmlTextReaderImpl.Normalization property cannot be changed on reader created via XmlReader.Create.");
2041Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be accessed on reader created via XmlReader.Create.");
2046Debug.Assert(_v1Compat, "XmlTextReaderImpl.WhitespaceHandling property cannot be changed on reader created via XmlReader.Create.");
2066Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be accessed on reader created via XmlReader.Create.");
2071Debug.Assert(_v1Compat, "XmlTextReaderImpl.DtdProcessing property cannot be changed on reader created via XmlReader.Create.");
2123Debug.Assert(_v1Compat, "XmlTextReaderImpl.ResetState cannot be called on reader created via XmlReader.Create.");
2137Debug.Assert(_namespaceManager != null);
2165Debug.Assert(_v1Compat, "XmlTextReaderImpl.GetRemainder cannot be called on reader created via XmlReader.Create.");
2166Debug.Assert(_stringBuilder.Length == 0);
2206Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadChars cannot be called on reader created via XmlReader.Create.");
2207Debug.Assert(_outerReader is XmlTextReader);
2242Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBase64 cannot be called on reader created via XmlReader.Create.");
2243Debug.Assert(_outerReader is XmlTextReader);
2276Debug.Assert(_v1Compat, "XmlTextReaderImpl.ReadBinHex cannot be called on reader created via XmlReader.Create.");
2277Debug.Assert(_outerReader is XmlTextReader);
2404Debug.Assert(value >= 0 && value <= _ps.charsUsed);
2490Debug.Assert(_parsingMode == ParsingMode.Full);
2578Debug.Assert(_parsingStatesStackTop == -1);
2579Debug.Assert((systemId != null && systemId.Length > 0) || (publicId != null && publicId.Length > 0));
2586Debug.Assert(_xmlResolver != null);
2598Debug.Assert(_ps.appendMode);
2614Debug.Assert(_parsingStatesStackTop == -1);
2615Debug.Assert(internalDtd != null);
2788Debug.Assert(InAttributeValueIterator);
2825Debug.Assert(baseUriStr != null);
2831Debug.Assert(baseUri != null);
2842Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.textReader == null);
2843Debug.Assert(baseUriStr != null);
2844Debug.Assert(baseUri == null || (baseUri.ToString().Equals(baseUriStr)));
2917Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0 && _ps.stream == null);
2918Debug.Assert(baseUriStr != null);
2946Debug.Assert(_ps.stream == null && _ps.textReader == null);
2947Debug.Assert(_ps.charPos == 0 && _ps.charsUsed == 0);
2948Debug.Assert(baseUriStr != null);
2949Debug.Assert(str != null);
3004Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl);
3008Debug.Assert(_parsingFunction == ParsingFunction.SwitchToInteractiveXmlDecl);
3009Debug.Assert(_nextParsingFunction == ParsingFunction.DocumentContent);
3034Debug.Assert(context != null && context.HasDtdInfo);
3048Debug.Fail("Unhandled DtdProcessing enumeration value.");
3056Debug.Assert(_url != null && _url.Length > 0);
3081Debug.Assert(_ps.stream != null);
3089Debug.Assert(_ps.bytes != null);
3090Debug.Assert(_ps.bytePos == 0);
3176Debug.Assert(_ps.charPos == 0);
3194Debug.Assert(_ps.encoding != null);
3195Debug.Assert(_ps.bytes != null);
3206Debug.Assert(_ps.encoding != null);
3209Debug.Assert(_ps.stream != null);
3221Debug.Assert(_ps.encoding != null);
3270Debug.Assert(newEncoding != null);
3271Debug.Assert(newEncoding.EncodingName != "UTF-8");
3285Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null);
3286Debug.Assert(_ps.appendMode, "UnDecodeChars cannot be called after ps.appendMode has been changed to false");
3288Debug.Assert(_ps.charsUsed >= _ps.charPos, "The current position must be in the valid character range.");
3296Debug.Assert(_charactersInDocument >= _ps.charsUsed - _ps.charPos,
3305Debug.Assert(_charactersFromEntities >= _ps.charsUsed - _ps.charPos,
3314Debug.Assert(_ps.encoding != null);
3315Debug.Assert(_ps.chars != null);
3358Debug.Assert(_ps.chars != null);
3381Debug.Assert(_ps.bytes != null);
3440Debug.Assert(_ps.bytes != null);
3455Debug.Assert(_ps.bytes != null);
3494Debug.Assert(_ps.charsUsed < _ps.chars.Length);
3505Debug.Assert(_ps.stream != null && _ps.decoder != null && _ps.bytes != null);
3506Debug.Assert(_ps.chars != null);
3507Debug.Assert(maxCharsCount <= _ps.chars.Length - _ps.charsUsed - 1);
3531Debug.Assert(maxCharsCount >= charsCount);
3546Debug.Assert(_ps.decoder != null);
3547Debug.Assert(_ps.bytes != null);
3548Debug.Assert(_ps.chars != null);
3554Debug.Fail("We should get an exception again.");
3596Debug.Assert(_ps.chars != null);
3626Debug.Assert(_stringBuilder.Length == 0 || isTextDecl);
3670Debug.Assert(_ps.encoding != null);
3747Debug.Assert(attr != null);
3779Debug.Assert(attr != null);
3805Debug.Assert(attr != null);
3821Debug.Assert(attr != null);
3836Debug.Assert(!isTextDecl);
3842Debug.Assert(attr != null);
3848Debug.Fail($"Unexpected xmlDeclState {xmlDeclState}");
3888Debug.Assert(_ps.encoding != null);
3912Debug.Assert(_ps.chars != null);
4094Debug.Assert(pos == _ps.charsUsed && !_ps.isEof);
4114Debug.Assert(_index == 0);
4137Debug.Assert(_ps.chars != null);
4311Debug.Assert(_ps.chars != null);
4377Debug.Assert(_namespaceManager != null);
4469Debug.Assert(_curNode.type == XmlNodeType.Element);
4470Debug.Assert(_dtdInfo != null);
4562Debug.Assert(_ps.chars != null);
4642Debug.Fail("We should never get to this point.");
4651Debug.Assert(_index > 0);
4656Debug.Assert(_curNode == startTagNode);
4673Debug.Assert(_ps.chars != null);
4683Debug.Assert(startTag.type == XmlNodeType.EntityReference);
4692Debug.Assert(_ps.chars != null);
4696Debug.Assert(_attrCount == 0);
4745Debug.Assert(_curNode.type == XmlNodeType.Element);
4753Debug.Assert(_curNode.type == XmlNodeType.Element);
4857Debug.Assert(attrNameLineNo == _ps.LineNo);
4904Debug.Assert(val == XmlComplianceUtil.CDataNormalize(val), "The attribute value is not CDATA normalized!");
4979Debug.Assert(_curNode.type == XmlNodeType.Element);
5106Debug.Assert(_ps.chars != null);
5113Debug.Assert(_stringBuilder.Length == 0);
5268Debug.Assert(_ps.entity != null);
5322Debug.Fail("We should never get to this point.");
5325Debug.Assert(_ps.isEof);
5343Debug.Fail("no EndEntity reporting while parsing attributes");
5383Debug.Assert(attr.nextAttrValueChunk == null);
5412Debug.Assert(_stringBuilder.Length == 0);
5428Debug.Assert(endPos - startPos > 0);
5429Debug.Assert(_ps.chars != null);
5452Debug.Assert(_stringBuilder.Length > 0);
5473Debug.Assert(endPos - startPos > 0);
5474Debug.Assert(_ps.chars != null);
5549Debug.Assert(_ps.chars != null);
5739Debug.Assert(_ps.isEof);
5781Debug.Assert(_stringBuilder.Length == 0);
5782Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue ||
5796Debug.Assert(_stringBuilder.Length > 0);
5850Debug.Assert(_parsingFunction == ParsingFunction.PartialTextValue || _parsingFunction == ParsingFunction.InReadValueChunk ||
5860Debug.Assert(_parsingFunction == ParsingFunction.InReadValueChunk);
5865Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent);
5877Debug.Assert(_parsingFunction == ParsingFunction.InReadContentAsBinary || _parsingFunction == ParsingFunction.InReadElementContentAsBinary);
5882Debug.Assert((_index > 0) ? _nextParsingFunction == ParsingFunction.ElementContent : _nextParsingFunction == ParsingFunction.DocumentContent);
5910Debug.Assert(_stringBuilder.Length == 0);
5914Debug.Assert(_ps.chars != null);
5952Debug.Assert(_ps.chars != null);
5953Debug.Assert(_ps.chars[_ps.charPos] == '&');
5962Debug.Assert(_ps.chars != null);
5963Debug.Assert(_ps.chars[_ps.charPos] == '&');
5978Debug.Assert(entityType == EntityType.CharacterDec || entityType == EntityType.CharacterHex);
6056Debug.Assert(entity != null);
6132Debug.Fail($"Unexpected parsing states stack top {_parsingStatesStackTop}");
6173Debug.Assert(_lastEntity != null);
6179Debug.Assert(_curNode.depth == _index);
6192Debug.Assert(_curNode.type == XmlNodeType.EntityReference);
6193Debug.Assert(_lastEntity != null);
6194Debug.Assert(Ref.Equal(_lastEntity.Name, _curNode.localName));
6213Debug.Assert(_stringBuilder.Length == 0);
6217Debug.Assert(_ps.chars != null);
6240Debug.Assert(_ps.charPos < _ps.charsUsed);
6284Debug.Assert(_stringBuilder.Length == 0);
6318Debug.Assert(_ps.chars != null);
6340Debug.Assert(!_ps.eolNormalized);
6487Debug.Assert(_stringBuilder.Length == 0);
6490Debug.Assert(_ps.chars != null);
6523Debug.Assert(_ps.chars != null);
6547Debug.Assert(!_ps.eolNormalized);
6696Debug.Assert(_ps.chars != null);
6729Debug.Assert(_dtdProcessing == DtdProcessing.Ignore);
6761Debug.Assert(_ps.chars != null);
6858Debug.Assert(_ps.chars != null);
6877Debug.Assert(_ps.chars != null);
7055Debug.Fail("We should never get to this point.");
7058Debug.Assert(_ps.isEof);
7074Debug.Assert(_ps.chars != null);
7156Debug.Fail("We should never get to this point.");
7159Debug.Assert(_ps.isEof);
7168Debug.Assert(_ps.chars != null);
7169Debug.Assert(_ps.chars[startPos] == '&');
7202Debug.Assert(_ps.chars != null);
7203Debug.Assert(_ps.chars[_ps.charPos] == '&');
7223Debug.Assert(_ps.chars != null);
7224Debug.Assert(_ps.chars[startPos] == '&' && _ps.chars[startPos + 1] == '#');
7279Debug.Assert(badDigitExceptionString != null);
7331Debug.Assert(pos > 0);
7365Debug.Assert(_ps.chars != null);
7366Debug.Assert(_ps.chars[_ps.charPos] == '&');
7386Debug.Assert(startPos < _ps.charsUsed);
7387Debug.Assert(_ps.chars != null);
7388Debug.Assert(_ps.chars[startPos] == '&');
7389Debug.Assert(_ps.chars[startPos + 1] != '#');
7497Debug.Assert(pos > 0);
7522Debug.Assert(_ps.chars != null);
7585Debug.Assert(_ps.chars != null);
7618Debug.Assert(_ps.chars != null);
7633Debug.Assert(nodeIndex < _nodes.Length);
7634Debug.Assert(_nodes[_nodes.Length - 1] == null);
7647Debug.Assert(nodeIndex < _nodes.Length);
7654Debug.Assert(nodeIndex < _nodes.Length);
7671Debug.Assert(_ps.chars != null);
7724Debug.Assert(attr.type == XmlNodeType.Attribute);
7740Debug.Assert(_namespaceManager != null);
7759Debug.Assert(_ps.isEof);
7772Debug.Assert(_namespaceManager != null);
7810Debug.Assert(_namespaceManager != null);
7823Debug.Assert(_xmlContext.defaultNamespace == uri);
7860Debug.Assert(_curNode.xmlContextPushed);
7902Debug.Assert(_xmlResolver != null);
7960Debug.Assert(_xmlResolver != null);
7977Debug.Assert(_xmlResolver.SupportsType(uri, typeof(Stream)), "Stream must always be a supported type in XmlResolver");
7997Debug.Assert(entity.IsExternal);
8001Debug.Assert(_xmlResolver != null);
8012Debug.Assert(_ps.appendMode);
8043Debug.Assert(!entity.IsExternal);
8109Debug.Assert(_parsingStatesStackTop == -1);
8125Debug.Assert(_parsingStatesStackTop >= 0);
8126Debug.Assert(_parsingStatesStack != null);
8173Debug.Assert(_incReadDecoder != null);
8183Debug.Assert(_incReadDecoder != null);
8184Debug.Assert(_ps.chars != null);
8233Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 2).StartsWith("?>"));
8241Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("-->"));
8249Debug.Assert(_ps.chars.AsSpan(_ps.charPos - 3).StartsWith("]]>"));
8271Debug.Fail($"Unexpected read state {_incReadState}");
8274Debug.Assert(_incReadState == IncrementalReadState.Text ||
8383Debug.Assert(_ps.charPos - pos == 0);
8384Debug.Assert(_ps.charPos - startPos == 0);
8423Debug.Assert(_ps.charPos - pos == 0);
8424Debug.Assert(_ps.charPos - startPos == 0);
8521Debug.Assert(count == charsParsed || _incReadDecoder.IsFull, "Check if decoded consumed all characters unless it's full.");
8538Debug.Assert(IncrementalRead() == 0, "Previous call of IncrementalRead should eat up all characters!");
8544Debug.Assert(_fragmentType == XmlNodeType.Attribute);
8561Debug.Assert(_parsingFunction == ParsingFunction.InReadAttributeValue);
8574Debug.Assert(_ps.chars != null);
8589Debug.Assert(_stringBuilder.Length == 0);
8600Debug.Assert(_ps.eolNormalized, "Entity replacement text for attribute values should be EOL-normalized!");
8655Debug.Fail("We should never get to this point.");
8713Debug.Fail("We should never get to this point.");
8793Debug.Assert(_ps.chars != null);
8806Debug.Assert(_ps.charPos < _ps.charsUsed);
8871Debug.Assert(_ps.chars != null);
8884Debug.Assert(_dtdInfo == null && _fragmentParserContext != null && _fragmentParserContext.HasDtdInfo);
8900Debug.Assert(_parsingFunction != ParsingFunction.InReadContentAsBinary);
8927Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
8928Debug.Assert(_curNode.type == XmlNodeType.Element);
9011Debug.Assert(context != null);
9032Debug.Assert(nt != null);
9033Debug.Assert(context.NameTable == null || context.NameTable == nt, "This check should have been done in XmlParserContext constructor.");
9049Debug.Assert(!_nameTableFromSettings);
9074Debug.Assert(_dtdInfo == null);
9132Debug.Assert(_curNode.type == XmlNodeType.Whitespace && newNodeType == XmlNodeType.SignificantWhitespace, "Incorrect node type change!");
9234Debug.Assert(attr != null);
9255Debug.Assert(_namespaceManager != null);
9258Debug.Assert(prefix != null);
9276Debug.Assert(attr != null);
9308Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9326Debug.Assert(_nodes[_index].type == XmlNodeType.Element);
9327Debug.Assert(_namespaceManager != null);
9361Debug.Assert(_incReadDecoder != null);
9395Debug.Assert(_ps.chars != null);
9474Debug.Assert(_parsingFunction != ParsingFunction.InReadElementContentAsBinary);
9530Debug.Assert(characters >= 0);
9572Debug.Assert(startPos >= 0);
9573Debug.Assert(endPos < chars.Length);
9574Debug.Assert(startPos <= endPos);
9581Debug.Assert(startPos >= 0);
9582Debug.Assert(endPos < str.Length);
9583Debug.Assert(startPos <= endPos);
System\Xml\Schema\XmlValueConverter.cs (9)
235Debug.Assert(schemaType != null && datatype != null, "schemaType or schemaType.Datatype may not be null");
242Debug.Assert(schemaType.Datatype!.Variety != XmlSchemaDatatypeVariety.List, "schemaType must be list's item type, not list itself");
270Debug.Fail($"Type code {typeCode} is not supported.");
282Debug.Assert(_clrTypeDefault!.IsArray);
435Debug.Assert(_typeCode == XmlTypeCode.Item, "If SchemaType is null, then TypeCode may only be Item, Node, or AnyAtomicType");
2919Debug.Assert(!(atomicConverter is XmlListConverter) || ((XmlListConverter)atomicConverter).atomicConverter == null,
3051Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
3079Debug.Assert(enumSrc != null, "Value passed to ToArray must implement IEnumerable");
3146Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
System\Xml\Xsl\IlGen\XmlILConstructAnalyzer.cs (30)
129Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
142Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
155Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
168Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
181Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
194Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
195Debug.Assert(value);
218Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
219Debug.Assert(value);
242Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
243Debug.Assert(value);
267Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
296Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
310Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
324Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
338Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
352Debug.Assert(!_isReadOnly, "This XmlILConstructInfo instance is read-only.");
441Debug.Assert(ndContent != null);
490case QilNodeType.NamespaceDecl: Debug.Assert(ndContent == null); break;
491case QilNodeType.TextCtor: Debug.Assert(ndContent == null); break;
492case QilNodeType.RawTextCtor: Debug.Assert(ndContent == null); break;
496case QilNodeType.XsltCopyOf: Debug.Assert(ndContent == null); break;
500default: Debug.Fail($"{ndConstr.NodeType} is not handled by XmlILStateAnalyzer."); break;
714Debug.Assert(!typ.IsSingleton);
750Debug.Assert(!typ.IsSingleton);
800Debug.Assert(ndElem!.NodeType == QilNodeType.ElementCtor);
838Debug.Assert(binaryNode != null);
857Debug.Assert(ndName != null);
1058Debug.Assert(nd.NodeType == QilNodeType.NamespaceDecl);
1094Debug.Assert(nd.NodeType != QilNodeType.NamespaceDecl || !_nsmgr.HasNamespace(prefix) || _nsmgr.LookupNamespace(prefix) == ns,
System\Xml\Xsl\IlGen\XmlIlVisitor.cs (90)
76Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None, "Root expression should have been pushed to the writer.");
93Debug.Assert(iter.NodeType == QilNodeType.Let || iter.NodeType == QilNodeType.Parameter);
97Debug.Assert(methGlobal != null, "Metadata for global value should have already been computed");
149Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports parameters of type item*.");
193Debug.Assert(iter.NodeType == QilNodeType.Parameter, "Only parameters may not have a default value");
223Debug.Assert(iter.NodeType == QilNodeType.Parameter);
253Debug.Assert(iter.XmlType == TypeFactory.ItemS, "IlGen currently only supports default values in parameters of type item*.");
318Debug.Assert(nd.XmlType!.IsSingleton || CachesResult(nd) || _iterCurr.HasLabelNext,
336Debug.Fail($"Visit{parent.NodeType} should never be called");
758Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None);
843Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None);
909Debug.Assert(info.ConstructMethod == XmlILConstructMethod.Iterator);
912Debug.Assert(ndCond.Left.XmlType!.TypeCode == XmlTypeCode.Boolean);
949Debug.Assert(!ndCond.Center.XmlType!.IsSingleton || !ndCond.Right.XmlType!.IsSingleton);
981Debug.Assert(ndBranch.XmlType!.IsSingleton, "Conditional must produce a singleton");
986Debug.Assert(itemStorageType == typeof(bool));
1012Debug.Assert(XmlILConstructInfo.Read(ndChoice).PushToWriterFirst);
1144Debug.Assert(XmlILConstructInfo.Read(nd).PullFromIteratorFirst, "VisitEmpty should only be called if items are iterated");
1165Debug.Assert(XmlILConstructInfo.Read(ndSeq).ConstructMethod == XmlILConstructMethod.Iterator, "This method should only be called if items in list are pulled from a code iterator.");
1509Debug.Assert(!ndStrConcat.Values.XmlType!.IsSingleton, "Optimizer should have folded StrConcat of a singleton value");
1630Debug.Assert(ndParsedTagName.Right.XmlType.IsSingleton);
1713Debug.Assert(ndComp.Left.XmlType!.IsAtomicValue && ndComp.Right.XmlType!.IsAtomicValue, "Operands to compare must be atomic values.");
1714Debug.Assert(ndComp.Left.XmlType.IsSingleton && ndComp.Right.XmlType.IsSingleton, "Operands to compare must be cardinality one.");
1715Debug.Assert(ndComp.Left.XmlType == ndComp.Right.XmlType, "Operands to compare may not be heterogenous.");
1753Debug.Assert(code != XmlTypeCode.QName, $"QName values do not support the {relOp} operation");
1772Debug.Fail($"Comparisons for datatype {code} are invalid.");
2030Debug.Fail($"Pattern {step.NodeType} should have been handled.");
2110Debug.Assert(ndIter != null);
2123Debug.Assert(ndIter.NodeType == QilNodeType.Let || ndIter.NodeType == QilNodeType.Parameter);
2124Debug.Assert(!patt.MatchesPattern(OptimizerPatternName.IsPositional));
2141Debug.Assert(ndFor.XmlType!.IsSingleton);
2203Debug.Assert(!ndLet.XmlType!.IsSingleton);
2234Debug.Assert(ndIter != null);
2248Debug.Assert(ndIter.NodeType == QilNodeType.For);
2251Debug.Assert(locPos != null);
2265Debug.Assert(ndSort.Variable.NodeType == QilNodeType.For);
2286Debug.Assert(!_iterNested!.Storage.IsCached);
2330Debug.Assert(ndKey.Key.XmlType!.IsAtomicValue, "Sort key must be an atomic value.");
2437Debug.Assert(pattStep.MatchesPattern(OptimizerPatternName.Axis), "Dod patterns should only match if step is FilterElements or FilterKindTest or Axis");
2474Debug.Fail($"Pattern {step.NodeType} should have been handled.");
2500Debug.Fail($"Pattern {step.NodeType} should have been handled.");
2523Debug.Assert(_iterCurr.Storage.IsCached, "DodMerge pattern should only be matched when cached sequences are returned from loop");
2552Debug.Assert(!XmlILConstructInfo.Read(ndInvoke).PushToWriterFirst || useWriter);
2600Debug.Assert(ndName != null, "Attribute node must have a literal QName as its second argument");
2780Debug.Assert(XmlILConstructInfo.Read(ndElem).PushToWriterFirst, "Element construction should always be pushed to writer.");
2830Debug.Assert(XmlILConstructInfo.Read(ndAttr).PushToWriterFirst, "Attribute construction should always be pushed to writer.");
2864Debug.Assert(XmlILConstructInfo.Read(ndComment).PushToWriterFirst, "Comment construction should always be pushed to writer.");
2884Debug.Assert(XmlILConstructInfo.Read(ndPI).PushToWriterFirst, "PI construction should always be pushed to writer.");
2924Debug.Assert(info.PushToWriterFirst, "Text construction should always be pushed to writer.");
2984Debug.Assert(XmlILConstructInfo.Read(ndDoc).PushToWriterFirst, "Document root construction should always be pushed to writer.");
3007Debug.Assert(info.PushToWriterFirst, "Namespace construction should always be pushed to writer.");
3137Debug.Fail($"Unexpected node type {ndProp.NodeType}");
3181Debug.Assert(!typDerived!.NeverSubtypeOf(typBase), "Normalizer should have eliminated IsType where source can never be a subtype of destination type.");
3187Debug.Assert(_iterCurr.Storage.ItemStorageType == typeof(XPathItem), "If !IsNode, then storage type should be Item");
3263Debug.Assert((typDerived.NodeKinds & kinds) != XmlNodeKindFlags.None, "Normalizer should have taken care of case where node kinds are disjoint.");
3375Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None);
3439Debug.Assert(ndVal.Child.XmlType!.IsNode, "XPathNodeValue node may only be applied to a sequence of Nodes.");
3562Debug.Assert(XmlILConstructInfo.Read(ndInvoke).ConstructMethod != XmlILConstructMethod.Writer);
3649Debug.Assert(ndActualArg.XmlType!.IsSubtypeOf(xmlTypeFormalArg), "Xml type of actual arg must be a subtype of the Xml type of the formal arg");
3681Debug.Fail($"Internal Xslt library may not use parameters of type {clrTypeFormalArg}");
3745Debug.Assert(XmlILConstructInfo.Read(ndCopy).PushToWriterFirst);
3751Debug.Assert(ndCopy.Left.XmlType!.IsNode);
3763Debug.Assert(ndCopy.Left.XmlType.IsNode);
3779Debug.Assert(XmlILConstructInfo.Read(ndCopyOf).PushToWriterFirst, "XsltCopyOf should always be pushed to writer.");
3811Debug.Fail($"Conversion from {ndConv.Source.XmlType} to {ndConv.TargetType} is not supported.");
3988Debug.Assert(ndDod.NodeType == QilNodeType.DocOrderDistinct && ndLoop != null);
4105Debug.Assert(ndName.XmlType!.TypeCode == XmlTypeCode.QName, "Element or attribute name must have QName type.");
4124Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, nodeType, ValidateNames.Flags.AllExceptPrefixMapping));
4201Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne);
4240Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne);
4267Debug.Assert(ndSecond.NodeType == QilNodeType.NameOf);
4309default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break;
4322default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break;
4338default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break;
4345Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None);
4357default: Debug.Fail($"Unexpected rel op {relOp}"); opcode = OpCodes.Nop; break;
4378Debug.Assert(relOp == QilNodeType.Eq || relOp == QilNodeType.Ne);
4398Debug.Assert(_iterCurr.CurrentBranchingContext == BranchingContext.None);
4583Debug.Assert(xmlTypes == XmlNodeKindFlags.PI);
4604Debug.Fail($"Cannot map QilNodeType {typ} to an XPathNodeType");
4616Debug.Assert(xmlTypes == XmlNodeKindFlags.Element);
4623Debug.Assert(!isXmlTypeUnion || (xmlTypes & XmlNodeKindFlags.Content) == XmlNodeKindFlags.Content);
4694Debug.Assert(_iterCurr.Storage.Location == ItemLocation.None ||
4772Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
4786Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
4805Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
4815Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
4825Debug.Assert(nd.XmlType!.IsSingleton && !XmlILConstructInfo.Read(nd).PushToWriterLast);
4839Debug.Assert(!XmlILConstructInfo.Read(nd).PushToWriterLast);
4853Debug.Assert(_iterCurr.Storage.IsCached, "Expression result should be cached. CachesResult() might have a bug in it.");
System\Xml\Xsl\Runtime\XmlQueryOutput.cs (47)
161Debug.Assert(prefix != null && !string.IsNullOrEmpty(localName) && ns != null, "Invalid argument");
162Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Element, ValidateNames.Flags.All), "Name validation failed");
220Debug.Assert(prefix != null && localName != null && ns != null, "Invalid argument");
230Debug.Assert(ValidateNames.ValidateName(prefix, localName, ns, XPathNodeType.Attribute, ValidateNames.Flags.All));
418Debug.Assert(_xstate == XmlState.WithinSequence, $"StartTree cannot be called in the {_xstate} state.");
429Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"EndTree cannot be called in the {_xstate} state.");
445Debug.Assert(_xstate == XmlState.WithinContent, $"WriteStartElement cannot be called in the {_xstate} state.");
468Debug.Assert(_xstate == XmlState.EnumAttrs, $"StartElementContent cannot be called in the {_xstate} state.");
483Debug.Assert(_xstate == XmlState.EnumAttrs || _xstate == XmlState.WithinContent, $"WriteEndElement cannot be called in the {_xstate} state.");
503Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteStartAttribute cannot be called in the {_xstate} state.");
522Debug.Assert(_xstate == XmlState.WithinAttr, $"WriteEndAttribute cannot be called in the {_xstate} state.");
537Debug.Assert(prefix != null && ns != null);
538Debug.Assert(_xstate == XmlState.EnumAttrs, $"WriteNamespaceDeclaration cannot be called in the {_xstate} state.");
541Debug.Assert(prefix.Length == 0 || ns.Length != 0);
571Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlock cannot be called in the {_xstate} state.");
580Debug.Assert(_xstate != XmlState.WithinSequence && _xstate != XmlState.EnumAttrs, $"WriteTextBlockNoEntities cannot be called in the {_xstate} state.");
594Debug.Assert(_depth == 0, "Root node can only be constructed at top-level.");
607Debug.Assert(_depth == 1, "Root node can only be constructed at top-level.");
698Debug.Assert(prefix != null && ns != null);
745Debug.Assert(prefix != null, "Invalid argument");
761Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteNamespaceString cannot be called in the {_xstate} state.");
770Debug.Assert(_xstate == XmlState.WithinNmsp, $"WriteEndNamespace cannot be called in the {_xstate} state.");
800Debug.Assert(_xstate == XmlState.WithinComment, $"WriteCommentString cannot be called in the {_xstate} state.");
809Debug.Assert(_xstate == XmlState.WithinComment, $"WriteEndComment cannot be called in the {_xstate} state.");
843Debug.Assert(_xstate == XmlState.WithinPI, $"WriteProcessingInstructionString cannot be called in the {_xstate} state.");
852Debug.Assert(_xstate == XmlState.WithinPI, $"WriteEndProcessingInstruction cannot be called in the {_xstate} state.");
883Debug.Assert(_xstate == XmlState.WithinSequence, "Values can only be written at the top-level.");
937Debug.Assert(navigator.NodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes.");
956Debug.Assert(navigator.NodeType == XPathNodeType.Root, "EndCopy should only be called for Element and Document nodes.");
979Debug.Assert(text != null, "Invalid argument");
1020Debug.Fail($"Text cannot be output in the {_xstate} state.");
1036Debug.Assert(navigator != null);
1043Debug.Assert(nodeType == XPathNodeType.Element, "StartCopy should return true only for Element nodes.");
1174Debug.Assert(_xstate != XmlState.WithinSequence, "StartCopy should not called if state is WithinSequence");
1191Debug.Fail($"Unexpected node type {navigator.NodeType}");
1204Debug.Assert(navigator.NodeType == XPathNodeType.Element);
1205Debug.Assert(_xstate == XmlState.WithinContent, $"EndCopy cannot be called in the {_xstate} state.");
1218Debug.Assert(navigator.NodeType == XPathNodeType.Element, "Only elements have namespaces to copy");
1223Debug.Assert(navigator.LocalName.Length != 0, "xmlns:foo='' isn't allowed");
1256Debug.Assert(rootType == XPathNodeType.Element || rootType == XPathNodeType.Comment || rootType == XPathNodeType.ProcessingInstruction);
1287Debug.Assert(rootType == XPathNodeType.Attribute || rootType == XPathNodeType.Namespace);
1318Debug.Assert(_nsmgr != null);
1339Debug.Fail($"{xstate} is not a valid XmlState.");
1350Debug.Assert(prefix.Length != 0 && ns.Length != 0);
1398Debug.Assert(prefix != null && !string.IsNullOrEmpty(ns));
1504Debug.Assert(ValidateNames.ParseNCName(name.Name, 0) == name.Name.Length);
1553Debug.Assert(_stkNames != null);
System\Xml\Xsl\Runtime\XmlQueryRuntime.cs (22)
72Debug.Assert(data != null);
174Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed.");
175Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios.");
191Debug.Assert(IsGlobalComputed(idx), "Cannot get the value of a global value until it has been computed.");
192Debug.Assert(_globalValues![idx] is IList<XPathItem>, "Only debugger should call this method, and all global values should have type item* in debugging scenarios.");
250Debug.Assert(_earlyObjects != null && index < _earlyObjects.Length, "Early bound object does not exist");
300Debug.Assert(IsGlobalComputed(index), "Cannot get the value of a global value until it has been computed.");
310Debug.Assert(!IsGlobalComputed(index), "Global value should only be set once.");
332Debug.Assert(_atomizedNames != null);
341Debug.Assert(_filters != null);
395Debug.Assert(_prefixMappingsList != null);
462Debug.Assert(_types != null);
480Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()),
483Debug.Assert(destinationType == typeof(object) || !destinationType.IsAssignableFrom(value.GetType()),
499Debug.Assert(xmlType != XmlQueryTypeFactory.Node && xmlType != XmlQueryTypeFactory.NodeS,
558Debug.Assert(destinationType.IsAssignableFrom(value.GetType()), $"ChangeType from type {value.GetType().Name} to type {destinationType.Name} failed");
680Debug.Assert(XmlILTypeHelper.GetStorageType(xmlType).IsAssignableFrom(value.GetType()), $"Xml type {xmlType} is not represented in ILGen as {value.GetType().Name}");
778Debug.Fail($"XmlTypeCode {code} was not fully handled.");
829Debug.Assert(_collations != null);
890Debug.Assert(context != null);
927Debug.Assert(context != null);
1078Debug.Assert(node.NodeType == XPathNodeType.Namespace);
System\Xml\Xsl\XmlQueryType.cs (11)
487Debug.Assert(Count == 1 && IsSingleton, "This method should only be called for item types.");
488Debug.Assert(baseType.Count == 1 && baseType.IsSingleton, "This method should only be called for item types.");
489Debug.Assert(!IsDod && !baseType.IsDod, "Singleton types may not have DocOrderDistinct property");
509Debug.Assert(IsAtomicValue && baseType.IsAtomicValue);
528Debug.Assert(this.Count == 1 && this.IsSingleton, "this should be an item");
529Debug.Assert(other.Count == 1 && other.IsSingleton, "other should be an item");
562Debug.Assert(Count == 1, "Do not pass a Union type to this method.");
563Debug.Assert(IsSingleton, "Do not pass a Sequence type to this method.");
885Debug.Assert(count < 64, "BitMatrix currently only handles up to 64x64 matrix.");
903Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
908Debug.Assert(index1 < _bits.Length && index2 < _bits.Length, "Index out of range.");
System\Xml\Xsl\XmlQueryTypeFactory.cs (15)
63Debug.Assert(schemaType.DerivedBy == XmlSchemaDerivationMethod.Union);
265Debug.Assert(itemType.IsSingleton, "All types should be prime.");
351Debug.Assert(arrEnum[arrEnum.Length - 1] == XmlTypeCode.DayTimeDuration,
437Debug.Assert(schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic, "List or Union Xsd types should have been handled by caller.");
470Debug.Assert(!isNillable);
504Debug.Assert(nameTest != null, "nameTest cannot be null");
505Debug.Assert(schemaType != null, "schemaType cannot be null");
513Debug.Assert(!IsAtomicValue || schemaType.Datatype!.Variety == XmlSchemaDatatypeVariety.Atomic);
554Debug.Assert((object)this == (object)Create(_code, _isStrict), "Unknown type");
741Debug.Assert(members != null && members.Count != 1, "ChoiceType must contain a list with 0 or >1 types.");
749Debug.Assert(t.Cardinality == XmlQueryCardinality.One, "ChoiceType member types must be prime types.");
972Debug.Assert(prime != null, "SequenceType can only modify the cardinality of a non-null XmlQueryType.");
973Debug.Assert(prime.IsSingleton, "Prime type must have cardinality one.");
1182Debug.Fail($"Don't know how to serialize {type.GetType()}");
1201Debug.Fail("Unexpected XmlQueryType's subtype id");
System\Xml\Xsl\XPath\XPathBuilder.cs (32)
46Debug.Fail("Must not be called");
67Debug.Assert(!_inTheBuild, "XPathBuilder is busy!");
80Debug.Assert(_inTheBuild, "StartBuild() wasn't called");
92Debug.Assert(numFixupCurrent >= 0, "Context fixup error");
93Debug.Assert(numFixupPosition >= 0, "Context fixup error");
94Debug.Assert(numFixupLast >= 0, "Context fixup error");
115Debug.Assert(op != XPathOperator.Unknown);
118Debug.Assert((opGroup != XPathOperatorGroup.Negate && right != null) || (opGroup == XPathOperatorGroup.Negate && right == null));
129Debug.Fail($"{op} is not a valid XPathOperator");
136Debug.Assert(op == XPathOperator.Or || op == XPathOperator.And);
147Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String);
148Debug.Assert(compType == XmlTypeCode.Boolean || left.XmlType!.IsSingleton && right.XmlType!.IsSingleton, "Both comparison operands must be singletons");
161Debug.Fail("Wrong operator type");
169Debug.Assert(val.XmlType!.IsSingleton);
170Debug.Assert(compType == XmlTypeCode.Boolean || compType == XmlTypeCode.Double || compType == XmlTypeCode.String, "I don't know what to do with RTF here");
214Debug.Assert(op == XPathOperator.Eq || op == XPathOperator.Ne);
247Debug.Assert(op == XPathOperator.Lt || op == XPathOperator.Le || op == XPathOperator.Gt || op == XPathOperator.Ge);
278Debug.Assert(op == XPathOperator.UnaryMinus);
294Debug.Fail("Wrong operator type");
301Debug.Assert(op == XPathOperator.Union);
414Debug.Fail("Invalid EnumValue 'XPathAxis'");
457Debug.Assert(nodeset.NodeType == QilNodeType.DocOrderDistinct,
561Debug.Assert(!args.IsReadOnly, "Writable collection expected");
602Debug.Fail($"{func.id} is present in the function table, but absent from the switch");
853Debug.Assert(current != null);
866Debug.Assert(environment != null);
890Debug.Assert(unknown.NodeType == QilNodeType.Unknown);
933Debug.Assert(_last != null);
938Debug.Assert(unknown != null);
988Debug.Assert(maxArgs == 0 || maxArgs == Infinity || argTypes != null && argTypes.Length == maxArgs);
1024Debug.Assert(numArgs > maxArgs);
1046Debug.Assert(args.Count == 0 || argTypes != null);
System\Xml\Xsl\Xslt\InvokeGenerator.cs (8)
60Debug.Assert(formalArg.Name.LocalName == "namespaces", "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs()");
61Debug.Assert(formalArg.DefaultValue != null, "PrecompileProtoTemplatesHeaders() set it");
71Debug.Assert(formalArg.Name!.NamespaceUri != XmlReservedNs.NsXslDebug, "Cur,Pos,Last don't have default values and should be always added to by caller in AddImplicitArgs(). We don't have $namespaces in !debug.");
86Debug.Assert(invokeType == T.ItemS, "Actual argument type is not a subtype of formal argument type");
104Debug.Assert(argName != null);
132Debug.Assert(_formalArgs![prevArg] != null, "formalArg must be in the list");
133Debug.Assert(_invokeArgs![prevArg] != null, "This arg should be compiled already");
151Debug.Assert(_invokeArgs[prevArg] is QilIterator);
System\Xml\Xsl\Xslt\QilGenerator.cs (56)
136Debug.Assert(compiler != null);
229Debug.Assert(IsDebug && _curLoop.IsFocusSet);
236Debug.Assert(!_curLoop.IsFocusSet && !_funcFocus.IsFocusSet, "Must be compiled using singleton focus");
436Debug.Assert(IsDebug, "This is debug only logic");
440Debug.Assert(var.XmlType!.IsSubtypeOf(T.NamespaceS));
441Debug.Assert(var.Binding is QilList);
450Debug.Assert(nsList[i].NodeType == QilNodeType.NamespaceDecl);
451Debug.Assert(varList[i].NodeType == QilNodeType.NamespaceDecl);
482Debug.Assert(tmpl != null && tmpl.Function == null);
483Debug.Assert(tmpl.NodeType == XslNodeType.AttributeSet || tmpl.NodeType == XslNodeType.Template);
512Debug.Assert(tmpl.NodeType == XslNodeType.Template);
606Debug.Assert((template != null) == (tmpl.SourceLine != null), "Templates must have line information, and attribute sets must not");
614Debug.Assert(!IsDebug, "In debug mode we don't generate parumWithCalls functions. Otherwise focus flags should be adjusted");
647Debug.Assert(tmpl != null && tmpl.Function != null && tmpl.Function.Definition.NodeType == QilNodeType.Unknown);
657Debug.Assert(tmpl is Template, "Only templates can have explicit arguments");
660Debug.Assert(arg.DefaultValue == null, "Argument must not be compiled yet");
704Debug.Assert(instructions != null);
747default: Debug.Fail($"Unexpected type of AST node: {nodeType}"); result = null; break;
751Debug.Assert(result != null, "Result of compilation should not be null");
987Debug.Assert(pos < source.Length);
1023Debug.Assert(i == source.Length || source[i] == '{');
1077Debug.Assert(avt != null);
1129Debug.Assert(_curLoop.IsFocusSet);
1183Debug.Assert(withParam.NodeType == XslNodeType.WithParam);
1219Debug.Assert(node.NodeType == XslNodeType.ApplyImports);
1220Debug.Assert(!_curLoop.IsFocusSet, "xsl:apply-imports cannot be inside of xsl:for-each");
1250Debug.Assert(tmpl.Function != null, "All templates should be already compiled");
1285Debug.Assert(attSet.Function != null, "All templates should be already compiled");
1421Debug.Assert(when.NodeType == XslNodeType.If || when.NodeType == XslNodeType.Otherwise);
1425Debug.Assert(result == null, "xsl:otherwise must be the last child of xsl:choose");
1464Debug.Assert(node.NodeType == XslNodeType.Variable);
1474Debug.Assert(node.NodeType == XslNodeType.Variable || node.NodeType == XslNodeType.Param || node.NodeType == XslNodeType.WithParam);
1506Debug.Assert(varValue.SourceLine == null);
1512Debug.Assert(withParam.NodeType == XslNodeType.WithParam);
1722Debug.Assert(result.XmlType == T.StringX);
1730Debug.Assert(sort.NodeType == XslNodeType.Sort);
1822Debug.Assert(0 < list.Count, "Pattern should have at least one filter");
1877Debug.Fail($"Unexpected NodeKind: {nodeKinds}");
2123Debug.Assert(num.Level == NumberLevel.Any);
2143Debug.Assert(sheet.TemplateMatches.Count == 0);
2227Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param);
2263Debug.Assert(varPar.NodeType == XslNodeType.Variable || varPar.NodeType == XslNodeType.Param);
2350Debug.Assert(expr != null);
2379Debug.Assert(pttrn != null);
2405Debug.Assert(pttrn != null);
2519Debug.Assert(
2585Debug.Assert(actualArgs[actArg].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()");
2666Debug.Assert(actualArgs[i].NodeType == XslNodeType.WithParam, "All Sorts was removed in CompileSorts()");
2693Debug.Assert(actualArgs[0].Name == _nameCurrent, "Caller should always pass $current as a first argument to apply-* calls.");
2757Debug.Assert(
2798Debug.Assert(!IsDebug, "Attempt to override SourceLineInfo in debug mode");
2804Debug.Assert(n.SourceLine == null);
2828Debug.Assert(nsVar.XmlType!.IsSubtypeOf(T.NamespaceS));
2873Debug.Assert(let.NodeType == QilNodeType.Let);
2879Debug.Assert(0 <= varScope && varScope <= _vars.Count);
2890Debug.Assert(_vars.Count == 0, "Accumulated variables left unclaimed");
System\Xml\Xsl\Xslt\XPathPatternBuilder.cs (36)
28Debug.Assert(environment != null);
44Debug.Assert(!_inTheBuild, "XPathBuilder is busy!");
52Debug.Assert(filter.NodeType == QilNodeType.Filter, "XPathPatternBuilder expected to generate list of Filters on top level");
53Debug.Assert(filter.Variable.XmlType!.IsSubtypeOf(T.NodeNotRtf));
54Debug.Assert(filter.Variable.Binding!.NodeType == QilNodeType.Unknown); // fixupNode
55Debug.Assert(filter.Body.XmlType!.IsSubtypeOf(T.Boolean));
67Debug.Assert(_inTheBuild, "StartBuild() wasn't called");
71Debug.Assert(_predicateEnvironment.numFixupCurrent >= 0, "Context fixup error");
72Debug.Assert(_predicateEnvironment.numFixupPosition >= 0, "Context fixup error");
73Debug.Assert(_predicateEnvironment.numFixupLast >= 0, "Context fixup error");
80Debug.Assert(op == XPathOperator.Union);
81Debug.Assert(left != null);
82Debug.Assert(right != null);
84Debug.Assert(right.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter");
92Debug.Assert(left.NodeType == QilNodeType.Filter, "LocationPathPattern must be compiled into a filter");
122Debug.Assert(
133Debug.Assert(nodeType == XPathNodeType.All && prefix == null && name == null, " // is the only d-o-s axes that we can have in pattern");
190Debug.Assert(left != null);
191Debug.Assert(right != null);
195Debug.Assert(nop.Child == _fixupNode);
199Debug.Assert(GetLastParent(left) == left, "Left is always single axis and never the step");
200Debug.Assert(left.NodeType == QilNodeType.Filter);
209Debug.Assert(nop.Child != null);
213Debug.Assert(right.NodeType == QilNodeType.Filter);
215Debug.Assert(lastParent != null);
226Debug.Fail("Should not call to this function.");
291Debug.Assert(prefix.Length == 0);
297Debug.Assert(
305Debug.Assert(name == "key", "Unexpected function");
306Debug.Assert(
355Debug.Assert(parent.NodeType == QilNodeType.Filter);
376Debug.Assert(context != null, "Predicate always has step so it can't have context == null");
377Debug.Assert(context.Variable.NodeType == QilNodeType.For, "It shouldn't be Let, becaus predicates in PatternBuilder don't produce cached tuples.");
430Debug.Assert(current != null);
444Debug.Fail("GetPosition() must not be called");
450Debug.Fail("GetLast() must not be called");
System\Xml\Xsl\Xslt\XsltInput.cs (37)
43Debug.Assert(reader != null);
44Debug.Assert(atoms != null);
77Debug.Assert(tr.Settings == null, "XmlReader created with XmlReader.Create should always expand entities.");
201Debug.Assert(
244Debug.Assert(_reader.NodeType == XmlNodeType.EntityReference);
246Debug.Assert(local[0] == '#' || local == "lt" || local == "gt" || local == "quot" || local == "apos");
258Debug.Assert(_reader.NodeType == XmlNodeType.Text || _reader.NodeType == XmlNodeType.Whitespace || _reader.NodeType == XmlNodeType.SignificantWhitespace);
261Debug.Assert(_reader.NodeType == XmlNodeType.EndEntity);
273Debug.Assert(_reader.NodeType == XmlNodeType.Attribute, "reader.NodeType == XmlNodeType.Attribute");
323Debug.Assert(_reader.NodeType == XmlNodeType.Text, "Unexpected node type inside attribute value");
332Debug.Assert(_reader.NodeType != XmlNodeType.EntityReference);
348Debug.Assert(_nodeType == XmlNodeType.Element, "To call MoveToFirstChild() XsltInut should be positioned on an Element.");
358Debug.Assert(_nodeType != XmlNodeType.Element || IsEmptyElement, "On non-empty elements we should call MoveToFirstChild()");
441Debug.Assert(_nodeType == XmlNodeType.Text || _nodeType == XmlNodeType.Whitespace || _nodeType == XmlNodeType.SignificantWhitespace);
488Debug.Assert(_reader.NodeType == XmlNodeType.Element);
518Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToElement() we should be positioned on Element or Attribute");
524Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute");
539Debug.Assert(_nodeType == XmlNodeType.Element, "For MoveToLiteralAttribute() we should be positioned on Element or Attribute");
554Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error.");
566Debug.Assert(_attributes != null && _attributes[attNum].name == attName, "Attribute numbering error.");
589Debug.Assert(_nodeType == XmlNodeType.Element || _nodeType == XmlNodeType.EndElement, "Input is positioned on element or attribute");
620Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
628Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
637Debug.Assert(_nodeType != XmlNodeType.Element || _attributesRead, "Should first read attributes");
650Debug.Assert(IsKeyword(_atoms.Version));
714Debug.Assert(NodeType == XmlNodeType.Element);
715Debug.Assert(attributes.Length <= _xsltAttributeNumber.Length);
750Debug.Assert(SS, "First we parse xsl:stylesheet element");
843Debug.Assert(NodeType == XmlNodeType.Element);
921Debug.Assert(NodeType == XmlNodeType.Element && IsXsltNamespace());
948Debug.Assert(extensions ? IsKeyword(_atoms.ExtensionElementPrefixes) : IsKeyword(_atoms.ExcludeResultPrefixes));
1001Debug.Assert(IsKeyword(_atoms.XPathDefaultNamespace));
1013Debug.Assert(IsKeyword(_atoms.DefaultCollation));
1095Debug.Assert(prefix != null);
1099Debug.Assert(Ref.Equal(_atoms.NameTable.Get(nsUri), nsUri), "Namespaces must be atomized");
1179Debug.Assert(input.NodeType == XmlNodeType.EndElement);
1184Debug.Assert(input.NodeType == XmlNodeType.Element || input.NodeType == XmlNodeType.Attribute);
System\Xml\Xsl\Xslt\XsltLoader.cs (42)
43Debug.Assert(compiler != null);
98Debug.Fail("Should never get here");
102Debug.Assert(compiler.Root != null);
177Debug.Assert(_compiler.Version != 0, "Version should be already decided at this point");
236Debug.Assert(!_documentUriInUse.Contains(baseUri), "Circular references must be checked while processing xsl:include and xsl:import");
298Debug.Assert(_input.NodeType == XmlNodeType.Element);
323Debug.Assert(!_input.IsXsltNamespace());
324Debug.Assert(_curTemplate == null);
341Debug.Fail("AddTemplate() returned false for simplified stylesheet");
355Debug.Assert(_input.IsXsltNamespace() && (_input.IsKeyword(_atoms.Stylesheet) || _input.IsKeyword(_atoms.Transform)));
468Debug.Assert(_input.NodeType == XmlNodeType.Text);
825Debug.Assert(attSet != null);
836Debug.Assert(attSet.CycleCheck == CycleCheck.Processing);
837Debug.Assert(attSet.Content[0].SourceLine != null);
957Debug.Assert(NumCharAttrs == DefaultValues.Length);
973Debug.Assert(dummy, "One of the attrs should have lineInfo. If both are default they can't conflict.");
993Debug.Assert(name.Equals(format.Name));
1067Debug.Assert(setName != null, "Required attribute always != null");
1112Debug.Assert(_input.NodeType == XmlNodeType.Text);
1123Debug.Assert(_curTemplate == null);
1124Debug.Assert(!_input.CanHaveApplyImports);
1141Debug.Assert(_curTemplate == null);
1457Debug.Assert(_input.NodeType == XmlNodeType.Text);
1505Debug.Assert(_input.NodeType == XmlNodeType.Text);
1718Debug.Assert(_input.NodeType == XmlNodeType.Text);
1923Debug.Assert(nodeType != XslNodeType.Unknown);
2036Debug.Assert(_input.NodeType == XmlNodeType.Element);
2482Debug.Assert(_input.NodeType == XmlNodeType.Element);
2525Debug.Assert(content != null && withParam != null);
2526Debug.Assert(withParam.NodeType == XslNodeType.WithParam);
2539Debug.Assert(content != null);
2548Debug.Assert(content != null);
2802Debug.Assert(_input.IsRequiredAttribute(attNum), "It happened that @name as NCName is always required attribute");
2892Debug.Assert(_input.LocalName == "use-attribute-sets", "we are positioned on this attribute");
2893Debug.Assert(list != null && list.Count == 0, "It happened that we always add use-attribute-sets first. Otherwise we can't call list.Clear()");
2956Debug.Assert(!_input.IsRequiredAttribute(attNum), "All Yes/No attributes are optional.");
2976Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'type' attributes are optional.");
2985Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'validation' attributes are optional.");
3011Debug.Assert(!_input.IsRequiredAttribute(attNum), "All 'input-type-validation' attributes are optional.");
3075Debug.Assert(node != null);
3082Debug.Assert(node != null);
3092Debug.Assert(to != null);
System\Xml\Xsl\XsltOld\Processor.cs (45)
127Debug.Assert(_execResult == ExecResult.Continue);
141Debug.Assert(_resolver != null, "Constructor should create it if null passed");
150Debug.Assert(_sortArray != null, "InitSortArray() wasn't called");
201Debug.Assert(_sortArray != null, "InitSortArray() wasn't called");
279Debug.Assert(!_stringBuilderLocked);
436Debug.Assert(_actionStack != null);
444Debug.Assert(_builder != null);
476Debug.Assert(frame != null);
505Debug.Assert(_templateLookup != null);
512Debug.Assert(key != Compiler.InvalidQueryKey);
518Debug.Assert(key != Compiler.InvalidQueryKey);
533Debug.Assert(key != Compiler.InvalidQueryKey);
602Debug.Assert(nav.NodeType == XPathNodeType.Element);
721Debug.Assert(_builder != null);
731Debug.Assert(_xsm != null);
745Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
746Debug.Assert(ExecutionResult == ExecResult.Continue);
750Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
762Debug.Fail("Unexpected result of RecordBuilder.BeginEvent()");
774Debug.Assert(_xsm != null);
787Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
788Debug.Assert(ExecutionResult == ExecResult.Continue);
792Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
802Debug.Fail("Unexpected result of RecordBuilder.TextEvent()");
809Debug.Assert(_xsm != null);
823Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State);
827Debug.Assert(StateMachine.StateOnly(stateOutlook) == _xsm.State,
837Debug.Fail("Unexpected result of RecordBuilder.TextEvent()");
865Debug.Fail("Invalid XPathNodeType in CopyBeginEvent");
894Debug.Fail("Invalid XPathNodeType in CopyTextEvent");
924Debug.Fail("Invalid XPathNodeType in CopyEndEvent");
933Debug.Assert(navigator != null);
956Debug.Assert(output != null);
967Debug.Assert(_builder != null);
1016Debug.Assert(saveStackSize == _actionStack.Length);
1018Debug.Assert(result != null, "Variable was just calculated and result can't be null");
1029Debug.Assert(1 < _actionStack.Length);
1042Debug.Assert(2 < _actionStack.Length);
1057Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
1069Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
1075Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
1077Debug.Assert(dbgFrame != null, "PushDebuggerStack() wasn't ever called");
1084Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
1085Debug.Assert(2 <= _debuggerStack!.Length);
1091Debug.Assert(this.Debugger != null, "We don't generate calls this function if ! debugger");
System.Private.Xml.Linq (33)
System.Reflection.Context (72)
System.Reflection.DispatchProxy (11)
System.Reflection.Emit (31)
System.Reflection.Metadata (319)
System.Reflection.MetadataLoadContext (153)
System.Resources.Extensions (54)
src\runtime\src\libraries\System.Private.CoreLib\src\System\Resources\ResourceReader.cs (32)
46Debug.Assert(value >= 0, "negative ResourceTypeCode. What?");
191Debug.Assert(index >= 0 && index < _numResources, $"Bad index into hash array. index: {index}");
195Debug.Assert(_nameHashes != null && _nameHashesPtr == null, "Internal state mangled.");
200Debug.Assert(_nameHashes == null && _nameHashesPtr != null, "Internal state mangled.");
207Debug.Assert(index >= 0 && index < _numResources, $"Bad index into name position array. index: {index}");
211Debug.Assert(_namePositions != null && _namePositionsPtr == null, "Internal state mangled.");
216Debug.Assert(_namePositions == null && _namePositionsPtr != null, "Internal state mangled.");
252Debug.Assert(_store != null, "ResourceReader is closed!");
333Debug.Assert(_store != null, "ResourceReader is closed!");
334Debug.Assert(Monitor.IsEntered(this)); // uses _store
376Debug.Assert(_store != null, "ResourceReader is closed!");
447Debug.Assert(_store != null, "ResourceReader is closed!");
471Debug.Assert(_store != null, "ResourceReader is closed!");
533Debug.Assert(_store != null, "ResourceReader is closed!");
534Debug.Assert(_version == 1, ".resources file was not a V1 .resources file!");
535Debug.Assert(Monitor.IsEntered(this)); // uses _store
555Debug.Assert(Monitor.IsEntered(this)); // uses _store
615Debug.Assert(_store != null, "ResourceReader is closed!");
616Debug.Assert(_version >= 2, ".resources file was not a V2 (or higher) .resources file!");
617Debug.Assert(Monitor.IsEntered(this)); // uses _store
637Debug.Assert(Monitor.IsEntered(this)); // uses _store
723Debug.Assert(r == len, "ResourceReader needs to use a blocking read here. (Call _store.ReadBytes(len)?)");
775Debug.Assert(!Monitor.IsEntered(this)); // only called during init
776Debug.Assert(_store != null, "ResourceReader is closed!");
798Debug.Assert(!Monitor.IsEntered(this)); // only called during init
987Debug.Assert(Monitor.IsEntered(this)); // uses _store
995Debug.Assert(_typeTable[typeIndex] != null, "Should have found a type!");
1026Debug.Assert(typeCode >= 0, "can't be negative");
1027Debug.Assert(Monitor.IsEntered(this)); // uses _store
1031Debug.Assert(!string.Equals(typeCode.ToString(), "LastPrimitive"), "Change ResourceTypeCode metadata order so LastPrimitive isn't what Enum.ToString prefers.");
1037Debug.Assert(typeIndex >= 0 && typeIndex < _typeTable.Length, "TypeCode is broken or corrupted!");
1111Debug.Assert(!Monitor.IsEntered(_reader));
System.Resources.Writer (8)
System.Runtime (1)
System.Runtime.Caching (126)
System\Runtime\Caching\CacheExpires.cs (50)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex");
28Debug.Assert((entryIndex & ENTRY_MASK) == entryIndex, "(entryIndex & ENTRY_MASK) == entryIndex");
29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0");
118Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0");
119Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0");
120Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
182Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
188Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1");
201Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
207Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1");
220Debug.Assert(list._head != -1, "list._head != -1");
229Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
233Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex");
238Debug.Assert(list._head == pageIndex, "list._head == pageIndex");
244Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex");
249Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex");
259Debug.Assert(list._head != -1, "list._head != -1");
260Debug.Assert(list._tail != -1, "list._tail != -1");
272Debug.Assert(list._head != -1, "list._head != -1");
273Debug.Assert(list._tail != -1, "list._tail != -1");
293Debug.Assert(capacity > 0, "capacity > 0");
294Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0");
307Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES");
312Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null");
328Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0");
338Debug.Assert(((entries)[0]._next).IsInvalid, "FreeEntryHead(entries).IsInvalid");
349Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null");
370Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse");
371Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1");
372Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1");
386Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength");
387Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES");
392Debug.Assert(newLength > oldLength, "newLength > oldLength");
439Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1");
440Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1");
441Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
476Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0");
486Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
488Debug.Assert(newRef.PageIndex != _freeEntryList._tail, "newRef.PageIndex != _freeEntryList._tail");
512Debug.Assert((cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid, "(cacheEntry.ExpiresBucket == 0xff) == entryRef.IsInvalid");
522Debug.Assert(cacheEntry.ExpiresBucket == 0xff, "cacheEntry.ExpiresBucket == 0xff");
523Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid");
567Debug.WriteLine("CacheExpiresRemove",
594Debug.Assert(cacheEntry == entries[entryIndex]._cacheEntry);
610Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
628Debug.Assert(!_blockReduce, "_blockReduce == false");
695Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid");
709Debug.Assert(cacheEntry.ExpiresEntryRef.IsInvalid, "cacheEntry.ExpiresEntryRef.IsInvalid");
738Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
775Debug.Assert(NUMBUCKETS < byte.MaxValue);
System\Runtime\Caching\CacheUsage.cs (60)
27Debug.Assert((pageIndex & 0x00ffffff) == pageIndex, "(pageIndex & 0x00ffffff) == pageIndex");
28Debug.Assert((Math.Abs(entryIndex) & ENTRY_MASK) == (Math.Abs(entryIndex)), "(Math.Abs(entryIndex) & ENTRY_MASK) == Math.Abs(entryIndex)");
29Debug.Assert(entryIndex != 0 || pageIndex == 0, "entryIndex != 0 || pageIndex == 0");
52Debug.Assert(result > 0, "result > 0");
62Debug.Assert(result < 0, "result < 0");
148Debug.Assert(_cPagesInUse == 0, "_cPagesInUse == 0");
149Debug.Assert(_cEntriesInUse == 0, "_cEntriesInUse == 0");
150Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
151Debug.Assert(_lastRefHead.IsInvalid, "_lastRefHead.IsInvalid");
152Debug.Assert(_lastRefTail.IsInvalid, "_lastRefTail.IsInvalid");
153Debug.Assert(_addRef2Head.IsInvalid, "_addRef2Head.IsInvalid");
165Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
171Debug.Assert((_pages[(list._head)]._pagePrev) == -1, "PagePrev(list._head) == -1");
184Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
190Debug.Assert((_pages[(list._tail)]._pageNext) == -1, "PageNext(list._tail) == -1");
203Debug.Assert(list._head != -1, "list._head != -1");
212Debug.Assert((list._head == -1) == (list._tail == -1), "(list._head == -1) == (list._tail == -1)");
216Debug.Assert((_pages[((_pages[(pageIndex)]._pagePrev))]._pageNext) == pageIndex, "PageNext(PagePrev(pageIndex)) == pageIndex");
221Debug.Assert(list._head == pageIndex, "list._head == pageIndex");
227Debug.Assert((_pages[((_pages[(pageIndex)]._pageNext))]._pagePrev) == pageIndex, "PagePrev(PageNext(pageIndex)) == pageIndex");
232Debug.Assert(list._tail == pageIndex, "list._tail == pageIndex");
242Debug.Assert(list._head != -1, "list._head != -1");
243Debug.Assert(list._tail != -1, "list._tail != -1");
254Debug.Assert(list._head != -1, "list._head != -1");
255Debug.Assert(list._tail != -1, "list._tail != -1");
273Debug.Assert(capacity > 0, "capacity > 0");
274Debug.Assert(MIN_LOAD_FACTOR < 1.0, "MIN_LOAD_FACTOR < 1.0");
287Debug.Assert((((_pages[(pageIndex)]._entries))[0]._cFree) == NUM_ENTRIES, "FreeEntryCount(EntriesI(pageIndex)) == NUM_ENTRIES");
292Debug.Assert((_pages[(pageIndex)]._entries) != null, "EntriesI(pageIndex) != null");
308Debug.Assert(_freeEntryList._head >= 0, "_freeEntryList._head >= 0");
318Debug.Assert(((entries)[0]._ref1._next).IsInvalid, "FreeEntryHead(entries).IsInvalid");
326Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
331Debug.Assert(entries[entryIndex]._cacheEntry == null, "entries[entryIndex]._cacheEntry == null");
355Debug.Assert(_cPagesInUse * NUM_ENTRIES == _cEntriesInUse, "_cPagesInUse * NUM_ENTRIES == _cEntriesInUse");
356Debug.Assert(_freeEntryList._head == -1, "_freeEntryList._head == -1");
357Debug.Assert(_freeEntryList._tail == -1, "_freeEntryList._tail == -1");
371Debug.Assert(_cPagesInUse == oldLength, "_cPagesInUse == oldLength");
372Debug.Assert(_cEntriesInUse == oldLength * NUM_ENTRIES, "_cEntriesInUse == oldLength * ExpiresEntryRef.NUM_ENTRIES");
377Debug.Assert(newLength > oldLength, "newLength > oldLength");
424Debug.Assert(_freeEntryList._head != -1, "_freeEntryList._head != -1");
425Debug.Assert(_freeEntryList._tail != -1, "_freeEntryList._tail != -1");
426Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
459Debug.Assert(((entries)[0]._cFree) > 0, "FreeEntryCount(entries) > 0");
469Debug.Assert(_freeEntryList._head != _freeEntryList._tail, "_freeEntryList._head != _freeEntryList._tail");
472Debug.Assert(newRef1.PageIndex != _freeEntryList._tail, "newRef1.PageIndex != _freeEntryList._tail");
478Debug.Assert(cacheEntry.UsageEntryRef == oldRef1, "cacheEntry.UsageEntryRef == oldRef1");
487Debug.Assert(prev != oldRef2, "prev != oldRef2");
505Debug.Assert(next != oldRef1, "next != oldRef1");
531Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid");
583Debug.Assert(entryRef.IsRef1, "entryRef.IsRef1");
682Debug.Assert(maxFlush > 0, $"maxFlush is not greater than 0, instead is {maxFlush}");
683Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
700Debug.Assert(!_blockReduce, "_blockReduce == false");
709Debug.Assert(_cEntriesInUse > 0, "_cEntriesInUse > 0");
723Debug.Assert(utcDate != DateTime.MinValue, "utcDate != DateTime.MinValue");
731Debug.Assert(cacheEntry.UsageEntryRef == prev1, "cacheEntry.UsageEntryRef == prev1");
761Debug.Assert(!inFlushHead.IsInvalid, "!inFlushHead.IsInvalid");
775Debug.Assert(cacheEntry.UsageEntryRef.IsInvalid, "cacheEntry.UsageEntryRef.IsInvalid");
801Debug.Assert(_cEntriesInFlush == 0, "_cEntriesInFlush == 0");
851Debug.Assert(bucket != 0xff, "bucket != 0xff");
System.Runtime.InteropServices (3)
System.Runtime.Numerics (379)
System.Runtime.Serialization.Formatters (54)
System.Runtime.Serialization.Schema (46)
System\Runtime\Serialization\Schema\CodeExporter.cs (43)
262Debug.Assert(classContract.Is(DataContractType.ClassDataContract));
314Debug.Assert(contractCodeDomInfo.TypeReference != null);
496Debug.Assert(containingContractCodeDomInfo.TypeDeclaration != null, "Nested types have containing types by definition - types with declaration");
513Debug.Assert(containingContractCodeDomInfo.TypeReference != null, "Nested types have containing types by definition - types with reference");
530Debug.Assert(assemblyName.Name != null, $"Current executing assembly name is not expected to be null in {nameof(CodeExporter)}.{nameof(CreateTypeDeclaration)} scenario");
587Debug.Assert(typeReference != null);
612Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract));
620Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract");
643Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract));
644Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract");
661Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract));
662Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract");
674Debug.Assert(itemContract != null);
675Debug.Assert(itemContract.DataMembers.Count >= 2);
793Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract));
800Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
834Debug.Assert(baseContractCodeDomInfo.IsProcessed, "Cannot generate code for type if code for base type has not been generated");
835Debug.Assert(baseContractCodeDomInfo.TypeReference != null, "Class data contracts should have non-null TypeReference");
841Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type
949Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract));
986Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract));
987Debug.Assert(classDataContract.KnownDataContracts != null);
999Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract));
1009Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1074Debug.Assert(enumDataContract.Is(DataContractType.EnumDataContract));
1081Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1085Debug.Assert(enumDataContract.BaseContract != null, "BaseContract should not be null for EnumDataContract");
1124Debug.Assert(classDataContract.Is(DataContractType.ClassDataContract));
1138Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1171Debug.Assert(baseContractCodeDomInfo.TypeReference != null, "Class data contracts should have non-null TypeReference");
1176Debug.Assert(actualType != null); // If we're in this if condition, then we should be able to get a Type
1186Debug.Assert(keyValueContract == null || keyValueContract.Is(DataContractType.ClassDataContract));
1208Debug.Assert(collectionContract.Is(DataContractType.CollectionDataContract));
1223Debug.Assert(collectionContract.BaseContract != null, "BaseContract should not be null for CollectionDataContract");
1255Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1256Debug.Assert(baseTypeReference != null, "Base type reference should not be null for Dictionary/List collection data contracts");
1265Debug.Assert(itemName != null, "ItemName is never null for Collection contracts.");
1270Debug.Assert(keyName != null);
1271Debug.Assert(valueName != null);
1288Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1394Debug.Assert(contractCodeDomInfo.TypeDeclaration != null);
1517Debug.Assert(clrNamespace != null);
1518Debug.Assert(codeNamespace != null);
System.Security.AccessControl (28)
System.Security.Cryptography (876)
src\runtime\src\libraries\Common\src\System\Security\Cryptography\DSACng.ImportExport.cs (9)
215Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB)}");
225Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}");
280Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}");
290Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}");
307Debug.Assert(offset == blobSize, $"Expected offset = blobSize, got {offset} != {blobSize}");
363Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB)}");
374Debug.Assert(magic == KeyBlobMagicNumber.BCRYPT_DSA_PUBLIC_MAGIC_V2 || magic == KeyBlobMagicNumber.BCRYPT_DSA_PRIVATE_MAGIC_V2);
395Debug.Assert(offset == sizeof(BCRYPT_DSA_KEY_BLOB_V2), $"Expected offset = sizeof(BCRYPT_DSA_KEY_BLOB_V2), got {offset} != {sizeof(BCRYPT_DSA_KEY_BLOB_V2)}");
415Debug.Assert(offset == dsaBlob.Length, $"Expected offset = dsaBlob.Length, got {offset} != {dsaBlob.Length}");
System.Security.Cryptography.Cose (47)
System.Security.Cryptography.Pkcs (181)
System.Security.Cryptography.ProtectedData (8)
System.Security.Cryptography.Xml (67)
System\Security\Cryptography\Xml\SignedXmlDebugLog.cs (52)
212Debug.Assert(key != null, "key != null");
255Debug.Assert(o != null, "o != null");
265Debug.Assert(oid != null, "oid != null");
281Debug.Assert(signedXml != null, "signedXml != null");
282Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null");
316Debug.Assert(signedXml != null, "signedXml != null");
317Debug.Assert(formatValidator != null, "formatValidator != null");
339Debug.Assert(signedXml != null, "signedXml != null");
340Debug.Assert(signedInfo != null, " signedInfo != null");
358Debug.Assert(signedXml != null, "signedXml != null");
388Debug.Assert(signedXml != null, "signedXml != null");
418Debug.Assert(signedXml != null, "signedXml != null");
419Debug.Assert(canonicalizationTransform != null, "canonicalizationTransform != null");
443Debug.Assert(signedXml != null, "signedXml != null");
462Debug.Assert(signedXml != null, "signedXml != null");
463Debug.Assert(validAlgorithms != null, "validAlgorithms != null");
501Debug.Assert(signedXml != null, "signedXml != null");
502Debug.Assert(validC14nAlgorithms != null, "validC14nAlgorithms != null");
503Debug.Assert(validTransformAlgorithms != null, "validTransformAlgorithms != null");
544Debug.Assert(signedXml != null, "signedXml != null");
635Debug.Assert(signedXml != null, "signedXml != null");
636Debug.Assert(signatureDescription != null, "signatureDescription != null");
637Debug.Assert(hash != null, "hash != null");
638Debug.Assert(asymmetricSignatureFormatter != null, "asymmetricSignatureFormatter != null");
663Debug.Assert(signedXml != null, "signedXml != null");
664Debug.Assert(key != null, "key != null");
687Debug.Assert(signedXml != null, "signedXml != null");
688Debug.Assert(reference != null, "reference != null");
738Debug.Assert(signedXml != null, "signedXml != null");
739Debug.Assert(key != null, "key != null");
764Debug.Assert(signedXml != null, "signedXml != null");
765Debug.Assert(certificate != null, "certificate != null");
789Debug.Assert(signedXml != null, "signedXml != null");
790Debug.Assert(reference != null, "reference != null");
821Debug.Assert(signedXml != null, "signedXml != null");
822Debug.Assert(reference != null, "reference != null");
823Debug.Assert(actualHash != null, "actualHash != null");
824Debug.Assert(expectedHash != null, "expectedHash != null");
864Debug.Assert(signedXml != null, "signedXml != null");
865Debug.Assert(signatureDescription != null, "signatureDescription != null");
866Debug.Assert(hashAlgorithm != null, "hashAlgorithm != null");
867Debug.Assert(asymmetricSignatureDeformatter != null, "asymmetricSignatureDeformatter != null");
910Debug.Assert(signedXml != null, "signedXml != null");
911Debug.Assert(mac != null, "mac != null");
946Debug.Assert(signedXml != null, "signedXml != null");
947Debug.Assert(certificate != null, "certificate != null");
948Debug.Assert(chain != null, "chain != null");
1038Debug.Assert(signedXml != null, "signedXml != null");
1039Debug.Assert(reference != null, "reference != null");
1067Debug.Assert(source != null, "source != null");
1068Debug.Assert(!string.IsNullOrEmpty(data), "!string.IsNullOrEmpty(data)");
1069Debug.Assert(InformationLoggingEnabled, "InformationLoggingEnabled");
System.Security.Principal.Windows (14)
System.ServiceModel.Federation (1)
System.ServiceModel.Primitives (1)
System.ServiceModel.Syndication (27)
System.ServiceProcess.ServiceController (6)
System.Speech (204)
System.Text.Encoding.CodePages (186)
System\Text\DBCSCodePageEncoding.cs (39)
87Debug.Assert(m_codePageHeader?.Length > 0);
94Debug.Assert(pCodePage->CodePage == dataTableCodePage,
116Debug.Assert(_bytesUnknown == 0x3f,
139Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
179Debug.Assert(bytePosition < 0x100, "[DBCSCodePageEncoding.LoadManagedCodePage]expected lead byte to be < 0x100");
251Debug.Assert(bytesRead == m_dataSize, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
392Debug.Assert((arrayTemp.Length / 2) < 20,
514Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetByteCount]count is negative");
515Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetByteCount]chars is null");
518Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetByteCount]Attempting to use null fallback");
545Debug.Assert(char.IsHighSurrogate(charLeftOver), "[DBCSCodePageEncoding.GetByteCount]leftover character should be high surrogate");
546Debug.Assert(encoder != null,
610Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetBytes]bytes is null");
611Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetBytes]byteCount is negative");
612Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetBytes]chars is null");
613Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetBytes]charCount is negative");
616Debug.Assert(EncoderFallback != null, "[DBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback");
636Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver),
651Debug.Assert(encoder != null,
684Debug.Assert(encoder == null,
707Debug.Assert(chars > charStart,
726Debug.Assert(chars > charStart,
759Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetCharCount]bytes is null");
760Debug.Assert(count >= 0, "[DBCSCodePageEncoding.GetCharCount]byteCount is negative");
776Debug.Assert(decoder == null ||
796Debug.Assert(fallbackBuffer == null,
821Debug.Assert(fallbackBuffer == null,
896Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
908Debug.Assert(bytes != null, "[DBCSCodePageEncoding.GetChars]bytes is null");
909Debug.Assert(byteCount >= 0, "[DBCSCodePageEncoding.GetChars]byteCount is negative");
910Debug.Assert(chars != null, "[DBCSCodePageEncoding.GetChars]chars is null");
911Debug.Assert(charCount >= 0, "[DBCSCodePageEncoding.GetChars]charCount is negative");
929Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
950Debug.Assert(fallbackBuffer == null,
976Debug.Assert(fallbackBuffer == null,
1054Debug.Assert(bytes >= byteStart + byteBuffer.Length,
1068Debug.Assert(bytes > byteStart,
1073Debug.Assert(bytes > byteStart,
1099Debug.Assert(decoder == null || !decoder.m_throwOnOverflow ||
System\Text\GB18030Encoding.cs (13)
166Debug.Assert(count4Byte <= GBLast4ByteCode,
186Debug.Assert(unicodeCount == 0,
190Debug.Assert(count4Byte == GBLast4ByteCode + 1,
217Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetBytes]byteCount is negative");
218Debug.Assert(chars != null, "[GB18030Encoding.GetBytes]chars is null");
219Debug.Assert(charCount >= 0, "[GB18030Encoding.GetBytes]charCount is negative");
222Debug.Assert(EncoderFallback != null, "[GB18030Encoding.GetBytes]Attempting to use null encoder fallback");
244Debug.Assert(char.IsHighSurrogate(charLeftOver),
274Debug.Assert(offset < 0x6f,
324Debug.Assert(iBytes < 0x7e,
402Debug.Assert(bytes != null, "[GB18030Encoding.GetChars]bytes is null");
403Debug.Assert(byteCount >= 0, "[GB18030Encoding.GetChars]byteCount is negative");
405Debug.Assert(charCount >= 0, "[GB18030Encoding.GetChars]charCount is negative");
System\Text\ISCIIEncoding.cs (32)
60Debug.Assert(_defaultCodePage >= CodeDevanagari && _defaultCodePage <= CodePunjabi,
129Debug.Assert(chars != null, "[ISCIIEncoding.GetBytes]chars!=null");
131Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetBytes]charCount >=0");
132Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetBytes]byteCount >=0");
228Debug.Assert(indicScript != 0, "[ISCIIEncoding.GetBytes]expected an indic script value");
239Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi,
254Debug.Assert((indicTwoBytes >> 12) > 0 && (indicTwoBytes >> 12) <= 3,
318Debug.Assert(bytes != null, "[ISCIIEncoding.GetChars]bytes is null");
319Debug.Assert(byteCount >= 0, "[ISCIIEncoding.GetChars]byteCount is negative");
321Debug.Assert(charCount >= 0, "[ISCIIEncoding.GetChars]charCount is negative");
352Debug.Assert(currentCodePage >= CodeDevanagari && currentCodePage <= CodePunjabi,
372Debug.Assert(((bLastVirama ? 1 : 0) + (bLastATR ? 1 : 0) +
431Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastATR mode");
432Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastATR mode");
433Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastATR mode");
434Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastATR mode");
462Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastVirama mode");
463Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in bLastVirama mode");
464Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastVirama mode");
465Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastVirama mode");
498Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in bLastDevenagariStressAbbr mode");
499Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in bLastDevenagariStressAbbr mode");
500Debug.Assert(cLastCharForNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNextNukta in bLastDevenagariStressAbbr mode");
501Debug.Assert(cLastCharForNoNextNukta == (char)0, "[ISCIIEncoding.GetChars] Expected no cLastCharForNoNextNukta in bLastDevenagariStressAbbr mode");
506Debug.Assert(cLastCharForNextNukta > 0 && cLastCharForNoNextNukta > 0,
528Debug.Assert(!bLastATR, "[ISCIIEncoding.GetChars] Expected no bLastATR in cLastCharForNextNukta mode");
529Debug.Assert(!bLastVirama, "[ISCIIEncoding.GetChars] Expected no bLastVirama in cLastCharForNextNukta mode");
530Debug.Assert(!bLastDevenagariStressAbbr, "[ISCIIEncoding.GetChars] Expected no bLastDevenagariStressAbbr in cLastCharForNextNukta mode");
535Debug.Assert(!bLastSpecial && !bLastDevenagariStressAbbr && !bLastVirama && !bLastATR &&
554Debug.Assert(currentCodePageIndex != -1, "[ISCIIEncoding.GetChars]Expected valid currentCodePageIndex != -1");
600Debug.Assert(currentCodePage == CodeDevanagari && b == DevenagariExt,
652Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\ISO2022Encoding.cs (24)
226Debug.Assert(count >= 0, "[ISO2022Encoding.GetByteCount]count is negative");
227Debug.Assert(chars != null, "[ISO2022Encoding.GetByteCount]chars is null");
237Debug.Assert(chars != null, "[ISO2022Encoding.GetBytes]chars is null");
238Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetBytes]byteCount is negative");
239Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetBytes]charCount is negative");
242Debug.Assert(EncoderFallback != null, "[ISO2022Encoding.GetBytes]Attempting to use null encoder fallback");
277Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharCount]bytes is null");
278Debug.Assert(count >= 0, "[ISO2022Encoding.GetCharCount]byteCount is negative");
288Debug.Assert(bytes != null, "[ISO2022Encoding.GetChars]bytes is null");
289Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetChars]byteCount is negative");
290Debug.Assert(charCount >= 0, "[ISO2022Encoding.GetChars]charCount is negative");
314Debug.Fail("[ISO2022Encoding.GetChars] had unexpected code page");
376Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP5022xJP]leftover character should be high surrogate");
437Debug.Assert(CodePage == 50221, "[ISO2022Encoding.GetBytesCP5022xJP]Expected Code Page 50221");
617Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP50225KR]leftover character should be high surrogate");
717Debug.Assert(!encoder.MustFlush || !encoder.m_throwOnOverflow,
763Debug.Assert(char.IsHighSurrogate(charLeftOver), "[ISO2022Encoding.GetBytesCP52936]leftover character should be high surrogate");
1086Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
1180Debug.Assert(count > 0, "[ISO2022Encoding.DecrementEscapeBytes]count > 0");
1385Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
1443Debug.Assert(byteCount >= 0, "[ISO2022Encoding.GetCharsCP52936]count >=0");
1444Debug.Assert(bytes != null, "[ISO2022Encoding.GetCharsCP52936]bytes!=null");
1553Debug.Assert(currentMode == ISO2022Modes.ModeHZ, "[ISO2022Encoding.GetCharsCP52936]Expected ModeHZ");
1677Debug.Assert(!decoder.MustFlush || !decoder.m_throwOnOverflow,
System\Text\SBCSCodePageEncoding.cs (37)
62Debug.Assert(m_codePageHeader?.Length > 0);
68Debug.Assert(pCodePage->CodePage == dataTableCodePage,
103Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
156Debug.Assert(bytesRead == buffer.Length, "s_codePagesEncodingDataStream.Read should have read a full buffer.");
171Debug.Assert(arrayTemp[byteTemp] == UNKNOWN_CHAR, $"[SBCSCodePageEncoding::ReadBestFitTable] Expected unallocated byte (not 0x{(int)arrayTemp[byteTemp]:X2}) for best fit byte at 0x{byteTemp:X2} for code page {CodePage}");
270Debug.Assert(arrayTemp[iBestFitCount - 1] != (char)0,
290Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetByteCount]count is negative");
291Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetByteCount]chars is null");
294Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetByteCount]Attempting to use null fallback");
306Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver),
311Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
352Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetByteCount]Expect to have encoder if we have a charLeftOver");
405Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
415Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetBytes]bytes is null");
416Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetBytes]byteCount is negative");
417Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetBytes]chars is null");
418Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetBytes]charCount is negative");
421Debug.Assert(EncoderFallback != null, "[SBCSCodePageEncoding.GetBytes]Attempting to use null encoder fallback");
433Debug.Assert(charLeftOver == 0 || char.IsHighSurrogate(charLeftOver),
438Debug.Assert(!encoder.m_throwOnOverflow || !encoder.InternalHasFallbackBuffer ||
537Debug.Assert(encoder != null, "[SBCSCodePageEncoding.GetBytes]Expect to have encoder if we have a charLeftOver");
596Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (fallback)");
612Debug.Assert(fallbackBuffer == null || !fallbackHelper.bFallingBack, "[SBCSCodePageEncoding.GetBytes]Expected to NOT be falling back");
615Debug.Assert(chars > charStart, "[SBCSCodePageEncoding.GetBytes]Expected chars to have advanced (normal)");
640Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0, "[SBCSEncoding.GetBytes]Expected Empty fallback buffer at end");
649Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetCharCount]bytes is null");
650Debug.Assert(count >= 0, "[SBCSCodePageEncoding.GetCharCount]byteCount is negative");
669Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
727Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
738Debug.Assert(bytes != null, "[SBCSCodePageEncoding.GetChars]bytes is null");
739Debug.Assert(byteCount >= 0, "[SBCSCodePageEncoding.GetChars]byteCount is negative");
740Debug.Assert(chars != null, "[SBCSCodePageEncoding.GetChars]chars is null");
741Debug.Assert(charCount >= 0, "[SBCSCodePageEncoding.GetChars]charCount is negative");
765Debug.Assert(!decoder.m_throwOnOverflow || !decoder.InternalHasFallbackBuffer ||
849Debug.Assert(bytes > byteStart,
868Debug.Assert(bytes > byteStart,
884Debug.Assert(fallbackBuffer == null || fallbackBuffer.Remaining == 0,
System.Text.Encodings.Web (45)
System.Text.Json (1543)
System\Text\Json\BitStack.cs (13)
80Debug.Assert(index >= 0, $"Set - Negative - index: {index}, arrayLength: {_array.Length}");
83Debug.Assert(_array.Length <= int.MaxValue / 32 + 1, $"index: {index}, arrayLength: {_array.Length}");
92Debug.Assert(index >= 0 && index > (int)((uint)_array.Length * 32 - 1), $"Only grow when necessary - index: {index}, arrayLength: {_array.Length}");
96Debug.Assert(elementIndex < _array.Length, $"Set - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}");
144Debug.Assert(_array is not null);
145Debug.Assert(index >= 0, $"Get - Negative - index: {index}, arrayLength: {_array.Length}");
149Debug.Assert(elementIndex < _array.Length, $"Get - index: {index}, elementIndex: {elementIndex}, arrayLength: {_array.Length}, extraBits: {extraBits}");
164Debug.Assert(_array is not null);
165Debug.Assert(_array.Length < int.MaxValue / 2, $"Array too large - arrayLength: {_array.Length}");
166Debug.Assert(minSize >= 0 && minSize >= _array.Length);
169Debug.Assert(nextDouble > minSize);
179Debug.Assert(_currentDepth == 0, "Only call SetFirstBit when depth is 0");
189Debug.Assert(_currentDepth == 0, "Only call ResetFirstBit when depth is 0");
System\Text\Json\Serialization\Converters\Value\EnumConverter.cs (15)
58Debug.Assert(EnumConverterFactory.Helpers.IsSupportedTypeCode(s_enumTypeCode));
147Debug.Assert(s_isFlagsEnum, "Should only be entered by flags enums.");
207Debug.Assert(s_isFlagsEnum || dictionaryKeyPolicy is not null, "Should only be entered by flags enums or dictionary key policy.");
238Debug.Assert(reader.TokenType is JsonTokenType.String or JsonTokenType.PropertyName);
368Debug.Assert(s_isSignedEnum);
398Debug.Assert(IsDefinedValueOrCombinationOfValues(key), "must only be invoked against valid enum values.");
399Debug.Assert(
432Debug.Assert(remainingBits == 0 && sb.Length > 0, "unexpected remaining bits or empty string.");
437Debug.Assert(dictionaryKeyPolicy is not null);
448Debug.Fail("should not have been reached.");
520Debug.Assert(allowsString || allowsNumber, "EnumConverter must allow strings, numbers, or both.");
540Debug.Assert(names.Length == values.Length);
619Debug.Assert(JsonName.Equals(other.JsonName, StringComparison.OrdinalIgnoreCase), "The conflicting entry must be equal up to case insensitivity.");
664Debug.Assert(input.Equals(JsonName.AsSpan(), StringComparison.OrdinalIgnoreCase), "Must equal the field name up to case insensitivity.");
674Debug.Assert(conflictingFields.Count > 0);
System\Text\Json\Serialization\Metadata\JsonPropertyInfo.cs (35)
29Debug.Assert(_effectiveConverter is not null);
140Debug.Assert(!IsConfigured);
371Debug.Assert(declaringTypeInfo is null || declaringType.IsAssignableFrom(declaringTypeInfo.Type));
385Debug.Assert(!info.IsForTypeInfo);
386Debug.Assert(!info.CanSerialize);
387Debug.Assert(!info.CanDeserialize);
413Debug.Assert(DeclaringTypeInfo is not null);
414Debug.Assert(!IsConfigured);
458Debug.Assert(!IgnoreNullTokensOnRead);
472Debug.Assert(Name is not null);
501Debug.Assert(Options.DefaultIgnoreCondition == JsonIgnoreCondition.Never);
523Debug.Assert(EffectiveConverter is not null, "Must have calculated the effective converter.");
527Debug.Assert(MemberType is 0 or MemberTypes.Field or MemberTypes.Property);
560Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo");
561Debug.Assert(!DeclaringTypeInfo.IsConfigured);
588Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo");
589Debug.Assert(!IsConfigured, "Should not be called post-configuration.");
590Debug.Assert(_jsonTypeInfo is not null, "Must have already been determined on configuration.");
615Debug.Assert(EffectiveConverter is not null, "Must have calculated the effective converter.");
616Debug.Assert(DeclaringTypeInfo is not null, "We should have ensured parent is assigned in JsonTypeInfo");
617Debug.Assert(!IsConfigured, "Should not be called post-configuration.");
657Debug.Assert(_jsonTypeInfo is not null);
658Debug.Assert(_jsonTypeInfo.IsConfigurationStarted);
704Debug.Assert(EffectiveConverter.ElementType != null);
756Debug.Assert(MemberType == MemberTypes.Property || MemberType == MemberTypes.Field || MemberType == default);
794Debug.Assert(_name is not null);
874Debug.Assert(propValue is Nodes.JsonObject);
889Debug.Assert(dictionaryValueInfo is JsonTypeInfo<TValue>);
916Debug.Assert(this == state.Current.JsonTypeInfo.ExtensionDataProperty);
959Debug.Assert(EffectiveConverter.CanPopulate, "Property is marked with Populate but converter cannot populate. This should have been validated in Configure");
960Debug.Assert(state.Parent.ReturnValue is not null, "Parent object is null");
961Debug.Assert(!state.Current.IsPopulating, "We've called TryGetPrePopulatedValue more than once");
972Debug.Assert(_jsonTypeInfo?.IsConfigurationStarted == true);
1069Debug.Assert(IsConfigured);
1074Debug.Assert(!IsConfigured);
System\Text\Json\Serialization\Metadata\JsonTypeInfoOfT.cs (11)
60Debug.Assert(createObject is null or Func<object> or Func<T>);
66Debug.Assert(_createObject is null);
67Debug.Assert(_typedCreateObject is null);
73Debug.Assert(_createObject is null);
74Debug.Assert(_typedCreateObject is null);
93Debug.Assert(createObject is Func<object>);
146Debug.Assert(deconstructor is null or Func<object, (Type?, object?)> or Func<T, (Type?, object?)>);
162Debug.Assert(deconstructor is Func<object, (Type?, object?)>);
204Debug.Assert(constructor is null or Func<Type, object?, object> or Func<Type, object?, T>);
220Debug.Assert(constructor is Func<Type, object?, object>);
243Debug.Assert(!IsReadOnly, "We should not mutate read-only JsonTypeInfo");
System.Text.Json.SourceGeneration (73)
System.Text.RegularExpressions (605)
System\Text\RegularExpressions\RegexCharClass.cs (22)
197Debug.Assert(
204Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})");
210Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i));
244Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge");
282Debug.Assert(!set.IsEmpty);
300Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. ");
474Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class");
574Debug.Assert(c != 0);
742Debug.Assert(count <= evaluated);
786Debug.Assert(set1Negated == set2Negated);
865Debug.Assert(!IsNegated(set1) && !IsNegated(set2));
982Debug.Assert((uint)comparison <= char.MaxValue);
1029Debug.Assert(twoChars.Length >= 2);
1115Debug.Assert(!hasSubtraction);
1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters");
1247Debug.Assert(ch < 128);
1265Debug.Assert(ch < 128);
1350Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed");
1440Debug.Assert(curcat < 0);
1541Debug.Assert(chars[index] < chars[index + 1]);
1600Debug.Assert(i == span.Length);
1849Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
System\Text\RegularExpressions\RegexCompiler.cs (99)
381Debug.Assert(_pool != null);
382Debug.Assert(_local != null);
383Debug.Assert(!_pool.Contains(_local));
392Debug.Assert(_regexTree != null);
413Debug.Assert(minRequiredLength >= 0);
491Debug.Fail($"Unexpected mode: {_regexTree.FindOptimizations.FindMode}");
782Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingString_LeftToRight or
837Debug.Assert(!string.IsNullOrEmpty(prefix));
869Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
943Debug.Assert(primarySet.Chars.Length > 0);
1125Debug.Assert(needLoop);
1141Debug.Assert(setIndex is 0 or 1);
1144Debug.Assert(needLoop);
1200Debug.Assert(_regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
1203Debug.Assert(set.Distance == 0);
1207Debug.Assert(!set.Negated);
1271Debug.Assert(_regexTree.FindOptimizations.LiteralAfterLoop is not null);
1274Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic);
1275Debug.Assert(target.LoopNode.N == int.MaxValue);
1305Debug.Assert(target.Literal.StringComparison is StringComparison.Ordinal);
1451Debug.Assert(_regexTree != null);
1457Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
1458Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child");
1639Debug.Assert(requiredLength > 0);
1673Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}");
1674Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
1677Debug.Assert(childCount >= 2);
1684Debug.Assert(node.Parent is not null);
1885Debug.Assert(sliceStaticPos == 0);
1948Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node.");
1953Debug.Assert(numChars != 0);
2028Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node.");
2090Debug.Assert(sliceStaticPos == 0);
2095Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}");
2105Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}");
2295Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}");
2296Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}");
2394Debug.Assert(needsEndConditional);
2454Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
2455Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}");
2593Debug.Assert(resumeAt is not null);
2647Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}");
2648Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2751Debug.Assert(startingCapturePos != null);
2773Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}");
2774Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2817Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}");
2818Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2941Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced.");
3070Debug.Fail($"Unexpected node type: {node.Kind}");
3076Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
3077Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}");
3120Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}");
3140Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}");
3141Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
3211Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
3214Debug.Assert(!rtl || offset is null);
3286Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected type: {node.Kind}");
3346Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}");
3347Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0);
3348Debug.Assert(sliceStaticPos >= 0);
3350Debug.Assert(sliceStaticPos >= 0);
3484Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}");
3490Debug.Assert(str.Length >= 2);
3494Debug.Assert(emitLengthCheck);
3536Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}");
3556Debug.Assert(node.M < node.N);
3811Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}");
3828Debug.Assert(node.M < node.N);
4158Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
4159Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
4160Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
4161Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
4267Debug.Assert(sliceStaticPos == 0);
4347Debug.Assert(entriesPerIteration >= 1);
4506Debug.Assert(entriesPerIteration >= 1);
4530Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
4680Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4696Debug.Assert(node.N > node.M);
4927Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4928Debug.Assert(node.M == 0 && node.N == 1);
5016Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
5017Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
5018Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}");
5019Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
5020Debug.Assert(!analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}");
5054Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
5055Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
5056Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
5057Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
5179Debug.Assert(sliceStaticPos == 0);
5333Debug.Assert(startingStackpos is not null);
5488Debug.Assert(!negate, "Negation isn't appropriate for a multi");
5587Debug.Fail("We should never get here. This method should only be called if CanEmitIndexOf returned true, and all of the same cases should be covered.");
5609Debug.Assert(count >= 1);
6028Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive);
6480Debug.Assert(chars.Length > 3, $"chars.Length == {chars.Length}");
6519Debug.Assert(values is char[] or string[]);
6520Debug.Assert(comparison is StringComparison.Ordinal || values is string[]);
System\Text\RegularExpressions\RegexNode.cs (87)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or
92Debug.Assert(M > 0);
115Debug.Assert(culture is not null);
233Debug.Fail($"Unexpected type: {Kind}");
243Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
256Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}");
262Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed.");
268Debug.Fail("All Group nodes should have been removed.");
298Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}.");
307Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}.");
311Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}");
315Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}");
320Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}.");
324Debug.Fail($"Unexpected node type: {node.Kind}");
332Debug.Assert(node.Str is not null, "Expect non-null multi string");
333Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters");
340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}.");
344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\".");
355Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase");
372Debug.Assert(rootNode.Kind == RegexNodeKind.Capture);
373Debug.Assert(rootNode.Parent is null);
374Debug.Assert(rootNode.ChildCount() == 1);
589Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
594Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
659Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate);
676Debug.Assert(Kind == RegexNodeKind.Group);
681Debug.Assert(u.ChildCount() == 1);
704Debug.Assert(Kind == RegexNodeKind.Atomic);
705Debug.Assert(ChildCount() == 1);
754Debug.Assert(branches is not null && branches.Count != 0);
881Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
1013Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy);
1014Debug.Assert(!string.IsNullOrEmpty(Str));
1073Debug.Assert(Kind == RegexNodeKind.Alternate);
1241Debug.Assert(alternation.Kind == RegexNodeKind.Alternate);
1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 });
1341Debug.Assert(node.Kind == RegexNodeKind.Alternate);
1342Debug.Assert(node.ChildCount() >= 2);
1384Debug.Assert(alternation.Kind == RegexNodeKind.Alternate);
1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 });
1419Debug.Assert(startingSpan.Length > 0);
1448Debug.Assert(startingNode.Kind == RegexNodeKind.Multi);
1449Debug.Assert(startingNode.Str!.Length > 0);
1472Debug.Assert(startingSpan.Length > 0);
1495Debug.Assert(startingSpan.Length == 1);
1496Debug.Assert(startingSpan[0] == node.Ch);
1502Debug.Assert(node.Kind == RegexNodeKind.Multi);
1503Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal));
1557Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0));
1558Debug.Assert((Options & RegexOptions.RightToLeft) == 0);
1572Debug.Assert(Kind is RegexNodeKind.Alternate);
1573Debug.Assert((Options & RegexOptions.RightToLeft) == 0);
1608Debug.Assert(startingLiteralNode.IsSetFamily);
1687Debug.Assert(lowInclusive < highInclusive);
1723Debug.Assert(@string is not null);
1729Debug.Assert(setChars is not null);
1742Debug.Assert(Kind == RegexNodeKind.Concatenate);
1784Debug.Assert(Kind == RegexNodeKind.Concatenate);
1785Debug.Assert(Children is List<RegexNode>);
1867Debug.Assert(Kind == RegexNodeKind.Concatenate);
1868Debug.Assert(Children is List<RegexNode>);
1978Debug.Assert(matchingCharsInMulti < nextNode.Str.Length);
2050Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking");
2076Debug.Assert(Children is List<RegexNode>);
2221Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround);
2222Debug.Assert(ChildCount() == 1);
2341Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional);
2342Debug.Assert(ChildCount() is 1 or 2);
2359Debug.Assert(Kind == RegexNodeKind.ExpressionConditional);
2360Debug.Assert(ChildCount() is 2 or 3);
2402Debug.Assert(loopNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop);
2712Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list");
2788Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation.");
2874Debug.Assert(childCount >= 2);
2907Debug.Assert(ChildCount() == 1);
2936Debug.Fail($"Unknown node: {Kind}");
2991Debug.Assert(childCount >= 2);
3045Debug.Assert(ChildCount() == 1);
3073Debug.Fail($"Unknown node: {Kind}");
3105Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
3241Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
3302Debug.Assert(max >= 2);
3347Debug.Assert(Children is List<RegexNode>);
3358Debug.Assert(Children != null);
3359Debug.Assert(index < ChildCount());
3371Debug.Assert(Children != null);
3397Debug.Assert(Children is RegexNode);
System\Text\RegularExpressions\Symbolic\SymbolicRegexMatcher.cs (40)
171Debug.Assert(builder._solver is UInt64Solver or BitVectorSolver, $"Unsupported solver: {builder._solver}");
178Debug.Assert(solverMinterms is not null);
221Debug.Assert(CharKind.General == 0);
295Debug.Assert(Solver.IsEmpty(Solver.And(Solver.Not(_builder._wordLetterForBoundariesSet), minterm)));
340Debug.Assert(_checkTimeout);
356Debug.Assert(startat >= 0 && startat <= input.Length, $"{nameof(startat)} == {startat}, {nameof(input.Length)} == {input.Length}");
357Debug.Assert(perThreadData is not null);
416Debug.Assert(matchEnd >= startat - 1);
462Debug.Fail($"Unexpected reversal kind: {_optimizedReversalInfo.Kind}");
865Debug.Assert(i >= 0, $"{nameof(i)} == {i}");
866Debug.Assert(matchStartBoundary >= 0 && matchStartBoundary <= input.Length, $"{nameof(matchStartBoundary)} == {matchStartBoundary}");
867Debug.Assert(i >= matchStartBoundary, $"Expected {i} >= {matchStartBoundary}.");
888Debug.Assert(i >= matchStartBoundary);
894Debug.Assert(lastStart != -1, "We expected to find a starting position but didn't.");
930Debug.Assert(lastStart != -1);
977Debug.Assert(lastStart != -1);
1021Debug.Assert(perThreadData.Current is not null && perThreadData.Next is not null);
1032Debug.Assert(next.Count == 0);
1061Debug.Assert(coreStateId != _deadStateId);
1082Debug.Assert(current.Count > 0);
1095Debug.Fail("No nullable state found in the set of end states");
1159Debug.Assert(CaptureStarts.Length == other.CaptureStarts.Length);
1160Debug.Assert(CaptureEnds.Length == other.CaptureEnds.Length);
1272Debug.Assert(dfaStateId > 0, $"Expected non-zero {nameof(dfaStateId)}.");
1344Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}.");
1345Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}.");
1441Debug.Assert(state.DfaStateId < 0, $"Expected negative {nameof(state.DfaStateId)}.");
1442Debug.Assert(state.NfaState is not null, $"Expected non-null {nameof(state.NfaState)}.");
1453Debug.Assert(nextStates.Count == 0 || sourceStates.Count > 0);
1548Debug.Assert(matcher._findOpts is not null);
1560Debug.Assert(pos == input.Length);
1579Debug.Assert(matcher._findOpts is not null);
1580Debug.Assert(lookup is not null, $"{nameof(NoZAnchorFindOptimizationsInitialStateHandler)} must only be used with call sites that pass non-null {nameof(lookup)}.");
1591Debug.Assert(pos == input.Length);
1610Debug.Assert(!matcher._containsAnyAnchor);
1611Debug.Assert(matcher._findOpts is not null);
1612Debug.Assert(currentStateId == matcher._initialStateId, "There are no anchors, so the current state should be the sole initial state.");
1621Debug.Assert(pos == input.Length);
1659Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor);
1688Debug.Assert(!matcher._pattern._info.ContainsSomeAnchor);
System.Text.RegularExpressions.Generator (263)
RegexGenerator.Emitter.cs (93)
522Debug.Assert(chars.Length > 3);
864Debug.Assert(minRequiredLength >= 0);
918Debug.Fail($"Unexpected mode: {regexTree.FindOptimizations.FindMode}");
1152Debug.Assert(!string.IsNullOrEmpty(substring));
1159Debug.Assert(!string.IsNullOrEmpty(substring));
1163Debug.Assert(!string.IsNullOrEmpty(regexTree.FindOptimizations.FixedDistanceLiteral.String));
1173Debug.Fail($"Unexpected mode: {opts.FindMode}");
1232Debug.Assert(opts.FindMode is FindNextStartingPositionMode.LeadingStrings_LeftToRight or FindNextStartingPositionMode.LeadingStrings_OrdinalIgnoreCase_LeftToRight);
1278Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
1327Debug.Assert(primarySet.Chars.Length > 0);
1425Debug.Assert(setIndex is 0 or 1);
1431Debug.Assert(needLoop);
1466Debug.Assert(regexTree.FindOptimizations.FixedDistanceSets is { Count: > 0 });
1469Debug.Assert(set.Distance == 0);
1476Debug.Assert(!set.Negated);
1500Debug.Assert(regexTree.FindOptimizations.LiteralAfterLoop is not null);
1503Debug.Assert(target.LoopNode.Kind is RegexNodeKind.Setloop or RegexNodeKind.Setlazy or RegexNodeKind.Setloopatomic);
1504Debug.Assert(target.LoopNode.N == int.MaxValue);
1625Debug.Assert(node.Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
1626Debug.Assert(node.ChildCount() == 1, "Capture nodes should have one child");
1775Debug.Assert(requiredLength > 0);
1807Debug.Assert(node.Kind is RegexNodeKind.Alternate, $"Unexpected type: {node.Kind}");
1808Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
1811Debug.Assert(childCount >= 2);
1818Debug.Assert(node.Parent is not null);
1891Debug.Assert(startingLiteralNode is not null, "Unexpectedly couldn't find the branch starting node.");
1897Debug.Assert(numChars != 0);
1978Debug.Assert(multi.Kind is RegexNodeKind.Multi, $"Expected a Multi node, got {multi.Kind}");
2198Debug.Assert(sliceStaticPos == 0);
2205Debug.Assert(node.Kind is RegexNodeKind.Backreference, $"Unexpected type: {node.Kind}");
2274Debug.Assert(node.Kind is RegexNodeKind.BackreferenceConditional, $"Unexpected type: {node.Kind}");
2275Debug.Assert(node.ChildCount() == 2, $"Expected 2 children, found {node.ChildCount()}");
2447Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
2448Debug.Assert(node.ChildCount() == 3, $"Expected 3 children, found {node.ChildCount()}");
2627Debug.Assert(node.Kind is RegexNodeKind.Capture, $"Unexpected type: {node.Kind}");
2628Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2720Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround, $"Unexpected type: {node.Kind}");
2721Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2761Debug.Assert(node.Kind is RegexNodeKind.NegativeLookaround, $"Unexpected type: {node.Kind}");
2762Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
2866Debug.Assert(sliceStaticPos == 0, "This should be the first node and thus static position shouldn't have advanced.");
3005Debug.Assert(rm.Analysis.MayBacktrack(node.Child(0)));
3024Debug.Fail($"Unexpected node type: {node.Kind}");
3030Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional, $"Unexpected type: {node.Kind}");
3031Debug.Assert(node.Kind is RegexNodeKind.ExpressionConditional ? node.ChildCount() >= 1 : node.ChildCount() == 1, $"Unexpected number of children: {node.ChildCount()}");
3033Debug.Assert(node.Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround or RegexNodeKind.ExpressionConditional || rm.Analysis.MayBacktrack(node.Child(0)), "Expected lookaround/conditional or a child that may backtrack");
3060Debug.Assert(node.Kind is RegexNodeKind.UpdateBumpalong, $"Unexpected type: {node.Kind}");
3072Debug.Assert(node.Kind is RegexNodeKind.Concatenate, $"Unexpected type: {node.Kind}");
3073Debug.Assert(node.ChildCount() >= 2, $"Expected at least 2 children, found {node.ChildCount()}");
3202Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
3205Debug.Assert(!rtl || offset is null);
3206Debug.Assert(!rtl || !clauseOnly);
3246Debug.Assert(node.Kind is RegexNodeKind.Boundary or RegexNodeKind.NonBoundary or RegexNodeKind.ECMABoundary or RegexNodeKind.NonECMABoundary, $"Unexpected kind: {node.Kind}");
3286Debug.Assert(node.Kind is RegexNodeKind.Beginning or RegexNodeKind.Start or RegexNodeKind.Bol or RegexNodeKind.End or RegexNodeKind.EndZ or RegexNodeKind.Eol, $"Unexpected type: {node.Kind}");
3287Debug.Assert((node.Options & RegexOptions.RightToLeft) == 0 || sliceStaticPos == 0);
3288Debug.Assert(sliceStaticPos >= 0);
3352Debug.Assert(node.Kind is RegexNodeKind.Multi, $"Unexpected type: {node.Kind}");
3353Debug.Assert(node.Str is not null);
3359Debug.Assert(str.Length >= 2);
3360Debug.Assert(!clauseOnly || (!emitLengthCheck && !rightToLeft));
3364Debug.Assert(emitLengthCheck);
3401Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop, $"Unexpected type: {node.Kind}");
3421Debug.Assert(node.M < node.N);
3579Debug.Assert(node.Kind is RegexNodeKind.Onelazy or RegexNodeKind.Notonelazy or RegexNodeKind.Setlazy, $"Unexpected type: {node.Kind}");
3602Debug.Assert(node.M < node.N);
3826Debug.Assert(node.Kind is RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
3827Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
3828Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
3829Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
3921Debug.Assert(sliceStaticPos == 0);
3987Debug.Assert(entriesPerIteration >= 1);
4101Debug.Assert(entriesPerIteration >= 1);
4132Debug.Assert(node.IsOneFamily || node.IsNotoneFamily || node.IsSetFamily, $"Unexpected type: {node.Kind}");
4252Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4268Debug.Assert(node.N > node.M);
4384Debug.Assert(node.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or RegexNodeKind.Notoneloop or RegexNodeKind.Notoneloopatomic or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic, $"Unexpected type: {node.Kind}");
4385Debug.Assert(node.M == 0 && node.N == 1);
4422Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
4423Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
4424Debug.Assert(node.M == node.N, $"Unexpected M={node.M} == N={node.N}");
4425Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
4426Debug.Assert(!rm.Analysis.MayBacktrack(node.Child(0)), $"Expected non-backtracking node {node.Kind}");
4442Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop, $"Unexpected type: {node.Kind}");
4443Debug.Assert(node.M < int.MaxValue, $"Unexpected M={node.M}");
4444Debug.Assert(node.N >= node.M, $"Unexpected M={node.M}, N={node.N}");
4445Debug.Assert(node.ChildCount() == 1, $"Expected 1 child, found {node.ChildCount()}");
4560Debug.Assert(sliceStaticPos == 0);
4693Debug.Assert(startingStackpos is not null);
4824Debug.Assert(args.Length is >= 1);
4876Debug.Assert(args.Length is >= 1);
5066Debug.Assert(!negate, "Negation isn't appropriate for a multi");
5312Debug.Assert(rangeLower.LowInclusive != rangeUpper.LowInclusive);
5559Debug.Fail("This shouldn't happen, as we should only get to the point of emitting code if RegexOptions was valid.");
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexCharClass.cs (22)
197Debug.Assert(
204Debug.Assert(string.Compare(s_propTable[i][0], s_propTable[i + 1][0], StringComparison.Ordinal) < 0, $"RegexCharClass s_propTable is out of order at ({s_propTable[i][0]}, {s_propTable[i + 1][0]})");
210Debug.Assert(whitespaceSet.Contains((char)i) == char.IsWhiteSpace((char)i));
244Debug.Assert(cc.CanMerge && CanMerge, "Both character classes added together must be able to merge");
282Debug.Assert(!set.IsEmpty);
300Debug.Assert(_subtractor == null, "Can't add two subtractions to a char class. ");
474Debug.Assert(IsSingleton(set) || IsSingletonInverse(set), "Tried to get the singleton char out of a non singleton character class");
574Debug.Assert(c != 0);
742Debug.Assert(count <= evaluated);
786Debug.Assert(set1Negated == set2Negated);
865Debug.Assert(!IsNegated(set1) && !IsNegated(set2));
982Debug.Assert((uint)comparison <= char.MaxValue);
1029Debug.Assert(twoChars.Length >= 2);
1115Debug.Assert(!hasSubtraction);
1239Debug.Assert(asciiLazyCache is null || asciiLazyCache.Length == CacheArrayLength, "set lookup should be able to store two bits for each of the first 128 characters");
1247Debug.Assert(ch < 128);
1265Debug.Assert(ch < 128);
1350Debug.Assert((SetStartIndex & 0x1) == 1, "If SetStartIndex is not odd, the calculation below this will be reversed");
1440Debug.Assert(curcat < 0);
1541Debug.Assert(chars[index] < chars[index + 1]);
1621Debug.Assert(i == span.Length);
1849Debug.Assert(!string.IsNullOrEmpty(set), "Found a null/empty element in RegexCharClass prop table");
src\runtime\src\libraries\System.Text.RegularExpressions\src\System\Text\RegularExpressions\RegexNode.cs (87)
89Debug.Assert(Kind is RegexNodeKind.Onelazy or RegexNodeKind.Oneloop or RegexNodeKind.Oneloopatomic or
92Debug.Assert(M > 0);
115Debug.Assert(culture is not null);
233Debug.Fail($"Unexpected type: {Kind}");
243Debug.Assert(Kind == RegexNodeKind.Capture, "Every generated tree should begin with a capture node");
256Debug.Assert(child.Parent == node, $"{child.Describe()} missing reference to parent {node.Describe()}");
262Debug.Assert(Kind != RegexNodeKind.Group, "All Group nodes should have been removed.");
268Debug.Fail("All Group nodes should have been removed.");
298Debug.Assert(childCount == 0, $"Expected zero children for {node.Kind}, got {childCount}.");
307Debug.Assert(childCount == 1, $"Expected one and only one child for {node.Kind}, got {childCount}.");
311Debug.Assert(childCount == 2, $"Expected two children for {node.Kind}, got {childCount}");
315Debug.Assert(childCount == 3, $"Expected three children for {node.Kind}, got {childCount}");
320Debug.Assert(childCount >= 2, $"Expected at least two children for {node.Kind}, got {childCount}.");
324Debug.Fail($"Unexpected node type: {node.Kind}");
332Debug.Assert(node.Str is not null, "Expect non-null multi string");
333Debug.Assert(node.Str.Length >= 2, $"Expected {node.Str} to be at least two characters");
340Debug.Assert(!string.IsNullOrEmpty(node.Str), $"Expected non-null, non-empty string for {node.Kind}.");
344Debug.Assert(node.Str is null, $"Expected null string for {node.Kind}, got \"{node.Str}\".");
355Debug.Assert((node.Options & RegexOptions.IgnoreCase) == 0, $"{node.Kind} node should not have RegexOptions.IgnoreCase");
372Debug.Assert(rootNode.Kind == RegexNodeKind.Capture);
373Debug.Assert(rootNode.Parent is null);
374Debug.Assert(rootNode.ChildCount() == 1);
589Debug.Assert(node.Kind is RegexNodeKind.Atomic or RegexNodeKind.Empty or RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
594Debug.Assert(node.Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
659Debug.Assert(Kind is RegexNodeKind.Alternate or RegexNodeKind.Concatenate);
676Debug.Assert(Kind == RegexNodeKind.Group);
681Debug.Assert(u.ChildCount() == 1);
704Debug.Assert(Kind == RegexNodeKind.Atomic);
705Debug.Assert(ChildCount() == 1);
754Debug.Assert(branches is not null && branches.Count != 0);
881Debug.Assert(Kind is RegexNodeKind.Loop or RegexNodeKind.Lazyloop);
1013Debug.Assert(Kind is RegexNodeKind.Set or RegexNodeKind.Setloop or RegexNodeKind.Setloopatomic or RegexNodeKind.Setlazy);
1014Debug.Assert(!string.IsNullOrEmpty(Str));
1073Debug.Assert(Kind == RegexNodeKind.Alternate);
1241Debug.Assert(alternation.Kind == RegexNodeKind.Alternate);
1242Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 });
1341Debug.Assert(node.Kind == RegexNodeKind.Alternate);
1342Debug.Assert(node.ChildCount() >= 2);
1384Debug.Assert(alternation.Kind == RegexNodeKind.Alternate);
1385Debug.Assert(alternation.Children is List<RegexNode> { Count: >= 2 });
1419Debug.Assert(startingSpan.Length > 0);
1448Debug.Assert(startingNode.Kind == RegexNodeKind.Multi);
1449Debug.Assert(startingNode.Str!.Length > 0);
1472Debug.Assert(startingSpan.Length > 0);
1495Debug.Assert(startingSpan.Length == 1);
1496Debug.Assert(startingSpan[0] == node.Ch);
1502Debug.Assert(node.Kind == RegexNodeKind.Multi);
1503Debug.Assert(node.Str.AsSpan().StartsWith(startingSpan, StringComparison.Ordinal));
1557Debug.Assert(Kind is RegexNodeKind.One or RegexNodeKind.Multi || (IsOneFamily && M > 0));
1558Debug.Assert((Options & RegexOptions.RightToLeft) == 0);
1572Debug.Assert(Kind is RegexNodeKind.Alternate);
1573Debug.Assert((Options & RegexOptions.RightToLeft) == 0);
1608Debug.Assert(startingLiteralNode.IsSetFamily);
1687Debug.Assert(lowInclusive < highInclusive);
1723Debug.Assert(@string is not null);
1729Debug.Assert(setChars is not null);
1742Debug.Assert(Kind == RegexNodeKind.Concatenate);
1784Debug.Assert(Kind == RegexNodeKind.Concatenate);
1785Debug.Assert(Children is List<RegexNode>);
1867Debug.Assert(Kind == RegexNodeKind.Concatenate);
1868Debug.Assert(Children is List<RegexNode>);
1978Debug.Assert(matchingCharsInMulti < nextNode.Str.Length);
2050Debug.Assert((Options & RegexOptions.NonBacktracking) == 0, "Atomic groups aren't supported and don't help performance with NonBacktracking");
2076Debug.Assert(Children is List<RegexNode>);
2221Debug.Assert(Kind is RegexNodeKind.PositiveLookaround or RegexNodeKind.NegativeLookaround);
2222Debug.Assert(ChildCount() == 1);
2341Debug.Assert(Kind == RegexNodeKind.BackreferenceConditional);
2342Debug.Assert(ChildCount() is 1 or 2);
2359Debug.Assert(Kind == RegexNodeKind.ExpressionConditional);
2360Debug.Assert(ChildCount() is 2 or 3);
2402Debug.Assert(loopNode.Kind is RegexNodeKind.Oneloop or RegexNodeKind.Notoneloop or RegexNodeKind.Setloop);
2712Debug.Assert(currentIndex >= 0, "Node should have been in its parent's child list");
2788Debug.Assert(node.Kind is not RegexNodeKind.Concatenate, "The existing logic assumes that the node itself isn't a concatenation.");
2874Debug.Assert(childCount >= 2);
2907Debug.Assert(ChildCount() == 1);
2936Debug.Fail($"Unknown node: {Kind}");
2991Debug.Assert(childCount >= 2);
3045Debug.Assert(ChildCount() == 1);
3073Debug.Fail($"Unknown node: {Kind}");
3105Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
3241Debug.Assert(Kind == RegexNodeKind.Concatenate, $"Expected Concatenate, got {Kind}");
3302Debug.Assert(max >= 2);
3347Debug.Assert(Children is List<RegexNode>);
3358Debug.Assert(Children != null);
3359Debug.Assert(index < ChildCount());
3371Debug.Assert(Children != null);
3397Debug.Assert(Children is RegexNode);
System.Threading (77)
System.Threading.AccessControl (4)
System.Threading.Channels (114)
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0.");
68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2");
69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum.");
70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur.");
102Debug.Assert(segment is not null, "Expected a non-null segment.");
112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow.");
179Debug.Assert(segment is not null, "Expected a non-null segment.");
180Debug.Assert(array is not null, "Expected a non-null item array.");
253Debug.Assert(segment is not null, "Expected a non-null segment.");
254Debug.Assert(array is not null, "Expected a non-null item array.");
368Debug.Assert(syncObj is not null, "The syncObj parameter is null.");
390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2");
429Debug.Assert(queue is not null, "Expected a non-null queue.");
System\Threading\Channels\AsyncOperation.cs (21)
17private static void AvailableSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation<>)}.{nameof(AvailableSentinel)} invoked with {s}");
21private static void CompletedSentinel(object? s) => Debug.Fail($"{nameof(AsyncOperation<>)}.{nameof(CompletedSentinel)} invoked with {s}");
106Debug.Assert(!pooled || !cancellationToken.CanBeCanceled);
114Debug.Assert(cancellationCallback is not null, "Expected a non-null cancellation callback when the token is cancelable");
115Debug.Assert(!_pooled, "Cancelable operations can't be pooled");
191Debug.Assert(
212Debug.Assert(_continuation != s_completedSentinel, $"The continuation was the completion sentinel.");
213Debug.Assert(_continuation != s_availableSentinel, $"The continuation was the available sentinel.");
250Debug.Assert(ts is not null, "Expected a TaskScheduler");
267Debug.Assert(_continuation is not null);
322Debug.Assert(_capturedContext is null);
382Debug.Assert(prevContinuation != s_availableSentinel, "Continuation was the available sentinel.");
383Debug.Assert(IsCompleted, $"Expected IsCompleted");
407Debug.Assert(capturedContext is ExecutionContext);
420Debug.Assert(scheduler is SynchronizationContext or TaskScheduler, $"{nameof(scheduler)} is {scheduler}");
421Debug.Assert(executionContext is not null, $"{nameof(executionContext)} is null");
494Debug.Assert((object?)Next == null);
495Debug.Assert((object?)Previous == null);
496Debug.Assert(_continuationState == null);
497Debug.Assert(_capturedContext == null);
558Debug.Assert(_pooled, "Should only be used for pooled objects");
System\Threading\Channels\BoundedChannel.cs (18)
56Debug.Assert(bufferedCapacity > 0);
242Debug.Assert(Monitor.IsEntered(parent.SyncObj));
455Debug.Assert(waitingReadersHead is null);
460Debug.Assert(waitingReadersHead is not null);
630Debug.Assert(waitingReadersHead is null);
635Debug.Assert(waitingReadersHead is not null);
684Debug.Fail($"Unexpected operation: {state.Value}");
695Debug.Assert(SyncObj is not null, "The sync obj must not be null.");
696Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
700Debug.Assert(_blockedReadersHead is null, "There are items available, so there shouldn't be any blocked readers.");
701Debug.Assert(_waitingReadersHead is null, "There are items available, so there shouldn't be any waiting readers.");
706Debug.Assert(_blockedWritersHead is null, "There's space available, so there shouldn't be any blocked writers.");
707Debug.Assert(_waitingWritersHead is null, "There's space available, so there shouldn't be any waiting writers.");
712Debug.Assert(_items.IsEmpty, "There shouldn't be queued items if there's a blocked reader.");
713Debug.Assert(_blockedWritersHead is null, "There shouldn't be any blocked writer if there's a blocked reader.");
718Debug.Assert(_items.Count == _bufferedCapacity, "We should have a full buffer if there's a blocked writer.");
719Debug.Assert(_blockedReadersHead is null, "There shouldn't be any blocked readers if there's a blocked writer.");
724Debug.Assert(_doneWriting is not null, "We can only complete if we're done writing.");
System\Threading\Channels\UnboundedChannel.cs (8)
333Debug.Fail($"Unexpected operation: {state.Value}");
344Debug.Assert(SyncObj is not null, "The sync obj must not be null.");
345Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
351Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers.");
352Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers.");
354Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed.");
359Debug.Assert(_items.IsEmpty, "There are blocked/waiting readers, so there shouldn't be any data available.");
364Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System\Threading\Channels\UnboundedPriorityChannel.cs (9)
138Debug.Assert(Monitor.IsEntered(parent.SyncObj));
329Debug.Fail($"Unexpected operation: {state.Value}");
340Debug.Assert(SyncObj is not null, "The sync obj must not be null.");
341Debug.Assert(Monitor.IsEntered(SyncObj), "Invariants can only be validated while holding the lock.");
347Debug.Assert(_blockedReadersHead is null, "There's data available, so there shouldn't be any blocked readers.");
348Debug.Assert(_waitingReadersHead is null, "There's data available, so there shouldn't be any waiting readers.");
350Debug.Assert(!_completion.Task.IsCompleted, "We still have data available, so shouldn't be completed.");
355Debug.Assert(_items.Count == 0, "There are blocked/waiting readers, so there shouldn't be any data available.");
360Debug.Assert(_doneWriting is not null, "We're completed, so we must be done writing.");
System.Threading.RateLimiting (42)
System.Threading.Tasks.Dataflow (414)
Base\DataflowBlock.cs (53)
108Debug.Assert(source != null, "Filtered link requires a source to filter on.");
109Debug.Assert(target != null, "Filtered link requires a target to filter to.");
110Debug.Assert(predicate != null, "Filtered link requires a predicate to filter with.");
123Debug.Assert(_userProvidedPredicate != null, "User-provided predicate is required.");
155Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed.");
164Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed.");
173Debug.Assert(messageHeader.IsValid, "Only valid messages may be consumed.");
210Debug.Assert(filter != null, "Need a filter with which to construct the debug view.");
312Debug.Fail("A message should never be postponed when no source has been provided");
316Debug.Fail("The message should never be missed, as it's offered to only this one target");
334Debug.Assert(source != null, "The SendAsyncSource instance must have been constructed.");
390Debug.Assert(target != null, "A valid target to send to is required.");
494Debug.Assert(completionAction != null, "Completion action to run is required.");
503Debug.Assert(_cancellationRegistration != default(CancellationTokenRegistration),
543Debug.Assert(source._cancellationState != CANCELLATION_STATE_NONE,
584Debug.Assert(_cancellationState == CANCELLATION_STATE_COMPLETING,
596Debug.Fail("The message should never be missed, as it's offered to only this one target");
639Debug.Assert(
740Debug.Assert(source != null, "Need a source with which to construct the debug view.");
974Debug.Assert(source != null, "Need a source from which to receive.");
1228Debug.Assert(Volatile.Read(ref _cleanupReserved), "Should only be called once by whomever reserved the right.");
1310Debug.Fail("Invalid linking cleanup reason specified.");
1527Debug.Assert(target != null, "The target should never be null; this should be checked by all internal usage.");
1528Debug.Assert(source != null, "The source should never be null; this should be checked by all internal usage.");
1622Debug.Assert(propagator != null, "Need a block with which to construct the debug view.");
1825Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null.");
1826Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null.");
1827Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null.");
1828Debug.Assert(dataflowBlockOptions != null, "Options are required.");
1872Debug.Assert(source != null, "Expected a non-null source");
1873Debug.Assert(action != null, "Expected a non-null action");
1874Debug.Assert(branchId >= 0, "Expected a valid branch ID (> 0)");
1875Debug.Assert(scheduler != null, "Expected a non-null scheduler");
1910Debug.Assert(source1 != null && action1 != null, "The first source and action should not be null.");
1911Debug.Assert(source2 != null && action2 != null, "The second source and action should not be null.");
1912Debug.Assert((source3 == null) == (action3 == null), "The third action should be null iff the third source is null.");
1913Debug.Assert(dataflowBlockOptions != null, "Options are required.");
1961Debug.Assert(resultBranchId < tasks.Length, "Expected a valid branch ID");
1962Debug.Assert(successfulBranchId == -1, "There should be at most one successful branch.");
1965else Debug.Assert(resultBranchId == -1, "Expected -1 as a signal of a non-successful branch");
2087Debug.Assert(completed != null, "Requires a shared target to complete.");
2184Debug.Assert(source != null, "Requires a source for which to retrieve the observable.");
2202Debug.Assert(source != null, "The observable requires a source to wrap.");
2248Debug.Assert(_observersState.Unlinker == null, "The source should not be linked to the target.");
2273Debug.Assert(observer != null, "Expected an observer.");
2279Debug.Assert(currentState != null, "Observer state should never be null.");
2307Debug.Assert(currentState != null, "Observer state should never be null.");
2308Debug.Assert(currentState.Unlinker != null, "The target should be linked.");
2309Debug.Assert(currentState.Canceler != null, "The target should have set up continuations.");
2341Debug.Assert(observable != null, "Need a block with which to construct the debug view.");
2376Debug.Assert(observable != null, "Observe state must be mapped to a source observable.");
2470Debug.Assert(Target.Completion.IsCompleted, "The target must have already completed in order to notify of completion.");
2539Debug.Assert(target != null, "A target to observe is required.");
Blocks\BatchBlock.cs (34)
84Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
199Debug.Assert(batchBlock != null, "Need a block with which to construct the debug view");
290Debug.Assert(batchSize > 0, "A positive batch size is required");
306Debug.Assert(owningBatch != null, "This batch target core must be associated with a batch block.");
307Debug.Assert(batchSize >= 1, "Batch sizes must be positive.");
308Debug.Assert(batchCompletedAction != null, "Completion action must be specified.");
309Debug.Assert(dataflowBlockOptions != null, "Options required to configure the block.");
378Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
406Debug.Assert(_nonGreedyState != null, "_nonGreedyState must have been initialized during construction in non-greedy mode.");
458Debug.Assert(_nonGreedyState != null && _nonGreedyState.TaskForInputProcessing != null,
619Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
634Debug.Assert(BatchesNeedProcessing, "There must be a batch that needs processing.");
663Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
752Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode.");
753Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
770Debug.Assert(_messages.Count == 0, "The queue must be empty between batches in non-greedy mode");
782Debug.Assert(allowFewerThanBatchSize ? poppedInitially > 0 : poppedInitially == _batchSize,
816Debug.Assert(reserved.Count <= _batchSize, "Expected the number of reserved sources to be <= the number needed for a batch.");
869Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode.");
870Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
871Debug.Assert(_boundingState != null, "Bounding state is required when in bounded mode.");
899Debug.Assert(poppedInitially > 0, "We received fewer than we expected based on the previous check.");
928Debug.Assert(reserved.Count <= itemCountNeededToCompleteBatch, "Expected the number of reserved sources to be <= the number needed for a batch.");
978Debug.Assert(!_dataflowBlockOptions.Greedy, "This method may only be used in non-greedy mode.");
979Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
980Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized.");
1028Debug.Assert(_dataflowBlockOptions.Greedy, "This method may only be used in greedy mode.");
1029Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
1030Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "ReservedSourcesTemp should have been initialized.");
1031Debug.Assert(_boundingState != null, "Bounded state is required for bounded mode.");
1083Debug.Assert(_nonGreedyState != null, "Non-greedy state is required for non-greedy mode.");
1084Debug.Assert(_nonGreedyState.ReservedSourcesTemp != null, "Should have been initialized");
1114Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed.");
1125Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\BatchedJoinBlock.cs (21)
102Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
149Debug.Assert(_target1 != null, "_target1 not initialized");
150Debug.Assert(_target2 != null, "_target2 not initialized");
161Debug.Assert(_sharedResources != null, "_sharedResources not initialized");
162Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized");
163Debug.Assert(_source != null, "_source not initialized");
227Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view.");
351Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
401Debug.Assert(_target1 != null, "_target1 not initialized");
402Debug.Assert(_target2 != null, "_target2 not initialized");
403Debug.Assert(_target3 != null, "_target3 not initialized");
415Debug.Assert(_sharedResources != null, "_sharedResources not initialized");
416Debug.Assert(_sharedResources._incomingLock != null, "_sharedResources._incomingLock not initialized");
417Debug.Assert(_source != null, "_source not initialized");
482Debug.Assert(batchedJoinBlock != null, "Need a block with which to construct the debug view.");
540Debug.Assert(sharedResources != null, "Targets require a shared resources through which to communicate.");
580Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
643Debug.Assert(batchedJoinBlockTarget != null, "Need a block with which to construct the debug view.");
676Debug.Assert(batchSize >= 1, "A positive batch size is required.");
677Debug.Assert(batchSizeReachedAction != null, "Need an action to invoke for each batch.");
678Debug.Assert(allTargetsDecliningAction != null, "Need an action to invoke when all targets have declined.");
Blocks\BroadcastBlock.cs (26)
76Debug.Assert(dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor");
91Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
121Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState,
136Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
188Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
203Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null,
218Debug.Assert(numItemsRemoved > 0, "Should only be called for a positive number of items removed.");
229Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
244Debug.Assert(_boundingState != null, "Must be in bounded mode.");
279Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
281Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId,
325Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
327Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId,
458Debug.Assert(broadcastBlock != null, "Need a block with which to construct the debug view.");
547Debug.Assert(owningSource != null, "Must be associated with a broadcast block.");
548Debug.Assert(dataflowBlockOptions != null, "Options are required to configure this block.");
668Debug.Assert(target != null, "Target required to offer messages to.");
705else Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages from a Broadcast should never be missed.");
738Debug.Assert(_messages.Count > 0, "There must be at least one message to dequeue.");
810Debug.Fail("Messages from a Broadcast should never be missed.");
938Debug.Assert(_taskForOutputProcessing == null, "There must be no processing tasks.");
939Debug.Assert(
1150Debug.Assert(exception != null, "An exception to add is required.");
1151Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
1162Debug.Assert(exceptions != null, "A list of exceptions to add is required.");
1163Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
Blocks\BufferBlock.cs (13)
73Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
116Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
132Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null,
156Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState,
171Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
219Debug.Assert(numItemsRemoved > 0, "A positive number of items to remove is required.");
230Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
245Debug.Assert(_boundingState != null, "Must be in bounded mode.");
281Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
283Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId,
327Debug.Assert(_boundingState != null && _boundingState.TaskForInputProcessing != null,
329Debug.Assert(_boundingState.TaskForInputProcessing.Id == Task.CurrentId,
442Debug.Assert(bufferBlock != null, "Need a block with which to construct the debug view.");
Blocks\JoinBlock.cs (42)
95Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
133Debug.Assert(_target1 != null, "_target1 not initialized");
134Debug.Assert(_target2 != null, "_target2 not initialized");
145Debug.Assert(_sharedResources != null, "_sharedResources not initialized");
146Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized");
205Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view.");
314Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
352Debug.Assert(_target1 != null, "_target1 not initialized");
353Debug.Assert(_target2 != null, "_target2 not initialized");
354Debug.Assert(_target3 != null, "_target3 not initialized");
366Debug.Assert(_sharedResources != null, "_sharedResources not initialized");
367Debug.Assert(_sharedResources._exceptionAction != null, "_sharedResources._exceptionAction not initialized");
429Debug.Assert(joinBlock != null, "Need a block with which to construct the debug view.");
502Debug.Assert(sharedResources != null, "Targets need shared resources through which to communicate.");
518Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode");
519Debug.Assert(_messages.Count >= 0, "A message must have been consumed by this point.");
524Debug.Assert(_nonGreedy!.ConsumedMessage.Key, "A message must have been consumed by this point.");
549Debug.Assert(_messages != null, "_messages must have been initialized in greedy mode");
584Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only valid in greedy mode");
601Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode");
608Debug.Assert(!HasAtLeastOneMessageAvailable, "The queue must be empty between joins in non-greedy mode");
641Debug.Assert(!_sharedResources._dataflowBlockOptions.Greedy, "This is only used in non-greedy mode");
642Debug.Assert(_nonGreedy!.ReservedMessage.Key != null, "This target must have a reserved message");
668Debug.Assert(!_nonGreedy.ConsumedMessage.Key, "There must be no other consumed message");
683Debug.Assert(_sharedResources._dataflowBlockOptions.Greedy, "This is only used in greedy mode");
684Debug.Assert(_sharedResources._boundingState != null, "This is only used in bounding mode");
768Debug.Assert(_nonGreedy != null, "Only valid in non-greedy mode.");
779Debug.Assert(_nonGreedy == null || _nonGreedy.ReservedMessage.Key == null,
843Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
867Debug.Assert(_nonGreedy != null, "_nonGreedy must have been initialized during construction in non-greedy mode.");
898Debug.Assert(_messages != null, "_messages must be initialized in greedy mode.");
962Debug.Assert(joinBlockTarget != null, "Need a target with which to construct the debug view.");
1028Debug.Assert(ownerJoin != null, "Resources must be associated with a join.");
1029Debug.Assert(targets != null, "Resources must be shared between multiple targets.");
1030Debug.Assert(joinFilledAction != null, "An action to invoke when a join is created must be provided.");
1031Debug.Assert(exceptionAction != null, "An action to invoke for faults must be provided.");
1032Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the resources.");
1262Debug.Assert(JoinNeedsProcessing, "There must be a join that needs processing.");
1343Debug.Assert(!_dataflowBlockOptions.Greedy || _boundingState != null, "This only makes sense in non-greedy or bounding mode");
1382Debug.Assert(_targets.Length > 0, "A join must have targets.");
1409Debug.Assert(numItemsRemoved > 0, "Number of items removed needs to be positive.");
1420Debug.Assert(_boundingState.CurrentCount - numItemsRemoved >= 0,
Blocks\TransformManyBlock.cs (11)
153Debug.Assert(completed.IsFaulted, "The source must be faulted in order to trigger a target completion.");
256Debug.Assert(completed != null, "A task should have been provided.");
257Debug.Assert(completed.IsCompleted, "The task should have been in a final state.");
295Debug.Fail("The task should have been in a final state.");
350Debug.Assert(_reorderingBuffer != null, "Expected a reordering buffer");
351Debug.Assert(id != Common.INVALID_REORDERING_ID, "This ID should never have been handed out.");
438Debug.Assert(_reorderingBuffer == null, "Expected not to have a reordering buffer");
439Debug.Assert(outputItems is TOutput[] || outputItems is List<TOutput>, "outputItems must be a list we've already vetted as trusted");
538Debug.Assert(_target.IsBounded, "Expected to be in bounding mode.");
541else Debug.Assert(count == 1, "Count shouldn't be negative.");
626Debug.Assert(transformManyBlock != null, "Need a block with which to construct the debug view.");
Internal\Common.cs (40)
48Debug.Assert(syncObj != null, "The monitor object to check must be provided.");
49Debug.Assert(Monitor.IsEntered(syncObj) == held, "The locking scheme was not correctly followed.");
71Debug.Assert(predicate != null, "Non-null predicate to execute is required.");
95Debug.Assert(wr != null, "Expected a WeakReference<T> as the state argument");
104Debug.Assert(block != null, "Block required to extract an Id.");
120Debug.Assert(block != null, "Should only be used with valid objects being displayed in the debugger.");
121Debug.Assert(options == null || options.NameFormat != null, "If options are provided, NameFormat must be valid.");
152Debug.Assert(exception != null, "An exception to check for cancellation must be provided.");
178Debug.Assert(completionTask != null, "A task to wire up for completion is needed.");
179Debug.Assert(completeAction != null, "An action to invoke upon cancellation is required.");
214Debug.Assert(exception != null && exception.StackTrace == null,
230Debug.Assert(exc != null, "The exception into which data should be stored must be provided.");
274Debug.Assert(exception != null, "An exception is needed to store the data into.");
275Debug.Assert(key != null, "A key into the exception's data collection is needed.");
276Debug.Assert(value != null, "The value to store must be provided.");
313Debug.Assert(exception != null, "An exception to add is required.");
314Debug.Assert(!unwrapInnerExceptions || exception.InnerException != null,
374Debug.Assert(cancellationToken.IsCancellationRequested,
377Debug.Assert(t.IsCanceled, "Task's constructor should cancel the task synchronously in the ctor.");
386Debug.Assert(block != null, "We need a block from which to retrieve a cancellation task.");
407Debug.Assert(outgoingLock != null, "Monitor object needed to protect the operation.");
408Debug.Assert(targetRegistry != null, "Registry from which to remove is required.");
409Debug.Assert(targetBlock != null, "Target block to unlink is required.");
454Debug.Assert(task != null, "Task to start is required.");
455Debug.Assert(scheduler != null, "Scheduler on which to start the task is required.");
472Debug.Assert(task != null, "Task to start is needed.");
473Debug.Assert(scheduler != null, "Scheduler on which to start the task is required.");
484Debug.Assert(task.IsFaulted, "The task should have been faulted if it failed to start.");
501Debug.Assert(target != null, "There must be a subject target.");
502Debug.Assert(postponedMessages != null, "The stacked map of postponed messages must exist.");
519Debug.Assert(sourceAndMessage.Key != null, "Postponed messages must have an associated source.");
533Debug.Assert(processedCount == initialCount,
548Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null.");
549Debug.Assert(target != null, "The target where completion is to be propagated may not be null.");
550Debug.Assert(sourceCompletionTask.IsCompleted, "sourceCompletionTask must be completed in order to propagate its completion.");
571Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null.");
572Debug.Assert(target != null, "The target where completion is to be propagated may not be null.");
582Debug.Assert(sourceCompletionTask != null, "sourceCompletionTask may not be null.");
583Debug.Assert(target != null, "The target where completion is to be propagated may not be null.");
628Debug.Assert(boundedCapacity > 0, "Bounded is only supported with positive values.");
Internal\DataflowEtwProvider.cs (11)
63Debug.Assert(block != null, "Block needed for the ETW event.");
64Debug.Assert(dataflowBlockOptions != null, "Options needed for the ETW event.");
91Debug.Assert(block != null, "Block needed for the ETW event.");
92Debug.Assert(task != null, "Task needed for the ETW event.");
93Debug.Assert(reason == TaskLaunchedReason.ProcessingInputMessages || reason == TaskLaunchedReason.OfferingOutputMessages,
127Debug.Assert(block != null, "Block needed for the ETW event.");
132Debug.Assert(blockIsCompleted, "Block must be completed for this event to be valid.");
178Debug.Assert(source != null, "Source needed for the ETW event.");
179Debug.Assert(target != null, "Target needed for the ETW event.");
200Debug.Assert(source != null, "Source needed for the ETW event.");
201Debug.Assert(target != null, "Target needed for the ETW event.");
Internal\QueuedMap.cs (11)
78Debug.Assert(0 <= _freeIndex && _freeIndex < _storage.Count, "Index is out of range.");
93Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail.");
99Debug.Assert(_tailIndex != TERMINATOR_INDEX, "If head does not indicate empty, neither should tail.");
116Debug.Assert(_tailIndex == TERMINATOR_INDEX, "If head indicates empty, so too should tail.");
122Debug.Assert(0 <= _headIndex && _headIndex < _storage.Count, "Head is out of range.");
140Debug.Assert(0 <= index && index < _storage.Count, "Index is out of range.");
144Debug.Assert(idx != index, "Index should not belong to the list of free slots.");
211Debug.Assert(items != null, "Requires non-null array to store into.");
212Debug.Assert(count >= 0 && arrayOffset >= 0, "Count and offset must be non-negative");
213Debug.Assert(arrayOffset + count >= 0, "Offset plus count overflowed");
214Debug.Assert(arrayOffset + count <= items.Length, "Range must be within array size");
Internal\SourceCore.cs (21)
108Debug.Assert(owningSource != null, "Core must be associated with a source.");
109Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core.");
110Debug.Assert(completeAction != null, "Action to invoke on completion is required.");
258Debug.Assert(!_enableOffering, "Offering should have been disabled if there was a valid reservation");
365Debug.Assert(items != null);
406Debug.Assert(items != null, "Items list must be valid.");
456Debug.Assert(exception != null, "Valid exception must be provided to be added.");
457Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
468Debug.Assert(exceptions != null, "Valid exceptions must be provided to be added.");
469Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
483Debug.Assert(aggregateException != null && aggregateException.InnerExceptions.Count > 0, "Aggregate must be valid and contain inner exceptions to unwrap.");
484Debug.Assert(!Completion.IsCompleted || Completion.IsFaulted, "The block must either not be completed or be faulted if we're still storing exceptions.");
573Debug.Assert(linkToTarget != null, "Must have a valid target to offer to.");
622Debug.Fail("The target did not follow the protocol.");
667Debug.Assert(target != null, "Valid target to offer to is required.");
672Debug.Assert(result != DataflowMessageStatus.NotAvailable, "Messages are not being offered concurrently, so nothing should be missed.");
690Debug.Assert(result == DataflowMessageStatus.Postponed,
735Debug.Assert(_taskForOutputProcessing == null && _enableOffering && !_messages.IsEmpty,
794Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId,
852Debug.Assert(_taskForOutputProcessing != null && _taskForOutputProcessing.Id == Task.CurrentId,
906Debug.Assert(
Internal\TargetCore.cs (30)
114Debug.Assert(owningTarget != null, "Core must be associated with a target block.");
115Debug.Assert(dataflowBlockOptions != null, "Options must be provided to configure the core.");
116Debug.Assert(callAction != null, "Action to invoke for each item is required.");
129Debug.Assert(_dataflowBlockOptions.BoundedCapacity > 0, "Positive bounding count expected; should have been verified by options ctor");
143Debug.Assert(storeExceptionEvenIfAlreadyCompleting || !revertProcessingState,
153Debug.Assert(_numberOfOutstandingOperations > 0 || !storeExceptionEvenIfAlreadyCompleting,
168Debug.Assert(_numberOfOutstandingOperations > 0 && (!UsesAsyncCompletion || _numberOfOutstandingServiceTasks > 0),
208Debug.Assert(source != null, "We must have thrown if source == null && consumeToAccept == true.");
218Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid.");
227Debug.Assert(_boundingState != null && _boundingState.PostponedMessages != null,
259Debug.Assert(_numberOfOutstandingOperations > 0, "Operations may only be completed if any are outstanding.");
265Debug.Assert(boundingCountChange <= 0 && _boundingState.CurrentCount + boundingCountChange >= 0,
295Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative.");
296Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative.");
297Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations.");
311Debug.Assert(_numberOfOutstandingOperations >= 0, "Number of outstanding operations should never be negative.");
312Debug.Assert(_numberOfOutstandingServiceTasks >= 0, "Number of outstanding service tasks should never be negative.");
313Debug.Assert(_numberOfOutstandingOperations >= _numberOfOutstandingServiceTasks, "Number of outstanding service tasks should never exceed the number of outstanding operations.");
354Debug.Assert(HasRoomForMoreServiceTasks, "There must be room to process asynchronously.");
424Debug.Assert(
495Debug.Assert(_numberOfOutstandingOperations > 0, "Expected a positive number of outstanding operations, since we're completing one here.");
502Debug.Assert(_numberOfOutstandingServiceTasks > 0, "Expected a positive number of outstanding service tasks, since we're completing one here.");
523Debug.Assert(UsesAsyncCompletion, "Only valid to use when in async mode.");
615Debug.Assert(
660Debug.Assert(messageId != Common.INVALID_REORDERING_ID, "The assigned message ID is invalid.");
664Debug.Assert(_boundingState.OutstandingTransfers >= 0, "Expected TryConsumePostponedMessage to not be negative.");
730Debug.Assert((_decliningPermanently && _messages.IsEmpty) || CanceledOrFaulted, "There must be no more messages.");
758lock (IncomingLock) Debug.Assert(_numberOfOutstandingOperations == 0, "Everything must be done by now.");
811Debug.Assert(count != 0, "Should only be called when the count is actually changing.");
817Debug.Assert(count > 0 || (count < 0 && _boundingState.CurrentCount + count >= 0),
Internal\TargetRegistry.cs (29)
37Debug.Assert(target != null, "The target that is supposed to be linked must not be null.");
38Debug.Assert(linkOptions != null, "The linkOptions must not be null.");
74Debug.Assert(owningSource != null, "The TargetRegistry instance must be owned by a source block.");
85Debug.Assert(target != null, "The target that is supposed to be linked must not be null.");
86Debug.Assert(linkOptions != null, "The link options must not be null.");
97Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time.");
121Debug.Assert(target != null, "Target to remove is required.");
124Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time.");
138Debug.Assert(target != null, "Target to remove is required.");
141Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time.");
142Debug.Assert(!onlyIfReachedMaxMessages || _linksWithRemainingMessages > 0, "We shouldn't have ended on the slow path.");
148Debug.Assert(node != null, "The LinkedTargetInfo node referenced in the Dictionary must be non-null.");
159Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time.");
169Debug.Assert(node.RemainingMessages > 1, "The target should have been removed, because there are no remaining messages.");
184Debug.Assert(_linksWithRemainingMessages >= 0, "_linksWithRemainingMessages must be non-negative at any time.");
194Debug.Assert(_owningSource.Completion.IsCompleted, "The owning source must have completed before propagating completion.");
214Debug.Assert(node != null, "Requires a node to be added.");
223Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must either be null or non-null.");
224Debug.Assert(_lastTarget.Next == null, "The last node must not have a successor.");
225Debug.Assert(_firstTarget.Previous == null, "The first node must not have a predecessor.");
243Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null after AddToList.");
250Debug.Assert(node != null, "Node to remove is required.");
251Debug.Assert(_firstTarget != null && _lastTarget != null, "Both first and last node must be non-null before RemoveFromList.");
273Debug.Assert((_firstTarget != null) == (_lastTarget != null), "Both first and last node must either be null or non-null after RemoveFromList.");
312Debug.Assert(owningSource != null, "Propagator must be associated with a source.");
313Debug.Assert(target != null, "Target to propagate to is required.");
323Debug.Assert(source == _owningSource, "Only valid to be used with the source for which it was created.");
378Debug.Assert(passthrough != null, "Need a propagator with which to construct the debug view.");
398Debug.Assert(registry != null, "Need a registry with which to construct the debug view.");
src\runtime\src\libraries\Common\src\System\Collections\Concurrent\SingleProducerSingleConsumerQueue.cs (13)
67Debug.Assert(InitialSegmentSize > 0, "Initial segment size must be > 0.");
68Debug.Assert((InitialSegmentSize & (InitialSegmentSize - 1)) == 0, "Initial segment size must be a power of 2");
69Debug.Assert(InitialSegmentSize <= MaxSegmentSize, "Initial segment size should be <= maximum.");
70Debug.Assert(MaxSegmentSize < int.MaxValue / 2, "Max segment size * 2 must be < int.MaxValue, or else overflow could occur.");
102Debug.Assert(segment is not null, "Expected a non-null segment.");
112Debug.Assert(newSegmentSize > 0, "The max size should always be small enough that we don't overflow.");
179Debug.Assert(segment is not null, "Expected a non-null segment.");
180Debug.Assert(array is not null, "Expected a non-null item array.");
253Debug.Assert(segment is not null, "Expected a non-null segment.");
254Debug.Assert(array is not null, "Expected a non-null item array.");
368Debug.Assert(syncObj is not null, "The syncObj parameter is null.");
390Debug.Assert((size & (size - 1)) == 0, "Size must be a power of 2");
429Debug.Assert(queue is not null, "Expected a non-null queue.");
System.Threading.Tasks.Parallel (44)
System.Transactions.Local (226)
System\Transactions\Oletx\OletxTransaction.cs (12)
174Debug.Assert(returnValue != null, "OletxTransaction.GetRealObject - GetTxFromPropToken returned null");
242Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
262Debug.Assert(singlePhaseNotification != null, "Argument is null");
263Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
293Debug.Assert(enlistmentNotification != null, "Argument is null");
294Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
329Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
371Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
448Debug.Assert(Disposed == 0, "OletxTransction object is disposed");
794Debug.Assert(Phase1EnlistVolatilementContainer == null,
939Debug.Assert(Phase1EnlistVolatilementContainer == null,
1091Debug.Assert(localCount >= 0, "RealOletxTransction.undisposedOletxTransationCount < 0");
System\Transactions\Oletx\OletxVolatileEnlistment.cs (31)
17Debug.Assert(realOletxTransaction != null, "Argument is null");
97Debug.Assert(enlistment != null, "Argument is null");
142Debug.Assert(IncompleteDependentClones >= 0, "OletxPhase0VolatileEnlistmentContainer.DependentCloneCompleted - incompleteDependentClones < 0");
238Debug.Assert(OutstandingNotifications >= 0, "OletxPhase0VolatileEnlistmentContainer.DecrementOutstandingNotifications - outstandingNotifications < 0");
311Debug.Fail("OletxPhase0VolatileEnlistmentContainer.OutcomeFromTransaction, outcome is not Commited or Aborted or InDoubt");
323Debug.Assert(Phase == 0 && OutstandingNotifications == 0);
339Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Committed, enlistmentList element is not an OletxVolatileEnlistment.");
371Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Aborted, enlistmentList element is not an OletxVolatileEnlistment.");
403Debug.Fail("OletxPhase1VolatileEnlistmentContainer.InDoubt, enlistmentList element is not an OletxVolatileEnlistment.");
499Debug.Fail("OletxPhase0VolatileEnlistmentContainer.Phase0Request, phase != -1");
523Debug.Fail("OletxPhase0VolatileEnlistmentContainer.Phase0Request, enlistmentList element is not an OletxVolatileEnlistment.");
528Debug.Assert(enlistment.EnlistDuringPrepareRequired, "OletxPhase0VolatileEnlistmentContainer.Phase0Request, enlistmentList element not marked as EnlistmentDuringPrepareRequired.");
529Debug.Assert(!abortHint, "OletxPhase0VolatileEnlistmentContainer.Phase0Request, abortingHint is true just before sending Prepares.");
569Debug.Assert(enlistment != null, "Argument is null");
616Debug.Assert(OutstandingNotifications >= 0, "OletxPhase1VolatileEnlistmentContainer.DependentCloneCompleted - DependentCloneCompleted < 0");
722Debug.Assert(OutstandingNotifications >= 0, "OletxPhase1VolatileEnlistmentContainer.DecrementOutstandingNotifications - outstandingNotifications < 0");
803Debug.Fail("OletxPhase1VolatileEnlistmentContainer.OutcomeFromTransaction, outcome is not Aborted or InDoubt");
842Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Committed, enlistmentList element is not an OletxVolatileEnlistment.");
872Debug.Fail("OletxPhase1VolatileEnlistmentContainer.Aborted, enlistmentList element is not an OletxVolatileEnlistment.");
902Debug.Fail("OletxPhase1VolatileEnlistmentContainer.InDoubt, enlistmentList element is not an OletxVolatileEnlistment.");
969Debug.Fail("OletxPhase1VolatileEnlistmentContainer.VoteRequest, enlistmentList element is not an OletxVolatileEnlistment.");
1075Debug.Fail("OletxVolatileEnlistment.Prepare, no enlistmentNotification member.");
1110Debug.Fail("OletxVolatileEnlistment.Prepare, invalid state.");
1156Debug.Fail("OletxVolatileEnlistment.Commit, no enlistmentNotification member.");
1172Debug.Fail("OletxVolatileEnlistment.Commit, invalid state.");
1239Debug.Fail("OletxVolatileEnlistment.Rollback, invalid state.");
1291Debug.Fail("OletxVolatileEnlistment.InDoubt, no enlistmentNotification member.");
1307Debug.Fail("OletxVolatileEnlistment.InDoubt, invalid state.");
1387Debug.Fail("OletxVolatileEnlistment.Prepared, no container member.");
1422Debug.Fail("OletxVolatileEnlistment.Prepared, invalid pending outcome value.");
1463Debug.Fail("OletxVolatileEnlistment.ForceRollback, no container member.");
System\Transactions\TransactionState.cs (70)
163Debug.Assert(tx.State != this, "Changing to the same state.");
185Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
299Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
311Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
323Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
335Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
347Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
359Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
371Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
383Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
395Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
411Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
417Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
423Debug.Fail($"Invalid Event for State; Current State: {GetType()}");
615Debug.Assert(tx._phase0Volatiles._dependentClones >= 0);
618Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <=
636Debug.Assert(tx._phase1Volatiles._dependentClones >= 0);
664Debug.Assert(tx.promotedToken != null);
788Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in PSPEInitialize");
835Debug.Assert(tx._promoter != null, "Transaction Promoter is Null entering SubordinateActive");
845Debug.Assert(tx._promoter != null);
1077Debug.Assert(tx._promoterType != Guid.Empty, "InternalTransaction.PromoterType was not set in Phase0PSPEInitialize");
1183Debug.Assert(tx._committableTransaction != null);
1266Debug.Assert(tx._phase1Volatiles._volatileEnlistmentCount == 1,
1668Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
1697Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
1727Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
1768Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
1803Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
1879Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <=
1893Debug.Assert(tx._phase0WaveDependentCloneCount >= 0);
1927Debug.Assert(tx._phase1Volatiles._dependentClones >= 0);
1934Debug.Assert(0 <= tx._abortingDependentCloneCount);
1969Debug.Assert(tx.PromotedTransaction != null);
1991Debug.Assert(tx.PromotedTransaction != null);
2007Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
2065Debug.Assert(tx.PromotedTransaction != null);
2101Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes.");
2131Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null);
2145Debug.Assert((tx._promoterType == Guid.Empty) || (tx._promoterType == TransactionInterop.PromoterTypeDtc), "Promoted to MSTC but PromoterType is not TransactionInterop.PromoterTypeDtc");
2255Debug.Assert(tx.PromotedTransaction != null);
2271Debug.Assert(tx.PromotedTransaction != null);
2296Debug.Assert(tx.PromotedTransaction != null && tx.PromotedTransaction.RealTransaction != null);
2300Debug.Assert(tx.State != null);
2536Debug.Assert(tx._phase0Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted.");
2541Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null);
2641Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist for VolatilePrepareDone when promoted.");
2646Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null);
2763Debug.Assert(tx._phase0Volatiles.VolatileDemux._promotedEnlistment != null);
2774Debug.Assert(tx.PromotedTransaction != null);
2798Debug.Assert(tx._phase1Volatiles.VolatileDemux != null, "Volatile Demux must exist.");
2805Debug.Assert(tx._phase1Volatiles.VolatileDemux._promotedEnlistment != null);
2861Debug.Assert(tx.PromotedTransaction != null, "Promoted state not valid for transaction.");
2891Debug.Assert(tx.PromotedTransaction != null);
3361Debug.Assert(tx._durableEnlistment != null);
3491Debug.Assert(tx._durableEnlistment != null, "PromotedNonMSDTC state is not valid for transaction");
3532Debug.Assert(tx._phase0Volatiles._preparedVolatileEnlistments <=
3551Debug.Assert(tx._phase1Volatiles._dependentClones >= 0);
3630Debug.Assert(tx.promotedToken != null, "InternalTransaction.promotedToken is null in TransactionStateDelegatedNonMSDTCBase or one of its derived classes.");
3743Debug.Assert(tx._committableTransaction != null);
3844Debug.Assert(tx._durableEnlistment != null);
4262Debug.Assert((distributedTx == null), "PSPEPromote for non-MSDTC promotion returned a distributed transaction.");
4263Debug.Assert((tx.promotedToken != null), "PSPEPromote for non-MSDTC promotion did not set InternalTransaction.PromotedToken.");
4304Debug.Assert(tx.PromotedTransaction != null);
4348Debug.Assert(tx.State == TransactionStateActive, "PSPEPromote called from state other than TransactionStateActive");
4375Debug.Assert(tx.State == TransactionStatePhase0, "Phase0PSPEInitialize called from state other than TransactionStatePhase0");
4398Debug.Assert(returnState == TransactionStateDelegated ||
4419Debug.Assert(tx._promoter != null);
4613Debug.Assert(tx._durableEnlistment != null);
4649Debug.Assert(tx._durableEnlistment != null);
System.Web.HttpUtility (13)
System.Windows.Controls.Ribbon (79)
System.Windows.Extensions (11)
System.Windows.Forms (2476)
System\Windows\Forms\ActiveX\AxHost.cs (46)
1028Debug.Assert(!Visible, "If we were visible we would not be need a fake window.");
1045Debug.Assert(!IsHandleCreated, "if we need a fake window, we can't have a real one");
1260Debug.Assert(!OwnWindow(), "Why are we here if we own our window?");
1301Debug.Fail("how did we ever get into the open state?");
1324Debug.Assert(GetOcState() == OC_LOADED, " failed transition");
1329Debug.Assert(GetOcState() == OC_PASSIVE, " failed transition");
1333Debug.Fail("bad state");
1363Debug.Assert(GetOcState() == OC_LOADED, " failed transition");
1368Debug.Assert(GetOcState() == OC_RUNNING, " failed transition");
1380Debug.Assert(!_axState[s_fOwnWindow], "If we are invis at runtime, we should never be going beyond OC_RUNNING");
1429Debug.Assert(GetOcState() == OC_UIACTIVE, " failed transition");
1433Debug.Fail("bad state");
1457Debug.Fail(t.ToString());
1482Debug.Assert(CanUIActivate, "we have to be able to uiactivate");
1491Debug.Assert(_axState[s_fFakingWindow], "have to be faking it in order to destroy it...");
1525Debug.Fail("extremely naughty ctl is refusing to give us an hWnd... giving up...");
1574Debug.Assert(!_axState[s_fFakingWindow], "if we were visible, we could not have had a fake window...");
1604Debug.Fail(t.ToString());
1618Debug.Assert(!_axState[s_fOwnWindow], "can't own our window when hiding");
1619Debug.Assert(IsHandleCreated, "gotta have a window to hide");
1620Debug.Assert(GetOcState() >= OC_INPLACE, "have to be in place in order to hide.");
1625Debug.Assert(!IsHandleCreated, "if we are inplace deactivated we should not have a window.");
1778Debug.Fail($"error in processMnemonic: {t}");
1822Debug.Assert(!_axState[s_disposed], "we could not be asking for the object when we are axState[disposed]...");
1839Debug.Fail("Trying to reload with a OcxState that is of a different type.");
1895Debug.Fail("we got to have an old state which holds out scribble storage...");
1914Debug.Fail("unknown storage type.");
2013Debug.Assert(_storageType != StorageType.Unknown, "if we are loaded, out storage type must be set!");
2052Debug.Fail("unknown storage type");
2177Debug.Assert(_freezeCount >= 0, "invalid freeze count!");
2300Debug.Assert(_instance is null, "instance must be null");
2304Debug.Assert(_instance is not null, "w/o an exception being thrown we must have an object...");
2386Debug.Assert(selectionStyle is >= 0 and <= 2, "Invalid selection style");
2402Debug.Assert((_flags & AxFlags.PreventEditMode) == 0, "edit mode should have been disabled");
2589Debug.Assert(baseProps[i] is not null, $"Null base prop at location: {i}");
2625Debug.Assert(propDesc is not null, $"Cannot find cached entry for: {propName}");
2629Debug.Fail($"Duplicate property with same name: {propName}");
2707Debug.Assert(dispid != PInvokeCore.DISPID_UNKNOWN, "Wrong dispid sent to GetPropertyDescriptorFromDispid");
2774Debug.Fail("no implemented persistence interfaces on object");
2841Debug.Fail("unknown storage type.");
2879Debug.Fail(t.ToString());
2896Debug.Fail(t.ToString());
2959Debug.Fail($"Failed to get instance in {nameof(ShowPropertyPageForDispid)}.");
3231Debug.Assert(IsHandleCreated, "we got to have a handle to be here...");
3375Debug.Fail(t.ToString());
3393Debug.Fail(ex.Message);
System\Windows\Forms\Control.cs (33)
542Debug.Assert(accessibleObject is not null, "Failed to create accessibility object");
561Debug.Assert(ncAccessibleObject is not null, "Failed to create NON-CLIENT accessibility object");
813Debug.Assert(!backBrush.IsNull, "Failed to create brushHandle");
1833Debug.Assert(s_defaultFont is not null, "defaultFont wasn't set!");
2130Debug.Assert(
2718Debug.Assert(Margin == value, "Error detected while setting Margin.");
2742Debug.Assert(MaximumSize == DefaultMaximumSize, "Error detected while resetting MaximumSize.");
2748Debug.Assert(MaximumSize == value, "Error detected while setting MaximumSize.");
2767Debug.Assert(MinimumSize == value, "Error detected while setting MinimumSize.");
4815Debug.Assert((cp.ExStyle & (int)WINDOW_EX_STYLE.WS_EX_MDICHILD) == 0, "Can't put MDI child forms on the parking form");
5264Debug.Assert(this == entry._caller, "Called BeginInvoke on one control, and the corresponding EndInvoke on a different control");
5280Debug.Assert(asyncResult.IsCompleted, "Why isn't this asyncResult done yet?");
5359Debug.Assert(c.IsHandleCreated, "FindMarshalingControl chose a bad control.");
6011Debug.Assert(window is not null, "window is null in Control.GetSafeHandle");
6128Debug.Assert(region.GetPointer() != null);
6395Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for WaitCallback");
6400Debug.Assert(tme._args!.Length == 1, "Arguments are wrong for SendOrPostCallback");
7119Debug.Fail($"Unexpected {nameof(VisualStylesModeChangeImpact)}: {impact}");
9096Debug.Fail($"Unknown PaintLayer {layer}");
9170Debug.Assert(args is not null, "This method should never be called with null args.");
9518Debug.Assert((OBJ_TYPE)PInvokeCore.GetObjectType(hDC) == OBJ_TYPE.OBJ_ENHMETADC,
9520Debug.Assert((lParam & (long)PInvoke.PRF_CHILDREN) != 0,
9530Debug.Assert(success, "GetViewportOrgEx() failed.");
9538Debug.Assert(!hClippingRegion.IsNull, "CreateRectRgn() failed.");
9542Debug.Assert(
9560Debug.Assert(success, "GetWindowRect() failed.");
9962Debug.WriteLineIf(
10991Debug.Assert(value != -1, "Outdated call to SetParentHandle");
10999Debug.Assert(Handle != value, "Cycle created in SetParentHandle");
11515Debug.Assert(LayoutSuspendCount > 0, "SuspendLayout: layoutSuspendCount overflowed.");
11531Debug.Assert(scaledFont is not null);
12636Debug.WriteLine("Could not create buffered graphics, will paint in the surface directly");
13478Debug.Assert(sizeProperty is not null && locationProperty is not null, "Error retrieving Size/Location properties on Control.");
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonStandardAdapter.cs (1)
210Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
190Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxPopupAdapter.cs (1)
123Debug.Assert(
System\Windows\Forms\Controls\Buttons\ButtonInternal\DarkMode\ModernButtonColorMath.cs (1)
49Debug.Assert(
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (13)
649Debug.Assert(IsHandleCreated, "Handle should be created at this point");
2102Debug.Assert((ModifierKeys & Keys.Alt) == 0);
2120Debug.Assert((ModifierKeys & Keys.Alt) == 0);
2241Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created.");
2251Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created.");
2281Debug.Assert(actualLength != PInvoke.LB_ERR, "Should have validated the index above");
2292Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created.");
2299Debug.Assert(insertIndex == index, $"NativeComboBox inserted at {insertIndex} not the requested index of {index}");
2308Debug.Assert(IsHandleCreated, "Shouldn't be calling Native methods before the handle is created.");
2360Debug.Assert(_childEdit is null, "Child edit window already attached");
2361Debug.Assert(_childListBox is null, "Child listbox window already attached");
2948Debug.Assert(DisplayMember.Equals(string.Empty), "if this list is sorted it means that dataSource was null when Sorted first became true. at that point DisplayMember had to be String.Empty");
3276Debug.Assert(DropDownStyle == ComboBoxStyle.DropDownList);
System\Windows\Forms\Controls\DataGridView\DataGridView.DataConnection.cs (41)
148Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_cancellingRowEdit]);
163Debug.Assert(CurrencyManager.AllowAdd, "why did we call AddNew on the currency manager when the currency manager does not allow new rows?");
274Debug.Assert(_props is not null);
311Debug.Assert(sortProperty is null);
327Debug.Assert(_props is not null);
341Debug.Assert(DataBoundRowsCount() == CurrencyManager!.List!.Count || (_owner.Columns.Count == 0 && dataGridViewRowsCount == 0),
348Debug.Assert(sender == CurrencyManager, "did we forget to unregister our ListChanged event handler?");
388Debug.Assert(!_dataConnectionState[DATACONNECTIONSTATE_inAddNew] || !_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew],
414Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start the add new transaction when the AllowUserToAddRowsInternal is false?");
474Debug.Assert(CurrencyManager?.List is not null);
488Debug.Assert(DataBoundRowsCount() != -1, "the data bound data grid view rows count should be at least 0");
492Debug.Assert(CurrencyManager?.List is not null);
508Debug.Assert(CurrencyManager.List.Count == 1);
513Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_finishedAddNew]);
529Debug.Assert(CurrencyManager!.List!.Count == 0, "we deleted the row that the Child table forcefully added");
551Debug.Assert(CurrencyManager?.List is not null);
603Debug.Fail("fail in debug builds so we can catch this situation in the check in suites");
616Debug.Assert(e.OldIndex > -1, "the currency manager should have taken care of this case");
617Debug.Assert(e.NewIndex > -1, "how can we move an item outside of the list?");
623Debug.Assert(e.NewIndex != -1, "the item changed event does not cover changes to the entire list");
678Debug.Assert(sender == CurrencyManager, "did we forget to unregister our events?");
681Debug.Assert(_owner.CurrentCellAddress.X == -1);
736Debug.Assert(CurrencyManager?.List is not null);
766Debug.Assert(_owner.NewRowIndex != -1, "the NewRowIndex is -1 only when AllowUserToAddRows is false");
783Debug.Assert(sender == DataSource);
784Debug.Assert(DataSource is ISupportInitializeNotification);
785Debug.Assert(_dataConnectionState[DATACONNECTIONSTATE_dataSourceInitializedHookedUp]);
798Debug.Assert(CurrencyManager is not null);
805Debug.Assert(CurrencyManager is not null);
826Debug.Assert(_owner.AllowUserToAddRowsInternal, "how did we start an add new row transaction if the dataGridView control has AllowUserToAddRows == false?");
828Debug.Assert(CurrencyManager?.List is not null);
837Debug.Assert(_owner.NewRowIndex == CurrencyManager.List.Count - 1);
890Debug.Fail("we only care about which data fields are read only when we are data bound");
1141Debug.Assert(rowIndex >= 0);
1174Debug.Assert(rowIndex >= 0);
1207Debug.Assert(!_props[i].IsBrowsable || typeof(IList).IsAssignableFrom(_props[i].PropertyType), "if the DGV does not have any columns then the properties in the currency manager should be Browsable(false) or point to sub lists");
1222Debug.Assert(dataGridViewColumn is not null);
1229Debug.Assert(rowIndex >= -1);
1394Debug.Assert(DataBoundRowsCount() == CurrencyManager.List!.Count, "if the back end was changed while in AddNew the DGV should have updated its rows collection");
1541Debug.Assert(dataGridViewColumn.IsDataBound && dataGridViewColumn.BoundColumnIndex != -1, "we need a bound column index to perform the sort");
1542Debug.Assert(List is IBindingList, "you should have checked by now that we are bound to an IBindingList");
System\Windows\Forms\Controls\DataGridView\DataGridView.Methods.cs (784)
71Debug.Assert(NewRowIndex == -1);
299Debug.Assert(rowIndex > -1);
300Debug.Assert(rowIndex < Rows.Count);
333Debug.Assert(_noAutoSizeCount > 0);
342Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None);
343Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0);
369Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count);
370Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
371Debug.Assert(_autoSizeRowsMode is DataGridViewAutoSizeRowsMode.DisplayedHeaders
388Debug.Assert(columnIndex == -1);
389Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0);
393Debug.Assert(RowHeadersWidth > 0);
394Debug.Assert(RowHeadersVisible);
409Debug.Assert(preferredThickness >= minimumHeight);
417Debug.Assert(_autoSizeRowsMode != DataGridViewAutoSizeRowsMode.None);
466Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.Header) != 0);
470Debug.Assert(RowHeadersWidth > 0);
471Debug.Assert(RowHeadersVisible);
493Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)_autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0);
534Debug.Assert(dataGridViewColumn.Visible);
535Debug.Assert(!dataGridViewColumn.Frozen);
536Debug.Assert(dataGridViewColumn.MinimumWidth <= width);
537Debug.Assert(dataGridViewColumn.InheritedAutoSizeMode == DataGridViewAutoSizeColumnMode.Fill);
538Debug.Assert(!_layout._dirty);
544Debug.Assert(dataGridViewColumn.MinimumWidth == dataGridViewColumn.Width);
569Debug.Assert(!dataGridViewColumnTmp.Frozen);
695Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F);
714Debug.Assert(!dataGridViewColumnTmp.Frozen);
758Debug.Assert(newWeightSum > 0);
862Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F);
907Debug.Assert(!dataGridViewColumn.Frozen);
925Debug.Assert(_layout.Data.Width == _layout.Inside.Width - _layout.RowHeaders.Width - (SingleVerticalBorderAdded ? 1 : 0));
991Debug.Assert(weightSum > 0);
1166Debug.Assert(oldDesiredWidth >= mostDeservingDataGridViewColumn.DesiredFillWidth);
1178Debug.Assert(widthLoss >= 0);
1197Debug.Assert(Math.Abs(weightSum - weightSumDbg) < 1.0F);
1256Debug.Assert(Math.Abs(dataGridViewColumnTmp.UsedFillWeight * _availableWidthForFillColumns - weightSum * dataGridViewColumnTmp.Width) / weightSum / dataGridViewColumnTmp.Width <= 1.25F / dataGridViewColumnTmp.Width);
1278Debug.Assert(widthSum == _availableWidthForFillColumns);
1319Debug.Assert((((DataGridViewAutoSizeRowsModeInternal)autoSizeRowsMode) & DataGridViewAutoSizeRowsModeInternal.DisplayedRows) != 0);
1479Debug.Assert(_selectedBandIndexes.Contains(rowIndex) ==
1504Debug.Fail("DataGridView.AreAllCellsSelected - Shouldn't reach this code");
1617Debug.Assert(clonedColumn.IsDataBound);
1634Debug.Assert(finalClonedColumns.Length == 0);
1635Debug.Assert(clonedColumnsCount == 0);
1648Debug.Assert(dataGridViewColumn.IsDataBound);
1656Debug.Assert(autoSizeColumnCriteriaFilter != DataGridViewAutoSizeColumnCriteriaInternal.None);
1657Debug.Assert((autoSizeColumnCriteriaFilter & DataGridViewAutoSizeColumnCriteriaInternal.Fill) == 0);
1792Debug.Assert(_noAutoSizeCount > 0);
1857Debug.Assert(_noAutoSizeCount > 0);
1864Debug.Assert(autoSizeColumnCriteriaInternal is DataGridViewAutoSizeColumnCriteriaInternal.Header
1869Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
1915Debug.Assert(_noAutoSizeCount > 0);
2090Debug.Fail("Unexpected rowHeadersWidthSizeMode value in AutoResizeRowHeadersWidth");
2107Debug.Assert(_noAutoSizeCount > 0);
2252Debug.Fail("Unexpected rowHeadersWidthSizeMode value in AutoResizeRowHeadersWidth");
2269Debug.Assert(_noAutoSizeCount > 0);
2276Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
2277Debug.Assert(((DataGridViewAutoSizeRowCriteriaInternal)autoSizeRowMode & InvalidDataGridViewAutoSizeRowCriteriaInternalMask) == 0);
2331Debug.Assert(_noAutoSizeCount > 0);
2443Debug.Assert(_lastRowSplitBar == -1);
2578Debug.Assert(_ptCurrentCell.X >= 0 && _ptCurrentCell.X < Columns.Count);
2579Debug.Assert(_ptCurrentCell.Y >= 0 && _ptCurrentCell.Y < Rows.Count);
2580Debug.Assert(!IsCurrentCellInEditMode);
2608Debug.Assert(!IsCurrentCellInEditMode);
2661Debug.Assert(((IDataGridViewEditingControl)EditingControl).EditingControlDataGridView == this);
2665Debug.Assert(EditingControl is null);
2667Debug.Assert(EditingControl is not null);
2674Debug.Assert(EditingControl is not null);
2688Debug.Assert(EditingControl is not null);
2689Debug.Assert(_editingPanel is not null);
2692Debug.Assert(dgvese.CellStyle is not null);
2759Debug.Assert(_lastColSplitBar == -1);
2782Debug.Assert(_lastRowSplitBar == -1);
2789Debug.Assert(inheritedCellStyle is not null);
2795Debug.Assert(cellStyle is not null);
2799Debug.Assert(columnHeadersStyle is not null);
2802Debug.Assert(dataGridViewStyle is not null);
2920Debug.Assert(dataGridViewStyle.Alignment != DataGridViewContentAlignment.NotSet);
2934Debug.Assert(dataGridViewStyle.WrapMode != DataGridViewTriState.NotSet);
3040Debug.Assert(_ptCurrentCell.Y != -1);
3073Debug.Assert(success);
3089Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
3091Debug.Assert(dataGridViewEditingCell is not null);
3124Debug.Assert(dataGridViewEditingCell is not null);
3132Debug.Assert((AllowUserToAddRowsInternal && Rows.Count == 1) || (!AllowUserToAddRowsInternal && Rows.Count == 0));
3149Debug.Assert(success);
3177Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
3209Debug.Assert(Rows.GetFirstRow(DataGridViewElementStates.Visible) == 0);
3250Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
3315Debug.Assert(dataGridViewCurrentCell.OwningColumn is not null);
3442Debug.Assert(_noDimensionChangeCount >= 0);
3580Debug.Assert(_noDimensionChangeCount >= 0);
3591Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count, $"Invalid columnIndex: {columnIndex}");
3607Debug.Assert(firstVisibleFrozenColumn is not null);
3613Debug.Assert(Columns.DisplayInOrder(firstVisibleFrozenColumn.Index, dataGridViewColumn.Index));
3646Debug.Assert(hti._col != -1);
3697Debug.Assert(hti._col != -1);
3757Debug.Assert(_ptCurrentCell.X > -1);
3861Debug.Assert(((EditingControl is not null && ((IDataGridViewEditingControl)EditingControl).EditingControlValueChanged)
3872Debug.Assert(_ptCurrentCell.X > -1);
3905Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
3943Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
4019Debug.Assert(_ptCurrentCell.X > -1);
4142Debug.Assert(columnIndex < Columns.Count);
4165Debug.Assert(success);
4183Debug.Assert(dataGridViewRow is not null);
4243Debug.Assert(cx <= _horizontalOffset);
4332Debug.Assert(rowIndex < DisplayedBandsInfo.FirstDisplayedScrollingRow);
4388Debug.Assert(insideLeft.Height >= 0);
4410Debug.Assert(insideLeft.Width >= 0);
4429Debug.Assert(colHeaders.Width >= 0);
4471Debug.Assert(newLayout.Data.X >= 0);
4472Debug.Assert(newLayout.Data.Y >= 0);
4473Debug.Assert(newLayout.Data.Width >= 0);
4474Debug.Assert(newLayout.Data.Height >= 0);
4482Debug.Assert(!_layout._dirty);
4516Debug.Assert(oldNumTotallyVisibleFrozenRows == DisplayedBandsInfo.NumTotallyDisplayedFrozenRows);
4517Debug.Assert(oldNumVisibleScrollingRows == DisplayedBandsInfo.NumDisplayedScrollingRows);
4518Debug.Assert(oldNumTotallyVisibleScrollingRows == DisplayedBandsInfo.NumTotallyDisplayedScrollingRows);
4519Debug.Assert(oldFirstVisibleScrollingRow == DisplayedBandsInfo.FirstDisplayedScrollingRow);
4525Debug.Assert(newFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol);
4530Debug.Assert(oldLastTotallyVisibleScrollingCol == DisplayedBandsInfo.LastTotallyDisplayedScrollingCol);
4531Debug.Assert(oldFirstVisibleScrollingCol == DisplayedBandsInfo.FirstDisplayedScrollingCol);
4542Debug.Assert(_vertScrollBar.Maximum > 0);
4557Debug.Assert(VerticalScrollingOffset == _vertScrollBar.Value);
4609Debug.Assert(cx <= Columns.GetColumnsWidth(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen));
4652Debug.Assert(firstDisplayedScrollingCol >= 0);
4674Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0);
4694Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == 0);
4700Debug.Assert(dataGridViewColumn.Thickness > displayWidth - cx);
4707Debug.Assert(FirstDisplayedScrollingColumnHiddenWidth == GetNegOffsetFromHorizontalOffset(_horizontalOffset));
4711Debug.Assert(numVisibleScrollingCols <= visibleScrollingColumnsTmp, "the number of displayed columns can only grow");
4727Debug.Assert(jumpFromFirstVisibleScrollingCol >= -1);
4735Debug.Assert(firstDisplayedScrollingCol >= 0);
4758Debug.Assert((DisplayedBandsInfo.NumDisplayedScrollingCols > 0 && DisplayedBandsInfo.FirstDisplayedScrollingCol != -1)
4788Debug.Assert(cy < displayHeight);
4882Debug.Assert(lastDisplayedScrollingRow == -1);
4891Debug.Assert(firstDisplayedFrozenRow < nRows, "firstDisplayedFrozenRow larger than number of rows");
4892Debug.Assert(lastDisplayedFrozenRow < nRows, "lastDisplayedFrozenRow larger than number of rows");
4893Debug.Assert(lastDisplayedScrollingRow < nRows, "lastDisplayedScrollingRow larger than number of rows");
4901Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedFrozenRows >= 0, "the number of visible frozen rows can't be negative");
4902Debug.Assert(DisplayedBandsInfo.NumDisplayedScrollingRows >= 0, "the number of visible scrolling rows can't be negative");
4903Debug.Assert(DisplayedBandsInfo.NumTotallyDisplayedScrollingRows >= 0, "the number of totally visible scrolling rows can't be negative");
4904Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow < nRows, "firstDisplayedScrollingRow larger than number of rows");
4934Debug.Assert(dataGridViewColumn.DataGridView is null);
4935Debug.Assert(dataGridViewColumn.Index >= 0);
4936Debug.Assert(dataGridViewColumn.DisplayIndex >= 0);
4953Debug.Assert(Columns.VerifyColumnDisplayIndexes());
4968Debug.Assert(dataGridViewColumn.DataGridView == this);
4970Debug.Assert(dataGridViewColumn.DisplayIndex >= 0);
4987Debug.Assert(Columns.VerifyColumnDisplayIndexes());
5002Debug.Assert(anticipatedColumnIndex >= 0 && anticipatedColumnIndex <= Columns.Count);
5011Debug.Assert(dataGridViewColumn.DisplayIndex >= 0 && dataGridViewColumn.DisplayIndex <= Columns.Count);
5131Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex);
5132Debug.Assert(!_dataGridViewOper[OperationInDisplayIndexAdjustments]);
5194Debug.Assert(Columns[columnIndex].Index == columnIndex);
5201Debug.Assert(insertionCount > 0);
5212Debug.Assert(CurrentCellInternal is not null);
5219Debug.Assert(dataGridViewRow is not null);
5220Debug.Assert(anticipatedRowIndex >= 0 && anticipatedRowIndex <= Rows.Count);
5286Debug.Assert(dataGridViewRow is not null);
5347Debug.Assert(rowIndexDeleted >= 0);
5355Debug.Assert(dataGridViewRow.Index == rowIndex);
5372Debug.Assert(rowIndexInserted >= 0);
5373Debug.Assert(insertionCount > 0);
5381Debug.Assert(dataGridViewRow.Index == rowIndex);
5449Debug.Assert(Rows.Count > 1);
5450Debug.Assert(NewRowIndex != -1);
5460Debug.Assert(NewRowIndex == Rows.Count - 1);
5463Debug.Assert(dataGridViewRow.Index == -1);
5468Debug.Assert(NewRowIndex == -1);
5473Debug.Assert((Rows.GetRowState(NewRowIndex) & DataGridViewElementStates.Visible) != 0);
5474Debug.Assert(_ptCurrentCell.Y == NewRowIndex);
5544Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen);
5610Debug.Assert(NoSelectionChangeCount == 0);
5733Debug.Assert(_editingPanel is not null);
5734Debug.Assert(_ptCurrentCell.X != -1);
5946Debug.Assert(sender == EditingControl || sender == _editingPanel);
5947Debug.Assert(_ptCurrentCell.X != -1);
5956Debug.Assert(sender == EditingControl || sender == _editingPanel);
5957Debug.Assert(_ptCurrentCell.X != -1);
5966Debug.Assert(sender == EditingControl || sender == _editingPanel);
5972Debug.Assert(sender == EditingControl || sender == _editingPanel);
5978Debug.Assert(sender == EditingControl || sender == _editingPanel);
5984Debug.Assert(sender == EditingControl || sender == _editingPanel);
5987Debug.Assert(EditingControl is not null);
5988Debug.Assert(!_dataGridViewState1[State1_CustomCursorSet]);
6004Debug.Assert(sender == EditingControl || sender == _editingPanel);
6007Debug.Assert(EditingControl is not null);
6026Debug.Assert(sender == EditingControl || sender == _editingPanel);
6032Debug.Assert(sender == EditingControl || sender == _editingPanel);
6122Debug.Assert(proposed >= Columns[_trackColumn].MinimumThickness);
6123Debug.Assert(proposed <= DataGridViewBand.MaxBandThickness);
6234Debug.Assert(_editingPanel is null || _editingPanel.Controls.Count == 0);
6248Debug.Assert(success);
6261Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
6338Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None);
6390Debug.Assert(rowIndex >= 0);
6391Debug.Assert(rowIndex < Rows.Count);
6392Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0);
6393Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Frozen) == 0);
6429Debug.Assert(numDisplayedScrollingRows > 0);
6432Debug.Assert(rowIndexTmp != -1);
6445Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1);
6473Debug.Assert(rowIndexTmp != -1);
6497Debug.Assert(firstDisplayedFrozenRowIndex != -1);
6612Debug.Fail("Unexpected Displayed state for row");
6633Debug.Assert(numDisplayedScrollingCols > 0);
6637Debug.Assert(dataGridViewColumnTmp is not null);
6650Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol != -1);
6678Debug.Assert(dataGridViewColumnTmp is not null);
6762Debug.Fail("Unexpected Displayed state for column");
6979Debug.Assert(rowIndex >= 0);
6980Debug.Assert(dataGridViewCell.OwningColumn is not null);
7102Debug.Assert(columnIndex >= -1 && columnIndex < Columns.Count);
7103Debug.Assert(rowIndex >= -1 && rowIndex < Rows.Count);
7107Debug.Assert(dataGridViewRow is not null);
7288Debug.Assert(rowIndex != -1);
7815Debug.Assert(firstVisibleColumn is not null);
7816Debug.Assert(lastVisibleColumn is not null);
7840Debug.Assert(firstVisibleRowIndex != -1);
7841Debug.Assert(lastVisibleRowIndex != -1);
7889Debug.Assert(lRowIndex != -1);
7890Debug.Assert(uRowIndex != -1);
7891Debug.Assert(lColumn is not null);
7892Debug.Assert(uColumn is not null);
7893Debug.Assert(lColumn.Index == uColumn.Index || Columns.DisplayInOrder(lColumn.Index, uColumn.Index));
7894Debug.Assert(lRowIndex <= uRowIndex);
7919Debug.Assert(prevDataGridViewColumn is not null);
7982Debug.Assert(nextDataGridViewColumn is not null);
8011Debug.Assert(rowIndex != -1);
8017Debug.Assert(nextRowIndex != -1);
8034Debug.Assert(prevDataGridViewColumn is not null);
8104Debug.Assert(nextDataGridViewColumn is not null);
8183Debug.Assert(destinationBytes[97] == '<');
8184Debug.Assert(destinationBytes[bytecountEndOfHtml - 1] == '>');
8185Debug.Assert(destinationBytes[133] == '<');
8186Debug.Assert(destinationBytes[bytecountEndOfFragment] == '<');
8200Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
8322Debug.Assert(RightToLeftInternal || (x >= data.X - 1 && x < data.Right), "x must be inside the horizontal bounds of this.layout.Data");
8323Debug.Assert(!RightToLeftInternal || (x >= data.X && x <= data.Right), "x must be inside the horizontal bounds of this.layout.Data");
8382Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen);
8415Debug.Assert(xOffset > 0);
8450Debug.Assert(index < Columns.Count);
8451Debug.Assert(Columns[index].Visible);
8492Debug.Assert(dataGridViewColumn!.Visible && !dataGridViewColumn.Frozen);
8542Debug.Fail("Could not find column in GetColumnXFromIndex");
8569Debug.Assert(!_vertScrollBar.Enabled
8602Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
8638Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
8649Debug.Assert(mouseY > rectScrollingArea.Bottom);
8694Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0);
8745Debug.Assert((!RightToLeftInternal && mouseX > rectScrollingArea.Right) || (RightToLeftInternal && mouseX < rectScrollingArea.Left));
8819Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
8861Debug.Assert(mouseY >= rectScrollingArea.Top && mouseY <= rectScrollingArea.Bottom);
8962Debug.Assert(mouseX >= rectScrollingArea.Left && mouseX <= rectScrollingArea.Right);
9030Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
9108Debug.Assert(y >= data.Y - 1 && y < data.Bottom, "y must be inside the vertical bounds of the data area.");
9138Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0
9162Debug.Assert(yOffset > 0);
9195Debug.Assert(index >= 0 && index < Rows.Count);
9196Debug.Assert((Rows.GetRowState(index) & DataGridViewElementStates.Visible) != 0);
9232Debug.Assert(indexTmp != -1);
9237Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0
9254Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow != -1);
9271Debug.Fail("Could not find row in GetRowYFromIndex");
9344Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col));
9418Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row));
9485Debug.Assert(xColumnLeftEdge == GetColumnXFromIndex(hti._col));
9486Debug.Assert(yRowTopEdge == GetRowYFromIndex(hti._row));
9606Debug.Assert(rowIndex >= 0);
9627Debug.Assert(_dataGridViewOper[OperationTrackColSelect] || _dataGridViewOper[OperationTrackCellSelect]);
9638Debug.Assert(_horizScrollTimer is not null);
9693Debug.Assert(_ptCurrentCell.X == dataGridViewCell.ColumnIndex);
9721Debug.Assert(EditingControl is not null);
9772Debug.Assert(dataGridViewCell.DataGridView == this);
9812Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
9856Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
9884Debug.Assert(lo <= hi);
9885Debug.Assert(lo < Rows.Count);
9886Debug.Assert(hi < Rows.Count);
9916Debug.Assert(lo <= hi);
9917Debug.Assert(lo > -1);
10175Debug.Assert(_layout.Data.Height >= 0);
10198Debug.Assert(_layout.RowHeaders.Height >= 0);
10219Debug.Assert(_layout.Data.Width >= 0);
10228Debug.Assert(_layout.ColumnHeaders.Width >= 0);
10265Debug.Assert(_layout.Data.Height >= 0);
10276Debug.Assert(_layout.Data.Width >= 0);
10285Debug.Assert(_layout.ColumnHeaders.Width >= 0);
10314Debug.Assert(_horizScrollBar.Maximum > 0);
10356Debug.Assert(_vertScrollBar.Maximum > 0);
10398Debug.Assert(success);
10419Debug.Fail("Unexpected autoSizeRowsMode value in MapAutoSizeRowsModeToRowMode");
10447Debug.Assert(DataSource is not null, "this method should only be called when we have a data connection");
10448Debug.Assert(dataGridViewColumn.DataPropertyName.Length != 0, "this method should be called only for columns which have DataPropertyName set");
10530Debug.Assert(dataGridViewColumn.Index >= 0);
10531Debug.Assert(dataGridViewColumn.DataGridView == this);
10550Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
10583Debug.Assert(rowIndex >= 0);
10589Debug.Assert(rowIndex == Rows.Count - 1);
10599Debug.Assert(!dataGridViewCell.Selected);
10600Debug.Assert(dataGridViewRowDebug.Index != -1 || !dataGridViewCell.HasValue);
10610Debug.Assert(dataGridViewCell.OwningColumn is not null);
10621Debug.Assert(rowIndex >= 0);
10835Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount);
10849Debug.Assert(weightSum <= ushort.MaxValue);
10852Debug.Assert(dataGridViewColumns is not null);
10914Debug.Assert(weightSum <= ushort.MaxValue);
10937Debug.Assert(dataGridViewColumn.CellType is not null);
10955Debug.Assert(dataGridViewColumn.CellType is not null);
11032Debug.Assert(dataGridViewRows is not null);
11072Debug.Assert(!AllowUserToAddRowsInternal);
11162Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
11245Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
11301Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
11732Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
11750Debug.Assert(_noDimensionChangeCount >= 0);
11756Debug.Assert(dataGridViewCell.RowIndex >= -1);
11757Debug.Assert(dataGridViewCell.ColumnIndex >= -1);
11772Debug.Assert(columnIndex >= 0);
11773Debug.Assert(rowIndex >= 0);
11820Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
11838Debug.Assert(_noDimensionChangeCount >= 0);
11903Debug.Assert(hti.Type is not DataGridViewHitTestType.None
11906Debug.Assert(_ptMouseDownCell.X == hti._col);
11907Debug.Assert(_ptMouseDownCell.Y == hti._row);
11955Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True);
12062Debug.Assert(hti.Type == DataGridViewHitTestType.Cell);
12139Debug.Assert(MultiSelect || _individualSelectedCells.Count <= 1);
12188Debug.Assert(success);
12211Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
12267Debug.Assert(_selectedBandIndexes.Contains(hti._col));
12277Debug.Assert(success);
12294Debug.Assert(_selectedBandIndexes.Count <= 1);
12367Debug.Assert(_selectedBandIndexes.Count <= 1);
12389Debug.Assert(success);
12414Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
12465Debug.Assert(_selectedBandIndexes.Contains(hti._row) ==
12472Debug.Assert(_selectedBandIndexes.Contains(hti._row));
12482Debug.Assert(success);
12500Debug.Assert(_selectedBandIndexes.Count <= 1);
12573Debug.Assert(_selectedBandIndexes.Count <= 1);
12684Debug.Assert(hti.Type is not DataGridViewHitTestType.None
12696Debug.Assert(!_dataGridViewState2[State2_MessageFromEditingCtrls]);
12761Debug.Assert(MultiSelect);
12795Debug.Assert(success);
12811Debug.Assert(dataGridViewCell.RowIndex >= 0);
12855Debug.Assert(dataGridViewCellStyle is not null);
13056Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
13078Debug.Assert(_noDimensionChangeCount >= 0);
13102Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
13128Debug.Assert(_noDimensionChangeCount >= 0);
13363Debug.Assert(newDisplayIndex != dataGridViewColumn.DisplayIndex);
13421Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]);
13423Debug.Assert(Columns.VerifyColumnDisplayIndexes());
13431Debug.Assert(_dataGridViewOper[OperationInDisplayIndexAdjustments]);
13534Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
13613Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.None);
13614Debug.Assert(autoSizeColumnCriteriaInternal != DataGridViewAutoSizeColumnCriteriaInternal.Fill);
13647Debug.Assert(SortOrder != SortOrder.None);
13673Debug.Assert(hti.Type == DataGridViewHitTestType.ColumnHeader);
13773Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
13803Debug.Assert(_individualSelectedCells.Count == 0);
13847Debug.Assert(success);
13859Debug.Assert(success);
13870Debug.Assert(success);
13875Debug.Assert(CurrentCellAddress == new Point(-1, -1));
13880Debug.Assert(_selectedBandIndexes.Contains(hti._col));
14034Debug.Assert(dataGridViewColumn.Width == minimumWidth);
14114Debug.Assert(dataGridViewColumn.DataGridView is null);
14123Debug.Assert(hti._col >= 0);
14124Debug.Assert(MultiSelect);
14221Debug.Assert(success);
14334Debug.Assert(Columns.DisplayInOrder(dataGridViewColumn.Index, DisplayedBandsInfo.FirstDisplayedScrollingCol));
14387Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
14583Debug.Assert(AllowUserToAddRowsInternal);
14748Debug.Assert(!ReadOnly);
14769Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging");
14785Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0);
14789Debug.Assert(DataConnection is not null);
14790Debug.Assert(DataConnection.CurrencyManager is not null);
14791Debug.Assert(DataConnection.CurrencyManager.Position == _ptCurrentCell.Y);
14831Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging");
14849Debug.Assert(!Columns[dataGridViewCell.ColumnIndex].ReadOnly);
14850Debug.Assert(!Rows[dataGridViewCell.RowIndex].ReadOnly);
14851Debug.Assert(!ReadOnly);
14872Debug.Fail("Unexpected DataGridViewElementStates param in DataGridView.OnDataGridViewElementStateChanging");
14878Debug.Fail("Unexpected DataGridViewElement type in DataGridView.OnDataGridViewElementStateChanging");
15271Debug.Assert(_ptCurrentCell.X == -1);
15280Debug.Assert(success);
15286Debug.Assert(rowIndex >= 0);
15287Debug.Assert(insertionCount > 0);
15301Debug.Assert(rowIndex >= 0);
15309Debug.Assert(_ptCurrentCell.X == -1);
15318Debug.Assert(success);
15324Debug.Assert(rowIndex >= 0);
15325Debug.Assert(dataGridViewRows is not null);
15326Debug.Assert(dataGridViewRows.Length > 0);
15340Debug.Assert(dataGridViewRows is not null);
15341Debug.Assert(dataGridViewRows.Length > 0);
15349Debug.Assert(_ptCurrentCell.X == -1);
15358Debug.Assert(success);
15469Debug.Assert(dataGridViewRow.Cells.Count < newColumnCount);
15542Debug.Assert(success);
15608Debug.Assert(dataGridViewRows is not null);
15917Debug.Assert(dgvcme is not null);
15928Debug.Assert(dgvcme is not null);
15985Debug.Assert(dgvcme is not null);
16008Debug.Assert(Columns[columnIndex].Resizable == DataGridViewTriState.True);
16028Debug.Assert(_columnHeadersHeightSizeMode == DataGridViewColumnHeadersHeightSizeMode.EnableResizing);
16035Debug.Assert(dgvcme is not null);
16058Debug.Assert(Rows[rowIndex].Resizable == DataGridViewTriState.True);
16078Debug.Assert(_rowHeadersWidthSizeMode == DataGridViewRowHeadersWidthSizeMode.EnableResizing);
16105Debug.Assert(_ptMouseDownCell.Y != -2);
16325Debug.Assert(_vertScrollTimer is null || !_vertScrollTimer.Enabled);
16326Debug.Assert(_horizScrollTimer is null || !_horizScrollTimer.Enabled);
16479Debug.Assert(_cumulativeVerticalWheelDelta > -PInvoke.WHEEL_DELTA);
16480Debug.Assert(_cumulativeVerticalWheelDelta < PInvoke.WHEEL_DELTA);
16481Debug.Assert(_cumulativeHorizontalWheelDelta > -PInvoke.WHEEL_DELTA);
16482Debug.Assert(_cumulativeHorizontalWheelDelta < PInvoke.WHEEL_DELTA);
16580Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
16589Debug.Assert(totalVisibleFrozenHeight == Rows.GetRowsHeight(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen));
16590Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
16722Debug.Fail($"DataGridView.OnPaint exception: {ex.Message} stack trace {ex.StackTrace}");
16870Debug.Assert(dataGridViewColumn.Index >= 0);
16871Debug.Assert(dataGridViewColumn.DataGridView is null);
16896Debug.Assert(_ptCurrentCell.X == -1);
16905Debug.Assert(success);
16921Debug.Assert(autoSizeColumnMode != DataGridViewAutoSizeColumnMode.NotSet);
16947Debug.Assert(_ptCurrentCell.X == -1);
16956Debug.Assert(success);
17023Debug.Assert(dataGridViewColumn.Index >= 0 && dataGridViewColumn.Index < Columns.Count);
17074Debug.Assert(success);
17087Debug.Assert(success);
17103Debug.Assert(columnIndex == 0);
17146Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time");
17147Debug.Assert(Columns[i].HeaderCell.SortGlyphDirection == dataGridViewColumn.HeaderCell.SortGlyphDirection, "DataBound columns should have the same SortGlyphDirection as the one on the DataGridView");
17186Debug.Assert(_horizontalOffset >= dataGridViewColumn.Thickness);
17237Debug.Assert(rowIndexDeleted >= 0 && rowIndexDeleted < Rows.Count);
17260Debug.Assert(NewRowIndex != -1);
17261Debug.Assert(NewRowIndex == Rows.Count - 1);
17275Debug.Assert(rowIndexDeleted < _ptCurrentCell.Y);
17289Debug.Assert(success);
17302Debug.Assert(success);
17559Debug.Assert(rowIndex >= 0);
17652Debug.Assert(columnIndex >= 0 && rowIndex >= 0);
17694Debug.Assert(NewRowIndex == -1, "newRowIndex and AllowUserToAddRowsInternal became out of sync");
17725Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
17746Debug.Assert(_noDimensionChangeCount >= 0);
17769Debug.Assert(rowIndex >= 0);
17925Debug.Assert(hti.Type == DataGridViewHitTestType.RowHeader);
18030Debug.Assert(success);
18055Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
18085Debug.Assert(_individualSelectedCells.Count == 0);
18115Debug.Assert(_selectedBandIndexes.Contains(hti._row) ==
18131Debug.Assert(success);
18138Debug.Assert(success);
18149Debug.Assert(success);
18154Debug.Assert(CurrentCellAddress == new Point(-1, -1));
18159Debug.Assert(_selectedBandIndexes.Contains(hti._row));
18298Debug.Assert(rowIndex != -1);
18299Debug.Assert(_autoSizeRowsMode == DataGridViewAutoSizeRowsMode.None);
18319Debug.Assert(columnIndex >= 0 && rowIndex >= 0);
18332Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
18353Debug.Assert(_noDimensionChangeCount >= 0);
18399Debug.Assert(hti._row >= 0);
18400Debug.Assert(MultiSelect);
18493Debug.Assert(success);
18553Debug.Assert(rowIndex >= -1);
18755Debug.Assert(_noDimensionChangeCount >= 0);
18779Debug.Assert(rowIndex < Rows.Count && columnIndex < Columns.Count);
18800Debug.Assert(_noDimensionChangeCount >= 0);
18936Debug.Assert(dataGridViewColumnHeaderCell is not null);
18960Debug.Assert(Columns[i].IsDataBound, "two columns w/ the same DataPropertyName should be DataBound at the same time");
18988Debug.Assert(success);
19095Debug.Assert(success);
19105Debug.Assert(success);
19135Debug.Assert(rowIndexTmp != -1);
19142Debug.Assert(rowIndexTmp != -1);
19143Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0);
19163Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Visible) != 0);
19165Debug.Assert(numDisplayedScrollingRows > 0);
19168Debug.Assert(rowIndexTmp != -1);
19175Debug.Assert(rowIndexTmp != -1);
19176Debug.Assert((Rows.GetRowState(rowIndexTmp) & DataGridViewElementStates.Displayed) != 0);
19274Debug.Assert(bounds.Left == 0);
19275Debug.Assert(bounds.Top == 0);
19328Debug.Fail("DataGridView.PaintBorder - Unexpected BorderStyle value.");
19360Debug.Assert(cellBounds.Width > 0);
19429Debug.Assert(dataGridViewColumn.Visible && !dataGridViewColumn.Frozen);
19438Debug.Assert(cellBounds.Width > 0);
19477Debug.Assert(clipRegion is not null);
19538Debug.Assert(_dataGridViewOper[OperationTrackColHeadersResize] || _dataGridViewOper[OperationTrackRowResize]);
19543Debug.Assert(_dataGridViewOper[OperationTrackRowHeadersResize]
19618Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Frozen) == 0);
19619Debug.Assert((Rows.GetRowState(indexTmp) & DataGridViewElementStates.Visible) != 0);
19761Debug.Assert(_inPerformLayoutCount >= 0);
19790Debug.Assert(EditingControl is not null);
19800Debug.Assert(dataGridViewCell.ColumnIndex == _ptCurrentCell.X);
19801Debug.Assert(dataGridViewCell.RowIndex == _ptCurrentCell.Y || dataGridViewCell.RowIndex == -1);
19945Debug.Assert(rowIndex >= 0);
19970Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync in AddNewTransaction when the user did not type in the 'add new row'");
19978Debug.Assert(rowCount == dataGridViewRowsCount, "out of sync");
20011Debug.Assert(dataGridViewRow.Index == -1);
20023Debug.Assert(dataGridViewRow.Index == -1);
20180Debug.Assert(success);
20206Debug.Assert(_ptAnchorCell.Y >= 0);
20258Debug.Assert(success);
20303Debug.Assert(success);
20373Debug.Assert(success);
20433Debug.Assert(success);
20462Debug.Assert(_ptAnchorCell.Y >= 0);
20500Debug.Assert(success);
20545Debug.Assert(success);
20614Debug.Assert(success);
20669Debug.Assert(success);
20691Debug.Assert(_ptAnchorCell.Y >= 0);
20761Debug.Assert(success);
20815Debug.Assert(success);
20913Debug.Assert(success);
20975Debug.Assert(success);
21015Debug.Assert(success);
21500Debug.Assert(_ptCurrentCell.Y != -1);
21501Debug.Assert(CurrentCellInternal is not null);
21502Debug.Assert(EditMode != DataGridViewEditMode.EditOnEnter
21511Debug.Assert(success);
21900Debug.Assert(success);
22111Debug.Assert(success);
22118Debug.Assert(success);
22139Debug.Assert(_ptAnchorCell.X >= 0);
22162Debug.Assert(success);
22172Debug.Assert(success);
22179Debug.Assert(success);
22201Debug.Assert(success);
22222Debug.Assert(success);
22229Debug.Assert(success);
22271Debug.Assert(success);
22281Debug.Assert(success);
22288Debug.Assert(success);
22310Debug.Assert(success);
22331Debug.Assert(success);
22338Debug.Assert(success);
22406Debug.Assert(success);
22416Debug.Assert(success);
22423Debug.Assert(success);
22454Debug.Assert(success);
22473Debug.Assert(success);
22480Debug.Assert(success);
22500Debug.Assert(success);
22535Debug.Assert(success);
22542Debug.Assert(success);
22553Debug.Assert(_ptAnchorCell.X >= 0);
22574Debug.Assert(success);
22596Debug.Assert(success);
22607Debug.Assert(success);
22619Debug.Assert(success);
22641Debug.Assert(success);
22655Debug.Assert(success);
22667Debug.Assert(success);
22684Debug.Assert(_ptAnchorCell.X >= 0);
22687Debug.Assert(success);
22704Debug.Assert(success);
22715Debug.Assert(success);
22722Debug.Assert(success);
22739Debug.Assert(success);
22753Debug.Assert(success);
22760Debug.Assert(success);
22776Debug.Assert(_ptAnchorCell.X >= 0);
22796Debug.Assert(success);
22822Debug.Assert(success);
22833Debug.Assert(success);
22840Debug.Assert(success);
22866Debug.Assert(success);
22878Debug.Assert(success);
22885Debug.Assert(success);
22900Debug.Assert(success);
22946Debug.Assert(firstDisplayedScrollingRowIndex != -1);
22966Debug.Assert(nextScreenVisibleRowIndexTmp != -1);
23004Debug.Assert(success);
23030Debug.Assert(_ptAnchorCell.Y >= 0);
23053Debug.Assert(success);
23070Debug.Assert(_ptAnchorCell.Y >= 0);
23106Debug.Assert(_ptAnchorCell.Y >= 0);
23212Debug.Assert(previousScreenVisibleRowIndexTmp != -1);
23240Debug.Assert(previousScreenVisibleRowIndex != -1);
23289Debug.Assert(_ptAnchorCell.Y >= 0);
23328Debug.Assert(_ptAnchorCell.Y >= 0);
23364Debug.Assert(_ptAnchorCell.Y >= 0);
23490Debug.Assert(success);
23497Debug.Assert(success);
23540Debug.Assert(success);
23550Debug.Assert(success);
23557Debug.Assert(success);
23579Debug.Assert(success);
23600Debug.Assert(success);
23607Debug.Assert(success);
23649Debug.Assert(success);
23659Debug.Assert(success);
23666Debug.Assert(success);
23688Debug.Assert(success);
23709Debug.Assert(success);
23716Debug.Assert(success);
23786Debug.Assert(success);
23796Debug.Assert(success);
23803Debug.Assert(success);
23834Debug.Assert(success);
23853Debug.Assert(success);
23860Debug.Assert(success);
23880Debug.Assert(success);
23915Debug.Assert(success);
23922Debug.Assert(success);
23938Debug.Assert(_ptAnchorCell.X >= 0);
23954Debug.Assert(success);
23961Debug.Assert(success);
23972Debug.Assert(success);
23979Debug.Assert(success);
23996Debug.Assert(success);
24010Debug.Assert(success);
24017Debug.Assert(success);
24039Debug.Assert(_ptAnchorCell.X >= 0);
24042Debug.Assert(success);
24049Debug.Assert(success);
24060Debug.Assert(success);
24067Debug.Assert(success);
24084Debug.Assert(success);
24098Debug.Assert(success);
24105Debug.Assert(success);
24121Debug.Assert(_ptAnchorCell.X >= 0);
24146Debug.Assert(success);
24162Debug.Assert(success);
24173Debug.Assert(success);
24180Debug.Assert(success);
24206Debug.Assert(success);
24218Debug.Assert(success);
24225Debug.Assert(success);
24240Debug.Assert(success);
24271Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
24289Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.X));
24298Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
24316Debug.Assert(!_selectedBandIndexes.Contains(_ptCurrentCell.Y));
24581Debug.Assert(_ptAnchorCell.Y >= 0);
24678Debug.Assert(_ptAnchorCell.Y >= 0);
24780Debug.Assert(_ptAnchorCell.Y >= 0);
24963Debug.Assert(_ptAnchorCell.Y >= 0);
25278Debug.Assert(success);
25289Debug.Assert(dataGridViewCurrentCell is not null);
25302Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
25304Debug.Assert(dataGridViewEditingCell is not null);
25333Debug.Assert(NewRowIndex == Rows.Count - 1);
25342Debug.Assert(IsCurrentCellInEditMode);
25396Debug.Assert(dgvcme.Clicks == 1);
25472Debug.Assert(_ptCurrentCell.Y != -1);
25494Debug.Assert(_dataGridViewState1[State1_CurrentCellInEditMode]);
25498Debug.Assert(dataGridViewEditingCell is not null);
25553Debug.Assert(list.Count == rowsCount);
25670Debug.Assert(_noSelectionChangeCount > 0);
25697Debug.Assert(_noSelectionChangeCount > 0);
25719Debug.Assert(dataGridViewCell.ColumnIndex != columnIndexException || dataGridViewCell.RowIndex != rowIndexException);
25738Debug.Assert(_noSelectionChangeCount > 0);
25790Debug.Assert(_noSelectionChangeCount > 0);
25954Debug.Assert(rowIndex >= 0);
25955Debug.Assert(rowIndex < Rows.Count);
26000Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
26132Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0);
26149Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= 0);
26199Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
26200Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingCol >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingCol < Columns.Count);
26201Debug.Assert(DisplayedBandsInfo.LastTotallyDisplayedScrollingCol >= -1 && DisplayedBandsInfo.LastTotallyDisplayedScrollingCol < Columns.Count);
26202Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
26203Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= -1 && DisplayedBandsInfo.FirstDisplayedScrollingRow < Rows.Count);
26204Debug.Assert(Columns[columnIndex].Visible);
26205Debug.Assert((Rows.GetRowState(rowIndex) & DataGridViewElementStates.Visible) != 0);
26262Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
26292Debug.Assert(firstDisplayedScrollingRow != -1);
26317Debug.Assert(rowCount != 0);
26318Debug.Assert(deltaY != 0);
26319Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen));
26341Debug.Assert(rowsRect.X > 0);
26348Debug.Assert(rowsRect.Height >= 0);
26352Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow > -1);
26377Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
26379Debug.Assert(firstVisibleScrollingRow != -1);
26381Debug.Assert(newScrolledOffRowCount >= rowCount);
26388Debug.Assert(rows != 0);
26389Debug.Assert((rows > 0 && (scrollEventType == ScrollEventType.SmallIncrement || scrollEventType == ScrollEventType.LargeIncrement))
26393Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
26404Debug.Assert(newFirstVisibleScrollingRow != -1);
26422Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == oldFirstVisibleScrollingRow);
26445Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow == newFirstVisibleScrollingRow);
26459Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
26485Debug.Assert(newFirstVisibleScrollingRow != -1);
26611Debug.Assert(_noDimensionChangeCount >= 0);
26612Debug.Assert(_noSelectionChangeCount >= 0);
26639Debug.Assert(index >= 0);
26713Debug.Assert(_columnHeadersHeight != columnHeadersHeight);
26714Debug.Assert(columnHeadersHeight >= MinimumColumnHeadersHeight);
26715Debug.Assert(columnHeadersHeight <= MaxHeadersThickness);
26781Debug.Assert(rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count);
26849Debug.Assert(oldCurrentCellX == _ptCurrentCell.X);
26850Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y);
26947Debug.Assert(oldCurrentCellY >= 0);
27055Debug.Assert(oldCurrentCellX == _ptCurrentCell.X);
27056Debug.Assert(oldCurrentCellY == _ptCurrentCell.Y);
27111Debug.Assert(oldCurrentCellY >= 0);
27143Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0);
27144Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex);
27145Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0);
27146Debug.Assert(rowIndexFrom <= rowIndexTo);
27147Debug.Assert(_noSelectionChangeCount > 0);
27230Debug.Assert(_noSelectionChangeCount > 0);
27265Debug.Assert(columnIndexFrom >= 0 && columnIndexTo >= 0);
27266Debug.Assert((Columns[columnIndexFrom]).DisplayIndex <= (Columns[columnIndexTo]).DisplayIndex);
27267Debug.Assert(_noSelectionChangeCount > 0);
27281Debug.Assert(_selectedBandIndexes.Contains(columnIndex));
27308Debug.Assert(_selectedBandIndexes.Contains(columnIndexTo));
27316Debug.Assert(rowIndexFrom >= 0 && rowIndexTo >= 0);
27317Debug.Assert(rowIndexFrom <= rowIndexTo);
27318Debug.Assert(_noSelectionChangeCount > 0);
27337Debug.Assert(!_selectedBandIndexes.Contains(rowIndex));
27346Debug.Assert(_selectedBandIndexes.Contains(rowIndex));
27468Debug.Assert(columnIndex >= 0 && rowIndex >= 0 && columnIndex < Columns.Count && rowIndex < Rows.Count);
27541Debug.Assert(columnIndex >= 0 && columnIndex < Columns.Count);
27577Debug.Assert(rowIndex >= 0 && rowIndex < Rows.Count);
27638Debug.Assert(_individualSelectedCells.Contains(dataGridViewCell));
27656Debug.Assert(_selectedBandIndexes.Contains(columnIndex));
27692Debug.Assert(_selectedBandIndexes.Contains(rowIndex));
27757Debug.Assert(_individualSelectedCells.Count <= 1);
27771Debug.Assert(_selectedBandIndexes.Count <= 1);
27809Debug.Assert(_selectedBandIndexes.Count <= 1);
27826Debug.Assert(_selectedBandIndexes.Count <= 1);
27851Debug.Assert(_selectedBandIndexes.Count <= 1);
27869Debug.Assert(_selectedBandIndexes.Contains(rowIndex) ==
27878Debug.Assert(_selectedBandIndexes.Contains(rowIndex) ==
27893Debug.Assert(_selectedBandIndexes.Count <= 1);
27910Debug.Assert(_selectedBandIndexes.Count <= 1);
27938Debug.Assert(success);
27959Debug.Assert(!_selectedBandIndexes.Contains(columnIndex));
27965Debug.Assert(_selectedBandIndexes.Contains(columnIndex));
27978Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
27990Debug.Assert(_selectedBandIndexes.Count <= 1);
28078Debug.Assert(!_selectedBandIndexes.Contains(rowIndex));
28085Debug.Assert(_selectedBandIndexes.Contains(rowIndex));
28098Debug.Assert(MultiSelect || _selectedBandIndexes.Count <= 1);
28110Debug.Assert(_selectedBandIndexes.Count <= 1);
28216Debug.Assert(!(comparer is not null && DataSource is not null));
28217Debug.Assert(direction is ListSortDirection.Ascending or ListSortDirection.Descending);
28242Debug.Assert(rowVFIndex != -1);
28244Debug.Assert(Rows.GetRowCount(DataGridViewElementStates.Visible | DataGridViewElementStates.Frozen) == 0);
28306Debug.Assert(rowVIndex != -1);
28310Debug.Assert(rowVIndex != -1);
28321Debug.Assert(_dataGridViewOper[OperationInSort]);
28342Debug.Assert(rowIndex1 != NewRowIndex);
28343Debug.Assert(rowIndex2 != NewRowIndex);
28428Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
28452Debug.Assert(DisplayedBandsInfo.FirstDisplayedScrollingRow >= 0);
28680Debug.Assert(lastVisibleRowIndex != -1);
28817Debug.Assert(_editingPanel is not null);
28828Debug.Assert(EditingControl is not null);
28892Debug.Assert(dataGridViewColumnTmp is not null);
28896Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp));
28909Debug.Assert(numDisplayedScrollingCols > 0);
28913Debug.Assert(dataGridViewColumnTmp is not null);
28917Debug.Assert(ColumnNeedsDisplayedState(dataGridViewColumnTmp));
29053Debug.Assert(rowVisible);
29115Debug.Assert(rowIndexTmp != -1);
29131Debug.Assert(numDisplayedScrollingRows > 0);
29134Debug.Assert(rowIndexTmp != -1);
29214Debug.Assert(anchorColumnIndex >= 0);
29215Debug.Assert(anchorRowIndex >= 0);
29216Debug.Assert(newEdgeColumnIndex >= 0);
29217Debug.Assert(newEdgeRowIndex >= 0);
29218Debug.Assert(_noSelectionChangeCount > 0);
29400Debug.Assert(oldEdgeRowIndex < anchorRowIndex);
29445Debug.Assert(oldEdgeRowIndex <= anchorRowIndex);
29628Debug.Assert(oldEdgeRowIndex >= anchorRowIndex);
29776Debug.Assert(oldEdgeRowIndex >= anchorRowIndex);
29862Debug.Assert(_dataGridViewOper[OperationTrackRowSelect] || _dataGridViewOper[OperationTrackCellSelect]);
29915Debug.Assert(_editingPanel is not null);
29926Debug.Assert(EditingControl is not null);
29980Debug.Assert(hti._row == -1);
29984Debug.Assert(hti._col == -1);
29988Debug.Assert(hti._row == -1);
29989Debug.Assert(hti._col == -1);
System\Windows\Forms\Controls\ListView\ListView.cs (52)
851Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || View == View.SmallIcon, "we need this bit only in SmallIcon view");
852Debug.Assert(!_listViewState[LISTVIEWSTATE_flipViewToLargeIconAndSmallIcon] || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0");
859Debug.Assert(!value || View == View.SmallIcon, "we need this bit only in SmallIcon view");
860Debug.Assert(!value || Application.ComCtlSupportsVisualStyles, "we need this bit only when loading ComCtl 6.0");
1692Debug.Assert(result != 0, "LVM_SETTILEVIEWINFO failed");
2414Debug.Assert(Columns[i].DisplayIndex > -1 && Columns[i].DisplayIndex < Columns.Count, "display indices out of whack");
2418Debug.Assert(sumOfDisplayIndices == (colsCount - 1) * colsCount / 2, "display indices out of whack");
2471Debug.Assert(_listItemSorter is not null, "null sorter!");
2770Debug.Assert(item is not null, "Item was null in ITEMPREPAINT");
2935Debug.Fail("Exception occurred attempting to setup custom draw. Disabling custom draw for this control", e.ToString());
2973Debug.Fail("ListView sunk dispose event from unknown component");
3103Debug.Assert(fi.Exists, "who deleted our temp file?");
3128Debug.Assert(fi.Exists, "who deleted our temp file?");
3268Debug.Assert(false, "these are all the search directions");
3407Debug.Assert(item._listView == this, "Can't GetDisplayIndex if the list item doesn't belong to us");
3408Debug.Assert(item._id != -1, "ListViewItem has no ID yet");
3431Debug.Assert(displayIndex != -1, "This item is in the list view -- why can't we find a display index for it?");
3438Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created");
3569Debug.Assert(IsHandleCreated, "How did we add items without a handle?");
3940Debug.Assert(_groups is not null && _groups.Count > 0, "this method should be used only when the user adds a group, not when we add our own DefaultGroup");
3941Debug.Assert(group != DefaultGroup, "this method should be used only when the user adds a group, not when we add our own DefaultGroup");
3978Debug.Assert(lvItem.iGroupId != -1, "there is a list view item which is not parented");
3987Debug.Assert(IsHandleCreated, "InsertGroupNative precondition: list-view handle must be created");
3988Debug.Assert(group == DefaultGroup || Groups.Contains(group), "Make sure ListView.Groups contains this group before adding the native LVGROUP. Otherwise, custom-drawing may break.");
3991Debug.Assert(result != -1, "Failed to insert group");
4027Debug.Assert(itemList is not null, "In Begin/EndUpdate with no delayed array!");
4054Debug.Assert(!_listItemsTable.ContainsKey(itemID), "internal hash table inconsistent -- inserting item, but it's already in the hash table");
4063Debug.Assert(_listViewItems is not null, "listItemsArray is null, but the handle isn't created");
4087Debug.Assert(!FlipViewToLargeIconAndSmallIcon, "if we added even 1 item then we should have been done w/ FlipViewToLargeIconAndSmallIcon");
4102Debug.Assert(IsHandleCreated, "InsertItemsNative precondition: list-view handle must be created");
4127Debug.Assert(Items.Contains(li), "Make sure ListView.Items contains this item before adding the native LVITEM. Otherwise, custom-drawing may break.");
4148Debug.Assert(result != IntPtr.Zero, "Groups not enabled");
4150Debug.Assert(result != IntPtr.Zero, $"Doesn't contain group id: {lvItem.iGroupId}");
4736Debug.Assert(_listViewItems is null, "listItemsArray not null, even though handle created");
5042Debug.Assert(retval != 0);
5148Debug.Assert(IsHandleCreated, "RemoveGroupNative precondition: list-view handle must be created");
5245Debug.Assert((mask & ~(LVCOLUMNW_MASK.LVCF_FMT | LVCOLUMNW_MASK.LVCF_TEXT | LVCOLUMNW_MASK.LVCF_IMAGE)) == 0, "Unsupported mask in setColumnInfo");
5406Debug.Assert(_savedCheckedItems.Contains(item), "somehow we lost track of one item");
5478Debug.Assert(IsHandleCreated, "How did we add items without a handle?");
5515Debug.Assert(IsHandleCreated, "SetItemText with no handle");
5746Debug.Assert(IsHandleCreated, "UpdateGroupNative precondition: list-view handle must be created");
5749Debug.Assert(result != -1);
5855Debug.Assert(retval != -1, "Error enabling group view");
5862Debug.Assert(Application.ComCtlSupportsVisualStyles, "this function works only when ComCtl 6.0 and higher is loaded");
5863Debug.Assert(_viewStyle == View.Tile, "this function should be called only in Tile view");
5876Debug.Assert(retval != 0, "LVM_SETTILEVIEWINFO failed");
6091Debug.Fail("Exception occurred attempting to setup header custom draw. Disabling custom draw for the column header", e.ToString());
6213Debug.Assert(_listViewState[LISTVIEWSTATE_headerControlTracking], "HDN_ENDTRACK and HDN_BEGINTRACK are out of sync.");
6360Debug.Assert(header->iItem == 0, "we only need to compensate for the first column resize");
6361Debug.Assert(_columnHeaders!.Length > 0, "there should be a column that we need to compensate for");
6475Debug.Assert(_labelEdit is null,
6531Debug.Assert(_labelEdit is not null, "There is no active label edit to end");
System\Windows\Forms\Controls\ListView\ListView.ListViewNativeItemCollection.cs (15)
91Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
105Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
140Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
192Debug.Assert(!_owner.VirtualMode, "in virtual mode, this method does not make any sense");
235Debug.Assert(item is not null, $"Failed to get item at index {i}");
259Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created");
273Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon, "we only set this when comctl 6.0 is loaded");
289Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
317Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
342Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
366Debug.Assert(!_owner.VirtualMode, "in virtual mode, this function does not make any sense");
382Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
405Debug.Assert(!_owner.FlipViewToLargeIconAndSmallIcon || Count == 0, "the FlipView... bit is turned off after adding 1 item.");
420Debug.Assert(_owner._listViewItems is null, "listItemsArray not null, even though handle created");
428Debug.Assert(_owner._listViewItems is not null, "listItemsArray is null, but the handle isn't created");
System\Windows\Forms\Controls\ListView\ListViewItem.cs (10)
455Debug.Assert(_group == value, "BUG: group member variable wasn't updated!");
997Debug.Assert(_listView is null || !_listView.VirtualMode, "ListViewItem::Host can't be used w/ a virtual item");
998Debug.Assert(parent is null || !parent.VirtualMode, "ListViewItem::Host can't be used w/ a virtual list");
1037Debug.Assert(_listView is not null, "This method is used only when items are parented in a list view");
1038Debug.Assert(!_listView.VirtualMode, "we need to update the group only when the user specifies the list view items in localizable forms");
1063Debug.Assert(_listView!.IsHandleCreated, "Should only invoke UpdateStateToListView when handle is created.");
1100Debug.Assert(!updateOwner || result != 0, "Groups not enabled");
1102Debug.Assert(!updateOwner || result != 0, $"Doesn't contain group id: {lvItem.iGroupId}");
1297Debug.Assert(listView is not null && listView.VirtualMode, "ListViewItem::SetItemIndex should be used only when the list is virtual");
1298Debug.Assert(index > -1, "can't set the index on a virtual list view item to -1");
System\Windows\Forms\Controls\PropertyGrid\PropertyGrid.cs (17)
245Debug.Fail(ex.ToString());
1176Debug.Assert(_selectedTab is not null, "Invalid tab selection!");
1511Debug.Assert(_tabs[i] is not null, "Null item in tab array!");
1598Debug.Fail("Bad tab. We're going to remove it.", e.ToString());
1692Debug.Fail($"{nameof(CreatePropertyTab)} failed. {exception.Message}");
1729Debug.Fail($"Failed to create {nameof(PropertyTab)}. {exception.Message}");
1848Debug.Assert(
2080Debug.Fail("Bad Tab. Disable for now.", e.ToString());
2158Debug.Fail($"Failed to add a large property grid toolstrip button, {ex}");
3552Debug.Fail("Bad Tab. It's going away.", e.ToString());
3593Debug.Assert(_tabs.Count > 0, "We don't have any tabs left!");
3608Debug.Assert(_tabs.Count > 0, "Tab array destroyed!");
3688Debug.Assert(oldObject is not null && newObject is not null && oldObject.GetType() == newObject.GetType());
3746Debug.Assert(_tabs.Count > 0, "No view tab buttons to select!");
3750Debug.Fail("Failed to find the tab!");
3836Debug.Assert(view < _viewSortButtons.Length, "Can't select view type > 1");
3976Debug.Fail(ex.ToString());
System\Windows\Forms\Controls\PropertyGrid\PropertyGridInternal\GridEntry.cs (10)
76Debug.Assert(OwnerGrid is not null, "GridEntry w/o PropertyGrid owner, text rendering will fail.");
181Debug.Assert(value is null || !Disposed, "Why are we putting new children in after we are disposed?");
681Debug.Assert(value != this, "how can we be our own parent?");
917Debug.Assert(!Disposed, "Why are we creating children after we are disposed?");
1271Debug.Assert(ownerTab is not null, "No current tab!");
1371Debug.Assert(!s_pbrsAssertPropsSwitch.Enabled, $"Bad property '{PropertyLabel}.{property.Name}': {w}");
1400Debug.Fail($"Failed to get properties: {e.GetType().Name},{e.Message}\n{e.StackTrace}");
1444Debug.Fail($"Bad Type Converter! {t.GetType().Name}, {t.Message},{converter}", t.ToString());
1977Debug.Assert(gridHost is not null, "No prop entry host!");
2212Debug.Assert(o is not null, "Collection contains a null element.");
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (25)
146Debug.Assert(maskedTextProvider is not null, "Initializing from a null MaskProvider ref.");
572Debug.Fail("Invalid InsertKeyMode. This code path should have never been executed.");
1086Debug.Fail("Could not get IME input context.");
1223Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
1499Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
1500Debug.Assert(keyCode is Keys.Delete or Keys.Back, $"Delete called with keyCode == {keyCode}");
1501Debug.Assert(startPosition >= 0 && ((startPosition + selectionLen) <= _maskedTextProvider.Length), "Invalid position range.");
1694Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
1772Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2058Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2158Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2159Debug.Assert(text is not null, "text is null.");
2277Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2381Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2492Debug.Assert(newProvider is not null, "Initializing from a null MaskProvider ref.");
2541Debug.Assert(srcPos != MaskedTextProvider.InvalidIndex, "InvalidIndex unexpected at this time.");
2696Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2715Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2753Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2759Debug.Assert(ImeMode == ImeMode.Disable, "IME enabled when in RO or Pwd mode.");
2802Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2859Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
2876Debug.Fail(ex.ToString());
2997Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
3016Debug.Assert(!_flagState[s_isNullMask], "This method must be called when a Mask is provided.");
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (25)
351Debug.Fail($"error in processMnemonic: {ex}");
600Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition");
604Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition");
608Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition");
612Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Failed transition");
615Debug.Fail("bad state");
641Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Failed transition");
645Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Failed transition");
649Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Failed transition");
653Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Failed transition");
656Debug.Fail("bad state");
674Debug.Assert(hr.Succeeded, $"DoVerb call failed for verb 0x{verb}");
829Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Passive, "Wrong start state to transition from");
833Debug.Assert(_activeXInstance is null, "activeXInstance must be null");
846Debug.Assert(_activeXInstance is not null, "w/o an exception being thrown we must have an object...");
858Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from");
887Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Loaded, "Wrong start state to transition from");
912Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from");
931Debug.Assert(ActiveXState == WebBrowserHelper.AXState.Running, "Wrong start state to transition from");
953Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from");
974Debug.Assert(ActiveXState == WebBrowserHelper.AXState.InPlaceActive, "Wrong start state to transition from");
994Debug.Assert(ActiveXState == WebBrowserHelper.AXState.UIActive, "Wrong start state to transition from");
998Debug.Assert(hr.Succeeded, "Failed to UIDeactivate");
1010Debug.Assert(_activeXInstance is not null, "The native control is null");
1170Debug.Assert(!result.Failed, $"{result}");
System\Windows\Forms\Form.cs (36)
183Debug.Assert(_formState[s_formStateAllowTransparency] == 0, "Failed to set formState[FormStateAllowTransparency]");
184Debug.Assert(_formState[s_formStateBorderStyle] == (int)FormBorderStyle.Sizable, "Failed to set formState[FormStateBorderStyle]");
185Debug.Assert(_formState[s_formStateTaskBar] == 1, "Failed to set formState[FormStateTaskBar]");
186Debug.Assert(_formState[s_formStateControlBox] == 1, "Failed to set formState[FormStateControlBox]");
187Debug.Assert(_formState[s_formStateKeyPreview] == 0, "Failed to set formState[FormStateKeyPreview]");
188Debug.Assert(_formState[s_formStateLayered] == 0, "Failed to set formState[FormStateLayered]");
189Debug.Assert(_formState[s_formStateMaximizeBox] == 1, "Failed to set formState[FormStateMaximizeBox]");
190Debug.Assert(_formState[s_formStateMinimizeBox] == 1, "Failed to set formState[FormStateMinimizeBox]");
191Debug.Assert(_formState[s_formStateHelpButton] == 0, "Failed to set formState[FormStateHelpButton]");
192Debug.Assert(_formState[s_formStateStartPos] == (int)FormStartPosition.WindowsDefaultLocation, "Failed to set formState[FormStateStartPos]");
193Debug.Assert(_formState[s_formStateWindowState] == (int)FormWindowState.Normal, "Failed to set formState[FormStateWindowState]");
194Debug.Assert(_formState[s_formStateShowWindowOnCreate] == 0, "Failed to set formState[FormStateShowWindowOnCreate]");
195Debug.Assert(_formState[s_formStateAutoScaling] == 1, "Failed to set formState[FormStateAutoScaling]");
196Debug.Assert(_formState[s_formStateSetClientSize] == 0, "Failed to set formState[FormStateSetClientSize]");
197Debug.Assert(_formState[s_formStateTopMost] == 0, "Failed to set formState[FormStateTopMost]");
198Debug.Assert(_formState[s_formStateSWCalled] == 0, "Failed to set formState[FormStateSWCalled]");
199Debug.Assert(_formState[s_formStateMdiChildMax] == 0, "Failed to set formState[FormStateMdiChildMax]");
200Debug.Assert(_formState[s_formStateRenderSizeGrip] == 0, "Failed to set formState[FormStateRenderSizeGrip]");
201Debug.Assert(_formState[s_formStateSizeGripStyle] == 0, "Failed to set formState[FormStateSizeGripStyle]");
202Debug.Assert(_formState[s_formStateIsWindowActivated] == 0, "Failed to set formState[FormStateIsWindowActivated]");
203Debug.Assert(_formState[s_formStateIsTextEmpty] == 0, "Failed to set formState[FormStateIsTextEmpty]");
204Debug.Assert(_formState[s_formStateIsActive] == 0, "Failed to set formState[FormStateIsActive]");
205Debug.Assert(_formState[s_formStateIconSet] == 0, "Failed to set formState[FormStateIconSet]");
461Debug.Assert(!DesignMode, "Form designer should not allow base size set in design mode.");
510Debug.Assert(AutoSize == value, "Error detected setting Form.AutoSize.");
1104Debug.Assert(_ctlClient is null, "why isn't ctlClient null");
1110Debug.Assert(_ctlClient is not null, "why is ctlClient null");
3761Debug.Assert(IsHandleCreated, "Attempt to set focus to a form that has not yet created its handle.");
4610Debug.WriteLine($"AutoScaleFactor computed for new DPI = {autoScaleFactor.Width} - {autoScaleFactor.Height}");
4923Debug.Assert(result);
4967Debug.Assert(result);
6102Debug.Assert(containerControl is not null);
6195Debug.Assert(IsMdiContainer, "Not an MDI container!");
6355Debug.Assert(numWindowListItems == MdiWindowListStrip.MergedMenu.MdiWindowListItem.DropDownItems.Count, "Calling RevertMerge modified the mdiwindowlistitem");
6955Debug.Assert(Properties.ContainsKey(s_propFormMdiParent), "how is formMdiParent null?");
6956Debug.Assert(IsHandleCreated, "how is handle 0?");
System\Windows\Forms\Layout\CommonProperties.cs (28)
167Debug.Assert(value != GetAutoSize(element), "PERF: Caller should guard against setting AutoSize to original value.");
178Debug.Assert(GetAutoSize(element) == value, "Error detected setting AutoSize.");
186Debug.Assert(value != GetMargin(element), "PERF: Caller should guard against setting Margin to original value.");
190Debug.Assert(GetMargin(element) == value, "Error detected setting Margin.");
200Debug.Assert(value != GetMaximumSize(element, new Size(-7109, -7107)),
214Debug.Assert(GetMaximumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MaximumSize.");
222Debug.Assert(value != GetMinimumSize(element, new Size(-7109, -7107)),
236Debug.Assert(GetMinimumSize(element, new Size(-7109, -7107)) == value, "Error detected setting MinimumSize.");
250Debug.Assert(value != GetPadding(element, new Padding(-7105)),
256Debug.Assert(GetPadding(element, new Padding(-7105)) == value, "Error detected setting Padding.");
348Debug.Assert(xGetPreferredSizeCache(element) == Size.Empty, "Error detected in xClearPreferredSizeCache.");
390Debug.Assert(
394Debug.Assert(xGetPreferredSizeCache(element) == value, "Error detected in xGetPreferredSizeCache.");
423Debug.Assert(
441Debug.Assert(
458Debug.Assert(((xGetDock(element) != DockStyle.None) && element.ParticipatesInLayout) == result,
519Debug.Assert(value != GetSelfAutoSizeInDefaultLayout(element), "PERF: Caller should guard against setting AutoSize to original value.");
525Debug.Assert(GetSelfAutoSizeInDefaultLayout(element) == value, "Error detected setting AutoSize.");
541Debug.Assert(mode == DockAnchorMode.Anchor || value == DefaultAnchor, "xGetAnchor needs to return DefaultAnchor when docked.");
559Debug.Assert(result == (GetAutoSize(element) && xGetDock(element) == DockStyle.None),
578Debug.Assert(mode == DockAnchorMode.Dock || value == DefaultDock,
589Debug.Assert(value != xGetAnchor(element), "PERF: Caller should guard against setting Anchor to original value.");
599Debug.Assert(GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Anchor,
608Debug.Assert(value != xGetDock(element), "PERF: Caller should guard against setting Dock to original value.");
618Debug.Assert(xGetDock(element) == value, "Error detected setting Dock.");
619Debug.Assert((GetLayoutState(element)[s_dockModeSection] == (int)DockAnchorMode.Dock)
652Debug.Assert(value != GetFlowBreak(element), "PERF: Caller should guard against setting FlowBreak to original value.");
660Debug.Assert(GetFlowBreak(element) == value, "Error detected setting SetFlowBreak.");
System\Windows\Forms\Layout\DefaultLayout.cs (21)
83Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || (newSize.Height >= oldBounds.Height && newSize.Width >= oldBounds.Width),
100Debug.Assert(CommonProperties.GetAutoSizeMode(element) == AutoSizeMode.GrowAndShrink || newBounds.Contains(oldBounds), "How did we resize in such a way we no longer contain our old bounds?");
137Debug.Assert((growthDirection & GrowthDirection.Left) == GrowthDirection.None
140Debug.Assert((growthDirection & GrowthDirection.Upward) == GrowthDirection.None
175Debug.WriteLineIf(width < 0 || height < 0, $"\t\t'{element}' destination bounds resulted in negative");
373Debug.Assert(GetAnchorInfo(element) is not null, "AnchorInfo should be initialized before LayoutAnchorControls().");
380Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list.");
395Debug.Assert(element.Bounds == GetCachedBounds(element), "Why do we have cachedBounds for a docked element?");
456Debug.Assert(mdiClient is null, "How did we end up with multiple MdiClients?");
469Debug.Fail("Unsupported value for dock.");
532Debug.Assert(
553Debug.Assert((measureOnly && (newSize.Width >= remainingSize.Width)) || (newSize.Width == remainingSize.Width),
570Debug.Assert((measureOnly && (newSize.Height >= remainingSize.Height)) || (newSize.Height == remainingSize.Height),
590Debug.Assert(desiredSize.Width >= 0 && desiredSize.Height >= 0, "Error detected in xGetDockSize: Element size was negative.");
716Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list.");
840Debug.Assert(AppContextSwitches.AnchorLayoutV2, $"AnchorLayoutV2 should be called only when {AppContextSwitches.AnchorLayoutV2SwitchName} is enabled.");
942Debug.Assert(!HasCachedBounds(element.Container), "Do not call this method with an active cached bounds list.");
977Debug.Assert(GetDock(element) == value, "Error setting Dock value.");
1059Debug.Assert(element.Container == container, "We have non-children in our containers cached bounds store.");
1100Debug.Assert(specified == BoundsSpecified.None || GetCachedBounds(element) == element.Bounds,
1112Debug.Assert(!HasCachedBounds(container), "Do not call this method with an active cached bounds list.");
System\Windows\Forms\Layout\LayoutUtils.cs (24)
89Debug.Assert((topBits != 0 && (middleBits == 0 && bottomBits == 0))
99Debug.Assert(result is >= 0x00 and <= 0x0A, "ContentAlignmentToIndex result out of range.");
100Debug.Assert(result != 0x00 || alignment == ContentAlignment.TopLeft, "Error detected in ContentAlignmentToIndex.");
101Debug.Assert(result != 0x01 || alignment == ContentAlignment.TopCenter, "Error detected in ContentAlignmentToIndex.");
102Debug.Assert(result != 0x02 || alignment == ContentAlignment.TopRight, "Error detected in ContentAlignmentToIndex.");
103Debug.Assert(result != 0x03, "Error detected in ContentAlignmentToIndex.");
104Debug.Assert(result != 0x04 || alignment == ContentAlignment.MiddleLeft, "Error detected in ContentAlignmentToIndex.");
105Debug.Assert(result != 0x05 || alignment == ContentAlignment.MiddleCenter, "Error detected in ContentAlignmentToIndex.");
106Debug.Assert(result != 0x06 || alignment == ContentAlignment.MiddleRight, "Error detected in ContentAlignmentToIndex.");
107Debug.Assert(result != 0x07, "Error detected in ContentAlignmentToIndex.");
108Debug.Assert(result != 0x08 || alignment == ContentAlignment.BottomLeft, "Error detected in ContentAlignmentToIndex.");
109Debug.Assert(result != 0x09 || alignment == ContentAlignment.BottomCenter, "Error detected in ContentAlignmentToIndex.");
110Debug.Assert(result != 0x0A || alignment == ContentAlignment.BottomRight, "Error detected in ContentAlignmentToIndex.");
118Debug.Assert(threeBitFlag is >= 0x00 and <= 0x04 and not 0x03, "threeBitFlag out of range.");
120Debug.Assert((result & 0x03) == result, "Result out of range.");
478Debug.Assert(align != ContentAlignment.MiddleCenter, "Result is ambiguous with an alignment of MiddleCenter.");
529Debug.Fail("Unsupported value for region1Align.");
533Debug.Assert(Rectangle.Union(region1, region2) == bounds,
543Debug.Assert(region1.Right == region2.Left, "Adjacency error.");
548Debug.Assert(region2.Right == region1.Left, "Adjacency error.");
553Debug.Assert(region1.Bottom == region2.Top, "Adjacency error.");
558Debug.Assert(region2.Bottom == region1.Top, "Adjacency error.");
563Debug.Fail("Unsupported value for region1Align.");
567Debug.Assert(Rectangle.Union(region1, region2) == bounds, "region1 and region2 do not add up to bounds.");
System\Windows\Forms\Layout\TableLayout.cs (21)
320Debug.Assert(maxColumns > 0, "maxColumn must be positive");
450Debug.Assert(numRows <= maxRows, "number of rows allocated shouldn't exceed max number of rows");
451Debug.Assert(numColumns <= maxColumns, "number of columns allocated shouldn't exceed max number of columns");
512Debug.Assert(fixedLayoutInfo.IsAbsolutelyPositioned, "should only check for those elements which are absolutely positioned");
1036Debug.Assert((strip.MinSize == style.Size), "absolutely sized strip's size should be set before we call ApplyStyles");
1169Debug.Assert((dontHonorConstraint || (usedSpace == SumStrips(strips, 0, strips.Length))), "Error computing usedSpace.");
1201Debug.Assert(currentRow <= layoutInfo.RowStart, "RowStart should increase in forward Z-order.");
1214Debug.Assert(currentCol <= layoutInfo.ColumnStart, "ColumnStart should increase in forward Z-order.");
1364Debug.Assert(GetLayoutInfo(element) == value, "GetLayoutInfo should return the same value as we set it to");
1428Debug.Assert((containerInfo.Columns is null && cols is null) || containerInfo.Columns!.Length == cols.Length,
1430Debug.Assert((containerInfo.Rows is null && rows is null) || containerInfo.Rows!.Length == rows.Length,
1435Debug.Assert(layoutInfo.Equals(oldLayoutInfo[layoutInfo.Element]),
1481Debug.Assert(!cellsOccupied1.IntersectsWith(cellsOccupied2), "controls overlap in the same cell");
1486Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo1.ColumnSpan, "length of column style too short");
1487Debug.Assert(containerInfo.ColumnStyles.Count >= layoutInfo1.ColumnStart + layoutInfo2.ColumnSpan, "length of column style too short");
1490Debug.Assert(containerInfo.ColumnStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized");
1495Debug.Assert(containerInfo.ColumnStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized");
1503Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo1.RowStart + layoutInfo1.RowSpan, "length of row style too short");
1504Debug.Assert(containerInfo.RowStyles.Count >= layoutInfo2.RowStart + layoutInfo2.RowSpan, "length of row style too short");
1507Debug.Assert(containerInfo.RowStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized");
1512Debug.Assert(containerInfo.RowStyles[k].SizeType == SizeType.Absolute, $"column {k} is not absolutely sized");
System\Windows\Forms\SendKeys\SendKeys.SendKeysHookProc.cs (1)
53Debug.Assert(
System.Windows.Forms.Design (566)
System\ComponentModel\Design\Serialization\CodeDomSerializerBase.cs (33)
145Debug.Fail("GetReflectionTypeFromTypeHelper does not accept null arguments.");
195Debug.Fail("GetReflectionTypeHelper does not accept null arguments.");
214Debug.Fail("GetPropertiesHelper does not accept null arguments.");
246Debug.Fail("GetEventsHelper does not accept null arguments.");
278Debug.Fail("GetAttributesHelper does not accept null arguments.");
300Debug.Fail("GetAttributesFromTypeHelper does not accept null arguments.");
360Debug.Assert(resourceName is not null, "non-string keys in dictionary entry");
465Debug.Assert(manager.Context.Current == statement, "Someone corrupted the context stack");
994Debug.Assert(o is IConvertible, $"Array size expression could not be resolved to IConvertible: {(o.GetType().Name)}");
1165Debug.Fail($"Unrecognized expression type: {result.GetType().Name}");
1181Debug.Assert(targetObject is not null, "Failed to get target object for event attach");
1182Debug.Assert(eventName is not null, "Failed to get eventName for event attach");
1202Debug.Fail("Encountered delegate object create with more or less than 1 parameter?");
1278Debug.Fail($"Unsupported binary operator type: {op}");
1325Debug.Fail("Could not convert left or right side to binary-compatible value.");
1460Debug.Fail("Should never get here!");
1477Debug.Fail("Addition operator not supported for this type");
1482Debug.Fail("Math operators are not supported");
1693Debug.Assert(nameParts.Length > 0, "How can we fail to split when IndexOf succeeded?");
1952Debug.Assert(argumentValues is not null && parameters is not null, "These should have been allocated when the argument array was created.");
1973Debug.Assert(manager.Context.Current == newCtx, "Context stack corrupted.");
2012Debug.Assert(arguments.Length == 0, "Property serialization does not support arguments");
2018Debug.Assert(arguments.Length == 0, "Field serialization does not support arguments");
2025Debug.Fail($"Unrecognized reflection type in instance descriptor: {descriptor.MemberInfo.GetType().Name}");
2118Debug.Assert(manager.Context.Current == descriptor, "Context stack corrupted.");
2159Debug.Assert(manager.Context.Current == inheritance, "Somebody messed up our context stack.");
2227Debug.Assert(manager.Context.Current == tree, "Context stack corrupted.");
2235Debug.Assert(manager.Context.Current == statements, "Context stack corrupted.");
2263Debug.Assert(manager.Context.Current == propertyToSerialize, "Context stack corrupted.");
2370Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted.");
2402Debug.Assert(saveStatements != statements, "The serializer returned the same collection that exists on the context stack.");
2563Debug.Assert(manager.Context.Current == saveStatements, "Context stack corrupted.");
2769Debug.Assert(className is not null, "FillStatementTable expected a valid className but received null");
System\ComponentModel\Design\Serialization\ResourceCodeDomSerializer.SerializationResourceManager.cs (20)
125Debug.Fail("We expected to get IResourceService -- no resource serialization will be available");
209Debug.Assert(name is not null, "name is null");
219Debug.Assert(culture.Parent != culture, "should have returned when culture = InvariantCulture");
364Debug.Assert(_manager is not null, "This resource manager object has been destroyed.");
390Debug.Assert(culture is not null, "null parameter");
463Debug.Assert(invariantWriter is not null, "GetResourceWriter returned null for the InvariantCulture");
468Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct");
470Debug.Assert(resourceSet is not null, "ResourceSet for the InvariantCulture not loaded, but it's considered dirty?");
481Debug.Assert(_metadata is not null, "No metadata, but it's dirty?");
491Debug.Fail("Metadata not supported, but it's dirty?");
503Debug.Fail("Couldn't find IResourceService");
518Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}");
568Debug.Assert(metadata is not null, "Don't know where to push metadata.");
603Debug.Fail($"Cannot save a non-serializable value into resources. Add serializable to {(value is null ? "(null)" : value.GetType().Name)}");
620Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?");
648Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct");
650Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?");
686Debug.Assert(!ReadCulture.Equals(CultureInfo.InvariantCulture), "invariantCultureResourcesDirty should only come into play when readCulture != CultureInfo.InvariantCulture; check that CompareWithParentValue is correct");
688Debug.Assert(resourceSet is not null, "No ResourceSet for the InvariantCulture?");
697Debug.Fail($"Unknown CompareValue {comparison}");
System\Windows\Forms\Design\CommandSet.cs (17)
201Debug.Assert(SelectionService is not null, "CommandSet relies on the selection service, which is unavailable.");
218Debug.Assert(ds is not null, "No dictionary service");
300Debug.Fail("non-CLS compliant exception");
541Debug.Fail("Commands may be disabled, the location property was not accessible", e.ToString());
774Debug.Fail($"Unknown command mapped to OnKeyMove: {cmd}");
1082Debug.Fail($"Unrecognized command: {id}");
1399Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard");
1444Debug.Assert(ds is not null, "No designer serialization service -- we cannot copy to clipboard");
2192Debug.Assert(SelectionService is not null, "We need the SelectionService, but we can't find it!");
2308Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this");
2389Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this");
2414Debug.Assert(sizeProp is not null, "No size property on component");
2415Debug.Assert(locProp is not null, "No location property on component");
2464Debug.Assert(false, "Invoking pbrs command failed");
2548Debug.Assert(selectedObjects is not null, "queryStatus should have disabled this");
2895Debug.Assert(designerHost is not null, "Failed to get designer host");
3081Debug.Assert(attr is not null, "Type descriptor gave us a null attribute -- problem in type descriptor");
System\Windows\Forms\Design\ComponentTray.cs (29)
87Debug.Assert(es is not null, "Component tray wants an extender provider service, but there isn't one.");
102Debug.Assert(_menucmdArrangeIcons is null, "Non-Null Menu Command for ArrangeIcons");
103Debug.Assert(_menucmdLineupIcons is null, "Non-Null Menu Command for LineupIcons");
104Debug.Assert(_menucmdLargeIcons is null, "Non-Null Menu Command for LargeIcons");
528Debug.Fail("Don't know how to add component!");
543Debug.Fail("component is not IComponent");
746Debug.Assert(host is not null, "Service object could not provide us with a designer host.");
873Debug.Assert(_menucmdArrangeIcons is not null, "Null Menu Command for ArrangeIcons");
874Debug.Assert(_menucmdLineupIcons is not null, "Null Menu Command for LineupIcons");
875Debug.Assert(_menucmdLargeIcons is not null, "Null Menu Command for LargeIcons");
973Debug.Fail("Anything we're extending should have a component view.");
988Debug.Assert(_serviceProvider is not null, "Trying to access services too late or too early.");
1114Debug.Assert((de.AllowedEffect & (DragDropEffects.Move | DragDropEffects.Copy)) != 0, "DragDropEffect.Move | .Copy isn't allowed?");
1148Debug.Assert((de.AllowedEffect & DragDropEffects.Copy) != 0, "DragDropEffect.Move isn't allowed?");
1553Debug.Fail("Anything we're extending should have a component view.");
1740Debug.Assert(c.Visible, $"TrayControl for {c.Component} should not be positioned");
1759Debug.Assert(index >= 1, "Got the wrong index, how could that be?");
1781Debug.Assert(index >= 1, "Got the wrong index, how could that be?");
1795Debug.Assert(_controls.IndexOf(c) != -1, "Add control to the list of controls before autoarranging.!!!");
1796Debug.Assert(Visible == c.Visible, $"TrayControl for {((TrayControl)c).Component} should not be positioned");
1805Debug.Assert(c.Visible, $"TrayControl for {c.Component} should not be positioned");
1808Debug.Assert(_selectionUISvc is not null, "No SelectionUIService available for tray.");
1824Debug.Assert(comp is not null, "Component for the TrayControl is null");
1859Debug.Assert(comp is not null, "Component for the TrayControl is null");
1922Debug.Assert(ds is not null, "ComponentTray relies on IDictionaryService, which is not available.");
2075Debug.Assert(host is not null, "Component tray does not have access to designer host.");
2119Debug.Assert(_tray._selectionUISvc is not null, "We shouldn't be able to begin a drag without this");
2362Debug.Fail(e.Message);
2752Debug.Assert(o1 is not null && o2 is not null, "Null objects sent for comparison!!!");
System\Windows\Forms\Design\DocumentDesigner.AxToolboxItem.cs (15)
63Debug.Assert(host is not null, "Designer host is null");
88Debug.Assert(tlbRef is not null, $"Null reference returned by AddActiveX (tlbimp) by the project system for: {_clsid}");
98Debug.Assert(axRef is not null, $"Null reference returned by AddActiveX (aximp) by the project system for: {_clsid}");
137Debug.Fail($"Could not create type: {e}");
141Debug.Assert(comps[0] is not null, "Could not create instance of ActiveX control wrappers!!!");
175Debug.Assert(trs is not null, "No type resolution service found.");
178Debug.Assert(a is not null, $"No assembly found at {fullPath}");
200Debug.Assert(attrs is not null && attrs.Length == 1, $"Invalid number of GuidAttributes found on: {t.FullName}");
231Debug.Assert(project is not null, $"No DTE Project for the current project item: {name}");
234Debug.Assert(vsproject is not null, $"No VS Project for the current project item: {name}");
237Debug.Assert(references is not null, $"No References for the current project item: {name}");
261Debug.Assert(verKey is not null, $"No version registry key found for: {controlKey}");
280Debug.Assert(majorVer > 0 && minorVer >= 0, $"No Major version number found for: {controlKey}");
287Debug.Assert(!tlbGuid.Equals(Guid.Empty), $"No valid Guid found for: {controlKey}");
306Debug.Assert(inprocServer is not null, $"No valid InprocServer32 found for: {controlKey}");
System\Windows\Forms\Design\ToolStripDesigner.cs (12)
476Debug.Assert(_host is not null, "Why didn't we get a designer host?");
525Debug.Assert(_host is not null, "Why didn't we get a designer host?");
526Debug.Assert(_pendingTransaction is null, "Adding item with pending transaction?");
559Debug.Assert(textProperty is not null, "Could not find 'Text' property in ToolStripItem.");
578Debug.Assert(imageProperty is not null, "Could not find 'Image' property in ToolStripItem.");
585Debug.Assert(displayProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem.");
589Debug.Assert(imageTransProperty is not null, "Could not find 'DisplayStyle' property in ToolStripItem.");
969Debug.Assert(_host is not null, "Why didn't we get a designer host?");
1077Debug.Assert(_host is not null, "Why didn't we get a designer host?");
1078Debug.Assert(_pendingTransaction is null, "Removing item with pending transaction?");
1697Debug.Assert(defaultName is not null && defaultName.Length > 0, "Couldn't create default name for item");
2449Debug.Assert(NewItemTransaction is null, "NewItemTransaction should have been nulled out and cancelled by now.");
System\Windows\Forms\Design\ToolStripItemBehavior.cs (10)
113Debug.Assert(item is not null, "Item passed is null, SelectionService cannot be obtained");
117Debug.Assert(selSvc is not null, "Failed to get Selection Service!");
127Debug.Assert(item is not null, "Item passed is null, BehaviorService cannot be obtained");
131Debug.Assert(behaviorSvc is not null, "Failed to get Behavior Service!");
141Debug.Assert(item is not null, "Item passed is null, ToolStripKeyBoardHandlingService cannot be obtained");
145Debug.Assert(keyBoardSvc is not null, "Failed to get ToolStripKeyboardHandlingService!");
294Debug.Assert(designerHost is not null, "Invalid DesignerHost");
545Debug.Assert(designerHost is not null, "Invalid DesignerHost");
649Debug.Assert(designerHost is not null, "Invalid DesignerHost");
963Debug.Assert(designerHost is not null, "Invalid DesignerHost");
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (14)
255Debug.Assert(item is not null, "Why is item null?");
259Debug.Assert(propertyName is not null, "Why is propertyName null?");
271Debug.Assert(item is not null, "Why is item null?");
275Debug.Assert(desc is not null, "Why is desc null?");
373Debug.Assert(designerHost is not null, "Why didn't we get a designer host?");
435Debug.Assert(designerHost is not null, "Why didn't we get a designer host?");
448Debug.Assert(dummyIndex != -1, "Why is item index negative?");
474Debug.Assert(designerHost is not null, "Why didn't we get a designer host?");
487Debug.Assert(dummyIndex != -1, "Why is item index negative?");
513Debug.Assert(designerHost is not null, "Why didn't we get a designer host?");
544Debug.Assert(dummyIndex != -1, "Why is item index negative?");
569Debug.Assert(getProperty is not null, "Could not find given property in control.");
585Debug.Assert(getProperty is not null, "Could not find given property in control.");
603Debug.Assert(changingProperty is not null, "Could not find given property in control.");
System.Windows.Forms.Primitives (39)
System.Windows.Input.Manipulations (115)
System.Xaml (185)
System\Xaml\Schema\TypeReflector.cs (13)
314Debug.Assert(_positionalParameterTypes is not null, "TryGetPositionalParameters should have been called first");
357Debug.Assert(!IsUnknown);
441Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
453Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
467Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
468Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this");
480Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
481Debug.Assert(_nonAttachableMemberCache is not null, "Members property should have been invoked before this");
708Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
725Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
986Debug.Assert(UnderlyingType is not null, "Caller should check for UnderlyingType == null");
987Debug.Assert(_attachableMemberCache is not null, "AttachableMembers property should have been invoked before this");
1147Debug.Assert(value);
System\Xaml\XamlType.cs (26)
201Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsDictionary");
220Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind");
241Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind");
261Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsCollection");
337Debug.Assert(_reflector is not null, "_reflector should have been initialized by IsMarkupExtension");
523Debug.Assert(_reflector is not null, "_reflector should have been initialized by ItemType");
597Debug.Assert(_reflector is not null, "_reflector should have been initialized by GetCollectionKind");
824Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
861Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
955Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
969Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1030Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1208Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1222Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1233Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1267Debug.Assert(typeArgs.Length == 1);
1280Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1309Debug.Assert(typeArgs.Length == 1);
1324Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1343Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1423Debug.Assert(UnderlyingTypeInternal.IsSet, "EnsureReflector should have caused UnderlyingType to be initialized");
1673Debug.Assert(GetType() != typeof(XamlType), "Default GetAllMembers logic should have already captured all writeable properties");
1782Debug.Fail("Enum out of range");
1811Debug.Assert(_reflector is not null, "_reflector should have been initialized by AreAttributesAvailable");
1930Debug.Assert(xamlType1.IsUnknown);
1931Debug.Assert(xamlType2.IsUnknown);
testhost (1)
testhost.arm64 (1)
testhost.x86 (1)
UIAutomationClient (38)
UIAutomationClientSideProviders (95)
MS\Internal\AutomationProxies\Accessible.cs (14)
143Debug.Assert(acc != null, "null IAccessible");
316Debug.Assert(parent != null);
327Debug.Assert(false);
343Debug.Assert(parent != null);
354Debug.Assert(false);
685Debug.Assert( false, "Need to handle Accessible.accFocus case!" );
728Debug.Assert(_idChild == NativeMethods.CHILD_SELF);
773Debug.Assert(false);
916System.Diagnostics.Debug.Fail("Call to AccessibleChildren() returned E_INVALIDARG.");
979Debug.Assert(_accessibleChildrenIndex < 0);
1158Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected exception thrown for AccessibleChildren: {0}", e));
1166Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, "Unexpected hresult from AccessibleChildren: {0} count is {1} and actualCount is {2}", hr, count, actualCount));
1370Debug.Fail(string.Format(CultureInfo.CurrentCulture, "MsaaNativeProvider: IAccessible threw a COMException: {0}", e.Message));
1387Debug.Fail(string.Format(CultureInfo.CurrentCulture, "Unexpected IAccessible exception: {0}", e));
MS\Internal\AutomationProxies\WindowsEditBox.cs (17)
436Debug.Assert(point.x >= 0 && point.x < 65536, "WindowsEditBox.CharFromPos() x coordinate out of range.");
437Debug.Assert(point.y >= 0 && point.y < 65536, "WindowsEditBox.CharFromPos() y coordinate out of range.");
514Debug.Assert(!IsMultiline);
521Debug.Assert(IsMultiline);
551Debug.Assert(hfont != IntPtr.Zero, "WindowsEditBox.GetLogfont got null HFONT");
556Debug.Fail("WindowsEditBox.GetObject unexpected return value");
677Debug.Assert(index >= 0, "WindowsEditBox.LineFromChar negative index.");
678Debug.Assert(index <= GetTextLength(), "WindowsEditBox.LineFromChar index out of range.");
739Debug.Assert(index >= 0, "WindowsEditBox.PosFromChar negative index.");
740Debug.Assert(index < GetTextLength(), "WindowsEditBox.PosFromChar index out of range.");
743Debug.Assert(result!=-1, "WindowsEditBox.PosFromChar index out of bounds.");
798Debug.Assert(start >= 0, "WindowsEditBox.SetSel negative start.");
799Debug.Assert(start <= GetTextLength(), "WindowsEditBox.SetSel start out of range.");
800Debug.Assert(end >= 0, "WindowsEditBox.SetSel negative end.");
801Debug.Assert(end <= GetTextLength(), "WindowsEditBox.SetSel end out of range.");
961Debug.Assert(floor >= 0);
972Debug.Assert(i >= floor);
UIAutomationTypes (12)
vbc (12)
VBCSCompiler (29)
vstest.console (7)
vstest.console.arm64 (7)
WindowsFormsIntegration (26)