dart-lang / dart-lang/language

Record named field shorthand

Open
#3,245 0 comments 12 reactions 0 assignees View on GitHub
feature records
Dominant language
TeX
Stars
2.9k
Forks
239
Avg merge
2d 18h
Merged PRs (30d)
14

Description

This is a simple feature. Since we have pattern matching and destructuring of records, I propose that we have a shorthand for adding named fields to record literals in the case of declared identifiers. For example:

```dart
int x = 3;
int get y => 4;

print((:x, :y)); // (x: 3, y: 4)
```

Contributor guide

Open the contributing guide

Research direction

No files, tests, or implementation entry points are named. Start by reviewing the proposed syntax alongside Dart's existing record pattern-matching and destructuring behavior; done means the shorthand's syntax and semantics are fully designed and the required implementation work is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.