I've just had a look at the ArraySegment
class in .NET Core (...\microsoft.netcore.app\2.0.0\ref\netcoreapp2.0\System.Runtime.dll
).
Every method\property just has throw null
in it:
public T[] Array
{
get
{
throw null;
}
}
What's this for? How does it work?
You're looking at the reference assemblies. That's not the real implementation - it's just a placeholder to compile against, effectively.
You'll see the assembly only has the public/protected members, and every code-based member (property, constructor, method etc) is implemented like this.
The point is to create an assembly which is as small as it can be, but which the compiler can use as a reference. At execution time, the real code is present instead.
See more on this question at Stackoverflow