winglang / winglang/wing

Allow `T[]` as syntax sugar for `Array<T>`

Open
#4,530 3 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.