microsoft / microsoft/typespec
Allow augment decorator of uninstantiated templates with arguments
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
PR #1744 fixed an issue where one could target template instantiations with illogical results. The fix implemented in the PR implemented the following logic:
**Error** `@@decorator(Foo, "blah")`
**Error** `@@decorator(Foo, "blah")`
**Okay** `@@decorator(Foo, "blah") // the template args left off`
The problem with this is the following scenario:
```
@doc("Page of {T}", T)
model Page {
items: T[];
}
```
The equivalent augment of this would be
`@@doc(Page, "Page of {T}", T)`
Unfortunately, due to #1744 this will yield an error.
The fix will likely require redesign of internals because it was discovered while implementing #1744 that somehow the TypeSpec cannot understand that `T` is different in this context than `string`.
Contributor guide
Assessment
This issue has not been assessed yet.