Skip to content
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

Refactor MethodProvider #3756

Merged
merged 4 commits into from
Jul 9, 2024

Conversation

ArcturusZhang
Copy link
Member

@ArcturusZhang ArcturusZhang commented Jul 5, 2024

Fixes #3739

Previously, constructors and methods are both represented by MethodProvider, which is quite inconvenience in some cases that we want to get the ReturnType out from a method, we will have to cast the Signature to MethodSignature.
A new type ConstructorProvider is introduced in this PR to represent ctors only and now the Signature type is MethodSignature in MethodProvider which only represents the normal methods.

Considering that ctors and methods are similar, we may add a common base type to MethodProvider and ConstructorProvider, such as MethodBaseProvider just like how MethodSignature and ConstructorSignature do.
But currently I did not see any use case that requires to add ctors and methods into the same list, therefore this PR does not add that, and we could always add that part later.

@ArcturusZhang ArcturusZhang marked this pull request as ready for review July 5, 2024 06:42
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

Microsoft.Generator.CSharp

@m-nash m-nash enabled auto-merge July 9, 2024 19:36
@m-nash m-nash added this pull request to the merge queue Jul 9, 2024
Merged via the queue into microsoft:main with commit f5a9764 Jul 9, 2024
21 checks passed
@ArcturusZhang ArcturusZhang deleted the separate-method-and-ctor branch July 9, 2024 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor MethodProvider
3 participants