Skip to content

Commit d6889ba

Browse files
stereotype441dart-scoped@luci-project-accounts.iam.gserviceaccount.com
authored andcommitted
Migrate pkg/build_integration to new constructor decl syntax.
(Part of #63288) This change migrates `pkg/build_integration` to use the new constructor declaration syntax, described in https://github.com/dart-lang/language/blob/main/accepted/future-releases/primary-constructors/feature-specification.md#abbreviations-of-in-body-constructor-declarations. This change was performed in an automated fashion, by (a) bumping the packages' SDK constraints to `3.13.0-0`, (b) enabling the lints `unnecessary_type_name_in_constructor` and `unnecessary_const_in_enum_constructor`, (c) fixing the resulting lint failures using `dart fix`, and then (d) reformatting the affected files. To ease code review, I've reverted unrelated formatting changes. Since this change requires bumping SDK constaints to `3.13.0-0`, it was only performed on packages that are *not* published on pub. (Packages that *are* published on pub should remain on lower language versions until at least after the stable version of 3.13 is released, so that we don't block users on the stable channel from receiving updates to those packages.) Change-Id: Ifb2c4ca31f14c3e94f7b756969e730bf6a6a6964 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506023 Reviewed-by: Nate Bosch <nbosch@google.com> Commit-Queue: Paul Berry <paulberry@google.com>
1 parent f6cfbde commit d6889ba

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
linter:
2+
rules:
3+
- unnecessary_type_name_in_constructor
4+
- unnecessary_const_in_enum_constructor
15
include: package:lints/recommended.yaml

pkg/build_integration/lib/file_system/multi_root.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class MultiRootFileSystem implements FileSystem {
3636
final List<Uri> roots;
3737
final FileSystem original;
3838

39-
MultiRootFileSystem(this.markerScheme, List<Uri> roots, this.original)
39+
new(this.markerScheme, List<Uri> roots, this.original)
4040
: roots = roots.map(_normalize).toList();
4141

4242
@override
@@ -74,7 +74,7 @@ class MultiRootFileSystemEntity implements FileSystemEntity {
7474
return multiRootFileSystem.original.entityForUri(uri);
7575
}
7676

77-
MultiRootFileSystemEntity(this.multiRootFileSystem, this.uri);
77+
new(this.multiRootFileSystem, this.uri);
7878

7979
@override
8080
Future<bool> exists() async => (await delegate).exists();
@@ -98,7 +98,7 @@ class MissingFileSystemEntity implements FileSystemEntity {
9898
@override
9999
final Uri uri;
100100

101-
MissingFileSystemEntity(this.uri);
101+
new(this.uri);
102102

103103
@override
104104
Future<bool> exists() => Future.value(false);

pkg/build_integration/lib/file_system/single_root.dart

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ class SingleRootFileSystem implements FileSystem {
3131
final Uri root;
3232
final FileSystem original;
3333

34-
SingleRootFileSystem(this.markerScheme, Uri root, this.original)
35-
: root = _normalize(root);
34+
new(this.markerScheme, Uri root, this.original) : root = _normalize(root);
3635

3736
@override
3837
FileSystemEntity entityForUri(Uri uri) {
@@ -65,7 +64,7 @@ class SingleRootFileSystemEntity implements FileSystemEntity {
6564
final Uri uri;
6665
final FileSystemEntity delegate;
6766

68-
SingleRootFileSystemEntity(this.uri, this.delegate);
67+
new(this.uri, this.delegate);
6968

7069
@override
7170
Future<bool> exists() async => delegate.exists();

pkg/build_integration/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: >
66
publish_to: none
77

88
environment:
9-
sdk: '^3.12.0-0'
9+
sdk: '^3.13.0-0'
1010

1111
resolution: workspace
1212

0 commit comments

Comments
 (0)