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

[http-client-csharp] rename UnionTypes in TypeFactory to UnionVariantTypes? #5673

Open
ArcturusZhang opened this issue Jan 21, 2025 · 2 comments
Assignees
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@ArcturusZhang
Copy link
Member

ArcturusZhang commented Jan 21, 2025

We have a HashSet<string> UnionTypes in TypeFactory tracking the names of all existing union variant types.

Shall we rename it to UnionVariantTypes to avoid confusion?

@ArcturusZhang ArcturusZhang added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Jan 21, 2025
@ArcturusZhang ArcturusZhang changed the title [http-client-csharp] UnionTypes in TypeFactory makes no sense [http-client-csharp] rename UnionTypes in TypeFactory to UnionVariantTypes? Jan 21, 2025
@JoshLove-msft
Copy link
Contributor

@ArcturusZhang can you clarify what the confusion would be? The naming matches the public InputUnionType.

@JoshLove-msft JoshLove-msft self-assigned this Feb 11, 2025
@ArcturusZhang
Copy link
Member Author

@ArcturusZhang can you clarify what the confusion would be? The naming matches the public InputUnionType.

First I thought this set is tracking the union types themselves. But actually this is tracking those variants.
For instance, we have a union A | B, the set should contain type A and type B, but not the union itself A | B.

I think this is here to make sure we would keep these variants in post processor - otherwise they would be trimmed off.
But I think these variants should have usages in the xml doc, would roslyn ignore these usages and we have to track them by ourselves?
Also this might be problematic because we did not ensure the model that encloses the union type has not been removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

2 participants