Migrate a ??= getter to a late final field (#1646)
This field was initialized lazily manually because it needs to refer
to other fields on `this`. Using a `late final` field with an
initializing expression is a more terse way to express this than an
additional private field.
diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md
index ea27e9d..f4ce9d5 100644
--- a/pkgs/test_core/CHANGELOG.md
+++ b/pkgs/test_core/CHANGELOG.md
@@ -1,3 +1,5 @@
+## 0.4.11-dev
+
## 0.4.10
* Update `analyzer` constraint to `>=2.14.0 <3.0.0`.
diff --git a/pkgs/test_core/lib/src/runner/suite.dart b/pkgs/test_core/lib/src/runner/suite.dart
index 196e069..4b0282f 100644
--- a/pkgs/test_core/lib/src/runner/suite.dart
+++ b/pkgs/test_core/lib/src/runner/suite.dart
@@ -125,15 +125,14 @@
final Metadata _metadata;
/// The set of tags that have been declared in any way in this configuration.
- Set<String> get knownTags => _knownTags ??= UnmodifiableSetView({
- ...includeTags.variables,
- ...excludeTags.variables,
- ..._metadata.tags,
- for (var selector in tags.keys) ...selector.variables,
- for (var configuration in tags.values) ...configuration.knownTags,
- for (var configuration in onPlatform.values) ...configuration.knownTags,
- });
- Set<String>? _knownTags;
+ late final Set<String> knownTags = UnmodifiableSetView({
+ ...includeTags.variables,
+ ...excludeTags.variables,
+ ..._metadata.tags,
+ for (var selector in tags.keys) ...selector.variables,
+ for (var configuration in tags.values) ...configuration.knownTags,
+ for (var configuration in onPlatform.values) ...configuration.knownTags,
+ });
/// Only run tests that originate from this line in a test file.
final int? line;
diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml
index b549d87..a94c4c2 100644
--- a/pkgs/test_core/pubspec.yaml
+++ b/pkgs/test_core/pubspec.yaml
@@ -1,5 +1,5 @@
name: test_core
-version: 0.4.10
+version: 0.4.11-dev
description: A basic library for writing tests and running them on the VM.
homepage: https://github.com/dart-lang/test/blob/master/pkgs/test_core