From 5ccd5818e0f89b445bf093b5fd178b88036cd5a7 Mon Sep 17 00:00:00 2001 From: Robert Nystrom Date: Wed, 27 May 2026 16:17:46 -0700 Subject: [PATCH] Migrate pkg/expect to the new constructor syntax. Change-Id: I872868b7f9dea21889aeac00a92eef0b03849354 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/506603 Auto-Submit: Bob Nystrom Commit-Queue: Bob Nystrom Reviewed-by: Paul Berry --- pkg/expect/analysis_options.yaml | 2 ++ pkg/expect/lib/expect.dart | 2 +- pkg/expect/lib/legacy/minitest.dart | 2 +- pkg/expect/pubspec.yaml | 2 +- pkg/expect/test/identical_distinct_test.dart | 2 +- 5 files changed, 6 insertions(+), 4 deletions(-) diff --git a/pkg/expect/analysis_options.yaml b/pkg/expect/analysis_options.yaml index 830fa83c359..12752954da8 100644 --- a/pkg/expect/analysis_options.yaml +++ b/pkg/expect/analysis_options.yaml @@ -7,3 +7,5 @@ analyzer: linter: rules: - lines_longer_than_80_chars + - unnecessary_const_in_enum_constructor + - unnecessary_type_name_in_constructor diff --git a/pkg/expect/lib/expect.dart b/pkg/expect/lib/expect.dart index b7792f818b0..db5dac96752 100644 --- a/pkg/expect/lib/expect.dart +++ b/pkg/expect/lib/expect.dart @@ -913,7 +913,7 @@ class ExpectException { final String message; final String name; - ExpectException(this.message) : name = _getTestName(); + new(this.message) : name = _getTestName(); @override String toString() { diff --git a/pkg/expect/lib/legacy/minitest.dart b/pkg/expect/lib/legacy/minitest.dart index 45ac4de87f5..7b21be0b402 100644 --- a/pkg/expect/lib/legacy/minitest.dart +++ b/pkg/expect/lib/legacy/minitest.dart @@ -208,5 +208,5 @@ class _Group { class _Expectation { final _ExpectationFunction function; - _Expectation(this.function); + new(this.function); } diff --git a/pkg/expect/pubspec.yaml b/pkg/expect/pubspec.yaml index 28d73d5e8ce..5c0a01f6669 100644 --- a/pkg/expect/pubspec.yaml +++ b/pkg/expect/pubspec.yaml @@ -10,7 +10,7 @@ description: >- publish_to: none environment: - sdk: '^3.12.0-0' + sdk: '^3.13.0-0' resolution: workspace diff --git a/pkg/expect/test/identical_distinct_test.dart b/pkg/expect/test/identical_distinct_test.dart index 9fa55bb363a..a794e144230 100644 --- a/pkg/expect/test/identical_distinct_test.dart +++ b/pkg/expect/test/identical_distinct_test.dart @@ -87,7 +87,7 @@ void main() { class C { final Object x; - const C(this.x); + const new(this.x); @override int get hashCode => x.hashCode; @override