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

Reconsider Foo<> means default instance #1831

Open
timotheeguerin opened this issue Apr 17, 2023 · 1 comment
Open

Reconsider Foo<> means default instance #1831

timotheeguerin opened this issue Apr 17, 2023 · 1 comment
Labels
design:needed A design request has been raised that needs a proposal
Milestone

Comments

@timotheeguerin
Copy link
Member

From design discussed here #1163. Creating a new issue as that design discussion had 2 part and 1st is still relevant. This is to rediscuss the 2nd part.

It was decided that given a template

model Template<T  = string> {
  x: T
}
  1. Template<> would reference the default instance (Template<string>)
  2. Template would reference the uninstantiated template

The thing is right now Template means the default instance already, so this change would not only be a breaking change but I think relatively confusing for spec writers.

https://cadlplayground.z22.web.core.windows.net/?c=bW9kZWwgTTxUID0gc3RyaW5nPiB7CiAgeDogVDsKfQoKYWxpYXMgTURlZmF1bHRJbnN0YW5jZSA9IE07CgrGPkTFMmQxOtEnLng7Cn0%3D

with this issue #1774 also now on the table I think we might want to reconsider the augment decorator scenario which is as far as I can tell the only place where we want to reference the uninstantiated template

@nguerrera
Copy link
Contributor

We seem to be very confused about what Template means:

Animation

Notice that the alias is unused but somehow has an impact on things.

I think that I initially said on #1774 that Template was uninstantiated because I did a quick test like above without the alias.

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

4 participants