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

c#, fix: fix type conflicts #4244

Merged
merged 9 commits into from
Aug 12, 2024
Merged

Conversation

dcb6
Copy link
Contributor

@dcb6 dcb6 commented Aug 9, 2024

Motivation

In one of our generated SDKs, we saw a Task generated type conflict with the Sytem.Threading.Tasks Task that is used as an async method return type, leading to compile breaks.

Solution

To check for potential conflicts, we now collect every generated type ClassReference and compare to a ClassReference that we are about to write. If there are any other ClassReferences with the same name as the one we're about to write, we fully qualify the type inline (rather than adding the import) to disambiguate.

_client = client;
}

public async System.Threading.Tasks.Task HelloAsync(RequestOptions? options = null)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here is example of fix that will be applied directly merge

@dcb6 dcb6 marked this pull request as ready for review August 12, 2024 16:51
@dcb6 dcb6 requested a review from dsinghvi as a code owner August 12, 2024 16:51
@dcb6 dcb6 enabled auto-merge (squash) August 12, 2024 18:12
@dcb6 dcb6 disabled auto-merge August 12, 2024 18:12
@dcb6 dcb6 enabled auto-merge (squash) August 12, 2024 18:13
@dcb6 dcb6 disabled auto-merge August 12, 2024 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants