-
Notifications
You must be signed in to change notification settings - Fork 5k
[Azure Mgmt Generator] Investigate :C format specifier for cref generation with generic type error reproduction #51869
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use the format specifier
:C
to generate crefs.We could use
:C
when the argument is a System.Type or CSharpType.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I attempted to implement the
:C
format specifier as requested, but encountered an issue with generic types. When using{enclosingType.Type:C}
, the generator crashes for generic types likeMgmtTypeSpecArmOperation<T>
with the error "TypeProvider doesn't support generics" atCSharpType.GetGenericTypeDefinition()
.Could you clarify how to handle generic types with the
:C
format specifier? Should we::C
with generic types?:C
only for non-generic types?I've reverted to the manual approach for now to maintain functionality while waiting for guidance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot could you do it any way so that I could see the error message and find if there is a workaround of it?
If there is a bug on this API, then we could first put aside the topic of other ctors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented the
:C
format specifier as requested (commit e1d17fb). The error with generic types is now reproduced:The issue occurs when the
:C
formatter callsAppendTypeForCRef
which then callsGetGenericTypeDefinition()
on generic types likeMgmtTypeSpecArmOperation<T>
. This method is not supported for generics.