Skip to content

Commit

Permalink
Merge branch 'main' into tcgc/forbid-polymorphism-flatten
Browse files Browse the repository at this point in the history
  • Loading branch information
Mingzhe Huang (from Dev Box) committed Jul 23, 2024
2 parents a037487 + 0739f7e commit d0c63ec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 42 deletions.
7 changes: 0 additions & 7 deletions .chronus/changes/operation-validation-2024-6-19-18-35-46.md

This file was deleted.

7 changes: 7 additions & 0 deletions .chronus/changes/revert-fix-2024-6-23-10-47-25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
changeKind: internal
packages:
- "@azure-tools/typespec-client-generator-core"
---

Revert "fix @clientName validation for operation within interface"
5 changes: 0 additions & 5 deletions packages/typespec-client-generator-core/src/validate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ function validateClientNamesPerNamespace(
// Check for duplicate client names for operations
validateClientNamesCore(tcgcContext, scope, namespace.operations.values());

// check for duplicate client names for operations in interfaces
for (const item of namespace.interfaces.values()) {
validateClientNamesCore(tcgcContext, scope, item.operations.values());
}

// Check for duplicate client names for interfaces
validateClientNamesCore(tcgcContext, scope, namespace.interfaces.values());

Expand Down
30 changes: 0 additions & 30 deletions packages/typespec-client-generator-core/test/decorators.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2864,36 +2864,6 @@ describe("typespec-client-generator-core: decorators", () => {
]);
});

it("duplicate operation in interface with all language scopes", async () => {
const diagnostics = await runner.diagnose(
`
@service
namespace Contoso.WidgetManager;
interface C {
@clientName("b")
@route("/a")
op a(): void;
@route("/b")
op b(): void;
}
`
);

expectDiagnostics(diagnostics, [
{
code: "@azure-tools/typespec-client-generator-core/duplicate-client-name",
message: 'Client name: "b" is duplicated in language scope: "AllScopes"',
},
{
code: "@azure-tools/typespec-client-generator-core/duplicate-client-name",
message:
'Client name: "b" is defined somewhere causing nameing conflicts in language scope: "AllScopes"',
},
]);
});

it("duplicate scalar with all language scopes", async () => {
const diagnostics = await runner.diagnose(
`
Expand Down

0 comments on commit d0c63ec

Please sign in to comment.