Skip to content

[http-client-csharp] How do we deal with the case when type name collides with namespace #5471

@ArcturusZhang

Description

@ArcturusZhang

Once we enable the tsp namespace feature, we get tons of occurrence of this case:
one of the segment of the namespace collides with one of the existing type name, such as in cadl-ranch case http/client/naming, we have a type Client.Naming.UnionEnum.ClientExtensibleEnum and another client Client.Naming.UnionEnum
Here is a case that one namespace segment collides with a type's name. Spec here: Azure/typespec-azure@111e0b9/packages/azure-http-specs/specs/client/naming/main.tsp#L197

We get this before - but when this happens before, we rename the namespace, see this cadl ranch project:


in this case, the namespace segment collides with BCL type names, therefore we renamed them.

Now the new change uncovers more occurrence of this issue, we need to find a solution to avoid the generated code to fail to compile.

Metadata

Metadata

Assignees

Labels

emitter:client:csharpIssue for the C# client emitter: @typespec/http-client-csharp

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions