Commit f93aea7
Enable 'dot-shorthands' feature flag for Dart 3.10
This CL enables the dot shorthand feature by default in Dart 3.10.
Dot shorthands allow you to omit the type name when accessing a static member in a context where that type is expected.
These are some examples of ways you can use dot shorthands:
```dart
Color color = .blue;
switch (color) {
case .blue:
print('blue');
case .red:
print('red');
case .green:
print('green');
}
```
```dart
Column(
crossAxisAlignment: .start,
mainAxisSize: .min,
children: widgets,
)
```
To learn more about the feature, check out the feature specification located here: https://github.com/dart-lang/language/blob/main/working/3616%20-%20enum%20value%20shorthand/proposal-simple-lrhn.md
Tested: Feature tested with language tests and unit tests for the frontends, VM, web.
Bug: #57036
Fixes: #57037
Change-Id: I4e2cab29e33ed266603942eaebf3f9671ef60766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427802
Reviewed-by: Bob Nystrom <[email protected]>
Reviewed-by: Paul Berry <[email protected]>
Reviewed-by: Michael Thomsen <[email protected]>
Commit-Queue: Kallen Tu <[email protected]>
Reviewed-by: Ben Konyi <[email protected]>1 parent 58b2ecb commit f93aea7
File tree
23 files changed
+260
-54
lines changed- pkg
- analyzer_testing/lib/experiments
- analyzer
- lib/src/dart/analysis
- test
- generated
- src/dart/analysis
- front_end
- lib/src/api_prototype
- testcases
- constructor_tearoffs
- dot_shorthands
- runtime/vm
- tests/language
- dot_shorthands
- tools
23 files changed
+260
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
5 | 45 | | |
6 | 46 | | |
7 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
| 272 | + | |
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
| 651 | + | |
652 | 652 | | |
653 | 653 | | |
654 | 654 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | | - | |
488 | | - | |
489 | | - | |
490 | | - | |
| 486 | + | |
491 | 487 | | |
492 | 488 | | |
493 | 489 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| 406 | + | |
406 | 407 | | |
407 | 408 | | |
408 | 409 | | |
| |||
484 | 485 | | |
485 | 486 | | |
486 | 487 | | |
| 488 | + | |
487 | 489 | | |
488 | 490 | | |
489 | 491 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
| 121 | + | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
| |||
Lines changed: 0 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | 5 | | |
11 | 6 | | |
12 | 7 | | |
| |||
0 commit comments