PublicApiExtensionBlock Class
A C# 14 extension block (e.g. extension<T>(List<T> list) { ... }) declared in a static class.
public sealed class PublicApiExtensionBlockRemarks
The compiler emits each extension member twice: an implementation method on the static class, which is listed in PublicApiType.Members, and a member of an unspeakable grouping type that keeps the declaration as written in source. PublicApiExtensionBlock.Members contains the members as written in source. Use PublicApiMethod.ExtensionImplementation and PublicApiMethod.ImplementedExtensionMember to go from one to the other.
Properties
| Name | Description |
|---|---|
| DeclaringType | Gets the static class that declares the extension block. |
| GenericParameters | Gets the type parameters of the block (e.g. T in extension<T>(List<T> list)). |
| GroupingTypeMetadataName | Gets the metadata name of the compiler-generated grouping type (e.g. <G>$8048A6C8BE30A622530249B904B537EB). It is part of the documentation IDs of the PublicApiExtensionBlock.Members. Blocks with the same receiver type share it. |
| MarkerTypeMetadataName | Gets the metadata name of the compiler-generated marker type (e.g. <M>$C43E2675C7BBF9284AF22FB8A9BF0280), which identifies the block in its grouping type. |
| Members | Gets the members of the block, as written in source. Instance members have no receiver parameter and static members are PublicApiMember.IsStatic. |
| Receiver | Gets the receiver parameter. Its PublicApiParameter.Name is null or empty when the block only declares static members (e.g. extension(string)). |
DeclaringType
PublicApiExtensionBlock.csGets the static class that declares the extension block.
public PublicApiType DeclaringType { get; }Property value
GenericParameters
PublicApiExtensionBlock.csGets the type parameters of the block (e.g. T in extension<T>(List<T> list)).
public ImmutableArray<PublicApiGenericParameter> GenericParameters { get; }Property value
GroupingTypeMetadataName
PublicApiExtensionBlock.csGets the metadata name of the compiler-generated grouping type (e.g. <G>$8048A6C8BE30A622530249B904B537EB). It is part of the documentation IDs of the PublicApiExtensionBlock.Members. Blocks with the same receiver type share it.
public string GroupingTypeMetadataName { get; }Property value
MarkerTypeMetadataName
PublicApiExtensionBlock.csMembers
PublicApiExtensionBlock.csGets the members of the block, as written in source. Instance members have no receiver parameter and static members are PublicApiMember.IsStatic.
public ImmutableArray<PublicApiMember> Members { get; }Property value
Receiver
PublicApiExtensionBlock.csGets the receiver parameter. Its PublicApiParameter.Name is null or empty when the block only declares static members (e.g. extension(string)).
public PublicApiParameter Receiver { get; }Property value
Methods
| Name | Description |
|---|---|
| ToString() |