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

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

Closed
4 tasks done
live1206 opened this issue Jul 1, 2024 · 1 comment · Fixed by #1119
Closed
4 tasks done

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

live1206 opened this issue Jul 1, 2024 · 1 comment · Fixed by #1119
Assignees
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Comments

@live1206
Copy link
Member

live1206 commented Jul 1, 2024

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

  • Follow our Code of Conduct
  • Check that this issue is about the Azure libraries for typespec. For bug in the typespec language or core libraries file it in the TypeSpec repo
  • Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.
@live1206 live1206 added bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library labels Jul 1, 2024
@live1206 live1206 self-assigned this Jul 1, 2024
@live1206
Copy link
Member Author

live1206 commented Jul 1, 2024

Since clienName 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.

live1206 added a commit that referenced this issue Jul 17, 2024
Resolves #1096

---------

Co-authored-by: Timothee Guerin <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:tcgc Issues for @azure-tools/typespec-client-generator-core library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant