chore: fix build failure issue when using c# 14 extension members #10943
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR add limited support for C# 14 Extension members syntax.
Currently it throw exception when some C# features are used.
By this PR it can use C# 14 syntax without error.
What's changed in this PR
TypeKind.Extensionenum value.Extension Memberssymbol as temporary workaround for issue described below.samples/csharp/srcdirectory.Background
When using C# extension members
INamedTypeSymbolis generated per extension blocks.And following property is exposed.
ExtensionGroupingName// e.g.<G>$8B58B811E742D8E9EA7E14F878F87B0FExtensionMarkerName// e.g.<M>$2C37A6F24442AF359D03A7723186221CExtensionParameter: //IParameterSymbolthat specified at extension block.These names are used for DocumentationCommentId also.
And it contains
<,>chars so need to be escape when output YAML files.Limitation
extension blocksare not shown onstatic classextensions.