Revisit `as "id"` syntax / "as" keyword is confusing
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 20/100
- Issue type
- Feature
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- typescript
- Domain
- compilers
Research direction
No files, tests, or entry points are named in the issue. First resolve whether the identifier syntax should use is or an initializer id parameter, then identify the compiler and preflight-class tests that define the current as "id" behavior.
Written by the indexing model from the issue text.
Description
We want to use as for casting, so let's revisit the way we specify an identifier for preflight objects.
One option is to replace the current usage with is:
new Bucket() is "myBucket";
new Bucket() is "yourBucket";
Another alternative is to add a synthetic keyword optional parameter called id to every preflight class initializer and plug it in:
new cloud.Bucket(); // defaults to "cloud.Bucket"
new cloud.Bucket(id: "my-bucket");
See below for some discussion.
Thoughts?
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
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.
More from winglang/wing
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
-
🐛 bug
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
🐛 bug
Difficulty 4/5 3-5 days Newbie friendliness 25/100
-
🐛 bug
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 76/100
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
vercel/react-tweet#225 ·