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

Allow augment decorator of uninstantiated templates with arguments #1774

Open
tjprescott opened this issue Mar 31, 2023 · 0 comments
Open

Allow augment decorator of uninstantiated templates with arguments #1774

tjprescott opened this issue Mar 31, 2023 · 0 comments
Labels
design:needed A design request has been raised that needs a proposal
Milestone

Comments

@tjprescott
Copy link
Member

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<string>, "blah")
Error @@decorator(Foo<T>, "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<T> {
  items: T[];
}

The equivalent augment of this would be
@@doc(Page<T>, "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.

@markcowl markcowl added this to the Backlog milestone Apr 4, 2023
@markcowl markcowl added design:needed A design request has been raised that needs a proposal 📌 labels Apr 4, 2023
@bterlson bterlson removed the 📌 label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design:needed A design request has been raised that needs a proposal
Projects
None yet
Development

No branches or pull requests

3 participants