microsoft / microsoft/typespec
`declare` type and other type reorganization
Open
design:needed
- Dominant language
- Java
- Stars
- 5.9k
- Forks
- 394
- Avg merge
- 1d 23h
- Merged PRs (30d)
- 104
Description
Creating this issue to discuss the ability to give names to different anonymous types(tuples, arrays, etc.)
The tricky part about all of this is the potential breaking changes in either the spec or harder to dodge in the compiler api.
## Declare a type
We could imagine something like
```tsp
declare Point2d = [int32, int32];
declare IntArr = int32[]; // would replace model IntArr is int32[];
```
## Should Array be a Model
With this the other part is if array type should actually still be a ModelType. However changing this would most likely be a breaking change in the compiler api.
Contributor guide
Assessment
This issue has not been assessed yet.