Azure / typespec-azure

About TypeSpec Azure Libraries
https://azure.github.io/typespec-azure/
MIT License
8 stars 28 forks source link

[Bug][TCGC]: No compilation error on naming conflicts with clientName decorator #1096

Open live1206 opened 4 days ago

live1206 commented 4 days ago

Describe the bug

When a model is renamed to a name conflicting with existing model, TCGC should throw compilation error

Reproduction

Playground From the type graph, we can see TCGC only appends the clientName information for csharp, although it is conflicting with an exsiting model image

Checklist

live1206 commented 4 days ago

Since [clienName](https://github.com/Azure/typespec-azure/blob/54567f763257300e64603091659d282072631d2a/packages/typespec-client-generator-core/src/decorators.ts#L959-L964) can be applied for language scope and type. The name should be unique per language scope.

The naming validation should be after all clientName decorators applied, so that we have the overall naming map in place.