microsoft / microsoft/typespec
Add instantiate typekit
Open
compiler:core
design:needed
triaged:core
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Use case #7469 and https://github.com/microsoft/typespec/discussions/9729
There is a few ways we could consider this.
```ts
// 1. Evaluate expr
$.type.instantiate("Array")
// 2. Pass args manually
$.type.instantiate($.type.resolve("Array"), [$.type.resolve("Foo")])
```
2. Is probably needed for more control but it is also right now blocked as `$.type.resolve("TemplateDecl")` won't resolve it, need a flag to allow resolving the declaration
Contributor guide
Assessment
This issue has not been assessed yet.