f93aea7c54
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: https://github.com/dart-lang/sdk/issues/57036
Fixes: https://github.com/dart-lang/sdk/issues/57037
Change-Id: I4e2cab29e33ed266603942eaebf3f9671ef60766
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/427802
Reviewed-by: Bob Nystrom <rnystrom@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Michael Thomsen <mit@google.com>
Commit-Queue: Kallen Tu <kallentu@google.com>
Reviewed-by: Ben Konyi <bkonyi@google.com>
23 lines
919 B
Dart
23 lines
919 B
Dart
// Copyright (c) 2024, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'package:analyzer/dart/analysis/features.dart';
|
|
|
|
/// A list of the experiments that are to be enabled for tests.
|
|
///
|
|
/// The list will be empty if there are no experiments that should be enabled.
|
|
///
|
|
/// Experiments should be added to this list when work on a new experiment
|
|
/// begins. Experiments should be removed from this list when they are marked
|
|
/// as being enabled by default.
|
|
///
|
|
/// The flags in the list are kept in alphabetic order for ease of determining
|
|
/// whether a given flag is already included.
|
|
List<String> experimentsForTests = [
|
|
Feature.augmentations.enableString,
|
|
Feature.enhanced_parts.enableString,
|
|
Feature.macros.enableString,
|
|
Feature.variance.enableString,
|
|
];
|