Comments (6)
@mairaw I believe the comment is correct.
@ChrisMaddock here is an example:
string xml = @"<?xml version=""1.0""?><foo>bar</foo>";
var doc = new XmlDocument();
doc.LoadXml(xml);
var node = doc.FirstChild;
XmlNodeList test = node.SelectNodes("//*");
Console.WriteLine(test == null); // prints True
from dotnet-api-docs.
@mairaw I think what people care about are the types listed in the comment but to be technically correct it should be that it returns null if CreateNavigator
for the XmlNode returns null.
from dotnet-api-docs.
@ChrisMaddock that is odd, since we generate the IntelliSense from the docs.
Can you share what you're seeing on IntelliSense and what kind of project you have?
But it seems that SelectNodes can actually return null:
https://referencesource.microsoft.com/#System.Xml/System/Xml/Dom/XmlNode.cs,67
https://github.com/dotnet/corefx/blob/master/src/System.Private.Xml/src/System/Xml/Dom/XmlNode.cs#L71
@krwq, @pjanotti should we just document what's on the comments?
from dotnet-api-docs.
@mairaw - Apologies, I was wrong about the source - the hint seems to be generated by ReSharper rather than Intellisense. I wonder what ReSharper derives that information from, in that case...
For the record - the project is the NUnit console - a .NET Framework 2.0 console application.
from dotnet-api-docs.
No worries @ChrisMaddock. Thanks for letting me know the source. Not sure how ReSharper is implemented. Maybe it looks at the implementation and checks for null returns?
But we'll add the info to the docs too. Just don't know when yet.
from dotnet-api-docs.
IIRC ReSharper has a way to decorate stuff inside assemblies for which you don't build from sources, these attributes then are read and used at analysis time. So they can add stuff to indicate that specific things never return null, etc. I don't have any idea about what they used as a start point but by now they have accumulated a good deal of knowledge about this type of issue.
from dotnet-api-docs.
Related Issues (20)
- Documentation on tooltip timings doesn't specify the unit HOT 2
- Assigning things into Data throws if the key or value isn't Serializable. this should be documented. HOT 1
- Inaccurate/incomplete documentation of some Convert.ToString functions HOT 1
- Same example HOT 3
- IConfigurationBuilder.Add(IConfigurationSource) HOT 2
- System.IO.Directory.GetFiles(string, string, EnumerationOptions) - parameter description incorrect HOT 2
- The IEqualityComparer<T> does not used in List<T>.Sort HOT 1
- JsonNode.DeepEquals仅在.net8及以上支持,但文档中显示所有版本均支持 HOT 1
- Document Tracing/Activity sampling HOT 5
- Replace use of String.Copy in code examples
- أوتاز HOT 1
- BitMap.GetPixel Documentation HOT 2
- StructLayoutAttribute.Pack Field should give an example of nested packing HOT 3
- Update API ref for .NET 9 Preview 6 HOT 1
- Update API ref for .NET 9 Preview 7 HOT 1
- Update API ref for .NET 9 RC 1 HOT 1
- Update API ref for .NET 9 RC 2 HOT 1
- Update API ref for .NET 9 GA HOT 1
- An example !!!!!!!!!!!!!!!!!!!!!!!!!!!! HOT 2
- Add security-related documentation to AssemblyBuilder and PersistedAssemblyBuilder
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dotnet-api-docs.