microsoft / microsoft/typespec
Support for `model Foo<T> extends/is T`
Open
design:needed
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
I would expect this to work, and allows for some useful patterns like:
```
@blue model AsBlue is T;
model Test {
blueString: AsBlue
}
```
This really drives home the need for errors which highlight on one place (e.g. an instantiation like AsBlue) but whose elaboration includes additional details (e.g. template uses T in an extends, but the thing you passed can't be a base model). Presumably such machinery would be useful elsewhere, e.g. when a particular interface mixes ends up violating some constraint inside the abstraction.
Contributor guide
Assessment
This issue has not been assessed yet.