Azure / Azure/typespec-azure

Diagnostic for `alternateType`'s original type has `usage` or `access` decorator.

Open
#3,974 4 comments 0 reactions 1 assignee Claimed by @tadelesh View on GitHub
bug lib:tcgc
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 21h
Merged PRs (30d)
164

Description

### Describe the bug

If a type becomes unreferenced via `@@alternateType` then tcgc prunes it from the list of models. This makes sense and is ok. However, we can't use `@@access` and `@@usage` decorators to bring it back (see repro in playground).

### Reproduction

https://azure.github.io/typespec-azure/playground/?e=%40azure-tools%2Ftypespec-client-generator-core&c=aW1wb3J0ICJAYXp1cmUtdG9vbHMvdHlwZXNwZWMtY2xpZW50LWdlbmVyYXRvci1jb3JlIjsNCt43xhXRLMggL2h0dHDEGg0KdXNpbmcgQcQwLkPFbUfIbC5Db3JlO88jxhMNCkBzZXJ2aWNlKCN7DQogIHRpdGxlOiAiZXhhbXBsZSIsDQp9KQ0KbmFtZXNwYWNlIE1pc2NUZXN0c8U%2BbW9kZWwgU2VudE1lc3NhZ2UgxUbELzogc3RyaW5nOw0KfcorTGlzdE9myzFzxjJ3aWRnZXRzOiBBcnJheTzLIT7IQW9wIHNlbmTHFyhtc2c6zHopOtNd5gDjQGFsdGVybmF0ZVR5cGUo6QDDLtIxLOoA4S7MXcVJLy8gdGhlc2UgZG9uJ3QgcHJl5AE9ZdN4xXVjY2Vzc99uQcUlLmlu5QChbMRoQEB1xB3fOVXECC5vdXRwdXTENg%3D%3D&options=%7B%7D&vs=%7B%7D

### Checklist

- [x] Follow our [Code of Conduct](https://github.com/azure/typespec-azure/blob/main/CODE_OF_CONDUCT.md)
- [x] 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](https://github.com/Microsoft/TypeSpec/issues/new/choose)
- [x] Check that there isn't already an issue that request the same bug to avoid creating a duplicate.
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) of the bug.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.