Allow `T[]` as syntax sugar for `Array<T>`
Open
Nobody has claimed this yet.
✨ enhancement
📐 language-design
needs-discussion
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
Feature Spec
The syntax T[] can now be used anywhere Array<T> was used before:
let x: num[] = [1,2,3];
let len = (arr: str[]): num => { ... };
The optional version is T[]?
Use Cases
Reduce verbosity
Implementation Notes
No response
Component
No response
Community Notes
- Please vote by adding a 👍 reaction to the issue to help us prioritize.
- If you are interested to work on this issue, please leave a comment.
- If this issue is labeled needs-discussion, it means the spec has not been finalized yet. Please reach out on the #dev channel in the Wing Slack.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue defines the desired T[] and T[]? syntax and gives JavaScript-like examples, but names no files, tests, or entry points. Start by locating the parser and existing Array handling, then verify that the new forms work wherever Array was accepted, including optional arrays. Done means the syntax is accepted consistently and covered by tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100